Other Parts Discussed in Thread: MSP430F5438A
The interrupt function used in other C files, rather than the use of main.c interrupt. Can be achieved? The use of methods and main.c like? Examples are the best.
please help!
best wish!
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Other Parts Discussed in Thread: MSP430F5438A
The interrupt function used in other C files, rather than the use of main.c interrupt. Can be achieved? The use of methods and main.c like? Examples are the best.
please help!
best wish!
These two days to write a program, since the relevant code TA longer, directly write a timer.c put the code related functions, including the interrupt service routine. It was found that the program can be compiled to download, but it does not work interrupt function. Later this function where you can run into main.c correct.
I remember extern interrupt function is not declared on the outside that the interrupt function main.c how to use it?
PS: IAR 5.3 MSP430F5438A
Interrupt service routines can be defined in source files other than the one containing main() -- I do it all the time. The "#pragma vector=" constructs the linkage. (__interrupt deals with how the ISR is compiled.)
There is one (unusual) thing to watch out for: The linker will not resolve an ISR from a library, since there is no code which references the name. This is not incorrect, but it's often surprising. If this is what you're trying to do, the simplest thing is just to not put it into a library.
What symptom are you seeing? If the ISR code were not being linked into your program, the symptom would be a reset when the interrupt is triggered. If that's not what you're seeing, maybe the problem is elsewhere.
**Attention** This is a public forum