File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -56,8 +56,8 @@ void setup() {
5656 JsonDocument doc;
5757 JsonObject root = doc.to <JsonObject>();
5858 root[" foo" ] = " bar" ;
59- serializeJson (root, *response );
60- Serial.println ();
59+ // serializeJson(root, Serial );
60+ // Serial.println();
6161 request->send (response);
6262 });
6363
@@ -105,7 +105,19 @@ void setup() {
105105 server.begin ();
106106}
107107
108- // not needed
108+ static uint32_t lastHeapTime = 0 ;
109+ static uint32_t lastHeap = 0 ;
110+
109111void loop () {
110- delay (100 );
112+ #ifdef ESP32
113+ uint32_t now = millis ();
114+ if (now - lastHeapTime >= 500 ) {
115+ uint32_t heap = ESP.getFreeHeap ();
116+ if (heap != lastHeap) {
117+ lastHeap = heap;
118+ async_ws_log_w (" Free heap: %" PRIu32, heap);
119+ }
120+ lastHeapTime = now;
121+ }
122+ #endif
111123}
You can’t perform that action at this time.
0 commit comments