Greetings: I'm desperately chasing obscure bugs in somebody else's code. I say this before I state that some of the ISR's are embarrassingly long, and have multiple calls to utility functions. In a knowledge base article (http://www.keil.com/support/docs/2910.htm), there is a warning that "it would be impossible to call other functions within the interrupt service routines". Since the code under scrutiny routinely does exactly this, how bad is it? It seems to me the compiler only saves registers used within the __isr routine, therefore any functions called from there may overwrite registers which may or may not be pushed and popped by the IRS itself. Is this correct, or do I worry to much (I'm getting desperate for a solution here...).
Thanks, Doug
"... some of the ISR's are embarrassingly long, and have multiple calls to utility functions."
What are these utility functions of which you speak? Are they C library functions or functions that somebody else wrote?
If they are C library functions, note that not all library functions are reentrant, so if those non-reentrant functions are called from mainline code and ISRs, you could have a problem. The manual lists which library functions are reentrant:
http://www.keil.com/support/man/docs/ca/ca_library.htm
On the other hand, if somebody else wrote the utility functions and you have their source code, you should be able to judge for yourself whether or not they are reentrant.