Merge pull request #13702 from s-hadinger/gpio_rest

ESP32 fix leftover GPIO configuration after restart
This commit is contained in:
Theo Arends 2021-11-17 09:17:46 +01:00 committed by GitHub
commit 3b9f3c621f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -6,6 +6,7 @@ All notable changes to this project will be documented in this file.
## [10.0.0.3]
### Added
- Autoconfiguration for ESP32 and variants
- ESP32 fix leftover GPIO configuration after restart
### Changed
- ESP8266 Gratuitous ARP enabled and set to 60 seconds (#13623)

View File

@ -1651,6 +1651,22 @@ void ResetPwm(void)
/********************************************************************************************/
#ifdef ESP32
// Since ESP-IDF 4.4, GPIO matrix or I/O is not reset during a restart
// and GPIO configuration can get stuck because of leftovers
//
// This patched version of pinMode forces a full GPIO reset before setting new mode
//
extern "C" void ARDUINO_ISR_ATTR __pinMode(uint8_t pin, uint8_t mode);
extern "C" void ARDUINO_ISR_ATTR pinMode(uint8_t pin, uint8_t mode) {
gpio_reset_pin((gpio_num_t)pin);
__pinMode(pin, mode);
}
#endif
/********************************************************************************************/
void GpioInit(void)
{
if (!ValidModule(Settings->module)) {