diff --git a/src/ESPEasy.ino b/src/ESPEasy.ino index 6098f18a22..c52376aa57 100644 --- a/src/ESPEasy.ino +++ b/src/ESPEasy.ino @@ -314,7 +314,15 @@ #define FILE_SECURITY "security.dat" #define FILE_NOTIFICATION "notification.dat" #define FILE_RULES "rules1.dat" - #include "lwip/tcp_impl.h" + #include + #ifndef LWIP_VERSION_MAJOR + #error + #endif + #if LWIP_VERSION_MAJOR == 2 + // #include + #else + #include + #endif #include #include ESP8266WebServer WebServer(80); diff --git a/src/Misc.ino b/src/Misc.ino index a17e53109d..f0e1f0ef4b 100644 --- a/src/Misc.ino +++ b/src/Misc.ino @@ -7,10 +7,14 @@ #if defined(ESP8266) void tcpCleanup() { - while(tcp_tw_pcbs!=NULL) - { - tcp_abort(tcp_tw_pcbs); - } + #if LWIP_VERSION_MAJOR == 2 + // is it still needed ? + #else + while(tcp_tw_pcbs!=NULL) + { + tcp_abort(tcp_tw_pcbs); + } + #endif } #endif diff --git a/src/Networking.ino b/src/Networking.ino index 36a6c27813..5b3951bc04 100644 --- a/src/Networking.ino +++ b/src/Networking.ino @@ -2,6 +2,11 @@ // Syslog // UDP system messaging // SSDP + #if LWIP_VERSION_MAJOR == 2 + #define IP2STR(addr) (uint8_t)((uint32_t)addr & 0xFF), (uint8_t)(((uint32_t)addr >> 8) & 0xFF), (uint8_t)(((uint32_t)addr >> 16) & 0xFF), (uint8_t)(((uint32_t)addr >> 24) & 0xFF) + #endif + + /*********************************************************************************************\ Syslog client