Browse Source

Bugfix: log

pull/1581/head
Patrick Amrhein 10 months ago
parent
commit
f2c2c27d41
  1. 8
      src/plugins/zeroExport/powermeter.h
  2. 9
      src/plugins/zeroExport/zeroExport.h

8
src/plugins/zeroExport/powermeter.h

@ -52,10 +52,9 @@ class powermeter {
/** loop
* abfrage der gruppen um die aktuellen Werte (Zähler) zu ermitteln.
*/
void loop(void) {
unsigned long Tsp = millis();
if (Tsp - mPreviousTsp <= 1000) return; // skip when it is to fast
mPreviousTsp = Tsp;
void loop(unsigned long *tsp, bool *doLog) {
if (*tsp - mPreviousTsp <= 1000) return; // skip when it is to fast
mPreviousTsp = *tsp;
PowermeterBuffer_t power;
@ -89,6 +88,7 @@ class powermeter {
}
bufferWrite(power, group);
*doLog = true;
}
}

9
src/plugins/zeroExport/zeroExport.h

@ -59,10 +59,13 @@ class ZeroExport {
void loop(void) {
if ((!mIsInitialized) || (!mCfg->enabled)) return;
mPowermeter.loop();
unsigned long Tsp = millis();
bool DoLog = false;
unsigned long Tsp = millis();
mPowermeter.loop(&Tsp, &DoLog);
if (DoLog) sendLog();
clearLog();
DoLog = false;
for (uint8_t group = 0; group < ZEROEXPORT_MAX_GROUPS; group++) {
zeroExportGroup_t *cfgGroup = &mCfg->groups[group];

Loading…
Cancel
Save