We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I call some sub-routine in ISR. And I mark the ISR as "using 1". But I find out this will lead to the error of parameters passing from ISR to the sub-routine. How come?
... interrupt using 1 { functionone(); } void functionone (void) using 1 { } Erik
Erik, That is not the best way. Each function that has a using will save the PSW on the stack (which is a waste). Restoring the PSW from the stack destroys any return value of type bit. Using REGISTERBANK is simpler. For example:
#pragma REGISTERBANK(1) bit functionone(void) { return( 1 ); } void functiontwo( char c ) { ... } myISR interrupt n using 1 { if( functionone() ) functiontwo( 'c' ); }
You live and learn. Anyhow we both agree that a subroutine called from a routine/ISR using a given bank must "know" which bank to operate in. Erik