I think you need to clarify your question a little bit. However, given the function name, "isr", lets assume that you are asking about interrupt functions. For example: __interrupt void isr(void) { if (some_condition) { return; } // Do something. } In this case, the generated code will test the condition and, if it is true, execute a RETI instruction. Of course, the generated code will perform normal cleanup like restoring the stack pointer etc. Anyway, all this will be taken care of by the compiler, so you don't have to worry about it. An interrupt routine can't take arguments -- an interrupt can occur at any time, e.g. when a timer triggers or an external event occurs. When it occurs, the interrupt function is executed. There is no one involved that can set up and pass the arguments to the routine when the interrupt occurs. Of course, the interrupt function can call other, normal, functions with arguments. -- Anders Lindgren, IAR Systems, author of the IAR compiler for MSP430
↧