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: