mirror of
https://github.com/esphome/esphome.git
synced 2025-09-16 18:22:22 +01:00
Calculate PWM wrap dynamically whenever the frequency is changed (#4294)
fixes https://github.com/esphome/issues/issues/3841
This commit is contained in:
@@ -34,6 +34,7 @@ class RP2040PWM : public output::FloatOutput, public Component {
|
||||
|
||||
InternalGPIOPin *pin_;
|
||||
float frequency_{1000.0};
|
||||
uint16_t wrap_{65535};
|
||||
/// Cache last output level for dynamic frequency updating
|
||||
float last_output_{0.0};
|
||||
bool frequency_changed_{false};
|
||||
|
Reference in New Issue
Block a user