Skip to content

Commit 46c5775

Browse files
committed
supervisor: tick: add supervisor_fake_tick
1 parent a9baa0f commit 46c5775

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

supervisor/shared/tick.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,4 +88,7 @@ void supervisor_run_background_tasks_if_tick() {
8888
run_background_tasks();
8989
}
9090

91+
void supervisor_fake_tick() {
92+
uint32_t now32 = ticks_ms;
93+
background_ticks_ms32 = (now32 - 1);
9194
}

supervisor/shared/tick.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@
3636
* interrupt context.
3737
*/
3838
extern void supervisor_tick(void);
39+
/** @brief Cause background tasks to be called soon
40+
*
41+
* Normally, background tasks are only run once per tick. For other cases where
42+
* an event noticed from an interrupt context needs to be completed by a background
43+
* task activity, the interrupt can call supervisor_fake_tick.
44+
*/
45+
extern void supervisor_fake_tick(void);
3946
/** @brief Get the lower 32 bits of the time in milliseconds
4047
*
4148
* This can be more efficient than supervisor_ticks_ms64, for sites where a wraparound

0 commit comments

Comments
 (0)