1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 00:05:33 +03:00
Commit graph

54 commits

Author SHA1 Message Date
mikeller
6b87b3685c Remove unneeded library function 'powerf()'. 2021-04-26 16:50:54 +12:00
KarateBrot
d02af7334c Added tracking of multiple dynamic notches per axis and replaced FFT with SDFT 2021-03-24 17:09:28 +01:00
Dominic Clifton
980df1536f Refactored arbitrary gyro and mag alignment.
The original implementation:

* removed the old 'alignment' variable
* did not require 'ALIGN_CUSTOM'
* always used rotation matrix
* had no additional per-pid-loop conditional logic.

Extract currently unused code into tests.
In preparation for either deleting or re-using in validateAndFixConfig.

Fix code style of some old boardalignment code.

De-duplicate vector rotation code.

Now that rotation code is exacted from `alignBoard` and now  doesn't use
`boardRotation` some if it was similar to the code in `rotateV` in
maths.c

Use DECIDEGREES for mag and gyro/acc custom alignments.

Use unnamed structure instead of `values`.

Redefine what 'custom' orientation means.

Move alignment test-only code into the tests.

Ensure gyro/mag custom alignment settings follow the enum variations.

This can't be applied to ALIGN_DEFAULT because, in the case of the MAG,
the default isn't actually known until the gyro is detected, see
`compassDetect`.

OMNIBUSF4/F7 - Don't use ALIGN_DEFAULT in target.h,
common_defaults_post.h does this now.

Comment cleanup.

Delete unused alignment code left from various tests/refactoring
efforts.

* Please do not squash this commit.

Fix SITL build by avoiding structure assignment with anonymous inner
struct.

The error from the build server was as follows:

```./src/main/common/sensor_alignment.c:49:5: error: missing initializer
for field ‘yaw’ of ‘struct <anonymous>’
[-Werror=missing-field-initializers]
     *sensorAlignment = CUSTOM_ALIGN_CW0_DEG;
     ^
In file included from ./src/main/common/sensor_alignment.c:27:0:
./src/main/common/sensor_alignment.h:80:17: note: ‘yaw’ declared here
         int16_t yaw;
                 ^
```

