mirror of
https://github.com/micropython/micropython.git
synced 2026-01-04 11:10:14 +01:00
esp32/machine_pwm: Implement duty_u16() and duty_ns() PWM methods.
The methods duty_u16() and duty_ns() are implemented to match the existing docs. The duty will remain the same when the frequency is changed. Standard ESP32 as well as S2, S3 and C3 are supported. Thanks to @kdschlosser for the fix for rounding in resolution calculation. Documentation is updated and examples expanded for esp32, including the quickref and tutorial. Additional notes are added to the machine.PWM docs regarding limitations of hardware PWM.
This commit is contained in:
committed by
Damien George
parent
a7fa18c203
commit
b491967bbd
@@ -193,6 +193,8 @@ soft_reset_exit:
|
||||
mp_hal_stdout_tx_str("MPY: soft reboot\r\n");
|
||||
|
||||
// deinitialise peripherals
|
||||
machine_pwm_deinit_all();
|
||||
// TODO: machine_rmt_deinit_all();
|
||||
machine_pins_deinit();
|
||||
machine_deinit();
|
||||
usocket_events_deinit();
|
||||
|
||||
Reference in New Issue
Block a user