diff --git a/CHANGELOG.md b/CHANGELOG.md index 471ceb7af..ed3ff48d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ All notable changes to this project will be documented in this file. ### Added - HASPmota `pb.delete` to delete an object (#20735) - LVGL and HASPmota typicons font (#20742) +- HASPmota more attributes (#20744) ### Breaking Changed @@ -17,6 +18,7 @@ All notable changes to this project will be documented in this file. - HASPmota fix and improve demo with pixel-perfect fonts (#20734) ### Fixed +- ESP32 PWM activity on unconfigured PWM GPIOs (#20732) ### Removed @@ -179,7 +181,6 @@ All notable changes to this project will be documented in this file. ### Added - DeepSleep support through TIMERS (#20117) - Command ``WebCanvas linear-gradient(#F02 7%,#F93,#FF4,#082,#00F,#708 93%)`` to set GUI canvas -- HASPmota more attributes ### Breaking Changed - Remove Berry `every_200ms` event which didn't work anyways (#20205) diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 8a34730fa..6f51d26aa 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -128,7 +128,9 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm - Berry class `int64` made immutable [#20727](https://github.com/arendst/Tasmota/issues/20727) - LVGL make lv_touch_3_buttons more responsive [#20728](https://github.com/arendst/Tasmota/issues/20728) - HASPmota fix and improve demo with pixel-perfect fonts [#20734](https://github.com/arendst/Tasmota/issues/20734) +- HASPmota more attributes [#20744](https://github.com/arendst/Tasmota/issues/20744) ### Fixed +- ESP32 PWM activity on unconfigured PWM GPIOs [#20732](https://github.com/arendst/Tasmota/issues/20732) ### Removed diff --git a/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.cpp b/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.cpp index 86133e2eb..21bdc542e 100644 --- a/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.cpp +++ b/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.cpp @@ -323,7 +323,7 @@ int32_t analogAttach(uint32_t pin, bool output_invert) { // returns ledc chan return chan; } -void analogDetach(void) { +void analogDetachAll(void) { for (uint32_t pin = 0; pin < SOC_GPIO_PIN_COUNT; pin++) { if (pin_to_channel[pin] > 0) { #if ESP_IDF_VERSION_MAJOR < 5 diff --git a/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h b/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h index 325654247..0a5f99a3b 100644 --- a/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h +++ b/lib/libesp32/ESP32-to-ESP8266-compat/src/esp8266toEsp32.h @@ -45,6 +45,7 @@ extern "C" uint32_t ledcReadFreq2(uint8_t chan); uint8_t ledcReadResolution(uint8_t chan); + // // analogAttach - attach a GPIO to a hardware PWM // @@ -55,7 +56,11 @@ uint8_t ledcReadResolution(uint8_t chan); // Returns: hardware channel number, or -1 if it failed int32_t analogAttach(uint32_t pin, bool output_invert = false); // returns the ledc channel, or -1 if failed. This is implicitly called by analogWrite if the channel was not already allocated -void analogDetach(void); +// +// analogDetachAll - detach all attached GPIOs from a hardware PWM +// +// This solves ghost PWM activity on reconfigured GPIOs after a restart +void analogDetachAll(void); // change both freq and range // `0`: set to global value diff --git a/tasmota/tasmota_support/support_pwm.ino b/tasmota/tasmota_support/support_pwm.ino index 0e27a3491..0cd1adff1 100644 --- a/tasmota/tasmota_support/support_pwm.ino +++ b/tasmota/tasmota_support/support_pwm.ino @@ -183,6 +183,7 @@ void ResetPwm(void) TasmotaGlobal.pwm_value[i] = 0; } PwmApplyGPIO(true); + analogDetachAll(); // Fix PWM activity on unconfigured PWM GPIOs after restart } void CmndPwmfrequency(void) diff --git a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino index 263a42043..1124a60ea 100644 --- a/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino +++ b/tasmota/tasmota_xdrv_driver/xdrv_01_9_webserver.ino @@ -1816,11 +1816,6 @@ void HandleModuleConfiguration(void) { if (Webserver->hasArg(F("save"))) { ModuleSaveSettings(); - -#ifdef CONFIG_IDF_TARGET_ESP32 - analogDetach(); -#endif - WebRestart(1); return; }