diff --git a/src/Platform.cpp b/src/Platform.cpp index 3467e9a..fdb0c1e 100644 --- a/src/Platform.cpp +++ b/src/Platform.cpp @@ -74,6 +74,9 @@ Platform::freeRam() #ifdef BOARD_ESP8266 return ESP.getFreeHeap(); #endif +#ifdef BOARD_ESP32 + return ESP.getFreeHeap(); +#endif } void @@ -206,6 +209,28 @@ Platform::deviceID() return s_deviceID; } +void +Platform::addLEDs(CRGB* leds, unsigned int ledCount) { + FastLED.addLeds(leds, ledCount); +} + +const String +Platform::model() +{ + static String modelName = String("Renderbug " ) + Platform::name(); + return modelName; +} + +void +Platform::restart() { +#ifdef BOARD_ESP8266 + ESP.wdtDisable(); + ESP.restart(); +#elif defined(BOARD_ESP32) + ESP.restart(); +#endif +} + BootOptions Platform::bootopts; diff --git a/src/Platform.h b/src/Platform.h index 2cde7e2..3cc2f5b 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -11,17 +11,11 @@ class Platform : public Task { static BootOptions bootopts; static void setTimezone(int tz) { s_timezone = tz; } static int getTimezone() { return s_timezone; } - - static void addLEDs(CRGB* leds, unsigned int ledCount) { - FastLED.addLeds(leds, ledCount); - } + static void addLEDs(CRGB* leds, unsigned int ledCount); static const char* name(); static const char* version(); - static const String model() { - static String modelName = String("Renderbug " ) + Platform::name(); - return modelName; - } + static const String model(); static const String deviceName() { static String devName = model() + " " + Platform::deviceID(); return devName; @@ -110,12 +104,5 @@ class Platform : public Task { return task_iterator(NULL); } - static void restart() { -#ifdef BOARD_ESP8266 - ESP.wdtDisable(); - ESP.restart(); -#elif defined(BOARD_ESP32) - ESP.restart(); -#endif - } + static void restart(); };