Journal Journal: [avr] Annoyances
Well, gcc-avr has been trying hard to annoy me all day: firstly, the optimizer seems to be rather over-zealous, optimizing away entire code blocks it thinks does nothing (but which in fact has a profound effect on a routine driven by a timer interrupt). Declaring the variables as 'volatile' as suggested by the documentation had no effect. Putting a useless function call into the code block made it work, or turning optimization off made it work. There are probably some subtleties that I'm miss