feat: more toggles for InkHUD menu (#6469)

GPS on/off
Wifi off -> Bluetooth on
12 / 24 hour clock
This commit is contained in:
todd-herbert
2025-03-31 20:15:54 +13:00
committed by GitHub
parent f626f02005
commit da26ff5b95
3 changed files with 47 additions and 29 deletions

View File

@@ -582,9 +582,12 @@ std::string InkHUD::Applet::getTimeString(uint32_t epochSeconds)
uint32_t hour = hms / SEC_PER_HOUR;
uint32_t min = (hms % SEC_PER_HOUR) / SEC_PER_MIN;
// Format the clock string
// Format the clock string, either 12 hour or 24 hour
char clockStr[11];
sprintf(clockStr, "%u:%02u %s", (hour % 12 == 0 ? 12 : hour % 12), min, hour > 11 ? "PM" : "AM");
if (config.display.use_12h_clock)
sprintf(clockStr, "%u:%02u %s", (hour % 12 == 0 ? 12 : hour % 12), min, hour > 11 ? "PM" : "AM");
else
sprintf(clockStr, "%02u:%02u", hour, min);
return clockStr;
}