From f53a95b1da64bcfcce57b3674403b68c6e2ff93b Mon Sep 17 00:00:00 2001 From: Timothy Johnson Date: Thu, 5 Nov 2020 21:31:01 -0500 Subject: [PATCH] Add support for WifiEsp library --- src/ezTime.cpp | 15 +++++++++++++-- src/ezTime.h | 3 +++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/ezTime.cpp b/src/ezTime.cpp index f45dd5b..78d4399 100644 --- a/src/ezTime.cpp +++ b/src/ezTime.cpp @@ -20,6 +20,9 @@ #include #include #include + #elif defined(EZTIME_WIFIESP) + #include + #include #else #include #include @@ -416,7 +419,11 @@ namespace ezt { #ifndef EZTIME_ETHERNET if (WiFi.status() != WL_CONNECTED) { triggerError(NO_NETWORK); return false; } - WiFiUDP udp; + #ifndef EZTIME_WIFIESP + WiFiUDP udp; + #else + WiFiEspUDP udp; + #endif #else EthernetUDP udp; #endif @@ -799,7 +806,11 @@ String Timezone::getPosix() { return _posix; } #ifndef EZTIME_ETHERNET if (WiFi.status() != WL_CONNECTED) { triggerError(NO_NETWORK); return false; } - WiFiUDP udp; + #ifndef EZTIME_WIFIESP + WiFiUDP udp; + #else + WiFiEspUDP udp; + #endif #else EthernetUDP udp; #endif diff --git a/src/ezTime.h b/src/ezTime.h index 3fbff78..d849847 100644 --- a/src/ezTime.h +++ b/src/ezTime.h @@ -13,6 +13,9 @@ // Arduino Ethernet shields // #define EZTIME_ETHERNET +// Arduino board with ESP8266 shield +// #define EZTIME_WIFIESP + // Uncomment one of the below to only put only messages up to a certain level in the compiled code // (You still need to turn them on with setDebug(someLevel) to see them) // #define EZTIME_MAX_DEBUGLEVEL_NONE