Skip to content

Commit 923f2f4

Browse files
Fix boolean/bitmask typo in starting waveform
1 parent 78fba4c commit 923f2f4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/esp8266/core_esp8266_waveform.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t
134134
}
135135

136136
uint32_t mask = 1<<pin;
137-
if (!waveformEnabled && mask) {
137+
if (!(waveformEnabled & mask)) {
138138
// Actually set the pin high or low in the IRQ service to guarantee times
139139
wave->nextServiceCycle = GetCycleCount() + MicrosecondsToCycles(1);
140140
waveformToEnable |= mask;
@@ -143,7 +143,7 @@ int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t
143143
}
144144
timer1_write(MicrosecondsToCycles(1)); // Cause an interrupt post-haste
145145
while (waveformToEnable) {
146-
delay(1); // Wait for waveform to update
146+
delay(0); // Wait for waveform to update
147147
}
148148
}
149149

0 commit comments

Comments
 (0)