mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
uptime shows in HH:MM:SS
This commit is contained in:
@@ -790,7 +790,7 @@ String MyESP::_buildTime() {
|
||||
return String(buffer);
|
||||
}
|
||||
|
||||
// returns system uptime - copied for espurna. see (c)
|
||||
// returns system uptime in seconds - copied for espurna. see (c)
|
||||
unsigned long MyESP::_getUptime() {
|
||||
static unsigned long last_uptime = 0;
|
||||
static unsigned char uptime_overflows = 0;
|
||||
@@ -819,7 +819,12 @@ void MyESP::showSystemStats() {
|
||||
if (_boottime != NULL) {
|
||||
myDebug_P(PSTR(" [APP] Boot time: %s"), _boottime);
|
||||
}
|
||||
myDebug_P(PSTR(" [APP] Uptime: %d seconds"), _getUptime());
|
||||
uint32_t t = _getUptime(); // seconds
|
||||
uint32_t h = (uint32_t)t / (uint32_t)3600L;
|
||||
uint32_t rem = (uint32_t)t % (uint32_t)3600L;
|
||||
uint32_t m = rem / 60;
|
||||
uint32_t s = rem % 60;
|
||||
myDebug_P(PSTR(" [APP] Uptime: %d seconds (%02d:%02d:%02d)"), t, h, m, s);
|
||||
myDebug_P(PSTR(" [APP] System Load: %d%%"), getSystemLoadAverage());
|
||||
|
||||
if (isAPmode()) {
|
||||
@@ -909,7 +914,7 @@ void MyESP::_telnetHandle() {
|
||||
}
|
||||
break;
|
||||
|
||||
case '\b': // (^H) handle backspace in input: put a space in last char - coded by Simon Arlott
|
||||
case '\b': // (^H)
|
||||
case 0x7F: // (^?)
|
||||
if (charsRead > 0) {
|
||||
_command[--charsRead] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user