From 5398f1a499ad9875094f75c2d4c0d847b9d7ba7b Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sun, 1 Sep 2024 22:11:33 -0500 Subject: [PATCH] AP_HAL_ESP32: move scheduler stats display behind SCHEDDEBUG It takes ~100ms and causes noticeable control glitches. --- libraries/AP_HAL_ESP32/Scheduler.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/AP_HAL_ESP32/Scheduler.cpp b/libraries/AP_HAL_ESP32/Scheduler.cpp index 8b683b6e34dc3..39413f9331b2b 100644 --- a/libraries/AP_HAL_ESP32/Scheduler.cpp +++ b/libraries/AP_HAL_ESP32/Scheduler.cpp @@ -565,7 +565,9 @@ void IRAM_ATTR Scheduler::_main_thread(void *arg) sched->delay_microseconds(250); // run stats periodically +#ifdef SCHEDDEBUG sched->print_stats(); +#endif sched->print_main_loop_rate(); if (ESP_OK != esp_task_wdt_reset()) {