From 5094cb3c168ed5c08dbdaa982fe1c096482c5ecc Mon Sep 17 00:00:00 2001 From: Daniel Plasa Date: Sun, 31 May 2020 14:43:26 +0200 Subject: fix esp32 compile errors --- FTPCommon.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'FTPCommon.h') diff --git a/FTPCommon.h b/FTPCommon.h index edb9d8b..a88dd8d 100644 --- a/FTPCommon.h +++ b/FTPCommon.h @@ -5,7 +5,18 @@ #include #include #include + +#ifdef ESP8266 #include +using esp8266::polledTimeout::oneShotMs; // import the type to the local namespace +#define BUFFERSIZE TCP_MSS +#define PRINTu32 "lu" +#elif defined ESP32 +#include "esp32compat/PolledTimeout.h" +using esp32::polledTimeout::oneShotMs; +#define BUFFERSIZE CONFIG_TCP_MSS +#define PRINTu32 "u" +#endif #define FTP_SERVER_VERSION "0.9.7-20200529" @@ -84,8 +95,6 @@ #define FTP_CMD_LE_SYST 0x54535953 // "SYST" as uint32_t (little endian) #define FTP_CMD_BE_SYST 0x53595354 // "SYST" as uint32_t (big endian) -using esp8266::polledTimeout::oneShotMs; // import the type to the local namespace - class FTPCommon { public: @@ -124,7 +133,7 @@ protected: bool doNetworkToFile(); virtual void closeTransfer(); - uint16_t allocateBuffer(uint16_t desiredBytes); // allocate buffer for transfer + uint16_t allocateBuffer(uint16_t desiredBytes = BUFFERSIZE); // allocate buffer for transfer void freeBuffer(); uint8_t *fileBuffer = NULL; // pointer to buffer for file transfer (by allocateBuffer) uint16_t fileBufferSize; // size of buffer -- cgit v1.2.3