From d80ebb8add60dd01b37d21c21a1a9d971f0f9dce Mon Sep 17 00:00:00 2001 From: John Tsiombikas Date: Sun, 15 Nov 2020 09:26:55 +0200 Subject: [PATCH] initialize timer --- src/timer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/timer.c b/src/timer.c index 7df21bb..cbcebee 100644 --- a/src/timer.c +++ b/src/timer.c @@ -6,5 +6,10 @@ volatile unsigned long num_ticks; void timer_init(void) { + /* clear all 4 timer interrupt bits */ + STM_CTL_REG = 0xf; + /* setup first timer interrupt */ + STM_CMP1_REG = STM_LCNT_REG + 4000; + enable_gpu_irq(IRQ_GPU_TIMER1); } -- 1.7.10.4