From 63bca956a2ee8aaa4ec2e4d06eb0aefcb60b80e2 Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Tue, 26 Jun 2018 14:40:08 +0200 Subject: [PATCH] use the stack for buffers --- src/main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 0f1a772..6f493a0 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -187,9 +187,9 @@ void ICACHE_FLASH_ATTR sendValues() { if (sd.cpm > 0) DEBUG_MSG("Radiation : %6.2fµSv/h (J305)\n", sd.radioactivity); DEBUG_MSG("Voltage : %6.2fV (ESP8266)\n", sd.voltage); - DynamicJsonBuffer jsonBuffer; + StaticJsonBuffer jsonBuffer; JsonArray& array = jsonBuffer.createArray(); - DynamicJsonBuffer jsonBuffer2; + StaticJsonBuffer jsonBuffer2; JsonObject& root = jsonBuffer.createObject(); JsonObject& temperatureObject = array.createNestedObject(); @@ -245,7 +245,7 @@ void ICACHE_FLASH_ATTR sendValues() { root["heap"] = ESP.getFreeHeap(); - char buffer[500]; + char buffer[MQTT_MAX_PACKET_SIZE]; array.printTo(buffer, sizeof(buffer)); WiFi.forceSleepWake();