Contiki 2.5
cc2420-interrupt.c
1 #include <AT91SAM7S64.h>
2 #include <contiki-conf.h>
3 #include <sys/process.h>
4 #include <net/uip.h>
5 #include <dev/cc2420.h>
6 #include <interrupt-utils.h>
7 
8 static void NACKEDFUNC
9 cc2420_fifop_interrupt (void) /* System Interrupt Handler */
10 {
11  ISR_STORE();
12  ISR_ENABLE_NEST();
13  cc2420_interrupt();
14  ISR_DISABLE_NEST();
15  *AT91C_AIC_EOICR = 0; /* End of Interrupt */
16  ISR_RESTORE();
17 }
18 
19 void
20 cc2420_interrupt_fifop_int_init(void)
21 {
22  *AT91C_PIOA_ASR = AT91C_PA30_IRQ1;
23  *AT91C_PIOA_PDR = AT91C_PA30_IRQ1;
24  AT91C_AIC_SMR[AT91C_ID_IRQ1] = AT91C_AIC_SRCTYPE_POSITIVE_EDGE | 4;
25  AT91C_AIC_SVR[AT91C_ID_IRQ1] = (unsigned long)cc2420_fifop_interrupt;
26  /* *AT91C_AIC_IECR = (1 << AT91C_ID_IRQ1); */
27 }
28 
29 #ifndef __MAKING_DEPS__
30 
31 inline int splhigh(void)
32 {
33  int save;
34 #ifndef __THUMBEL__
35  asm("mrs %0, CPSR\n\torr r1,%0,#0x80\n\tmsr CPSR_c, r1" : "=r" (save)::"r1");
36 #else
37 #error Must be compiled in ARM mode
38 #endif
39  return save;
40 }
41 
42 inline void splx(int saved)
43 {
44 #ifndef __THUMBELL__
45  asm("msr CPSR_c, %0" ::"r" (saved));
46 #else
47 #error Must be compiled in ARM mode
48 #endif
49 }
50 
51 #endif /* __MAKING_DEPS__ */