void ISR_Pit(void) { unsigned int status; // Read the PIT status register status = PIT_GetStatus() & AT91C_PITC_PITS; if (status != 0) { // Read the PIVR to acknowledge interrupt and get number of ticks timestamp += (PIT_GetPIVR() >> 20); } }