diff --git a/Tools/AP_Periph/can.cpp b/Tools/AP_Periph/can.cpp index 24443807fb..927999547c 100644 --- a/Tools/AP_Periph/can.cpp +++ b/Tools/AP_Periph/can.cpp @@ -82,6 +82,15 @@ extern AP_Periph_FW periph; #define HAL_CAN_POOL_SIZE 4000 #endif +#ifndef HAL_PERIPH_LOOP_DELAY_US +// delay between can loop updates. This needs to be longer on F4 +#if defined(STM32H7) +#define HAL_PERIPH_LOOP_DELAY_US 64 +#else +#define HAL_PERIPH_LOOP_DELAY_US 512 +#endif +#endif + #define DEBUG_PRINTS 0 #define DEBUG_PKTS 0 #if DEBUG_PRINTS @@ -1623,7 +1632,7 @@ void AP_Periph_FW::can_update() #endif const uint32_t now_us = AP_HAL::micros(); while ((AP_HAL::micros() - now_us) < 1000) { - hal.scheduler->delay_microseconds(64); + hal.scheduler->delay_microseconds(HAL_PERIPH_LOOP_DELAY_US); processTx(); processRx(); }