fix(radio): disable gyro in USB storage mode (#6917)

This commit is contained in:
3djc
2026-01-01 11:29:04 +10:00
committed by GitHub
parent e52a2e27c4
commit a5c93c3cc5
4 changed files with 43 additions and 1 deletions
+2 -1
View File
@@ -24,6 +24,7 @@
#include "debug.h"
#define _USE_MATH_DEFINES
#include <math.h>
#include "hal/usb_driver.h"
#define ACC_LSB_VALUE 0.000488 // 0.488 mg/LSB
@@ -47,7 +48,7 @@ void Gyro::wakeup()
static tmr10ms_t gyroWakeupTime = 0;
tmr10ms_t now = get_tmr10ms();
if (errors >= 100 || now < gyroWakeupTime)
if (errors >= 100 || now < gyroWakeupTime || usbPluggedInStorageMode())
return;
gyroWakeupTime = now + 1; /* 10ms default */