Browse Source

fix memory leak (heap)

main
Hendrik Langer 6 years ago
parent
commit
5a9cfb5b50
  1. 15
      src/main.cpp

15
src/main.cpp

@ -260,12 +260,7 @@ void ICACHE_FLASH_ATTR sendValues() {
WiFi.forceSleepWake(); WiFi.forceSleepWake();
delay(1); // yield(); delay(1); // yield();
WiFi.persistent(false); // don't load and save credentials to flash
WiFi.mode(WIFI_STA); WiFi.mode(WIFI_STA);
wifiMulti.addAP("nether.net", PWD_NETHERNET);
wifiMulti.addAP("LNet", PWD_LNET);
wifiMulti.addAP("hw1_gast", PWD_HW1);
wifiMulti.addAP("Freifunk", "");
if ( ip != INADDR_NONE && dns != INADDR_NONE && gateway != INADDR_NONE && subnet != INADDR_NONE if ( ip != INADDR_NONE && dns != INADDR_NONE && gateway != INADDR_NONE && subnet != INADDR_NONE
&& ((ip[0] == 192 && ip[1] == 168) || (ip[0] == 172 && ip[1] == 16)) && ((ip[0] == 192 && ip[1] == 168) || (ip[0] == 172 && ip[1] == 16))
@ -430,8 +425,14 @@ void setup() {
geigeraverage.clear(); geigeraverage.clear();
previousMillis = rtcMillis(); //WiFi.persistent(false); // don't load and save credentials to flash
WiFi.mode(WIFI_STA);
wifiMulti.addAP("nether.net", PWD_NETHERNET);
wifiMulti.addAP("LNet", PWD_LNET);
wifiMulti.addAP("hw1_gast", PWD_HW1);
wifiMulti.addAP("Freifunk", "");
previousMillis = rtcMillis();
DEBUG_MSG("ready.\n"); //Serial.flush(); DEBUG_MSG("ready.\n"); //Serial.flush();
} }
@ -446,6 +447,8 @@ void loop() {
geiger_counts = 0; geiger_counts = 0;
} }
DEBUG_MSG("sleeping now... (%u)\n", currentMillis); DEBUG_MSG("sleeping now... (%u)\n", currentMillis);
DEBUG_MSG("heap: %d\n", ESP.getFreeHeap());
delay(10); delay(10);
lightsleep(); lightsleep();
delay(10); // debounce? delay(10); // debounce?

Loading…
Cancel
Save