Browse Source

use the stack for buffers

main
Hendrik Langer 7 years ago
parent
commit
63bca956a2
  1. 6
      src/main.cpp

6
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); if (sd.cpm > 0) DEBUG_MSG("Radiation : %6.2fµSv/h (J305)\n", sd.radioactivity);
DEBUG_MSG("Voltage : %6.2fV (ESP8266)\n", sd.voltage); DEBUG_MSG("Voltage : %6.2fV (ESP8266)\n", sd.voltage);
DynamicJsonBuffer jsonBuffer; StaticJsonBuffer<MQTT_MAX_PACKET_SIZE> jsonBuffer;
JsonArray& array = jsonBuffer.createArray(); JsonArray& array = jsonBuffer.createArray();
DynamicJsonBuffer jsonBuffer2; StaticJsonBuffer<MQTT_MAX_PACKET_SIZE> jsonBuffer2;
JsonObject& root = jsonBuffer.createObject(); JsonObject& root = jsonBuffer.createObject();
JsonObject& temperatureObject = array.createNestedObject(); JsonObject& temperatureObject = array.createNestedObject();
@ -245,7 +245,7 @@ void ICACHE_FLASH_ATTR sendValues() {
root["heap"] = ESP.getFreeHeap(); root["heap"] = ESP.getFreeHeap();
char buffer[500]; char buffer[MQTT_MAX_PACKET_SIZE];
array.printTo(buffer, sizeof(buffer)); array.printTo(buffer, sizeof(buffer));
WiFi.forceSleepWake(); WiFi.forceSleepWake();

Loading…
Cancel
Save