Skip to content

Commit 2ef5b96

Browse files
committed
Merge branch 'master' into develop
2 parents 8841c15 + 6a92358 commit 2ef5b96

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

src/graphics/draw/ClockRenderer.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1
190190
const char *titleStr = "";
191191
// === Header ===
192192
graphics::drawCommonHeader(display, x, y, titleStr, true, true);
193+
int line = 0;
193194

194195
#ifdef T_WATCH_S3
195196
if (nimbleBluetooth && nimbleBluetooth->isConnected()) {
@@ -299,6 +300,15 @@ void drawDigitalClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int1
299300
display->drawString(startingHourMinuteTextX + timeStringWidth - xOffset, (display->getHeight() - hourMinuteTextY) - yOffset,
300301
secondString);
301302
#endif
303+
304+
// Display GPS derived date
305+
char datetimeStr[25];
306+
UIRenderer::formatDateTime(datetimeStr, sizeof(datetimeStr), rtc_sec, display, false);
307+
char fullLine[40];
308+
snprintf(fullLine, sizeof(fullLine), "%s", datetimeStr);
309+
yOffset = (isHighResolution) ? 12 : 1;
310+
display->drawString(startingHourMinuteTextX + timeStringWidth - display->getStringWidth(fullLine),
311+
getTextPositions(display)[line] + yOffset, fullLine);
302312
}
303313

304314
void drawBluetoothConnectedIcon(OLEDDisplay *display, int16_t x, int16_t y)
@@ -314,6 +324,7 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
314324
const char *titleStr = "";
315325
// === Header ===
316326
graphics::drawCommonHeader(display, x, y, titleStr, true, true);
327+
int line = 0;
317328

318329
#ifdef T_WATCH_S3
319330
if (nimbleBluetooth && nimbleBluetooth->isConnected()) {
@@ -511,6 +522,19 @@ void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16
511522
// draw second hand
512523
display->drawLine(centerX, centerY, secondX, secondY);
513524
#endif
525+
526+
display->setFont(FONT_SMALL);
527+
// Display GPS derived date
528+
char datetimeStr[25];
529+
UIRenderer::formatDateTime(datetimeStr, sizeof(datetimeStr), rtc_sec, display, false);
530+
char fullLine[40];
531+
if (isHighResolution) {
532+
snprintf(fullLine, sizeof(fullLine), "%s", datetimeStr);
533+
} else {
534+
snprintf(fullLine, sizeof(fullLine), "%s", &datetimeStr[2]);
535+
}
536+
display->drawString(display->getWidth() - 1 - display->getStringWidth(fullLine), getTextPositions(display)[line],
537+
fullLine);
514538
}
515539
}
516540

src/graphics/draw/DebugRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ void drawLoRaFocused(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x,
447447
display->drawString(nameX, getTextPositions(display)[line++], frequencyslot);
448448

449449
#if !defined(M5STACK_UNITC6L)
450-
// === Fourth Row: Channel Utilization ===
450+
// === Fifth Row: Channel Utilization ===
451451
const char *chUtil = "ChUtil:";
452452
char chUtilPercentage[10];
453453
snprintf(chUtilPercentage, sizeof(chUtilPercentage), "%2.0f%%", airTime->channelUtilizationPercent());

0 commit comments

Comments
 (0)