From c2902737901d59895306fa6a3239193b036d3c1f Mon Sep 17 00:00:00 2001 From: lumapu Date: Sun, 11 Feb 2024 01:07:07 +0100 Subject: [PATCH] 0.8.78 * merge PR: Add hint to INV_RESET_MIDNIGHT resp. INV_PAUSE_DURING_NIGHT #1418 * merge PR: simplify rxOffset logic #1417 * code quality improvments --- src/CHANGES.md | 3 +++ src/eth/ahoyeth.h | 2 +- src/utils/helper.cpp | 6 ++---- src/utils/syslog.cpp | 3 +-- src/web/html/colorBright.css | 6 +++--- src/web/html/colorDark.css | 16 ++++++++-------- src/web/html/style.css | 21 +++++++++++---------- 7 files changed, 29 insertions(+), 28 deletions(-) diff --git a/src/CHANGES.md b/src/CHANGES.md index be5e011c5..aa63153fa 100644 --- a/src/CHANGES.md +++ b/src/CHANGES.md @@ -4,6 +4,9 @@ * finalized API token access #1415 * possible fix of MqTT fix "total values are sent to often" #1421 * removed `switchCycle` from `hmsRadio.h` #1412 +* merge PR: Add hint to INV_RESET_MIDNIGHT resp. INV_PAUSE_DURING_NIGHT #1418 +* merge PR: simplify rxOffset logic #1417 +* code quality improvments ## 0.8.77 - 2024-02-08 * merge PR: BugFix: ACK #1414 diff --git a/src/eth/ahoyeth.h b/src/eth/ahoyeth.h index ef8d07517..ebd91c677 100644 --- a/src/eth/ahoyeth.h +++ b/src/eth/ahoyeth.h @@ -49,7 +49,7 @@ class ahoyeth { #if defined(CONFIG_IDF_TARGET_ESP32S3) EthSpi mEthSpi; #endif - settings_t *mConfig = NULL; + settings_t *mConfig = nullptr; uint32_t *mUtcTimestamp; AsyncUDP mUdp; // for time server diff --git a/src/utils/helper.cpp b/src/utils/helper.cpp index b3f53a234..24a4d9ee2 100644 --- a/src/utils/helper.cpp +++ b/src/utils/helper.cpp @@ -72,11 +72,10 @@ namespace ah { String getTimeStrMs(uint64_t t) { char str[13]; - uint16_t m; if(0 == t) sprintf(str, "n/a"); else { - m = t % 1000; + uint16_t m = t % 1000; t = t / 1000; sprintf(str, "%02d:%02d:%02d.%03d", hour(t), minute(t), second(t), m); } @@ -86,14 +85,13 @@ namespace ah { uint64_t Serial2u64(const char *val) { char tmp[3]; uint64_t ret = 0ULL; - uint64_t u64; memset(tmp, 0, 3); for(uint8_t i = 0; i < 6; i++) { tmp[0] = val[i*2]; tmp[1] = val[i*2 + 1]; if((tmp[0] == '\0') || (tmp[1] == '\0')) break; - u64 = strtol(tmp, NULL, 16); + uint64_t u64 = strtol(tmp, NULL, 16); ret |= (u64 << ((5-i) << 3)); } return ret; diff --git a/src/utils/syslog.cpp b/src/utils/syslog.cpp index c251e8994..d02e25edb 100644 --- a/src/utils/syslog.cpp +++ b/src/utils/syslog.cpp @@ -68,12 +68,11 @@ void DbgSyslog::syslogCb (String msg) // Send mSyslogBuffer in chunks because mSyslogBuffer is larger than syslog packet size int packetStart = 0; int packetSize = 122; // syslog payload depends also on hostname and app - char saveChar; if (isEolFound) { mSyslogBuffer[mSyslogBufFill-2]=0; // skip \r\n } while(packetStart < mSyslogBufFill) { - saveChar = mSyslogBuffer[packetStart+packetSize]; + char saveChar = mSyslogBuffer[packetStart+packetSize]; mSyslogBuffer[packetStart+packetSize] = 0; log(mConfig->sys.deviceName,SYSLOG_FACILITY, mSyslogSeverity, &mSyslogBuffer[packetStart]); mSyslogBuffer[packetStart+packetSize] = saveChar; diff --git a/src/web/html/colorBright.css b/src/web/html/colorBright.css index 47382daa6..2e6760291 100644 --- a/src/web/html/colorBright.css +++ b/src/web/html/colorBright.css @@ -3,9 +3,9 @@ --fg: #000; --fg2: #fff; - --info: #0000dd; - --warn: #ff7700; - --success: #009900; + --info: #00d; + --warn: #f70; + --success: #090; --input-bg: #eee; --table-border: #ccc; diff --git a/src/web/html/colorDark.css b/src/web/html/colorDark.css index 65100721f..40bd4cf3c 100644 --- a/src/web/html/colorDark.css +++ b/src/web/html/colorDark.css @@ -4,8 +4,8 @@ --fg2: #fff; --info: #0072c8; - --warn: #ffaa00; - --success: #00bb00; + --warn: #fa0; + --success: #0b0; --input-bg: #333; --table-border: #333; @@ -20,14 +20,14 @@ --invalid-bg: #400; - --total-head-title: #555511; - --total-bg: #666622; - --iv-head-title: #115511; - --iv-head-bg: #226622; + --total-head-title: #551; + --total-bg: #662; + --iv-head-title: #151; + --iv-head-bg: #262; --iv-dis-title: #333; --iv-dis: #444; - --ch-head-title: #112255; - --ch-head-bg: #223366; + --ch-head-title: #125; + --ch-head-bg: #236; --ts-head: #333; --ts-bg: #555; } diff --git a/src/web/html/style.css b/src/web/html/style.css index 395fcb994..2d6a03c75 100644 --- a/src/web/html/style.css +++ b/src/web/html/style.css @@ -16,11 +16,11 @@ span, li, h3, label, fieldset { color: var(--fg); } -fieldset, input[type=submit], .btn { +fieldset, input[type="submit"], .btn { border-radius: 4px; } -input[type=file] { +input[type="file"] { width: 100%; } @@ -33,7 +33,7 @@ textarea { color: var(--fg2); } -svg rect {fill: #0000AA;} +svg rect {fill: #00A;} svg.chart { background: #f2f2f2; border: 2px solid gray; @@ -44,6 +44,7 @@ div.chartDivContainer { padding: 1px; margin: 1px; } + div.chartdivContainer span { color: var(--fg2); } @@ -95,7 +96,7 @@ svg.icon { vertical-align: middle; display: inline-block; margin-top:-4x; - padding: 5px 7px 5px 0px; + padding: 5px 7px 5px 0; } .icon-info { @@ -141,7 +142,7 @@ svg.icon { span.seperator { width: 100%; height: 1px; - margin: 5px 0px 5px; + margin: 5px 0 5px; background-color: #494949; display: block; } @@ -391,7 +392,7 @@ th { #footer .left { color: #bbb; - margin: 23px 0px 0px 25px; + margin: 23px 0 0 25px; } #footer ul { @@ -525,7 +526,7 @@ input, select { font-size: 13pt; } -input[type=text], input[type=password], select, input[type=number] { +input[type="text"], input[type="password"], select, input[type="number"] { width: 100%; box-sizing: border-box; border: 1px solid #ccc; @@ -551,7 +552,7 @@ input.btnDel { input.btn { background-color: var(--primary); color: #fff; - border: 0px; + border: 0; padding: 7px 20px 7px 20px; margin-bottom: 10px; text-transform: uppercase; @@ -572,7 +573,7 @@ label { display: inline-block; font-size: 12pt; padding-right: 10px; - margin: 10px 0px 0px 15px; + margin: 10px 0 0 15px; vertical-align: top; } @@ -601,7 +602,7 @@ div.ModPwr, div.ModName, div.YieldCor { div.hr { height: 1px; border-top: 1px solid #ccc; - margin: 10px 0px 10px; + margin: 10px 0 10px; } #note {