Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a0e3259

Browse filesBrowse files
committed
Expired pins must not be checked for next event.
1 parent 5cabb91 commit a0e3259
Copy full SHA for a0e3259

File tree

Expand file treeCollapse file tree

1 file changed

+17
-16
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+17
-16
lines changed

‎cores/esp8266/core_esp8266_waveform.cpp

Copy file name to clipboardExpand all lines: cores/esp8266/core_esp8266_waveform.cpp
+17-16Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -342,13 +342,14 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
342342
Waveform& wave = waveform.pins[pin];
343343

344344
const uint32_t overshootCcys = now - wave.nextEventCcy;
345-
if (static_cast<int32_t>(overshootCcys) >= 0) {
346-
if (WaveformMode::EXPIRES == wave.mode && wave.nextEventCcy == wave.expiryCcy) {
347-
// Disable any waveforms that are done
348-
waveform.enabled &= ~(1UL << pin);
349-
busyPins &= ~(1UL << pin);
350-
}
351-
else {
345+
if (WaveformMode::EXPIRES == wave.mode && wave.nextEventCcy == wave.expiryCcy &&
346+
static_cast<int32_t>(overshootCcys) >= 0) {
347+
// Disable any waveforms that are done
348+
waveform.enabled &= ~(1UL << pin);
349+
busyPins &= ~(1UL << pin);
350+
}
351+
else {
352+
if (static_cast<int32_t>(overshootCcys) >= 0) {
352353
uint32_t nextEdgeCcy;
353354
if (waveform.states & (1UL << pin)) {
354355
// active configuration and forward are 100% duty
@@ -410,17 +411,17 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
410411
(WaveformMode::EXPIRES == wave.mode && static_cast<int32_t>(nextEdgeCcy - wave.expiryCcy) > 0) ?
411412
wave.expiryCcy : nextEdgeCcy;
412413
}
413-
}
414414

415-
if (static_cast<int32_t>(wave.nextEventCcy - isrTimeoutCcy) >= 0) {
416-
busyPins &= ~(1UL << pin);
417-
if (static_cast<int32_t>(waveform.nextEventCcy - wave.nextEventCcy) > 0) {
418-
waveform.nextEventCcy = wave.nextEventCcy;
419-
waveform.nextPin = pin;
415+
if (static_cast<int32_t>(wave.nextEventCcy - isrTimeoutCcy) >= 0) {
416+
busyPins &= ~(1UL << pin);
417+
if (static_cast<int32_t>(waveform.nextEventCcy - wave.nextEventCcy) > 0) {
418+
waveform.nextEventCcy = wave.nextEventCcy;
419+
waveform.nextPin = pin;
420+
}
421+
}
422+
else if (static_cast<int32_t>(isrNextEventCcy - wave.nextEventCcy) > 0) {
423+
isrNextEventCcy = wave.nextEventCcy;
420424
}
421-
}
422-
else if (static_cast<int32_t>(isrNextEventCcy - wave.nextEventCcy) > 0) {
423-
isrNextEventCcy = wave.nextEventCcy;
424425
}
425426

426427
now = getScaledCcyCount(isrStartCcy);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.