Contiki 2.5
rtimer-arch-interrupt.c
1 #include "rtimer-arch-interrupt.h"
2 #include "rtimer-arch.h"
3 #include <interrupt-utils.h>
4 #include <AT91SAM7S64.h>
5 
6 #define DEBUG 1
7 #if DEBUG
8 #include <stdio.h>
9 #define PRINTF(...) printf(__VA_ARGS__)
10 #else
11 #define PRINTF(...)
12 #endif
13 
14 /* Here we have a proper stack frame and can use local variables */
15 static void rtimer_int_safe() __attribute((noinline));
16 static void
17 rtimer_int_safe()
18 {
19  unsigned int status;
20  status = RTIMER_ARCH_TIMER_BASE->TC_SR;
21  if (status & AT91C_TC_CPAS) {
23  }
24  *AT91C_AIC_EOICR = 0;
25 }
26 
27 void NACKEDFUNC
28 rtimer_interrupt (void) {
29  ISR_STORE();
30  ISR_ENABLE_NEST();
31  rtimer_int_safe();
32  ISR_DISABLE_NEST();
33  ISR_RESTORE();
34 }