mirror of https://github.com/arendst/Tasmota.git
Merge pull request #13702 from s-hadinger/gpio_rest
ESP32 fix leftover GPIO configuration after restart
This commit is contained in:
commit
3b9f3c621f
|
@ -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)
|
||||
|
|
|
@ -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)) {
|
||||
|
|
Loading…
Reference in New Issue