port to platformio

This commit is contained in:
2021-03-29 01:10:55 -07:00
parent 9a3bf84214
commit a6534bcb20
131 changed files with 1537 additions and 1148 deletions

View File

@@ -0,0 +1,30 @@
#include <Figments.h>
BootOpts bootopts;
void watchdogHandler() {
for(int i = 0; i < 8; i++) {
leds[i] = CRGB(i % 3 ? 35 : 255, 0, 0);
}
FastLED.show();
if (bootopts.lastBootWasFlash) {
System.dfu();
} else {
System.enterSafeMode();
}
}
class Watchdog : public Task {
public:
Watchdog() : Task("Watchdog") {
m_watchdog = new ApplicationWatchdog(5000, watchdogHandler, 1536);
}
void loop() override {
m_watchdog->checkin();
}
private:
ApplicationWatchdog *m_watchdog;
};
STATIC_ALLOC(Watchdog);