From 03b84b89f6361df556749a4c73679a6cbcedd28a Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Wed, 4 Dec 2024 00:47:54 -0700 Subject: Implemented listener system for systick. --- include/systick.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'include') diff --git a/include/systick.h b/include/systick.h index 8933a31..285b9b8 100644 --- a/include/systick.h +++ b/include/systick.h @@ -2,8 +2,17 @@ #include +typedef void (*systick_cb_t)(void); + void set_systick(uint64_t systick_value); uint64_t get_systick(); int systick_interrupt(); + +#define On_SysTick() \ + static void __local_on_systick__(void); \ + __attribute__(( \ + __section__(".systick_callbacks"))) static volatile systick_cb_t \ + __FILE__##__LINE__ = __local_on_systick__; \ + static void __local_on_systick__() -- cgit