[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] reentrant interrupt service routine
From: |
Pink Boy |
Subject: |
Re: [avr-gcc-list] reentrant interrupt service routine |
Date: |
Tue, 1 Apr 2008 11:37:57 -0700 (PDT) |
Sven Schlender sez,
> I just wondering if there are some experiences with
> reentrant interrupt service routines with avr-gcc.
I have a timer routine that is reentrant.
> Is this a known issue? How the avr-gcc handle
> it? Is there a possibility to find such reentrant calls
> with a compiler or linker command line option?
One thing I've found that is important is to have a
way of knowing that you are already in the ISR. I
do the following.
SIGNAL(BLAH_INT)
{
static volatile uint8_t int_blk = 0;
/* do some basic timer stuff */
if(int_blk)
return; // Oops we're still here
int_blk = 1;
sei();
/* do stuff that takes a while */
cli(); // turn ints back off
blk = 0; // reset blk flag;
}
PS: The volatile prefix is needed to keep the new gcc compilers
dirty mitts off of int_blk, otherwise it will very wrongly
optimize it away.
Mr Foo
- Re: AW: [avr-gcc-list] reentrant interrupt service routine, (continued)
- Re: AW: [avr-gcc-list] reentrant interrupt service routine, Dmitry K., 2008/04/02
- Re: AW: [avr-gcc-list] reentrant interrupt service routine, Mark Litwack, 2008/04/02
- Re: AW: [avr-gcc-list] reentrant interrupt service routine, Mark Litwack, 2008/04/07
- RE: AW: [avr-gcc-list] reentrant interrupt service routine, Weddington, Eric, 2008/04/07
- Re: [avr-gcc-list] reentrant interrupt service routine, hutchinsonandy, 2008/04/07
- Re: [avr-gcc-list] reentrant interrupt service routine, Bernard Fouché, 2008/04/07
- RE: [avr-gcc-list] reentrant interrupt service routine, Weddington, Eric, 2008/04/07
- Re: AW: [avr-gcc-list] reentrant interrupt service routine, Mark Litwack, 2008/04/07
- RE: AW: [avr-gcc-list] reentrant interrupt service routine, Weddington, Eric, 2008/04/07
Re: [avr-gcc-list] reentrant interrupt service routine, Joerg Wunsch, 2008/04/02
Re: [avr-gcc-list] reentrant interrupt service routine,
Pink Boy <=