#include "./SafeMode.h" #include "./LogService.h" #include "./Platform.h" #include "./Static.h" #include "./Config.h" TaskFunc safeModeNag([]{ static uint8_t frame = 0; static CRGB* leds = FastLED.leds(); EVERY_N_SECONDS(30) { Log.fatal("I am running in safe mode!"); } EVERY_N_MILLISECONDS(16) { frame++; for(int i = 0; i < HardwareConfig::MAX_LED_NUM; i++) { leds[i] = CRGB(0, 0, 0); } for(int idx = 0; idx < 3; idx++) { uint8_t length = beatsin8(5, 3, HardwareConfig::MAX_LED_NUM, 0, idx * 5); for(int i = 0; i < length; i++) { leds[i] += CRGB(scale8(5, beatsin8(5 + i * 7, 0, 255, 0, i*3)), 0, 0); } } FastLED.show(); } }); #ifdef CONFIG_WIFI #include "platform/arduino/WiFiTask.h" #endif // CONFIG_WIFI #ifdef CONFIG_OTA #include "platform/arduino/OTA.h" #endif // CONFIG_OTA #ifdef CONFIG_MQTT #include "platform/arduino/MQTTTelemetry.h" #endif // CONFIG_MQTT MainLoop SafeMode::safeModeApp{{ Static::instance(), // System logging Static::instance(), &safeModeNag, #ifdef CONFIG_WIFI // ESP Wifi Static::instance(), #endif // CONFIG_WIFI #ifdef CONFIG_MQTT // MQTT Static::instance(), #endif // CONFIG_MQTT #ifdef CONFIG_OTA // OTA Updates Static::instance(), #endif // CONFIG_OTA }};