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);
|
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() {
|
unsigned long MyESP::_getUptime() {
|
||||||
static unsigned long last_uptime = 0;
|
static unsigned long last_uptime = 0;
|
||||||
static unsigned char uptime_overflows = 0;
|
static unsigned char uptime_overflows = 0;
|
||||||
@@ -819,7 +819,12 @@ void MyESP::showSystemStats() {
|
|||||||
if (_boottime != NULL) {
|
if (_boottime != NULL) {
|
||||||
myDebug_P(PSTR(" [APP] Boot time: %s"), _boottime);
|
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());
|
myDebug_P(PSTR(" [APP] System Load: %d%%"), getSystemLoadAverage());
|
||||||
|
|
||||||
if (isAPmode()) {
|
if (isAPmode()) {
|
||||||
@@ -909,7 +914,7 @@ void MyESP::_telnetHandle() {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case '\b': // (^H) handle backspace in input: put a space in last char - coded by Simon Arlott
|
case '\b': // (^H)
|
||||||
case 0x7F: // (^?)
|
case 0x7F: // (^?)
|
||||||
if (charsRead > 0) {
|
if (charsRead > 0) {
|
||||||
_command[--charsRead] = '\0';
|
_command[--charsRead] = '\0';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
#ifndef MyEMS_h
|
#ifndef MyEMS_h
|
||||||
#define MyEMS_h
|
#define MyEMS_h
|
||||||
|
|
||||||
#define MYESP_VERSION "1.1.6b1"
|
#define MYESP_VERSION "1.1.6b2"
|
||||||
|
|
||||||
#include <ArduinoJson.h>
|
#include <ArduinoJson.h>
|
||||||
#include <ArduinoOTA.h>
|
#include <ArduinoOTA.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user