Commit b691aa0
esp8266/esppwm: Always start timer to avoid glitch from full to nonfull.
The PWM at full value was not considered as an "active" channel so if no other channel was used the timer used to mange PWM was not started. So when another duty value was set the PWM timer restarted and there was a visible glitch when driving LEDs. Such a glitch can be seen with the following code (assuming active-low LED on pin 0): p = machine.PWM(machine.Pin(0)) p.duty(1023) # full width, LED is off p.duty(1022) # LED flashes brightly then goes dim This patch fixes the glitch.1 parent 0acf868 commit b691aa0
1 file changed
+3
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
| 193 | + | |
| 194 | + | |
198 | 195 | | |
199 | 196 | | |
200 | 197 | | |
| |||
319 | 316 | | |
320 | 317 | | |
321 | 318 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
| 319 | + | |
327 | 320 | | |
328 | 321 | | |
329 | 322 | | |
| |||
0 commit comments