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

9
src/plugins/zeroExport/zeroExport.h

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

Loading…
Cancel
Save