OpenPicoRTOS
OpenPicoRTOS copied to clipboard
CONFIG_DEADLOCK_COUNT in the drivers is a bad idea !
A lot of drivers use CONFIG_DEADLOCK_COUNT as a way to avoid infinite loops. This doesn't work. Depending on the CPU power or level of optimization, this could trigger an assert and make a perfectly good software stall.
The solution is not obvious... We can increase the countdown but take the risk to see it fail anyway or find a way to determine the max counter depending on the CPU frequency. This one is available in the clock HAL, but this means the clocks must be initialized, which is not satisfying either.
Partially "solved" with the use of arch_delay_us()