platform: unify more esp32/esp8266 api

This commit is contained in:
Torrie Fischer 2023-12-11 08:06:57 +01:00
parent 7418172f79
commit 4114a8b2b5

View File

@ -62,7 +62,7 @@ Platform::version()
{
#ifdef PLATFORM_PHOTON
return System.version().c_str();
#elif defined(BOARD_ESP32)
#elif defined(BOARD_ESP32) || defined(BOARD_ESP8266)
return ESP.getSdkVersion();
#else
return "Unknown!";
@ -72,10 +72,7 @@ Platform::version()
int
Platform::freeRam()
{
#ifdef BOARD_ESP8266
return ESP.getFreeHeap();
#endif
#ifdef BOARD_ESP32
#if defined(BOARD_ESP8266) || defined(BOARD_ESP32)
return ESP.getFreeHeap();
#endif
}
@ -114,6 +111,9 @@ Platform::preSetup()
#endif
#ifdef BOARD_ESP8266
ESP.wdtEnable(0);
if (!ESP.checkFlashCRC()) {
Log.fatal("Firmware failed CRC check!!!");
}
#endif
}