Could anybody help me to resolve the re-entrant funcion issue in cosmic. I am using +modc memory model and I am putting @interrupt @stack before each interrupt handler but still the problem persists. I am getting error Reentrant function exists Many thanks in advance PraveenG
To make a function reentrant all you have to do is use the @stack ,eg.
@stack void MyFunc(void) also make sure it is declared the same in the header file. Remember interrupt functions are always stack based by default in cosmic regardless of memory model used, so the @stack for an interrupt function is not necessary. By the sounds of your problem you are calling a normal function from within your interrupt routine, this function will need to be declared with the @stack option not the einterrupt. Regards sjo
Posted on February 06, 2004 at 04:19as SJO says, the message you get means the linker has found a function that is called both from main and interrupt. This function must be made reentrant (which is not the case by default, because you're using +modc) using @stack or your application may crash at run time. Regards, Luca