Contiki 2.6

pit-interrupt.h

00001 volatile unsigned int pit_count = 0;
00002 
00003 static void NACKEDFUNC ATTR system_int (void) {        /* System Interrupt Handler */
00004 
00005   ISR_ENTRY();
00006 
00007   if (*AT91C_PITC_PISR & AT91C_PITC_PITS) {  /* Check PIT Interrupt */
00008     pit_count++;
00009     /*
00010     if ((pit_count % 100) == 0) {
00011       unsigned int led_state = (pit_count % 300) / 100;
00012       *AT91C_PIOA_ODSR = ~(1<<led_state);
00013     }
00014     */
00015 
00016     *AT91C_AIC_EOICR = *AT91C_PITC_PIVR;     /* Ack & End of Interrupt */
00017   } else {
00018     *AT91C_AIC_EOICR = 0;                   /* End of Interrupt */
00019   }
00020   
00021   ISR_EXIT();
00022 }