4,7 → 4,7 |
/* |
* Angular unit scaling: Number of units per degree |
*/ |
#define MATH_DRG_FACTOR GYRO_DEG_FACTOR_PITCHROLL |
#define MATH_DRG_FACTOR GYRO_DEG_FACTOR |
|
/* |
* Fix-point decimal scaling: Number of units for 1 (so if sin(something) |
14,9 → 14,11 |
//#define MATH_UNIT_FACTOR 8192 |
// Changed: We want to be able to multiply 2 sines/cosines and still stay comfortably (factor 100) within 31 bits. |
// 4096 = 12 bits, square = 24 bits, 7 bits to spare. |
#define MATH_UNIT_FACTOR_LOG 12 |
#define MATH_UNIT_FACTOR (1L<<MATH_UNIT_FACTOR_LOG) |
#define LOG_MATH_UNIT_FACTOR 12 |
#define MATH_UNIT_FACTOR (1L<<LOG_MATH_UNIT_FACTOR) |
|
int16_t int_sin(int32_t arg); |
int16_t int_cos(int32_t arg); |
int16_t int_tan(int32_t arg); |
int16_t sin_360(int16_t arg); |
int16_t cos_360(int16_t arg); |
int16_t tan_360(int16_t arg); |
|
void intervalWrap(int32_t *number, int32_t limit); |