Browse Source

Show pretty uptime with NTP_SUPPORT (#2137)

Fallback to basic N seconds display when disabled
mcspr-patch-1
Max Prokhorov 4 years ago
committed by GitHub
parent
commit
460083c28f
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 6 deletions
  1. +10
    -6
      code/espurna/utils.ino

+ 10
- 6
code/espurna/utils.ino View File

@ -208,12 +208,16 @@ namespace Heartbeat {
}
void infoUptime() {
auto uptime [[gnu::unused]] = getUptime();
DEBUG_MSG_P(
PSTR("Uptime: %02dd %02dh %02dm %02ds\n"),
elapsedDays(uptime), numberOfHours(uptime),
numberOfMinutes(uptime), numberOfSeconds(uptime)
);
const auto uptime [[gnu::unused]] = getUptime();
#if NTP_SUPPORT
DEBUG_MSG_P(
PSTR("[MAIN] Uptime: %02dd %02dh %02dm %02ds\n"),
elapsedDays(uptime), numberOfHours(uptime),
numberOfMinutes(uptime), numberOfSeconds(uptime)
);
#else
DEBUG_MSG_P(PSTR("[MAIN] Uptime: %lu seconds\n"), uptime);
#endif // NTP_SUPPORT
}
void heartbeat() {


Loading…
Cancel
Save