Cleanup sensor_alignment API.
2019-07-13 11:51:20 +12:00
Hans Christian Olaussen
f625cb261c Define HZ_TO_INTERVAL macro 2019-02-12 22:34:15 +01:00
jirif
0111949c63 Define macro HZ_TO_INTERVAL_US() and remove unneeded comments 2018-07-27 20:59:19 +02:00
Bruce Luckcuck
9b49d481e3 Fix setpoint rate sign, optimize code, cleanup from review
Also adds a `scaleRangef()` function to math.c
2018-06-27 19:27:22 -04:00
Michael Keller
c6a5ab9b96
Merge pull request #6096 from AirBreak69/GPS_handle_negative_altitude_and_safer_maths_macros
GPS: handle negative and high altitudes; safer macros in maths.h
2018-06-20 01:01:02 +12:00
mikeller
f412e17e89 More USB include woes. 2018-06-17 17:54:18 +12:00
AirBreak69
0cabe7e70c Removed additional /* on top of block comment 2018-06-12 00:18:13 +02:00
AirBreak69
536ad399e6 GPS: handle negative and high altitudes; safer macros in maths.h
Fixes underflows at negative altitude (below MSL) and overflows at altitude higher than 655.35m
Corrected parenthesis in maths.h avoid incorrect equations if arguments contain expressions.
2018-06-12 00:02:29 +02:00
mikeller
d43c178488 Fixes from review. 2018-06-09 13:22:36 +12:00
Michael Keller
f0ea0e81d4
Merge pull request #5765 from etracer65/gps_speed_units
Fix GPS speed and max speed to respect the units selection
2018-05-04 21:11:49 +12:00
blckmn
a9f74cd6df Removed excess trailing spaces before new lines on licenses. 2018-04-25 20:58:00 +10:00
Bruce Luckcuck
8c24176d96 Fix GPS speed and max speed to respect the units selection
Previously GPS speed and max speed would always display in KPH even if the user chose imperial units.  Now they will display in MPH for imperial units.
2018-04-24 16:41:45 -04:00
blckmn
46fe22b4bd Direct license replacement 2018-04-22 09:22:46 +10:00
Petr Ledvina
c11d016bc7 optimize math (#5287)
* optimize math

Results in considerable flash saving

* log_approx, exp_approx, pow_approx

Taken from https://github.com/jhjourdan/SIMD-math-prims/blob/master/simd_math_prims.h

* Fix pow in rangefinder

* Use approximate function in baro calculation

Maximum error is < 20cm

* fixup! Fix pow in rangefinder
2018-03-04 01:26:33 +13:00
fishpepper
a74979ff72 fix dangerous MIN/MAX/ABS definitions 2017-08-15 21:07:14 +02:00
Martin Budden
4ba8669cc3 Additional crc functions 2017-08-13 12:02:46 +01:00
Martin Budden
50ac13d79b Minor blackbox code tidy 2017-05-02 07:13:55 +01:00
Michael Keller
edc44bd830 Made 'scaleRange' agnostic to order of ranges. 2017-04-07 18:39:57 +12:00
Hydra
636c194aea CF/BF - OSD - Show symbol for GPS speed to better align with altitude
display on OSD.  Name and extract the duplicated GPS_speed equation - in
CM/S to KM/H.
2017-03-19 10:36:22 +00:00
Martin Budden
a77e424dec Use CRC rather than simple checksum for EEPROM (#2517)
Use CRC rather than simple checksum for EEPROM
2017-03-08 17:50:45 +00:00
Martin Budden
f6c8319361 Removed a number of static config pointers 2017-02-02 10:41:19 +00:00
Martin Budden
9e2fd0e51c Replaced use of power function 2016-12-17 08:25:07 +00:00
Martin Budden
c2a896c6f3 Added missing function declaration 2016-10-19 08:37:36 +01:00
Martin Budden
551bbe1d1a Initial commit of SPI receiver code. 2016-10-02 08:45:42 +01:00
Martin Budden
9889b1db9c Move master_t required #includes into config_master.h 2016-10-01 14:10:09 +01:00
borisbstyle
3f6860b83b Fix error in rc expo calculation // add configurable expo power 2016-09-02 22:10:01 +02:00
JOhn Aughey
8310c6f050 Moving constrain to the include file and making it static inline 2016-05-03 17:44:49 -05:00
borisbstyle
5ffb3b5068 Revert "Merge pull request #372 from aughey/betaflight"
This reverts commit a6a5f50ffb, reversing
changes made to 9cc5503851.
2016-05-04 00:00:04 +02:00
JOhn Aughey
b6ff69feda Moving constrain and constrainf to the include file to be inlined. 2016-05-02 10:03:43 -05:00
borisbstyle
257865cff2 Simplify Fixed point Math notations 2016-03-03 16:17:10 +01:00
borisbstyle
7fd88f060d Fixed point math Implementation instead of floats 2016-02-19 01:03:24 +01:00
Konstantin Sharlaimov (DigitalEntity)
e8917b7a28 Quick median filter for floats 2015-12-24 10:59:49 +01:00
borisbstyle
4b3ba927e9 Merge branch 'master' into betaflight
Conflicts:
	src/main/blackbox/blackbox_io.c
	src/main/drivers/serial_usb_vcp.c
	src/main/flight/imu.c
	src/main/mw.c
	src/main/target/CC3D/target.h
2015-10-12 23:53:43 +02:00
Petr Ledvina
8f3d9fae9a unify typedef struct name_s {} name_t; naming convention 2015-10-12 19:58:12 +01:00
Konstantin Sharlaimov (DigitalEntity)
45a4f11f92 Added #define for imu debug output (+16 squashed commit)
Squashed local commits:

from       : e4265d4a13f63f82d5cf55eea2c091622f96660b
up to (inc): 72416dc74745fa8bae1aded79aa4b9ed0e389076
2015-09-19 14:50:53 +02:00
Nicholas Sherlock
0c4604eeef Blackbox code size savings by factoring common loops out into fuctions 2015-07-31 15:53:22 +09:00
digitalentity
a3b57386c2 Ported fast trigonometry functions over from @Crashpilot1000 Harakiri code
Fixed maths_unittest.cc to correctly handle float-point numbers
2015-07-09 22:38:17 +10:00
Dominic Clifton
4fcecbd667 De-duplicate vector matrix calculation code.
Saves 248 bytes of flash space when using -O0.
2015-06-24 22:33:36 +01:00
digitalentity
6e041c57dd Added median filter implementation. Added 3-point median filter to generic barometer code. 2015-04-07 19:58:20 +01:00
Pierre Hugo
be03ed95fa Renamed min, max and abs macros to MIN MAX and ABS. 2015-01-23 22:40:00 -08:00
Pierre Hugo
29c5630957 Moved vectors, euler angles, rotation and normalization from imu to maths. 2015-01-21 19:42:06 -08:00
Pierre Hugo
6711c56dc5 Switched to explicitly using M_PI. 2015-01-21 19:20:19 -08:00
Pierre Hugo
add0b517ed Removed unused macro RADX10. 2015-01-21 19:13:15 -08:00
Pierre Hugo
c4dbe66249 Removed unused DEG2RAD macro. 2015-01-21 19:04:32 -08:00
Petr Ledvina
4157cf5315 Fix double constatns
some constants were double, M_PI was sometimes inherided as double

added -Wdouble-promotion to makefile warnings
2014-11-20 08:31:35 +01:00
Dominic Clifton
daa823ddba AltHold cleanup.
* Renamed several methods and variables so they make more sense.
* Move more altitude hold related code out of imu.c/h into
altitudehold.c/h.
* Fixed a unsigned integer being using instead of an signed integer in
the throttle calculation code.
2014-09-29 01:34:15 +01:00
Goebish
b83e7b42b7 Add throttle level indicator led mode 2014-09-19 01:09:59 +02:00
Dominic Clifton
d60183d91d Normalize all the line endings 2014-09-15 23:40:17 +01:00