CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Interrupt Warning Message

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Lestard



Joined: 13 Mar 2004
Posts: 2

View user's profile Send private message

Interrupt Warning Message
PostPosted: Sat Mar 13, 2004 12:30 pm     Reply with quote

I wrote a subroutine (subprogram), which handles a LCD and so on.
The Code looks like the following:

void init(void);

void main()
{


init(); //This subprogramm initializes an LCD and so on

while(1)
{
//There is some code
}
}

After compiling the whole program, the compiler gives me
the warning "Interrupts disabled during call to prevent re-entrancy".
Why does the compiler does this?
And there is a second problem:
e.g.
enable_interrupts(int_rda);
enable_interrupts(global);

The PIC does not execute the line "enable_interrupts(global);".
I also tried to change these two lines, but the PIC does nothing.
What could be the problem?

Thanks for every useful reply
Ttelmah
Guest







Re: Interrupt Warning Message
PostPosted: Sat Mar 13, 2004 12:46 pm     Reply with quote

Lestard wrote:
I wrote a subroutine (subprogram), which handles a LCD and so on.
The Code looks like the following:

void init(void);

void main()
{


init(); //This subprogramm initializes an LCD and so on

while(1)
{
//There is some code
}
}

After compiling the whole program, the compiler gives me
the warning "Interrupts disabled during call to prevent re-entrancy".
Why does the compiler does this?
And there is a second problem:
e.g.
enable_interrupts(int_rda);
enable_interrupts(global);

The PIC does not execute the line "enable_interrupts(global);".
I also tried to change these two lines, but the PIC does nothing.
What could be the problem?

Thanks for every useful reply

The compiler will disable interrupts 'round' a routine, if the same routine is called inside an interrupt handler, and elsewhere in the code. This is to prevent the routine being called from inside itself (re-entrancy). This is not basically supported by the processors architecture.
If the compiler is preventing enable_interrupts(global) from working inside an interrupt, this is a _very good thing_, and is preventing an allmost certain crash. Basically, till you have exited the interrupt handler, and the registers have been restored, you must not enable interrupts. This has caused many crashes in the past, and if the compiler is blocking this, it represents an attempt to stop you 'shooting yourself in your foot'...

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group