Commit 9e0d06f
analogWrite: add digitalWrite fallback for analogWrite without PWM
When analogWrite() is called for a pin that cannot be resolved to a PWM channel,
or when the resolved PWM device is not ready,
fall back to GPIO output instead of returning without changing the pin state.
This matches the common Arduino behavior for pins without hardware PWM support:
values above the midpoint drive the pin HIGH,
while lower values drive it LOW. Existing hardware PWM behavior is unchanged.
Co-Authored-by: Satvik <145106491+vs11official@users.noreply.github.com>
Signed-off-by: TOKITA Hiroshi <tokita.hiroshi@gmail.com>1 parent 4069733 commit 9e0d06f
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
| 403 | + | |
| 404 | + | |
403 | 405 | | |
404 | 406 | | |
405 | 407 | | |
406 | 408 | | |
| 409 | + | |
| 410 | + | |
407 | 411 | | |
408 | 412 | | |
409 | 413 | | |
| |||
0 commit comments