File tree 1 file changed +10
-13
lines changed 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -362,22 +362,19 @@ static ICACHE_RAM_ATTR void timer1Interrupt() {
362
362
waveNextEventCcy = wave.endDutyCcy = wave.nextPeriodCcy ;
363
363
}
364
364
else {
365
- if (wave.autoPwm && static_cast <int32_t >(now - wave.nextPeriodCcy ) >= 0 ) {
366
- wave.endDutyCcy += periodCcys - overshootCcys;
367
- wave.nextPeriodCcy += periodCcys;
368
- if (static_cast <int32_t >(now - wave.endDutyCcy ) >= 0 ) {
369
- waveNextEventCcy = wave.nextPeriodCcy ;
365
+ if (wave.autoPwm ) {
366
+ if (static_cast <int32_t >(now - wave.nextPeriodCcy ) >= 0 ) {
367
+ wave.endDutyCcy += periodCcys - overshootCcys;
368
+ wave.nextPeriodCcy += periodCcys;
369
+ waveNextEventCcy = wave.endDutyCcy ;
370
+ // adapt expiry such that it occurs during intended cycle
371
+ if (WaveformMode::EXPIRES == wave.mode )
372
+ wave.expiryCcy += periodCcys;
370
373
}
371
374
else {
372
- waveNextEventCcy = wave.endDutyCcy ;
375
+ wave.adjDutyCcys = overshootCcys;
376
+ waveNextEventCcy = wave.nextPeriodCcy ;
373
377
}
374
- // adapt expiry such that it occurs during intended cycle
375
- if (WaveformMode::EXPIRES == wave.mode )
376
- wave.expiryCcy += periodCcys;
377
- }
378
- else if (wave.autoPwm ) {
379
- wave.adjDutyCcys = overshootCcys;
380
- waveNextEventCcy = wave.nextPeriodCcy ;
381
378
}
382
379
else {
383
380
waveNextEventCcy = wave.nextPeriodCcy ;
You can’t perform that action at this time.
0 commit comments