mirror of https://github.com/arendst/Tasmota.git
Remove Arduino ESP8266 Core support before 2.7.1
Remove Arduino ESP8266 Core support for versions before 2.7.1
This commit is contained in:
parent
6b0870343b
commit
934ca43463
|
@ -54,6 +54,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
|
|||
|
||||
### Version 8.3.1.7
|
||||
|
||||
- Remove Arduino ESP8266 Core support for versions before 2.7.1
|
||||
- Change to limited support of Arduino IDE as an increasing amount of features cannot be compiled with Arduino IDE
|
||||
- Change IRremoteESP8266 library from v2.7.6 to v2.7.8
|
||||
- Change Adafruit_SGP30 library from v1.0.3 to v1.2.0 (#8519)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
### 8.3.1.7 20200716
|
||||
|
||||
- Remove Arduino ESP8266 Core support for versions before 2.7.1
|
||||
- Change to limited support of Arduino IDE as an increasing amount of features cannot be compiled with Arduino IDE
|
||||
|
||||
### 8.3.1.6 20200617
|
||||
|
|
|
@ -50,9 +50,7 @@ extern "C" {
|
|||
#include "c_types.h"
|
||||
|
||||
#include <core_version.h>
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_5_2
|
||||
#undef DEBUG_TLS
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_TLS
|
||||
#include "coredecls.h"
|
||||
|
@ -255,24 +253,14 @@ void WiFiClientSecure_light::setBufferSizes(int recv, int xmit) {
|
|||
}
|
||||
|
||||
bool WiFiClientSecure_light::stop(unsigned int maxWaitMs) {
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_4_2
|
||||
WiFiClient::stop(); // calls our virtual flush()
|
||||
_freeSSL();
|
||||
return true;
|
||||
#else
|
||||
bool ret = WiFiClient::stop(maxWaitMs); // calls our virtual flush()
|
||||
_freeSSL();
|
||||
return ret;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool WiFiClientSecure_light::flush(unsigned int maxWaitMs) {
|
||||
(void) _run_until(BR_SSL_SENDAPP);
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_4_2
|
||||
WiFiClient::flush();
|
||||
#else
|
||||
return WiFiClient::flush(maxWaitMs);
|
||||
#endif
|
||||
}
|
||||
|
||||
int WiFiClientSecure_light::connect(IPAddress ip, uint16_t port) {
|
||||
|
|
|
@ -25,12 +25,8 @@ class SendEmail
|
|||
const bool ssl;
|
||||
const int auth_used;
|
||||
#ifdef ESP8266
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
|
||||
WiFiClient* client;
|
||||
#else
|
||||
// use bear ssl
|
||||
BearSSL::WiFiClientSecure_light *client;
|
||||
#endif
|
||||
#else
|
||||
WiFiClient *client;
|
||||
#endif
|
||||
|
|
|
@ -159,14 +159,6 @@ extern "C" {
|
|||
|
||||
#ifdef ESP8266
|
||||
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) || defined(ARDUINO_ESP8266_RELEASE_2_5_0) || defined(ARDUINO_ESP8266_RELEASE_2_5_1) || defined(ARDUINO_ESP8266_RELEASE_2_5_2)
|
||||
|
||||
extern "C" uint32_t _SPIFFS_end;
|
||||
// From libraries/EEPROM/EEPROM.cpp EEPROMClass
|
||||
const uint32_t SPIFFS_END = ((uint32_t)&_SPIFFS_end - 0x40200000) / SPI_FLASH_SEC_SIZE;
|
||||
|
||||
#else // Core > 2.5.2 and STAGE
|
||||
|
||||
#if AUTOFLASHSIZE
|
||||
|
||||
#include "flash_hal.h"
|
||||
|
@ -187,8 +179,6 @@ const uint32_t SPIFFS_END = ((uint32_t)&_FS_end - 0x40200000) / SPI_FLASH_SEC_SI
|
|||
// Version 4.2 config = eeprom area
|
||||
const uint32_t SETTINGS_LOCATION = SPIFFS_END; // No need for SPIFFS as it uses EEPROM area
|
||||
|
||||
#endif // ESP8266
|
||||
|
||||
// Version 5.2 allow for more flash space
|
||||
const uint8_t CFG_ROTATES = 8; // Number of flash sectors used (handles uploads)
|
||||
|
||||
|
@ -632,11 +622,7 @@ void EspErase(uint32_t start_sector, uint32_t end_sector)
|
|||
// bool result = EsptoolEraseSector(sector); // Esptool - erases flash completely (slow)
|
||||
|
||||
if (serial_output) {
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
Serial.printf(D_LOG_APPLICATION D_ERASED_SECTOR " %d %s\n", sector, (result) ? D_OK : D_ERROR);
|
||||
#else
|
||||
Serial.printf_P(PSTR(D_LOG_APPLICATION D_ERASED_SECTOR " %d %s\n"), sector, (result) ? D_OK : D_ERROR);
|
||||
#endif
|
||||
delay(10);
|
||||
} else {
|
||||
yield();
|
||||
|
|
|
@ -1080,12 +1080,8 @@ int ResponseJsonEndEnd(void)
|
|||
* GPIO Module and Template management
|
||||
\*********************************************************************************************/
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception
|
||||
uint32_t Pin(uint32_t gpio, uint32_t index) ICACHE_RAM_ATTR;
|
||||
#endif
|
||||
|
||||
uint32_t Pin(uint32_t gpio, uint32_t index = 0);
|
||||
uint32_t Pin(uint32_t gpio, uint32_t index) {
|
||||
uint32_t ICACHE_RAM_ATTR Pin(uint32_t gpio, uint32_t index = 0);
|
||||
uint32_t ICACHE_RAM_ATTR Pin(uint32_t gpio, uint32_t index) {
|
||||
#ifdef ESP8266
|
||||
uint16_t real_gpio = gpio + index;
|
||||
#else // ESP32
|
||||
|
|
|
@ -112,11 +112,7 @@ DEBUG_SENSOR_LOG(PSTR("FLOG: init ..."));
|
|||
size = ESP.getSketchSize();
|
||||
// round one sector up
|
||||
start = (size + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1));
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) || defined(ARDUINO_ESP8266_RELEASE_2_5_0) || defined(ARDUINO_ESP8266_RELEASE_2_5_1) || defined(ARDUINO_ESP8266_RELEASE_2_5_2)
|
||||
end = (uint32_t)&_SPIFFS_start - 0x40200000;
|
||||
#else // Core > 2.5.2 and STAGE
|
||||
end = (uint32_t)&_FS_start - 0x40200000;
|
||||
#endif
|
||||
num_sectors = (end - start)/FLASH_SECTOR_SIZE;
|
||||
DEBUG_SENSOR_LOG(PSTR("FLOG: size: 0x%lx, start: 0x%lx, end: 0x%lx, num_sectors(dec): %lu"), size, start, end, num_sectors );
|
||||
_findFirstErasedSector();
|
||||
|
|
|
@ -17,9 +17,6 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
//#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
// Functions not available in 2.3.0
|
||||
|
||||
float fmodf(float x, float y)
|
||||
{
|
||||
// https://github.com/micropython/micropython/blob/master/lib/libm/fmodf.c
|
||||
|
@ -83,7 +80,6 @@ float fmodf(float x, float y)
|
|||
ux.i = uxi;
|
||||
return ux.f;
|
||||
}
|
||||
//#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
double FastPrecisePow(double a, double b)
|
||||
{
|
||||
|
|
|
@ -17,147 +17,6 @@
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
/*********************************************************************************************\
|
||||
* Functions not available in core 2.3.0
|
||||
\*********************************************************************************************/
|
||||
|
||||
// http://clc-wiki.net/wiki/C_standard_library:string.h:memchr
|
||||
void* memchr(const void* ptr, int value, size_t num)
|
||||
{
|
||||
unsigned char *p = (unsigned char*)ptr;
|
||||
while (num--) {
|
||||
if (*p != (unsigned char)value) {
|
||||
p++;
|
||||
} else {
|
||||
return p;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// http://clc-wiki.net/wiki/C_standard_library:string.h:strcspn
|
||||
// Get span until any character in string
|
||||
size_t strcspn(const char *str1, const char *str2)
|
||||
{
|
||||
size_t ret = 0;
|
||||
while (*str1) {
|
||||
if (strchr(str2, *str1)) { // Slow
|
||||
return ret;
|
||||
} else {
|
||||
str1++;
|
||||
ret++;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// https://clc-wiki.net/wiki/C_standard_library:string.h:strpbrk
|
||||
// Locate the first occurrence in the string pointed to by s1 of any character from the string pointed to by s2
|
||||
char* strpbrk(const char *s1, const char *s2)
|
||||
{
|
||||
while(*s1) {
|
||||
if (strchr(s2, *s1++)) {
|
||||
return (char*)--s1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// https://opensource.apple.com/source/Libc/Libc-583/stdlib/FreeBSD/strtoull.c
|
||||
// Convert a string to an unsigned long long integer
|
||||
#ifndef __LONG_LONG_MAX__
|
||||
#define __LONG_LONG_MAX__ 9223372036854775807LL
|
||||
#endif
|
||||
#ifndef ULLONG_MAX
|
||||
#define ULLONG_MAX (__LONG_LONG_MAX__ * 2ULL + 1)
|
||||
#endif
|
||||
|
||||
unsigned long long strtoull(const char *__restrict nptr, char **__restrict endptr, int base)
|
||||
{
|
||||
const char *s = nptr;
|
||||
char c;
|
||||
do { c = *s++; } while (isspace((unsigned char)c)); // Trim leading spaces
|
||||
|
||||
int neg = 0;
|
||||
if (c == '-') { // Set minus flag and/or skip sign
|
||||
neg = 1;
|
||||
c = *s++;
|
||||
} else {
|
||||
if (c == '+') {
|
||||
c = *s++;
|
||||
}
|
||||
}
|
||||
|
||||
if ((base == 0 || base == 16) && (c == '0') && (*s == 'x' || *s == 'X')) { // Set Hexadecimal
|
||||
c = s[1];
|
||||
s += 2;
|
||||
base = 16;
|
||||
}
|
||||
if (base == 0) { base = (c == '0') ? 8 : 10; } // Set Octal or Decimal
|
||||
|
||||
unsigned long long acc = 0;
|
||||
int any = 0;
|
||||
if (base > 1 && base < 37) {
|
||||
unsigned long long cutoff = ULLONG_MAX / base;
|
||||
int cutlim = ULLONG_MAX % base;
|
||||
for ( ; ; c = *s++) {
|
||||
if (c >= '0' && c <= '9')
|
||||
c -= '0';
|
||||
else if (c >= 'A' && c <= 'Z')
|
||||
c -= 'A' - 10;
|
||||
else if (c >= 'a' && c <= 'z')
|
||||
c -= 'a' - 10;
|
||||
else
|
||||
break;
|
||||
|
||||
if (c >= base)
|
||||
break;
|
||||
|
||||
if (any < 0 || acc > cutoff || (acc == cutoff && c > cutlim))
|
||||
any = -1;
|
||||
else {
|
||||
any = 1;
|
||||
acc *= base;
|
||||
acc += c;
|
||||
}
|
||||
}
|
||||
if (any < 0) {
|
||||
acc = ULLONG_MAX; // Range error
|
||||
}
|
||||
else if (any && neg) {
|
||||
acc = -acc;
|
||||
}
|
||||
}
|
||||
|
||||
if (endptr != nullptr) { *endptr = (char *)(any ? s - 1 : nptr); }
|
||||
|
||||
return acc;
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
|
||||
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) || defined(ARDUINO_ESP8266_RELEASE_2_5_0) || defined(ARDUINO_ESP8266_RELEASE_2_5_1) || defined(ARDUINO_ESP8266_RELEASE_2_5_2)
|
||||
/*********************************************************************************************\
|
||||
* Functions not available in core before 2.6.0
|
||||
\*********************************************************************************************/
|
||||
|
||||
// https://github.com/arendst/Tasmota/issues/6856#issuecomment-554258914
|
||||
void* memmove_P(void *dest, const void *src, size_t n)
|
||||
{
|
||||
if (src > (void*)0x40000000) {
|
||||
return memcpy_P(dest, src, n);
|
||||
} else {
|
||||
return memmove(dest, src, n);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ESP8266_RELEASE < 2_6_0
|
||||
|
||||
|
||||
|
||||
/*********************************************************************************************\
|
||||
* Core overrides
|
||||
\*********************************************************************************************/
|
||||
|
|
|
@ -852,11 +852,8 @@ void PerformEverySecond(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
// Wifi keep alive to send Gratuitous ARP
|
||||
wifiKeepAlive();
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
|
||||
#ifdef ESP32
|
||||
if (11 == uptime) { // Perform one-time ESP32 houskeeping
|
||||
|
@ -1027,13 +1024,8 @@ void Every250mSeconds(void)
|
|||
}
|
||||
#endif // FIRMWARE_MINIMAL
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_UPLOAD "%s"), mqtt_data);
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
|
||||
ota_result = (HTTP_UPDATE_FAILED != ESPhttpUpdate.update(mqtt_data));
|
||||
#else
|
||||
// If using core stage or 2.5.0+ the syntax has changed
|
||||
WiFiClient OTAclient;
|
||||
ota_result = (HTTP_UPDATE_FAILED != ESPhttpUpdate.update(OTAclient, mqtt_data));
|
||||
#endif
|
||||
if (!ota_result) {
|
||||
#ifndef FIRMWARE_MINIMAL
|
||||
int ota_error = ESPhttpUpdate.getLastError();
|
||||
|
|
|
@ -153,14 +153,11 @@ void WiFiSetSleepMode(void)
|
|||
*/
|
||||
|
||||
// Sleep explanation: https://github.com/esp8266/Arduino/blob/3f0c601cfe81439ce17e9bd5d28994a7ed144482/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.cpp#L255
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
|
||||
#else // Enabled in 2.3.0, 2.4.0 and stage
|
||||
if (ssleep && Settings.flag3.sleep_normal) { // SetOption60 - Enable normal sleep instead of dynamic sleep
|
||||
WiFi.setSleepMode(WIFI_LIGHT_SLEEP); // Allow light sleep during idle times
|
||||
} else {
|
||||
WiFi.setSleepMode(WIFI_MODEM_SLEEP); // Disable sleep (Esp8288/Arduino core and sdk default)
|
||||
}
|
||||
#endif
|
||||
WifiSetOutputPower();
|
||||
}
|
||||
|
||||
|
@ -172,12 +169,6 @@ void WifiBegin(uint8_t flag, uint8_t channel)
|
|||
UdpDisconnect();
|
||||
#endif // USE_EMULATION
|
||||
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0 // (!strncmp_P(ESP.getSdkVersion(),PSTR("1.5.3"),5))
|
||||
AddLog_P(LOG_LEVEL_DEBUG, S_LOG_WIFI, PSTR(D_PATCH_ISSUE_2186));
|
||||
// WiFi.mode(WIFI_OFF); // See https://github.com/esp8266/Arduino/issues/2186
|
||||
WifiSetMode(WIFI_OFF);
|
||||
#endif
|
||||
|
||||
WiFi.persistent(false); // Solve possible wifi init errors (re-add at 6.2.1.16 #4044, #4083)
|
||||
WiFi.disconnect(true); // Delete SDK wifi config
|
||||
delay(200);
|
||||
|
@ -652,7 +643,6 @@ void EspRestart(void)
|
|||
ESP_Restart();
|
||||
}
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
//
|
||||
// Gratuitous ARP, backported from https://github.com/esp8266/Arduino/pull/6889
|
||||
//
|
||||
|
@ -700,4 +690,3 @@ void wifiKeepAlive(void) {
|
|||
SetNextTimeInterval(wifiTimer, wifiTimerSec * 1000);
|
||||
}
|
||||
}
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
\*********************************************************************************************/
|
||||
|
||||
// Location specific includes
|
||||
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_3_0)
|
||||
#include <core_version.h> // Arduino_Esp8266 version information (ARDUINO_ESP8266_RELEASE and ARDUINO_ESP8266_RELEASE_2_7_1)
|
||||
#include "tasmota_compat.h"
|
||||
#include "tasmota_version.h" // Tasmota version information
|
||||
#include "tasmota.h" // Enumeration used in my_user_config.h
|
||||
|
@ -46,13 +46,6 @@
|
|||
#include "i18n.h" // Language support configured by my_user_config.h
|
||||
#include "tasmota_template.h" // Hardware configuration
|
||||
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_4_0
|
||||
#include "lwip/init.h"
|
||||
#if LWIP_VERSION_MAJOR != 1
|
||||
#error Please use stable lwIP v1.4
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// Libraries
|
||||
#include <ESP8266HTTPClient.h> // Ota
|
||||
#include <ESP8266httpUpdate.h> // Ota
|
||||
|
|
|
@ -280,13 +280,11 @@
|
|||
|
||||
#define USE_SPI // Hardware SPI using GPIO12(MISO), GPIO13(MOSI) and GPIO14(CLK) in addition to two user selectable GPIOs(CS and DC)
|
||||
#define USE_DISPLAY_ILI9341 // [DisplayModel 4] Enable ILI9341 Tft 480x320 display (+19k code)
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // There is not enough spare RAM with core 2.3.0 to support the following
|
||||
#define USE_DISPLAY_EPAPER_29 // [DisplayModel 5] Enable e-paper 2.9 inch display (+19k code)
|
||||
#define USE_DISPLAY_EPAPER_42 // [DisplayModel 6] Enable e-paper 4.2 inch display
|
||||
// #define USE_DISPLAY_ILI9488 // [DisplayModel 8]
|
||||
// #define USE_DISPLAY_SSD1351 // [DisplayModel 9]
|
||||
// #define USE_DISPLAY_RA8876 // [DisplayModel 10]
|
||||
#endif
|
||||
|
||||
#undef DEBUG_THEO // Disable debug code
|
||||
#undef USE_DEBUG_DRIVER // Disable debug code
|
||||
|
|
|
@ -128,8 +128,8 @@ String EthernetMacAddress(void);
|
|||
const uint16_t WEB_LOG_SIZE = 4000; // Max number of characters in weblog
|
||||
#endif
|
||||
|
||||
#if defined(USE_TLS) && defined(ARDUINO_ESP8266_RELEASE_2_3_0)
|
||||
#error "TLS is no more supported on Core 2.3.0, use 2.4.2 or higher."
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2) || defined(ARDUINO_ESP8266_RELEASE_2_5_0) || defined(ARDUINO_ESP8266_RELEASE_2_5_1) || defined(ARDUINO_ESP8266_RELEASE_2_5_2)
|
||||
#error "Arduino ESP8266 Core versions before 2.7.1 are not supported"
|
||||
#endif
|
||||
|
||||
#ifndef MQTT_MAX_PACKET_SIZE
|
||||
|
|
|
@ -913,14 +913,8 @@ void WifiManagerBegin(bool reset_only)
|
|||
int channel = WIFI_SOFT_AP_CHANNEL;
|
||||
if ((channel < 1) || (channel > 13)) { channel = 1; }
|
||||
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
// bool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0);
|
||||
WiFi.softAP(my_hostname, WIFI_AP_PASSPHRASE, channel, 0);
|
||||
#else
|
||||
// bool softAP(const char* ssid, const char* passphrase = NULL, int channel = 1, int ssid_hidden = 0, int max_connection = 4);
|
||||
WiFi.softAP(my_hostname, WIFI_AP_PASSPHRASE, channel, 0, 1);
|
||||
#endif
|
||||
|
||||
delay(500); // Without delay I've seen the IP address blank
|
||||
/* Setup the DNS server redirecting all the domains to the apIP */
|
||||
DnsServer->setErrorReplyCode(DNSReplyCode::NoError);
|
||||
|
@ -992,10 +986,6 @@ void WSContentBegin(int code, int ctype)
|
|||
{
|
||||
Webserver->client().flush();
|
||||
WSHeaderSend();
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
Webserver->sendHeader(F("Accept-Ranges"),F("none"));
|
||||
Webserver->sendHeader(F("Transfer-Encoding"),F("chunked"));
|
||||
#endif
|
||||
Webserver->setContentLength(CONTENT_LENGTH_UNKNOWN);
|
||||
WSSend(code, ctype, ""); // Signal start of chunked content
|
||||
Web.chunk_buffer = "";
|
||||
|
@ -1004,15 +994,7 @@ void WSContentBegin(int code, int ctype)
|
|||
void _WSContentSend(const String& content) // Low level sendContent for all core versions
|
||||
{
|
||||
size_t len = content.length();
|
||||
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
const char * footer = "\r\n";
|
||||
char chunk_size[11];
|
||||
sprintf(chunk_size, "%x\r\n", len);
|
||||
Webserver->sendContent(String() + chunk_size + content + footer);
|
||||
#else
|
||||
Webserver->sendContent(content);
|
||||
#endif
|
||||
|
||||
#ifdef USE_DEBUG_DRIVER
|
||||
ShowFreeMem(PSTR("WSContentSend"));
|
||||
|
@ -1377,7 +1359,7 @@ void HandleRoot(void)
|
|||
"c", // c - Unique HTML id
|
||||
"#000", "#fff", // Black to White
|
||||
4, // sl4 - Unique range HTML id - Used as source for Saturation begin color
|
||||
Settings.flag3.slider_dimmer_stay_on, 100, // Range 0/1 to 100%
|
||||
Settings.flag3.slider_dimmer_stay_on, 100, // Range 0/1 to 100% (SetOption77 - Do not power off if slider moved to far left)
|
||||
Settings.light_dimmer,
|
||||
'd', 0); // d0 - Value id is related to lc("d0", value) and WebGetArg("d0", tmp, sizeof(tmp));
|
||||
|
||||
|
@ -1389,7 +1371,7 @@ void HandleRoot(void)
|
|||
"f", // f - Unique HTML id
|
||||
"#000", "#fff", // Black to White
|
||||
5, // sl5 - Unique range HTML id - Not used
|
||||
Settings.flag3.slider_dimmer_stay_on, 100, // Range 0/1 to 100%
|
||||
Settings.flag3.slider_dimmer_stay_on, 100, // Range 0/1 to 100% (SetOption77 - Do not power off if slider moved to far left)
|
||||
LightGetDimmer(2),
|
||||
'w', 0); // w0 - Value id is related to lc("w0", value) and WebGetArg("w0", tmp, sizeof(tmp));
|
||||
}
|
||||
|
@ -2367,14 +2349,7 @@ void HandleBackupConfiguration(void)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
size_t written = myClient.write((const char*)settings_buffer, sizeof(Settings));
|
||||
if (written < sizeof(Settings)) { // https://github.com/esp8266/Arduino/issues/3218
|
||||
myClient.write((const char*)settings_buffer +written, sizeof(Settings) -written);
|
||||
}
|
||||
#else
|
||||
myClient.write((const char*)settings_buffer, sizeof(Settings));
|
||||
#endif
|
||||
|
||||
SettingsBufferFree();
|
||||
|
||||
|
@ -3152,14 +3127,9 @@ int WebSend(char *buffer)
|
|||
|
||||
DEBUG_CORE_LOG(PSTR("WEB: Uri |%s|"), url.c_str());
|
||||
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1) || defined(ARDUINO_ESP8266_RELEASE_2_4_2)
|
||||
HTTPClient http;
|
||||
if (http.begin(UrlEncode(url))) { // UrlEncode(url) = |http://192.168.178.86/cm?cmnd=POWER1%20ON|
|
||||
#else
|
||||
WiFiClient http_client;
|
||||
HTTPClient http;
|
||||
if (http.begin(http_client, UrlEncode(url))) { // UrlEncode(url) = |http://192.168.178.86/cm?cmnd=POWER1%20ON|
|
||||
#endif
|
||||
int http_code = http.GET(); // Start connection and send HTTP header
|
||||
if (http_code > 0) { // http_code will be negative on error
|
||||
if (http_code == HTTP_CODE_OK || http_code == HTTP_CODE_MOVED_PERMANENTLY) {
|
||||
|
|
|
@ -1217,11 +1217,7 @@ void CmndTlsDump(void) {
|
|||
uint32_t end = start + tls_block_len -1;
|
||||
for (uint32_t pos = start; pos < end; pos += 0x10) {
|
||||
uint32_t* values = (uint32_t*)(pos);
|
||||
#ifdef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
Serial.printf("%08x: %08x %08x %08x %08x\n", pos, bswap32(values[0]), bswap32(values[1]), bswap32(values[2]), bswap32(values[3]));
|
||||
#else
|
||||
Serial.printf_P(PSTR("%08x: %08x %08x %08x %08x\n"), pos, bswap32(values[0]), bswap32(values[1]), bswap32(values[2]), bswap32(values[3]));
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif // DEBUG_DUMP_TLS
|
||||
|
|
|
@ -1164,11 +1164,9 @@ uint32_t pulse_ltime_hl;
|
|||
uint32_t pulse_ltime_lh;
|
||||
uint8_t pt_pin;
|
||||
|
||||
void MP_Timer(void) ICACHE_RAM_ATTR;
|
||||
|
||||
#define MPT_DEBOUNCE 10
|
||||
|
||||
void MP_Timer(void) {
|
||||
void ICACHE_RAM_ATTR MP_Timer(void) {
|
||||
uint32_t level = digitalRead(pt_pin&0x3f);
|
||||
uint32_t ms = millis();
|
||||
uint32_t time;
|
||||
|
@ -2899,19 +2897,6 @@ char *getop(char *lp, uint8_t *operand) {
|
|||
|
||||
|
||||
#ifdef ESP8266
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1)
|
||||
// All version before core 2.4.2
|
||||
// https://github.com/esp8266/Arduino/issues/2557
|
||||
extern "C" {
|
||||
#include <cont.h>
|
||||
extern cont_t g_cont;
|
||||
}
|
||||
uint16_t GetStack(void) {
|
||||
register uint32_t *sp asm("a1");
|
||||
return (4 * (sp - g_cont.stack));
|
||||
}
|
||||
|
||||
#else
|
||||
extern "C" {
|
||||
#include <cont.h>
|
||||
extern cont_t* g_pcont;
|
||||
|
@ -2920,7 +2905,6 @@ uint16_t GetStack(void) {
|
|||
register uint32_t *sp asm("a1");
|
||||
return (4 * (sp - g_pcont->stack));
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
uint16_t GetStack(void) {
|
||||
register uint8_t *sp asm("a1");
|
||||
|
@ -4349,18 +4333,10 @@ uint8_t reject(char *name) {
|
|||
if (*name=='_') return 1;
|
||||
if (*name=='.') return 1;
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
if (!strncasecmp(name,"SPOTLI~1",REJCMPL)) return 1;
|
||||
if (!strncasecmp(name,"TRASHE~1",REJCMPL)) return 1;
|
||||
if (!strncasecmp(name,"FSEVEN~1",REJCMPL)) return 1;
|
||||
if (!strncasecmp(name,"SYSTEM~1",REJCMPL)) return 1;
|
||||
#else
|
||||
if (!strcasecmp(name,"SPOTLI~1")) return 1;
|
||||
if (!strcasecmp(name,"TRASHE~1")) return 1;
|
||||
if (!strcasecmp(name,"FSEVEN~1")) return 1;
|
||||
if (!strcasecmp(name,"SYSTEM~1")) return 1;
|
||||
#endif
|
||||
|
||||
if (!strncasecmp(name,"System Volume",13)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -45,11 +45,9 @@ struct ARILUX {
|
|||
uint8_t rf_toggle = 0;
|
||||
} Arilux;
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception
|
||||
#ifndef USE_WS2812_DMA // Collides with Neopixelbus but solves RF misses
|
||||
void AriluxRfInterrupt(void) ICACHE_RAM_ATTR; // As iram is tight and it works this way too
|
||||
#endif // USE_WS2812_DMA
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
void AriluxRfInterrupt(void)
|
||||
{
|
||||
|
|
|
@ -189,24 +189,6 @@ void CpuLoadLoop(void)
|
|||
/*******************************************************************************************/
|
||||
|
||||
#ifdef ESP8266
|
||||
#if defined(ARDUINO_ESP8266_RELEASE_2_3_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_0) || defined(ARDUINO_ESP8266_RELEASE_2_4_1)
|
||||
// All version before core 2.4.2
|
||||
// https://github.com/esp8266/Arduino/issues/2557
|
||||
|
||||
extern "C" {
|
||||
#include <cont.h>
|
||||
extern cont_t g_cont;
|
||||
}
|
||||
|
||||
void DebugFreeMem(void)
|
||||
{
|
||||
register uint32_t *sp asm("a1");
|
||||
|
||||
// AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "FreeRam %d, FreeStack %d, UnmodifiedStack %d (%s)"), ESP.getFreeHeap(), 4 * (sp - g_cont.stack), cont_get_free_stack(&g_cont), XdrvMailbox.data);
|
||||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "FreeRam %d, FreeStack %d (%s)"), ESP.getFreeHeap(), 4 * (sp - g_cont.stack), XdrvMailbox.data);
|
||||
}
|
||||
|
||||
#else
|
||||
// All version from core 2.4.2
|
||||
// https://github.com/esp8266/Arduino/pull/5018
|
||||
// https://github.com/esp8266/Arduino/pull/4553
|
||||
|
@ -223,8 +205,6 @@ void DebugFreeMem(void)
|
|||
AddLog_P2(LOG_LEVEL_DEBUG, PSTR(D_LOG_DEBUG "FreeRam %d, FreeStack %d (%s)"), ESP.getFreeHeap(), 4 * (sp - g_pcont->stack), XdrvMailbox.data);
|
||||
}
|
||||
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_x_x
|
||||
|
||||
#else // ESP32
|
||||
|
||||
void DebugFreeMem(void)
|
||||
|
|
|
@ -47,15 +47,7 @@ struct COUNTER {
|
|||
uint32_t last_cycle;
|
||||
uint32_t cycle_time;
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception
|
||||
void CounterUpdate(uint8_t index) ICACHE_RAM_ATTR;
|
||||
void CounterUpdate1(void) ICACHE_RAM_ATTR;
|
||||
void CounterUpdate2(void) ICACHE_RAM_ATTR;
|
||||
void CounterUpdate3(void) ICACHE_RAM_ATTR;
|
||||
void CounterUpdate4(void) ICACHE_RAM_ATTR;
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
void CounterUpdate(uint8_t index)
|
||||
void ICACHE_RAM_ATTR CounterUpdate(uint8_t index)
|
||||
{
|
||||
uint32_t time = micros();
|
||||
uint32_t debounce_time;
|
||||
|
@ -125,22 +117,22 @@ void CounterUpdate(uint8_t index)
|
|||
}
|
||||
}
|
||||
|
||||
void CounterUpdate1(void)
|
||||
void ICACHE_RAM_ATTR CounterUpdate1(void)
|
||||
{
|
||||
CounterUpdate(0);
|
||||
}
|
||||
|
||||
void CounterUpdate2(void)
|
||||
void ICACHE_RAM_ATTR CounterUpdate2(void)
|
||||
{
|
||||
CounterUpdate(1);
|
||||
}
|
||||
|
||||
void CounterUpdate3(void)
|
||||
void ICACHE_RAM_ATTR CounterUpdate3(void)
|
||||
{
|
||||
CounterUpdate(2);
|
||||
}
|
||||
|
||||
void CounterUpdate4(void)
|
||||
void ICACHE_RAM_ATTR CounterUpdate4(void)
|
||||
{
|
||||
CounterUpdate(3);
|
||||
}
|
||||
|
|
|
@ -150,11 +150,7 @@ uint32_t tx2x_last_available = 0;
|
|||
uint32_t tx23_stage = 0;
|
||||
#endif // USE_TX23_WIND_SENSOR
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception
|
||||
void TX2xStartRead(void) ICACHE_RAM_ATTR; // As iram is tight and it works this way too
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
void TX2xStartRead(void)
|
||||
void ICACHE_RAM_ATTR TX2xStartRead(void)
|
||||
{
|
||||
/**
|
||||
* La Crosse TX20 Anemometer datagram every 2 seconds
|
||||
|
|
|
@ -1811,16 +1811,7 @@ struct SML_COUNTER {
|
|||
#endif
|
||||
} sml_counters[MAX_COUNTERS];
|
||||
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception
|
||||
void SML_CounterUpd(uint8_t index) ICACHE_RAM_ATTR;
|
||||
void SML_CounterUpd1(void) ICACHE_RAM_ATTR;
|
||||
void SML_CounterUpd2(void) ICACHE_RAM_ATTR;
|
||||
void SML_CounterUpd3(void) ICACHE_RAM_ATTR;
|
||||
void SML_CounterUpd4(void) ICACHE_RAM_ATTR;
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
void SML_CounterUpd(uint8_t index) {
|
||||
void ICACHE_RAM_ATTR SML_CounterUpd(uint8_t index) {
|
||||
|
||||
uint8_t level=digitalRead(meter_desc_p[sml_counters[index].sml_cnt_old_state].srcpin);
|
||||
if (!level) {
|
||||
|
@ -1838,19 +1829,19 @@ void SML_CounterUpd(uint8_t index) {
|
|||
}
|
||||
}
|
||||
|
||||
void SML_CounterUpd1(void) {
|
||||
void ICACHE_RAM_ATTR SML_CounterUpd1(void) {
|
||||
SML_CounterUpd(0);
|
||||
}
|
||||
|
||||
void SML_CounterUpd2(void) {
|
||||
void ICACHE_RAM_ATTR SML_CounterUpd2(void) {
|
||||
SML_CounterUpd(1);
|
||||
}
|
||||
|
||||
void SML_CounterUpd3(void) {
|
||||
void ICACHE_RAM_ATTR SML_CounterUpd3(void) {
|
||||
SML_CounterUpd(2);
|
||||
}
|
||||
|
||||
void SML_CounterUpd4(void) {
|
||||
void ICACHE_RAM_ATTR SML_CounterUpd4(void) {
|
||||
SML_CounterUpd(3);
|
||||
}
|
||||
|
||||
|
|
|
@ -72,11 +72,7 @@ struct WINDMETER {
|
|||
#endif // USE_WINDMETER_NOSTATISTICS
|
||||
} WindMeter;
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception
|
||||
void WindMeterUpdateSpeed(void) ICACHE_RAM_ATTR;
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
void WindMeterUpdateSpeed(void)
|
||||
void ICACHE_RAM_ATTR WindMeterUpdateSpeed(void)
|
||||
{
|
||||
uint32_t time = micros();
|
||||
uint32_t time_diff = time - WindMeter.counter_time;
|
||||
|
|
|
@ -40,13 +40,9 @@ void LMT01_Init(void) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifndef ARDUINO_ESP8266_RELEASE_2_3_0 // Fix core 2.5.x ISR not in IRAM Exception
|
||||
void LMT01_countPulse(void) ICACHE_RAM_ATTR;
|
||||
#endif // ARDUINO_ESP8266_RELEASE_2_3_0
|
||||
|
||||
volatile int lmt01_pulseCount = 0;
|
||||
|
||||
void LMT01_countPulse(void) {
|
||||
void ICACHE_RAM_ATTR LMT01_countPulse(void) {
|
||||
lmt01_pulseCount++;
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,7 @@ int LMT01_getPulses(void) {
|
|||
hold = lmt01_pulseCount;
|
||||
delay(1);
|
||||
}
|
||||
// discard spurious low counts
|
||||
// discard spurious low counts
|
||||
if (timeout > 0 && hold >= 10) {
|
||||
return hold;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue