From f89f75b5616de99865448f41b068a2783cd3648e Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Sun, 8 Dec 2024 14:22:05 -0700 Subject: Cleaned up GPIO code quite a bit. --- src/systick.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/systick.c') diff --git a/src/systick.c b/src/systick.c index 3cd7bfa..4b57702 100644 --- a/src/systick.c +++ b/src/systick.c @@ -3,10 +3,12 @@ #include #include "ch573/systick.h" +#include "ch573/pfic.h" #include "isr_vector.h" #define SYSTICK_I CH573_SYSTICK__SYSTICK_T_INTF #define SYSTICK ch573_systick__systick +#define PFIC ch573_pfic__pfic void set_systick(uint64_t systick) { @@ -15,6 +17,8 @@ void set_systick(uint64_t systick) SYSTICK_I.cfg.interrupt_enable.set(SYSTICK, 1); SYSTICK_I.cfg.enabled.set(SYSTICK, ENABLED); + PFIC->interrupt_priority_threshold = 0x10; + PFIC->interrupt_enable |= IRQ_SysTick; } uint64_t get_systick() -- cgit