The error:
main.c: In function 'Timer_A':
main.c:150:28: error: MSP430 builtin functions only work inside interrupt handlers
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
^
makefile:23: recipe for target 'main.o' failed
Here's the code:
// TimerA interrupt
__attribute__((__interrupt__(TIMERA0_VECTOR)))
Timer_A (void)
{
iflag |= BIT0; // Set BIT0 flag
__bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR)
}
Is this a bug?
I found slaa294a (http://www.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=slaa294a) last night and have been trying to follow their code flow.