Mail Archives: djgpp/1996/06/16/03:40:05
In article <Pine DOT VUL DOT 3 DOT 91 DOT 960613123358 DOT 3422E-100000 AT zeus DOT adv-boeblingen DOT de>
steinke AT zeus DOT adv-boeblingen DOT de "Lennart Steinke" writes:
> Hi!
>
> I wrote a ISR which hook into the timer interrupt and updates
> a global variable.
>
> say this var is <g> ... my code looks something like
>
> int b;
>
> b=g;
> while (b==g);
>
>
> this loop is always optimazed to
> while(1);
>
> ist there a possibilty to tell gcc not to touch the code
> (similar to the __volatile__ keyword)?
Well, I'm not too well versed in the use of interrupts etc, but a possible
if kludgy way to solve your problem is to put your cide in a function in a
separate source file, which you compile to a .o with no optimisation.
..splitbung
--
* TQ 1.0 * The 'Just So Quotes'.
"MOM, CAN I SET FIRE TO MY BED MATTRESS?" "No, Calvin."
"CAN I RIDE MY TRICYCLE ON THE ROOF?" "No, Calvin."
"Then can I have a cookie?" "No, Calvin."
("She's on to me.")
- Raw text -