ESP.getFreeHeap()
or? Serial << "free RAM: " << ESP.getFreeHeap()<< endl;
int value[10000];
Serial << "free RAM: " << ESP.getFreeHeap()<< endl;
struct Persistent {
char version[4] = CONFIG_VERSION;
char stopName[31] = "";
} persistent;
void loadState() {
if (EEPROM.read(0) != CONFIG_VERSION[0] ||
EEPROM.read(1) != CONFIG_VERSION[1] ||
EEPROM.read(2) != CONFIG_VERSION[2]) {
Serial.println("Magic number invalid, return.");
return;
}
for (unsigned int t=0; t<sizeof(persistent); t++)
*((char*)&persistent + t) = EEPROM.read(t);
Serial.println("Loaded state.");
}
void saveState() {
for (unsigned int t=0; t<sizeof(persistent); t++)
EEPROM.write(t, *((char*)&persistent + t));
EEPROM.commit();
Serial.println("Saved state.");
}
Serial << "free RAM: " << ESP.getFreeHeap()<< endl;
int advalue[500];
for (int i = 0; i < 500; i +=1) {
advalue [i] = analogRead(A0);
}
Serial << "free RAM: " << ESP.getFreeHeap()<< endl;
ESP.getFreeHeap()
returns the heap only
int foo[1000] = { 0 }; // static allocated (.bss section)
void func() {
static int bar[1000] = { 0 }; // static allocated (.bss section)
int baz[1000] = { 0 }; // stack (g_cont)
int *foobar = new int[1000]; // heap (ESP.getFreeHeap())
}
malloc()
realloc()
are allocated on heap, too.
Arduino: 1.6.13 (Windows XP), Board: "WeMos D1 R2 & mini, 80 MHz, 921600, 4M (3M SPIFFS)"
Build options changed, rebuilding all
In file included from C:\Documents and Settings\ijadi\Desktop\New Folder (4)\arduino-1.6.13\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiGeneric.h:27:0,
from C:\Documents and Settings\ijadi\Desktop\New Folder (4)\arduino-1.6.13\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFiSTA.h:28,
from C:\Documents and Settings\ijadi\Desktop\New Folder (4)\arduino-1.6.13\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\src/ESP8266WiFi.h:34,
from C:\Documents and Settings\ijadi\Desktop\New Folder (4)\arduino-1.6.13\portable\packages\esp8266\hardware\esp8266\2.3.0\libraries\ESP8266WiFi\examples\WiFiWebServer\WiFiWebServer.ino:10:
c:\documents and settings\ijadi\desktop\new folder (4)\arduino-1.6.13\portable\packages\esp8266\tools\xtensa-lx106-elf-gcc\1.20.0-26-gb404fb9-2\xtensa-lx106-elf\include\c++\4.8.2\functional:48:28: fatal error: bits/c++config.h: No such file or directory
^
compilation terminated.
exit status 1
Error compiling for board WeMos D1 R2 & mini.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
bcn_timout,ap_probe_send_start
ap_probe_send over, rest wifi status to disassoc
state: 5 -> 0 (1)
rm 0
pm close 7
WS [2] Disconnected!
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
state: 5 -> 2 (fc0)
rm 0
reconnect
state: 2 -> 0 (0)
scandone
state: 0 -> 2 (b0)
state: 2 -> 3 (0)
state: 3 -> 5 (10)
add 0
aid 2
cnt
connected with keyno, channel 1
dhcp client start...
ip:192.168.1.150,mask:255.255.255.0,gw:192.168.1.1
pm open,type:2 0