Other Parts Discussed in Thread: MSPWARE, CAPTIVATE-FR2633, TEST2, CC1310
Tool/software: Code Composer Studio
Working on a Captivate project and want to start a timer-oscillator from a touch event to drive a piezo sounder. Tested a timer program example on my MSP430FR2633 Captivate board and all went well. Then inserted the same code into the modified Captivate main.c page(where I drive LED's from events) and get a "pragma vector..." error. The code that works on the board outside of the Captivate program is as follows:
int main(void)
{
WDTCTL = WDTPW | WDTHOLD; // Stop WDT
// Configure GPIO
P1DIR |= BIT0; // P1.0 output
P1OUT |= BIT0; // P1.0 high
// Disable the GPIO power-on default high-impedance mode to activate
// previously configured port settings
PM5CTL0 &= ~LOCKLPM5;
TA0CCTL0 |= CCIE; // TACCR0 interrupt enabled
TA0CCR0 = 5000; //changed from 50000
TA0CTL |= TASSEL__SMCLK | MC__CONTINUOUS; // SMCLK, continuous mode
__bis_SR_register(LPM0_bits | GIE); // Enter LPM3 w/ interrupts
__no_operation(); // For debug
}
// Timer A0 interrupt service routine
#if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
#pragma vector = TIMER0_A0_VECTOR
__interrupt void Timer_A (void)
#elif defined(__GNUC__)
void __attribute__ ((interrupt(TIMER0_A0_VECTOR))) Timer_A (void)
#else
#error Compiler not supported!
#endif
{
P1OUT ^= BIT0;
TA0CCR0 += 600; // Add Offset to TACCR0, changed from 50000
}
What am I missing? Main error seems to state "pragma vector can only be applied to a function definition, not Timer_A". Again, it all works well outside of Captivate. Should I be using a different timer? Somewhat new to embedded programming.