mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Fix bug that prevented throttle angle correction working correctly when
using different values in different. The cause was the IMU init code which triggered calculation was never called after switching profiles - it couldn't be called twice because it also initialised the compass. The solution was to decouple compass initialisation from IMU initialisation and extract the code to recalculate throttle angle scale to a new method.
This commit is contained in:
parent
64a43c77ca
commit
ab0296c991
6 changed files with 28 additions and 22 deletions
|
@ -159,7 +159,12 @@ void init(void)
|
|||
LED0_OFF;
|
||||
LED1_OFF;
|
||||
|
||||
imuInit(); // Mag is initialized inside imuInit
|
||||
imuInit();
|
||||
#ifdef MAG
|
||||
if (sensors(SENSOR_MAG))
|
||||
compassInit();
|
||||
#endif
|
||||
|
||||
mixerInit(masterConfig.mixerConfiguration, masterConfig.customMixer);
|
||||
|
||||
timerInit();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue