mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 05:45:31 +03:00
Decoupling imu from config - acc_unarmedcal.
This commit is contained in:
parent
5f4a464f50
commit
2bbbf9937d
3 changed files with 4 additions and 1 deletions
|
@ -388,6 +388,8 @@ void activateConfig(void)
|
||||||
imuRuntimeConfig.gyro_cmpf_factor = masterConfig.gyro_cmpf_factor;
|
imuRuntimeConfig.gyro_cmpf_factor = masterConfig.gyro_cmpf_factor;
|
||||||
imuRuntimeConfig.gyro_cmpfm_factor = masterConfig.gyro_cmpfm_factor;
|
imuRuntimeConfig.gyro_cmpfm_factor = masterConfig.gyro_cmpfm_factor;
|
||||||
imuRuntimeConfig.acc_lpf_factor = currentProfile.acc_lpf_factor;
|
imuRuntimeConfig.acc_lpf_factor = currentProfile.acc_lpf_factor;
|
||||||
|
imuRuntimeConfig.acc_unarmedcal = currentProfile.acc_unarmedcal;;
|
||||||
|
|
||||||
|
|
||||||
configureImu(&imuRuntimeConfig, ¤tProfile.pidProfile, ¤tProfile.barometerConfig, ¤tProfile.accDeadband);
|
configureImu(&imuRuntimeConfig, ¤tProfile.pidProfile, ¤tProfile.barometerConfig, ¤tProfile.accDeadband);
|
||||||
|
|
||||||
|
|
|
@ -245,7 +245,7 @@ void acc_calc(uint32_t deltaT)
|
||||||
|
|
||||||
rotateV(&accel_ned.V, &rpy);
|
rotateV(&accel_ned.V, &rpy);
|
||||||
|
|
||||||
if (currentProfile.acc_unarmedcal == 1) {
|
if (imuRuntimeConfig->acc_unarmedcal == 1) {
|
||||||
if (!f.ARMED) {
|
if (!f.ARMED) {
|
||||||
accZoffset -= accZoffset / 64;
|
accZoffset -= accZoffset / 64;
|
||||||
accZoffset += accel_ned.V.Z;
|
accZoffset += accel_ned.V.Z;
|
||||||
|
|
|
@ -23,6 +23,7 @@ extern int16_t throttleAngleCorrection;
|
||||||
|
|
||||||
typedef struct imuRuntimeConfig_s {
|
typedef struct imuRuntimeConfig_s {
|
||||||
uint8_t acc_lpf_factor;
|
uint8_t acc_lpf_factor;
|
||||||
|
uint8_t acc_unarmedcal;
|
||||||
float gyro_cmpf_factor;
|
float gyro_cmpf_factor;
|
||||||
float gyro_cmpfm_factor;
|
float gyro_cmpfm_factor;
|
||||||
} imuRuntimeConfig_t;
|
} imuRuntimeConfig_t;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue