5 #include <sys/robsys.h>
8 #include <lib/regfunc.h>
11 struct interrupt_frame {
23 //__attribute__ ((interrupt))
24 void * systick_handler(/* struct interrupt_frame * frame */) {
26 // cputs("TICKING\n");
33 /* Every time the counter counts down to zero
34 * a systick exception is asserted. Systick has
35 * exception number 15. in the vector table */
36 ivt_set_gate(15, systick_handler, 0);
38 /* Get calibration and set this to 1 sec
39 * !Most boards have a 1 ms or 10 ms
40 * calibration value */
41 int calib = (*STK_CALIB << 0) * 500;
43 /* The counter reload registers counts down to zero
44 * and then it is restores the value */
45 rwrite(STK_RELOAD, calib);
47 /* Enable the counter and enable the interrupt
48 * associated with it */