@@ -342,13 +342,14 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
342
342
Waveform& wave = waveform.pins [pin];
343
343
344
344
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 ) {
352
353
uint32_t nextEdgeCcy;
353
354
if (waveform.states & (1UL << pin)) {
354
355
// active configuration and forward are 100% duty
@@ -410,17 +411,17 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
410
411
(WaveformMode::EXPIRES == wave.mode && static_cast <int32_t >(nextEdgeCcy - wave.expiryCcy ) > 0 ) ?
411
412
wave.expiryCcy : nextEdgeCcy;
412
413
}
413
- }
414
414
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 ;
420
424
}
421
- }
422
- else if (static_cast <int32_t >(isrNextEventCcy - wave.nextEventCcy ) > 0 ) {
423
- isrNextEventCcy = wave.nextEventCcy ;
424
425
}
425
426
426
427
now = getScaledCcyCount (isrStartCcy);
0 commit comments