🐛 Fix imu and magnotometer

This commit is contained in:
Rune Harlyk
2025-11-27 20:51:54 +01:00
committed by Niklas Jensen
parent 081c1e7046
commit 868ff0446a
3 changed files with 57 additions and 37 deletions
+6 -6
View File
@@ -185,12 +185,6 @@ void IRAM_ATTR SpotControlLoopEntry(void *) {
#if FT_ENABLED(USE_WS2812)
ledService.loop();
#endif
EXECUTE_EVERY_N_MS(250, {
JsonDocument doc;
JsonVariant results = doc.to<JsonVariant>();
peripherals.getIMUResult(results);
socket.emit(EVENT_IMU, results);
});
vTaskDelayUntil(&xLastWakeTime, xFrequency);
}
}
@@ -216,6 +210,12 @@ void IRAM_ATTR serviceLoopEntry(void *) {
wifiService.loop();
apService.loop();
EXECUTE_EVERY_N_MS(2000, system_service::emitMetrics(socket));
EXECUTE_EVERY_N_MS(500, {
JsonDocument doc;
JsonVariant results = doc.to<JsonVariant>();
peripherals.getIMUResult(results);
socket.emit(EVENT_IMU, results);
});
vTaskDelay(100 / portTICK_PERIOD_MS);
}