I have a question that I think the answer to is quite simple. But I've been unable to find a straight answer to.
If i have this service routine in some module foo.c
#pragma vector = SOME_VECTOR
interrupt void fooISR(){
dosomething;
IFG = 0;
}
if i have in my main.
#include "foo.h"
Then it appears that the fooISR()
does indeed get loaded into the SOME_VECTOR and the ISR will trigger whenever the corresponding IFG is set.
I wanted to ask if this is the right way to write modules that utilize interrupts. Because with this approach the fooISR()
will be in the SOME_VECTOR whenever I include foo.h this doesn't really allow for much configuration for the person working in main.
For example if in main.c
I wanted to access some functionality of foo.c but wanted to write a separate ISR for SOME_VECTOR I'd be outta luck with this method right?