Go Down

Topic: While loop not behaving as expected (Read 4678 times) previous topic - next topic


Nick Gammon

Ah, i understand now, in this specific program I was engaging the while loop from within an ISR.  Thanks a heap fro explainin it.

Cheers Guys, this thread has been very helpful.


No it can't. Interrupt handlers turn interrupts off. Otherwise that would happen. For example, the timer interrupts that increments millis() might happen to be interrupted by incoming serial data....  Serial comms on version 1.0 of the IDE is (are?) done by an interrupt handler, and these are disabled during your while loop (purely because it is called from an interrupt handler).

Thanks! Very helpful in understanding Interrupts better.

Go Up