for (;;) { ADC12CTL0 |= ADC12SC; // Sampling open _BIS_SR(CPUOFF + GIE); // LPM0, ADC12_ISR will force exit } }
// ADC12 interrupt service routine #pragma vector=ADC_VECTOR __interrupt void ADC12_ISR (void) { if (ADC12MEM0 < 0x7FF) P1OUT &= ~0x01; // Clear P1.0 LED off else P1OUT |= 0x01; // Set P1.0 LED on _BIC_SR_IRQ(CPUOFF); // Clear CPUOFF bit from 0(SR) }
static unsigned int results[Num_of_Results]; // Needs to be global in this // example. Otherwise, the // compiler removes it because it // is not used for anything.