mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-23 18:56:38 +00:00
More ESP32 compatibility
This commit is contained in:
parent
d2b7b4012f
commit
538dfbef2e
@ -1675,17 +1675,28 @@ void ModuleSaveSettings(void)
|
||||
if (ValidGPIO(i, cmodule.io[i])) {
|
||||
snprintf_P(webindex, sizeof(webindex), PSTR("g%d"), i);
|
||||
WebGetArg(webindex, tmp, sizeof(tmp));
|
||||
Settings.my_gp.io[i] = (!strlen(tmp)) ? 0 : atoi(tmp);
|
||||
gpios += F(", " D_GPIO ); gpios += String(i); gpios += F(" "); gpios += String(Settings.my_gp.io[i]);
|
||||
uint8_t value = (!strlen(tmp)) ? 0 : atoi(tmp);
|
||||
#ifdef ESP8266
|
||||
Settings.my_gp.io[i] = value;
|
||||
#else // ESP32
|
||||
if (i == ADC0_PIN) {
|
||||
Settings.my_adc0 = value;
|
||||
} else {
|
||||
Settings.my_gp.io[i] = value;
|
||||
}
|
||||
#endif // ESP8266 - ESP32
|
||||
gpios += F(", " D_GPIO ); gpios += String(i); gpios += F(" "); gpios += String(value);
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef ESP8266
|
||||
#ifndef USE_ADC_VCC
|
||||
// WebGetArg("g17", tmp, sizeof(tmp));
|
||||
WebGetArg("g" STR(ADC0_PIN), tmp, sizeof(tmp));
|
||||
Settings.my_adc0 = (!strlen(tmp)) ? 0 : atoi(tmp);
|
||||
gpios += F(", " D_ADC "0 "); gpios += String(Settings.my_adc0);
|
||||
#endif // USE_ADC_VCC
|
||||
#endif // ESP8266
|
||||
|
||||
AddLog_P2(LOG_LEVEL_INFO, PSTR(D_LOG_MODULE "%s " D_CMND_MODULE "%s"), ModuleName().c_str(), gpios.c_str());
|
||||
}
|
||||
|
@ -229,7 +229,9 @@ void DebugFreeMem(void)
|
||||
|
||||
void DebugFreeMem(void)
|
||||
{
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "FreeRam %d"), ESP.getFreeHeap());
|
||||
register uint8_t *sp asm("a1");
|
||||
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "FreeRam %d, FreeStack %d (%s)"), ESP.getFreeHeap(), sp - pxTaskGetStackStart(NULL), XdrvMailbox.data);
|
||||
}
|
||||
|
||||
#endif // ESP8266 - ESP32
|
||||
|
Loading…
x
Reference in New Issue
Block a user