Hi
the linker generates a serious stack warning because I have a function which is called within the handling of a rb0 interrupt and also in the program main loop. I can imagine that this can cause problems when the function is called by the interrupt routine and within the main() loop at the same time.
But under specific conditions the rb0 interrupt handler (which contains that function call) is disabling it's interrupt and activates a flag. Depending on that flag the mentioned funtion is called in the main loop.
So that function, referred to in the warning, can never be called in the interrupt routine at the time itīs also being executed because of a call within the main loop!
This is still all tricky or itīs not a problem to ignore this warning under this conditions?
little 'pseudo code' illustrates what's happening and causes the warning to be generated
CODE
void interrupt( void ) {
//falling edge portB.0
if( intcon & (1<<INTF) ) {
if ( switchPort == 1 ) {
Rb0Handler();
activateDoSomething= 1;
clear_bit( intcon, INTIE ); // disable this interrupt!
}
else MyRoutine();
clear_bit( intcon, INTF ); //clear INTIE interrupt bit
} // if INTF
return;
}
////////////////////////////
void main() {
init();
activateDoSomething= 0;
set_bit( intcon, INTIE );
while( 1 ) {
if ( activateDoSomething ) {
DoSomething();
MyRoutine();
activateDoSomething= 0;
set_bit( intcon, INTIE ); // enable that interrupt again
} // if
} // while
} // main