Browse Source

only reset geiger counts once

main
Hendrik Langer 5 years ago
parent
commit
e48246d859
  1. 4
      src/main.cpp

4
src/main.cpp

@ -258,6 +258,7 @@ void ICACHE_FLASH_ATTR sendValues() {
if (rtcMillis() - geiger_previousMillis > 10000) {
sd.cpm = geiger_counts * 60000 / (rtcMillis() - geiger_previousMillis);
DEBUG_MSG("[DEBUG] resetting geiger counts. was: %d\n", geiger_counts);
geiger_previousMillis = rtcMillis();
geiger_counts = 0;
geigeraverage.addValue(sd.cpm);
@ -460,9 +461,6 @@ void loop() {
previousMillis = currentMillis;
DEBUG_MSG("[DEBUG] sending values... previousMillis:%u, millis():%u, difference:%d\n", previousMillis, currentMillis, currentMillis-previousMillis);
sendValues();
DEBUG_MSG("[DEBUG] resetting geiger counts. was: %d\n", geiger_counts);
geiger_previousMillis = rtcMillis();
geiger_counts = 0;
}
DEBUG_MSG("[DEBUG] heap: %d\n", ESP.getFreeHeap());
DEBUG_MSG("[DEBUG] sleeping now... (%u)\n", currentMillis);

Loading…
Cancel
Save