mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
some extra speedups
This commit is contained in:
parent
b7dddef483
commit
ab2b05bab1
5 changed files with 8 additions and 8 deletions
|
@ -200,7 +200,7 @@ void biquadFilterInit(biquadFilter_t *filter, uint16_t filterFreq, uint32_t samp
|
||||||
}
|
}
|
||||||
|
|
||||||
// Computes a biquad_t filter on a sample
|
// Computes a biquad_t filter on a sample
|
||||||
float FAST_CODE NOINLINE biquadFilterApply(biquadFilter_t *filter, float input)
|
float FAST_CODE biquadFilterApply(biquadFilter_t *filter, float input)
|
||||||
{
|
{
|
||||||
const float result = filter->b0 * input + filter->d1;
|
const float result = filter->b0 * input + filter->d1;
|
||||||
filter->d1 = filter->b1 * input - filter->a1 * result + filter->d2;
|
filter->d1 = filter->b1 * input - filter->a1 * result + filter->d2;
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
stickPositions_e rcStickPositions;
|
stickPositions_e rcStickPositions;
|
||||||
|
|
||||||
int16_t rcCommand[4]; // interval [1000;2000] for THROTTLE and [-500;+500] for ROLL/PITCH/YAW
|
FASTRAM int16_t rcCommand[4]; // interval [1000;2000] for THROTTLE and [-500;+500] for ROLL/PITCH/YAW
|
||||||
|
|
||||||
PG_REGISTER_WITH_RESET_TEMPLATE(rcControlsConfig_t, rcControlsConfig, PG_RC_CONTROLS_CONFIG, 0);
|
PG_REGISTER_WITH_RESET_TEMPLATE(rcControlsConfig_t, rcControlsConfig, PG_RC_CONTROLS_CONFIG, 0);
|
||||||
|
|
||||||
|
|
|
@ -58,8 +58,8 @@
|
||||||
|
|
||||||
static uint8_t motorCount;
|
static uint8_t motorCount;
|
||||||
|
|
||||||
int16_t motor[MAX_SUPPORTED_MOTORS];
|
FASTRAM int16_t motor[MAX_SUPPORTED_MOTORS];
|
||||||
int16_t motor_disarmed[MAX_SUPPORTED_MOTORS];
|
FASTRAM int16_t motor_disarmed[MAX_SUPPORTED_MOTORS];
|
||||||
static float motorMixRange;
|
static float motorMixRange;
|
||||||
|
|
||||||
PG_REGISTER_WITH_RESET_TEMPLATE(flight3DConfig_t, flight3DConfig, PG_MOTOR_3D_CONFIG, 0);
|
PG_REGISTER_WITH_RESET_TEMPLATE(flight3DConfig_t, flight3DConfig, PG_MOTOR_3D_CONFIG, 0);
|
||||||
|
|
|
@ -70,7 +70,7 @@ void updateBoardAlignment(int16_t roll, int16_t pitch)
|
||||||
initBoardAlignment();
|
initBoardAlignment();
|
||||||
}
|
}
|
||||||
|
|
||||||
void applyBoardAlignment(int32_t *vec)
|
void FAST_CODE applyBoardAlignment(int32_t *vec)
|
||||||
{
|
{
|
||||||
if (standardBoardAlignment) {
|
if (standardBoardAlignment) {
|
||||||
return;
|
return;
|
||||||
|
@ -84,7 +84,7 @@ void applyBoardAlignment(int32_t *vec)
|
||||||
vec[Z] = lrintf(fpVec.z);
|
vec[Z] = lrintf(fpVec.z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void applySensorAlignment(int32_t * dest, int32_t * src, uint8_t rotation)
|
void FAST_CODE applySensorAlignment(int32_t * dest, int32_t * src, uint8_t rotation)
|
||||||
{
|
{
|
||||||
// Create a copy so we could use the same buffer for src & dest
|
// Create a copy so we could use the same buffer for src & dest
|
||||||
const int32_t x = src[X];
|
const int32_t x = src[X];
|
||||||
|
|
|
@ -349,7 +349,7 @@ void gyroSetCalibrationCycles(uint16_t calibrationCyclesRequired)
|
||||||
gyroCalibration.calibratingG = calibrationCyclesRequired;
|
gyroCalibration.calibratingG = calibrationCyclesRequired;
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_UNIT_TESTED bool isCalibrationComplete(gyroCalibration_t *gyroCalibration)
|
STATIC_UNIT_TESTED bool FAST_CODE NOINLINE isCalibrationComplete(gyroCalibration_t *gyroCalibration)
|
||||||
{
|
{
|
||||||
return gyroCalibration->calibratingG == 0;
|
return gyroCalibration->calibratingG == 0;
|
||||||
}
|
}
|
||||||
|
@ -414,7 +414,7 @@ void gyroGetMeasuredRotationRate(fpVector3_t *measuredRotationRate)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void gyroUpdate()
|
void FAST_CODE NOINLINE gyroUpdate()
|
||||||
{
|
{
|
||||||
// range: +/- 8192; +/- 2000 deg/sec
|
// range: +/- 8192; +/- 2000 deg/sec
|
||||||
if (gyroDev0.readFn(&gyroDev0)) {
|
if (gyroDev0.readFn(&gyroDev0)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue