fix 'symbal' typo (#5395)
Some checks are pending
CI / setup (check) (push) Waiting to run
CI / setup (esp32) (push) Waiting to run
CI / setup (esp32c3) (push) Waiting to run
CI / setup (esp32c6) (push) Waiting to run
CI / setup (esp32s3) (push) Waiting to run
CI / setup (nrf52840) (push) Waiting to run
CI / setup (rp2040) (push) Waiting to run
CI / setup (stm32) (push) Waiting to run
CI / check (push) Blocked by required conditions
CI / build-esp32 (push) Blocked by required conditions
CI / build-esp32-s3 (push) Blocked by required conditions
CI / build-esp32-c3 (push) Blocked by required conditions
CI / build-esp32-c6 (push) Blocked by required conditions
CI / build-nrf52 (push) Blocked by required conditions
CI / build-rpi2040 (push) Blocked by required conditions
CI / build-stm32 (push) Blocked by required conditions
CI / package-raspbian (push) Waiting to run
CI / package-raspbian-armv7l (push) Waiting to run
CI / package-native (push) Waiting to run
CI / after-checks (push) Blocked by required conditions
CI / gather-artifacts (esp32) (push) Blocked by required conditions
CI / gather-artifacts (esp32c3) (push) Blocked by required conditions
CI / gather-artifacts (esp32c6) (push) Blocked by required conditions
CI / gather-artifacts (esp32s3) (push) Blocked by required conditions
CI / gather-artifacts (nrf52840) (push) Blocked by required conditions
CI / gather-artifacts (rp2040) (push) Blocked by required conditions
CI / gather-artifacts (stm32) (push) Blocked by required conditions
CI / release-artifacts (push) Blocked by required conditions
CI / release-firmware (esp32) (push) Blocked by required conditions
CI / release-firmware (esp32c3) (push) Blocked by required conditions
CI / release-firmware (esp32c6) (push) Blocked by required conditions
CI / release-firmware (esp32s3) (push) Blocked by required conditions
CI / release-firmware (nrf52840) (push) Blocked by required conditions
CI / release-firmware (rp2040) (push) Blocked by required conditions
CI / release-firmware (stm32) (push) Blocked by required conditions
Flawfinder Scan / Flawfinder (push) Waiting to run

This commit is contained in:
jcyrio 2024-11-19 05:52:20 -07:00 committed by GitHub
parent df1f66a6b9
commit b947b123fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 29 additions and 29 deletions

View File

@ -101,9 +101,9 @@ std::vector<MeshModule *> moduleFrames;
static char ourId[5]; static char ourId[5];
// vector where symbols (string) are displayed in bottom corner of display. // vector where symbols (string) are displayed in bottom corner of display.
std::vector<std::string> functionSymbals; std::vector<std::string> functionSymbol;
// string displayed in bottom right corner of display. Created from elements in functionSymbals vector // string displayed in bottom right corner of display. Created from elements in functionSymbol vector
std::string functionSymbalString = ""; std::string functionSymbolString = "";
#if HAS_GPS #if HAS_GPS
// GeoCoord object for the screen // GeoCoord object for the screen
@ -243,10 +243,10 @@ static void drawWelcomeScreen(OLEDDisplay *display, OLEDDisplayUiState *state, i
static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state) static void drawFunctionOverlay(OLEDDisplay *display, OLEDDisplayUiState *state)
{ {
// LOG_DEBUG("Draw function overlay"); // LOG_DEBUG("Draw function overlay");
if (functionSymbals.begin() != functionSymbals.end()) { if (functionSymbol.begin() != functionSymbol.end()) {
char buf[64]; char buf[64];
display->setFont(FONT_SMALL); 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); 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*/ /* 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()) { if (std::find(functionSymbol.begin(), functionSymbol.end(), sym) == functionSymbol.end()) {
functionSymbals.push_back(sym); functionSymbol.push_back(sym);
functionSymbalString = ""; functionSymbolString = "";
for (auto symbol : functionSymbals) { for (auto symbol : functionSymbol) {
functionSymbalString = symbol + " " + functionSymbalString; functionSymbolString = symbol + " " + functionSymbolString;
} }
setFastFramerate(); setFastFramerate();
} }
} }
void Screen::removeFunctionSymbal(std::string sym) void Screen::removeFunctionSymbol(std::string sym)
{ {
functionSymbals.erase(std::remove(functionSymbals.begin(), functionSymbals.end(), sym), functionSymbals.end()); functionSymbol.erase(std::remove(functionSymbol.begin(), functionSymbol.end(), sym), functionSymbol.end());
functionSymbalString = ""; functionSymbolString = "";
for (auto symbol : functionSymbals) { for (auto symbol : functionSymbol) {
functionSymbalString = symbol + " " + functionSymbalString; functionSymbolString = symbol + " " + functionSymbolString;
} }
setFastFramerate(); setFastFramerate();
} }

View File

@ -24,8 +24,8 @@ class Screen
void startFirmwareUpdateScreen() {} void startFirmwareUpdateScreen() {}
void increaseBrightness() {} void increaseBrightness() {}
void decreaseBrightness() {} void decreaseBrightness() {}
void setFunctionSymbal(std::string) {} void setFunctionSymbol(std::string) {}
void removeFunctionSymbal(std::string) {} void removeFunctionSymbol(std::string) {}
void startAlert(const char *) {} void startAlert(const char *) {}
void endAlert() {} void endAlert() {}
}; };
@ -282,8 +282,8 @@ class Screen : public concurrency::OSThread
void increaseBrightness(); void increaseBrightness();
void decreaseBrightness(); void decreaseBrightness();
void setFunctionSymbal(std::string sym); void setFunctionSymbol(std::string sym);
void removeFunctionSymbal(std::string sym); void removeFunctionSymbol(std::string sym);
/// Stops showing the boot screen. /// Stops showing the boot screen.
void stopBootScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BOOT_SCREEN}); } void stopBootScreen() { enqueueCmd(ScreenCmd{.cmd = Cmd::STOP_BOOT_SCREEN}); }

View File

@ -234,13 +234,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
screen->decreaseBrightness(); screen->decreaseBrightness();
LOG_DEBUG("Decrease Screen Brightness"); LOG_DEBUG("Decrease Screen Brightness");
break; 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) if (screen)
screen->setFunctionSymbal("Fn"); screen->setFunctionSymbol("Fn");
break; 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) if (screen)
screen->removeFunctionSymbal("Fn"); screen->removeFunctionSymbol("Fn");
break; break;
// mute (switch off/toggle) external notifications on fn+m // mute (switch off/toggle) external notifications on fn+m
case INPUT_BROKER_MSG_MUTE_TOGGLE: case INPUT_BROKER_MSG_MUTE_TOGGLE:
@ -249,13 +249,13 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
externalNotificationModule->setMute(false); externalNotificationModule->setMute(false);
showTemporaryMessage("Notifications \nEnabled"); showTemporaryMessage("Notifications \nEnabled");
if (screen) 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 { } else {
externalNotificationModule->stopNow(); // this will turn off all GPIO and sounds and idle the loop externalNotificationModule->stopNow(); // this will turn off all GPIO and sounds and idle the loop
externalNotificationModule->setMute(true); externalNotificationModule->setMute(true);
showTemporaryMessage("Notifications \nDisabled"); showTemporaryMessage("Notifications \nDisabled");
if (screen) 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; break;
@ -308,7 +308,7 @@ int CannedMessageModule::handleInputEvent(const InputEvent *event)
break; break;
} }
if (screen && (event->kbchar != INPUT_BROKER_MSG_FN_SYMBOL_ON)) { 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; break;
} }
if (screen) if (screen)
screen->removeFunctionSymbal("Fn"); screen->removeFunctionSymbol("Fn");
} }
this->lastTouchMillis = millis(); this->lastTouchMillis = millis();