diff --git a/include/FSMGlobals.h b/include/FSMGlobals.h index 529a7f2..fd94c32 100644 --- a/include/FSMGlobals.h +++ b/include/FSMGlobals.h @@ -30,9 +30,18 @@ #include typedef struct { - uint8_t menuMainPointerIdx = 0; //!< MenuMain: Index of the menu cursor - uint8_t prideFlagModeIdx = 0; //!< DisplayPrideFlag: Mode selector - uint8_t animationModeIdx = 0; //!< DisplayAnimation: Mode selector + /** + * @brief MenuMain: Index of the menu cursor + */ + uint8_t menuMainPointerIdx = 0; + /** + * @brief DisplayPrideFlag: Mode selector for pride flags: 0 keep the current, 1 rotate them all + */ + uint8_t prideFlagModeIdx = 0; + /** + * @brief DisplayAnimation: Mode selector + */ + uint8_t animationModeIdx = 0; } FSMGlobals; -#endif /* FSMGLOBALS_H_ */ \ No newline at end of file +#endif /* FSMGLOBALS_H_ */ diff --git a/lib/EFBoard/EFBoard.cpp b/lib/EFBoard/EFBoard.cpp index fb1d1a0..2064483 100644 --- a/lib/EFBoard/EFBoard.cpp +++ b/lib/EFBoard/EFBoard.cpp @@ -190,7 +190,7 @@ const EFBoardPowerState EFBoardClass::resetPowerState() { bool EFBoardClass::connectToWifi(const char *ssid, const char *password) { LOGF_INFO("(EFBoard) Connecting to WiFi network: %s ", ssid); - // Try to connect to wifi + // Try to connect to WiFi WiFi.begin(ssid, password); WiFi.setSleep(true); for (int32_t timeout_ms = 10000; timeout_ms >= 0; timeout_ms -= 200) { diff --git a/lib/EFLed/EFLed.cpp b/lib/EFLed/EFLed.cpp index 6b22f56..c2145cc 100644 --- a/lib/EFLed/EFLed.cpp +++ b/lib/EFLed/EFLed.cpp @@ -56,7 +56,6 @@ void EFLedClass::init(const uint8_t max_brightness) { LOGF_DEBUG("(EFLed) Set max_brightness=%d\r\n", this->max_brightness) enablePower(); - } void EFLedClass::enablePower() { diff --git a/src/states/DisplayAnimation.cpp b/src/states/DisplayAnimation.cpp index 349f125..2ebace9 100644 --- a/src/states/DisplayAnimation.cpp +++ b/src/states/DisplayAnimation.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "FSMState.h" @@ -37,7 +38,8 @@ * animation function and an associated tick rate in milliseconds. */ const struct { - void (DisplayAnimation::* animate)(); + void (DisplayAnimation::*animate)(); + const unsigned int tickrate; } animations[DISPLAY_ANIMATION_NUM_TOTAL] = { {.animate = &DisplayAnimation::_animateRainbowCircle, .tickrate = 20}, @@ -49,7 +51,7 @@ const struct { }; -const char* DisplayAnimation::getName() { +const char *DisplayAnimation::getName() { return "DisplayAnimation"; } @@ -132,7 +134,7 @@ void DisplayAnimation::_animateSnake() { CRGB::Black, }; - std::rotate(pattern.rbegin(), pattern.rbegin()+this->tick % EFLED_TOTAL_NUM, pattern.rend()); + std::rotate(pattern.rbegin(), pattern.rbegin() + this->tick % EFLED_TOTAL_NUM, pattern.rend()); EFLed.setAll(pattern.data()); } @@ -169,6 +171,6 @@ void DisplayAnimation::_animateMatrix() { void DisplayAnimation::_animateRainbowCircle() { CRGB data[EFLED_TOTAL_NUM]; - fill_rainbow_circular(data, EFLED_TOTAL_NUM, (tick % 128)*2, true); + fill_rainbow_circular(data, EFLED_TOTAL_NUM, (tick % 128) * 2, true); EFLed.setAll(data); } diff --git a/src/states/DisplayPrideFlag.cpp b/src/states/DisplayPrideFlag.cpp index b406ede..d840990 100644 --- a/src/states/DisplayPrideFlag.cpp +++ b/src/states/DisplayPrideFlag.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "FSMState.h" diff --git a/src/states/MenuMain.cpp b/src/states/MenuMain.cpp index 68a5d2d..4c69385 100644 --- a/src/states/MenuMain.cpp +++ b/src/states/MenuMain.cpp @@ -29,7 +29,7 @@ #include "FSMState.h" -const char* MenuMain::getName() { +const char *MenuMain::getName() { return "MenuMain"; } diff --git a/src/states/menu/MenuOTAUpdate.cpp b/src/states/menu/MenuOTAUpdate.cpp index 2965558..13051f7 100644 --- a/src/states/menu/MenuOTAUpdate.cpp +++ b/src/states/menu/MenuOTAUpdate.cpp @@ -38,7 +38,7 @@ const char* MenuOTAUpdate::getName() { } void MenuOTAUpdate::entry() { - // Connecto to wifi + // Connect to WiFi EFLed.setDragonNose(CRGB::Red); if (EFBoard.connectToWifi(WIFI_SSID, WIFI_PASSWORD)) { EFLed.setDragonNose(CRGB::Green);