View previous topic :: View next topic |
Author |
Message |
franckcl
Joined: 12 Sep 2003 Posts: 32 Location: France (Paris)
|
WARNING: Interrupts disabled during call to prevent re-entr |
Posted: Tue Jan 06, 2004 9:44 am |
|
|
Hi,
When I call a function which is called also by the timer #3 I have this :
"Warning 216 :Interrupts disabled during call to prevent re-entrancy"
but the problem is my program does not run.
I have tried to enable interrupt at the end of my function but it's the same problem.
I would like to enable and disable interrupt myself, how to do ?
Thank you
Franck |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jan 06, 2004 2:38 pm |
|
|
Post a small (but complete) program that demonstrates the
problem, and that can be compiled for testing. I suspect
that we can recommend a different way of writing the program,
to avoid the problem. |
|
|
franckcl
Joined: 12 Sep 2003 Posts: 32 Location: France (Paris)
|
|
Posted: Wed Jan 07, 2004 2:29 am |
|
|
My program is too long to post it here.
So, is there a pragma to disable this feature ???
Here is a very small example :
//-------------------------------------------------------
#int_TIMER3 // Timer 20ms
TIMER3_isr()
{
// here I read the keyboard
if (Key1isPressed) SetLight(0xFFFF); // Each bit is a light
if (Key2isPressed) SetLight(0x0000); // Each bit is a light
return(0);
}
//-------------------------------------------------------
void SetLight(int16 BitmapLigh)
{
// (...)
}
//-------------------------------------------------------
void main()
{
init(); // call this function to initialize variables, timers, registers....
SetLight(0); // at reset, turn off all lights
while (true)
{
(...)
if (EventTrue) SetLight(0); // turn off, all lights
(...)
}
} |
|
|
|