diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-12-04 00:47:54 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-12-04 00:47:54 -0700 |
commit | 03b84b89f6361df556749a4c73679a6cbcedd28a (patch) | |
tree | ee5a6569feddc3bc32ab0bdb485affb56d7fafbe /include | |
parent | d6d04862de9126d0930ae1f4b95ff6077c6eda63 (diff) | |
download | ch573-03b84b89f6361df556749a4c73679a6cbcedd28a.tar.gz ch573-03b84b89f6361df556749a4c73679a6cbcedd28a.tar.bz2 ch573-03b84b89f6361df556749a4c73679a6cbcedd28a.zip |
Implemented listener system for systick.
Diffstat (limited to 'include')
-rw-r--r-- | include/systick.h | 9 |
1 files changed, 9 insertions, 0 deletions
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 <stdint.h> +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__() |