initialize timer
[rpikern] / src / timer.c
1 #include "timer.h"
2 #include "rpi_ioreg.h"
3 #include "intr.h"
4
5 volatile unsigned long num_ticks;
6
7 void timer_init(void)
8 {
9         /* clear all 4 timer interrupt bits */
10         STM_CTL_REG = 0xf;
11         /* setup first timer interrupt */
12         STM_CMP1_REG = STM_LCNT_REG + 4000;
13
14         enable_gpu_irq(IRQ_GPU_TIMER1);
15 }