Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

msp430-elf-gcc errors on builtin SR function

$
0
0

I'm getting this 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

With this 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)
}

For some reason msp430-elf-gcc thinks my ISR isn't an ISR :(

 

Any ideas? I emailed one of the red hat guys who submitted the GCC patch with the function that checks whether a function is an interrupt handler or not.


Viewing all articles
Browse latest Browse all 2077

Trending Articles