platform: fix crash, move some code from h to cpp
This commit is contained in:
@@ -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<WS2812B, RENDERBUG_LED_PIN, RENDERBUG_LED_PACKING>(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;
|
||||
|
||||
|
Reference in New Issue
Block a user