Contiki 2.5
pit-interrupt.h
1 volatile unsigned int pit_count = 0;
2 
3 static void NACKEDFUNC ATTR system_int (void) { /* System Interrupt Handler */
4 
5  ISR_ENTRY();
6 
7  if (*AT91C_PITC_PISR & AT91C_PITC_PITS) { /* Check PIT Interrupt */
8  pit_count++;
9  /*
10  if ((pit_count % 100) == 0) {
11  unsigned int led_state = (pit_count % 300) / 100;
12  *AT91C_PIOA_ODSR = ~(1<<led_state);
13  }
14  */
15 
16  *AT91C_AIC_EOICR = *AT91C_PITC_PIVR; /* Ack & End of Interrupt */
17  } else {
18  *AT91C_AIC_EOICR = 0; /* End of Interrupt */
19  }
20 
21  ISR_EXIT();
22 }