diff options
author | robert-hh <robert@hammelrath.com> | 2023-04-27 21:21:56 +0200 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2023-05-04 13:18:58 +1000 |
commit | 7952694a3cbf54ddc07268b84c45c80a8c6169e8 (patch) | |
tree | 2f296ff03a89327c6724e0bfc2dbf6a5e3fac394 /docs/pyboard/tutorial/assembler.rst | |
parent | 0b3b508d1d681e705c4c228cb846d10549e644af (diff) | |
download | micropython-7952694a3cbf54ddc07268b84c45c80a8c6169e8.tar.gz micropython-7952694a3cbf54ddc07268b84c45c80a8c6169e8.zip |
rp2/machine_pwm: Add duty_x() checks and return 0 if PWM is not started.
Changes in this commit:
- Limit duty_u16() to 65535 and duty_ns() to the period duration.
- Return 0 for pwm.freq() if the frequency has not been set yet.
- Return 0 for pwm.duty_us16() and duty_ns() unless both frequency and
duty cycle have been set.
- Initialize the pin to PWM at the very end of the constructor, to avoid
possible glitches on the pin when setting up the PWM.
Diffstat (limited to 'docs/pyboard/tutorial/assembler.rst')
0 files changed, 0 insertions, 0 deletions