File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929
3030#include <stdint.h>
3131
32+ /** @brief To be called once every ms
33+ *
34+ * The port must call supervisor_tick once per millisecond to perform regular tasks.
35+ * This is called from the SysTick interrupt or similar, and is safe to call in an
36+ * interrupt context.
37+ */
3238extern void supervisor_tick (void );
39+ /** @brief Get the lower 32 bits of the time in milliseconds
40+ *
41+ * This can be more efficient than supervisor_ticks_ms64, for sites where a wraparound
42+ * of ~49.5 days is not harmful.
43+ */
3344extern uint32_t supervisor_ticks_ms32 (void );
45+ /** @brief Get the full time in milliseconds
46+ *
47+ * Because common ARM mcus cannot atomically work with 64-bit quantities, this
48+ * function must briefly disable interrupts in order to return the value. If
49+ * only relative durations of less than about ~49.5 days need to be considered,
50+ * then it may be possible to use supervisor_ticks_ms64 instead.
51+ */
3452extern uint64_t supervisor_ticks_ms64 (void );
53+ /** @brief Run background ticks, but only about every millisecond.
54+ *
55+ * Normally, this is not called directly. Instead use the RUN_BACKGROUND_TASKS
56+ * macro.
57+ */
3558extern void supervisor_run_background_if_tick (void );
3659
3760#endif
You can’t perform that action at this time.
0 commit comments