MCPcopy Create free account
hub / github.com/BruceDevices/firmware / updateTimeStr

Function updateTimeStr

src/core/utils.cpp:93–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

91}
92
93void updateTimeStr(struct tm timeInfo) {
94 if (bruceConfig.clock24hr) {
95 // Use 24 hour format
96 snprintf(
97 timeStr, sizeof(timeStr), "%02d:%02d:%02d", timeInfo.tm_hour, timeInfo.tm_min, timeInfo.tm_sec
98 );
99 } else {
100 // Use 12 hour format with AM/PM
101 int hour12 = (timeInfo.tm_hour == 0) ? 12
102 : (timeInfo.tm_hour > 12) ? timeInfo.tm_hour - 12
103 : timeInfo.tm_hour;
104 const char *ampm = (timeInfo.tm_hour < 12) ? "AM" : "PM";
105
106 snprintf(
107 timeStr, sizeof(timeStr), "%02d:%02d:%02d %s", hour12, timeInfo.tm_min, timeInfo.tm_sec, ampm
108 );
109 }
110}
111
112void showDeviceInfo() {
113 ScrollableTextArea area = ScrollableTextArea("DEVICE INFO");

Callers 4

drawStatusBarFunction · 0.85
runClockLoopFunction · 0.85
updateClockTimezoneFunction · 0.85
clockCallbackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected