From c68a9cf26f81f7a95fa7aadc3a87295ffd90a975 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 24 Sep 2024 20:51:11 +1000 Subject: [PATCH] AP_DroneCAN: prevent saturation of CPU with DroneCAN thread --- libraries/AP_DroneCAN/AP_DroneCAN.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_DroneCAN/AP_DroneCAN.cpp b/libraries/AP_DroneCAN/AP_DroneCAN.cpp index 810e1ba074..b6f3703b44 100644 --- a/libraries/AP_DroneCAN/AP_DroneCAN.cpp +++ b/libraries/AP_DroneCAN/AP_DroneCAN.cpp @@ -506,6 +506,10 @@ void AP_DroneCAN::loop(void) continue; } + // ensure that the DroneCAN thread cannot completely saturate + // the CPU, preventing low priority threads from running + hal.scheduler->delay_microseconds(100); + canard_iface.process(1); safety_state_send();