Skip to content

Commit 792684d

Browse files
committed
Guards are in place, so xor rather than and bitwise not.
1 parent b1e3140 commit 792684d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cores/esp8266/core_esp8266_waveform.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,8 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
348348
if (WaveformMode::EXPIRES == wave.mode && wave.nextEventCcy == wave.expiryCcy &&
349349
static_cast<int32_t>(overshootCcys) >= 0) {
350350
// Disable any waveforms that are done
351-
waveform.enabled &= ~pinBit;
352-
busyPins &= ~pinBit;
351+
waveform.enabled ^= pinBit;
352+
busyPins ^= pinBit;
353353
}
354354
else {
355355
if (static_cast<int32_t>(overshootCcys) >= 0) {
@@ -371,7 +371,7 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
371371
}
372372
else {
373373
nextEdgeCcy = wave.nextPeriodCcy;
374-
waveform.states &= ~pinBit;
374+
waveform.states ^= pinBit;
375375
if (16 == pin) {
376376
GP16O = 0;
377377
}
@@ -416,7 +416,7 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
416416
}
417417

418418
if (static_cast<int32_t>(wave.nextEventCcy - isrTimeoutCcy) >= 0) {
419-
busyPins &= ~pinBit;
419+
busyPins ^= pinBit;
420420
if (static_cast<int32_t>(waveform.nextEventCcy - wave.nextEventCcy) > 0) {
421421
waveform.nextEventCcy = wave.nextEventCcy;
422422
waveform.nextPin = pin;

0 commit comments

Comments
 (0)