/* TIMER0 interrupt handler. 
@detail When TIMER0 expires the number of pulses on TIMER1 is inserted into channelValues. If this values is bigger than what is recorded in channelMaxValues, channelMaxValues is updated. Finally, the next ACMP channel is selected.  */
void TIMER0_IRQHandler(void)
/* TIMER0 interrupt handler. 
@detail When TIMER0 expires the number of pulses on TIMER1 is inserted into channelValues. If this values is bigger than what is recorded in channelMaxValues, channelMaxValues is updated. Finally, the next ACMP channel is selected.  */
void TIMER0_IRQHandler(void)
{
  uint32_t count;
  TIMER0->CMD = TIMER_CMD_STOP;
  TIMER1->CMD = TIMER_CMD_STOP;
  TIMER0->IFC = TIMER_IFC_OF;
  count = TIMER1->CNT;
  channelValues[currentChannel] = count;
  if (count > channelMaxValues[currentChannel])
    channelMaxValues[currentChannel] = count;
  measurementComplete = true;
}