Skip to content

Commit 6e0c0e3

Browse files
earlephilhowerdevyte
authored andcommitted
Only stop waveforms actually running in ISR (#5308)
The ISR could end up writing a 0 to a GPIO that had previously been stopped, effectively overwriting user writes to those pins. Fix to only actually disable and write when a pin was enabled and times out. Fixes #5306
1 parent e876170 commit 6e0c0e3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cores/esp8266/core_esp8266_waveform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
282282
// Check for timed-out waveforms out of the high-frequency toggle loop
283283
for (size_t i = 0; i < countof(waveform); i++) {
284284
Waveform *wave = &waveform[i];
285-
if (wave->timeLeftCycles) {
285+
if (wave->enabled && wave->timeLeftCycles) {
286286
// Check for unsigned underflow with new > old
287287
if (deltaCycles >= wave->timeLeftCycles) {
288288
// Done, remove!

0 commit comments

Comments
 (0)