uptime shows in HH:MM:SS

This commit is contained in:
proddy
2019-03-18 22:31:51 +01:00
parent f3a53f74cb
commit 50b60e0f70
2 changed files with 9 additions and 4 deletions

View File

@@ -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';

View File

@@ -9,7 +9,7 @@
#ifndef MyEMS_h
#define MyEMS_h
#define MYESP_VERSION "1.1.6b1"
#define MYESP_VERSION "1.1.6b2"
#include <ArduinoJson.h>
#include <ArduinoOTA.h>