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