2021-03-31 18:50:00 +00:00
|
|
|
#pragma once
|
|
|
|
#include <FastLED.h>
|
2021-04-10 18:10:25 +00:00
|
|
|
#include <Figments.h>
|
2021-03-31 18:50:00 +00:00
|
|
|
#include "BootOptions.h"
|
|
|
|
|
2021-04-10 18:10:25 +00:00
|
|
|
class Platform : public Task {
|
2021-03-31 18:50:00 +00:00
|
|
|
static int s_timezone;
|
|
|
|
static char s_deviceID[15];
|
|
|
|
public:
|
2021-04-10 18:10:25 +00:00
|
|
|
Platform() : Task("Platform") {}
|
2021-03-31 18:50:00 +00:00
|
|
|
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) {
|
|
|
|
#ifdef PLATFORM_PHOTON
|
|
|
|
FastLED.addLeds<NEOPIXEL, 6>(leds, ledCount);
|
|
|
|
#elif defined(BOARD_ESP32)
|
2021-04-10 18:10:25 +00:00
|
|
|
FastLED.addLeds<WS2812B, 13, GRB>(leds, ledCount);
|
2021-03-31 18:50:00 +00:00
|
|
|
#else
|
2021-04-10 18:10:25 +00:00
|
|
|
//FastLED.addLeds<WS2812B, 14, GRB>(leds, ledCount);
|
|
|
|
FastLED.addLeds<WS2812B, 14, RGB>(leds, ledCount);
|
2021-03-31 18:50:00 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char* name();
|
|
|
|
static const char* version();
|
2021-04-10 18:10:25 +00:00
|
|
|
static const String model() {
|
|
|
|
static String modelName = String("Renderbug " ) + Platform::name();
|
|
|
|
return modelName;
|
|
|
|
}
|
|
|
|
static const String deviceName() {
|
|
|
|
static String devName = model() + " " + Platform::deviceID();
|
|
|
|
return devName;
|
|
|
|
}
|
2021-03-31 18:50:00 +00:00
|
|
|
static void preSetup();
|
|
|
|
static void bootSplash();
|
|
|
|
static void setup();
|
2021-04-10 18:10:25 +00:00
|
|
|
void loop() override;
|
2021-03-31 18:50:00 +00:00
|
|
|
static bool getLocalTime(struct tm* timedata);
|
|
|
|
static const char* deviceID();
|
|
|
|
};
|
2021-04-10 18:10:25 +00:00
|
|
|
|