Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
coding-standards [2020/09/02 11:12]
wolfmanjm
coding-standards [2021/02/22 17:47] (current)
Line 90: Line 90:
  
 === Do not use blocking wait loops === Do not use blocking wait loops
-There must not be any blocking wait loops in the code, there is no RTOS here so a blocking wait loop stops everythign from running, and if long enough will trigger the watchdog timer. In the case of needing to wait for several milliseconds you can use the ''safe_delay_ms'' or ''safe_delay_us'' function call, which will call on_idle() to keep things going. However note this is not an accurate delay. For accurate timing an interupt timer must be used.+There must not be any blocking wait loops in the code, there is no RTOS here so a blocking wait loop stops everything from running, and if long enough will trigger the watchdog timer. In the case of needing to wait for several milliseconds you can use the ''safe_delay_ms'' or ''safe_delay_us'' function call, which will call on_idle() to keep things going. However note this is not an accurate delay. For accurate timing an interupt timer must be used.