Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 3b28ee5

Browse filesBrowse files
committed
Small refactoring, remove code path that is never taken even at 3x25kHz/1023 PWM.
1 parent 9eb92f0 commit 3b28ee5
Copy full SHA for 3b28ee5

File tree

Expand file treeCollapse file tree

1 file changed

+10
-13
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+10
-13
lines changed

‎cores/esp8266/core_esp8266_waveform.cpp

Copy file name to clipboardExpand all lines: cores/esp8266/core_esp8266_waveform.cpp
+10-13Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff 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;

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.