for (;;)
{
ADC10CTL0 |= ENC + ADC10SC; // Sampling and conversion start (ADC10开始采样转换)
__bis_SR_register(CPUOFF + GIE); // LPM0, ADC10_ISR will force exit (开总中断,低功耗模式)
/*******翻转P1.0口状态******/
if (ADC10MEM < 0x1FF)
P1OUT &= ~0x01; // Clear P1.0 LED off
else
P1OUT |= 0x01; // Set P1.0 LED on
}
}
// ADC10 interrupt service routine
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR(void)
{
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}