File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Expand file tree Collapse file tree 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() {
362362 waveNextEventCcy = wave.endDutyCcy = wave.nextPeriodCcy ;
363363 }
364364 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;
370373 }
371374 else {
372- waveNextEventCcy = wave.endDutyCcy ;
375+ wave.adjDutyCcys = overshootCcys;
376+ waveNextEventCcy = wave.nextPeriodCcy ;
373377 }
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 ;
381378 }
382379 else {
383380 waveNextEventCcy = wave.nextPeriodCcy ;
You can’t perform that action at this time.
0 commit comments