From 4114a8b2b5a7d552abcb55ad49d216b6d22efb61 Mon Sep 17 00:00:00 2001 From: Torrie Fischer Date: Mon, 11 Dec 2023 08:06:57 +0100 Subject: [PATCH] platform: unify more esp32/esp8266 api --- src/Platform.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Platform.cpp b/src/Platform.cpp index 38a076c..5702958 100644 --- a/src/Platform.cpp +++ b/src/Platform.cpp @@ -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 }