diff --git a/README.md b/README.md index b8d3b89e9..7704c15f2 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ Please provide as much context as possible, as well as the information requested ### Contributing -For minor fixes of code and documentation, please go ahead and submit a pull request. +For minor fixes of code and documentation, please go ahead and submit a pull request. A gentle introduction to the process can be found [here](https://www.freecodecamp.org/news/a-simple-git-guide-and-cheat-sheet-for-open-source-contributors/). Check out the list of issues that are easy to fix — [easy issues pending](https://github.com/esp8266/Arduino/issues?q=is%3Aopen+is%3Aissue+label%3A%22level%3A+easy%22). Working on them is a great way to move the project forward. diff --git a/boards.txt b/boards.txt index a651a0f56..b14d8df2c 100644 --- a/boards.txt +++ b/boards.txt @@ -365,6 +365,8 @@ generic.menu.led.14=14 generic.menu.led.14.build.led=-DLED_BUILTIN=14 generic.menu.led.15=15 generic.menu.led.15.build.led=-DLED_BUILTIN=15 +generic.menu.led.16=16 +generic.menu.led.16.build.led=-DLED_BUILTIN=16 generic.menu.sdk.nonosdk222_100=nonos-sdk 2.2.1+100 (testing) generic.menu.sdk.nonosdk222_100.build.sdk=NONOSDK22y generic.menu.sdk.nonosdk221=nonos-sdk 2.2.1 (legacy) @@ -466,8 +468,6 @@ generic.menu.wipe.all=All Flash Contents generic.menu.wipe.all.upload.erase_cmd=erase_flash generic.menu.baud.115200=115200 generic.menu.baud.115200.upload.speed=115200 -generic.menu.baud.9600=9600 -generic.menu.baud.9600.upload.speed=9600 generic.menu.baud.57600=57600 generic.menu.baud.57600.upload.speed=57600 generic.menu.baud.230400.linux=230400 @@ -641,6 +641,8 @@ esp8285.menu.led.14=14 esp8285.menu.led.14.build.led=-DLED_BUILTIN=14 esp8285.menu.led.15=15 esp8285.menu.led.15.build.led=-DLED_BUILTIN=15 +esp8285.menu.led.16=16 +esp8285.menu.led.16.build.led=-DLED_BUILTIN=16 esp8285.menu.ip.lm2f=v2 Lower Memory esp8285.menu.ip.lm2f.build.lwip_include=lwip2/include esp8285.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat @@ -736,8 +738,6 @@ esp8285.menu.wipe.all=All Flash Contents esp8285.menu.wipe.all.upload.erase_cmd=erase_flash esp8285.menu.baud.115200=115200 esp8285.menu.baud.115200.upload.speed=115200 -esp8285.menu.baud.9600=9600 -esp8285.menu.baud.9600.upload.speed=9600 esp8285.menu.baud.57600=57600 esp8285.menu.baud.57600.upload.speed=57600 esp8285.menu.baud.230400.linux=230400 @@ -932,8 +932,6 @@ espduino.menu.wipe.all=All Flash Contents espduino.menu.wipe.all.upload.erase_cmd=erase_flash espduino.menu.baud.115200=115200 espduino.menu.baud.115200.upload.speed=115200 -espduino.menu.baud.9600=9600 -espduino.menu.baud.9600.upload.speed=9600 espduino.menu.baud.57600=57600 espduino.menu.baud.57600.upload.speed=57600 espduino.menu.baud.230400.linux=230400 @@ -1120,8 +1118,6 @@ huzzah.menu.wipe.all=All Flash Contents huzzah.menu.wipe.all.upload.erase_cmd=erase_flash huzzah.menu.baud.115200=115200 huzzah.menu.baud.115200.upload.speed=115200 -huzzah.menu.baud.9600=9600 -huzzah.menu.baud.9600.upload.speed=9600 huzzah.menu.baud.57600=57600 huzzah.menu.baud.57600.upload.speed=57600 huzzah.menu.baud.230400.linux=230400 @@ -1308,8 +1304,6 @@ inventone.menu.wipe.all=All Flash Contents inventone.menu.wipe.all.upload.erase_cmd=erase_flash inventone.menu.baud.115200=115200 inventone.menu.baud.115200.upload.speed=115200 -inventone.menu.baud.9600=9600 -inventone.menu.baud.9600.upload.speed=9600 inventone.menu.baud.57600=57600 inventone.menu.baud.57600.upload.speed=57600 inventone.menu.baud.230400.linux=230400 @@ -1499,8 +1493,6 @@ cw01.menu.wipe.all=All Flash Contents cw01.menu.wipe.all.upload.erase_cmd=erase_flash cw01.menu.baud.115200=115200 cw01.menu.baud.115200.upload.speed=115200 -cw01.menu.baud.9600=9600 -cw01.menu.baud.9600.upload.speed=9600 cw01.menu.baud.57600=57600 cw01.menu.baud.57600.upload.speed=57600 cw01.menu.baud.230400.linux=230400 @@ -1690,8 +1682,6 @@ espresso_lite_v1.menu.wipe.all=All Flash Contents espresso_lite_v1.menu.wipe.all.upload.erase_cmd=erase_flash espresso_lite_v1.menu.baud.115200=115200 espresso_lite_v1.menu.baud.115200.upload.speed=115200 -espresso_lite_v1.menu.baud.9600=9600 -espresso_lite_v1.menu.baud.9600.upload.speed=9600 espresso_lite_v1.menu.baud.57600=57600 espresso_lite_v1.menu.baud.57600.upload.speed=57600 espresso_lite_v1.menu.baud.230400.linux=230400 @@ -1881,8 +1871,6 @@ espresso_lite_v2.menu.wipe.all=All Flash Contents espresso_lite_v2.menu.wipe.all.upload.erase_cmd=erase_flash espresso_lite_v2.menu.baud.115200=115200 espresso_lite_v2.menu.baud.115200.upload.speed=115200 -espresso_lite_v2.menu.baud.9600=9600 -espresso_lite_v2.menu.baud.9600.upload.speed=9600 espresso_lite_v2.menu.baud.57600=57600 espresso_lite_v2.menu.baud.57600.upload.speed=57600 espresso_lite_v2.menu.baud.230400.linux=230400 @@ -2072,8 +2060,6 @@ phoenix_v1.menu.wipe.all=All Flash Contents phoenix_v1.menu.wipe.all.upload.erase_cmd=erase_flash phoenix_v1.menu.baud.115200=115200 phoenix_v1.menu.baud.115200.upload.speed=115200 -phoenix_v1.menu.baud.9600=9600 -phoenix_v1.menu.baud.9600.upload.speed=9600 phoenix_v1.menu.baud.57600=57600 phoenix_v1.menu.baud.57600.upload.speed=57600 phoenix_v1.menu.baud.230400.linux=230400 @@ -2263,8 +2249,6 @@ phoenix_v2.menu.wipe.all=All Flash Contents phoenix_v2.menu.wipe.all.upload.erase_cmd=erase_flash phoenix_v2.menu.baud.115200=115200 phoenix_v2.menu.baud.115200.upload.speed=115200 -phoenix_v2.menu.baud.9600=9600 -phoenix_v2.menu.baud.9600.upload.speed=9600 phoenix_v2.menu.baud.57600=57600 phoenix_v2.menu.baud.57600.upload.speed=57600 phoenix_v2.menu.baud.230400.linux=230400 @@ -2451,8 +2435,6 @@ nodemcu.menu.wipe.all=All Flash Contents nodemcu.menu.wipe.all.upload.erase_cmd=erase_flash nodemcu.menu.baud.115200=115200 nodemcu.menu.baud.115200.upload.speed=115200 -nodemcu.menu.baud.9600=9600 -nodemcu.menu.baud.9600.upload.speed=9600 nodemcu.menu.baud.57600=57600 nodemcu.menu.baud.57600.upload.speed=57600 nodemcu.menu.baud.230400.linux=230400 @@ -2639,8 +2621,6 @@ nodemcuv2.menu.wipe.all=All Flash Contents nodemcuv2.menu.wipe.all.upload.erase_cmd=erase_flash nodemcuv2.menu.baud.115200=115200 nodemcuv2.menu.baud.115200.upload.speed=115200 -nodemcuv2.menu.baud.9600=9600 -nodemcuv2.menu.baud.9600.upload.speed=9600 nodemcuv2.menu.baud.57600=57600 nodemcuv2.menu.baud.57600.upload.speed=57600 nodemcuv2.menu.baud.230400.linux=230400 @@ -2847,8 +2827,6 @@ modwifi.menu.wipe.all=All Flash Contents modwifi.menu.wipe.all.upload.erase_cmd=erase_flash modwifi.menu.baud.115200=115200 modwifi.menu.baud.115200.upload.speed=115200 -modwifi.menu.baud.9600=9600 -modwifi.menu.baud.9600.upload.speed=9600 modwifi.menu.baud.57600=57600 modwifi.menu.baud.57600.upload.speed=57600 modwifi.menu.baud.230400.linux=230400 @@ -3035,8 +3013,6 @@ thing.menu.wipe.all=All Flash Contents thing.menu.wipe.all.upload.erase_cmd=erase_flash thing.menu.baud.115200=115200 thing.menu.baud.115200.upload.speed=115200 -thing.menu.baud.9600=9600 -thing.menu.baud.9600.upload.speed=9600 thing.menu.baud.57600=57600 thing.menu.baud.57600.upload.speed=57600 thing.menu.baud.230400.linux=230400 @@ -3223,8 +3199,6 @@ thingdev.menu.wipe.all=All Flash Contents thingdev.menu.wipe.all.upload.erase_cmd=erase_flash thingdev.menu.baud.115200=115200 thingdev.menu.baud.115200.upload.speed=115200 -thingdev.menu.baud.9600=9600 -thingdev.menu.baud.9600.upload.speed=9600 thingdev.menu.baud.57600=57600 thingdev.menu.baud.57600.upload.speed=57600 thingdev.menu.baud.230400.linux=230400 @@ -3411,8 +3385,6 @@ esp210.menu.wipe.all=All Flash Contents esp210.menu.wipe.all.upload.erase_cmd=erase_flash esp210.menu.baud.57600=57600 esp210.menu.baud.57600.upload.speed=57600 -esp210.menu.baud.9600=9600 -esp210.menu.baud.9600.upload.speed=9600 esp210.menu.baud.115200=115200 esp210.menu.baud.115200.upload.speed=115200 esp210.menu.baud.230400.linux=230400 @@ -3599,8 +3571,6 @@ d1_mini.menu.wipe.all=All Flash Contents d1_mini.menu.wipe.all.upload.erase_cmd=erase_flash d1_mini.menu.baud.921600=921600 d1_mini.menu.baud.921600.upload.speed=921600 -d1_mini.menu.baud.9600=9600 -d1_mini.menu.baud.9600.upload.speed=9600 d1_mini.menu.baud.57600=57600 d1_mini.menu.baud.57600.upload.speed=57600 d1_mini.menu.baud.115200=115200 @@ -3770,8 +3740,6 @@ d1_mini_pro.menu.wipe.all=All Flash Contents d1_mini_pro.menu.wipe.all.upload.erase_cmd=erase_flash d1_mini_pro.menu.baud.921600=921600 d1_mini_pro.menu.baud.921600.upload.speed=921600 -d1_mini_pro.menu.baud.9600=9600 -d1_mini_pro.menu.baud.9600.upload.speed=9600 d1_mini_pro.menu.baud.57600=57600 d1_mini_pro.menu.baud.57600.upload.speed=57600 d1_mini_pro.menu.baud.115200=115200 @@ -3998,8 +3966,6 @@ d1_mini_lite.menu.wipe.all=All Flash Contents d1_mini_lite.menu.wipe.all.upload.erase_cmd=erase_flash d1_mini_lite.menu.baud.921600=921600 d1_mini_lite.menu.baud.921600.upload.speed=921600 -d1_mini_lite.menu.baud.9600=9600 -d1_mini_lite.menu.baud.9600.upload.speed=9600 d1_mini_lite.menu.baud.57600=57600 d1_mini_lite.menu.baud.57600.upload.speed=57600 d1_mini_lite.menu.baud.115200=115200 @@ -4186,8 +4152,6 @@ d1.menu.wipe.all=All Flash Contents d1.menu.wipe.all.upload.erase_cmd=erase_flash d1.menu.baud.921600=921600 d1.menu.baud.921600.upload.speed=921600 -d1.menu.baud.9600=9600 -d1.menu.baud.9600.upload.speed=9600 d1.menu.baud.57600=57600 d1.menu.baud.57600.upload.speed=57600 d1.menu.baud.115200=115200 @@ -4377,8 +4341,6 @@ espino.menu.wipe.all=All Flash Contents espino.menu.wipe.all.upload.erase_cmd=erase_flash espino.menu.baud.115200=115200 espino.menu.baud.115200.upload.speed=115200 -espino.menu.baud.9600=9600 -espino.menu.baud.9600.upload.speed=9600 espino.menu.baud.57600=57600 espino.menu.baud.57600.upload.speed=57600 espino.menu.baud.230400.linux=230400 @@ -4565,8 +4527,6 @@ espinotee.menu.wipe.all=All Flash Contents espinotee.menu.wipe.all.upload.erase_cmd=erase_flash espinotee.menu.baud.115200=115200 espinotee.menu.baud.115200.upload.speed=115200 -espinotee.menu.baud.9600=9600 -espinotee.menu.baud.9600.upload.speed=9600 espinotee.menu.baud.57600=57600 espinotee.menu.baud.57600.upload.speed=57600 espinotee.menu.baud.230400.linux=230400 @@ -4813,8 +4773,6 @@ wifinfo.menu.wipe.all=All Flash Contents wifinfo.menu.wipe.all.upload.erase_cmd=erase_flash wifinfo.menu.baud.115200=115200 wifinfo.menu.baud.115200.upload.speed=115200 -wifinfo.menu.baud.9600=9600 -wifinfo.menu.baud.9600.upload.speed=9600 wifinfo.menu.baud.57600=57600 wifinfo.menu.baud.57600.upload.speed=57600 wifinfo.menu.baud.230400.linux=230400 @@ -5013,8 +4971,6 @@ arduino-esp8266.menu.wipe.all=All Flash Contents arduino-esp8266.menu.wipe.all.upload.erase_cmd=erase_flash arduino-esp8266.menu.baud.115200=115200 arduino-esp8266.menu.baud.115200.upload.speed=115200 -arduino-esp8266.menu.baud.9600=9600 -arduino-esp8266.menu.baud.9600.upload.speed=9600 arduino-esp8266.menu.baud.57600=57600 arduino-esp8266.menu.baud.57600.upload.speed=57600 arduino-esp8266.menu.baud.230400.linux=230400 @@ -5202,8 +5158,6 @@ gen4iod.menu.wipe.all=All Flash Contents gen4iod.menu.wipe.all.upload.erase_cmd=erase_flash gen4iod.menu.baud.115200=115200 gen4iod.menu.baud.115200.upload.speed=115200 -gen4iod.menu.baud.9600=9600 -gen4iod.menu.baud.9600.upload.speed=9600 gen4iod.menu.baud.57600=57600 gen4iod.menu.baud.57600.upload.speed=57600 gen4iod.menu.baud.230400.linux=230400 @@ -5391,8 +5345,6 @@ oak.menu.wipe.all=All Flash Contents oak.menu.wipe.all.upload.erase_cmd=erase_flash oak.menu.baud.921600=921600 oak.menu.baud.921600.upload.speed=921600 -oak.menu.baud.9600=9600 -oak.menu.baud.9600.upload.speed=9600 oak.menu.baud.57600=57600 oak.menu.baud.57600.upload.speed=57600 oak.menu.baud.115200=115200 @@ -5579,8 +5531,6 @@ wifiduino.menu.wipe.all=All Flash Contents wifiduino.menu.wipe.all.upload.erase_cmd=erase_flash wifiduino.menu.baud.921600=921600 wifiduino.menu.baud.921600.upload.speed=921600 -wifiduino.menu.baud.9600=9600 -wifiduino.menu.baud.9600.upload.speed=9600 wifiduino.menu.baud.57600=57600 wifiduino.menu.baud.57600.upload.speed=57600 wifiduino.menu.baud.115200=115200 @@ -5877,8 +5827,6 @@ wifi_slot.menu.wipe.all=All Flash Contents wifi_slot.menu.wipe.all.upload.erase_cmd=erase_flash wifi_slot.menu.baud.115200=115200 wifi_slot.menu.baud.115200.upload.speed=115200 -wifi_slot.menu.baud.9600=9600 -wifi_slot.menu.baud.9600.upload.speed=9600 wifi_slot.menu.baud.57600=57600 wifi_slot.menu.baud.57600.upload.speed=57600 wifi_slot.menu.baud.230400.linux=230400 @@ -6065,8 +6013,6 @@ wiolink.menu.wipe.all=All Flash Contents wiolink.menu.wipe.all.upload.erase_cmd=erase_flash wiolink.menu.baud.115200=115200 wiolink.menu.baud.115200.upload.speed=115200 -wiolink.menu.baud.9600=9600 -wiolink.menu.baud.9600.upload.speed=9600 wiolink.menu.baud.57600=57600 wiolink.menu.baud.57600.upload.speed=57600 wiolink.menu.baud.230400.linux=230400 @@ -6253,8 +6199,6 @@ espectro.menu.wipe.all=All Flash Contents espectro.menu.wipe.all.upload.erase_cmd=erase_flash espectro.menu.baud.115200=115200 espectro.menu.baud.115200.upload.speed=115200 -espectro.menu.baud.9600=9600 -espectro.menu.baud.9600.upload.speed=9600 espectro.menu.baud.57600=57600 espectro.menu.baud.57600.upload.speed=57600 espectro.menu.baud.230400.linux=230400 diff --git a/cores/esp8266/AddrList.h b/cores/esp8266/AddrList.h index 36ccd49b3..23a105f25 100644 --- a/cores/esp8266/AddrList.h +++ b/cores/esp8266/AddrList.h @@ -167,8 +167,6 @@ public: bool operator== (AddressListIterator& o) { return netIf.equal(*o); } bool operator!= (AddressListIterator& o) { return !netIf.equal(*o); } - AddressListIterator& operator= (const AddressListIterator& o) { netIf = o.netIf; return *this; } - AddressListIterator operator++ (int) { AddressListIterator ret = *this; diff --git a/cores/esp8266/Arduino.h b/cores/esp8266/Arduino.h index 5ab2b8476..d962923de 100644 --- a/cores/esp8266/Arduino.h +++ b/cores/esp8266/Arduino.h @@ -159,7 +159,7 @@ void ets_intr_unlock(); // level 15 will disable ALL interrupts, // level 0 will enable ALL interrupts, // -#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state)); state;})) +#define xt_rsil(level) (__extension__({uint32_t state; __asm__ __volatile__("rsil %0," __STRINGIFY(level) : "=a" (state) :: "memory"); state;})) #define xt_wsr_ps(state) __asm__ __volatile__("wsr %0,ps; isync" :: "a" (state) : "memory") #define interrupts() xt_rsil(0) diff --git a/cores/esp8266/FS.cpp b/cores/esp8266/FS.cpp index 7006a8afa..d7baa4306 100644 --- a/cores/esp8266/FS.cpp +++ b/cores/esp8266/FS.cpp @@ -272,6 +272,13 @@ bool FS::gc() { return _impl->gc(); } +bool FS::check() { + if (!_impl) { + return false; + } + return _impl->check(); +} + bool FS::format() { if (!_impl) { return false; diff --git a/cores/esp8266/FS.h b/cores/esp8266/FS.h index 2d33f4808..669287876 100644 --- a/cores/esp8266/FS.h +++ b/cores/esp8266/FS.h @@ -221,7 +221,9 @@ public: bool rmdir(const char* path); bool rmdir(const String& path); + // Low-level FS routines, not needed by most applications bool gc(); + bool check(); friend class ::SDClass; // More of a frenemy, but SD needs internal implementation to get private FAT bits protected: @@ -241,6 +243,7 @@ using fs::SeekCur; using fs::SeekEnd; using fs::FSInfo; using fs::FSConfig; +using fs::SPIFFSConfig; #endif //FS_NO_GLOBALS #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SPIFFS) diff --git a/cores/esp8266/FSImpl.h b/cores/esp8266/FSImpl.h index 6caea9ca2..b7cf4a7a6 100644 --- a/cores/esp8266/FSImpl.h +++ b/cores/esp8266/FSImpl.h @@ -85,6 +85,7 @@ public: virtual bool mkdir(const char* path) = 0; virtual bool rmdir(const char* path) = 0; virtual bool gc() { return true; } // May not be implemented in all file systems. + virtual bool check() { return true; } // May not be implemented in all file systems. }; } // namespace fs diff --git a/cores/esp8266/IPAddress.h b/cores/esp8266/IPAddress.h index f4ed5a063..bf5ef1010 100644 --- a/cores/esp8266/IPAddress.h +++ b/cores/esp8266/IPAddress.h @@ -36,7 +36,7 @@ #define IP_SET_TYPE_VAL(x,y) do { (void)0; } while (0) #define IP_ANY_TYPE (&ip_addr_any) #define IP4_ADDR_ANY IPADDR_ANY -#define IP4_ADDR_ANY4 IPADDR_ANY +#define IP4_ADDR_ANY4 IP_ADDR_ANY #define IPADDR4_INIT(x) { x } #define CONST /* nothing: lwIP-v1 does not use const */ #define ip4_addr_netcmp ip_addr_netcmp @@ -136,6 +136,7 @@ class IPAddress: public Printable { // Overloaded copy operators to allow initialisation of IPAddress objects from other types IPAddress& operator=(const uint8_t *address); IPAddress& operator=(uint32_t address); + IPAddress& operator=(const IPAddress&) = default; virtual size_t printTo(Print& p) const; String toString() const; diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index 44d43f572..2992d3c95 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -205,7 +205,6 @@ bool UpdaterClass::end(bool evenIfRemaining){ #endif if (sigLen != _verify->length()) { _setError(UPDATE_ERROR_SIGN); - _reset(); return false; } @@ -231,7 +230,6 @@ bool UpdaterClass::end(bool evenIfRemaining){ uint8_t *sig = (uint8_t*)malloc(sigLen); if (!sig) { _setError(UPDATE_ERROR_SIGN); - _reset(); return false; } ESP.flashRead(_startAddress + binSize, (uint32_t *)sig, sigLen); @@ -244,7 +242,6 @@ bool UpdaterClass::end(bool evenIfRemaining){ #endif if (!_verify->verify(_hash, (void *)sig, sigLen)) { _setError(UPDATE_ERROR_SIGN); - _reset(); return false; } #ifdef DEBUG_UPDATER @@ -254,7 +251,6 @@ bool UpdaterClass::end(bool evenIfRemaining){ _md5.calculate(); if (strcasecmp(_target_md5.c_str(), _md5.toString().c_str())) { _setError(UPDATE_ERROR_MD5); - _reset(); return false; } #ifdef DEBUG_UPDATER @@ -467,7 +463,6 @@ size_t UpdaterClass::writeStream(Stream &data) { if(toRead == 0) { //Timeout _currentAddress = (_startAddress + _size); _setError(UPDATE_ERROR_STREAM); - _reset(); return written; } } @@ -494,6 +489,7 @@ void UpdaterClass::_setError(int error){ #ifdef DEBUG_UPDATER printError(DEBUG_UPDATER); #endif + _reset(); // Any error condition invalidates the entire update, so clear partial status } void UpdaterClass::printError(Print &out){ diff --git a/cores/esp8266/WString.h b/cores/esp8266/WString.h index 48b96f08f..558d1da85 100644 --- a/cores/esp8266/WString.h +++ b/cores/esp8266/WString.h @@ -82,6 +82,12 @@ class String { return 0; } } + inline void clear(void) { + setLen(0); + } + inline bool isEmpty(void) const { + return length() == 0; + } // creates a copy of the assigned value. if the value is null or // invalid, or if the memory allocation fails, the string will be diff --git a/cores/esp8266/abi.cpp b/cores/esp8266/abi.cpp index 71967e63e..6a2c0928c 100644 --- a/cores/esp8266/abi.cpp +++ b/cores/esp8266/abi.cpp @@ -31,6 +31,29 @@ extern int umm_last_fail_alloc_size; extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); + +#ifndef __cpp_exceptions +void *operator new(size_t size) +{ + void *ret = malloc(size); + if (0 != size && 0 == ret) { + umm_last_fail_alloc_addr = __builtin_return_address(0); + umm_last_fail_alloc_size = size; + } + return ret; +} + +void *operator new[](size_t size) +{ + void *ret = malloc(size); + if (0 != size && 0 == ret) { + umm_last_fail_alloc_addr = __builtin_return_address(0); + umm_last_fail_alloc_size = size; + } + return ret; +} +#endif + void __cxa_pure_virtual(void) { panic(); diff --git a/cores/esp8266/core_esp8266_i2s.cpp b/cores/esp8266/core_esp8266_i2s.cpp index 005d1f465..901ffe120 100644 --- a/cores/esp8266/core_esp8266_i2s.cpp +++ b/cores/esp8266/core_esp8266_i2s.cpp @@ -507,7 +507,6 @@ bool i2s_rxtx_begin(bool enableRx, bool enableTx) { PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, FUNC_I2SI_WS); } - _i2s_sample_rate = 0; if (!i2s_slc_begin()) { // OOM in SLC memory allocations, tear it all down and abort! i2s_end(); @@ -530,7 +529,13 @@ bool i2s_rxtx_begin(bool enableRx, bool enableTx) { // I2STXCMM, I2SRXCMM=0 => Dual channel mode I2SCC &= ~((I2STXCMM << I2STXCM) | (I2SRXCMM << I2SRXCM)); // Set RX/TX CHAN_MOD=0 - i2s_set_rate(44100); + // Ensure a sane clock is set, but don't change any pre-existing ones. + // But we also need to make sure the other bits weren't reset by a previous + // reset. So, store the present one, clear the flag, then set the same + // value (writing all needed config bits in the process + uint32_t save_rate = _i2s_sample_rate; + _i2s_sample_rate = 0; + i2s_set_rate(save_rate ? save_rate : 44100); if (rx) { // Need to prime the # of samples to receive in the engine diff --git a/cores/esp8266/core_esp8266_main.cpp b/cores/esp8266/core_esp8266_main.cpp index 0d708ff7e..588019f0d 100644 --- a/cores/esp8266/core_esp8266_main.cpp +++ b/cores/esp8266/core_esp8266_main.cpp @@ -121,6 +121,14 @@ extern "C" void optimistic_yield(uint32_t interval_us) { } } +extern "C" void __loop_end (void) +{ + run_scheduled_functions(); + run_scheduled_recurrent_functions(); +} + +extern "C" void loop_end (void) __attribute__ ((weak, alias("__loop_end"))); + static void loop_wrapper() { static bool setup_done = false; preloop_update_frequency(); @@ -129,8 +137,7 @@ static void loop_wrapper() { setup_done = true; } loop(); - run_scheduled_functions(); - run_scheduled_recurrent_functions(); + loop_end(); esp_schedule(); } diff --git a/cores/esp8266/core_esp8266_postmortem.cpp b/cores/esp8266/core_esp8266_postmortem.cpp index f18dcfe53..bbe67f1d4 100644 --- a/cores/esp8266/core_esp8266_postmortem.cpp +++ b/cores/esp8266/core_esp8266_postmortem.cpp @@ -52,6 +52,13 @@ static void uart0_write_char_d(char c); static void uart1_write_char_d(char c); static void print_stack(uint32_t start, uint32_t end); +// using numbers different from "REASON_" in user_interface.h (=0..6) +enum rst_reason_sw +{ + REASON_USER_SWEXCEPTION_RST = 254 +}; +static int s_user_reset_reason = REASON_DEFAULT_RST; + // From UMM, the last caller of a malloc/realloc/calloc which failed: extern void *umm_last_fail_alloc_addr; extern int umm_last_fail_alloc_size; @@ -86,24 +93,20 @@ void __wrap_system_restart_local() { register uint32_t sp asm("a1"); uint32_t sp_dump = sp; - if (gdb_present()) { - /* When GDBStub is present, exceptions are handled by GDBStub, - but Soft WDT will still call this function. - Trigger an exception to break into GDB. - TODO: check why gdb_do_break() or asm("break.n 0") do not - break into GDB here. */ - raise_exception(); - } - struct rst_info rst_info; memset(&rst_info, 0, sizeof(rst_info)); - system_rtc_mem_read(0, &rst_info, sizeof(rst_info)); - if (rst_info.reason != REASON_SOFT_WDT_RST && - rst_info.reason != REASON_EXCEPTION_RST && - rst_info.reason != REASON_WDT_RST) + if (s_user_reset_reason == REASON_DEFAULT_RST) { - return; + system_rtc_mem_read(0, &rst_info, sizeof(rst_info)); + if (rst_info.reason != REASON_SOFT_WDT_RST && + rst_info.reason != REASON_EXCEPTION_RST && + rst_info.reason != REASON_WDT_RST) + { + rst_info.reason = REASON_DEFAULT_RST; + } } + else + rst_info.reason = s_user_reset_reason; // TODO: ets_install_putc1 definition is wrong in ets_sys.h, need cast ets_install_putc1((void *)&uart_write_char_d); @@ -128,6 +131,9 @@ void __wrap_system_restart_local() { else if (rst_info.reason == REASON_SOFT_WDT_RST) { ets_printf_P(PSTR("\nSoft WDT reset\n")); } + else { + ets_printf_P(PSTR("\nGeneric Reset\n")); + } uint32_t cont_stack_start = (uint32_t) &(g_pcont->stack); uint32_t cont_stack_end = (uint32_t) g_pcont->stack_end; @@ -222,7 +228,13 @@ static void uart1_write_char_d(char c) { } static void raise_exception() { - __asm__ __volatile__ ("syscall"); + if (gdb_present()) + __asm__ __volatile__ ("syscall"); // triggers GDB when enabled + + s_user_reset_reason = REASON_USER_SWEXCEPTION_RST; + ets_printf_P(PSTR("\nUser exception (panic/abort/assert)")); + __wrap_system_restart_local(); + while (1); // never reached, needed to satisfy "noreturn" attribute } diff --git a/cores/esp8266/core_esp8266_wiring.cpp b/cores/esp8266/core_esp8266_wiring.cpp index 247a02bbd..64b80aed1 100644 --- a/cores/esp8266/core_esp8266_wiring.cpp +++ b/cores/esp8266/core_esp8266_wiring.cpp @@ -43,7 +43,7 @@ void delay_end(void* arg) { esp_schedule(); } -void delay(unsigned long ms) { +void __delay(unsigned long ms) { if(ms) { os_timer_setfn(&delay_timer, (os_timer_func_t*) &delay_end, 0); os_timer_arm(&delay_timer, ms, ONCE); @@ -56,6 +56,8 @@ void delay(unsigned long ms) { } } +void delay(unsigned long ms) __attribute__ ((weak, alias("__delay"))); + void micros_overflow_tick(void* arg) { (void) arg; uint32_t m = system_get_time(); diff --git a/cores/esp8266/core_esp8266_wiring_digital.cpp b/cores/esp8266/core_esp8266_wiring_digital.cpp index a1a0d51ff..5ed0a40ab 100644 --- a/cores/esp8266/core_esp8266_wiring_digital.cpp +++ b/cores/esp8266/core_esp8266_wiring_digital.cpp @@ -252,7 +252,7 @@ extern void initPins() { extern void pinMode(uint8_t pin, uint8_t mode) __attribute__ ((weak, alias("__pinMode"))); extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__ ((weak, alias("__digitalWrite"))); -extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead"))); +extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead"), nothrow)); extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt"))); extern void attachInterruptArg(uint8_t pin, voidFuncPtrArg handler, void* arg, int mode) __attribute__((weak, alias("__attachInterruptArg"))); extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt"))); diff --git a/cores/esp8266/spiffs_api.h b/cores/esp8266/spiffs_api.h index 0491508f4..c297d7d23 100644 --- a/cores/esp8266/spiffs_api.h +++ b/cores/esp8266/spiffs_api.h @@ -219,6 +219,11 @@ public: return SPIFFS_gc_quick( &_fs, 0 ) == SPIFFS_OK; } + bool check() override + { + return SPIFFS_check(&_fs) == SPIFFS_OK; + } + protected: friend class SPIFFSFileImpl; friend class SPIFFSDirImpl; diff --git a/cores/esp8266/umm_malloc/umm_malloc_cfg.h b/cores/esp8266/umm_malloc/umm_malloc_cfg.h index e7c573c87..14fb4a8e4 100644 --- a/cores/esp8266/umm_malloc/umm_malloc_cfg.h +++ b/cores/esp8266/umm_malloc/umm_malloc_cfg.h @@ -91,7 +91,7 @@ void* realloc_loc (void* p, size_t s, const char* file, int line); #define UMM_BEST_FIT /* Start addresses and the size of the heap */ -extern char _heap_start; +extern char _heap_start[]; #define UMM_MALLOC_CFG__HEAP_ADDR ((uint32_t)&_heap_start) #define UMM_MALLOC_CFG__HEAP_SIZE ((size_t)(0x3fffc000 - UMM_MALLOC_CFG__HEAP_ADDR)) diff --git a/doc/PROGMEM.rst b/doc/PROGMEM.rst index 43f1ad95d..eb4402806 100644 --- a/doc/PROGMEM.rst +++ b/doc/PROGMEM.rst @@ -116,7 +116,7 @@ the ``F()`` macro and possibly the FPSTR() macro. These are defined in `WString. #define FPSTR(pstr_pointer) (reinterpret_cast(pstr_pointer)) #define F(string_literal) (FPSTR(PSTR(string_literal))) -So ``FSPTR()`` takes a PROGMEM pointer to a string and casts it to this +So ``FPSTR()`` takes a PROGMEM pointer to a string and casts it to this ``__FlashStringHelper`` class. Thus if you have defined a string as above ``xyz`` you can use ``FPSTR()`` to convert it to ``__FlashStringHelper`` for passing into functions that take it. diff --git a/doc/esp8266wifi/bearssl-client-secure-class.rst b/doc/esp8266wifi/bearssl-client-secure-class.rst index 4eee8ef54..dc6886342 100644 --- a/doc/esp8266wifi/bearssl-client-secure-class.rst +++ b/doc/esp8266wifi/bearssl-client-secure-class.rst @@ -109,7 +109,7 @@ See the `BearSSL_CertStore` example for full details as the `BearSSL::CertStore` Supported Crypto ~~~~~~~~~~~~~~~~ -Please see the `BearSSL website `__ for detailed cryptographic information. In general, TLS 1.2, TLS 1.1, and TLS 1.0 are supported with RSA and Elliptic Curve keys and a very rich set of hashing and symmetric encryption codes. Please note that Elliptic Curve (EC) key operations take a significant amount of time. +Please see the `BearSSL website `__ for detailed cryptographic information. In general, TLS 1.2, TLS 1.1, and TLS 1.0 are supported with RSA and Elliptic Curve keys and a very rich set of hashing and symmetric encryption codes. Please note that Elliptic Curve (EC) key operations take a significant amount of time. BearSSL::WiFiClientSecure Class @@ -139,6 +139,8 @@ setFingerprint(const uint8_t fp[20]) / setFingerprint(const char \*fpStr) Verify the SHA1 fingerprint of the certificate returned matches this one. If the server certificate changes, it will fail. If an array of 20 bytes are sent in, it is assumed they are the binary SHA1 values. If a `char*` string is passed in, it is parsed as a series of human-readable hex values separated by spaces or colons (e.g. `setFingerprint("00:01:02:03:...:1f");`) +This fingerprint is calcuated on the raw X509 certificate served by the server. In very rare cases, these certificates have certain encodings which should be normalized before taking a fingerprint (but in order to preserve memory BearSSL does not do this normalization since it would need RAM for an entire copy of the cert), and the fingerprint BearSSL calculates will not match the fingerprint OpenSSL calculates. In this case, you can enable SSL debugging and get a dump of BearSSL's calculated fingerprint and use that one in your code, or use full certificate validation. See the `original issue and debug here `__. + setTrustAnchors(BearSSL::X509List \*ta) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc/esp8266wifi/server-class.rst b/doc/esp8266wifi/server-class.rst index 8855083ab..560322837 100644 --- a/doc/esp8266wifi/server-class.rst +++ b/doc/esp8266wifi/server-class.rst @@ -14,6 +14,13 @@ Methods documented for the `Server Class `__ documentation. Before they are fully documented please refer to information below. +write (write to all clients) not supported +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Please note that the ``write`` method on the ``WiFiServer`` object is not implemented and returns failure always. Use the returned +``WiFiClient`` object from the ``WiFiServer::available()`` method to communicate with individual clients. If you need to send +the exact same packets to a series of clients, your application must maintain a list of connected clients and iterate over them manually. + setNoDelay ~~~~~~~~~~ diff --git a/doc/filesystem.rst b/doc/filesystem.rst index b7d8b421e..a56ff8fb0 100644 --- a/doc/filesystem.rst +++ b/doc/filesystem.rst @@ -402,6 +402,31 @@ block size - ``pageSize`` — filesystem logical page size - ``maxOpenFiles`` ``maxPathLength`` — max file name length (including one byte for zero termination) +gc +~~ + +.. code:: cpp + + SPIFFS.gc() + +Only implemented in SPIFFS. Performs a quick garbage collection operation on SPIFFS, +possibly making writes perform faster/better in the future. On very full or very fragmented +filesystems, using this call can avoid or reduce issues where SPIFFS reports free space +but is unable to write additional data to a file. See `this discussion +` for more info. + +check +~~~~~ + +.. code:: cpp + + SPIFFS.begin(); + SPIFFS.check(); + +Only implemented in SPIFFS. Performs an in-depth check of the filesystem metadata and +correct what is repairable. Not normally needed, and not guaranteed to actually fix +anything should there be corruption. + Directory object (Dir) ---------------------- diff --git a/libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer-impl.h b/libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer-impl.h index 8131caf60..b543073f4 100644 --- a/libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer-impl.h +++ b/libraries/ESP8266HTTPUpdateServer/src/ESP8266HTTPUpdateServer-impl.h @@ -16,7 +16,7 @@ static const char serverIndex[] PROGMEM = )"; static const char successResponse[] PROGMEM = - "Update Success! Rebooting...\n"; + "Update Success! Rebooting..."; template ESP8266HTTPUpdateServerTemplate::ESP8266HTTPUpdateServerTemplate(bool serial_debug) diff --git a/libraries/ESP8266NetBIOS/ESP8266NetBIOS.cpp b/libraries/ESP8266NetBIOS/ESP8266NetBIOS.cpp index aedcfcdc7..557c1117c 100644 --- a/libraries/ESP8266NetBIOS/ESP8266NetBIOS.cpp +++ b/libraries/ESP8266NetBIOS/ESP8266NetBIOS.cpp @@ -156,7 +156,7 @@ bool ESP8266NetBIOS::begin(const char *name) } _pcb = udp_new(); udp_recv(_pcb, &_s_recv, (void *) this); - err_t err = udp_bind(_pcb, INADDR_ANY, NBNS_PORT); + err_t err = udp_bind(_pcb, (ip_addr_t*)INADDR_ANY, NBNS_PORT); if(err != ERR_OK) { end(); return false; diff --git a/libraries/ESP8266SdFat b/libraries/ESP8266SdFat index 6326c71ff..af4ed0c5e 160000 --- a/libraries/ESP8266SdFat +++ b/libraries/ESP8266SdFat @@ -1 +1 @@ -Subproject commit 6326c71ff1f6294756b6e348edaf723bfe7be3e7 +Subproject commit af4ed0c5ec3084cb3883df51ec2052791ca2bff2 diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer.h b/libraries/ESP8266WebServer/src/ESP8266WebServer.h index 30a71cdfd..6eec446d9 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer.h @@ -135,6 +135,8 @@ public: void sendContent(const String& content); void sendContent_P(PGM_P content); void sendContent_P(PGM_P content, size_t size); + void sendContent(const char *content) { sendContent_P(content); } + void sendContent(const char *content, size_t size) { sendContent_P(content, size); } static String credentialHash(const String& username, const String& realm, const String& password); @@ -216,6 +218,7 @@ protected: using ESP8266WebServer = esp8266webserver::ESP8266WebServerTemplate; +using RequestHandler = esp8266webserver::RequestHandler; #endif //ESP8266WEBSERVER_H diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp index b47d7c21e..62b7f0ab8 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureAxTLS.cpp @@ -473,7 +473,7 @@ extern "C" int __ax_port_read(int fd, uint8_t* buffer, size_t count) } return cb; } -extern "C" void ax_port_read() __attribute__ ((weak, alias("__ax_port_read"))); +extern "C" int ax_port_read(int fd, uint8_t* buffer, size_t count) __attribute__ ((weak, alias("__ax_port_read"))); extern "C" int __ax_port_write(int fd, uint8_t* buffer, size_t count) { @@ -489,7 +489,7 @@ extern "C" int __ax_port_write(int fd, uint8_t* buffer, size_t count) } return cb; } -extern "C" void ax_port_write() __attribute__ ((weak, alias("__ax_port_write"))); +extern "C" int ax_port_write(int fd, uint8_t* buffer, size_t count) __attribute__ ((weak, alias("__ax_port_write"))); extern "C" int __ax_get_file(const char *filename, uint8_t **buf) { @@ -497,7 +497,7 @@ extern "C" int __ax_get_file(const char *filename, uint8_t **buf) *buf = 0; return 0; } -extern "C" void ax_get_file() __attribute__ ((weak, alias("__ax_get_file"))); +extern "C" int ax_get_file(const char *filename, uint8_t **buf) __attribute__ ((weak, alias("__ax_get_file"))); extern "C" void __ax_wdt_feed() { diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp index bc68ed3da..5691f1cf5 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp @@ -654,6 +654,13 @@ extern "C" { if (!xc->done_cert) { br_sha1_update(&xc->sha1_cert, buf, len); br_x509_decoder_push(&xc->ctx, (const void*)buf, len); +#ifdef DEBUG_ESP_SSL + DEBUG_BSSL("CERT: "); + for (size_t i=0; isha1_cert, res); if (xc->match_fingerprint && memcmp(res, xc->match_fingerprint, sizeof(res))) { +#ifdef DEBUG_ESP_SSL DEBUG_BSSL("insecure_end_chain: Received cert FP doesn't match\n"); + char buff[3 * sizeof(res) + 1]; // 3 chars per byte XX_, and null + buff[0] = 0; + for (size_t i=0; imatch_fingerprint[i] & 0xff); + strlcat(buff, hex, sizeof(buff)); + } + DEBUG_BSSL("insecure_end_chain: expected %s\n", buff); + buff[0] =0; + for (size_t i=0; i callback_function_t; void attach_scheduled(float seconds, callback_function_t callback) @@ -64,14 +64,14 @@ public: // C-cast serves two purposes: // static_cast for smaller integer types, // reinterpret_cast + const_cast for pointer types - _attach_s(seconds, true, reinterpret_cast(callback), (void*)arg); + _attach_s(seconds, true, reinterpret_cast(callback), reinterpret_cast(arg)); } template void attach_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) { static_assert(sizeof(TArg) <= sizeof(void*), "attach() callback argument size must be <= sizeof(void*)"); - _attach_ms(milliseconds, true, reinterpret_cast(callback), (void*)arg); + _attach_ms(milliseconds, true, reinterpret_cast(callback), reinterpret_cast(arg)); } void once_scheduled(float seconds, callback_function_t callback) @@ -100,14 +100,14 @@ public: void once(float seconds, void (*callback)(TArg), TArg arg) { static_assert(sizeof(TArg) <= sizeof(void*), "attach() callback argument size must be <= sizeof(void*)"); - _attach_s(seconds, false, reinterpret_cast(callback), (void*)arg); + _attach_s(seconds, false, reinterpret_cast(callback), reinterpret_cast(arg)); } template void once_ms(uint32_t milliseconds, void (*callback)(TArg), TArg arg) { static_assert(sizeof(TArg) <= sizeof(void*), "attach() callback argument size must be <= sizeof(void*)"); - _attach_ms(milliseconds, false, reinterpret_cast(callback), (void*)arg); + _attach_ms(milliseconds, false, reinterpret_cast(callback), reinterpret_cast(arg)); } void detach(); @@ -122,7 +122,6 @@ protected: private: void _attach_s(float seconds, bool repeat, callback_with_arg_t callback, void* arg); - //char _etsTimerMem[sizeof(ETSTimer)]; ETSTimer _etsTimer; }; diff --git a/libraries/Ticker/examples/TickerParameter/TickerParameter.ino b/libraries/Ticker/examples/TickerParameter/TickerParameter.ino index 67c6256b5..80734a1a6 100644 --- a/libraries/Ticker/examples/TickerParameter/TickerParameter.ino +++ b/libraries/Ticker/examples/TickerParameter/TickerParameter.ino @@ -14,12 +14,17 @@ #include Ticker tickerSetHigh; +Ticker tickerSetAnalog; Ticker tickerSetLow; void setPin(int state) { digitalWrite(LED_BUILTIN, state); } +void setPinChar(char state) { + digitalWrite(LED_BUILTIN, state); +} + void setup() { pinMode(LED_BUILTIN, OUTPUT); digitalWrite(1, LOW); @@ -27,8 +32,9 @@ void setup() { // every 25 ms, call setPin(0) tickerSetLow.attach_ms(25, setPin, 0); - // every 26 ms, call setPin(1) - tickerSetHigh.attach_ms(26, setPin, 1); + // every 26 ms, call setPinChar(1) + tickerSetHigh.attach_ms(26, setPinChar, (char)1); + } void loop() { diff --git a/package/build_boards_manager_package.sh b/package/build_boards_manager_package.sh index ee1351947..e18ededfc 100755 --- a/package/build_boards_manager_package.sh +++ b/package/build_boards_manager_package.sh @@ -82,7 +82,7 @@ $SED 's/^tools.esptool.network_cmd=.*//g' | \ $SED 's/^#tools.esptool.cmd=/tools.esptool.cmd=/g' | \ $SED 's/^#tools.esptool.network_cmd=/tools.esptool.network_cmd=/g' | \ $SED 's/tools.mkspiffs.path={runtime.platform.path}\/tools\/mkspiffs/tools.mkspiffs.path=\{runtime.tools.mkspiffs.path\}/g' |\ -$SED 's/recipe.hooks.core.prebuild.2.pattern.*//g' |\ +$SED 's/recipe.hooks.core.prebuild.pattern.*//g' |\ $SED "s/version=.*/version=$ver/g" |\ $SED -E "s/name=([a-zA-Z0-9\ -]+).*/name=\1($ver)/g"\ > $outdir/platform.txt @@ -156,7 +156,7 @@ new_json=package_esp8266com_index.json set +e # Merge the old and new, then drop any obsolete package versions -python ../../merge_packages.py $new_json $old_json | python ../../drop_versions.py - platforms 1.6.5-947-g39819f0 2.5.0-beta1 2.5.0-beta2 2.5.0-beta3 2.4.0-rc1 2.4.0-rc2 >tmp && mv tmp $new_json && rm $old_json +python ../../merge_packages.py $new_json $old_json | python ../../drop_versions.py - tools 1.20.0-26-gb404fb9 >tmp && mv tmp $new_json && rm $old_json # Verify the JSON file can be read, fail if it's not OK set -e diff --git a/package/drop_versions.py b/package/drop_versions.py index a3fe47295..a3aa9b288 100755 --- a/package/drop_versions.py +++ b/package/drop_versions.py @@ -4,12 +4,13 @@ from __future__ import print_function import json import sys +from collections import OrderedDict def load_package(filename): if filename == "-": - pkg = json.load(sys.stdin)['packages'][0] + pkg = json.load(sys.stdin, object_pairs_hook=OrderedDict)['packages'][0] else: - pkg = json.load(open(filename))['packages'][0] + pkg = json.load(open(filename), object_pairs_hook=OrderedDict)['packages'][0] print("Loaded package {0} from {1}".format(pkg['name'], filename), file=sys.stderr) print("{0} platform(s), {1} tools".format(len(pkg['platforms']), len(pkg['tools'])), file=sys.stderr) return pkg diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index e1d6edb88..74204a123 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -111,17 +111,17 @@ "toolsDependencies": [ { "packager": "esp8266", - "version": "2.5.0-3-20ed2b9", + "version": "2.5.0-4-b40a506", "name": "xtensa-lx106-elf-gcc" }, { "packager": "esp8266", - "version": "2.5.0-3-20ed2b9", + "version": "2.5.0-4-b40a506", "name": "mkspiffs" }, { "packager": "esp8266", - "version": "2.5.1-2", + "version": "2.5.0-4-b40a506", "name": "mklittlefs" }, { @@ -192,159 +192,166 @@ ] }, { - "version": "2.5.0-3-20ed2b9", + "version": "2.5.0-4-b40a506", "name": "xtensa-lx106-elf-gcc", "systems": [ { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/aarch64-linux-gnu.xtensa-lx106-elf-20ed2b9c.tar.gz", - "archiveFileName": "aarch64-linux-gnu.xtensa-lx106-elf-20ed2b9c.tar.gz", - "checksum": "SHA-256:2192512ff6e33d4126722b2bfea02c1d8293b0a90094f84a9ac494d5fcaa0f45", - "size": "40974297" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/aarch64-linux-gnu.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "archiveFileName": "aarch64-linux-gnu.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "checksum": "SHA-256:88c5e9a813bd01c97fe2a07a7280e0685cf18a937ad3ea756d33f8bfbbcbfec3", + "size": "40983153" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/arm-linux-gnueabihf.xtensa-lx106-elf-20ed2b9c.tar.gz", - "archiveFileName": "arm-linux-gnueabihf.xtensa-lx106-elf-20ed2b9c.tar.gz", - "checksum": "SHA-256:861c4ab7f6f04344f7ee656d90288e6904d7efac83ffe4835b66df3eba35b0a0", - "size": "37013753" - }, - { - "host": "i686-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/i686-w64-mingw32.xtensa-lx106-elf-20ed2b9c.zip", - "archiveFileName": "i686-w64-mingw32.xtensa-lx106-elf-20ed2b9c.zip", - "checksum": "SHA-256:38b9ccc3b286546b026fb8a29fb2bd8fdab32c4711816a1a3cb0f11250b5c541", - "size": "44935132" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/arm-linux-gnueabihf.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "checksum": "SHA-256:244d958e2532e5e1195aa6c8bb38e6fcf1601d88b67631a371d93c818a5a5b65", + "size": "37027468" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/i686-linux-gnu.xtensa-lx106-elf-1f24aeae.tar.gz", - "archiveFileName": "i686-linux-gnu.xtensa-lx106-elf-1f24aeae.tar.gz", - "checksum": "SHA-256:96b106fbc814155e92d1805d3227d36096b88d3d54cfcd885804a0e9cf5631d7", - "size": "42500158" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/i686-linux-gnu.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "archiveFileName": "i686-linux-gnu.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "checksum": "SHA-256:7c84fa929231d2467060b82ba51599cfb227dea1ac58964c74d46800ac33ba47", + "size": "42926131" + }, + { + "host": "i686-mingw32", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/i686-w64-mingw32.xtensa-lx106-elf-b40a506.1563313032.zip", + "archiveFileName": "i686-w64-mingw32.xtensa-lx106-elf-b40a506.1563313032.zip", + "checksum": "SHA-256:694680c2215a65364748ca876c701479580c017757cd8ed6c3df0d48c2f7bd79", + "size": "44955630" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-apple-darwin14.xtensa-lx106-elf-20ed2b9c.tar.gz", - "archiveFileName": "x86_64-apple-darwin14.xtensa-lx106-elf-20ed2b9c.tar.gz", - "checksum": "SHA-256:fd29ae844915fb2dd800d99ad7967be0e890601c18b80555efbc4eca2dd808c2", - "size": "44378513" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-apple-darwin14.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "checksum": "SHA-256:ddf7a7ea4d53469918671ea662cf529dae5b255f06054db17621b34c71710641", + "size": "44393288" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-linux-gnu.xtensa-lx106-elf-20ed2b9c.tar.gz", - "archiveFileName": "x86_64-linux-gnu.xtensa-lx106-elf-20ed2b9c.tar.gz", - "checksum": "SHA-256:039f87e2d881b6488a0be8c7fda86cacb1d38502a236cc6768a2dbc2a20ca9cd", - "size": "43778575" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-linux-gnu.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "archiveFileName": "x86_64-linux-gnu.xtensa-lx106-elf-b40a506.1563313032.tar.gz", + "checksum": "SHA-256:90e04da49be288f36097d231e2f46ac46204a7640507011358f8f72c04700080", + "size": "43790957" }, { "host": "x86_64-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-w64-mingw32.xtensa-lx106-elf-20ed2b9c.zip", - "archiveFileName": "x86_64-w64-mingw32.xtensa-lx106-elf-20ed2b9c.zip", - "checksum": "SHA-256:cc8c19a458129e49ec195d9438a53c6ce2c1287a04ea1ea22b81dcc65db511a8", - "size": "48635537" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-w64-mingw32.xtensa-lx106-elf-b40a506.1563313032.zip", + "archiveFileName": "x86_64-w64-mingw32.xtensa-lx106-elf-b40a506.1563313032.zip", + "checksum": "SHA-256:01c31cd521b058e0805b9d1f3728798a42b1a217a7a34debcda3fcba23414b0e", + "size": "48656678" } ] }, { - "version": "2.5.0-3-20ed2b9", + "version": "2.5.0-4-b40a506", "name": "mkspiffs", "systems": [ { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/aarch64-linux-gnu.mkspiffs-7fefeac.tar.gz", - "archiveFileName": "aarch64-linux-gnu.mkspiffs-7fefeac.tar.gz", - "checksum": "SHA-256:5f1e6a1f0eff4522bed90c539f88efe48ecc9c9ee72b0e3cad35f8b09c334168", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/aarch64-linux-gnu.mkspiffs-7fefeac.1563313032.tar.gz", + "archiveFileName": "aarch64-linux-gnu.mkspiffs-7fefeac.1563313032.tar.gz", + "checksum": "SHA-256:49cc1938d5df2bec3eec0b3bf2c84ab887c379b04973a67705c80cf1dec523b3", "size": "51017" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/arm-linux-gnueabihf.mkspiffs-7fefeac.tar.gz", - "archiveFileName": "arm-linux-gnueabihf.mkspiffs-7fefeac.tar.gz", - "checksum": "SHA-256:edc5ea2080f90f33aed84e5a9b6986bf905431e09155cdca96b648eae9656d94", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/arm-linux-gnueabihf.mkspiffs-7fefeac.1563313032.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.mkspiffs-7fefeac.1563313032.tar.gz", + "checksum": "SHA-256:084518fe5452bc2a33c346e3f0825a7c42e36bdb41ee3320f767a248452813be", "size": "44050" }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/i686-linux-gnu.mkspiffs-7fefeac.1563313032.tar.gz", + "archiveFileName": "i686-linux-gnu.mkspiffs-7fefeac.1563313032.tar.gz", + "checksum": "SHA-256:d121a44416db8c9772372978f5accd13fe5a926fd17faf55a8dce23744dfc88c", + "size": "54278" + }, { "host": "i686-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/i686-w64-mingw32.mkspiffs-7fefeac.zip", - "archiveFileName": "i686-w64-mingw32.mkspiffs-7fefeac.zip", - "checksum": "SHA-256:ec661fb02c2635ac722eaaedf0a0c35474c43c72008f0ceefffb19af2f739d15", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/i686-w64-mingw32.mkspiffs-7fefeac.1563313032.zip", + "archiveFileName": "i686-w64-mingw32.mkspiffs-7fefeac.1563313032.zip", + "checksum": "SHA-256:3e0fd9212027cba06e362ae6921f48d252834996d81e1ade41d5b5c54735837a", "size": "337874" }, - { - "host": "i686-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/i686-linux-gnu.mkspiffs-7fefeac.tar.gz", - "archiveFileName": "i686-linux-gnu.mkspiffs-7fefeac.tar.gz", - "checksum": "SHA-256:d080b3b50ee00ac56b7204f8d08b95cd53872a2e09da590775ee631bcb279cad", - "size": "54276" - }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-apple-darwin14.mkspiffs-7fefeac.tar.gz", - "archiveFileName": "x86_64-apple-darwin14.mkspiffs-7fefeac.tar.gz", - "checksum": "SHA-256:927cb67d045c598a9159ae16bc5fb63a20b3e23ad95eeb44702c938e6272f92f", - "size": "368554" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-apple-darwin14.mkspiffs-7fefeac.1563313032.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.mkspiffs-7fefeac.1563313032.tar.gz", + "checksum": "SHA-256:efa480b351be563d35bd6a9bee809cd860f49efd26df711500df02b61460e19c", + "size": "368555" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-linux-gnu.mkspiffs-7fefeac.tar.gz", - "archiveFileName": "x86_64-linux-gnu.mkspiffs-7fefeac.tar.gz", - "checksum": "SHA-256:4547bfe668090944d50af8dbf09abb5b51eb4a892b4784818f06a2274a630878", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-linux-gnu.mkspiffs-7fefeac.1563313032.tar.gz", + "archiveFileName": "x86_64-linux-gnu.mkspiffs-7fefeac.1563313032.tar.gz", + "checksum": "SHA-256:238f9936f5b39f747602becfe90fae0ed6b31e63ea1fa6f5da062fcb33e0aae9", "size": "52429" }, { "host": "x86_64-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-3/x86_64-w64-mingw32.mkspiffs-7fefeac.zip", - "archiveFileName": "x86_64-w64-mingw32.mkspiffs-7fefeac.zip", - "checksum": "SHA-256:0dedc3ee977af99ffd160bb304e8bfb68a8545f2d1f2e4a3b534f2ae1a49d2c9", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-w64-mingw32.mkspiffs-7fefeac.1563313032.zip", + "archiveFileName": "x86_64-w64-mingw32.mkspiffs-7fefeac.1563313032.zip", + "checksum": "SHA-256:1c71a7ce71bd39fb83bfab138388adca8c1f9b798e09efd9932aa99d26c04c9b", "size": "350035" } ] }, { - "version": "2.5.1-2", + "version": "2.5.0-4-b40a506", "name": "mklittlefs", "systems": [ { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/mklittlefs/releases/download/2.5.1-2/aarch64-linux-gnu-mklittlefs-1c43629.tar.gz", - "archiveFileName": "aarch64-linux-gnu-mklittlefs-1c43629.tar.gz", - "checksum": "SHA-256:1d51ab0e5abc9dd243829353a411fccb76e0ce70e3d106d51fb0d3a29dc1b1a7", - "size": "44058" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/aarch64-linux-gnu.mklittlefs-7f77f2b.1563313032.tar.gz", + "archiveFileName": "aarch64-linux-gnu.mklittlefs-7f77f2b.1563313032.tar.gz", + "checksum": "SHA-256:25c4dcf818d175e19c3cc22bc0388c61fa3d9bdf82a1fad388323cef34caa169", + "size": "44059" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/mklittlefs/releases/download/2.5.1-2/arm-linux-gnueabihf-mklittlefs-1c43629.tar.gz", - "archiveFileName": "arm-linux-gnueabihf-mklittlefs-1c43629.tar.gz", - "checksum": "SHA-256:f316d7638ae41c15d82d7f8ca0815dbdfcd5ab323a84ff0d22420e683841150a", - "size": "36566" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/arm-linux-gnueabihf.mklittlefs-7f77f2b.1563313032.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.mklittlefs-7f77f2b.1563313032.tar.gz", + "checksum": "SHA-256:75a284f4e8c54d302b1880df46dd48e18857f69c21baa0977b1e6efc404caf18", + "size": "36567" + }, + { + "host": "i686-pc-linux-gnu", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/i686-linux-gnu.mklittlefs-7f77f2b.1563313032.tar.gz", + "archiveFileName": "i686-linux-gnu.mklittlefs-7f77f2b.1563313032.tar.gz", + "checksum": "SHA-256:022c96df4d110f957d43f6d23e9c5e8b699a66d8ab041056dd5da7411a8ade42", + "size": "47544" }, { "host": "i686-mingw32", - "url": "https://github.com/earlephilhower/mklittlefs/releases/download/2.5.1-2/i686-w64-mingw32-mklittlefs-1c43629.zip", - "archiveFileName": "i686-w64-mingw32-mklittlefs-1c43629.zip", - "checksum": "SHA-256:4a926f3c282aefe7895d353797f43ac988a9542f2ba7bfcd6ef98fbe1455569c", - "size": "332058" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/i686-w64-mingw32.mklittlefs-7f77f2b.1563313032.zip", + "archiveFileName": "i686-w64-mingw32.mklittlefs-7f77f2b.1563313032.zip", + "checksum": "SHA-256:7778209e9df8c8c5f5da82660ff9a95b866defee3c9eb5c22371e0fd84b1addc", + "size": "332057" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/mklittlefs/releases/download/2.5.1-2/x86_64-apple-darwin14-mklittlefs-1c43629.tar.gz", - "archiveFileName": "x86_64-apple-darwin14-mklittlefs-1c43629.tar.gz", - "checksum": "SHA-256:b3e62af202f0c93a3f6ccacaaaa133afc0dd1c65a8ea492690d02345212bf535", - "size": "362016" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-apple-darwin14.mklittlefs-7f77f2b.1563313032.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.mklittlefs-7f77f2b.1563313032.tar.gz", + "checksum": "SHA-256:c465da766026c6c66d731442b741fb5a7f8b741e9473d181e6c5e588c541f588", + "size": "362014" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/mklittlefs/releases/download/2.5.1-2/x86_64-linux-gnu-mklittlefs-1c43629.tar.gz", - "archiveFileName": "x86_64-linux-gnu-mklittlefs-1c43629.tar.gz", - "checksum": "SHA-256:b5222d220e9396807d736d16ef63983f80dc1d8d1e02fa9736f3b4a3e224cc63", - "size": "46162" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-linux-gnu.mklittlefs-7f77f2b.1563313032.tar.gz", + "archiveFileName": "x86_64-linux-gnu.mklittlefs-7f77f2b.1563313032.tar.gz", + "checksum": "SHA-256:6a358716d4c780fa459b4c774723302431b3ad5e1ee3f7edae62be331541615c", + "size": "46164" }, { "host": "x86_64-mingw32", - "url": "https://github.com/earlephilhower/mklittlefs/releases/download/2.5.1-2/x86_64-w64-mingw32-mklittlefs-1c43629.zip", - "archiveFileName": "x86_64-w64-mingw32-mklittlefs-1c43629.zip", - "checksum": "SHA-256:175cdd13a046d6ed06d1ee9eb535100821d8f59adbe16a117d8f80c252e7e62f", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/2.5.0-4/x86_64-w64-mingw32.mklittlefs-7f77f2b.1563313032.zip", + "archiveFileName": "x86_64-w64-mingw32.mklittlefs-7f77f2b.1563313032.zip", + "checksum": "SHA-256:d5d44b5f21681a831318a23b31957bc9368c50f0766964ead409c3d2fe4747d2", "size": "344578" } ] diff --git a/platform.txt b/platform.txt index 6a7616fbc..9ddfe6dab 100644 --- a/platform.txt +++ b/platform.txt @@ -34,6 +34,7 @@ build.sslflags= build.exception_flags=-fno-exceptions build.stdcpp_lib=-lstdc++ +build.stdcpp_level=-std=gnu++11 build.float=-u _printf_float -u _scanf_float build.led= @@ -57,7 +58,7 @@ compiler.c.elf.cmd=xtensa-lx106-elf-gcc compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -laxtls -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc compiler.cpp.cmd=xtensa-lx106-elf-g++ -compiler.cpp.flags=-c {compiler.warning_flags} -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 -std=c++11 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} +compiler.cpp.flags=-c {compiler.warning_flags} -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} compiler.as.cmd=xtensa-lx106-elf-as @@ -83,8 +84,8 @@ compiler.elf2hex.extra_flags= ## generate file with git version number ## needs bash, git, and echo -recipe.hooks.core.prebuild.1.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" -recipe.hooks.core.prebuild.2.pattern="{runtime.tools.python.path}/python" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" +recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python.path}/python" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" +recipe.hooks.core.prebuild.pattern="{runtime.tools.python.path}/python" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" ## Build the app.ld linker file recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" diff --git a/tests/host/Makefile b/tests/host/Makefile index 6bd73ea61..3768c11b5 100644 --- a/tests/host/Makefile +++ b/tests/host/Makefile @@ -147,7 +147,7 @@ DEBUG += -DDEBUG_ESP_PORT=Serial DEBUG += -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_MDNS endif -FLAGS += $(DEBUG) -Wall -coverage $(OPTZ) -fno-common -g $(M32) +FLAGS += $(DEBUG) -Wall $(OPTZ) -fno-common -g $(M32) FLAGS += -DHTTPCLIENT_1_1_COMPATIBLE=0 FLAGS += -DLWIP_IPV6=0 FLAGS += -DHOST_MOCK=1 @@ -178,7 +178,7 @@ COVERAGE_FILES = $(OBJECTS:.o=.gc*) all: help CI: # run CI - $(MAKE) -f $(MAKEFILE) MKFLAGS=-Werror FORCE32=0 OPTZ=-O0 doCI + $(MAKE) -f $(MAKEFILE) MKFLAGS="-Werror -coverage" FORCE32=0 OPTZ=-O0 doCI doCI: build-info $(OUTPUT_BINARY) valgrind test gcov @@ -287,6 +287,7 @@ MOCK_ARDUINO_LIBS := $(addprefix common/,\ MockEsp.cpp \ MockEEPROM.cpp \ MockSPI.cpp \ + strl.cpp \ ) CPP_SOURCES_CORE_EMU = \ diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp index 8d9830826..7fdf4b22f 100644 --- a/tests/host/common/ArduinoMain.cpp +++ b/tests/host/common/ArduinoMain.cpp @@ -152,7 +152,7 @@ static struct option options[] = void cleanup () { mock_stop_spiffs(); -// mock_stop_littlefs(); + mock_stop_littlefs(); mock_stop_uart(); } @@ -182,7 +182,7 @@ int main (int argc, char* const argv []) for (;;) { - int n = getopt_long(argc, argv, "hlcfbvi:S:s:", options, NULL); + int n = getopt_long(argc, argv, "hlcfbvi:S:s:L:", options, NULL); if (n < 0) break; switch (n) @@ -239,7 +239,7 @@ int main (int argc, char* const argv []) name += "-littlefs"; name += String(littlefs_kb > 0? littlefs_kb: -littlefs_kb, DEC); name += "KB"; -// mock_start_littlefs(name, littlefs_kb); + mock_start_littlefs(name, littlefs_kb); } // setup global global_ipv4_netfmt diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h index 3824b62a4..e61616737 100644 --- a/tests/host/common/mock.h +++ b/tests/host/common/mock.h @@ -37,6 +37,7 @@ #ifdef __cplusplus #include #endif +#include #ifdef __cplusplus @@ -49,6 +50,8 @@ char* ltoa (long val, char *s, int radix); } #endif +size_t strlcat(char *dst, const char *src, size_t size); +size_t strlcpy(char *dst, const char *src, size_t size); // exotic typedefs used in the sdk diff --git a/tests/host/common/strl.cpp b/tests/host/common/strl.cpp new file mode 100644 index 000000000..529b9a1ed --- /dev/null +++ b/tests/host/common/strl.cpp @@ -0,0 +1,86 @@ +// https://gist.github.com/Fonger/98cc95ac39fbe1a7e4d9 + +#ifndef HAVE_STRLCAT +/* + '_cups_strlcat()' - Safely concatenate two strings. +*/ + +size_t /* O - Length of string */ +strlcat(char *dst, /* O - Destination string */ + const char *src, /* I - Source string */ + size_t size) /* I - Size of destination string buffer */ +{ + size_t srclen; /* Length of source string */ + size_t dstlen; /* Length of destination string */ + + + /* + Figure out how much room is left... + */ + + dstlen = strlen(dst); + size -= dstlen + 1; + + if (!size) + { + return (dstlen); /* No room, return immediately... */ + } + + /* + Figure out how much room is needed... + */ + + srclen = strlen(src); + + /* + Copy the appropriate amount... + */ + + if (srclen > size) + { + srclen = size; + } + + memcpy(dst + dstlen, src, srclen); + dst[dstlen + srclen] = '\0'; + + return (dstlen + srclen); +} +#endif /* !HAVE_STRLCAT */ + +#ifndef HAVE_STRLCPY +/* + '_cups_strlcpy()' - Safely copy two strings. +*/ + +size_t /* O - Length of string */ +strlcpy(char *dst, /* O - Destination string */ + const char *src, /* I - Source string */ + size_t size) /* I - Size of destination string buffer */ +{ + size_t srclen; /* Length of source string */ + + + /* + Figure out how much room is needed... + */ + + size --; + + srclen = strlen(src); + + /* + Copy the appropriate amount... + */ + + if (srclen > size) + { + srclen = size; + } + + memcpy(dst, src, srclen); + dst[srclen] = '\0'; + + return (srclen); +} +#endif /* !HAVE_STRLCPY */ diff --git a/tools/boards.txt.py b/tools/boards.txt.py index 4e117ac54..cd50470a9 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -44,14 +44,13 @@ import json # or by user command line speeds = collections.OrderedDict([ - ( '9', [ 's9', 's57', 's115', 's230', 's256', 's460', 's512', 's921' ]), - ( '57', [ 's57', 's9', 's115', 's230', 's256', 's460', 's512', 's921' ]), - ( '115', [ 's115', 's9', 's57', 's230', 's256', 's460', 's512', 's921' ]), - ( '230', [ 's230', 's9', 's57', 's115', 's256', 's460', 's512', 's921' ]), - ( '256', [ 's256', 's9', 's57', 's115', 's230', 's460', 's512', 's921' ]), - ( '460', [ 's460', 's9', 's57', 's115', 's230', 's256', 's512', 's921' ]), - ( '512', [ 's512', 's9', 's57', 's115', 's230', 's256', 's460', 's921' ]), - ( '921', [ 's921', 's9', 's57', 's115', 's230', 's256', 's460', 's512' ]), + ( '57', [ 's57', 's115', 's230', 's256', 's460', 's512', 's921' ]), + ( '115', [ 's115', 's57', 's230', 's256', 's460', 's512', 's921' ]), + ( '230', [ 's230', 's57', 's115', 's256', 's460', 's512', 's921' ]), + ( '256', [ 's256', 's57', 's115', 's230', 's460', 's512', 's921' ]), + ( '460', [ 's460', 's57', 's115', 's230', 's256', 's512', 's921' ]), + ( '512', [ 's512', 's57', 's115', 's230', 's256', 's460', 's921' ]), + ( '921', [ 's921', 's57', 's115', 's230', 's256', 's460', 's512' ]), ]) # boards list @@ -1328,7 +1327,7 @@ def led (default,max): ('.menu.led.' + str(default), str(default)), ('.menu.led.' + str(default) + '.build.led', '-DLED_BUILTIN=' + str(default)), ]); - for i in range(0,max): + for i in range(0,max+1): # Make range incluside of max (16), since there are really 16 GPIOS not 15 if not i == default: led.update( collections.OrderedDict([ diff --git a/tools/espota.py b/tools/espota.py index 36d5f8c31..0b6270511 100755 --- a/tools/espota.py +++ b/tools/espota.py @@ -81,6 +81,14 @@ def serve(remoteAddr, localAddr, remotePort, localPort, password, filename, comm logging.error("Listen Failed") return 1 + # Check whether Signed Update is used. + if ( os.path.isfile(filename + '.signed') ): + filename = filename + '.signed' + file_check_msg = 'Detected Signed Update. %s will be uploaded instead.' % (filename) + sys.stderr.write(file_check_msg + '\n') + sys.stderr.flush() + logging.info(file_check_msg) + content_size = os.path.getsize(filename) f = open(filename,'rb') file_md5 = hashlib.md5(f.read()).hexdigest() diff --git a/tools/sdk/include/bearssl/bearssl_git.h b/tools/sdk/include/bearssl/bearssl_git.h index d3675fc83..e494ac683 100644 --- a/tools/sdk/include/bearssl/bearssl_git.h +++ b/tools/sdk/include/bearssl/bearssl_git.h @@ -1,2 +1,2 @@ // Do not edit -- Automatically generated by tools/sdk/ssl/bearssl/Makefile -#define BEARSSL_GIT 6b9587f +#define BEARSSL_GIT 89454af diff --git a/tools/sdk/include/bearssl/bearssl_ssl.h b/tools/sdk/include/bearssl/bearssl_ssl.h index 0393e1f96..fe3f6be2f 100644 --- a/tools/sdk/include/bearssl/bearssl_ssl.h +++ b/tools/sdk/include/bearssl/bearssl_ssl.h @@ -1251,8 +1251,8 @@ static inline void br_ssl_engine_set_versions(br_ssl_engine_context *cc, unsigned version_min, unsigned version_max) { - cc->version_min = version_min; - cc->version_max = version_max; + cc->version_min = (uint16_t)version_min; + cc->version_max = (uint16_t)version_max; } /** @@ -1325,7 +1325,7 @@ br_ssl_engine_set_protocol_names(br_ssl_engine_context *ctx, const char **names, size_t num) { ctx->protocol_names = names; - ctx->protocol_names_num = num; + ctx->protocol_names_num = (uint16_t)num; } /** diff --git a/tools/sdk/ld/eagle.app.v6.common.ld.h b/tools/sdk/ld/eagle.app.v6.common.ld.h index 45aafed69..2f5735fff 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld.h +++ b/tools/sdk/ld/eagle.app.v6.common.ld.h @@ -129,6 +129,8 @@ SECTIONS *(.text.app_entry*) /* The main startup code */ + *(.text.gdbstub*, .text.gdb_init) /* Any GDB hooks */ + /* all functional callers are placed in IRAM (including SPI/IRQ callbacks/etc) here */ *(.text._ZNKSt8functionIF*EE*) /* std::function::operator()() const */ } >iram1_0_seg :iram1_0_phdr diff --git a/tools/sdk/lib/libbearssl.a b/tools/sdk/lib/libbearssl.a index 52a3e5619..773eeaf80 100644 Binary files a/tools/sdk/lib/libbearssl.a and b/tools/sdk/lib/libbearssl.a differ diff --git a/tools/sdk/lib/libgcc.a b/tools/sdk/lib/libgcc.a index 070d68d1e..def039765 100644 Binary files a/tools/sdk/lib/libgcc.a and b/tools/sdk/lib/libgcc.a differ diff --git a/tools/sdk/lib/libhal.a b/tools/sdk/lib/libhal.a index 4af7aae61..c2193e140 100644 Binary files a/tools/sdk/lib/libhal.a and b/tools/sdk/lib/libhal.a differ diff --git a/tools/sdk/lib/liblwip2-1460-feat.a b/tools/sdk/lib/liblwip2-1460-feat.a index 3cdf0b561..5732de9cd 100644 Binary files a/tools/sdk/lib/liblwip2-1460-feat.a and b/tools/sdk/lib/liblwip2-1460-feat.a differ diff --git a/tools/sdk/lib/liblwip2-1460.a b/tools/sdk/lib/liblwip2-1460.a index 388fe0b68..be9966fa6 100644 Binary files a/tools/sdk/lib/liblwip2-1460.a and b/tools/sdk/lib/liblwip2-1460.a differ diff --git a/tools/sdk/lib/liblwip2-536-feat.a b/tools/sdk/lib/liblwip2-536-feat.a index 20769920d..bc679a5a6 100644 Binary files a/tools/sdk/lib/liblwip2-536-feat.a and b/tools/sdk/lib/liblwip2-536-feat.a differ diff --git a/tools/sdk/lib/liblwip2-536.a b/tools/sdk/lib/liblwip2-536.a index 37a1a8f73..193d2d439 100644 Binary files a/tools/sdk/lib/liblwip2-536.a and b/tools/sdk/lib/liblwip2-536.a differ diff --git a/tools/sdk/lib/liblwip6-1460-feat.a b/tools/sdk/lib/liblwip6-1460-feat.a index a6c8d786a..e4dd8b8fc 100644 Binary files a/tools/sdk/lib/liblwip6-1460-feat.a and b/tools/sdk/lib/liblwip6-1460-feat.a differ diff --git a/tools/sdk/lib/liblwip6-536-feat.a b/tools/sdk/lib/liblwip6-536-feat.a index 8c75a77ba..5cb1db04e 100644 Binary files a/tools/sdk/lib/liblwip6-536-feat.a and b/tools/sdk/lib/liblwip6-536-feat.a differ diff --git a/tools/sdk/lib/libstdc++-exc.a b/tools/sdk/lib/libstdc++-exc.a index f6efc2bda..dfb4b190b 100644 Binary files a/tools/sdk/lib/libstdc++-exc.a and b/tools/sdk/lib/libstdc++-exc.a differ diff --git a/tools/sdk/lib/libstdc++.a b/tools/sdk/lib/libstdc++.a index ade2614cc..49d30d479 100644 Binary files a/tools/sdk/lib/libstdc++.a and b/tools/sdk/lib/libstdc++.a differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h index ce5b3eda7..37ab5b6e8 100644 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h +++ b/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h @@ -402,7 +402,7 @@ struct _reent char *_asctime_buf; /* signal info */ - void (**(_sig_func))(int); + void (**_sig_func)(int); # ifndef _REENT_GLOBAL_ATEXIT /* atexit stuff */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/crt0.o b/tools/sdk/libc/xtensa-lx106-elf/lib/crt0.o index 9e76114eb..8a790872c 100644 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/crt0.o and b/tools/sdk/libc/xtensa-lx106-elf/lib/crt0.o differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a b/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a index bfbece2f3..2a1a82d90 100644 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a and b/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/libg.a b/tools/sdk/libc/xtensa-lx106-elf/lib/libg.a index f9e147933..2a1a82d90 100644 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/libg.a and b/tools/sdk/libc/xtensa-lx106-elf/lib/libg.a differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/libm.a b/tools/sdk/libc/xtensa-lx106-elf/lib/libm.a index e7a209a6a..0d2f0a493 100644 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/libm.a and b/tools/sdk/libc/xtensa-lx106-elf/lib/libm.a differ diff --git a/tools/sdk/lwip2/include/lwip-git-hash.h b/tools/sdk/lwip2/include/lwip-git-hash.h index 58c115214..bf1fbda76 100644 --- a/tools/sdk/lwip2/include/lwip-git-hash.h +++ b/tools/sdk/lwip2/include/lwip-git-hash.h @@ -1,5 +1,5 @@ // generated by makefiles/make-lwip2-hash #ifndef LWIP_HASH_H #define LWIP_HASH_H -#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.1-7-g82abda3" +#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.1-8-g2314329" #endif // LWIP_HASH_H diff --git a/tools/sdk/ssl/bearssl b/tools/sdk/ssl/bearssl index 6b9587f4a..89454af34 160000 --- a/tools/sdk/ssl/bearssl +++ b/tools/sdk/ssl/bearssl @@ -1 +1 @@ -Subproject commit 6b9587f4ac63f0ec62a7c5884b1b70496713acb3 +Subproject commit 89454af34e3e61ddfc9837f3da5a0bc8ed44c3aa