From dd3fbe29184253b6be0b08d74863b08149fb8774 Mon Sep 17 00:00:00 2001 From: Sebastian Bischlager Date: Fri, 10 May 2019 14:14:44 +0200 Subject: [PATCH 1/2] Fixed compile errors for STM32 architecture --- src/utility/EspDrv.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utility/EspDrv.cpp b/src/utility/EspDrv.cpp index cb577fe..31e22fd 100644 --- a/src/utility/EspDrv.cpp +++ b/src/utility/EspDrv.cpp @@ -22,6 +22,13 @@ along with The Arduino WiFiEsp library. If not, see #include "utility/EspDrv.h" #include "utility/debug.h" +#if defined(ARDUINO_ARCH_STM32) +//For va_start +#include + +//vsnprintf_P is not defined in avr/pgmspace.h for ststm32-maple +#define vsnprintf_P vsnprintf +#endif #define NUMESPTAGS 5 From 2ff455049a5d6240548cd709f15007251f7fa939 Mon Sep 17 00:00:00 2001 From: Sebastian Bischlager Date: Fri, 10 May 2019 14:14:56 +0200 Subject: [PATCH 2/2] Fixed some compile warnings --- src/WiFiEspClient.cpp | 4 ++-- src/utility/RingBuffer.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/WiFiEspClient.cpp b/src/WiFiEspClient.cpp index 5a242a1..c54e9a8 100644 --- a/src/WiFiEspClient.cpp +++ b/src/WiFiEspClient.cpp @@ -43,14 +43,14 @@ WiFiEspClient::WiFiEspClient(uint8_t sock) : _sock(sock) // this is very slow on ESP size_t WiFiEspClient::print(const __FlashStringHelper *ifsh) { - printFSH(ifsh, false); + return printFSH(ifsh, false); } // if we do override this, the standard println will call the print // method twice size_t WiFiEspClient::println(const __FlashStringHelper *ifsh) { - printFSH(ifsh, true); + return printFSH(ifsh, true); } diff --git a/src/utility/RingBuffer.cpp b/src/utility/RingBuffer.cpp index e5fa3c4..022e6eb 100644 --- a/src/utility/RingBuffer.cpp +++ b/src/utility/RingBuffer.cpp @@ -92,7 +92,7 @@ void RingBuffer::getStr(char * destination, unsigned int skipChars) void RingBuffer::getStrN(char * destination, unsigned int skipChars, unsigned int num) { - int len = ringBufP-ringBuf-skipChars; + unsigned int len = ringBufP-ringBuf-skipChars; if (len>num) len=num;