5 #include <sys/robsys.h>
8 #include <lib/regfunc.h> // TODO
10 struct interrupt_frame {
22 //__attribute__ ((interrupt))
23 void * systick_handler(/* struct interrupt_frame * frame */) {
25 // uint32_t volatile status;
26 //uart_puts("TICKING\n");
33 /* Enable the counter and enable the interrupt
34 * associated with it */
35 *STK_CTRL = (volatile uint32_t) 0x00000003;
37 /* The counter reload register here holds
38 * 0x1000 -- that's 4096 clock cycles -- if
39 * it is down to zero it is restores the value */
40 *STK_RELOAD = (volatile uint32_t) 0x00400000;
42 /* Every time the counter counts down to zero
43 * a systick exception is asserted. Systick has
44 * exception number 15. in the vector table */
45 ivt_set_gate(15, systick_handler, 0);