Commit 4ac5092
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 1316b52 commit 4ac5092
1 file changed
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
436 | 436 | | |
437 | 437 | | |
438 | 438 | | |
| 439 | + | |
| 440 | + | |
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
442 | 444 | | |
| 445 | + | |
| 446 | + | |
443 | 447 | | |
444 | 448 | | |
445 | 449 | | |
| |||
0 commit comments