1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 08:15:30 +03:00

Added #define for imu debug output (+16 squashed commit)

Squashed local commits:

from       : e4265d4a13f63f82d5cf55eea2c091622f96660b
up to (inc): 72416dc74745fa8bae1aded79aa4b9ed0e389076
This commit is contained in:
Konstantin Sharlaimov (DigitalEntity) 2015-07-10 15:02:38 +10:00 committed by ProDrone
parent c6f5b98a79
commit 45a4f11f92
21 changed files with 823 additions and 188 deletions

View file

@ -22,8 +22,8 @@
#endif
// Undefine this for use libc sinf/cosf. Keep this defined to use fast sin/cos approximations
#define FAST_TRIGONOMETRY // order 9 approximation
//#define EVEN_FASTER_TRIGONOMETRY // order 7 approximation
#define FAST_MATH // order 9 approximation
#define VERY_FAST_MATH // order 7 approximation
// Use floating point M_PI instead explicitly.
#define M_PIf 3.14159265358979323846f
@ -88,12 +88,18 @@ int32_t quickMedianFilter5(int32_t * v);
int32_t quickMedianFilter7(int32_t * v);
int32_t quickMedianFilter9(int32_t * v);
#if defined(FAST_TRIGONOMETRY) || defined(EVEN_FASTER_TRIGONOMETRY)
#if defined(FAST_MATH) || defined(VERY_FAST_MATH)
float sin_approx(float x);
float cos_approx(float x);
float atan2_approx(float y, float x);
float acos_approx(float x);
#define tan_approx(x) (sin_approx(x) / cos_approx(x))
#else
#define sin_approx(x) sinf(x)
#define cos_approx(x) cosf(x)
#define atan2_approx(y,x) atan2f(y,x)
#define acos_approx(x) acosf(x)
#define tan_approx(x) tanf(x)
#endif
void arraySubInt32(int32_t *dest, int32_t *array1, int32_t *array2, int count);