|
|
@ -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); |
|
|
|