diff --git a/README.md b/README.md index 22a12463a3..ed7864956c 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Arduino core for ESP8266 WiFi chip # Quick links -- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.5.2/) +- [Latest release documentation](https://arduino-esp8266.readthedocs.io/en/2.6.0/) - [Current "git version" documentation](https://arduino-esp8266.readthedocs.io/en/latest/) - [Install git version](https://arduino-esp8266.readthedocs.io/en/latest/installing.html#using-git-version) ([sources](doc/installing.rst#using-git-version)) @@ -36,7 +36,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package #### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/) Boards manager link: `https://arduino.esp8266.com/stable/package_esp8266com_index.json` -Documentation: [https://arduino-esp8266.readthedocs.io/en/2.5.2/](https://arduino-esp8266.readthedocs.io/en/2.5.2/) +Documentation: [https://arduino-esp8266.readthedocs.io/en/2.6.0/](https://arduino-esp8266.readthedocs.io/en/2.6.0/) ### Using git version [![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino) @@ -123,3 +123,13 @@ ESP8266 core files are licensed under LGPL. [BearSSL](https://bearssl.org) library written by Thomas Pornin, built from https://github.com/earlephilhower/bearssl-esp8266, is used in this project. It is distributed under the [MIT License](https://bearssl.org/#legal-details). [LittleFS](https://github.com/ARMmbed/littlefs) library written by ARM Limited and released under the [BSD 3-clause license](https://github.com/ARMmbed/littlefs/blob/master/LICENSE.md). + +### Other useful links ### + +[Toolchain repo](https://github.com/earlephilhower/esp-quick-toolchain) + +[Lwip link layer repo](https://github.com/d-a-v/esp82xx-nonos-linklayer) + +[SoftwareSerial repo](https://github.com/plerup/espsoftwareserial) + +[Serial Monitor Arduino IDE plugin](https://github.com/mytrain/arduino-esp8266-serial-plugin) Original discussion [here](https://github.com/esp8266/Arduino/issues/1360), quick download [there](http://mytrain.fr/cms//images/mytrain/private/ESP8266SM.v3.zip). diff --git a/boards.txt b/boards.txt index f19cc72b6b..e873cdb57c 100644 --- a/boards.txt +++ b/boards.txt @@ -2610,6 +2610,10 @@ nodemcuv2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld nodemcuv2.menu.eesz.4M.build.spiffs_pagesize=256 nodemcuv2.menu.eesz.4M.upload.maximum_size=1044464 nodemcuv2.menu.eesz.4M.build.rfcal_addr=0x3FC000 +nodemcuv2.menu.led.2=2 +nodemcuv2.menu.led.2.build.led=-DLED_BUILTIN=2 +nodemcuv2.menu.led.16=16 +nodemcuv2.menu.led.16.build.led=-DLED_BUILTIN=16 nodemcuv2.menu.ip.lm2f=v2 Lower Memory nodemcuv2.menu.ip.lm2f.build.lwip_include=lwip2/include nodemcuv2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat diff --git a/cores/esp8266/IPAddress.h b/cores/esp8266/IPAddress.h index bf5ef1010d..cdd4b2499f 100644 --- a/cores/esp8266/IPAddress.h +++ b/cores/esp8266/IPAddress.h @@ -32,6 +32,7 @@ #define LWIP_IPV6_NUM_ADDRESSES 0 #define ip_2_ip4(x) (x) #define ipv4_addr ip_addr +#define ipv4_addr_t ip_addr_t #define IP_IS_V4_VAL(x) (1) #define IP_SET_TYPE_VAL(x,y) do { (void)0; } while (0) #define IP_ANY_TYPE (&ip_addr_any) diff --git a/cores/esp8266/WString.h b/cores/esp8266/WString.h index 8c970abf14..3f026f2f75 100644 --- a/cores/esp8266/WString.h +++ b/cores/esp8266/WString.h @@ -202,8 +202,20 @@ class String { unsigned char equalsIgnoreCase(const String &s) const; unsigned char equalsConstantTime(const String &s) const; unsigned char startsWith(const String &prefix) const; + unsigned char startsWith(const char * prefix) const { + return this->startsWith(String(prefix)); + } + unsigned char startsWith(const __FlashStringHelper * prefix) const { + return this->startsWith(String(prefix)); + } unsigned char startsWith(const String &prefix, unsigned int offset) const; unsigned char endsWith(const String &suffix) const; + unsigned char endsWith(const char * suffix) const { + return this->endsWith(String(suffix)); + } + unsigned char endsWith(const __FlashStringHelper * suffix) const { + return this->endsWith(String(suffix)); + } // character access char charAt(unsigned int index) const; @@ -238,6 +250,21 @@ class String { // modification void replace(char find, char replace); void replace(const String& find, const String& replace); + void replace(const char * find, const String& replace) { + this->replace(String(find), replace); + } + void replace(const __FlashStringHelper * find, const String& replace) { + this->replace(String(find), replace); + } + void replace(const char * find, const char * replace) { + this->replace(String(find), String(replace)); + } + void replace(const __FlashStringHelper * find, const char * replace) { + this->replace(String(find), String(replace)); + } + void replace(const __FlashStringHelper * find, const __FlashStringHelper * replace) { + this->replace(String(find), String(replace)); + } void remove(unsigned int index); void remove(unsigned int index, unsigned int count); void toLowerCase(void); diff --git a/doc/installing.rst b/doc/installing.rst index a83d4161f9..ca9e3f449e 100644 --- a/doc/installing.rst +++ b/doc/installing.rst @@ -53,7 +53,8 @@ Instructions - Windows 10 ~~~~~~~~~~~~~~~~~~~~~~~~~ - First, make sure you don't already have an ESP8266 core version installed using the Board Manager (see above). If you do, uninstall it from the - Board Manager before proceeding. + Board Manager before proceeding. It is also advisable to erase the Arduino15 + contents. - Install git for Windows (if not already; see https://git-scm.com/download/win) @@ -136,7 +137,8 @@ Instructions - Other OS - First, make sure you don't already have an ESP8266 core version installed using the Board Manager (see above). If you do, uninstall it from the - Board Manager before proceeding. + Board Manager before proceeding. It is also advisable to erase the .arduino15 (Linux) + or Arduino15 (MacOS) contents. - Open the console and go to Arduino directory. This can be either your *sketchbook* directory (usually ``/Arduino``), or the diff --git a/libraries/ESP8266WebServer/README.rst b/libraries/ESP8266WebServer/README.rst index 00a3813a84..0dcf68b516 100644 --- a/libraries/ESP8266WebServer/README.rst +++ b/libraries/ESP8266WebServer/README.rst @@ -96,7 +96,7 @@ Getting information about request arguments int args(); bool hasArg(); -``arg`` - get request argument value +``arg`` - get request argument value, use ``arg("plain")`` to get POST body ``argName`` - get request argument name diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino index 5ba217b233..9102af12d8 100644 --- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino +++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino @@ -85,8 +85,8 @@ void setup() { Serial.swap(); // Hardware serial is now on RX:GPIO13 TX:GPIO15 // use SoftwareSerial on regular RX(3)/TX(1) for logging - logger = new SoftwareSerial(); - logger->begin(BAUD_LOGGER, 3, 1); + logger = new SoftwareSerial(3, 1); + logger->begin(BAUD_LOGGER); logger->enableIntTx(false); logger->println("\n\nUsing SoftwareSerial for logging"); #else diff --git a/libraries/LittleFS/lib/littlefs b/libraries/LittleFS/lib/littlefs index abd90cb84c..6b65737715 160000 --- a/libraries/LittleFS/lib/littlefs +++ b/libraries/LittleFS/lib/littlefs @@ -1 +1 @@ -Subproject commit abd90cb84c818a663b584575b019258d01d0065e +Subproject commit 6b65737715039ef92d348014316b575b52547019 diff --git a/libraries/SoftwareSerial b/libraries/SoftwareSerial index 1a1472340b..38e3f1a3c0 160000 --- a/libraries/SoftwareSerial +++ b/libraries/SoftwareSerial @@ -1 +1 @@ -Subproject commit 1a1472340b73d17495710f489de81e7b53fb5a21 +Subproject commit 38e3f1a3c0ce8a4c3e6cda4a9698968a6f3d96c4 diff --git a/libraries/esp8266/examples/SerialStress/SerialStress.ino b/libraries/esp8266/examples/SerialStress/SerialStress.ino index 5500b10a62..1412abd2be 100644 --- a/libraries/esp8266/examples/SerialStress/SerialStress.ino +++ b/libraries/esp8266/examples/SerialStress/SerialStress.ino @@ -72,8 +72,8 @@ void setup() { // using HardwareSerial0 pins, // so we can still log to the regular usbserial chips - SoftwareSerial* ss = new SoftwareSerial; - ss->begin(SSBAUD, 3, 1); + SoftwareSerial* ss = new SoftwareSerial(3, 1); + ss->begin(SSBAUD); ss->enableIntTx(false); logger = ss; logger->println(); diff --git a/package/build_boards_manager_package.sh b/package/build_boards_manager_package.sh index f5ffff447f..ff63547b97 100755 --- a/package/build_boards_manager_package.sh +++ b/package/build_boards_manager_package.sh @@ -94,7 +94,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.pattern.*//g' |\ +$SED 's/recipe.hooks.*makecorever.*//g' |\ $SED "s/version=.*/version=$ver/g" |\ $SED -E "s/name=([a-zA-Z0-9\ -]+).*/name=\1($ver)/g"\ > $outdir/platform.txt diff --git a/platform.txt b/platform.txt index 18200bb679..13da729e6f 100644 --- a/platform.txt +++ b/platform.txt @@ -5,8 +5,8 @@ # For more info: # https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5-3rd-party-Hardware-specification -name=ESP8266 Boards (2.6.0) -version=2.6.0 +name=ESP8266 Boards (2.7.0-dev) +version=2.7.0-dev # These will be removed by the packager script when doing a JSON release runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/tools/xtensa-lx106-elf diff --git a/tools/boards.txt.py b/tools/boards.txt.py index 53964bbc04..a40c5f885c 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -42,6 +42,7 @@ requiredboards = [ 'generic', 'esp8285' ] +################################################################ # serial upload speed order in menu # default is 115 for every board unless specified with 'serial' in board # or by user command line @@ -57,6 +58,7 @@ ( '3000', [ 's3000','s57', 's115', 's230', 's256', 's460', 's512', 's921' ]), ]) +################################################################ # boards list boards = collections.OrderedDict([ @@ -467,6 +469,7 @@ 'flashmode_dio', 'flashfreq_40', '4M', + 'led216', ], 'desc': [ 'This module is sold under many names for around $6.50 on AliExpress and it\'s one of the cheapest, fully integrated ESP8266 solutions.', '', @@ -1435,19 +1438,19 @@ def all_flash_map (): ################################################################ # builtin led -def led (default,max): +def led (name, default, ledList): led = collections.OrderedDict([ ('.menu.led.' + str(default), str(default)), ('.menu.led.' + str(default) + '.build.led', '-DLED_BUILTIN=' + str(default)), ]); - for i in range(0,max+1): # Make range incluside of max (16), since there are really 16 GPIOS not 15 + for i in ledList: # Make range incluside of max (16), since there are really 16 GPIOS not 15 if not i == default: led.update( collections.OrderedDict([ ('.menu.led.' + str(i), str(i)), ('.menu.led.' + str(i) + '.build.led', '-DLED_BUILTIN=' + str(i)), ])) - return { 'led': led } + return { name: led } ################################################################ # sdk selection @@ -1495,7 +1498,8 @@ def all_boards (): macros.update(all_flash_map()) macros.update(all_debug()) - macros.update(led(led_default, led_max)) + macros.update(led('led', led_default, range(0,led_max+1))) + macros.update(led('led216', 2, { 16 })) macros.update(sdk()) if boardfilteropt or excludeboards: diff --git a/variants/nodemcu/pins_arduino.h b/variants/nodemcu/pins_arduino.h index ceb30691cb..443e23e0f0 100644 --- a/variants/nodemcu/pins_arduino.h +++ b/variants/nodemcu/pins_arduino.h @@ -32,7 +32,8 @@ static const uint8_t SDA = PIN_WIRE_SDA; static const uint8_t SCL = PIN_WIRE_SCL; -#define LED_BUILTIN 16 +#define LED_BUILTIN 2 +#define LED_BUILTIN_AUX 16 static const uint8_t D0 = 16; static const uint8_t D1 = 5;