AnsweredAssumed Answered

calling ISRs...?

Question asked by Doug Paulsen on Oct 28, 2014
Latest reply on Nov 3, 2014 by Pascal Irrle

This is one of those areas where it would be really helpful to subvert the way things are designed to work:  In Codewarrior 6.3, is it possible to call an Interrupt Service Routine?  I can hear people cringing already, but let me explain.


I have a Coldfire V1 project to which I have just added embedded End Of Line test code.  While the EOL tests are running of course regular operations need to be suspended and interrupts disabled.  In some parts of the test, the functionality already coded in an ISR is needed.  I have tried to call the ISR directly, which works fine right up to the ISR's RTE instruction, which results in a trap instruction.  Or in other words, bad news.


I can see from the RTE instruction description, to make a simple call to an ISR will require (at best) some manual stack loading prior to the call in order for the return address to be found, but is there a better way to do this?  Or even an approved way to do this?


Of course, I could just copy the ISR contents to a regular function and call that, but there's a space waste involved, plus the maintenance problem to keep the two code sections coordinated.  Or perhaps have the functionality in one regular function which is called from both the ISR and from the EOL test?  That's probably my fall back, but that ISR took a lot of tuning, and I'd prefer not to mess with it...


Thanks for any suggestions!