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. --- src/main.c | 4 ++++ src/systick.c | 7 +++++++ 2 files changed, 11 insertions(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index 9f5808b..c80ab30 100644 --- a/src/main.c +++ b/src/main.c @@ -250,3 +250,7 @@ int main(void) return 0; } + +On_SysTick() { + printf("Systick BOI!\n"); +} diff --git a/src/systick.c b/src/systick.c index 506f6df..3cd7bfa 100644 --- a/src/systick.c +++ b/src/systick.c @@ -28,7 +28,14 @@ int systick_interrupt() return SYSTICK_I.counter_interrupt_flag.get(SYSTICK); } +extern systick_cb_t SYSTICK_LISTENERS_START; +extern systick_cb_t SYSTICK_LISTENERS_END; IRQ(systick) { + systick_cb_t* cur = &SYSTICK_LISTENERS_START; + while (cur != &SYSTICK_LISTENERS_END) { + (*cur)(); + ++cur; + } SYSTICK_I.counter_interrupt_flag.set(SYSTICK, 0); } -- cgit