/* Use *system timer* peripheral -> compare module CM1 */ void timer_init() { /* 10 ms seems good */ set_next_tick_default(); /* Enable timer irq */ ENABLE_TIMER_IRQ(); /* Enable interrupt *line* */ Set32(0x2000B210, 0x00000002); }
void irq_handler(void) { set_next_tick_default(); ENABLE_TIMER_IRQ(); ENABLE_IRQ(); }