As the title said, I am trying to see if an Interrupt Vector can be embedded inside a function? I am using IAR, but gcc or ccs would work too. I don't see it done in any code online. Example:
void function_funtime (int test){
int lm4970_state = 0;
int abc = test + 3;
// Port 1 interrupt service routine
#pragma vector = PORT1_VECTOR
__interrupt void Port_1_ISR (void)
{
_BIC_SR_IRQ(LPM3_bits + GIE); // Clear LPM/Disable Interrupts
lm4970_state++; // Increase LM4970 state by 1
P1IFG &= ~PB; // P1.3 IFG cleared
}
}
Function "function_funtime" is called from the main code before the interrupt is ever seen. Can this be done?