From f743ca4c6c770f4cfef5bac5446bb9828e43e230 Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Thu, 28 Nov 2019 19:47:31 +0300 Subject: [PATCH] Reword comments regarding 2.4.0 (#2024) --- code/espurna/config/general.h | 10 +++++----- code/espurna/config/prototypes.h | 12 ++++++------ code/espurna/utils.ino | 2 +- code/scripts/pio_main.py | 3 ++- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/code/espurna/config/general.h b/code/espurna/config/general.h index 6cc823f7..f57d50c6 100644 --- a/code/espurna/config/general.h +++ b/code/espurna/config/general.h @@ -606,8 +606,8 @@ #define WEB_EMBEDDED 1 // Build the firmware with the web interface embedded in #endif -// This is not working at the moment!! -// Requires SECURE_CLIENT = SECURE_CLIENT_AXTLS and ESP8266 Arduino Core 2.4.0 +// Requires ESPAsyncTCP to be built with ASYNC_TCP_SSL_ENABLED=1 and Arduino Core version >= 2.4.0 +// XXX: This is not working at the moment!! Pending https://github.com/me-no-dev/ESPAsyncTCP/issues/95 #ifndef WEB_SSL_ENABLED #define WEB_SSL_ENABLED 0 // Use HTTPS web interface #endif @@ -700,11 +700,11 @@ #endif #ifndef LLMNR_SUPPORT -#define LLMNR_SUPPORT 0 // Publish device using LLMNR protocol by default (1.95Kb) - requires 2.4.0 +#define LLMNR_SUPPORT 0 // Publish device using LLMNR protocol by default (1.95Kb) - requires Core version >= 2.4.0 #endif #ifndef NETBIOS_SUPPORT -#define NETBIOS_SUPPORT 0 // Publish device using NetBIOS protocol by default (1.26Kb) - requires 2.4.0 +#define NETBIOS_SUPPORT 0 // Publish device using NetBIOS protocol by default (1.26Kb) - requires Core version >= 2.4.0 #endif #ifndef SSDP_SUPPORT @@ -1363,7 +1363,7 @@ // THINGSPEAK OVER SSL // Using THINGSPEAK over SSL works well but generates problems with the web interface, // so you should compile it with WEB_SUPPORT to 0. -// When THINGSPEAK_USE_ASYNC is 1, requires SECURE_CLIENT = SECURE_CLIENT_AXTLS and ESP8266 Arduino Core >= 2.4.0. +// When THINGSPEAK_USE_ASYNC is 1, requires EspAsyncTCP to be built with ASYNC_TCP_SSL_ENABLED=1 and ESP8266 Arduino Core >= 2.4.0. #define THINGSPEAK_USE_SSL 0 // Use secure connection #define THINGSPEAK_FINGERPRINT "78 60 18 44 81 35 BF DF 77 84 D4 0A 22 0D 9B 4E 6C DC 57 2C" diff --git a/code/espurna/config/prototypes.h b/code/espurna/config/prototypes.h index 84cfd457..8b55670c 100644 --- a/code/espurna/config/prototypes.h +++ b/code/espurna/config/prototypes.h @@ -81,8 +81,8 @@ void systemStabilityCounter(uint8_t); // API // ----------------------------------------------------------------------------- -using api_get_callback_f = std::function; -using api_put_callback_f = std::function ; +using api_get_callback_f = std::function; +using api_put_callback_f = std::function ; #if WEB_SUPPORT void apiRegister(const char * key, api_get_callback_f getFn, api_put_callback_f putFn = NULL); @@ -192,8 +192,8 @@ void i2c_read_buffer(uint8_t address, uint8_t * buffer, size_t len); #include #endif -using mqtt_callback_f = std::function; -using mqtt_msg_t = std::pair; +using mqtt_callback_f = std::function; +using mqtt_msg_t = std::pair; // topic, payload void mqttRegister(mqtt_callback_f callback); @@ -312,7 +312,7 @@ class AsyncWebServer; class AwsEventType; #endif -using web_body_callback_f = std::function; +using web_body_callback_f = std::function; using web_request_callback_f = std::function; void webBodyRegister(web_body_callback_f); void webRequestRegister(web_request_callback_f); @@ -399,7 +399,7 @@ bool wifiConnected(); // ----------------------------------------------------------------------------- // THERMOSTAT // ----------------------------------------------------------------------------- -using thermostat_callback_f = std::function; +using thermostat_callback_f = std::function; #if THERMOSTAT_SUPPORT void thermostatRegister(thermostat_callback_f callback); #endif diff --git a/code/espurna/utils.ino b/code/espurna/utils.ino index aa07c1e6..56f2486a 100644 --- a/code/espurna/utils.ino +++ b/code/espurna/utils.ino @@ -597,7 +597,7 @@ bool sslFingerPrintChar(const char * fingerprint, char * destination) { // Fixed since 2.4.0, see: esp8266/core/esp8266/Esp.cpp: ESP::eraseConfig() bool eraseSDKConfig() { #if defined(ARDUINO_ESP8266_RELEASE_2_3_0) - const size_t cfgsize = 0x4000; + constexpr size_t cfgsize = 0x4000; size_t cfgaddr = ESP.getFlashChipSize() - cfgsize; for (size_t offset = 0; offset < cfgsize; offset += SPI_FLASH_SEC_SIZE) { diff --git a/code/scripts/pio_main.py b/code/scripts/pio_main.py index 313bc8c3..a53507fc 100644 --- a/code/scripts/pio_main.py +++ b/code/scripts/pio_main.py @@ -14,7 +14,8 @@ Import("env", "projenv") # Always show warnings for project code projenv.ProcessUnFlags("-w") -# 2.4.0 and up +# XXX: note that this will also break %d format with floats and print raw memory contents as int +# Cores after 2.3.0 can disable %f in the printf / scanf to reduce .bin size remove_float_support(env) ldscripts_inject_libpath(env)