From b947b123fc80926689332e1ac3fd9d41ef675d5f Mon Sep 17 00:00:00 2001 From: jcyrio <50239349+jcyrio@users.noreply.github.com> Date: Tue, 19 Nov 2024 05:52:20 -0700 Subject: [PATCH] fix 'symbal' typo (#5395) --- src/graphics/Screen.cpp | 32 ++++++++++++++--------------- src/graphics/Screen.h | 10 ++++----- src/modules/CannedMessageModule.cpp | 16 +++++++-------- 3 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index fb7edcbfd..9a41bf298 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -101,9 +101,9 @@ std::vector moduleFrames; static char ourId[5]; // vector where symbols (string) are displayed in bottom corner of display. -std::vector functionSymbals; -// string displayed in bottom right corner of display. Created from elements in functionSymbals vector -std::string functionSymbalString = ""; +std::vector functionSymbol; +// string displayed in bottom right corner of display. Created from elements in functionSymbol vector +std::string functionSymbolString = ""; #if HAS_GPS // GeoCoord object for the screen @@ -243,10 +243,10 @@ static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) { // LOG_DEBUG("Draw function overlay"); - if (functionSymbals.begin() != functionSymbals.end()) { + if (functionSymbol.begin() != functionSymbol.end()) { char buf[64]; display->setFont(FONT_SMALL); - snprintf(buf, sizeof(buf), "%s", functionSymbalString.c_str()); + snprintf(buf, sizeof(buf), "%s", functionSymbolString.c_str()); display->drawString(SCREEN_WIDTH - display->getStringWidth(buf), SCREEN_HEIGHT - FONT_HEIGHT_SMALL, buf); } } @@ -2252,24 +2252,24 @@ void Screen::decreaseBrightness() /* TO DO: add little popup in center of screen saying what brightness level it is set to*/ } -void Screen::setFunctionSymbal(std::string sym) +void Screen::setFunctionSymbol(std::string sym) { - if (std::find(functionSymbals.begin(), functionSymbals.end(), sym) == functionSymbals.end()) { - functionSymbals.push_back(sym); - functionSymbalString = ""; - for (auto symbol : functionSymbals) { - functionSymbalString = symbol + " " + functionSymbalString; + if (std::find(functionSymbol.begin(), functionSymbol.end(), sym) == functionSymbol.end()) { + functionSymbol.push_back(sym); + functionSymbolString = ""; + for (auto symbol : functionSymbol) { + functionSymbolString = symbol + " " + functionSymbolString; } setFastFramerate(); } } -void Screen::removeFunctionSymbal(std::string sym) +void Screen::removeFunctionSymbol(std::string sym) { - functionSymbals.erase(std::remove(functionSymbals.begin(), functionSymbals.end(), sym), functionSymbals.end()); - functionSymbalString = ""; - for (auto symbol : functionSymbals) { - functionSymbalString = symbol + " " + functionSymbalString; + functionSymbol.erase(std::remove(functionSymbol.begin(), functionSymbol.end(), sym), functionSymbol.end()); + functionSymbolString = ""; + for (auto symbol : functionSymbol) { + functionSymbolString = symbol + " " + functionSymbolString; } setFastFramerate(); } diff --git a/src/graphics/Screen.h b/src/graphics/Screen.h index 3066c0c17..ee8de69f0 100644 --- a/src/graphics/Screen.h +++ b/src/graphics/Screen.h @@ -24,8 +24,8 @@ class Screen void startFirmwareUpdateScreen() {} void increaseBrightness() {} void decreaseBrightness() {} - void setFunctionSymbal(std::string) {} - void removeFunctionSymbal(std::string) {} + void setFunctionSymbol(std::string) {} + void removeFunctionSymbol(std::string) {} void startAlert(const char *) {} void endAlert() {} }; @@ -282,8 +282,8 @@ class Screen : public concurrency::OSThread void increaseBrightness(); void decreaseBrightness(); - void setFunctionSymbal(std::string sym); - void removeFunctionSymbal(std::string sym); + void setFunctionSymbol(std::string sym); + void removeFunctionSymbol(std::string sym); /// Stops showing the boot screen. void stopBootScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BOOT_SCREEN}); } @@ -605,4 +605,4 @@ class Screen : public concurrency::OSThread } // namespace graphics -#endif \ No newline at end of file +#endif diff --git a/src/modules/CannedMessageModule.cpp b/src/modules/CannedMessageModule.cpp index 37409b43b..6d1bfdc5c 100644 --- a/src/modules/CannedMessageModule.cpp +++ b/src/modules/CannedMessageModule.cpp @@ -234,13 +234,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) screen->decreaseBrightness(); LOG_DEBUG("Decrease Screen Brightness"); break; - case INPUT_BROKER_MSG_FN_SYMBOL_ON: // draw modifier (function) symbal + case INPUT_BROKER_MSG_FN_SYMBOL_ON: // draw modifier (function) symbol if (screen) - screen->setFunctionSymbal("Fn"); + screen->setFunctionSymbol("Fn"); break; - case INPUT_BROKER_MSG_FN_SYMBOL_OFF: // remove modifier (function) symbal + case INPUT_BROKER_MSG_FN_SYMBOL_OFF: // remove modifier (function) symbol if (screen) - screen->removeFunctionSymbal("Fn"); + screen->removeFunctionSymbol("Fn"); break; // mute (switch off/toggle) external notifications on fn+m case INPUT_BROKER_MSG_MUTE_TOGGLE: @@ -249,13 +249,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) externalNotificationModule->setMute(false); showTemporaryMessage("Notifications \nEnabled"); if (screen) - screen->removeFunctionSymbal("M"); // remove the mute symbol from the bottom right corner + screen->removeFunctionSymbol("M"); // remove the mute symbol from the bottom right corner } else { externalNotificationModule->stopNow(); // this will turn off all GPIO and sounds and idle the loop externalNotificationModule->setMute(true); showTemporaryMessage("Notifications \nDisabled"); if (screen) - screen->setFunctionSymbal("M"); // add the mute symbol to the bottom right corner + screen->setFunctionSymbol("M"); // add the mute symbol to the bottom right corner } } break; @@ -308,7 +308,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event) break; } if (screen && (event->kbchar != INPUT_BROKER_MSG_FN_SYMBOL_ON)) { - screen->removeFunctionSymbal("Fn"); // remove modifier (function) symbal + screen->removeFunctionSymbol("Fn"); // remove modifier (function) symbol } } @@ -672,7 +672,7 @@ int32_t CannedMessageModule::runOnce() break; } if (screen) - screen->removeFunctionSymbal("Fn"); + screen->removeFunctionSymbol("Fn"); } this->lastTouchMillis = millis();