/* Start a capsense measurement of a specific channel and waits for it to complete.  */
static void CAPSENSE_Measure(ACMP_Channel_TypeDef channel)
/* Start a capsense measurement of a specific channel and waits for it to complete.  */
static void CAPSENSE_Measure(ACMP_Channel_TypeDef channel)
{
  ACMP_CapsenseChannelSet(ACMP_CAPSENSE, channel);
  TIMER0->CNT = 0;
  TIMER1->CNT = 0;
  measurementComplete = false;
  TIMER0->CMD = TIMER_CMD_START;
  TIMER1->CMD = TIMER_CMD_START;
  while ( measurementComplete == false )
  {
    EMU_EnterEM1();
  }
}