mirror of https://github.com/arendst/Tasmota.git
Merge pull request #13345 from s-hadinger/esp32_nopsram
Reset GPIO16/17 on ESP32 only for non-pico
This commit is contained in:
commit
58bb709202
|
@ -78,6 +78,10 @@
|
|||
// Structs
|
||||
#include "settings.h"
|
||||
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
#include "soc/efuse_reg.h"
|
||||
#endif
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Global variables
|
||||
\*********************************************************************************************/
|
||||
|
@ -222,6 +226,18 @@ void setup(void) {
|
|||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_IDF_TARGET_ESP32
|
||||
// restore GPIO16/17 if no PSRAM is found
|
||||
if (!FoundPSRAM()) {
|
||||
// test if the CPU is not pico
|
||||
uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
|
||||
uint32_t pkg_version = chip_ver & 0x7;
|
||||
if (pkg_version <= 3) { // D0WD, S0WD, D2WD
|
||||
gpio_reset_pin(GPIO_NUM_16);
|
||||
gpio_reset_pin(GPIO_NUM_17);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
RtcPreInit();
|
||||
SettingsInit();
|
||||
|
||||
|
|
Loading…
Reference in New Issue