mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-21 21:22:31 +03:00
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
This commit is contained in:
committed by
Develo
parent
e876170cf4
commit
6e0c0e3dcc
@ -282,7 +282,7 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
|
||||
// Check for timed-out waveforms out of the high-frequency toggle loop
|
||||
for (size_t i = 0; i < countof(waveform); i++) {
|
||||
Waveform *wave = &waveform[i];
|
||||
if (wave->timeLeftCycles) {
|
||||
if (wave->enabled && wave->timeLeftCycles) {
|
||||
// Check for unsigned underflow with new > old
|
||||
if (deltaCycles >= wave->timeLeftCycles) {
|
||||
// Done, remove!
|
||||
|
Reference in New Issue
Block a user