cancel
Showing results for 
Search instead for 
Did you mean: 

Cosmic re-entrant functions

parveen
Associate II
Posted on February 06, 2004 at 04:19

Cosmic re-entrant functions

3 REPLIES 3
parveen
Associate II
Posted on February 05, 2004 at 08:33

Hello All,

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
sjo
Associate II
Posted on February 05, 2004 at 18:04

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
luca239955_st
Associate III
Posted on February 06, 2004 at 04:19

as 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