diff --git a/radio/src/gyro.cpp b/radio/src/gyro.cpp index 56f49fd1f..ffd0e8d3f 100644 --- a/radio/src/gyro.cpp +++ b/radio/src/gyro.cpp @@ -54,6 +54,11 @@ void Gyro::wakeup() return; } + // reset error count on each + // successful query to avoid + // stopping the sensor forever + errors = 0; + int16_t gx = values[0]; int16_t gy = values[1]; // int16_t gz = values[2]; diff --git a/radio/src/tasks.cpp b/radio/src/tasks.cpp index 08ac269f2..8086c6385 100644 --- a/radio/src/tasks.cpp +++ b/radio/src/tasks.cpp @@ -56,10 +56,6 @@ TASK_FUNCTION(menusTask) touchPanelInit(); #endif -#if defined(IMU) - gyroInit(); -#endif - opentxInit(); #if defined(PWR_BUTTON_PRESS) diff --git a/radio/src/tasks/mixer_task.cpp b/radio/src/tasks/mixer_task.cpp index 2ac5415d6..c683cebcc 100644 --- a/radio/src/tasks/mixer_task.cpp +++ b/radio/src/tasks/mixer_task.cpp @@ -133,6 +133,10 @@ void execMixerFrequentActions() TASK_FUNCTION(mixerTask) { +#if defined(IMU) + gyroInit(); +#endif + mixerSchedulerInit(); mixerSchedulerStart();