supervisor: tick: add supervisor_fake_tick

This commit is contained in:
Jeff Epler 2019-11-20 10:15:44 -06:00
parent a9baa0f954
commit 46c5775ba4
2 changed files with 10 additions and 0 deletions

View File

@ -88,4 +88,7 @@ void supervisor_run_background_tasks_if_tick() {
run_background_tasks();
}
void supervisor_fake_tick() {
uint32_t now32 = ticks_ms;
background_ticks_ms32 = (now32 - 1);
}

View File

@ -36,6 +36,13 @@
* interrupt context.
*/
extern void supervisor_tick(void);
/** @brief Cause background tasks to be called soon
*
* Normally, background tasks are only run once per tick. For other cases where
* an event noticed from an interrupt context needs to be completed by a background
* task activity, the interrupt can call supervisor_fake_tick.
*/
extern void supervisor_fake_tick(void);
/** @brief Get the lower 32 bits of the time in milliseconds
*
* This can be more efficient than supervisor_ticks_ms64, for sites where a wraparound