Try-fix: L76K spamming bad times can crash nodes (#7261)

* Try-fix: Clear GPS buffer when we encounter a bad time in NMEA

* Fix signed int warnings
This commit is contained in:
Ben Meadors
2025-07-07 19:35:57 -05:00
committed by GitHub
parent f2fb473ecf
commit 415dc4aa47
4 changed files with 27 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ uint32_t NotificationRenderer::currentNumber = 0;
uint32_t pow_of_10(uint32_t n)
{
uint32_t ret = 1;
for (int i = 0; i < n; i++) {
for (uint32_t i = 0; i < n; i++) {
ret *= 10;
}
return ret;
@@ -80,6 +80,9 @@ void NotificationRenderer::drawBannercallback(OLEDDisplay *display, OLEDDisplayU
if (!isOverlayBannerShowing() || pauseBanner)
return;
switch (current_notification_type) {
case notificationTypeEnum::none:
// Do nothing - no notification to display
break;
case notificationTypeEnum::text_banner:
case notificationTypeEnum::selection_picker:
drawAlertBannerOverlay(display, state);
@@ -144,12 +147,12 @@ void NotificationRenderer::drawNumberPicker(OLEDDisplay *display, OLEDDisplayUiS
const char *linePointers[totalLines + 1] = {0}; // this is sort of a dynamic allocation
// copy the linestarts to display to the linePointers holder
for (int i = 0; i < lineCount; i++) {
for (uint16_t i = 0; i < lineCount; i++) {
linePointers[i] = lineStarts[i];
}
std::string digits = " ";
std::string arrowPointer = " ";
for (int i = 0; i < numDigits; i++) {
for (uint16_t i = 0; i < numDigits; i++) {
// Modulo minus modulo to return just the current number
digits += std::to_string((currentNumber % (pow_of_10(numDigits - i))) / (pow_of_10(numDigits - i - 1))) + " ";
if (curSelected == i) {