Interrupt variable exceeds volatile long's 8bit size

Doesn't matter if the interrupt is external or internal, you need to make it volatile if it's going to be updated in an interrupt routine and read in the main code. Otherwise the optimiser within the compiler will make incorrect assumptions about when the value might have changed.

2 Likes