fix: Various issues related to IMU sensor (#3171)
* fix(imu): reset error counter on successful IMU query Please note that the HAL already handles busy I2C bus, so that we should not run into the case where the bus is used and another query is started. However, if that happens, HAL_BUSY will be returned, which leads to -1 being returned in our functions, thus increasing the error count until the sensor stops working. * fix(imu): move imu init into mixer task Fixes a race condition between init and use.
This commit is contained in:
@@ -133,6 +133,10 @@ void execMixerFrequentActions()
|
||||
|
||||
TASK_FUNCTION(mixerTask)
|
||||
{
|
||||
#if defined(IMU)
|
||||
gyroInit();
|
||||
#endif
|
||||
|
||||
mixerSchedulerInit();
|
||||
mixerSchedulerStart();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user