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