From 302f0afcb4479acd4b980293dea46f92e838e218 Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Tue, 28 May 2024 15:21:14 -0400 Subject: [PATCH] Decrease buffer size for Mega, fix warnings Signed-off-by: Sara Damiano --- src/LogBuffer.h | 4 ++++ src/publishers/DreamHostPublisher.cpp | 2 +- src/publishers/ThingSpeakPublisher.cpp | 2 +- src/publishers/UbidotsPublisher.cpp | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/LogBuffer.h b/src/LogBuffer.h index 756ac3d8e..9d3151256 100644 --- a/src/LogBuffer.h +++ b/src/LogBuffer.h @@ -26,8 +26,12 @@ * compiling. 8192 bytes is a safe value for the Mayfly 1.1 with six variables. */ #ifndef MS_LOG_DATA_BUFFER_SIZE +#ifdef ARDUINO_AVR_MEGA2560 +#define MS_LOG_DATA_BUFFER_SIZE 2048 +#else #define MS_LOG_DATA_BUFFER_SIZE 8192 #endif +#endif #include #include diff --git a/src/publishers/DreamHostPublisher.cpp b/src/publishers/DreamHostPublisher.cpp index d30b7cbab..9089028ac 100644 --- a/src/publishers/DreamHostPublisher.cpp +++ b/src/publishers/DreamHostPublisher.cpp @@ -65,7 +65,7 @@ void DreamHostPublisher::begin(Logger& baseLogger, const char* dhUrl) { // Post the data to dream host. // int16_t DreamHostPublisher::postDataDreamHost(void) -int16_t DreamHostPublisher::publishData(Client* outClient, bool forceFlush) { +int16_t DreamHostPublisher::publishData(Client* outClient, bool) { // Create a buffer for the portions of the request and response char tempBuffer[37] = ""; uint16_t did_respond = 0; diff --git a/src/publishers/ThingSpeakPublisher.cpp b/src/publishers/ThingSpeakPublisher.cpp index efdf997dc..3b070088a 100644 --- a/src/publishers/ThingSpeakPublisher.cpp +++ b/src/publishers/ThingSpeakPublisher.cpp @@ -102,7 +102,7 @@ void ThingSpeakPublisher::begin(Logger& baseLogger, // This sends the data to ThingSpeak // bool ThingSpeakPublisher::mqttThingSpeak(void) -int16_t ThingSpeakPublisher::publishData(Client* outClient, bool forceFlush) { +int16_t ThingSpeakPublisher::publishData(Client* outClient, bool ) { bool retVal = false; // Make sure we don't have too many fields diff --git a/src/publishers/UbidotsPublisher.cpp b/src/publishers/UbidotsPublisher.cpp index 702baafd7..33f2993f9 100644 --- a/src/publishers/UbidotsPublisher.cpp +++ b/src/publishers/UbidotsPublisher.cpp @@ -113,7 +113,7 @@ void UbidotsPublisher::begin(Logger& baseLogger, // over that connection. // The return is the http status code of the response. // int16_t EnviroDIYPublisher::postDataEnviroDIY(void) -int16_t UbidotsPublisher::publishData(Client* outClient, bool forceFlush) { +int16_t UbidotsPublisher::publishData(Client* outClient, bool) { // Create a buffer for the portions of the request and response char tempBuffer[37] = ""; uint16_t did_respond = 0;