Why keep ISR code terse?

Another gotcha when using interrupts and even when using short ISR routines. When the main loop code goes to read the global volatile int or other larger then one byte variable you need to consider disabling interrupts, reading the variable and then re-enabling interrupts, to make sure you get the whole variable in a 'atomic' manner that can not have been changed while reading a multi byte variable in the loop code.

That probably doesn't explain the issue well, but it is what it is. :wink:

Lefty