2626#ifndef ESP8266HTTPUPDATE_H_
2727#define ESP8266HTTPUPDATE_H_
2828
29- #define HTTPUPDATE_1_2_COMPATIBLE
30-
3129#include < Arduino.h>
3230#include < ESP8266WiFi.h>
3331#include < WiFiClient.h>
3432#include < WiFiUdp.h>
3533#include < ESP8266HTTPClient.h>
3634
35+ #ifndef HTTPUPDATE_1_2_COMPATIBLE
36+ #define HTTPUPDATE_1_2_COMPATIBLE HTTPCLIENT_1_1_COMPATIBLE
37+ #endif
38+
3739#ifdef DEBUG_ESP_HTTP_UPDATE
3840#ifdef DEBUG_ESP_PORT
3941#define DEBUG_HTTP_UPDATE (fmt, ...) DEBUG_ESP_PORT.printf_P( (PGM_P)PSTR(fmt), ## __VA_ARGS__ )
@@ -85,7 +87,7 @@ class ESP8266HTTPUpdate
8587 _ledOn = ledOn;
8688 }
8789
88- #ifdef HTTPUPDATE_1_2_COMPATIBLE
90+ #if HTTPUPDATE_1_2_COMPATIBLE
8991 // This function is deprecated, use rebootOnUpdate and the next one instead
9092 t_httpUpdate_return update(const String& url, const String& currentVersion,
9193 const String& httpsFingerprint, bool reboot) __attribute__((deprecated));
@@ -97,7 +99,7 @@ class ESP8266HTTPUpdate
9799#endif
98100 t_httpUpdate_return update(WiFiClient& client, const String& url, const String& currentVersion = " " );
99101
100- #ifdef HTTPUPDATE_1_2_COMPATIBLE
102+ #if HTTPUPDATE_1_2_COMPATIBLE
101103 // This function is deprecated, use one of the overloads below along with rebootOnUpdate
102104 t_httpUpdate_return update(const String& host, uint16_t port, const String& uri, const String& currentVersion,
103105 bool https, const String& httpsFingerprint, bool reboot) __attribute__((deprecated));
@@ -112,7 +114,7 @@ class ESP8266HTTPUpdate
112114 t_httpUpdate_return update(WiFiClient& client, const String& host, uint16_t port, const String& uri = " /" ,
113115 const String& currentVersion = " " );
114116
115- #ifdef HTTPUPDATE_1_2_COMPATIBLE
117+ #if HTTPUPDATE_1_2_COMPATIBLE
116118 // This function is deprecated, use rebootOnUpdate and the next one instead
117119 t_httpUpdate_return updateSpiffs(const String& url, const String& currentVersion,
118120 const String& httpsFingerprint, bool reboot) __attribute__((deprecated));
0 commit comments