/* Enter sleep mode using WFI instruction. Enable interrupt first and then disable it after wake up.  */
static void enter_asleep(void)
/* Enter sleep mode using WFI instruction. Enable interrupt first and then disable it after wake up.  */
static void enter_asleep(void)
{
	while (1) {
		puts("Now switching the device into sleep mode...\r");
		adc_get_status(ADC);
		adc_enable_interrupt(ADC, ADC_IER_COMPE);
		__WFI();
		break;
	}
}