diff --git a/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp b/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp index 7c3d128f4..0090390a7 100644 --- a/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp +++ b/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp @@ -43,7 +43,7 @@ ESP8266HTTPUpdate::~ESP8266HTTPUpdate(void) { } -#ifdef HTTPUPDATE_1_2_COMPATIBLE +#if HTTPUPDATE_1_2_COMPATIBLE HTTPUpdateResult ESP8266HTTPUpdate::update(const String& url, const String& currentVersion, const String& httpsFingerprint, bool reboot) { @@ -94,7 +94,7 @@ HTTPUpdateResult ESP8266HTTPUpdate::update(WiFiClient& client, const String& url return handleUpdate(http, currentVersion, false); } -#ifdef HTTPUPDATE_1_2_COMPATIBLE +#if HTTPUPDATE_1_2_COMPATIBLE HTTPUpdateResult ESP8266HTTPUpdate::updateSpiffs(const String& url, const String& currentVersion, const String& httpsFingerprint) { HTTPClient http; @@ -133,7 +133,7 @@ HTTPUpdateResult ESP8266HTTPUpdate::updateSpiffs(WiFiClient& client, const Strin return handleUpdate(http, currentVersion, true); } -#ifdef HTTPUPDATE_1_2_COMPATIBLE +#if HTTPUPDATE_1_2_COMPATIBLE HTTPUpdateResult ESP8266HTTPUpdate::update(const String& host, uint16_t port, const String& uri, const String& currentVersion, bool https, const String& httpsFingerprint, bool reboot) { diff --git a/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.h b/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.h index a61e071f7..14c0b6552 100644 --- a/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.h +++ b/libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.h @@ -26,14 +26,16 @@ #ifndef ESP8266HTTPUPDATE_H_ #define ESP8266HTTPUPDATE_H_ -#define HTTPUPDATE_1_2_COMPATIBLE - #include #include #include #include #include +#ifndef HTTPUPDATE_1_2_COMPATIBLE +#define HTTPUPDATE_1_2_COMPATIBLE HTTPCLIENT_1_1_COMPATIBLE +#endif + #ifdef DEBUG_ESP_HTTP_UPDATE #ifdef DEBUG_ESP_PORT #define DEBUG_HTTP_UPDATE(fmt, ...) DEBUG_ESP_PORT.printf_P( (PGM_P)PSTR(fmt), ## __VA_ARGS__ ) @@ -85,7 +87,7 @@ public: _ledOn = ledOn; } -#ifdef HTTPUPDATE_1_2_COMPATIBLE +#if HTTPUPDATE_1_2_COMPATIBLE // This function is deprecated, use rebootOnUpdate and the next one instead t_httpUpdate_return update(const String& url, const String& currentVersion, const String& httpsFingerprint, bool reboot) __attribute__((deprecated)); @@ -97,7 +99,7 @@ public: #endif t_httpUpdate_return update(WiFiClient& client, const String& url, const String& currentVersion = ""); -#ifdef HTTPUPDATE_1_2_COMPATIBLE +#if HTTPUPDATE_1_2_COMPATIBLE // This function is deprecated, use one of the overloads below along with rebootOnUpdate t_httpUpdate_return update(const String& host, uint16_t port, const String& uri, const String& currentVersion, bool https, const String& httpsFingerprint, bool reboot) __attribute__((deprecated)); @@ -112,7 +114,7 @@ public: t_httpUpdate_return update(WiFiClient& client, const String& host, uint16_t port, const String& uri = "/", const String& currentVersion = ""); -#ifdef HTTPUPDATE_1_2_COMPATIBLE +#if HTTPUPDATE_1_2_COMPATIBLE // This function is deprecated, use rebootOnUpdate and the next one instead t_httpUpdate_return updateSpiffs(const String& url, const String& currentVersion, const String& httpsFingerprint, bool reboot) __attribute__((deprecated));