diff --git a/.gitignore b/.gitignore
index c36bdd3aa3..b15779b9b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,5 +8,16 @@ exclude.txt
tools/sdk/lib/liblwip_src.a
tools/sdk/lwip/src/build
tools/sdk/lwip/src/liblwip_src.a
+tools/sdk/ld/backup
+tools/sdk/ld/eagle.app.v6.common.ld
*.pyc
+*.gch
+
+boards.local.txt
+
+*.gcov
+*.gcno
+*.gcda
+*.o
+*.a
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000000..2703cecb68
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "lwip2"]
+ path = tools/sdk/lwip2/builder
+ url = https://github.com/d-a-v/esp82xx-nonos-linklayer.git
+[submodule "tools/sdk/ssl/bearssl"]
+ path = tools/sdk/ssl/bearssl
+ url = https://github.com/earlephilhower/bearssl-esp8266
diff --git a/.travis.yml b/.travis.yml
index 05fb744fe3..5591e47a63 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,50 +1,61 @@
sudo: false
language: bash
-os:
- - linux
+os: linux
+dist: trusty
-addons:
- apt:
- sources:
- - ubuntu-toolchain-r-test
- packages:
- - g++-4.8
+cache:
+ directories:
+ - $HOME/astyle
+
+matrix:
+ include:
+ - env:
+ - BUILD_TYPE=build_even
+ - env:
+ - BUILD_TYPE=build_odd
+ - env:
+ - BUILD_TYPE=platformio
+ - env:
+ - BUILD_TYPE=docs
+ - env:
+ - BUILD_TYPE=package
+ - env:
+ - BUILD_TYPE=host_tests
+ - env:
+ - BUILD_TYPE=style_check
+
+install:
+ - >
+ [ "$BUILD_TYPE" = "docs" ] && {
+ pip install --user -r doc/requirements.txt;
+ } || true
+ - >
+ [ "$BUILD_TYPE" = "style_check" ] && {
+ [ -f $HOME/astyle/build/gcc/bin/astyle ] || {
+ wget -O astyle_3.1_linux.tar.gz https://sourceforge.net/projects/astyle/files/astyle/astyle%203.1/astyle_3.1_linux.tar.gz/download;
+ tar -xf astyle_3.1_linux.tar.gz -C $HOME;
+ make -C $HOME/astyle/build/gcc;
+ }
+ make -C $HOME/astyle/build/gcc prefix=$HOME install;
+ } || true
script:
- - set -e
- - export CXX="g++-4.8" CC="gcc-4.8" GCOV="gcov-4.8"
- - echo -e "travis_fold:start:host_tests"
- - pushd $TRAVIS_BUILD_DIR/tests/host
- - make
- - make clean-objects
- - echo -e "travis_fold:end:host_tests"
- - echo -e "travis_fold:start:sketch_test_env_prepare"
- - popd
- - wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
- - tar xf arduino.tar.xz
- - mv arduino-nightly $HOME/arduino_ide
- - cd $HOME/arduino_ide/hardware
- - mkdir esp8266com
- - cd esp8266com
- - ln -s $TRAVIS_BUILD_DIR esp8266
- - cd esp8266/tools
- - python get.py
- - export PATH="$HOME/arduino_ide:$TRAVIS_BUILD_DIR/tools/xtensa-lx106-elf/bin:$PATH"
- - which arduino
- - cd $TRAVIS_BUILD_DIR
- - source tests/common.sh
- - install_libraries
- - echo -e "travis_fold:end:sketch_test_env_prepare"
- - echo -e "travis_fold:start:sketch_test"
- - build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries"
- - echo -e "travis_fold:end:sketch_test"
- - echo -e "travis_fold:start:size_report"
- - cat size.log
- - echo -e "travis_fold:end:size_report"
+ - $TRAVIS_BUILD_DIR/tests/common.sh
-after_success:
- - pushd $TRAVIS_BUILD_DIR/tests/host
- - bash <(curl -s https://codecov.io/bash) -X gcov
+deploy:
+ provider: releases
+ prerelease: true
+ skip_cleanup: true
+ api_key:
+ secure: A4FBmqyhlzy33oPeZVolg2Q/A3ZcJ3WnRQqQJ3NAPy+qGM5xcboOYtwcLL9vKaHZGfUB7lUP9QVZFGou1Wrmo9DnPvAoe3+XvCaDRGzVMxeIpu7UStbBD4Knbh98tlbMvZCXYRlT4VcusI9bMLK6UWw4sMdPislBh2FEfglTiag=
+ file_glob: true
+ file:
+ - package/versions/$TRAVIS_TAG/esp8266-$TRAVIS_TAG.zip
+ - package/versions/$TRAVIS_TAG/package_esp8266com_index.json
+ on:
+ repo: esp8266/Arduino
+ tags: true
+ condition: "$BUILD_TYPE = package"
notifications:
email:
diff --git a/ISSUE_TEMPLATE.md b/ISSUE_TEMPLATE.md
index 041742df4a..51d0688744 100644
--- a/ISSUE_TEMPLATE.md
+++ b/ISSUE_TEMPLATE.md
@@ -1,36 +1,65 @@
+----------------------------- Delete below -----------------------------
-Please fill the info fields, it helps to get you faster support ;)
+If your issue is a general question, starts similar to "How do I..", is related to 3rd party libs, or is related to hardware, please discuss at a community forum like esp8266.com.
-if you have a stack dump decode it:
-https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/stack_dump.md
+INSTRUCTIONS
+============
+If you do not follow these instructions, your issue may be dismissed.
-for better debug messages:
-https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.md
+1. Follow the checklist under Basic Infos and fill in the [ ] spaces with an X.
+2. Fill in all the fields under Platform and Settings in IDE marked with [ ] (pick the correct option for you in each case, delete the others).
+3. If you haven't already done so, test your issue against current master branch (aka latest git), because it may have been already fixed.
+4. Describe your problem.
+5. If you have a STACK DUMP decode it:
------------------------------ Remove above -----------------------------
+https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/stack_dump.html
+
+6. Include a Minimal Complete Reproducible Example sketch that shows your issue. Do not include your entire project, or a huge piece of code.
+7. Include debug messages:
+
+https://arduino-esp8266.readthedocs.io/en/latest/Troubleshooting/debugging.html
+
+8. Use markup (buttons above) and the Preview tab to check what the issue will look like.
+9. Delete these instructions from the above to the below marker lines before submitting this issue.
+
+
+----------------------------- Delete above -----------------------------
### Basic Infos
-#### Hardware
-Hardware: ?ESP-12?
-Core Version: ?2.1.0-rc2?
+- [ ] This issue complies with the [issue POLICY doc](https://github.com/esp8266/Arduino/blob/master/POLICY.md).
+- [ ] I have read the documentation at [readthedocs](https://arduino-esp8266.readthedocs.io/en/latest) and the issue is not addressed there.
+- [ ] I have tested that the issue is present in current master branch (aka latest git).
+- [ ] I have searched the issue tracker for a similar issue.
+- [ ] If there is a stack dump, I have decoded it.
+- [ ] I have filled out all fields below.
-### Description
+#### Platform
-Problem description
+- Hardware: [ESP-12|ESP-01|ESP-07|ESP8285 device|other]
+- Core Version: [latest git hash or date]
+- Development Env: [Arduino IDE|Platformio|Make|other]
+- Operating System: [Windows|Ubuntu|MacOS]
### Settings in IDE
-Module: ?Generic ESP8266 Module?
-Flash Size: ?4MB/1MB?
-CPU Frequency: ?80Mhz?
-Flash Mode: ?qio?
-Flash Frequency: ?40Mhz?
-Upload Using: ?OTA / SERIAL?
-Reset Method: ?ck / nodemcu?
+- Module: [Generic ESP8266 Module|Wemos D1 mini r2|Nodemcu|other]
+- Flash Mode: [qio|dio|other]
+- Flash Size: [4MB/1MB]
+- lwip Variant: [v1.4|v2 Lower Memory|Higher Bandwidth]
+- Reset Method: [ck|nodemcu]
+- Flash Frequency: [40Mhz]
+- CPU Frequency: [80Mhz|160MHz]
+- Upload Using: [OTA|SERIAL]
+- Upload Speed: [115200|other] (serial upload only)
-### Sketch
+### Problem Description
+
+Detailed problem description goes here.
+
+
+### [MCVE](https://stackoverflow.com/help/mcve) Sketch
```cpp
@@ -43,12 +72,13 @@ void setup() {
void loop() {
}
+
```
### Debug Messages
```
-messages here
+Debug messages go here
```
diff --git a/POLICY.md b/POLICY.md
new file mode 100644
index 0000000000..8ff05c83e5
--- /dev/null
+++ b/POLICY.md
@@ -0,0 +1,67 @@
+This document describes rules that are in effect for this repository, meant for handling issues by contributors in the issue tracker and PRs.
+# Opening New Issues
+1. The issue tracker is precisely that: a tool to track issues in the core code, and not a discussion forum. Opening an issue means that a problem has been found in the core code, and that it should be addressed by a contributor.
+2. When opening an issue, a template is presented with fields to fill out. The requested information is important. If the template is ignored, or not enough info about the issue is provided, the issue may be closed due to lack of info. Example:
+ * Using WifiMulti and FS crashes with error. Why? (no basic info, no IDE settings, no sketch provided)
+3. Questions of type "How do I..." or "Can you please help me with..." or "Can the ESP do..." won't be handled here. Such questions should be directed at a discussion forum, like esp8266.com or stackoverflow. All issues of this type will be closed with a simple reference to the policy. Example:
+ * how do I connect to wifi
+ * how do I connect two ESPs
+ * can I send http data over a public network
+ * my wiring/project/code doesn't work, help!
+4. Issues that are obviously user error, programming language errors, lack of knowledge or experience with the use semantics of the core libs, or similar, will be closed with a reference to the policy. Examples:
+ * sketch crashes due to a char[] in it that is not null terminated
+ * trying to use yield/delay, or libs that use yield/delay, from inside async callbacks
+ * Use of new/malloc without matching delete/free (mem leak)
+5. Issues about topics already handled in the documentation will be closed in a similar manner. Example:
+ * can't flash with error espcomm failed
+6. Issues must be provided with a minimalist sketch. Issues with an incomplete sketch, or a huge sketch, will be closed. Maximum effort must be put forth by the person opening the issue to reduce the relevant code that reproduces the issue, so that investigation can be taken up. MCVE is a must.
+7. Issues for unmerged PRs will be closed. If there is an issue with a PR, the explanation should be added to the PR itself.
+8. Issues with accompanied investigation that shows the root of the problem should be given priority
+9. Duplicate issues will be closed with a reference to the original
+
+# Triaging
+1. Any contributor of the project can participate in the triaging process, if he/she chooses to do so
+2. An issue that needs to be closed, either due to not complying with this policy, or for other reasons, should be closed by a contributor
+3. Issues that are accepted should be marked with appropriate labels, e.g.: component: xyz
+4. If an issue is deemed to require specialized knowledge (e.g.: TLS, HTTP parser, SDK integration, etc), contributor(s) relevant to the affected code should be /cc’ed, as this can help grab attention
+5. Severe issues should be assigned to the current milestone (i.e.: the next version to be released), or the milestone following. It is ok to push back issues depending on available resources.
+6. Issues that could impact functionality for many users should be considered severe.
+7. Issues caused by the SDK or chip should not be marked severe, as there usually isn’t much to be done. Common sense should be applied when deciding. Such issues should be documented in a KID (Known Issues Document), possibly on the Wiki, for reference by users. Example:
+ * ARP issue
+ * Extra channel change beacon announced by the SoftAP
+ * Wakeup ROM bug in the ESP chip
+8. Issues with feature requests should be discussed for viability/desirability. Example:
+ * Support for new board. If the new board is not widely used, doesn’t have a manufacturer webpage, etc, then it isn’t desirable to support it. If the new board is essentially a duplicate of another, it isn’t desirable to duplicate the existing one.
+9. Feature requests or changes that are meant to address a very specific/limited use case, especially if at the expense of increased code complexity, may be denied, or may be required to be redesigned, generalized, or simplified
+10. Feature requests that are not accompanied by a PR:
+ * could be closed immediately (denied)
+ * could be closed after some predetermined period of time (left as candidate for somebody to pick up)
+ * could be deemed interesting enough to work on, but without a specific project or target, and hence accumulated in a long-term feature request list. Such feature requests will in general not be targeted for a deadline or release.
+11. In some cases, feedback may be requested from the issue reporter, either as additional info for clarification, additional testing, or other. If no feedback is provided after 30 days, the issue may be closed by a contributor.
+
+# Compatibility
+1. Compatibility with the Arduino build system is first priority. Compatibility with PlatformIO and make are also maintained, but are second priority.
+2. Feature requests should consider compatibility with Arduino
+ * ESP-specific APIs should be added with care, and should be marked as such (Example: ESP8266WiFi)
+ * APIs of common libraries should maintain compatibility (Example: Wire, SPI, Servo)
+ * ESP-specific extensions to compatible APIs are ok, especially if required to fully use certain peripherals, but such functions should be clearly marked as ESP-specific
+3. When making changes that are likely to impact PlatformIO or make, relevant people should be notified. Check whether some corresponding changes are needed on the build system side. When an issue related to one of these build systems is reported, redirect the issue reporter to the respective issue tracker.
+4. The core libs are implemented as a wrapper layer over the Espressif SDK. Due to the requirements and limitations imposed by the SDK, there are inherent differences between the behavior of this core and the standard Arduino core (Example: using long delay()s is not allowed here). Compatibility can’t be maintained in such cases, and differences should be clearly documented.
+
+# Pull requests
+1. All pull requests should undergo peer review by at least one contributor other than the creator
+2. All pull requests should consider updates to the documentation
+3. All pull requests should consider updates to regression tests, where possible
+4. Pull requests that address an outstanding issue, particularly an issue deemed to be severe, should be given priority
+5. If a PR is accepted, then it should undergo review and updated based on the feedback provided, then merged
+6. Pull requests that don't meet the above will be denied and closed
+
+# Other
+A table should be maintained for relating maintainers and components. When triaging, this is essential to figure out if someone in particular should be consulted about specific changes.
+
+A stable release cadence should be established, e.g.: every 6 months.
+
+Regression testing should be revisited and streamlined with the release process. Running regression tests should be done before merging a PR to reduce overhead for a release.
+
+
+
diff --git a/README.md b/README.md
index f41fefc7eb..7ca5597574 100644
--- a/README.md
+++ b/README.md
@@ -16,36 +16,30 @@ ESP8266 Arduino core comes with libraries to communicate over WiFi using TCP and
- [Contributing](#contributing)
- [License and credits](#license-and-credits)
-### Installing with Boards Manager ###
+### Installing with Boards Manager
Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).
-- Install Arduino 1.6.8 from the [Arduino website](http://www.arduino.cc/en/main/software).
+- Install the current upstream Arduino IDE at the 1.8 level or later. The current version is at the [Arduino website](http://www.arduino.cc/en/main/software).
- Start Arduino and open Preferences window.
- Enter ```http://arduino.esp8266.com/stable/package_esp8266com_index.json``` into *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
- Open Boards Manager from Tools > Board menu and install *esp8266* platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).
-The best place to ask questions related to this core is ESP8266 community forum: http://www.esp8266.com/arduino.
-If you find this forum or the ESP8266 Boards Manager package useful, please consider supporting it with a donation.
-[](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66)
-
-#### Available versions
-
-##### Stable version 
+#### Latest release [](https://github.com/esp8266/Arduino/releases/latest/)
Boards manager link: `http://arduino.esp8266.com/stable/package_esp8266com_index.json`
-Documentation: [http://esp8266.github.io/Arduino/versions/2.3.0/](http://esp8266.github.io/Arduino/versions/2.3.0/)
-
-##### Staging version 
-Boards manager link: `http://arduino.esp8266.com/staging/package_esp8266com_index.json`
-
-Documentation: [http://esp8266.github.io/Arduino/versions/2.3.0-rc2/](http://esp8266.github.io/Arduino/versions/2.3.0-rc2/)
+Documentation: [https://arduino-esp8266.readthedocs.io/en/2.4.1/](https://arduino-esp8266.readthedocs.io/en/2.4.1/)
### Using git version
-[](https://travis-ci.org/esp8266/Arduino) [](https://codecov.io/github/esp8266/Arduino?branch=master)
-
-- Install Arduino 1.6.8
-- Go to Arduino directory
+[](https://travis-ci.org/esp8266/Arduino)
+
+- Install the current upstream Arduino IDE at the 1.8 level or later. The current version is at the [Arduino website](http://www.arduino.cc/en/main/software).
+- Go to Arduino application directory
+ - For Mac OS X, it is `Arduino.app` showing as the Arduino icon.
+ This location may be your `~/Downloads`, `~/Desktop` or even `/Applications`.
+ ```bash
+ cd /Arduino.app/Contents/Java
+ ```
- Clone this repository into hardware/esp8266com/esp8266 directory (or clone it elsewhere and create a symlink)
```bash
cd hardware
@@ -62,19 +56,19 @@ python get.py
### Using PlatformIO
-[PlatformIO](http://platformio.org) is an open source ecosystem for IoT
+[PlatformIO](http://platformio.org?utm_source=github&utm_medium=arduino-esp8266) is an open source ecosystem for IoT
development with cross platform build system, library manager and full support
-for Espressif (ESP8266) development. It works on the popular host OS: Mac OS X, Windows,
+for Espressif (ESP8266) development. It works on the popular host OS: macOS, Windows,
Linux 32/64, Linux ARM (like Raspberry Pi, BeagleBone, CubieBoard).
-- [What is PlatformIO?](http://docs.platformio.org/en/stable/what-is-platformio.html)
-- [PlatformIO IDE](http://platformio.org/platformio-ide)
-- Quick Start with [PlatformIO IDE](http://docs.platformio.org/en/stable/ide/atom.html#quick-start) or [PlatformIO CLI](http://docs.platformio.org/en/stable/quickstart.html)
-- [Advanced using](http://docs.platformio.org/en/stable/platforms/espressif.html) -
- custom settings, uploading to SPIFFS, Over-the-Air (OTA) or using stage version
-- [Integration with other IDE](http://docs.platformio.org/en/stable/ide.html) -
- Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM and Visual Studio
-- [Project Examples](http://docs.platformio.org/en/stable/platforms/espressif.html#examples)
+- [What is PlatformIO?](http://docs.platformio.org/en/latest/what-is-platformio.html?utm_source=github&utm_medium=arduino-esp8266)
+- [PlatformIO IDE](http://platformio.org/platformio-ide?utm_source=github&utm_medium=arduino-esp8266)
+- [PlatformIO Core](http://docs.platformio.org/en/latest/core.html?utm_source=github&utm_medium=arduino-esp8266) (command line tool)
+- [Advanced usage](http://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=github&utm_medium=arduino-esp8266) -
+ custom settings, uploading to SPIFFS, Over-the-Air (OTA), staging version
+- [Integration with Cloud and Standalone IDEs](http://docs.platformio.org/en/latest/ide.html?utm_source=github&utm_medium=arduino-esp8266) -
+ Cloud9, Codeanywhere, Eclipse Che (Codenvy), Atom, CLion, Eclipse, Emacs, NetBeans, Qt Creator, Sublime Text, VIM, Visual Studio, and VSCode
+- [Project Examples](http://docs.platformio.org/en/latest/platforms/espressif8266.html?utm_source=github&utm_medium=arduino-esp8266#examples)
### Building with make
@@ -83,30 +77,33 @@ Using make instead of the Arduino IDE makes it easier to do automated and produc
### Documentation
-Documentation for latest development version:
-
-- [Reference](doc/reference.md)
-- [Libraries](doc/libraries.md)
-- [File system](doc/filesystem.md)
-- [OTA update](doc/ota_updates/readme.md)
-- [Supported boards](doc/boards.md)
-- [FAQ / Trubleshooting](doc/faq/readme.md)
-- [Change log](doc/changes.md)
+Documentation for latest development version: https://arduino-esp8266.readthedocs.io/en/latest/
### Issues and support ###
-If you encounter an issue, you are welcome to submit it here on Github: https://github.com/esp8266/Arduino/issues.
-Please provide as much context as possible: version which you are using (you can check it in Boards Manager), your sketch code, serial output, board model, IDE settings (board selection, flash size, etc).
+[ESP8266 Community Forum](http://www.esp8266.com/u/arduinoanswers) is a well established community for questions and answers about Arduino for ESP8266.
+
+If you find this forum useful, please consider supporting it with a donation.
+[](https://www.paypal.com/webscr?cmd=_s-xclick&hosted_button_id=4M56YCWV6PX66)
+
+If you encounter an issue which you think is a bug in the ESP8266 Arduino Core or the associated libraries, you are welcome to submit it here on Github: https://github.com/esp8266/Arduino/issues.
+
+Please provide as much context as possible:
-If you can not find the answers above, you can also try [ESP8266 Community Forum](http://www.esp8266.com/arduino)
+- ESP8266 Arduino core version which you are using (you can check it in Boards Manager)
+- your sketch code; please wrap it into a code block, see [Github markdown manual](https://help.github.com/articles/basic-writing-and-formatting-syntax/#quoting-code)
+- when encountering an issue which happens at run time, attach serial output. Wrap it into a code block, just like the code.
+- for issues which happen at compile time, enable verbose compiler output in the IDE preferences, and attach that output (also inside a code block)
+- ESP8266 development board model
+- IDE settings (board choich, flash size)
### Contributing
-For minor fixes of code and documentation, go ahead and submit a pull request.
+For minor fixes of code and documentation, please go ahead and submit a pull request.
-Check out the list of issues which are easy to fix — [easy issues for 2.2.0](https://github.com/esp8266/Arduino/issues?q=is%3Aopen+is%3Aissue+milestone%3A2.2.0+label%3A%22level%3A+easy%22). Working on them is a great way to move the project forward.
+Check out the list of issues which are easy to fix — [easy issues for 2.5.0](https://github.com/esp8266/Arduino/issues?q=is%3Aopen+is%3Aissue+milestone%3A2.5.0+label%3A%22level%3A+easy%22). Working on them is a great way to move the project forward.
-Larger changes (rewriting parts of existing code from scratch, adding new functions to the core, adding new libraries) should generally be discussed [in the chat](https://gitter.im/esp8266/Arduino) first.
+Larger changes (rewriting parts of existing code from scratch, adding new functions to the core, adding new libraries) should generally be discussed by opening an issue first.
Feature branches with lots of small commits (especially titled "oops", "fix typo", "forgot to add file", etc.) should be squashed before opening a pull request. At the same time, please refrain from putting multiple unrelated changes into a single pull request.
@@ -125,3 +122,5 @@ ESP8266 core files are licensed under LGPL.
[SPI Flash File System (SPIFFS)](https://github.com/pellepl/spiffs) written by Peter Andersson is used in this project. It is distributed under MIT license.
[umm_malloc](https://github.com/rhempel/umm_malloc) memory management library written by Ralph Hempel is used in this project. It is distributed under MIT license.
+
+[axTLS](http://axtls.sourceforge.net/) library written by Cameron Rich, built from https://github.com/igrr/axtls-8266, is used in this project. It is distributed under [BSD license](https://github.com/igrr/axtls-8266/blob/master/LICENSE).
diff --git a/boards.txt b/boards.txt
index 818b26ce25..37fcbe69d1 100644
--- a/boards.txt
+++ b/boards.txt
@@ -1,5 +1,11 @@
+#
+# this file is script-generated and is likely to be overwritten by boards.txt.py
+#
+
+menu.BoardModel=Model
menu.UploadSpeed=Upload Speed
menu.CpuFrequency=CPU Frequency
+menu.CrystalFreq=Crystal Frequency
menu.FlashSize=Flash Size
menu.FlashMode=Flash Mode
menu.FlashFreq=Flash Frequency
@@ -8,269 +14,585 @@ menu.ESPModule=Module
menu.Debug=Debug port
menu.DebugLevel=Debug Level
menu.LwIPVariant=lwIP Variant
+menu.VTable=VTables
+menu.led=Builtin Led
+menu.FlashErase=Erase Flash
##############################################################
generic.name=Generic ESP8266 Module
-
+generic.build.board=ESP8266_GENERIC
generic.upload.tool=esptool
-generic.upload.speed=115200
-generic.upload.resetmethod=ck
-generic.upload.maximum_size=434160
generic.upload.maximum_data_size=81920
generic.upload.wait_for_upload_port=true
+generic.upload.erase_cmd=
generic.serial.disableDTR=true
generic.serial.disableRTS=true
-
generic.build.mcu=esp8266
-generic.build.f_cpu=80000000L
-generic.build.board=ESP8266_ESP01
generic.build.core=esp8266
generic.build.variant=generic
-generic.build.flash_mode=qio
generic.build.spiffs_pagesize=256
generic.build.debug_port=
generic.build.debug_level=
-
generic.menu.CpuFrequency.80=80 MHz
generic.menu.CpuFrequency.80.build.f_cpu=80000000L
generic.menu.CpuFrequency.160=160 MHz
generic.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+generic.menu.VTable.flash=Flash
+generic.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+generic.menu.VTable.heap=Heap
+generic.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+generic.menu.VTable.iram=IRAM
+generic.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+generic.menu.ResetMethod.ck=ck
+generic.menu.ResetMethod.ck.upload.resetmethod=ck
+generic.menu.ResetMethod.nodemcu=nodemcu
+generic.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+generic.menu.ResetMethod.none=none
+generic.menu.ResetMethod.none.upload.resetmethod=none
+generic.menu.ResetMethod.dtrset=dtrset
+generic.menu.ResetMethod.dtrset.upload.resetmethod=dtrset
+generic.menu.CrystalFreq.26=26 MHz
+generic.menu.CrystalFreq.40=40 MHz
+generic.menu.CrystalFreq.40.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
generic.menu.FlashFreq.40=40MHz
generic.menu.FlashFreq.40.build.flash_freq=40
generic.menu.FlashFreq.80=80MHz
generic.menu.FlashFreq.80.build.flash_freq=80
-
-generic.menu.FlashMode.dio=DIO
-generic.menu.FlashMode.dio.build.flash_mode=dio
generic.menu.FlashMode.qio=QIO
generic.menu.FlashMode.qio.build.flash_mode=qio
-generic.menu.FlashMode.dout=DOUT
-generic.menu.FlashMode.dout.build.flash_mode=dout
generic.menu.FlashMode.qout=QOUT
generic.menu.FlashMode.qout.build.flash_mode=qout
-
-generic.menu.UploadSpeed.115200=115200
-generic.menu.UploadSpeed.115200.upload.speed=115200
-generic.menu.UploadSpeed.9600=9600
-generic.menu.UploadSpeed.9600.upload.speed=9600
-generic.menu.UploadSpeed.57600=57600
-generic.menu.UploadSpeed.57600.upload.speed=57600
-generic.menu.UploadSpeed.256000.windows=256000
-generic.menu.UploadSpeed.256000.upload.speed=256000
-generic.menu.UploadSpeed.230400.linux=230400
-generic.menu.UploadSpeed.230400.macosx=230400
-generic.menu.UploadSpeed.230400.upload.speed=230400
-generic.menu.UploadSpeed.460800.linux=460800
-generic.menu.UploadSpeed.460800.macosx=460800
-generic.menu.UploadSpeed.460800.upload.speed=460800
-generic.menu.UploadSpeed.512000.windows=512000
-generic.menu.UploadSpeed.512000.upload.speed=512000
-generic.menu.UploadSpeed.921600=921600
-generic.menu.UploadSpeed.921600.upload.speed=921600
-
+generic.menu.FlashMode.dio=DIO
+generic.menu.FlashMode.dio.build.flash_mode=dio
+generic.menu.FlashMode.dout=DOUT
+generic.menu.FlashMode.dout.build.flash_mode=dout
+generic.menu.FlashSize.512K0=512K (no SPIFFS)
+generic.menu.FlashSize.512K0.build.flash_size=512K
+generic.menu.FlashSize.512K0.build.flash_size_bytes=0x80000
+generic.menu.FlashSize.512K0.build.flash_ld=eagle.flash.512k0.ld
+generic.menu.FlashSize.512K0.build.spiffs_pagesize=256
+generic.menu.FlashSize.512K0.upload.maximum_size=499696
+generic.menu.FlashSize.512K0.build.rfcal_addr=0x7C000
generic.menu.FlashSize.512K64=512K (64K SPIFFS)
generic.menu.FlashSize.512K64.build.flash_size=512K
+generic.menu.FlashSize.512K64.build.flash_size_bytes=0x80000
generic.menu.FlashSize.512K64.build.flash_ld=eagle.flash.512k64.ld
+generic.menu.FlashSize.512K64.build.spiffs_pagesize=256
+generic.menu.FlashSize.512K64.upload.maximum_size=434160
+generic.menu.FlashSize.512K64.build.rfcal_addr=0x7C000
generic.menu.FlashSize.512K64.build.spiffs_start=0x6B000
generic.menu.FlashSize.512K64.build.spiffs_end=0x7B000
generic.menu.FlashSize.512K64.build.spiffs_blocksize=4096
-generic.menu.FlashSize.512K64.upload.maximum_size=434160
-
generic.menu.FlashSize.512K128=512K (128K SPIFFS)
generic.menu.FlashSize.512K128.build.flash_size=512K
+generic.menu.FlashSize.512K128.build.flash_size_bytes=0x80000
generic.menu.FlashSize.512K128.build.flash_ld=eagle.flash.512k128.ld
+generic.menu.FlashSize.512K128.build.spiffs_pagesize=256
+generic.menu.FlashSize.512K128.upload.maximum_size=368624
+generic.menu.FlashSize.512K128.build.rfcal_addr=0x7C000
generic.menu.FlashSize.512K128.build.spiffs_start=0x5B000
generic.menu.FlashSize.512K128.build.spiffs_end=0x7B000
generic.menu.FlashSize.512K128.build.spiffs_blocksize=4096
-generic.menu.FlashSize.512K128.upload.maximum_size=368624
-
-generic.menu.FlashSize.512K0=512K (no SPIFFS)
-generic.menu.FlashSize.512K0.build.flash_size=512K
-generic.menu.FlashSize.512K0.build.flash_ld=eagle.flash.512k0.ld
-generic.menu.FlashSize.512K0.upload.maximum_size=499696
-
-generic.menu.FlashSize.1M512=1M (512K SPIFFS)
-generic.menu.FlashSize.1M512.build.flash_size=1M
-generic.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
-generic.menu.FlashSize.1M512.build.spiffs_start=0x7B000
-generic.menu.FlashSize.1M512.build.spiffs_end=0xFB000
-generic.menu.FlashSize.1M512.build.spiffs_blocksize=8192
-generic.menu.FlashSize.1M512.upload.maximum_size=499696
-
-generic.menu.FlashSize.1M256=1M (256K SPIFFS)
-generic.menu.FlashSize.1M256.build.flash_size=1M
-generic.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
-generic.menu.FlashSize.1M256.build.spiffs_start=0xBB000
-generic.menu.FlashSize.1M256.build.spiffs_end=0xFB000
-generic.menu.FlashSize.1M256.build.spiffs_blocksize=4096
-generic.menu.FlashSize.1M256.upload.maximum_size=761840
-
-generic.menu.FlashSize.1M192=1M (192K SPIFFS)
-generic.menu.FlashSize.1M192.build.flash_size=1M
-generic.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
-generic.menu.FlashSize.1M192.build.spiffs_start=0xCB000
-generic.menu.FlashSize.1M192.build.spiffs_end=0xFB000
-generic.menu.FlashSize.1M192.build.spiffs_blocksize=4096
-generic.menu.FlashSize.1M192.upload.maximum_size=827376
-
-generic.menu.FlashSize.1M160=1M (160K SPIFFS)
-generic.menu.FlashSize.1M160.build.flash_size=1M
-generic.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
-generic.menu.FlashSize.1M160.build.spiffs_start=0xD3000
-generic.menu.FlashSize.1M160.build.spiffs_end=0xFB000
-generic.menu.FlashSize.1M160.build.spiffs_blocksize=4096
-generic.menu.FlashSize.1M160.upload.maximum_size=860144
-
-generic.menu.FlashSize.1M144=1M (144K SPIFFS)
-generic.menu.FlashSize.1M144.build.flash_size=1M
-generic.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
-generic.menu.FlashSize.1M144.build.spiffs_start=0xD7000
-generic.menu.FlashSize.1M144.build.spiffs_end=0xFB000
-generic.menu.FlashSize.1M144.build.spiffs_blocksize=4096
-generic.menu.FlashSize.1M144.upload.maximum_size=876528
-
-generic.menu.FlashSize.1M128=1M (128K SPIFFS)
-generic.menu.FlashSize.1M128.build.flash_size=1M
-generic.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
-generic.menu.FlashSize.1M128.build.spiffs_start=0xDB000
-generic.menu.FlashSize.1M128.build.spiffs_end=0xFB000
-generic.menu.FlashSize.1M128.build.spiffs_blocksize=4096
-generic.menu.FlashSize.1M128.upload.maximum_size=892912
-
+generic.menu.FlashSize.1M0=1M (no SPIFFS)
+generic.menu.FlashSize.1M0.build.flash_size=1M
+generic.menu.FlashSize.1M0.build.flash_size_bytes=0x100000
+generic.menu.FlashSize.1M0.build.flash_ld=eagle.flash.1m0.ld
+generic.menu.FlashSize.1M0.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M0.upload.maximum_size=1023984
+generic.menu.FlashSize.1M0.build.rfcal_addr=0xFC000
generic.menu.FlashSize.1M64=1M (64K SPIFFS)
generic.menu.FlashSize.1M64.build.flash_size=1M
+generic.menu.FlashSize.1M64.build.flash_size_bytes=0x100000
generic.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
+generic.menu.FlashSize.1M64.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M64.upload.maximum_size=958448
+generic.menu.FlashSize.1M64.build.rfcal_addr=0xFC000
generic.menu.FlashSize.1M64.build.spiffs_start=0xEB000
generic.menu.FlashSize.1M64.build.spiffs_end=0xFB000
generic.menu.FlashSize.1M64.build.spiffs_blocksize=4096
-generic.menu.FlashSize.1M64.upload.maximum_size=958448
-
+generic.menu.FlashSize.1M128=1M (128K SPIFFS)
+generic.menu.FlashSize.1M128.build.flash_size=1M
+generic.menu.FlashSize.1M128.build.flash_size_bytes=0x100000
+generic.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
+generic.menu.FlashSize.1M128.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M128.upload.maximum_size=892912
+generic.menu.FlashSize.1M128.build.rfcal_addr=0xFC000
+generic.menu.FlashSize.1M128.build.spiffs_start=0xDB000
+generic.menu.FlashSize.1M128.build.spiffs_end=0xFB000
+generic.menu.FlashSize.1M128.build.spiffs_blocksize=4096
+generic.menu.FlashSize.1M144=1M (144K SPIFFS)
+generic.menu.FlashSize.1M144.build.flash_size=1M
+generic.menu.FlashSize.1M144.build.flash_size_bytes=0x100000
+generic.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
+generic.menu.FlashSize.1M144.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M144.upload.maximum_size=876528
+generic.menu.FlashSize.1M144.build.rfcal_addr=0xFC000
+generic.menu.FlashSize.1M144.build.spiffs_start=0xD7000
+generic.menu.FlashSize.1M144.build.spiffs_end=0xFB000
+generic.menu.FlashSize.1M144.build.spiffs_blocksize=4096
+generic.menu.FlashSize.1M160=1M (160K SPIFFS)
+generic.menu.FlashSize.1M160.build.flash_size=1M
+generic.menu.FlashSize.1M160.build.flash_size_bytes=0x100000
+generic.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
+generic.menu.FlashSize.1M160.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M160.upload.maximum_size=860144
+generic.menu.FlashSize.1M160.build.rfcal_addr=0xFC000
+generic.menu.FlashSize.1M160.build.spiffs_start=0xD3000
+generic.menu.FlashSize.1M160.build.spiffs_end=0xFB000
+generic.menu.FlashSize.1M160.build.spiffs_blocksize=4096
+generic.menu.FlashSize.1M192=1M (192K SPIFFS)
+generic.menu.FlashSize.1M192.build.flash_size=1M
+generic.menu.FlashSize.1M192.build.flash_size_bytes=0x100000
+generic.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
+generic.menu.FlashSize.1M192.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M192.upload.maximum_size=827376
+generic.menu.FlashSize.1M192.build.rfcal_addr=0xFC000
+generic.menu.FlashSize.1M192.build.spiffs_start=0xCB000
+generic.menu.FlashSize.1M192.build.spiffs_end=0xFB000
+generic.menu.FlashSize.1M192.build.spiffs_blocksize=4096
+generic.menu.FlashSize.1M256=1M (256K SPIFFS)
+generic.menu.FlashSize.1M256.build.flash_size=1M
+generic.menu.FlashSize.1M256.build.flash_size_bytes=0x100000
+generic.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
+generic.menu.FlashSize.1M256.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M256.upload.maximum_size=761840
+generic.menu.FlashSize.1M256.build.rfcal_addr=0xFC000
+generic.menu.FlashSize.1M256.build.spiffs_start=0xBB000
+generic.menu.FlashSize.1M256.build.spiffs_end=0xFB000
+generic.menu.FlashSize.1M256.build.spiffs_blocksize=4096
+generic.menu.FlashSize.1M512=1M (512K SPIFFS)
+generic.menu.FlashSize.1M512.build.flash_size=1M
+generic.menu.FlashSize.1M512.build.flash_size_bytes=0x100000
+generic.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
+generic.menu.FlashSize.1M512.build.spiffs_pagesize=256
+generic.menu.FlashSize.1M512.upload.maximum_size=499696
+generic.menu.FlashSize.1M512.build.rfcal_addr=0xFC000
+generic.menu.FlashSize.1M512.build.spiffs_start=0x7B000
+generic.menu.FlashSize.1M512.build.spiffs_end=0xFB000
+generic.menu.FlashSize.1M512.build.spiffs_blocksize=8192
generic.menu.FlashSize.2M=2M (1M SPIFFS)
generic.menu.FlashSize.2M.build.flash_size=2M
+generic.menu.FlashSize.2M.build.flash_size_bytes=0x200000
generic.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld
+generic.menu.FlashSize.2M.build.spiffs_pagesize=256
+generic.menu.FlashSize.2M.upload.maximum_size=1044464
+generic.menu.FlashSize.2M.build.rfcal_addr=0x1FC000
generic.menu.FlashSize.2M.build.spiffs_start=0x100000
generic.menu.FlashSize.2M.build.spiffs_end=0x1FB000
generic.menu.FlashSize.2M.build.spiffs_blocksize=8192
-generic.menu.FlashSize.2M.upload.maximum_size=1044464
-
generic.menu.FlashSize.4M1M=4M (1M SPIFFS)
generic.menu.FlashSize.4M1M.build.flash_size=4M
+generic.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
generic.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+generic.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+generic.menu.FlashSize.4M1M.upload.maximum_size=1044464
+generic.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
generic.menu.FlashSize.4M1M.build.spiffs_start=0x300000
generic.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
generic.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-generic.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-generic.menu.FlashSize.4M1M.upload.maximum_size=1044464
-
+generic.menu.FlashSize.4M2M=4M (2M SPIFFS)
+generic.menu.FlashSize.4M2M.build.flash_size=4M
+generic.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+generic.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+generic.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+generic.menu.FlashSize.4M2M.upload.maximum_size=1044464
+generic.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+generic.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+generic.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+generic.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
generic.menu.FlashSize.4M3M=4M (3M SPIFFS)
generic.menu.FlashSize.4M3M.build.flash_size=4M
+generic.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
generic.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+generic.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+generic.menu.FlashSize.4M3M.upload.maximum_size=1044464
+generic.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
generic.menu.FlashSize.4M3M.build.spiffs_start=0x100000
generic.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
generic.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-generic.menu.FlashSize.4M3M.upload.maximum_size=1044464
-
-generic.menu.ResetMethod.ck=ck
-generic.menu.ResetMethod.ck.upload.resetmethod=ck
-generic.menu.ResetMethod.nodemcu=nodemcu
-generic.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
-
+generic.menu.FlashSize.8M7M=8M (7M SPIFFS)
+generic.menu.FlashSize.8M7M.build.flash_size=8M
+generic.menu.FlashSize.8M7M.build.flash_size_bytes=0x800000
+generic.menu.FlashSize.8M7M.build.flash_ld=eagle.flash.8m.ld
+generic.menu.FlashSize.8M7M.build.spiffs_pagesize=256
+generic.menu.FlashSize.8M7M.upload.maximum_size=1044464
+generic.menu.FlashSize.8M7M.build.rfcal_addr=0x7FC000
+generic.menu.FlashSize.8M7M.build.spiffs_start=0x100000
+generic.menu.FlashSize.8M7M.build.spiffs_end=0x7FB000
+generic.menu.FlashSize.8M7M.build.spiffs_blocksize=8192
+generic.menu.FlashSize.16M15M=16M (15M SPIFFS)
+generic.menu.FlashSize.16M15M.build.flash_size=16M
+generic.menu.FlashSize.16M15M.build.flash_size_bytes=0x1000000
+generic.menu.FlashSize.16M15M.build.flash_ld=eagle.flash.16m.ld
+generic.menu.FlashSize.16M15M.build.spiffs_pagesize=256
+generic.menu.FlashSize.16M15M.upload.maximum_size=1044464
+generic.menu.FlashSize.16M15M.build.rfcal_addr=0xFFC000
+generic.menu.FlashSize.16M15M.build.spiffs_start=0x100000
+generic.menu.FlashSize.16M15M.build.spiffs_end=0xFFB000
+generic.menu.FlashSize.16M15M.build.spiffs_blocksize=8192
+generic.menu.led.2=2
+generic.menu.led.2.build.led=-DLED_BUILTIN=2
+generic.menu.led.0=0
+generic.menu.led.0.build.led=-DLED_BUILTIN=0
+generic.menu.led.1=1
+generic.menu.led.1.build.led=-DLED_BUILTIN=1
+generic.menu.led.3=3
+generic.menu.led.3.build.led=-DLED_BUILTIN=3
+generic.menu.led.4=4
+generic.menu.led.4.build.led=-DLED_BUILTIN=4
+generic.menu.led.5=5
+generic.menu.led.5.build.led=-DLED_BUILTIN=5
+generic.menu.led.6=6
+generic.menu.led.6.build.led=-DLED_BUILTIN=6
+generic.menu.led.7=7
+generic.menu.led.7.build.led=-DLED_BUILTIN=7
+generic.menu.led.8=8
+generic.menu.led.8.build.led=-DLED_BUILTIN=8
+generic.menu.led.9=9
+generic.menu.led.9.build.led=-DLED_BUILTIN=9
+generic.menu.led.10=10
+generic.menu.led.10.build.led=-DLED_BUILTIN=10
+generic.menu.led.11=11
+generic.menu.led.11.build.led=-DLED_BUILTIN=11
+generic.menu.led.12=12
+generic.menu.led.12.build.led=-DLED_BUILTIN=12
+generic.menu.led.13=13
+generic.menu.led.13.build.led=-DLED_BUILTIN=13
+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.LwIPVariant.v2mss536=v2 Lower Memory
+generic.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+generic.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+generic.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+generic.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+generic.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+generic.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+generic.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+generic.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+generic.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+generic.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+generic.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+generic.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+generic.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+generic.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
generic.menu.Debug.Disabled=Disabled
generic.menu.Debug.Disabled.build.debug_port=
generic.menu.Debug.Serial=Serial
generic.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
generic.menu.Debug.Serial1=Serial1
generic.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
-
generic.menu.DebugLevel.None____=None
generic.menu.DebugLevel.None____.build.debug_level=
-generic.menu.DebugLevel.Core____=Core
-generic.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
-generic.menu.DebugLevel.SSL_____=Core + SSL
-generic.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
-generic.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem
-generic.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM
-generic.menu.DebugLevel.WiFic___=Core + WiFi
-generic.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
-generic.menu.DebugLevel.WiFi____=WiFi
-generic.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
-generic.menu.DebugLevel.HTTPClient=HTTPClient
-generic.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
-generic.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
-generic.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
-generic.menu.DebugLevel.HTTPUpdate=HTTPUpdate
-generic.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
-generic.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
-generic.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE
-generic.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater
-generic.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER
-generic.menu.DebugLevel.HTTPServer=HTTPServer
-generic.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
-generic.menu.DebugLevel.UPDATER=Updater
-generic.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
-generic.menu.DebugLevel.OTA_____=OTA
-generic.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
-generic.menu.DebugLevel.OTA2____=OTA + Updater
-generic.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
-generic.menu.DebugLevel.all_____=All
-generic.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM
-
-# disabled because espressif's bootloader refuses to write above 4M
-# generic.menu.FlashSize.8M=8M (7M SPIFFS)
-# generic.menu.FlashSize.8M.build.flash_size=1M
-# generic.menu.FlashSize.8M.build.flash_ld=eagle.flash.8m.ld
-# generic.menu.FlashSize.8M.build.spiffs_start=0x100000
-# generic.menu.FlashSize.8M.build.spiffs_end=0x800000
-# generic.menu.FlashSize.8M.build.spiffs_blocksize=8192
-# generic.menu.FlashSize.16M=16M (15M SPIFFS)
-# generic.menu.FlashSize.16M.build.flash_size=1M
-# generic.menu.FlashSize.16M.build.flash_ld=eagle.flash.16m.ld
-# generic.menu.FlashSize.16M.build.spiffs_start=0x100000
-# generic.menu.FlashSize.16M.build.spiffs_end=0x1000000
-# generic.menu.FlashSize.16M.build.spiffs_blocksize=8192
+generic.menu.DebugLevel.SSL=SSL
+generic.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+generic.menu.DebugLevel.TLS_MEM=TLS_MEM
+generic.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+generic.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+generic.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+generic.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+generic.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+generic.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+generic.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+generic.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+generic.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+generic.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+generic.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+generic.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+generic.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+generic.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+generic.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+generic.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+generic.menu.DebugLevel.CORE=CORE
+generic.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+generic.menu.DebugLevel.WIFI=WIFI
+generic.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+generic.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+generic.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+generic.menu.DebugLevel.UPDATER=UPDATER
+generic.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+generic.menu.DebugLevel.OTA=OTA
+generic.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+generic.menu.DebugLevel.OOM=OOM
+generic.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+generic.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+generic.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+generic.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+generic.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+generic.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+generic.menu.FlashErase.none=Only Sketch
+generic.menu.FlashErase.none.upload.erase_cmd=
+generic.menu.FlashErase.sdk=Sketch + WiFi Settings
+generic.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+generic.menu.FlashErase.all=All Flash Contents
+generic.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+generic.menu.UploadSpeed.115200=115200
+generic.menu.UploadSpeed.115200.upload.speed=115200
+generic.menu.UploadSpeed.9600=9600
+generic.menu.UploadSpeed.9600.upload.speed=9600
+generic.menu.UploadSpeed.57600=57600
+generic.menu.UploadSpeed.57600.upload.speed=57600
+generic.menu.UploadSpeed.230400.linux=230400
+generic.menu.UploadSpeed.230400.macosx=230400
+generic.menu.UploadSpeed.230400.upload.speed=230400
+generic.menu.UploadSpeed.256000.windows=256000
+generic.menu.UploadSpeed.256000.upload.speed=256000
+generic.menu.UploadSpeed.460800.linux=460800
+generic.menu.UploadSpeed.460800.macosx=460800
+generic.menu.UploadSpeed.460800.upload.speed=460800
+generic.menu.UploadSpeed.512000.windows=512000
+generic.menu.UploadSpeed.512000.upload.speed=512000
+generic.menu.UploadSpeed.921600=921600
+generic.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
-# ESP8285 chip has built-in 1MB flash
-
esp8285.name=Generic ESP8285 Module
-
+esp8285.build.board=ESP8266_ESP01
esp8285.upload.tool=esptool
-esp8285.upload.speed=115200
-esp8285.upload.resetmethod=ck
-esp8285.upload.maximum_size=434160
esp8285.upload.maximum_data_size=81920
esp8285.upload.wait_for_upload_port=true
+esp8285.upload.erase_cmd=
esp8285.serial.disableDTR=true
esp8285.serial.disableRTS=true
-
esp8285.build.mcu=esp8266
-esp8285.build.f_cpu=80000000L
-esp8285.build.board=ESP8266_ESP01
esp8285.build.core=esp8266
esp8285.build.variant=generic
-esp8285.build.flash_mode=dout
-esp8285.build.flash_freq=40
esp8285.build.spiffs_pagesize=256
esp8285.build.debug_port=
esp8285.build.debug_level=
-
esp8285.menu.CpuFrequency.80=80 MHz
esp8285.menu.CpuFrequency.80.build.f_cpu=80000000L
esp8285.menu.CpuFrequency.160=160 MHz
esp8285.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+esp8285.menu.VTable.flash=Flash
+esp8285.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+esp8285.menu.VTable.heap=Heap
+esp8285.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+esp8285.menu.VTable.iram=IRAM
+esp8285.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+esp8285.menu.ResetMethod.ck=ck
+esp8285.menu.ResetMethod.ck.upload.resetmethod=ck
+esp8285.menu.ResetMethod.nodemcu=nodemcu
+esp8285.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+esp8285.menu.ResetMethod.none=none
+esp8285.menu.ResetMethod.none.upload.resetmethod=none
+esp8285.menu.ResetMethod.dtrset=dtrset
+esp8285.menu.ResetMethod.dtrset.upload.resetmethod=dtrset
+esp8285.menu.CrystalFreq.26=26 MHz
+esp8285.menu.CrystalFreq.40=40 MHz
+esp8285.menu.CrystalFreq.40.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
+esp8285.build.flash_mode=dout
+esp8285.build.flash_freq=40
+esp8285.menu.FlashSize.1M0=1M (no SPIFFS)
+esp8285.menu.FlashSize.1M0.build.flash_size=1M
+esp8285.menu.FlashSize.1M0.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M0.build.flash_ld=eagle.flash.1m0.ld
+esp8285.menu.FlashSize.1M0.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M0.upload.maximum_size=1023984
+esp8285.menu.FlashSize.1M0.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M64=1M (64K SPIFFS)
+esp8285.menu.FlashSize.1M64.build.flash_size=1M
+esp8285.menu.FlashSize.1M64.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
+esp8285.menu.FlashSize.1M64.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M64.upload.maximum_size=958448
+esp8285.menu.FlashSize.1M64.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M64.build.spiffs_start=0xEB000
+esp8285.menu.FlashSize.1M64.build.spiffs_end=0xFB000
+esp8285.menu.FlashSize.1M64.build.spiffs_blocksize=4096
+esp8285.menu.FlashSize.1M128=1M (128K SPIFFS)
+esp8285.menu.FlashSize.1M128.build.flash_size=1M
+esp8285.menu.FlashSize.1M128.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
+esp8285.menu.FlashSize.1M128.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M128.upload.maximum_size=892912
+esp8285.menu.FlashSize.1M128.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M128.build.spiffs_start=0xDB000
+esp8285.menu.FlashSize.1M128.build.spiffs_end=0xFB000
+esp8285.menu.FlashSize.1M128.build.spiffs_blocksize=4096
+esp8285.menu.FlashSize.1M144=1M (144K SPIFFS)
+esp8285.menu.FlashSize.1M144.build.flash_size=1M
+esp8285.menu.FlashSize.1M144.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
+esp8285.menu.FlashSize.1M144.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M144.upload.maximum_size=876528
+esp8285.menu.FlashSize.1M144.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M144.build.spiffs_start=0xD7000
+esp8285.menu.FlashSize.1M144.build.spiffs_end=0xFB000
+esp8285.menu.FlashSize.1M144.build.spiffs_blocksize=4096
+esp8285.menu.FlashSize.1M160=1M (160K SPIFFS)
+esp8285.menu.FlashSize.1M160.build.flash_size=1M
+esp8285.menu.FlashSize.1M160.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
+esp8285.menu.FlashSize.1M160.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M160.upload.maximum_size=860144
+esp8285.menu.FlashSize.1M160.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M160.build.spiffs_start=0xD3000
+esp8285.menu.FlashSize.1M160.build.spiffs_end=0xFB000
+esp8285.menu.FlashSize.1M160.build.spiffs_blocksize=4096
+esp8285.menu.FlashSize.1M192=1M (192K SPIFFS)
+esp8285.menu.FlashSize.1M192.build.flash_size=1M
+esp8285.menu.FlashSize.1M192.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
+esp8285.menu.FlashSize.1M192.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M192.upload.maximum_size=827376
+esp8285.menu.FlashSize.1M192.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M192.build.spiffs_start=0xCB000
+esp8285.menu.FlashSize.1M192.build.spiffs_end=0xFB000
+esp8285.menu.FlashSize.1M192.build.spiffs_blocksize=4096
+esp8285.menu.FlashSize.1M256=1M (256K SPIFFS)
+esp8285.menu.FlashSize.1M256.build.flash_size=1M
+esp8285.menu.FlashSize.1M256.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
+esp8285.menu.FlashSize.1M256.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M256.upload.maximum_size=761840
+esp8285.menu.FlashSize.1M256.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M256.build.spiffs_start=0xBB000
+esp8285.menu.FlashSize.1M256.build.spiffs_end=0xFB000
+esp8285.menu.FlashSize.1M256.build.spiffs_blocksize=4096
+esp8285.menu.FlashSize.1M512=1M (512K SPIFFS)
+esp8285.menu.FlashSize.1M512.build.flash_size=1M
+esp8285.menu.FlashSize.1M512.build.flash_size_bytes=0x100000
+esp8285.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
+esp8285.menu.FlashSize.1M512.build.spiffs_pagesize=256
+esp8285.menu.FlashSize.1M512.upload.maximum_size=499696
+esp8285.menu.FlashSize.1M512.build.rfcal_addr=0xFC000
+esp8285.menu.FlashSize.1M512.build.spiffs_start=0x7B000
+esp8285.menu.FlashSize.1M512.build.spiffs_end=0xFB000
+esp8285.menu.FlashSize.1M512.build.spiffs_blocksize=8192
+esp8285.menu.led.2=2
+esp8285.menu.led.2.build.led=-DLED_BUILTIN=2
+esp8285.menu.led.0=0
+esp8285.menu.led.0.build.led=-DLED_BUILTIN=0
+esp8285.menu.led.1=1
+esp8285.menu.led.1.build.led=-DLED_BUILTIN=1
+esp8285.menu.led.3=3
+esp8285.menu.led.3.build.led=-DLED_BUILTIN=3
+esp8285.menu.led.4=4
+esp8285.menu.led.4.build.led=-DLED_BUILTIN=4
+esp8285.menu.led.5=5
+esp8285.menu.led.5.build.led=-DLED_BUILTIN=5
+esp8285.menu.led.6=6
+esp8285.menu.led.6.build.led=-DLED_BUILTIN=6
+esp8285.menu.led.7=7
+esp8285.menu.led.7.build.led=-DLED_BUILTIN=7
+esp8285.menu.led.8=8
+esp8285.menu.led.8.build.led=-DLED_BUILTIN=8
+esp8285.menu.led.9=9
+esp8285.menu.led.9.build.led=-DLED_BUILTIN=9
+esp8285.menu.led.10=10
+esp8285.menu.led.10.build.led=-DLED_BUILTIN=10
+esp8285.menu.led.11=11
+esp8285.menu.led.11.build.led=-DLED_BUILTIN=11
+esp8285.menu.led.12=12
+esp8285.menu.led.12.build.led=-DLED_BUILTIN=12
+esp8285.menu.led.13=13
+esp8285.menu.led.13.build.led=-DLED_BUILTIN=13
+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.LwIPVariant.v2mss536=v2 Lower Memory
+esp8285.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+esp8285.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+esp8285.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+esp8285.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+esp8285.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+esp8285.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+esp8285.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+esp8285.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+esp8285.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+esp8285.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+esp8285.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+esp8285.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+esp8285.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+esp8285.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+esp8285.menu.Debug.Disabled=Disabled
+esp8285.menu.Debug.Disabled.build.debug_port=
+esp8285.menu.Debug.Serial=Serial
+esp8285.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+esp8285.menu.Debug.Serial1=Serial1
+esp8285.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+esp8285.menu.DebugLevel.None____=None
+esp8285.menu.DebugLevel.None____.build.debug_level=
+esp8285.menu.DebugLevel.SSL=SSL
+esp8285.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+esp8285.menu.DebugLevel.TLS_MEM=TLS_MEM
+esp8285.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+esp8285.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+esp8285.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+esp8285.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+esp8285.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+esp8285.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+esp8285.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+esp8285.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+esp8285.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+esp8285.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+esp8285.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+esp8285.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+esp8285.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+esp8285.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+esp8285.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+esp8285.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp8285.menu.DebugLevel.CORE=CORE
+esp8285.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+esp8285.menu.DebugLevel.WIFI=WIFI
+esp8285.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+esp8285.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+esp8285.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+esp8285.menu.DebugLevel.UPDATER=UPDATER
+esp8285.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+esp8285.menu.DebugLevel.OTA=OTA
+esp8285.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+esp8285.menu.DebugLevel.OOM=OOM
+esp8285.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+esp8285.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+esp8285.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+esp8285.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+esp8285.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+esp8285.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+esp8285.menu.FlashErase.none=Only Sketch
+esp8285.menu.FlashErase.none.upload.erase_cmd=
+esp8285.menu.FlashErase.sdk=Sketch + WiFi Settings
+esp8285.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+esp8285.menu.FlashErase.all=All Flash Contents
+esp8285.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
esp8285.menu.UploadSpeed.115200=115200
esp8285.menu.UploadSpeed.115200.upload.speed=115200
esp8285.menu.UploadSpeed.9600=9600
esp8285.menu.UploadSpeed.9600.upload.speed=9600
esp8285.menu.UploadSpeed.57600=57600
esp8285.menu.UploadSpeed.57600.upload.speed=57600
-esp8285.menu.UploadSpeed.256000.windows=256000
-esp8285.menu.UploadSpeed.256000.upload.speed=256000
esp8285.menu.UploadSpeed.230400.linux=230400
esp8285.menu.UploadSpeed.230400.macosx=230400
esp8285.menu.UploadSpeed.230400.upload.speed=230400
+esp8285.menu.UploadSpeed.256000.windows=256000
+esp8285.menu.UploadSpeed.256000.upload.speed=256000
esp8285.menu.UploadSpeed.460800.linux=460800
esp8285.menu.UploadSpeed.460800.macosx=460800
esp8285.menu.UploadSpeed.460800.upload.speed=460800
@@ -279,104 +601,160 @@ esp8285.menu.UploadSpeed.512000.upload.speed=512000
esp8285.menu.UploadSpeed.921600=921600
esp8285.menu.UploadSpeed.921600.upload.speed=921600
-esp8285.menu.FlashSize.1M512=1M (512K SPIFFS)
-esp8285.menu.FlashSize.1M512.build.flash_size=1M
-esp8285.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
-esp8285.menu.FlashSize.1M512.build.spiffs_start=0x7B000
-esp8285.menu.FlashSize.1M512.build.spiffs_end=0xFB000
-esp8285.menu.FlashSize.1M512.build.spiffs_blocksize=8192
-esp8285.menu.FlashSize.1M512.upload.maximum_size=499696
-
-esp8285.menu.FlashSize.1M256=1M (256K SPIFFS)
-esp8285.menu.FlashSize.1M256.build.flash_size=1M
-esp8285.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
-esp8285.menu.FlashSize.1M256.build.spiffs_start=0xBB000
-esp8285.menu.FlashSize.1M256.build.spiffs_end=0xFB000
-esp8285.menu.FlashSize.1M256.build.spiffs_blocksize=4096
-esp8285.menu.FlashSize.1M256.upload.maximum_size=761840
-
-esp8285.menu.FlashSize.1M192=1M (192K SPIFFS)
-esp8285.menu.FlashSize.1M192.build.flash_size=1M
-esp8285.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
-esp8285.menu.FlashSize.1M192.build.spiffs_start=0xCB000
-esp8285.menu.FlashSize.1M192.build.spiffs_end=0xFB000
-esp8285.menu.FlashSize.1M192.build.spiffs_blocksize=4096
-esp8285.menu.FlashSize.1M192.upload.maximum_size=827376
-
-esp8285.menu.FlashSize.1M160=1M (160K SPIFFS)
-esp8285.menu.FlashSize.1M160.build.flash_size=1M
-esp8285.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
-esp8285.menu.FlashSize.1M160.build.spiffs_start=0xD3000
-esp8285.menu.FlashSize.1M160.build.spiffs_end=0xFB000
-esp8285.menu.FlashSize.1M160.build.spiffs_blocksize=4096
-esp8285.menu.FlashSize.1M160.upload.maximum_size=860144
-
-esp8285.menu.FlashSize.1M144=1M (144K SPIFFS)
-esp8285.menu.FlashSize.1M144.build.flash_size=1M
-esp8285.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
-esp8285.menu.FlashSize.1M144.build.spiffs_start=0xD7000
-esp8285.menu.FlashSize.1M144.build.spiffs_end=0xFB000
-esp8285.menu.FlashSize.1M144.build.spiffs_blocksize=4096
-esp8285.menu.FlashSize.1M144.upload.maximum_size=876528
-
-esp8285.menu.FlashSize.1M128=1M (128K SPIFFS)
-esp8285.menu.FlashSize.1M128.build.flash_size=1M
-esp8285.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
-esp8285.menu.FlashSize.1M128.build.spiffs_start=0xDB000
-esp8285.menu.FlashSize.1M128.build.spiffs_end=0xFB000
-esp8285.menu.FlashSize.1M128.build.spiffs_blocksize=4096
-esp8285.menu.FlashSize.1M128.upload.maximum_size=892912
-
-esp8285.menu.FlashSize.1M64=1M (64K SPIFFS)
-esp8285.menu.FlashSize.1M64.build.flash_size=1M
-esp8285.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
-esp8285.menu.FlashSize.1M64.build.spiffs_start=0xEB000
-esp8285.menu.FlashSize.1M64.build.spiffs_end=0xFB000
-esp8285.menu.FlashSize.1M64.build.spiffs_blocksize=4096
-esp8285.menu.FlashSize.1M64.upload.maximum_size=958448
-
-
##############################################################
-
espduino.name=ESPDuino (ESP-13 Module)
-
+espduino.build.board=ESP8266_ESP13
+espduino.build.variant=ESPDuino
+espduino.menu.ResetMethod.v2=ESPduino-V2
+espduino.menu.ResetMethod.v2.upload.resetmethod=nodemcu
+espduino.menu.ResetMethod.v1=ESPduino-V1
+espduino.menu.ResetMethod.v1.upload.resetmethod=ck
+espduino.menu.UploadTool.esptool=Serial
+espduino.menu.UploadTool.esptool.upload.tool=esptool
+espduino.menu.UploadTool.esptool.upload.verbose=-vv
+espduino.menu.UploadTool.espota=OTA
+espduino.menu.UploadTool.espota.upload.tool=espota
espduino.upload.tool=esptool
-espduino.upload.speed=115200
-espduino.upload.resetmethod=ck
-espduino.upload.maximum_size=1044464
espduino.upload.maximum_data_size=81920
espduino.upload.wait_for_upload_port=true
+espduino.upload.erase_cmd=
espduino.serial.disableDTR=true
espduino.serial.disableRTS=true
-
espduino.build.mcu=esp8266
-espduino.build.f_cpu=80000000L
-espduino.build.board=ESP8266_ESP13
espduino.build.core=esp8266
-espduino.build.variant=ESPDuino
-espduino.build.flash_mode=dio
-espduino.build.flash_size=4M
-espduino.build.flash_freq=40
+espduino.build.spiffs_pagesize=256
espduino.build.debug_port=
espduino.build.debug_level=
-
espduino.menu.CpuFrequency.80=80 MHz
espduino.menu.CpuFrequency.80.build.f_cpu=80000000L
espduino.menu.CpuFrequency.160=160 MHz
espduino.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+espduino.menu.VTable.flash=Flash
+espduino.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+espduino.menu.VTable.heap=Heap
+espduino.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+espduino.menu.VTable.iram=IRAM
+espduino.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+espduino.build.flash_mode=dio
+espduino.build.flash_freq=40
+espduino.menu.FlashSize.4M1M=4M (1M SPIFFS)
+espduino.menu.FlashSize.4M1M.build.flash_size=4M
+espduino.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+espduino.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+espduino.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+espduino.menu.FlashSize.4M1M.upload.maximum_size=1044464
+espduino.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+espduino.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+espduino.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+espduino.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+espduino.menu.FlashSize.4M2M=4M (2M SPIFFS)
+espduino.menu.FlashSize.4M2M.build.flash_size=4M
+espduino.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+espduino.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+espduino.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+espduino.menu.FlashSize.4M2M.upload.maximum_size=1044464
+espduino.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+espduino.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+espduino.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+espduino.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+espduino.menu.FlashSize.4M3M=4M (3M SPIFFS)
+espduino.menu.FlashSize.4M3M.build.flash_size=4M
+espduino.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+espduino.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+espduino.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+espduino.menu.FlashSize.4M3M.upload.maximum_size=1044464
+espduino.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+espduino.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+espduino.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+espduino.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+espduino.menu.LwIPVariant.v2mss536=v2 Lower Memory
+espduino.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+espduino.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+espduino.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+espduino.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+espduino.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+espduino.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+espduino.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+espduino.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+espduino.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+espduino.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+espduino.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+espduino.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+espduino.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+espduino.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+espduino.menu.Debug.Disabled=Disabled
+espduino.menu.Debug.Disabled.build.debug_port=
+espduino.menu.Debug.Serial=Serial
+espduino.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+espduino.menu.Debug.Serial1=Serial1
+espduino.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+espduino.menu.DebugLevel.None____=None
+espduino.menu.DebugLevel.None____.build.debug_level=
+espduino.menu.DebugLevel.SSL=SSL
+espduino.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+espduino.menu.DebugLevel.TLS_MEM=TLS_MEM
+espduino.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+espduino.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+espduino.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+espduino.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+espduino.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+espduino.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+espduino.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+espduino.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+espduino.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+espduino.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+espduino.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espduino.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+espduino.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+espduino.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+espduino.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espduino.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espduino.menu.DebugLevel.CORE=CORE
+espduino.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+espduino.menu.DebugLevel.WIFI=WIFI
+espduino.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+espduino.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+espduino.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+espduino.menu.DebugLevel.UPDATER=UPDATER
+espduino.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+espduino.menu.DebugLevel.OTA=OTA
+espduino.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+espduino.menu.DebugLevel.OOM=OOM
+espduino.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+espduino.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espduino.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+espduino.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+espduino.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+espduino.menu.FlashErase.none=Only Sketch
+espduino.menu.FlashErase.none.upload.erase_cmd=
+espduino.menu.FlashErase.sdk=Sketch + WiFi Settings
+espduino.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+espduino.menu.FlashErase.all=All Flash Contents
+espduino.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
espduino.menu.UploadSpeed.115200=115200
espduino.menu.UploadSpeed.115200.upload.speed=115200
espduino.menu.UploadSpeed.9600=9600
espduino.menu.UploadSpeed.9600.upload.speed=9600
espduino.menu.UploadSpeed.57600=57600
espduino.menu.UploadSpeed.57600.upload.speed=57600
-espduino.menu.UploadSpeed.256000.windows=256000
-espduino.menu.UploadSpeed.256000.upload.speed=256000
espduino.menu.UploadSpeed.230400.linux=230400
espduino.menu.UploadSpeed.230400.macosx=230400
-espduino.menu.UploadSpeed.230400.macosx=230400
espduino.menu.UploadSpeed.230400.upload.speed=230400
+espduino.menu.UploadSpeed.256000.windows=256000
+espduino.menu.UploadSpeed.256000.upload.speed=256000
espduino.menu.UploadSpeed.460800.linux=460800
espduino.menu.UploadSpeed.460800.macosx=460800
espduino.menu.UploadSpeed.460800.upload.speed=460800
@@ -385,536 +763,934 @@ espduino.menu.UploadSpeed.512000.upload.speed=512000
espduino.menu.UploadSpeed.921600=921600
espduino.menu.UploadSpeed.921600.upload.speed=921600
-espduino.menu.FlashSize.4M3M=4M (3M SPIFFS)
-espduino.menu.FlashSize.4M3M.build.flash_size=4M
-espduino.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-espduino.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-espduino.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-espduino.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-espduino.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-espduino.menu.FlashSize.4M1M=4M (1M SPIFFS)
-espduino.menu.FlashSize.4M1M.build.flash_size=4M
-espduino.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-espduino.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-espduino.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-espduino.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-espduino.menu.FlashSize.4M1M.build.spiffs_pagesize=256
##############################################################
-huzzah.name=Adafruit HUZZAH ESP8266
-
+huzzah.name=Adafruit Feather HUZZAH ESP8266
+huzzah.build.board=ESP8266_ESP12
+huzzah.build.variant=adafruit
huzzah.upload.tool=esptool
-huzzah.upload.speed=115200
-huzzah.upload.resetmethod=nodemcu
-huzzah.upload.maximum_size=1044464
huzzah.upload.maximum_data_size=81920
huzzah.upload.wait_for_upload_port=true
+huzzah.upload.erase_cmd=
huzzah.serial.disableDTR=true
huzzah.serial.disableRTS=true
-
huzzah.build.mcu=esp8266
-huzzah.build.f_cpu=80000000L
-huzzah.build.board=ESP8266_ESP12
huzzah.build.core=esp8266
-huzzah.build.variant=adafruit
-huzzah.build.flash_mode=qio
-huzzah.build.flash_size=4M
-huzzah.build.flash_freq=40
+huzzah.build.spiffs_pagesize=256
huzzah.build.debug_port=
huzzah.build.debug_level=
-
huzzah.menu.CpuFrequency.80=80 MHz
huzzah.menu.CpuFrequency.80.build.f_cpu=80000000L
huzzah.menu.CpuFrequency.160=160 MHz
huzzah.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+huzzah.menu.VTable.flash=Flash
+huzzah.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+huzzah.menu.VTable.heap=Heap
+huzzah.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+huzzah.menu.VTable.iram=IRAM
+huzzah.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+huzzah.upload.resetmethod=nodemcu
+huzzah.build.flash_mode=qio
+huzzah.build.flash_freq=40
+huzzah.menu.FlashSize.4M1M=4M (1M SPIFFS)
+huzzah.menu.FlashSize.4M1M.build.flash_size=4M
+huzzah.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+huzzah.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+huzzah.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+huzzah.menu.FlashSize.4M1M.upload.maximum_size=1044464
+huzzah.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+huzzah.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+huzzah.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+huzzah.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+huzzah.menu.FlashSize.4M2M=4M (2M SPIFFS)
+huzzah.menu.FlashSize.4M2M.build.flash_size=4M
+huzzah.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+huzzah.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+huzzah.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+huzzah.menu.FlashSize.4M2M.upload.maximum_size=1044464
+huzzah.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+huzzah.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+huzzah.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+huzzah.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+huzzah.menu.FlashSize.4M3M=4M (3M SPIFFS)
+huzzah.menu.FlashSize.4M3M.build.flash_size=4M
+huzzah.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+huzzah.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+huzzah.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+huzzah.menu.FlashSize.4M3M.upload.maximum_size=1044464
+huzzah.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+huzzah.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+huzzah.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+huzzah.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+huzzah.menu.LwIPVariant.v2mss536=v2 Lower Memory
+huzzah.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+huzzah.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+huzzah.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+huzzah.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+huzzah.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+huzzah.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+huzzah.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+huzzah.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+huzzah.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+huzzah.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+huzzah.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+huzzah.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+huzzah.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+huzzah.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+huzzah.menu.Debug.Disabled=Disabled
+huzzah.menu.Debug.Disabled.build.debug_port=
+huzzah.menu.Debug.Serial=Serial
+huzzah.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+huzzah.menu.Debug.Serial1=Serial1
+huzzah.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+huzzah.menu.DebugLevel.None____=None
+huzzah.menu.DebugLevel.None____.build.debug_level=
+huzzah.menu.DebugLevel.SSL=SSL
+huzzah.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+huzzah.menu.DebugLevel.TLS_MEM=TLS_MEM
+huzzah.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+huzzah.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+huzzah.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+huzzah.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+huzzah.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+huzzah.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+huzzah.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+huzzah.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+huzzah.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+huzzah.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+huzzah.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+huzzah.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+huzzah.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+huzzah.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+huzzah.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+huzzah.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+huzzah.menu.DebugLevel.CORE=CORE
+huzzah.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+huzzah.menu.DebugLevel.WIFI=WIFI
+huzzah.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+huzzah.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+huzzah.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+huzzah.menu.DebugLevel.UPDATER=UPDATER
+huzzah.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+huzzah.menu.DebugLevel.OTA=OTA
+huzzah.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+huzzah.menu.DebugLevel.OOM=OOM
+huzzah.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+huzzah.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+huzzah.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+huzzah.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+huzzah.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+huzzah.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+huzzah.menu.FlashErase.none=Only Sketch
+huzzah.menu.FlashErase.none.upload.erase_cmd=
+huzzah.menu.FlashErase.sdk=Sketch + WiFi Settings
+huzzah.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+huzzah.menu.FlashErase.all=All Flash Contents
+huzzah.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
huzzah.menu.UploadSpeed.115200=115200
huzzah.menu.UploadSpeed.115200.upload.speed=115200
huzzah.menu.UploadSpeed.9600=9600
huzzah.menu.UploadSpeed.9600.upload.speed=9600
huzzah.menu.UploadSpeed.57600=57600
huzzah.menu.UploadSpeed.57600.upload.speed=57600
-huzzah.menu.UploadSpeed.256000=256000
+huzzah.menu.UploadSpeed.230400.linux=230400
+huzzah.menu.UploadSpeed.230400.macosx=230400
+huzzah.menu.UploadSpeed.230400.upload.speed=230400
+huzzah.menu.UploadSpeed.256000.windows=256000
huzzah.menu.UploadSpeed.256000.upload.speed=256000
+huzzah.menu.UploadSpeed.460800.linux=460800
+huzzah.menu.UploadSpeed.460800.macosx=460800
+huzzah.menu.UploadSpeed.460800.upload.speed=460800
+huzzah.menu.UploadSpeed.512000.windows=512000
+huzzah.menu.UploadSpeed.512000.upload.speed=512000
huzzah.menu.UploadSpeed.921600=921600
huzzah.menu.UploadSpeed.921600.upload.speed=921600
-huzzah.menu.FlashSize.4M3M=4M (3M SPIFFS)
-huzzah.menu.FlashSize.4M3M.build.flash_size=4M
-huzzah.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-huzzah.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-huzzah.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-huzzah.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-huzzah.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-huzzah.menu.FlashSize.4M1M=4M (1M SPIFFS)
-huzzah.menu.FlashSize.4M1M.build.flash_size=4M
-huzzah.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-huzzah.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-huzzah.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-huzzah.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-huzzah.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-
##############################################################
espresso_lite_v1.name=ESPresso Lite 1.0
+espresso_lite_v1.build.board=ESP8266_ESPRESSO_LITE_V1
+espresso_lite_v1.build.variant=espresso_lite_v1
espresso_lite_v1.upload.tool=esptool
-espresso_lite_v1.upload.speed=115200
-espresso_lite_v1.upload.maximum_size=1044464
espresso_lite_v1.upload.maximum_data_size=81920
espresso_lite_v1.upload.wait_for_upload_port=true
-
+espresso_lite_v1.upload.erase_cmd=
+espresso_lite_v1.serial.disableDTR=true
+espresso_lite_v1.serial.disableRTS=true
espresso_lite_v1.build.mcu=esp8266
-espresso_lite_v1.build.f_cpu=80000000L
-espresso_lite_v1.build.board=ESP8266_ESPRESSO_LITE_V1
espresso_lite_v1.build.core=esp8266
-espresso_lite_v1.build.variant=espresso_lite_v1
-espresso_lite_v1.build.flash_mode=dio
-espresso_lite_v1.build.flash_size=4M
-espresso_lite_v1.build.flash_freq=40
-
+espresso_lite_v1.build.spiffs_pagesize=256
+espresso_lite_v1.build.debug_port=
+espresso_lite_v1.build.debug_level=
espresso_lite_v1.menu.CpuFrequency.80=80 MHz
espresso_lite_v1.menu.CpuFrequency.80.build.f_cpu=80000000L
espresso_lite_v1.menu.CpuFrequency.160=160 MHz
espresso_lite_v1.menu.CpuFrequency.160.build.f_cpu=160000000L
-
-espresso_lite_v1.menu.UploadSpeed.115200=115200
-espresso_lite_v1.menu.UploadSpeed.115200.upload.speed=115200
-espresso_lite_v1.menu.UploadSpeed.57600=57600
-espresso_lite_v1.menu.UploadSpeed.57600.upload.speed=57600
-espresso_lite_v1.menu.UploadSpeed.256000.windows=256000
-espresso_lite_v1.menu.UploadSpeed.256000.upload.speed=256000
-espresso_lite_v1.menu.UploadSpeed.230400.linux=230400
-espresso_lite_v1.menu.UploadSpeed.230400.macosx=230400
-espresso_lite_v1.menu.UploadSpeed.230400.macosx=230400
-espresso_lite_v1.menu.UploadSpeed.230400.upload.speed=230400
-espresso_lite_v1.menu.UploadSpeed.460800.linux=460800
-espresso_lite_v1.menu.UploadSpeed.460800.macosx=460800
-espresso_lite_v1.menu.UploadSpeed.460800.upload.speed=460800
-espresso_lite_v1.menu.UploadSpeed.512000.windows=512000
-espresso_lite_v1.menu.UploadSpeed.512000.upload.speed=512000
-espresso_lite_v1.menu.UploadSpeed.921600=921600
-espresso_lite_v1.menu.UploadSpeed.921600.upload.speed=921600
-
-espresso_lite_v1.menu.FlashSize.4M3M=4M (3M SPIFFS)
-espresso_lite_v1.menu.FlashSize.4M3M.build.flash_size=4M
-espresso_lite_v1.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-espresso_lite_v1.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-espresso_lite_v1.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-espresso_lite_v1.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-espresso_lite_v1.menu.FlashSize.4M3M.upload.maximum_size=1044464
-
+espresso_lite_v1.menu.VTable.flash=Flash
+espresso_lite_v1.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+espresso_lite_v1.menu.VTable.heap=Heap
+espresso_lite_v1.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+espresso_lite_v1.menu.VTable.iram=IRAM
+espresso_lite_v1.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+espresso_lite_v1.build.flash_mode=dio
+espresso_lite_v1.build.flash_freq=40
espresso_lite_v1.menu.FlashSize.4M1M=4M (1M SPIFFS)
espresso_lite_v1.menu.FlashSize.4M1M.build.flash_size=4M
+espresso_lite_v1.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
espresso_lite_v1.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+espresso_lite_v1.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+espresso_lite_v1.menu.FlashSize.4M1M.upload.maximum_size=1044464
+espresso_lite_v1.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
espresso_lite_v1.menu.FlashSize.4M1M.build.spiffs_start=0x300000
espresso_lite_v1.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
espresso_lite_v1.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-espresso_lite_v1.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-espresso_lite_v1.menu.FlashSize.4M1M.upload.maximum_size=1044464
-
-espresso_lite_v1.menu.ResetMethod.nodemcu=nodemcu
-espresso_lite_v1.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+espresso_lite_v1.menu.FlashSize.4M2M=4M (2M SPIFFS)
+espresso_lite_v1.menu.FlashSize.4M2M.build.flash_size=4M
+espresso_lite_v1.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+espresso_lite_v1.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+espresso_lite_v1.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+espresso_lite_v1.menu.FlashSize.4M2M.upload.maximum_size=1044464
+espresso_lite_v1.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+espresso_lite_v1.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+espresso_lite_v1.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+espresso_lite_v1.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+espresso_lite_v1.menu.FlashSize.4M3M=4M (3M SPIFFS)
+espresso_lite_v1.menu.FlashSize.4M3M.build.flash_size=4M
+espresso_lite_v1.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+espresso_lite_v1.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+espresso_lite_v1.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+espresso_lite_v1.menu.FlashSize.4M3M.upload.maximum_size=1044464
+espresso_lite_v1.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+espresso_lite_v1.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+espresso_lite_v1.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+espresso_lite_v1.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
espresso_lite_v1.menu.ResetMethod.ck=ck
espresso_lite_v1.menu.ResetMethod.ck.upload.resetmethod=ck
-
+espresso_lite_v1.menu.ResetMethod.nodemcu=nodemcu
+espresso_lite_v1.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+espresso_lite_v1.menu.LwIPVariant.v2mss536=v2 Lower Memory
+espresso_lite_v1.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+espresso_lite_v1.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+espresso_lite_v1.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+espresso_lite_v1.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+espresso_lite_v1.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+espresso_lite_v1.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+espresso_lite_v1.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+espresso_lite_v1.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+espresso_lite_v1.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+espresso_lite_v1.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+espresso_lite_v1.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+espresso_lite_v1.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+espresso_lite_v1.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+espresso_lite_v1.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
espresso_lite_v1.menu.Debug.Disabled=Disabled
espresso_lite_v1.menu.Debug.Disabled.build.debug_port=
espresso_lite_v1.menu.Debug.Serial=Serial
espresso_lite_v1.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
espresso_lite_v1.menu.Debug.Serial1=Serial1
espresso_lite_v1.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
-
espresso_lite_v1.menu.DebugLevel.None____=None
espresso_lite_v1.menu.DebugLevel.None____.build.debug_level=
-espresso_lite_v1.menu.DebugLevel.Core____=Core
-espresso_lite_v1.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
-espresso_lite_v1.menu.DebugLevel.SSL_____=Core + SSL
-espresso_lite_v1.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
-espresso_lite_v1.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem
-espresso_lite_v1.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM
-espresso_lite_v1.menu.DebugLevel.WiFic___=Core + WiFi
-espresso_lite_v1.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
-espresso_lite_v1.menu.DebugLevel.WiFi____=WiFi
-espresso_lite_v1.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
-espresso_lite_v1.menu.DebugLevel.HTTPClient=HTTPClient
-espresso_lite_v1.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
-espresso_lite_v1.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
-espresso_lite_v1.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
-espresso_lite_v1.menu.DebugLevel.HTTPUpdate=HTTPUpdate
-espresso_lite_v1.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
-espresso_lite_v1.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
-espresso_lite_v1.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE
-espresso_lite_v1.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater
-espresso_lite_v1.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER
-espresso_lite_v1.menu.DebugLevel.HTTPServer=HTTPServer
-espresso_lite_v1.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
-espresso_lite_v1.menu.DebugLevel.UPDATER=Updater
-espresso_lite_v1.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
-espresso_lite_v1.menu.DebugLevel.OTA_____=OTA
-espresso_lite_v1.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
-espresso_lite_v1.menu.DebugLevel.OTA2____=OTA + Updater
-espresso_lite_v1.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
-espresso_lite_v1.menu.DebugLevel.all_____=All
-espresso_lite_v1.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM
-
-espresso_lite_v1.build.debug_port=
-espresso_lite_v1.build.debug_level=
+espresso_lite_v1.menu.DebugLevel.SSL=SSL
+espresso_lite_v1.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+espresso_lite_v1.menu.DebugLevel.TLS_MEM=TLS_MEM
+espresso_lite_v1.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+espresso_lite_v1.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+espresso_lite_v1.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v1.menu.DebugLevel.CORE=CORE
+espresso_lite_v1.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+espresso_lite_v1.menu.DebugLevel.WIFI=WIFI
+espresso_lite_v1.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+espresso_lite_v1.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+espresso_lite_v1.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+espresso_lite_v1.menu.DebugLevel.UPDATER=UPDATER
+espresso_lite_v1.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+espresso_lite_v1.menu.DebugLevel.OTA=OTA
+espresso_lite_v1.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+espresso_lite_v1.menu.DebugLevel.OOM=OOM
+espresso_lite_v1.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+espresso_lite_v1.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espresso_lite_v1.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espresso_lite_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+espresso_lite_v1.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+espresso_lite_v1.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+espresso_lite_v1.menu.FlashErase.none=Only Sketch
+espresso_lite_v1.menu.FlashErase.none.upload.erase_cmd=
+espresso_lite_v1.menu.FlashErase.sdk=Sketch + WiFi Settings
+espresso_lite_v1.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+espresso_lite_v1.menu.FlashErase.all=All Flash Contents
+espresso_lite_v1.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+espresso_lite_v1.menu.UploadSpeed.115200=115200
+espresso_lite_v1.menu.UploadSpeed.115200.upload.speed=115200
+espresso_lite_v1.menu.UploadSpeed.9600=9600
+espresso_lite_v1.menu.UploadSpeed.9600.upload.speed=9600
+espresso_lite_v1.menu.UploadSpeed.57600=57600
+espresso_lite_v1.menu.UploadSpeed.57600.upload.speed=57600
+espresso_lite_v1.menu.UploadSpeed.230400.linux=230400
+espresso_lite_v1.menu.UploadSpeed.230400.macosx=230400
+espresso_lite_v1.menu.UploadSpeed.230400.upload.speed=230400
+espresso_lite_v1.menu.UploadSpeed.256000.windows=256000
+espresso_lite_v1.menu.UploadSpeed.256000.upload.speed=256000
+espresso_lite_v1.menu.UploadSpeed.460800.linux=460800
+espresso_lite_v1.menu.UploadSpeed.460800.macosx=460800
+espresso_lite_v1.menu.UploadSpeed.460800.upload.speed=460800
+espresso_lite_v1.menu.UploadSpeed.512000.windows=512000
+espresso_lite_v1.menu.UploadSpeed.512000.upload.speed=512000
+espresso_lite_v1.menu.UploadSpeed.921600=921600
+espresso_lite_v1.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
espresso_lite_v2.name=ESPresso Lite 2.0
+espresso_lite_v2.build.board=ESP8266_ESPRESSO_LITE_V2
+espresso_lite_v2.build.variant=espresso_lite_v2
espresso_lite_v2.upload.tool=esptool
-espresso_lite_v2.upload.speed=115200
-espresso_lite_v2.upload.maximum_size=1044464
espresso_lite_v2.upload.maximum_data_size=81920
espresso_lite_v2.upload.wait_for_upload_port=true
-
+espresso_lite_v2.upload.erase_cmd=
+espresso_lite_v2.serial.disableDTR=true
+espresso_lite_v2.serial.disableRTS=true
espresso_lite_v2.build.mcu=esp8266
-espresso_lite_v2.build.f_cpu=80000000L
-espresso_lite_v2.build.board=ESP8266_ESPRESSO_LITE_V2
espresso_lite_v2.build.core=esp8266
-espresso_lite_v2.build.variant=espresso_lite_v2
-espresso_lite_v2.build.flash_mode=dio
-espresso_lite_v2.build.flash_size=4M
-espresso_lite_v2.build.flash_freq=40
-
+espresso_lite_v2.build.spiffs_pagesize=256
+espresso_lite_v2.build.debug_port=
+espresso_lite_v2.build.debug_level=
espresso_lite_v2.menu.CpuFrequency.80=80 MHz
espresso_lite_v2.menu.CpuFrequency.80.build.f_cpu=80000000L
espresso_lite_v2.menu.CpuFrequency.160=160 MHz
espresso_lite_v2.menu.CpuFrequency.160.build.f_cpu=160000000L
-
-espresso_lite_v2.menu.UploadSpeed.115200=115200
-espresso_lite_v2.menu.UploadSpeed.115200.upload.speed=115200
-espresso_lite_v2.menu.UploadSpeed.57600=57600
-espresso_lite_v2.menu.UploadSpeed.57600.upload.speed=57600
-espresso_lite_v2.menu.UploadSpeed.256000.windows=256000
-espresso_lite_v2.menu.UploadSpeed.256000.upload.speed=256000
-espresso_lite_v2.menu.UploadSpeed.230400.linux=230400
-espresso_lite_v2.menu.UploadSpeed.230400.macosx=230400
-espresso_lite_v2.menu.UploadSpeed.230400.macosx=230400
-espresso_lite_v2.menu.UploadSpeed.230400.upload.speed=230400
-espresso_lite_v2.menu.UploadSpeed.460800.linux=460800
-espresso_lite_v2.menu.UploadSpeed.460800.macosx=460800
-espresso_lite_v2.menu.UploadSpeed.460800.upload.speed=460800
-espresso_lite_v2.menu.UploadSpeed.512000.windows=512000
-espresso_lite_v2.menu.UploadSpeed.512000.upload.speed=512000
-espresso_lite_v2.menu.UploadSpeed.921600=921600
-espresso_lite_v2.menu.UploadSpeed.921600.upload.speed=921600
-
-espresso_lite_v2.menu.FlashSize.4M3M=4M (3M SPIFFS)
-espresso_lite_v2.menu.FlashSize.4M3M.build.flash_size=4M
-espresso_lite_v2.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-espresso_lite_v2.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-espresso_lite_v2.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-espresso_lite_v2.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-espresso_lite_v2.menu.FlashSize.4M3M.upload.maximum_size=1044464
-
+espresso_lite_v2.menu.VTable.flash=Flash
+espresso_lite_v2.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+espresso_lite_v2.menu.VTable.heap=Heap
+espresso_lite_v2.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+espresso_lite_v2.menu.VTable.iram=IRAM
+espresso_lite_v2.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+espresso_lite_v2.build.flash_mode=dio
+espresso_lite_v2.build.flash_freq=40
espresso_lite_v2.menu.FlashSize.4M1M=4M (1M SPIFFS)
espresso_lite_v2.menu.FlashSize.4M1M.build.flash_size=4M
+espresso_lite_v2.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
espresso_lite_v2.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+espresso_lite_v2.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+espresso_lite_v2.menu.FlashSize.4M1M.upload.maximum_size=1044464
+espresso_lite_v2.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
espresso_lite_v2.menu.FlashSize.4M1M.build.spiffs_start=0x300000
espresso_lite_v2.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
espresso_lite_v2.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-espresso_lite_v2.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-espresso_lite_v2.menu.FlashSize.4M1M.upload.maximum_size=1044464
-
+espresso_lite_v2.menu.FlashSize.4M2M=4M (2M SPIFFS)
+espresso_lite_v2.menu.FlashSize.4M2M.build.flash_size=4M
+espresso_lite_v2.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+espresso_lite_v2.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+espresso_lite_v2.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+espresso_lite_v2.menu.FlashSize.4M2M.upload.maximum_size=1044464
+espresso_lite_v2.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+espresso_lite_v2.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+espresso_lite_v2.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+espresso_lite_v2.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+espresso_lite_v2.menu.FlashSize.4M3M=4M (3M SPIFFS)
+espresso_lite_v2.menu.FlashSize.4M3M.build.flash_size=4M
+espresso_lite_v2.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+espresso_lite_v2.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+espresso_lite_v2.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+espresso_lite_v2.menu.FlashSize.4M3M.upload.maximum_size=1044464
+espresso_lite_v2.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+espresso_lite_v2.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+espresso_lite_v2.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+espresso_lite_v2.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
espresso_lite_v2.menu.ResetMethod.ck=ck
espresso_lite_v2.menu.ResetMethod.ck.upload.resetmethod=ck
espresso_lite_v2.menu.ResetMethod.nodemcu=nodemcu
espresso_lite_v2.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
-
+espresso_lite_v2.menu.LwIPVariant.v2mss536=v2 Lower Memory
+espresso_lite_v2.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+espresso_lite_v2.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+espresso_lite_v2.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+espresso_lite_v2.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+espresso_lite_v2.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+espresso_lite_v2.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+espresso_lite_v2.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+espresso_lite_v2.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+espresso_lite_v2.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+espresso_lite_v2.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+espresso_lite_v2.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+espresso_lite_v2.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+espresso_lite_v2.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+espresso_lite_v2.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
espresso_lite_v2.menu.Debug.Disabled=Disabled
espresso_lite_v2.menu.Debug.Disabled.build.debug_port=
espresso_lite_v2.menu.Debug.Serial=Serial
espresso_lite_v2.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
espresso_lite_v2.menu.Debug.Serial1=Serial1
espresso_lite_v2.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
-
espresso_lite_v2.menu.DebugLevel.None____=None
espresso_lite_v2.menu.DebugLevel.None____.build.debug_level=
-espresso_lite_v2.menu.DebugLevel.Core____=Core
-espresso_lite_v2.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
-espresso_lite_v2.menu.DebugLevel.SSL_____=Core + SSL
-espresso_lite_v2.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
-espresso_lite_v2.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem
-espresso_lite_v2.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM
-espresso_lite_v2.menu.DebugLevel.WiFic___=Core + WiFi
-espresso_lite_v2.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
-espresso_lite_v2.menu.DebugLevel.WiFi____=WiFi
-espresso_lite_v2.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
-espresso_lite_v2.menu.DebugLevel.HTTPClient=HTTPClient
-espresso_lite_v2.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
-espresso_lite_v2.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
-espresso_lite_v2.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
-espresso_lite_v2.menu.DebugLevel.HTTPUpdate=HTTPUpdate
-espresso_lite_v2.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
-espresso_lite_v2.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
-espresso_lite_v2.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE
-espresso_lite_v2.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater
-espresso_lite_v2.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER
-espresso_lite_v2.menu.DebugLevel.HTTPServer=HTTPServer
-espresso_lite_v2.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
-espresso_lite_v2.menu.DebugLevel.UPDATER=Updater
-espresso_lite_v2.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
-espresso_lite_v2.menu.DebugLevel.OTA_____=OTA
-espresso_lite_v2.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
-espresso_lite_v2.menu.DebugLevel.OTA2____=OTA + Updater
-espresso_lite_v2.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
-espresso_lite_v2.menu.DebugLevel.all_____=All
-espresso_lite_v2.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM
-
-espresso_lite_v2.build.debug_port=
-espresso_lite_v2.build.debug_level=
+espresso_lite_v2.menu.DebugLevel.SSL=SSL
+espresso_lite_v2.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+espresso_lite_v2.menu.DebugLevel.TLS_MEM=TLS_MEM
+espresso_lite_v2.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+espresso_lite_v2.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+espresso_lite_v2.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espresso_lite_v2.menu.DebugLevel.CORE=CORE
+espresso_lite_v2.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+espresso_lite_v2.menu.DebugLevel.WIFI=WIFI
+espresso_lite_v2.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+espresso_lite_v2.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+espresso_lite_v2.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+espresso_lite_v2.menu.DebugLevel.UPDATER=UPDATER
+espresso_lite_v2.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+espresso_lite_v2.menu.DebugLevel.OTA=OTA
+espresso_lite_v2.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+espresso_lite_v2.menu.DebugLevel.OOM=OOM
+espresso_lite_v2.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+espresso_lite_v2.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espresso_lite_v2.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espresso_lite_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+espresso_lite_v2.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+espresso_lite_v2.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+espresso_lite_v2.menu.FlashErase.none=Only Sketch
+espresso_lite_v2.menu.FlashErase.none.upload.erase_cmd=
+espresso_lite_v2.menu.FlashErase.sdk=Sketch + WiFi Settings
+espresso_lite_v2.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+espresso_lite_v2.menu.FlashErase.all=All Flash Contents
+espresso_lite_v2.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+espresso_lite_v2.menu.UploadSpeed.115200=115200
+espresso_lite_v2.menu.UploadSpeed.115200.upload.speed=115200
+espresso_lite_v2.menu.UploadSpeed.9600=9600
+espresso_lite_v2.menu.UploadSpeed.9600.upload.speed=9600
+espresso_lite_v2.menu.UploadSpeed.57600=57600
+espresso_lite_v2.menu.UploadSpeed.57600.upload.speed=57600
+espresso_lite_v2.menu.UploadSpeed.230400.linux=230400
+espresso_lite_v2.menu.UploadSpeed.230400.macosx=230400
+espresso_lite_v2.menu.UploadSpeed.230400.upload.speed=230400
+espresso_lite_v2.menu.UploadSpeed.256000.windows=256000
+espresso_lite_v2.menu.UploadSpeed.256000.upload.speed=256000
+espresso_lite_v2.menu.UploadSpeed.460800.linux=460800
+espresso_lite_v2.menu.UploadSpeed.460800.macosx=460800
+espresso_lite_v2.menu.UploadSpeed.460800.upload.speed=460800
+espresso_lite_v2.menu.UploadSpeed.512000.windows=512000
+espresso_lite_v2.menu.UploadSpeed.512000.upload.speed=512000
+espresso_lite_v2.menu.UploadSpeed.921600=921600
+espresso_lite_v2.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
phoenix_v1.name=Phoenix 1.0
+phoenix_v1.build.board=ESP8266_PHOENIX_V1
+phoenix_v1.build.variant=phoenix_v1
phoenix_v1.upload.tool=esptool
-phoenix_v1.upload.speed=115200
-phoenix_v1.upload.maximum_size=1044464
phoenix_v1.upload.maximum_data_size=81920
phoenix_v1.upload.wait_for_upload_port=true
-
+phoenix_v1.upload.erase_cmd=
+phoenix_v1.serial.disableDTR=true
+phoenix_v1.serial.disableRTS=true
phoenix_v1.build.mcu=esp8266
-phoenix_v1.build.f_cpu=80000000L
-phoenix_v1.build.board=ESP8266_PHOENIX_V1
phoenix_v1.build.core=esp8266
-phoenix_v1.build.variant=phoenix_v1
-phoenix_v1.build.flash_mode=dio
-phoenix_v1.build.flash_size=4M
-phoenix_v1.build.flash_freq=40
-
+phoenix_v1.build.spiffs_pagesize=256
+phoenix_v1.build.debug_port=
+phoenix_v1.build.debug_level=
phoenix_v1.menu.CpuFrequency.80=80 MHz
phoenix_v1.menu.CpuFrequency.80.build.f_cpu=80000000L
phoenix_v1.menu.CpuFrequency.160=160 MHz
phoenix_v1.menu.CpuFrequency.160.build.f_cpu=160000000L
-
-phoenix_v1.menu.UploadSpeed.115200=115200
-phoenix_v1.menu.UploadSpeed.115200.upload.speed=115200
-phoenix_v1.menu.UploadSpeed.57600=57600
-phoenix_v1.menu.UploadSpeed.57600.upload.speed=57600
-phoenix_v1.menu.UploadSpeed.256000.windows=256000
-phoenix_v1.menu.UploadSpeed.256000.upload.speed=256000
-phoenix_v1.menu.UploadSpeed.230400.linux=230400
-phoenix_v1.menu.UploadSpeed.230400.macosx=230400
-phoenix_v1.menu.UploadSpeed.230400.macosx=230400
-phoenix_v1.menu.UploadSpeed.230400.upload.speed=230400
-phoenix_v1.menu.UploadSpeed.460800.linux=460800
-phoenix_v1.menu.UploadSpeed.460800.macosx=460800
-phoenix_v1.menu.UploadSpeed.460800.upload.speed=460800
-phoenix_v1.menu.UploadSpeed.512000.windows=512000
-phoenix_v1.menu.UploadSpeed.512000.upload.speed=512000
-phoenix_v1.menu.UploadSpeed.921600=921600
-phoenix_v1.menu.UploadSpeed.921600.upload.speed=921600
-
-phoenix_v1.menu.FlashSize.4M3M=4M (3M SPIFFS)
-phoenix_v1.menu.FlashSize.4M3M.build.flash_size=4M
-phoenix_v1.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-phoenix_v1.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-phoenix_v1.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-phoenix_v1.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-phoenix_v1.menu.FlashSize.4M3M.upload.maximum_size=1044464
-
+phoenix_v1.menu.VTable.flash=Flash
+phoenix_v1.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+phoenix_v1.menu.VTable.heap=Heap
+phoenix_v1.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+phoenix_v1.menu.VTable.iram=IRAM
+phoenix_v1.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+phoenix_v1.build.flash_mode=dio
+phoenix_v1.build.flash_freq=40
phoenix_v1.menu.FlashSize.4M1M=4M (1M SPIFFS)
phoenix_v1.menu.FlashSize.4M1M.build.flash_size=4M
+phoenix_v1.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
phoenix_v1.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+phoenix_v1.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+phoenix_v1.menu.FlashSize.4M1M.upload.maximum_size=1044464
+phoenix_v1.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
phoenix_v1.menu.FlashSize.4M1M.build.spiffs_start=0x300000
phoenix_v1.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
phoenix_v1.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-phoenix_v1.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-phoenix_v1.menu.FlashSize.4M1M.upload.maximum_size=1044464
-
-phoenix_v1.menu.ResetMethod.nodemcu=nodemcu
-phoenix_v1.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+phoenix_v1.menu.FlashSize.4M2M=4M (2M SPIFFS)
+phoenix_v1.menu.FlashSize.4M2M.build.flash_size=4M
+phoenix_v1.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+phoenix_v1.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+phoenix_v1.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+phoenix_v1.menu.FlashSize.4M2M.upload.maximum_size=1044464
+phoenix_v1.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+phoenix_v1.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+phoenix_v1.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+phoenix_v1.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+phoenix_v1.menu.FlashSize.4M3M=4M (3M SPIFFS)
+phoenix_v1.menu.FlashSize.4M3M.build.flash_size=4M
+phoenix_v1.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+phoenix_v1.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+phoenix_v1.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+phoenix_v1.menu.FlashSize.4M3M.upload.maximum_size=1044464
+phoenix_v1.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+phoenix_v1.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+phoenix_v1.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+phoenix_v1.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
phoenix_v1.menu.ResetMethod.ck=ck
phoenix_v1.menu.ResetMethod.ck.upload.resetmethod=ck
-
+phoenix_v1.menu.ResetMethod.nodemcu=nodemcu
+phoenix_v1.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+phoenix_v1.menu.LwIPVariant.v2mss536=v2 Lower Memory
+phoenix_v1.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+phoenix_v1.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+phoenix_v1.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+phoenix_v1.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+phoenix_v1.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+phoenix_v1.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+phoenix_v1.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+phoenix_v1.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+phoenix_v1.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+phoenix_v1.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+phoenix_v1.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+phoenix_v1.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+phoenix_v1.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+phoenix_v1.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
phoenix_v1.menu.Debug.Disabled=Disabled
phoenix_v1.menu.Debug.Disabled.build.debug_port=
phoenix_v1.menu.Debug.Serial=Serial
phoenix_v1.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
phoenix_v1.menu.Debug.Serial1=Serial1
phoenix_v1.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
-
phoenix_v1.menu.DebugLevel.None____=None
phoenix_v1.menu.DebugLevel.None____.build.debug_level=
-phoenix_v1.menu.DebugLevel.Core____=Core
-phoenix_v1.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
-phoenix_v1.menu.DebugLevel.SSL_____=Core + SSL
-phoenix_v1.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
-phoenix_v1.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem
-phoenix_v1.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM
-phoenix_v1.menu.DebugLevel.WiFic___=Core + WiFi
-phoenix_v1.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
-phoenix_v1.menu.DebugLevel.WiFi____=WiFi
-phoenix_v1.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
-phoenix_v1.menu.DebugLevel.HTTPClient=HTTPClient
-phoenix_v1.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
-phoenix_v1.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
-phoenix_v1.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
-phoenix_v1.menu.DebugLevel.HTTPUpdate=HTTPUpdate
-phoenix_v1.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
-phoenix_v1.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
-phoenix_v1.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE
-phoenix_v1.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater
-phoenix_v1.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER
-phoenix_v1.menu.DebugLevel.HTTPServer=HTTPServer
-phoenix_v1.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
-phoenix_v1.menu.DebugLevel.UPDATER=Updater
-phoenix_v1.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
-phoenix_v1.menu.DebugLevel.OTA_____=OTA
-phoenix_v1.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
-phoenix_v1.menu.DebugLevel.OTA2____=OTA + Updater
-phoenix_v1.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
-phoenix_v1.menu.DebugLevel.all_____=All
-phoenix_v1.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM
-
-phoenix_v1.build.debug_port=
-phoenix_v1.build.debug_level=
+phoenix_v1.menu.DebugLevel.SSL=SSL
+phoenix_v1.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+phoenix_v1.menu.DebugLevel.TLS_MEM=TLS_MEM
+phoenix_v1.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+phoenix_v1.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+phoenix_v1.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+phoenix_v1.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+phoenix_v1.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+phoenix_v1.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+phoenix_v1.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+phoenix_v1.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v1.menu.DebugLevel.CORE=CORE
+phoenix_v1.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+phoenix_v1.menu.DebugLevel.WIFI=WIFI
+phoenix_v1.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+phoenix_v1.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+phoenix_v1.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+phoenix_v1.menu.DebugLevel.UPDATER=UPDATER
+phoenix_v1.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+phoenix_v1.menu.DebugLevel.OTA=OTA
+phoenix_v1.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+phoenix_v1.menu.DebugLevel.OOM=OOM
+phoenix_v1.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+phoenix_v1.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+phoenix_v1.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+phoenix_v1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+phoenix_v1.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+phoenix_v1.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+phoenix_v1.menu.FlashErase.none=Only Sketch
+phoenix_v1.menu.FlashErase.none.upload.erase_cmd=
+phoenix_v1.menu.FlashErase.sdk=Sketch + WiFi Settings
+phoenix_v1.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+phoenix_v1.menu.FlashErase.all=All Flash Contents
+phoenix_v1.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+phoenix_v1.menu.UploadSpeed.115200=115200
+phoenix_v1.menu.UploadSpeed.115200.upload.speed=115200
+phoenix_v1.menu.UploadSpeed.9600=9600
+phoenix_v1.menu.UploadSpeed.9600.upload.speed=9600
+phoenix_v1.menu.UploadSpeed.57600=57600
+phoenix_v1.menu.UploadSpeed.57600.upload.speed=57600
+phoenix_v1.menu.UploadSpeed.230400.linux=230400
+phoenix_v1.menu.UploadSpeed.230400.macosx=230400
+phoenix_v1.menu.UploadSpeed.230400.upload.speed=230400
+phoenix_v1.menu.UploadSpeed.256000.windows=256000
+phoenix_v1.menu.UploadSpeed.256000.upload.speed=256000
+phoenix_v1.menu.UploadSpeed.460800.linux=460800
+phoenix_v1.menu.UploadSpeed.460800.macosx=460800
+phoenix_v1.menu.UploadSpeed.460800.upload.speed=460800
+phoenix_v1.menu.UploadSpeed.512000.windows=512000
+phoenix_v1.menu.UploadSpeed.512000.upload.speed=512000
+phoenix_v1.menu.UploadSpeed.921600=921600
+phoenix_v1.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
phoenix_v2.name=Phoenix 2.0
+phoenix_v2.build.board=ESP8266_PHOENIX_V2
+phoenix_v2.build.variant=phoenix_v2
phoenix_v2.upload.tool=esptool
-phoenix_v2.upload.speed=115200
-phoenix_v2.upload.maximum_size=1044464
phoenix_v2.upload.maximum_data_size=81920
phoenix_v2.upload.wait_for_upload_port=true
-
+phoenix_v2.upload.erase_cmd=
+phoenix_v2.serial.disableDTR=true
+phoenix_v2.serial.disableRTS=true
phoenix_v2.build.mcu=esp8266
-phoenix_v2.build.f_cpu=80000000L
-phoenix_v2.build.board=ESP8266_PHOENIX_V2
phoenix_v2.build.core=esp8266
-phoenix_v2.build.variant=phoenix_v2
-phoenix_v2.build.flash_mode=dio
-phoenix_v2.build.flash_size=4M
-phoenix_v2.build.flash_freq=40
-
+phoenix_v2.build.spiffs_pagesize=256
+phoenix_v2.build.debug_port=
+phoenix_v2.build.debug_level=
phoenix_v2.menu.CpuFrequency.80=80 MHz
phoenix_v2.menu.CpuFrequency.80.build.f_cpu=80000000L
phoenix_v2.menu.CpuFrequency.160=160 MHz
phoenix_v2.menu.CpuFrequency.160.build.f_cpu=160000000L
-
-phoenix_v2.menu.UploadSpeed.115200=115200
-phoenix_v2.menu.UploadSpeed.115200.upload.speed=115200
-phoenix_v2.menu.UploadSpeed.57600=57600
-phoenix_v2.menu.UploadSpeed.57600.upload.speed=57600
-phoenix_v2.menu.UploadSpeed.256000.windows=256000
-phoenix_v2.menu.UploadSpeed.256000.upload.speed=256000
-phoenix_v2.menu.UploadSpeed.230400.linux=230400
-phoenix_v2.menu.UploadSpeed.230400.macosx=230400
-phoenix_v2.menu.UploadSpeed.230400.macosx=230400
-phoenix_v2.menu.UploadSpeed.230400.upload.speed=230400
-phoenix_v2.menu.UploadSpeed.460800.linux=460800
-phoenix_v2.menu.UploadSpeed.460800.macosx=460800
-phoenix_v2.menu.UploadSpeed.460800.upload.speed=460800
-phoenix_v2.menu.UploadSpeed.512000.windows=512000
-phoenix_v2.menu.UploadSpeed.512000.upload.speed=512000
-phoenix_v2.menu.UploadSpeed.921600=921600
-phoenix_v2.menu.UploadSpeed.921600.upload.speed=921600
-
-phoenix_v2.menu.FlashSize.4M3M=4M (3M SPIFFS)
-phoenix_v2.menu.FlashSize.4M3M.build.flash_size=4M
-phoenix_v2.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-phoenix_v2.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-phoenix_v2.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-phoenix_v2.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-phoenix_v2.menu.FlashSize.4M3M.upload.maximum_size=1044464
-
+phoenix_v2.menu.VTable.flash=Flash
+phoenix_v2.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+phoenix_v2.menu.VTable.heap=Heap
+phoenix_v2.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+phoenix_v2.menu.VTable.iram=IRAM
+phoenix_v2.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+phoenix_v2.build.flash_mode=dio
+phoenix_v2.build.flash_freq=40
phoenix_v2.menu.FlashSize.4M1M=4M (1M SPIFFS)
phoenix_v2.menu.FlashSize.4M1M.build.flash_size=4M
+phoenix_v2.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
phoenix_v2.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+phoenix_v2.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+phoenix_v2.menu.FlashSize.4M1M.upload.maximum_size=1044464
+phoenix_v2.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
phoenix_v2.menu.FlashSize.4M1M.build.spiffs_start=0x300000
phoenix_v2.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
phoenix_v2.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-phoenix_v2.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-phoenix_v2.menu.FlashSize.4M1M.upload.maximum_size=1044464
-
+phoenix_v2.menu.FlashSize.4M2M=4M (2M SPIFFS)
+phoenix_v2.menu.FlashSize.4M2M.build.flash_size=4M
+phoenix_v2.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+phoenix_v2.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+phoenix_v2.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+phoenix_v2.menu.FlashSize.4M2M.upload.maximum_size=1044464
+phoenix_v2.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+phoenix_v2.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+phoenix_v2.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+phoenix_v2.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+phoenix_v2.menu.FlashSize.4M3M=4M (3M SPIFFS)
+phoenix_v2.menu.FlashSize.4M3M.build.flash_size=4M
+phoenix_v2.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+phoenix_v2.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+phoenix_v2.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+phoenix_v2.menu.FlashSize.4M3M.upload.maximum_size=1044464
+phoenix_v2.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+phoenix_v2.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+phoenix_v2.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+phoenix_v2.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
phoenix_v2.menu.ResetMethod.ck=ck
phoenix_v2.menu.ResetMethod.ck.upload.resetmethod=ck
phoenix_v2.menu.ResetMethod.nodemcu=nodemcu
phoenix_v2.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
-
+phoenix_v2.menu.LwIPVariant.v2mss536=v2 Lower Memory
+phoenix_v2.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+phoenix_v2.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+phoenix_v2.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+phoenix_v2.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+phoenix_v2.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+phoenix_v2.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+phoenix_v2.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+phoenix_v2.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+phoenix_v2.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+phoenix_v2.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+phoenix_v2.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+phoenix_v2.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+phoenix_v2.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+phoenix_v2.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
phoenix_v2.menu.Debug.Disabled=Disabled
phoenix_v2.menu.Debug.Disabled.build.debug_port=
phoenix_v2.menu.Debug.Serial=Serial
phoenix_v2.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
phoenix_v2.menu.Debug.Serial1=Serial1
phoenix_v2.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
-
phoenix_v2.menu.DebugLevel.None____=None
phoenix_v2.menu.DebugLevel.None____.build.debug_level=
-phoenix_v2.menu.DebugLevel.Core____=Core
-phoenix_v2.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
-phoenix_v2.menu.DebugLevel.SSL_____=Core + SSL
-phoenix_v2.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
-phoenix_v2.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem
-phoenix_v2.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM
-phoenix_v2.menu.DebugLevel.WiFic___=Core + WiFi
-phoenix_v2.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
-phoenix_v2.menu.DebugLevel.WiFi____=WiFi
-phoenix_v2.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
-phoenix_v2.menu.DebugLevel.HTTPClient=HTTPClient
-phoenix_v2.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
-phoenix_v2.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
-phoenix_v2.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
-phoenix_v2.menu.DebugLevel.HTTPUpdate=HTTPUpdate
-phoenix_v2.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
-phoenix_v2.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
-phoenix_v2.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE
-phoenix_v2.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater
-phoenix_v2.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER
-phoenix_v2.menu.DebugLevel.HTTPServer=HTTPServer
-phoenix_v2.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
-phoenix_v2.menu.DebugLevel.UPDATER=Updater
-phoenix_v2.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
-phoenix_v2.menu.DebugLevel.OTA_____=OTA
-phoenix_v2.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
-phoenix_v2.menu.DebugLevel.OTA2____=OTA + Updater
-phoenix_v2.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
-phoenix_v2.menu.DebugLevel.all_____=All
-phoenix_v2.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM
-
-phoenix_v2.build.debug_port=
-phoenix_v2.build.debug_level=
+phoenix_v2.menu.DebugLevel.SSL=SSL
+phoenix_v2.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+phoenix_v2.menu.DebugLevel.TLS_MEM=TLS_MEM
+phoenix_v2.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+phoenix_v2.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+phoenix_v2.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+phoenix_v2.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+phoenix_v2.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+phoenix_v2.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+phoenix_v2.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+phoenix_v2.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+phoenix_v2.menu.DebugLevel.CORE=CORE
+phoenix_v2.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+phoenix_v2.menu.DebugLevel.WIFI=WIFI
+phoenix_v2.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+phoenix_v2.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+phoenix_v2.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+phoenix_v2.menu.DebugLevel.UPDATER=UPDATER
+phoenix_v2.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+phoenix_v2.menu.DebugLevel.OTA=OTA
+phoenix_v2.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+phoenix_v2.menu.DebugLevel.OOM=OOM
+phoenix_v2.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+phoenix_v2.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+phoenix_v2.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+phoenix_v2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+phoenix_v2.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+phoenix_v2.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+phoenix_v2.menu.FlashErase.none=Only Sketch
+phoenix_v2.menu.FlashErase.none.upload.erase_cmd=
+phoenix_v2.menu.FlashErase.sdk=Sketch + WiFi Settings
+phoenix_v2.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+phoenix_v2.menu.FlashErase.all=All Flash Contents
+phoenix_v2.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+phoenix_v2.menu.UploadSpeed.115200=115200
+phoenix_v2.menu.UploadSpeed.115200.upload.speed=115200
+phoenix_v2.menu.UploadSpeed.9600=9600
+phoenix_v2.menu.UploadSpeed.9600.upload.speed=9600
+phoenix_v2.menu.UploadSpeed.57600=57600
+phoenix_v2.menu.UploadSpeed.57600.upload.speed=57600
+phoenix_v2.menu.UploadSpeed.230400.linux=230400
+phoenix_v2.menu.UploadSpeed.230400.macosx=230400
+phoenix_v2.menu.UploadSpeed.230400.upload.speed=230400
+phoenix_v2.menu.UploadSpeed.256000.windows=256000
+phoenix_v2.menu.UploadSpeed.256000.upload.speed=256000
+phoenix_v2.menu.UploadSpeed.460800.linux=460800
+phoenix_v2.menu.UploadSpeed.460800.macosx=460800
+phoenix_v2.menu.UploadSpeed.460800.upload.speed=460800
+phoenix_v2.menu.UploadSpeed.512000.windows=512000
+phoenix_v2.menu.UploadSpeed.512000.upload.speed=512000
+phoenix_v2.menu.UploadSpeed.921600=921600
+phoenix_v2.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
nodemcu.name=NodeMCU 0.9 (ESP-12 Module)
-
+nodemcu.build.board=ESP8266_NODEMCU
+nodemcu.build.variant=nodemcu
nodemcu.upload.tool=esptool
-nodemcu.upload.speed=115200
-nodemcu.upload.resetmethod=nodemcu
-nodemcu.upload.maximum_size=1044464
nodemcu.upload.maximum_data_size=81920
nodemcu.upload.wait_for_upload_port=true
+nodemcu.upload.erase_cmd=
nodemcu.serial.disableDTR=true
nodemcu.serial.disableRTS=true
-
nodemcu.build.mcu=esp8266
-nodemcu.build.f_cpu=80000000L
-nodemcu.build.board=ESP8266_NODEMCU
nodemcu.build.core=esp8266
-nodemcu.build.variant=nodemcu
-nodemcu.build.flash_mode=qio
-nodemcu.build.flash_size=4M
-nodemcu.build.flash_freq=40
+nodemcu.build.spiffs_pagesize=256
nodemcu.build.debug_port=
nodemcu.build.debug_level=
-
nodemcu.menu.CpuFrequency.80=80 MHz
nodemcu.menu.CpuFrequency.80.build.f_cpu=80000000L
nodemcu.menu.CpuFrequency.160=160 MHz
nodemcu.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+nodemcu.menu.VTable.flash=Flash
+nodemcu.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+nodemcu.menu.VTable.heap=Heap
+nodemcu.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+nodemcu.menu.VTable.iram=IRAM
+nodemcu.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+nodemcu.upload.resetmethod=nodemcu
+nodemcu.build.flash_mode=qio
+nodemcu.build.flash_freq=40
+nodemcu.menu.FlashSize.4M1M=4M (1M SPIFFS)
+nodemcu.menu.FlashSize.4M1M.build.flash_size=4M
+nodemcu.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+nodemcu.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+nodemcu.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+nodemcu.menu.FlashSize.4M1M.upload.maximum_size=1044464
+nodemcu.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+nodemcu.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+nodemcu.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+nodemcu.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+nodemcu.menu.FlashSize.4M2M=4M (2M SPIFFS)
+nodemcu.menu.FlashSize.4M2M.build.flash_size=4M
+nodemcu.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+nodemcu.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+nodemcu.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+nodemcu.menu.FlashSize.4M2M.upload.maximum_size=1044464
+nodemcu.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+nodemcu.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+nodemcu.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+nodemcu.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+nodemcu.menu.FlashSize.4M3M=4M (3M SPIFFS)
+nodemcu.menu.FlashSize.4M3M.build.flash_size=4M
+nodemcu.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+nodemcu.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+nodemcu.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+nodemcu.menu.FlashSize.4M3M.upload.maximum_size=1044464
+nodemcu.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+nodemcu.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+nodemcu.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+nodemcu.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+nodemcu.menu.LwIPVariant.v2mss536=v2 Lower Memory
+nodemcu.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+nodemcu.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+nodemcu.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+nodemcu.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+nodemcu.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+nodemcu.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+nodemcu.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+nodemcu.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+nodemcu.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+nodemcu.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+nodemcu.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+nodemcu.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+nodemcu.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+nodemcu.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+nodemcu.menu.Debug.Disabled=Disabled
+nodemcu.menu.Debug.Disabled.build.debug_port=
+nodemcu.menu.Debug.Serial=Serial
+nodemcu.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+nodemcu.menu.Debug.Serial1=Serial1
+nodemcu.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+nodemcu.menu.DebugLevel.None____=None
+nodemcu.menu.DebugLevel.None____.build.debug_level=
+nodemcu.menu.DebugLevel.SSL=SSL
+nodemcu.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+nodemcu.menu.DebugLevel.TLS_MEM=TLS_MEM
+nodemcu.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+nodemcu.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+nodemcu.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+nodemcu.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+nodemcu.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+nodemcu.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+nodemcu.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+nodemcu.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+nodemcu.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+nodemcu.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+nodemcu.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+nodemcu.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+nodemcu.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+nodemcu.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcu.menu.DebugLevel.CORE=CORE
+nodemcu.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+nodemcu.menu.DebugLevel.WIFI=WIFI
+nodemcu.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+nodemcu.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+nodemcu.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+nodemcu.menu.DebugLevel.UPDATER=UPDATER
+nodemcu.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+nodemcu.menu.DebugLevel.OTA=OTA
+nodemcu.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+nodemcu.menu.DebugLevel.OOM=OOM
+nodemcu.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+nodemcu.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+nodemcu.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+nodemcu.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+nodemcu.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+nodemcu.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+nodemcu.menu.FlashErase.none=Only Sketch
+nodemcu.menu.FlashErase.none.upload.erase_cmd=
+nodemcu.menu.FlashErase.sdk=Sketch + WiFi Settings
+nodemcu.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+nodemcu.menu.FlashErase.all=All Flash Contents
+nodemcu.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
nodemcu.menu.UploadSpeed.115200=115200
nodemcu.menu.UploadSpeed.115200.upload.speed=115200
nodemcu.menu.UploadSpeed.9600=9600
nodemcu.menu.UploadSpeed.9600.upload.speed=9600
nodemcu.menu.UploadSpeed.57600=57600
nodemcu.menu.UploadSpeed.57600.upload.speed=57600
-nodemcu.menu.UploadSpeed.256000.windows=256000
-nodemcu.menu.UploadSpeed.256000.upload.speed=256000
nodemcu.menu.UploadSpeed.230400.linux=230400
nodemcu.menu.UploadSpeed.230400.macosx=230400
-nodemcu.menu.UploadSpeed.230400.macosx=230400
nodemcu.menu.UploadSpeed.230400.upload.speed=230400
+nodemcu.menu.UploadSpeed.256000.windows=256000
+nodemcu.menu.UploadSpeed.256000.upload.speed=256000
nodemcu.menu.UploadSpeed.460800.linux=460800
nodemcu.menu.UploadSpeed.460800.macosx=460800
nodemcu.menu.UploadSpeed.460800.upload.speed=460800
@@ -923,62 +1699,152 @@ nodemcu.menu.UploadSpeed.512000.upload.speed=512000
nodemcu.menu.UploadSpeed.921600=921600
nodemcu.menu.UploadSpeed.921600.upload.speed=921600
-nodemcu.menu.FlashSize.4M3M=4M (3M SPIFFS)
-nodemcu.menu.FlashSize.4M3M.build.flash_size=4M
-nodemcu.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-nodemcu.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-nodemcu.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-nodemcu.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-nodemcu.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-nodemcu.menu.FlashSize.4M1M=4M (1M SPIFFS)
-nodemcu.menu.FlashSize.4M1M.build.flash_size=4M
-nodemcu.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-nodemcu.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-nodemcu.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-nodemcu.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-nodemcu.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-
##############################################################
nodemcuv2.name=NodeMCU 1.0 (ESP-12E Module)
-
+nodemcuv2.build.board=ESP8266_NODEMCU
+nodemcuv2.build.variant=nodemcu
nodemcuv2.upload.tool=esptool
-nodemcuv2.upload.speed=115200
-nodemcuv2.upload.resetmethod=nodemcu
-nodemcuv2.upload.maximum_size=1044464
nodemcuv2.upload.maximum_data_size=81920
nodemcuv2.upload.wait_for_upload_port=true
+nodemcuv2.upload.erase_cmd=
nodemcuv2.serial.disableDTR=true
nodemcuv2.serial.disableRTS=true
-
nodemcuv2.build.mcu=esp8266
-nodemcuv2.build.f_cpu=80000000L
-nodemcuv2.build.board=ESP8266_NODEMCU
nodemcuv2.build.core=esp8266
-nodemcuv2.build.variant=nodemcu
-nodemcuv2.build.flash_mode=dio
-nodemcuv2.build.flash_size=4M
-nodemcuv2.build.flash_freq=40
+nodemcuv2.build.spiffs_pagesize=256
nodemcuv2.build.debug_port=
nodemcuv2.build.debug_level=
-
nodemcuv2.menu.CpuFrequency.80=80 MHz
nodemcuv2.menu.CpuFrequency.80.build.f_cpu=80000000L
nodemcuv2.menu.CpuFrequency.160=160 MHz
nodemcuv2.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+nodemcuv2.menu.VTable.flash=Flash
+nodemcuv2.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+nodemcuv2.menu.VTable.heap=Heap
+nodemcuv2.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+nodemcuv2.menu.VTable.iram=IRAM
+nodemcuv2.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+nodemcuv2.upload.resetmethod=nodemcu
+nodemcuv2.build.flash_mode=dio
+nodemcuv2.build.flash_freq=40
+nodemcuv2.menu.FlashSize.4M1M=4M (1M SPIFFS)
+nodemcuv2.menu.FlashSize.4M1M.build.flash_size=4M
+nodemcuv2.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+nodemcuv2.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+nodemcuv2.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+nodemcuv2.menu.FlashSize.4M1M.upload.maximum_size=1044464
+nodemcuv2.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+nodemcuv2.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+nodemcuv2.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+nodemcuv2.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+nodemcuv2.menu.FlashSize.4M2M=4M (2M SPIFFS)
+nodemcuv2.menu.FlashSize.4M2M.build.flash_size=4M
+nodemcuv2.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+nodemcuv2.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+nodemcuv2.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+nodemcuv2.menu.FlashSize.4M2M.upload.maximum_size=1044464
+nodemcuv2.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+nodemcuv2.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+nodemcuv2.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+nodemcuv2.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+nodemcuv2.menu.FlashSize.4M3M=4M (3M SPIFFS)
+nodemcuv2.menu.FlashSize.4M3M.build.flash_size=4M
+nodemcuv2.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+nodemcuv2.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+nodemcuv2.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+nodemcuv2.menu.FlashSize.4M3M.upload.maximum_size=1044464
+nodemcuv2.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+nodemcuv2.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+nodemcuv2.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+nodemcuv2.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+nodemcuv2.menu.LwIPVariant.v2mss536=v2 Lower Memory
+nodemcuv2.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+nodemcuv2.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+nodemcuv2.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+nodemcuv2.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+nodemcuv2.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+nodemcuv2.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+nodemcuv2.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+nodemcuv2.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+nodemcuv2.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+nodemcuv2.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+nodemcuv2.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+nodemcuv2.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+nodemcuv2.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+nodemcuv2.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+nodemcuv2.menu.Debug.Disabled=Disabled
+nodemcuv2.menu.Debug.Disabled.build.debug_port=
+nodemcuv2.menu.Debug.Serial=Serial
+nodemcuv2.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+nodemcuv2.menu.Debug.Serial1=Serial1
+nodemcuv2.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+nodemcuv2.menu.DebugLevel.None____=None
+nodemcuv2.menu.DebugLevel.None____.build.debug_level=
+nodemcuv2.menu.DebugLevel.SSL=SSL
+nodemcuv2.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+nodemcuv2.menu.DebugLevel.TLS_MEM=TLS_MEM
+nodemcuv2.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+nodemcuv2.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+nodemcuv2.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+nodemcuv2.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+nodemcuv2.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+nodemcuv2.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+nodemcuv2.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+nodemcuv2.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+nodemcuv2.menu.DebugLevel.CORE=CORE
+nodemcuv2.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+nodemcuv2.menu.DebugLevel.WIFI=WIFI
+nodemcuv2.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+nodemcuv2.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+nodemcuv2.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+nodemcuv2.menu.DebugLevel.UPDATER=UPDATER
+nodemcuv2.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+nodemcuv2.menu.DebugLevel.OTA=OTA
+nodemcuv2.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+nodemcuv2.menu.DebugLevel.OOM=OOM
+nodemcuv2.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+nodemcuv2.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+nodemcuv2.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+nodemcuv2.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+nodemcuv2.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+nodemcuv2.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+nodemcuv2.menu.FlashErase.none=Only Sketch
+nodemcuv2.menu.FlashErase.none.upload.erase_cmd=
+nodemcuv2.menu.FlashErase.sdk=Sketch + WiFi Settings
+nodemcuv2.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+nodemcuv2.menu.FlashErase.all=All Flash Contents
+nodemcuv2.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
nodemcuv2.menu.UploadSpeed.115200=115200
nodemcuv2.menu.UploadSpeed.115200.upload.speed=115200
nodemcuv2.menu.UploadSpeed.9600=9600
nodemcuv2.menu.UploadSpeed.9600.upload.speed=9600
nodemcuv2.menu.UploadSpeed.57600=57600
nodemcuv2.menu.UploadSpeed.57600.upload.speed=57600
-nodemcuv2.menu.UploadSpeed.256000.windows=256000
-nodemcuv2.menu.UploadSpeed.256000.upload.speed=256000
nodemcuv2.menu.UploadSpeed.230400.linux=230400
nodemcuv2.menu.UploadSpeed.230400.macosx=230400
-nodemcuv2.menu.UploadSpeed.230400.macosx=230400
nodemcuv2.menu.UploadSpeed.230400.upload.speed=230400
+nodemcuv2.menu.UploadSpeed.256000.windows=256000
+nodemcuv2.menu.UploadSpeed.256000.upload.speed=256000
nodemcuv2.menu.UploadSpeed.460800.linux=460800
nodemcuv2.menu.UploadSpeed.460800.macosx=460800
nodemcuv2.menu.UploadSpeed.460800.upload.speed=460800
@@ -987,69 +1853,132 @@ nodemcuv2.menu.UploadSpeed.512000.upload.speed=512000
nodemcuv2.menu.UploadSpeed.921600=921600
nodemcuv2.menu.UploadSpeed.921600.upload.speed=921600
-nodemcuv2.menu.FlashSize.4M3M=4M (3M SPIFFS)
-nodemcuv2.menu.FlashSize.4M3M.build.flash_size=4M
-nodemcuv2.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-nodemcuv2.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-nodemcuv2.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-nodemcuv2.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-nodemcuv2.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-nodemcuv2.menu.FlashSize.4M1M=4M (1M SPIFFS)
-nodemcuv2.menu.FlashSize.4M1M.build.flash_size=4M
-nodemcuv2.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-nodemcuv2.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-nodemcuv2.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-nodemcuv2.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-nodemcuv2.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-
-
##############################################################
modwifi.name=Olimex MOD-WIFI-ESP8266(-DEV)
-
+modwifi.build.board=MOD_WIFI_ESP8266
+modwifi.build.variant=modwifi
modwifi.upload.tool=esptool
-modwifi.upload.speed=115200
-modwifi.upload.resetmethod=ck
-modwifi.upload.maximum_size=1044464
modwifi.upload.maximum_data_size=81920
modwifi.upload.wait_for_upload_port=true
+modwifi.upload.erase_cmd=
modwifi.serial.disableDTR=true
modwifi.serial.disableRTS=true
-
modwifi.build.mcu=esp8266
-modwifi.build.f_cpu=80000000L
-modwifi.build.board=MOD_WIFI_ESP8266
modwifi.build.core=esp8266
-modwifi.build.variant=generic
-# Winbond W25Q16 flash
-modwifi.build.flash_mode=qio
-modwifi.build.flash_size=2M
-modwifi.build.flash_freq=40
-modwifi.build.flash_ld=eagle.flash.2m.ld
-modwifi.build.spiffs_start=0x100000
-modwifi.build.spiffs_end=0x1FB000
modwifi.build.spiffs_pagesize=256
-modwifi.build.spiffs_blocksize=8192
modwifi.build.debug_port=
modwifi.build.debug_level=
-
modwifi.menu.CpuFrequency.80=80 MHz
modwifi.menu.CpuFrequency.80.build.f_cpu=80000000L
modwifi.menu.CpuFrequency.160=160 MHz
modwifi.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+modwifi.menu.VTable.flash=Flash
+modwifi.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+modwifi.menu.VTable.heap=Heap
+modwifi.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+modwifi.menu.VTable.iram=IRAM
+modwifi.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+modwifi.upload.resetmethod=ck
+modwifi.build.flash_mode=qio
+modwifi.build.flash_freq=40
+modwifi.menu.FlashSize.2M=2M (1M SPIFFS)
+modwifi.menu.FlashSize.2M.build.flash_size=2M
+modwifi.menu.FlashSize.2M.build.flash_size_bytes=0x200000
+modwifi.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld
+modwifi.menu.FlashSize.2M.build.spiffs_pagesize=256
+modwifi.menu.FlashSize.2M.upload.maximum_size=1044464
+modwifi.menu.FlashSize.2M.build.rfcal_addr=0x1FC000
+modwifi.menu.FlashSize.2M.build.spiffs_start=0x100000
+modwifi.menu.FlashSize.2M.build.spiffs_end=0x1FB000
+modwifi.menu.FlashSize.2M.build.spiffs_blocksize=8192
+modwifi.menu.LwIPVariant.v2mss536=v2 Lower Memory
+modwifi.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+modwifi.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+modwifi.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+modwifi.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+modwifi.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+modwifi.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+modwifi.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+modwifi.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+modwifi.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+modwifi.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+modwifi.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+modwifi.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+modwifi.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+modwifi.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+modwifi.menu.Debug.Disabled=Disabled
+modwifi.menu.Debug.Disabled.build.debug_port=
+modwifi.menu.Debug.Serial=Serial
+modwifi.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+modwifi.menu.Debug.Serial1=Serial1
+modwifi.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+modwifi.menu.DebugLevel.None____=None
+modwifi.menu.DebugLevel.None____.build.debug_level=
+modwifi.menu.DebugLevel.SSL=SSL
+modwifi.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+modwifi.menu.DebugLevel.TLS_MEM=TLS_MEM
+modwifi.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+modwifi.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+modwifi.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+modwifi.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+modwifi.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+modwifi.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+modwifi.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+modwifi.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+modwifi.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+modwifi.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+modwifi.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+modwifi.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+modwifi.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+modwifi.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+modwifi.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+modwifi.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+modwifi.menu.DebugLevel.CORE=CORE
+modwifi.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+modwifi.menu.DebugLevel.WIFI=WIFI
+modwifi.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+modwifi.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+modwifi.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+modwifi.menu.DebugLevel.UPDATER=UPDATER
+modwifi.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+modwifi.menu.DebugLevel.OTA=OTA
+modwifi.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+modwifi.menu.DebugLevel.OOM=OOM
+modwifi.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+modwifi.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+modwifi.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+modwifi.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+modwifi.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+modwifi.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+modwifi.menu.FlashErase.none=Only Sketch
+modwifi.menu.FlashErase.none.upload.erase_cmd=
+modwifi.menu.FlashErase.sdk=Sketch + WiFi Settings
+modwifi.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+modwifi.menu.FlashErase.all=All Flash Contents
+modwifi.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
modwifi.menu.UploadSpeed.115200=115200
modwifi.menu.UploadSpeed.115200.upload.speed=115200
modwifi.menu.UploadSpeed.9600=9600
modwifi.menu.UploadSpeed.9600.upload.speed=9600
modwifi.menu.UploadSpeed.57600=57600
modwifi.menu.UploadSpeed.57600.upload.speed=57600
-modwifi.menu.UploadSpeed.256000.windows=256000
-modwifi.menu.UploadSpeed.256000.upload.speed=256000
modwifi.menu.UploadSpeed.230400.linux=230400
modwifi.menu.UploadSpeed.230400.macosx=230400
-modwifi.menu.UploadSpeed.230400.macosx=230400
modwifi.menu.UploadSpeed.230400.upload.speed=230400
+modwifi.menu.UploadSpeed.256000.windows=256000
+modwifi.menu.UploadSpeed.256000.upload.speed=256000
modwifi.menu.UploadSpeed.460800.linux=460800
modwifi.menu.UploadSpeed.460800.macosx=460800
modwifi.menu.UploadSpeed.460800.upload.speed=460800
@@ -1060,49 +1989,147 @@ modwifi.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
thing.name=SparkFun ESP8266 Thing
-
+thing.build.board=ESP8266_THING
+thing.build.variant=thing
thing.upload.tool=esptool
-thing.upload.speed=921600
-thing.upload.resetmethod=ck
-thing.upload.maximum_size=434160
thing.upload.maximum_data_size=81920
thing.upload.wait_for_upload_port=true
+thing.upload.erase_cmd=
thing.serial.disableDTR=true
thing.serial.disableRTS=true
-
thing.build.mcu=esp8266
-thing.build.f_cpu=80000000L
-thing.build.board=ESP8266_THING
thing.build.core=esp8266
-thing.build.variant=thing
-thing.build.flash_mode=qio
-# flash chip: AT25SF041 (512 kbyte, 4Mbit)
-thing.build.flash_size=512K
-thing.build.flash_ld=eagle.flash.512k64.ld
-thing.build.flash_freq=40
-thing.build.spiffs_start=0x6B000
-thing.build.spiffs_end=0x7B000
-thing.build.spiffs_blocksize=4096
thing.build.spiffs_pagesize=256
thing.build.debug_port=
thing.build.debug_level=
-
thing.menu.CpuFrequency.80=80 MHz
thing.menu.CpuFrequency.80.build.f_cpu=80000000L
thing.menu.CpuFrequency.160=160 MHz
thing.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+thing.menu.VTable.flash=Flash
+thing.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+thing.menu.VTable.heap=Heap
+thing.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+thing.menu.VTable.iram=IRAM
+thing.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+thing.upload.resetmethod=ck
+thing.build.flash_mode=qio
+thing.build.flash_freq=40
+thing.menu.FlashSize.512K0=512K (no SPIFFS)
+thing.menu.FlashSize.512K0.build.flash_size=512K
+thing.menu.FlashSize.512K0.build.flash_size_bytes=0x80000
+thing.menu.FlashSize.512K0.build.flash_ld=eagle.flash.512k0.ld
+thing.menu.FlashSize.512K0.build.spiffs_pagesize=256
+thing.menu.FlashSize.512K0.upload.maximum_size=499696
+thing.menu.FlashSize.512K0.build.rfcal_addr=0x7C000
+thing.menu.FlashSize.512K64=512K (64K SPIFFS)
+thing.menu.FlashSize.512K64.build.flash_size=512K
+thing.menu.FlashSize.512K64.build.flash_size_bytes=0x80000
+thing.menu.FlashSize.512K64.build.flash_ld=eagle.flash.512k64.ld
+thing.menu.FlashSize.512K64.build.spiffs_pagesize=256
+thing.menu.FlashSize.512K64.upload.maximum_size=434160
+thing.menu.FlashSize.512K64.build.rfcal_addr=0x7C000
+thing.menu.FlashSize.512K64.build.spiffs_start=0x6B000
+thing.menu.FlashSize.512K64.build.spiffs_end=0x7B000
+thing.menu.FlashSize.512K64.build.spiffs_blocksize=4096
+thing.menu.FlashSize.512K128=512K (128K SPIFFS)
+thing.menu.FlashSize.512K128.build.flash_size=512K
+thing.menu.FlashSize.512K128.build.flash_size_bytes=0x80000
+thing.menu.FlashSize.512K128.build.flash_ld=eagle.flash.512k128.ld
+thing.menu.FlashSize.512K128.build.spiffs_pagesize=256
+thing.menu.FlashSize.512K128.upload.maximum_size=368624
+thing.menu.FlashSize.512K128.build.rfcal_addr=0x7C000
+thing.menu.FlashSize.512K128.build.spiffs_start=0x5B000
+thing.menu.FlashSize.512K128.build.spiffs_end=0x7B000
+thing.menu.FlashSize.512K128.build.spiffs_blocksize=4096
+thing.menu.LwIPVariant.v2mss536=v2 Lower Memory
+thing.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+thing.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+thing.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+thing.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+thing.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+thing.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+thing.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+thing.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+thing.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+thing.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+thing.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+thing.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+thing.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+thing.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+thing.menu.Debug.Disabled=Disabled
+thing.menu.Debug.Disabled.build.debug_port=
+thing.menu.Debug.Serial=Serial
+thing.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+thing.menu.Debug.Serial1=Serial1
+thing.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+thing.menu.DebugLevel.None____=None
+thing.menu.DebugLevel.None____.build.debug_level=
+thing.menu.DebugLevel.SSL=SSL
+thing.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+thing.menu.DebugLevel.TLS_MEM=TLS_MEM
+thing.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+thing.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+thing.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+thing.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+thing.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+thing.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+thing.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+thing.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+thing.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+thing.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+thing.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+thing.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+thing.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+thing.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+thing.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+thing.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thing.menu.DebugLevel.CORE=CORE
+thing.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+thing.menu.DebugLevel.WIFI=WIFI
+thing.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+thing.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+thing.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+thing.menu.DebugLevel.UPDATER=UPDATER
+thing.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+thing.menu.DebugLevel.OTA=OTA
+thing.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+thing.menu.DebugLevel.OOM=OOM
+thing.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+thing.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+thing.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+thing.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+thing.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+thing.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+thing.menu.FlashErase.none=Only Sketch
+thing.menu.FlashErase.none.upload.erase_cmd=
+thing.menu.FlashErase.sdk=Sketch + WiFi Settings
+thing.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+thing.menu.FlashErase.all=All Flash Contents
+thing.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
thing.menu.UploadSpeed.115200=115200
thing.menu.UploadSpeed.115200.upload.speed=115200
thing.menu.UploadSpeed.9600=9600
thing.menu.UploadSpeed.9600.upload.speed=9600
thing.menu.UploadSpeed.57600=57600
thing.menu.UploadSpeed.57600.upload.speed=57600
-thing.menu.UploadSpeed.256000.windows=256000
-thing.menu.UploadSpeed.256000.upload.speed=256000
thing.menu.UploadSpeed.230400.linux=230400
thing.menu.UploadSpeed.230400.macosx=230400
thing.menu.UploadSpeed.230400.upload.speed=230400
+thing.menu.UploadSpeed.256000.windows=256000
+thing.menu.UploadSpeed.256000.upload.speed=256000
thing.menu.UploadSpeed.460800.linux=460800
thing.menu.UploadSpeed.460800.macosx=460800
thing.menu.UploadSpeed.460800.upload.speed=460800
@@ -1113,45 +2140,147 @@ thing.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
thingdev.name=SparkFun ESP8266 Thing Dev
-
+thingdev.build.board=ESP8266_THING_DEV
+thingdev.build.variant=thing
thingdev.upload.tool=esptool
-thingdev.upload.speed=921600
-thingdev.upload.resetmethod=nodemcu
-thingdev.upload.maximum_size=434160
thingdev.upload.maximum_data_size=81920
thingdev.upload.wait_for_upload_port=true
+thingdev.upload.erase_cmd=
thingdev.serial.disableDTR=true
thingdev.serial.disableRTS=true
-
thingdev.build.mcu=esp8266
-thingdev.build.f_cpu=80000000L
-thingdev.build.board=ESP8266_THING_DEV
thingdev.build.core=esp8266
-thingdev.build.variant=thing
-thingdev.build.flash_mode=dio
-# flash chip: AT25SF041 (512 kbyte, 4Mbit)
-thingdev.build.flash_size=512K
-thingdev.build.flash_ld=eagle.flash.512k64.ld
-thingdev.build.flash_freq=40
+thingdev.build.spiffs_pagesize=256
thingdev.build.debug_port=
thingdev.build.debug_level=
-
thingdev.menu.CpuFrequency.80=80 MHz
thingdev.menu.CpuFrequency.80.build.f_cpu=80000000L
thingdev.menu.CpuFrequency.160=160 MHz
thingdev.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+thingdev.menu.VTable.flash=Flash
+thingdev.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+thingdev.menu.VTable.heap=Heap
+thingdev.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+thingdev.menu.VTable.iram=IRAM
+thingdev.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+thingdev.upload.resetmethod=nodemcu
+thingdev.build.flash_mode=dio
+thingdev.build.flash_freq=40
+thingdev.menu.FlashSize.512K0=512K (no SPIFFS)
+thingdev.menu.FlashSize.512K0.build.flash_size=512K
+thingdev.menu.FlashSize.512K0.build.flash_size_bytes=0x80000
+thingdev.menu.FlashSize.512K0.build.flash_ld=eagle.flash.512k0.ld
+thingdev.menu.FlashSize.512K0.build.spiffs_pagesize=256
+thingdev.menu.FlashSize.512K0.upload.maximum_size=499696
+thingdev.menu.FlashSize.512K0.build.rfcal_addr=0x7C000
+thingdev.menu.FlashSize.512K64=512K (64K SPIFFS)
+thingdev.menu.FlashSize.512K64.build.flash_size=512K
+thingdev.menu.FlashSize.512K64.build.flash_size_bytes=0x80000
+thingdev.menu.FlashSize.512K64.build.flash_ld=eagle.flash.512k64.ld
+thingdev.menu.FlashSize.512K64.build.spiffs_pagesize=256
+thingdev.menu.FlashSize.512K64.upload.maximum_size=434160
+thingdev.menu.FlashSize.512K64.build.rfcal_addr=0x7C000
+thingdev.menu.FlashSize.512K64.build.spiffs_start=0x6B000
+thingdev.menu.FlashSize.512K64.build.spiffs_end=0x7B000
+thingdev.menu.FlashSize.512K64.build.spiffs_blocksize=4096
+thingdev.menu.FlashSize.512K128=512K (128K SPIFFS)
+thingdev.menu.FlashSize.512K128.build.flash_size=512K
+thingdev.menu.FlashSize.512K128.build.flash_size_bytes=0x80000
+thingdev.menu.FlashSize.512K128.build.flash_ld=eagle.flash.512k128.ld
+thingdev.menu.FlashSize.512K128.build.spiffs_pagesize=256
+thingdev.menu.FlashSize.512K128.upload.maximum_size=368624
+thingdev.menu.FlashSize.512K128.build.rfcal_addr=0x7C000
+thingdev.menu.FlashSize.512K128.build.spiffs_start=0x5B000
+thingdev.menu.FlashSize.512K128.build.spiffs_end=0x7B000
+thingdev.menu.FlashSize.512K128.build.spiffs_blocksize=4096
+thingdev.menu.LwIPVariant.v2mss536=v2 Lower Memory
+thingdev.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+thingdev.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+thingdev.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+thingdev.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+thingdev.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+thingdev.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+thingdev.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+thingdev.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+thingdev.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+thingdev.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+thingdev.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+thingdev.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+thingdev.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+thingdev.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+thingdev.menu.Debug.Disabled=Disabled
+thingdev.menu.Debug.Disabled.build.debug_port=
+thingdev.menu.Debug.Serial=Serial
+thingdev.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+thingdev.menu.Debug.Serial1=Serial1
+thingdev.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+thingdev.menu.DebugLevel.None____=None
+thingdev.menu.DebugLevel.None____.build.debug_level=
+thingdev.menu.DebugLevel.SSL=SSL
+thingdev.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+thingdev.menu.DebugLevel.TLS_MEM=TLS_MEM
+thingdev.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+thingdev.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+thingdev.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+thingdev.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+thingdev.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+thingdev.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+thingdev.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+thingdev.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+thingdev.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+thingdev.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+thingdev.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+thingdev.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+thingdev.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+thingdev.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+thingdev.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+thingdev.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+thingdev.menu.DebugLevel.CORE=CORE
+thingdev.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+thingdev.menu.DebugLevel.WIFI=WIFI
+thingdev.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+thingdev.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+thingdev.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+thingdev.menu.DebugLevel.UPDATER=UPDATER
+thingdev.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+thingdev.menu.DebugLevel.OTA=OTA
+thingdev.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+thingdev.menu.DebugLevel.OOM=OOM
+thingdev.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+thingdev.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+thingdev.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+thingdev.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+thingdev.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+thingdev.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+thingdev.menu.FlashErase.none=Only Sketch
+thingdev.menu.FlashErase.none.upload.erase_cmd=
+thingdev.menu.FlashErase.sdk=Sketch + WiFi Settings
+thingdev.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+thingdev.menu.FlashErase.all=All Flash Contents
+thingdev.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
thingdev.menu.UploadSpeed.115200=115200
thingdev.menu.UploadSpeed.115200.upload.speed=115200
thingdev.menu.UploadSpeed.9600=9600
thingdev.menu.UploadSpeed.9600.upload.speed=9600
thingdev.menu.UploadSpeed.57600=57600
thingdev.menu.UploadSpeed.57600.upload.speed=57600
-thingdev.menu.UploadSpeed.256000.windows=256000
-thingdev.menu.UploadSpeed.256000.upload.speed=256000
thingdev.menu.UploadSpeed.230400.linux=230400
thingdev.menu.UploadSpeed.230400.macosx=230400
thingdev.menu.UploadSpeed.230400.upload.speed=230400
+thingdev.menu.UploadSpeed.256000.windows=256000
+thingdev.menu.UploadSpeed.256000.upload.speed=256000
thingdev.menu.UploadSpeed.460800.linux=460800
thingdev.menu.UploadSpeed.460800.macosx=460800
thingdev.menu.UploadSpeed.460800.upload.speed=460800
@@ -1162,42 +2291,150 @@ thingdev.menu.UploadSpeed.921600.upload.speed=921600
##############################################################
esp210.name=SweetPea ESP-210
-
+esp210.build.board=ESP8266_ESP210
esp210.upload.tool=esptool
-esp210.upload.speed=115200
-esp210.upload.resetmethod=ck
-esp210.upload.maximum_size=1044464
esp210.upload.maximum_data_size=81920
esp210.upload.wait_for_upload_port=true
+esp210.upload.erase_cmd=
esp210.serial.disableDTR=true
esp210.serial.disableRTS=true
-
esp210.build.mcu=esp8266
-esp210.build.f_cpu=80000000L
-esp210.build.board=ESP8266_ESP210
esp210.build.core=esp8266
esp210.build.variant=generic
-esp210.build.flash_mode=qio
-esp210.build.flash_size=4M
-esp210.build.flash_freq=40
+esp210.build.spiffs_pagesize=256
esp210.build.debug_port=
esp210.build.debug_level=
-
esp210.menu.CpuFrequency.80=80 MHz
esp210.menu.CpuFrequency.80.build.f_cpu=80000000L
esp210.menu.CpuFrequency.160=160 MHz
esp210.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+esp210.menu.VTable.flash=Flash
+esp210.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+esp210.menu.VTable.heap=Heap
+esp210.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+esp210.menu.VTable.iram=IRAM
+esp210.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+esp210.upload.resetmethod=ck
+esp210.build.flash_mode=qio
+esp210.build.flash_freq=40
+esp210.menu.FlashSize.4M1M=4M (1M SPIFFS)
+esp210.menu.FlashSize.4M1M.build.flash_size=4M
+esp210.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+esp210.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+esp210.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+esp210.menu.FlashSize.4M1M.upload.maximum_size=1044464
+esp210.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+esp210.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+esp210.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+esp210.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+esp210.menu.FlashSize.4M2M=4M (2M SPIFFS)
+esp210.menu.FlashSize.4M2M.build.flash_size=4M
+esp210.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+esp210.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+esp210.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+esp210.menu.FlashSize.4M2M.upload.maximum_size=1044464
+esp210.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+esp210.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+esp210.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+esp210.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+esp210.menu.FlashSize.4M3M=4M (3M SPIFFS)
+esp210.menu.FlashSize.4M3M.build.flash_size=4M
+esp210.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+esp210.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+esp210.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+esp210.menu.FlashSize.4M3M.upload.maximum_size=1044464
+esp210.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+esp210.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+esp210.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+esp210.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+esp210.menu.LwIPVariant.v2mss536=v2 Lower Memory
+esp210.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+esp210.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+esp210.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+esp210.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+esp210.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+esp210.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+esp210.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+esp210.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+esp210.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+esp210.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+esp210.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+esp210.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+esp210.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+esp210.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+esp210.menu.Debug.Disabled=Disabled
+esp210.menu.Debug.Disabled.build.debug_port=
+esp210.menu.Debug.Serial=Serial
+esp210.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+esp210.menu.Debug.Serial1=Serial1
+esp210.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+esp210.menu.DebugLevel.None____=None
+esp210.menu.DebugLevel.None____.build.debug_level=
+esp210.menu.DebugLevel.SSL=SSL
+esp210.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+esp210.menu.DebugLevel.TLS_MEM=TLS_MEM
+esp210.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+esp210.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+esp210.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+esp210.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+esp210.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+esp210.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+esp210.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+esp210.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+esp210.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+esp210.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+esp210.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+esp210.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+esp210.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+esp210.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+esp210.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+esp210.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+esp210.menu.DebugLevel.CORE=CORE
+esp210.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+esp210.menu.DebugLevel.WIFI=WIFI
+esp210.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+esp210.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+esp210.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+esp210.menu.DebugLevel.UPDATER=UPDATER
+esp210.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+esp210.menu.DebugLevel.OTA=OTA
+esp210.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+esp210.menu.DebugLevel.OOM=OOM
+esp210.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+esp210.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+esp210.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+esp210.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+esp210.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+esp210.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+esp210.menu.FlashErase.none=Only Sketch
+esp210.menu.FlashErase.none.upload.erase_cmd=
+esp210.menu.FlashErase.sdk=Sketch + WiFi Settings
+esp210.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+esp210.menu.FlashErase.all=All Flash Contents
+esp210.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
esp210.menu.UploadSpeed.57600=57600
esp210.menu.UploadSpeed.57600.upload.speed=57600
+esp210.menu.UploadSpeed.9600=9600
+esp210.menu.UploadSpeed.9600.upload.speed=9600
esp210.menu.UploadSpeed.115200=115200
esp210.menu.UploadSpeed.115200.upload.speed=115200
-esp210.menu.UploadSpeed.256000.windows=256000
-esp210.menu.UploadSpeed.256000.upload.speed=256000
esp210.menu.UploadSpeed.230400.linux=230400
esp210.menu.UploadSpeed.230400.macosx=230400
-esp210.menu.UploadSpeed.230400.macosx=230400
esp210.menu.UploadSpeed.230400.upload.speed=230400
+esp210.menu.UploadSpeed.256000.windows=256000
+esp210.menu.UploadSpeed.256000.upload.speed=256000
esp210.menu.UploadSpeed.460800.linux=460800
esp210.menu.UploadSpeed.460800.macosx=460800
esp210.menu.UploadSpeed.460800.upload.speed=460800
@@ -1206,228 +2443,798 @@ esp210.menu.UploadSpeed.512000.upload.speed=512000
esp210.menu.UploadSpeed.921600=921600
esp210.menu.UploadSpeed.921600.upload.speed=921600
-esp210.menu.FlashSize.4M3M=4M (3M SPIFFS)
-esp210.menu.FlashSize.4M3M.build.flash_size=4M
-esp210.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-esp210.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-esp210.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-esp210.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-esp210.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-esp210.menu.FlashSize.4M1M=4M (1M SPIFFS)
-esp210.menu.FlashSize.4M1M.build.flash_size=4M
-esp210.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-esp210.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-esp210.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-esp210.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-esp210.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-
-##############################################################
-# wifio.name=Wifio
-#
-# wifio.upload.tool=esptool
-# wifio.upload.speed=115200
-# wifio.upload.resetmethod=wifio
-# wifio.upload.maximum_size=524288
-# wifio.upload.wait_for_upload_port=true
-#
-# wifio.build.mcu=esp8266
-# wifio.build.f_cpu=80000000L
-# wifio.build.board=ESP8266_WIFIO
-# wifio.build.core=esp8266
-# wifio.build.variant=wifio
-# wifio.build.flash_mode=qio
-# wifio.build.flash_size=512K
-# wifio.build.flash_freq=40
-# wifio.build.flash_ld=eagle.flash.512k64.ld
-# wifio.build.spiffs_start=0x6B000
-# wifio.build.spiffs_end=0x7B000
-#
-# wifio.menu.CpuFrequency.80=80MHz
-# wifio.menu.CpuFrequency.80.build.f_cpu=80000000L
-# wifio.menu.CpuFrequency.160=160MHz
-# wifio.menu.CpuFrequency.160.build.f_cpu=160000000L
-#
-# wifio.upload.tool=esptool
-#
-
##############################################################
d1_mini.name=WeMos D1 R2 & mini
-
+d1_mini.build.board=ESP8266_WEMOS_D1MINI
+d1_mini.build.variant=d1_mini
d1_mini.upload.tool=esptool
-d1_mini.upload.speed=460800
-d1_mini.upload.resetmethod=nodemcu
-d1_mini.upload.maximum_size=1044464
d1_mini.upload.maximum_data_size=81920
d1_mini.upload.wait_for_upload_port=true
+d1_mini.upload.erase_cmd=
d1_mini.serial.disableDTR=true
d1_mini.serial.disableRTS=true
-
d1_mini.build.mcu=esp8266
-d1_mini.build.f_cpu=80000000L
-d1_mini.build.board=ESP8266_WEMOS_D1MINI
d1_mini.build.core=esp8266
-d1_mini.build.variant=d1_mini
-d1_mini.build.flash_mode=dio
-d1_mini.build.flash_size=4M
-d1_mini.build.flash_freq=40
+d1_mini.build.spiffs_pagesize=256
d1_mini.build.debug_port=
d1_mini.build.debug_level=
-
d1_mini.menu.CpuFrequency.80=80 MHz
d1_mini.menu.CpuFrequency.80.build.f_cpu=80000000L
d1_mini.menu.CpuFrequency.160=160 MHz
d1_mini.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+d1_mini.menu.VTable.flash=Flash
+d1_mini.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+d1_mini.menu.VTable.heap=Heap
+d1_mini.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+d1_mini.menu.VTable.iram=IRAM
+d1_mini.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+d1_mini.upload.resetmethod=nodemcu
+d1_mini.build.flash_mode=dio
+d1_mini.build.flash_freq=40
+d1_mini.menu.FlashSize.4M1M=4M (1M SPIFFS)
+d1_mini.menu.FlashSize.4M1M.build.flash_size=4M
+d1_mini.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+d1_mini.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+d1_mini.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+d1_mini.menu.FlashSize.4M1M.upload.maximum_size=1044464
+d1_mini.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+d1_mini.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+d1_mini.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+d1_mini.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+d1_mini.menu.FlashSize.4M2M=4M (2M SPIFFS)
+d1_mini.menu.FlashSize.4M2M.build.flash_size=4M
+d1_mini.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+d1_mini.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+d1_mini.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+d1_mini.menu.FlashSize.4M2M.upload.maximum_size=1044464
+d1_mini.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+d1_mini.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+d1_mini.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+d1_mini.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+d1_mini.menu.FlashSize.4M3M=4M (3M SPIFFS)
+d1_mini.menu.FlashSize.4M3M.build.flash_size=4M
+d1_mini.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+d1_mini.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+d1_mini.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+d1_mini.menu.FlashSize.4M3M.upload.maximum_size=1044464
+d1_mini.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+d1_mini.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+d1_mini.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+d1_mini.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+d1_mini.menu.LwIPVariant.v2mss536=v2 Lower Memory
+d1_mini.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+d1_mini.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+d1_mini.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+d1_mini.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+d1_mini.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+d1_mini.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+d1_mini.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+d1_mini.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+d1_mini.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+d1_mini.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+d1_mini.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+d1_mini.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+d1_mini.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+d1_mini.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+d1_mini.menu.Debug.Disabled=Disabled
+d1_mini.menu.Debug.Disabled.build.debug_port=
+d1_mini.menu.Debug.Serial=Serial
+d1_mini.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+d1_mini.menu.Debug.Serial1=Serial1
+d1_mini.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+d1_mini.menu.DebugLevel.None____=None
+d1_mini.menu.DebugLevel.None____.build.debug_level=
+d1_mini.menu.DebugLevel.SSL=SSL
+d1_mini.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+d1_mini.menu.DebugLevel.TLS_MEM=TLS_MEM
+d1_mini.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+d1_mini.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+d1_mini.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+d1_mini.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+d1_mini.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+d1_mini.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+d1_mini.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+d1_mini.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+d1_mini.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+d1_mini.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1_mini.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+d1_mini.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+d1_mini.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1_mini.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini.menu.DebugLevel.CORE=CORE
+d1_mini.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+d1_mini.menu.DebugLevel.WIFI=WIFI
+d1_mini.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+d1_mini.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+d1_mini.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+d1_mini.menu.DebugLevel.UPDATER=UPDATER
+d1_mini.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+d1_mini.menu.DebugLevel.OTA=OTA
+d1_mini.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+d1_mini.menu.DebugLevel.OOM=OOM
+d1_mini.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+d1_mini.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1_mini.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1_mini.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+d1_mini.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+d1_mini.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+d1_mini.menu.FlashErase.none=Only Sketch
+d1_mini.menu.FlashErase.none.upload.erase_cmd=
+d1_mini.menu.FlashErase.sdk=Sketch + WiFi Settings
+d1_mini.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+d1_mini.menu.FlashErase.all=All Flash Contents
+d1_mini.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
d1_mini.menu.UploadSpeed.921600=921600
d1_mini.menu.UploadSpeed.921600.upload.speed=921600
-d1_mini.menu.UploadSpeed.115200=115200
-d1_mini.menu.UploadSpeed.115200.upload.speed=115200
d1_mini.menu.UploadSpeed.9600=9600
d1_mini.menu.UploadSpeed.9600.upload.speed=9600
d1_mini.menu.UploadSpeed.57600=57600
d1_mini.menu.UploadSpeed.57600.upload.speed=57600
-d1_mini.menu.UploadSpeed.256000.windows=256000
-d1_mini.menu.UploadSpeed.256000.upload.speed=256000
+d1_mini.menu.UploadSpeed.115200=115200
+d1_mini.menu.UploadSpeed.115200.upload.speed=115200
d1_mini.menu.UploadSpeed.230400.linux=230400
d1_mini.menu.UploadSpeed.230400.macosx=230400
-d1_mini.menu.UploadSpeed.230400.macosx=230400
d1_mini.menu.UploadSpeed.230400.upload.speed=230400
+d1_mini.menu.UploadSpeed.256000.windows=256000
+d1_mini.menu.UploadSpeed.256000.upload.speed=256000
d1_mini.menu.UploadSpeed.460800.linux=460800
d1_mini.menu.UploadSpeed.460800.macosx=460800
d1_mini.menu.UploadSpeed.460800.upload.speed=460800
d1_mini.menu.UploadSpeed.512000.windows=512000
d1_mini.menu.UploadSpeed.512000.upload.speed=512000
-
-d1_mini.menu.FlashSize.4M3M=4M (3M SPIFFS)
-d1_mini.menu.FlashSize.4M3M.build.flash_size=4M
-d1_mini.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-d1_mini.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-d1_mini.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-d1_mini.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-d1_mini.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-d1_mini.menu.FlashSize.4M1M=4M (1M SPIFFS)
-d1_mini.menu.FlashSize.4M1M.build.flash_size=4M
-d1_mini.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-d1_mini.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-d1_mini.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-d1_mini.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-d1_mini.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+##############################################################
+d1_mini_pro.name=WeMos D1 mini Pro
+d1_mini_pro.build.board=ESP8266_WEMOS_D1MINIPRO
+d1_mini_pro.build.variant=d1_mini
+d1_mini_pro.upload.tool=esptool
+d1_mini_pro.upload.maximum_data_size=81920
+d1_mini_pro.upload.wait_for_upload_port=true
+d1_mini_pro.upload.erase_cmd=
+d1_mini_pro.serial.disableDTR=true
+d1_mini_pro.serial.disableRTS=true
+d1_mini_pro.build.mcu=esp8266
+d1_mini_pro.build.core=esp8266
+d1_mini_pro.build.spiffs_pagesize=256
+d1_mini_pro.build.debug_port=
+d1_mini_pro.build.debug_level=
+d1_mini_pro.menu.CpuFrequency.80=80 MHz
+d1_mini_pro.menu.CpuFrequency.80.build.f_cpu=80000000L
+d1_mini_pro.menu.CpuFrequency.160=160 MHz
+d1_mini_pro.menu.CpuFrequency.160.build.f_cpu=160000000L
+d1_mini_pro.menu.VTable.flash=Flash
+d1_mini_pro.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+d1_mini_pro.menu.VTable.heap=Heap
+d1_mini_pro.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+d1_mini_pro.menu.VTable.iram=IRAM
+d1_mini_pro.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+d1_mini_pro.upload.resetmethod=nodemcu
+d1_mini_pro.build.flash_mode=dio
+d1_mini_pro.build.flash_freq=40
+d1_mini_pro.menu.FlashSize.16M15M=16M (15M SPIFFS)
+d1_mini_pro.menu.FlashSize.16M15M.build.flash_size=16M
+d1_mini_pro.menu.FlashSize.16M15M.build.flash_size_bytes=0x1000000
+d1_mini_pro.menu.FlashSize.16M15M.build.flash_ld=eagle.flash.16m.ld
+d1_mini_pro.menu.FlashSize.16M15M.build.spiffs_pagesize=256
+d1_mini_pro.menu.FlashSize.16M15M.upload.maximum_size=1044464
+d1_mini_pro.menu.FlashSize.16M15M.build.rfcal_addr=0xFFC000
+d1_mini_pro.menu.FlashSize.16M15M.build.spiffs_start=0x100000
+d1_mini_pro.menu.FlashSize.16M15M.build.spiffs_end=0xFFB000
+d1_mini_pro.menu.FlashSize.16M15M.build.spiffs_blocksize=8192
+d1_mini_pro.menu.LwIPVariant.v2mss536=v2 Lower Memory
+d1_mini_pro.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+d1_mini_pro.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+d1_mini_pro.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+d1_mini_pro.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+d1_mini_pro.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+d1_mini_pro.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+d1_mini_pro.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+d1_mini_pro.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+d1_mini_pro.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+d1_mini_pro.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+d1_mini_pro.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+d1_mini_pro.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+d1_mini_pro.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+d1_mini_pro.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+d1_mini_pro.menu.Debug.Disabled=Disabled
+d1_mini_pro.menu.Debug.Disabled.build.debug_port=
+d1_mini_pro.menu.Debug.Serial=Serial
+d1_mini_pro.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+d1_mini_pro.menu.Debug.Serial1=Serial1
+d1_mini_pro.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+d1_mini_pro.menu.DebugLevel.None____=None
+d1_mini_pro.menu.DebugLevel.None____.build.debug_level=
+d1_mini_pro.menu.DebugLevel.SSL=SSL
+d1_mini_pro.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+d1_mini_pro.menu.DebugLevel.TLS_MEM=TLS_MEM
+d1_mini_pro.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+d1_mini_pro.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+d1_mini_pro.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_pro.menu.DebugLevel.CORE=CORE
+d1_mini_pro.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+d1_mini_pro.menu.DebugLevel.WIFI=WIFI
+d1_mini_pro.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+d1_mini_pro.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+d1_mini_pro.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+d1_mini_pro.menu.DebugLevel.UPDATER=UPDATER
+d1_mini_pro.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+d1_mini_pro.menu.DebugLevel.OTA=OTA
+d1_mini_pro.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+d1_mini_pro.menu.DebugLevel.OOM=OOM
+d1_mini_pro.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+d1_mini_pro.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1_mini_pro.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1_mini_pro.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+d1_mini_pro.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+d1_mini_pro.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+d1_mini_pro.menu.FlashErase.none=Only Sketch
+d1_mini_pro.menu.FlashErase.none.upload.erase_cmd=
+d1_mini_pro.menu.FlashErase.sdk=Sketch + WiFi Settings
+d1_mini_pro.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+d1_mini_pro.menu.FlashErase.all=All Flash Contents
+d1_mini_pro.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+d1_mini_pro.menu.UploadSpeed.921600=921600
+d1_mini_pro.menu.UploadSpeed.921600.upload.speed=921600
+d1_mini_pro.menu.UploadSpeed.9600=9600
+d1_mini_pro.menu.UploadSpeed.9600.upload.speed=9600
+d1_mini_pro.menu.UploadSpeed.57600=57600
+d1_mini_pro.menu.UploadSpeed.57600.upload.speed=57600
+d1_mini_pro.menu.UploadSpeed.115200=115200
+d1_mini_pro.menu.UploadSpeed.115200.upload.speed=115200
+d1_mini_pro.menu.UploadSpeed.230400.linux=230400
+d1_mini_pro.menu.UploadSpeed.230400.macosx=230400
+d1_mini_pro.menu.UploadSpeed.230400.upload.speed=230400
+d1_mini_pro.menu.UploadSpeed.256000.windows=256000
+d1_mini_pro.menu.UploadSpeed.256000.upload.speed=256000
+d1_mini_pro.menu.UploadSpeed.460800.linux=460800
+d1_mini_pro.menu.UploadSpeed.460800.macosx=460800
+d1_mini_pro.menu.UploadSpeed.460800.upload.speed=460800
+d1_mini_pro.menu.UploadSpeed.512000.windows=512000
+d1_mini_pro.menu.UploadSpeed.512000.upload.speed=512000
##############################################################
-d1.name=WeMos D1(Retired)
+d1_mini_lite.name=WeMos D1 mini Lite
+d1_mini_lite.build.board=ESP8266_WEMOS_D1MINILITE
+d1_mini_lite.build.variant=d1_mini
+d1_mini_lite.upload.tool=esptool
+d1_mini_lite.upload.maximum_data_size=81920
+d1_mini_lite.upload.wait_for_upload_port=true
+d1_mini_lite.upload.erase_cmd=
+d1_mini_lite.serial.disableDTR=true
+d1_mini_lite.serial.disableRTS=true
+d1_mini_lite.build.mcu=esp8266
+d1_mini_lite.build.core=esp8266
+d1_mini_lite.build.spiffs_pagesize=256
+d1_mini_lite.build.debug_port=
+d1_mini_lite.build.debug_level=
+d1_mini_lite.menu.CpuFrequency.80=80 MHz
+d1_mini_lite.menu.CpuFrequency.80.build.f_cpu=80000000L
+d1_mini_lite.menu.CpuFrequency.160=160 MHz
+d1_mini_lite.menu.CpuFrequency.160.build.f_cpu=160000000L
+d1_mini_lite.menu.VTable.flash=Flash
+d1_mini_lite.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+d1_mini_lite.menu.VTable.heap=Heap
+d1_mini_lite.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+d1_mini_lite.menu.VTable.iram=IRAM
+d1_mini_lite.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+d1_mini_lite.upload.resetmethod=nodemcu
+d1_mini_lite.build.flash_mode=dout
+d1_mini_lite.build.flash_freq=40
+d1_mini_lite.menu.FlashSize.1M0=1M (no SPIFFS)
+d1_mini_lite.menu.FlashSize.1M0.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M0.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M0.build.flash_ld=eagle.flash.1m0.ld
+d1_mini_lite.menu.FlashSize.1M0.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M0.upload.maximum_size=1023984
+d1_mini_lite.menu.FlashSize.1M0.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M64=1M (64K SPIFFS)
+d1_mini_lite.menu.FlashSize.1M64.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M64.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
+d1_mini_lite.menu.FlashSize.1M64.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M64.upload.maximum_size=958448
+d1_mini_lite.menu.FlashSize.1M64.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M64.build.spiffs_start=0xEB000
+d1_mini_lite.menu.FlashSize.1M64.build.spiffs_end=0xFB000
+d1_mini_lite.menu.FlashSize.1M64.build.spiffs_blocksize=4096
+d1_mini_lite.menu.FlashSize.1M128=1M (128K SPIFFS)
+d1_mini_lite.menu.FlashSize.1M128.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M128.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
+d1_mini_lite.menu.FlashSize.1M128.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M128.upload.maximum_size=892912
+d1_mini_lite.menu.FlashSize.1M128.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M128.build.spiffs_start=0xDB000
+d1_mini_lite.menu.FlashSize.1M128.build.spiffs_end=0xFB000
+d1_mini_lite.menu.FlashSize.1M128.build.spiffs_blocksize=4096
+d1_mini_lite.menu.FlashSize.1M144=1M (144K SPIFFS)
+d1_mini_lite.menu.FlashSize.1M144.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M144.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
+d1_mini_lite.menu.FlashSize.1M144.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M144.upload.maximum_size=876528
+d1_mini_lite.menu.FlashSize.1M144.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M144.build.spiffs_start=0xD7000
+d1_mini_lite.menu.FlashSize.1M144.build.spiffs_end=0xFB000
+d1_mini_lite.menu.FlashSize.1M144.build.spiffs_blocksize=4096
+d1_mini_lite.menu.FlashSize.1M160=1M (160K SPIFFS)
+d1_mini_lite.menu.FlashSize.1M160.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M160.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
+d1_mini_lite.menu.FlashSize.1M160.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M160.upload.maximum_size=860144
+d1_mini_lite.menu.FlashSize.1M160.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M160.build.spiffs_start=0xD3000
+d1_mini_lite.menu.FlashSize.1M160.build.spiffs_end=0xFB000
+d1_mini_lite.menu.FlashSize.1M160.build.spiffs_blocksize=4096
+d1_mini_lite.menu.FlashSize.1M192=1M (192K SPIFFS)
+d1_mini_lite.menu.FlashSize.1M192.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M192.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
+d1_mini_lite.menu.FlashSize.1M192.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M192.upload.maximum_size=827376
+d1_mini_lite.menu.FlashSize.1M192.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M192.build.spiffs_start=0xCB000
+d1_mini_lite.menu.FlashSize.1M192.build.spiffs_end=0xFB000
+d1_mini_lite.menu.FlashSize.1M192.build.spiffs_blocksize=4096
+d1_mini_lite.menu.FlashSize.1M256=1M (256K SPIFFS)
+d1_mini_lite.menu.FlashSize.1M256.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M256.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
+d1_mini_lite.menu.FlashSize.1M256.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M256.upload.maximum_size=761840
+d1_mini_lite.menu.FlashSize.1M256.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M256.build.spiffs_start=0xBB000
+d1_mini_lite.menu.FlashSize.1M256.build.spiffs_end=0xFB000
+d1_mini_lite.menu.FlashSize.1M256.build.spiffs_blocksize=4096
+d1_mini_lite.menu.FlashSize.1M512=1M (512K SPIFFS)
+d1_mini_lite.menu.FlashSize.1M512.build.flash_size=1M
+d1_mini_lite.menu.FlashSize.1M512.build.flash_size_bytes=0x100000
+d1_mini_lite.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
+d1_mini_lite.menu.FlashSize.1M512.build.spiffs_pagesize=256
+d1_mini_lite.menu.FlashSize.1M512.upload.maximum_size=499696
+d1_mini_lite.menu.FlashSize.1M512.build.rfcal_addr=0xFC000
+d1_mini_lite.menu.FlashSize.1M512.build.spiffs_start=0x7B000
+d1_mini_lite.menu.FlashSize.1M512.build.spiffs_end=0xFB000
+d1_mini_lite.menu.FlashSize.1M512.build.spiffs_blocksize=8192
+d1_mini_lite.menu.LwIPVariant.v2mss536=v2 Lower Memory
+d1_mini_lite.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+d1_mini_lite.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+d1_mini_lite.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+d1_mini_lite.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+d1_mini_lite.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+d1_mini_lite.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+d1_mini_lite.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+d1_mini_lite.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+d1_mini_lite.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+d1_mini_lite.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+d1_mini_lite.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+d1_mini_lite.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+d1_mini_lite.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+d1_mini_lite.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+d1_mini_lite.menu.Debug.Disabled=Disabled
+d1_mini_lite.menu.Debug.Disabled.build.debug_port=
+d1_mini_lite.menu.Debug.Serial=Serial
+d1_mini_lite.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+d1_mini_lite.menu.Debug.Serial1=Serial1
+d1_mini_lite.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+d1_mini_lite.menu.DebugLevel.None____=None
+d1_mini_lite.menu.DebugLevel.None____.build.debug_level=
+d1_mini_lite.menu.DebugLevel.SSL=SSL
+d1_mini_lite.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+d1_mini_lite.menu.DebugLevel.TLS_MEM=TLS_MEM
+d1_mini_lite.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+d1_mini_lite.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+d1_mini_lite.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1_mini_lite.menu.DebugLevel.CORE=CORE
+d1_mini_lite.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+d1_mini_lite.menu.DebugLevel.WIFI=WIFI
+d1_mini_lite.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+d1_mini_lite.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+d1_mini_lite.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+d1_mini_lite.menu.DebugLevel.UPDATER=UPDATER
+d1_mini_lite.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+d1_mini_lite.menu.DebugLevel.OTA=OTA
+d1_mini_lite.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+d1_mini_lite.menu.DebugLevel.OOM=OOM
+d1_mini_lite.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+d1_mini_lite.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1_mini_lite.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1_mini_lite.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+d1_mini_lite.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+d1_mini_lite.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+d1_mini_lite.menu.FlashErase.none=Only Sketch
+d1_mini_lite.menu.FlashErase.none.upload.erase_cmd=
+d1_mini_lite.menu.FlashErase.sdk=Sketch + WiFi Settings
+d1_mini_lite.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+d1_mini_lite.menu.FlashErase.all=All Flash Contents
+d1_mini_lite.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+d1_mini_lite.menu.UploadSpeed.921600=921600
+d1_mini_lite.menu.UploadSpeed.921600.upload.speed=921600
+d1_mini_lite.menu.UploadSpeed.9600=9600
+d1_mini_lite.menu.UploadSpeed.9600.upload.speed=9600
+d1_mini_lite.menu.UploadSpeed.57600=57600
+d1_mini_lite.menu.UploadSpeed.57600.upload.speed=57600
+d1_mini_lite.menu.UploadSpeed.115200=115200
+d1_mini_lite.menu.UploadSpeed.115200.upload.speed=115200
+d1_mini_lite.menu.UploadSpeed.230400.linux=230400
+d1_mini_lite.menu.UploadSpeed.230400.macosx=230400
+d1_mini_lite.menu.UploadSpeed.230400.upload.speed=230400
+d1_mini_lite.menu.UploadSpeed.256000.windows=256000
+d1_mini_lite.menu.UploadSpeed.256000.upload.speed=256000
+d1_mini_lite.menu.UploadSpeed.460800.linux=460800
+d1_mini_lite.menu.UploadSpeed.460800.macosx=460800
+d1_mini_lite.menu.UploadSpeed.460800.upload.speed=460800
+d1_mini_lite.menu.UploadSpeed.512000.windows=512000
+d1_mini_lite.menu.UploadSpeed.512000.upload.speed=512000
+##############################################################
+d1.name=WeMos D1 R1
+d1.build.board=ESP8266_WEMOS_D1R1
+d1.build.variant=d1
d1.upload.tool=esptool
-d1.upload.speed=460800
-d1.upload.resetmethod=nodemcu
-d1.upload.maximum_size=1044464
d1.upload.maximum_data_size=81920
d1.upload.wait_for_upload_port=true
+d1.upload.erase_cmd=
d1.serial.disableDTR=true
d1.serial.disableRTS=true
-
d1.build.mcu=esp8266
-d1.build.f_cpu=80000000L
-d1.build.board=ESP8266_WEMOS_D1MINI
-d1.build.core=esp8266
-d1.build.variant=d1
-d1.build.flash_mode=dio
-d1.build.flash_size=4M
-d1.build.flash_freq=40
+d1.build.core=esp8266
+d1.build.spiffs_pagesize=256
d1.build.debug_port=
d1.build.debug_level=
-
d1.menu.CpuFrequency.80=80 MHz
d1.menu.CpuFrequency.80.build.f_cpu=80000000L
d1.menu.CpuFrequency.160=160 MHz
d1.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+d1.menu.VTable.flash=Flash
+d1.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+d1.menu.VTable.heap=Heap
+d1.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+d1.menu.VTable.iram=IRAM
+d1.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+d1.upload.resetmethod=nodemcu
+d1.build.flash_mode=dio
+d1.build.flash_freq=40
+d1.menu.FlashSize.4M1M=4M (1M SPIFFS)
+d1.menu.FlashSize.4M1M.build.flash_size=4M
+d1.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+d1.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+d1.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+d1.menu.FlashSize.4M1M.upload.maximum_size=1044464
+d1.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+d1.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+d1.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+d1.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+d1.menu.FlashSize.4M2M=4M (2M SPIFFS)
+d1.menu.FlashSize.4M2M.build.flash_size=4M
+d1.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+d1.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+d1.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+d1.menu.FlashSize.4M2M.upload.maximum_size=1044464
+d1.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+d1.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+d1.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+d1.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+d1.menu.FlashSize.4M3M=4M (3M SPIFFS)
+d1.menu.FlashSize.4M3M.build.flash_size=4M
+d1.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+d1.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+d1.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+d1.menu.FlashSize.4M3M.upload.maximum_size=1044464
+d1.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+d1.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+d1.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+d1.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+d1.menu.LwIPVariant.v2mss536=v2 Lower Memory
+d1.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+d1.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+d1.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+d1.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+d1.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+d1.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+d1.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+d1.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+d1.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+d1.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+d1.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+d1.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+d1.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+d1.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+d1.menu.Debug.Disabled=Disabled
+d1.menu.Debug.Disabled.build.debug_port=
+d1.menu.Debug.Serial=Serial
+d1.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+d1.menu.Debug.Serial1=Serial1
+d1.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+d1.menu.DebugLevel.None____=None
+d1.menu.DebugLevel.None____.build.debug_level=
+d1.menu.DebugLevel.SSL=SSL
+d1.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+d1.menu.DebugLevel.TLS_MEM=TLS_MEM
+d1.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+d1.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+d1.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+d1.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+d1.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+d1.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+d1.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+d1.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+d1.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+d1.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+d1.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+d1.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+d1.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+d1.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+d1.menu.DebugLevel.CORE=CORE
+d1.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+d1.menu.DebugLevel.WIFI=WIFI
+d1.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+d1.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+d1.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+d1.menu.DebugLevel.UPDATER=UPDATER
+d1.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+d1.menu.DebugLevel.OTA=OTA
+d1.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+d1.menu.DebugLevel.OOM=OOM
+d1.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+d1.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+d1.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+d1.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+d1.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+d1.menu.FlashErase.none=Only Sketch
+d1.menu.FlashErase.none.upload.erase_cmd=
+d1.menu.FlashErase.sdk=Sketch + WiFi Settings
+d1.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+d1.menu.FlashErase.all=All Flash Contents
+d1.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
d1.menu.UploadSpeed.921600=921600
d1.menu.UploadSpeed.921600.upload.speed=921600
-d1.menu.UploadSpeed.115200=115200
-d1.menu.UploadSpeed.115200.upload.speed=115200
d1.menu.UploadSpeed.9600=9600
d1.menu.UploadSpeed.9600.upload.speed=9600
d1.menu.UploadSpeed.57600=57600
d1.menu.UploadSpeed.57600.upload.speed=57600
-d1.menu.UploadSpeed.256000.windows=256000
-d1.menu.UploadSpeed.256000.upload.speed=256000
+d1.menu.UploadSpeed.115200=115200
+d1.menu.UploadSpeed.115200.upload.speed=115200
d1.menu.UploadSpeed.230400.linux=230400
d1.menu.UploadSpeed.230400.macosx=230400
-d1.menu.UploadSpeed.230400.macosx=230400
d1.menu.UploadSpeed.230400.upload.speed=230400
+d1.menu.UploadSpeed.256000.windows=256000
+d1.menu.UploadSpeed.256000.upload.speed=256000
d1.menu.UploadSpeed.460800.linux=460800
d1.menu.UploadSpeed.460800.macosx=460800
d1.menu.UploadSpeed.460800.upload.speed=460800
d1.menu.UploadSpeed.512000.windows=512000
d1.menu.UploadSpeed.512000.upload.speed=512000
-
-d1.menu.FlashSize.4M3M=4M (3M SPIFFS)
-d1.menu.FlashSize.4M3M.build.flash_size=4M
-d1.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-d1.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-d1.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-d1.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-d1.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-d1.menu.FlashSize.4M1M=4M (1M SPIFFS)
-d1.menu.FlashSize.4M1M.build.flash_size=4M
-d1.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-d1.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-d1.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-d1.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-d1.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-
-
##############################################################
-
espino.name=ESPino (ESP-12 Module)
-
+espino.build.board=ESP8266_ESP12
+espino.build.variant=espino
espino.upload.tool=esptool
-espino.upload.speed=115200
-espino.upload.resetmethod=ck
-espino.upload.maximum_size=1044464
espino.upload.maximum_data_size=81920
espino.upload.wait_for_upload_port=true
+espino.upload.erase_cmd=
espino.serial.disableDTR=true
espino.serial.disableRTS=true
-
espino.build.mcu=esp8266
-espino.build.f_cpu=80000000L
-espino.build.board=ESP8266_ESP12
espino.build.core=esp8266
-espino.build.variant=espino
-espino.build.flash_mode=qio
-espino.build.flash_size=4M
-espino.build.flash_freq=40
espino.build.spiffs_pagesize=256
espino.build.debug_port=
espino.build.debug_level=
-
espino.menu.CpuFrequency.80=80 MHz
espino.menu.CpuFrequency.80.build.f_cpu=80000000L
espino.menu.CpuFrequency.160=160 MHz
espino.menu.CpuFrequency.160.build.f_cpu=160000000L
-
-espino.menu.FlashMode.dio=DIO
-espino.menu.FlashMode.dio.build.flash_mode=dio
-espino.menu.FlashMode.qio=QIO
-espino.menu.FlashMode.qio.build.flash_mode=qio
-
+espino.menu.VTable.flash=Flash
+espino.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+espino.menu.VTable.heap=Heap
+espino.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+espino.menu.VTable.iram=IRAM
+espino.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+espino.menu.ResetMethod.ck=ck
+espino.menu.ResetMethod.ck.upload.resetmethod=ck
+espino.menu.ResetMethod.nodemcu=nodemcu
+espino.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+espino.build.flash_mode=qio
+espino.build.flash_freq=40
+espino.menu.FlashSize.4M1M=4M (1M SPIFFS)
+espino.menu.FlashSize.4M1M.build.flash_size=4M
+espino.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+espino.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+espino.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+espino.menu.FlashSize.4M1M.upload.maximum_size=1044464
+espino.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+espino.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+espino.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+espino.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+espino.menu.FlashSize.4M2M=4M (2M SPIFFS)
+espino.menu.FlashSize.4M2M.build.flash_size=4M
+espino.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+espino.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+espino.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+espino.menu.FlashSize.4M2M.upload.maximum_size=1044464
+espino.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+espino.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+espino.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+espino.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+espino.menu.FlashSize.4M3M=4M (3M SPIFFS)
+espino.menu.FlashSize.4M3M.build.flash_size=4M
+espino.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+espino.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+espino.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+espino.menu.FlashSize.4M3M.upload.maximum_size=1044464
+espino.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+espino.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+espino.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+espino.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+espino.menu.LwIPVariant.v2mss536=v2 Lower Memory
+espino.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+espino.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+espino.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+espino.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+espino.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+espino.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+espino.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+espino.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+espino.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+espino.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+espino.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+espino.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+espino.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+espino.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+espino.menu.Debug.Disabled=Disabled
+espino.menu.Debug.Disabled.build.debug_port=
+espino.menu.Debug.Serial=Serial
+espino.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+espino.menu.Debug.Serial1=Serial1
+espino.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+espino.menu.DebugLevel.None____=None
+espino.menu.DebugLevel.None____.build.debug_level=
+espino.menu.DebugLevel.SSL=SSL
+espino.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+espino.menu.DebugLevel.TLS_MEM=TLS_MEM
+espino.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+espino.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+espino.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+espino.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+espino.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+espino.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+espino.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+espino.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+espino.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+espino.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+espino.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espino.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+espino.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+espino.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+espino.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espino.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espino.menu.DebugLevel.CORE=CORE
+espino.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+espino.menu.DebugLevel.WIFI=WIFI
+espino.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+espino.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+espino.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+espino.menu.DebugLevel.UPDATER=UPDATER
+espino.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+espino.menu.DebugLevel.OTA=OTA
+espino.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+espino.menu.DebugLevel.OOM=OOM
+espino.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+espino.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espino.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+espino.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+espino.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+espino.menu.FlashErase.none=Only Sketch
+espino.menu.FlashErase.none.upload.erase_cmd=
+espino.menu.FlashErase.sdk=Sketch + WiFi Settings
+espino.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+espino.menu.FlashErase.all=All Flash Contents
+espino.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
espino.menu.UploadSpeed.115200=115200
espino.menu.UploadSpeed.115200.upload.speed=115200
espino.menu.UploadSpeed.9600=9600
espino.menu.UploadSpeed.9600.upload.speed=9600
espino.menu.UploadSpeed.57600=57600
espino.menu.UploadSpeed.57600.upload.speed=57600
-espino.menu.UploadSpeed.256000.windows=256000
-espino.menu.UploadSpeed.256000.upload.speed=256000
espino.menu.UploadSpeed.230400.linux=230400
espino.menu.UploadSpeed.230400.macosx=230400
espino.menu.UploadSpeed.230400.upload.speed=230400
+espino.menu.UploadSpeed.256000.windows=256000
+espino.menu.UploadSpeed.256000.upload.speed=256000
espino.menu.UploadSpeed.460800.linux=460800
espino.menu.UploadSpeed.460800.macosx=460800
espino.menu.UploadSpeed.460800.upload.speed=460800
@@ -1436,68 +3243,152 @@ espino.menu.UploadSpeed.512000.upload.speed=512000
espino.menu.UploadSpeed.921600=921600
espino.menu.UploadSpeed.921600.upload.speed=921600
-espino.menu.FlashSize.4M1M=4M (1M SPIFFS)
-espino.menu.FlashSize.4M1M.build.flash_size=4M
-espino.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-espino.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-espino.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-espino.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-espino.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-espino.menu.FlashSize.4M1M.upload.maximum_size=1044464
-
-espino.menu.FlashSize.4M3M=4M (3M SPIFFS)
-espino.menu.FlashSize.4M3M.build.flash_size=4M
-espino.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-espino.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-espino.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-espino.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-espino.menu.FlashSize.4M3M.upload.maximum_size=1044464
-
-espino.menu.ResetMethod.ck=ck
-espino.menu.ResetMethod.ck.upload.resetmethod=ck
-espino.menu.ResetMethod.nodemcu=nodemcu
-espino.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
-
##############################################################
espinotee.name=ThaiEasyElec's ESPino
-
+espinotee.build.board=ESP8266_ESP13
+espinotee.build.variant=espinotee
espinotee.upload.tool=esptool
-espinotee.upload.speed=115200
-espinotee.upload.resetmethod=nodemcu
-espinotee.upload.maximum_size=1044464
espinotee.upload.maximum_data_size=81920
espinotee.upload.wait_for_upload_port=true
+espinotee.upload.erase_cmd=
espinotee.serial.disableDTR=true
espinotee.serial.disableRTS=true
-
espinotee.build.mcu=esp8266
-espinotee.build.f_cpu=80000000L
-espinotee.build.board=ESP8266_ESP13
espinotee.build.core=esp8266
-espinotee.build.variant=espinotee
-espinotee.build.flash_mode=qio
-espinotee.build.flash_size=4M
-espinotee.build.flash_freq=40
+espinotee.build.spiffs_pagesize=256
espinotee.build.debug_port=
espinotee.build.debug_level=
-
espinotee.menu.CpuFrequency.80=80 MHz
espinotee.menu.CpuFrequency.80.build.f_cpu=80000000L
espinotee.menu.CpuFrequency.160=160 MHz
espinotee.menu.CpuFrequency.160.build.f_cpu=160000000L
-
+espinotee.menu.VTable.flash=Flash
+espinotee.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+espinotee.menu.VTable.heap=Heap
+espinotee.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+espinotee.menu.VTable.iram=IRAM
+espinotee.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+espinotee.upload.resetmethod=nodemcu
+espinotee.build.flash_mode=qio
+espinotee.build.flash_freq=40
+espinotee.menu.FlashSize.4M1M=4M (1M SPIFFS)
+espinotee.menu.FlashSize.4M1M.build.flash_size=4M
+espinotee.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+espinotee.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+espinotee.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+espinotee.menu.FlashSize.4M1M.upload.maximum_size=1044464
+espinotee.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+espinotee.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+espinotee.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+espinotee.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+espinotee.menu.FlashSize.4M2M=4M (2M SPIFFS)
+espinotee.menu.FlashSize.4M2M.build.flash_size=4M
+espinotee.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+espinotee.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+espinotee.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+espinotee.menu.FlashSize.4M2M.upload.maximum_size=1044464
+espinotee.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+espinotee.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+espinotee.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+espinotee.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+espinotee.menu.FlashSize.4M3M=4M (3M SPIFFS)
+espinotee.menu.FlashSize.4M3M.build.flash_size=4M
+espinotee.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+espinotee.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+espinotee.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+espinotee.menu.FlashSize.4M3M.upload.maximum_size=1044464
+espinotee.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+espinotee.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+espinotee.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+espinotee.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+espinotee.menu.LwIPVariant.v2mss536=v2 Lower Memory
+espinotee.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+espinotee.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+espinotee.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+espinotee.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+espinotee.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+espinotee.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+espinotee.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+espinotee.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+espinotee.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+espinotee.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+espinotee.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+espinotee.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+espinotee.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+espinotee.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+espinotee.menu.Debug.Disabled=Disabled
+espinotee.menu.Debug.Disabled.build.debug_port=
+espinotee.menu.Debug.Serial=Serial
+espinotee.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+espinotee.menu.Debug.Serial1=Serial1
+espinotee.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+espinotee.menu.DebugLevel.None____=None
+espinotee.menu.DebugLevel.None____.build.debug_level=
+espinotee.menu.DebugLevel.SSL=SSL
+espinotee.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+espinotee.menu.DebugLevel.TLS_MEM=TLS_MEM
+espinotee.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+espinotee.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+espinotee.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+espinotee.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+espinotee.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+espinotee.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+espinotee.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+espinotee.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+espinotee.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+espinotee.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+espinotee.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espinotee.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+espinotee.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+espinotee.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+espinotee.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espinotee.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+espinotee.menu.DebugLevel.CORE=CORE
+espinotee.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+espinotee.menu.DebugLevel.WIFI=WIFI
+espinotee.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+espinotee.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+espinotee.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+espinotee.menu.DebugLevel.UPDATER=UPDATER
+espinotee.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+espinotee.menu.DebugLevel.OTA=OTA
+espinotee.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+espinotee.menu.DebugLevel.OOM=OOM
+espinotee.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+espinotee.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espinotee.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+espinotee.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+espinotee.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+espinotee.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+espinotee.menu.FlashErase.none=Only Sketch
+espinotee.menu.FlashErase.none.upload.erase_cmd=
+espinotee.menu.FlashErase.sdk=Sketch + WiFi Settings
+espinotee.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+espinotee.menu.FlashErase.all=All Flash Contents
+espinotee.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
espinotee.menu.UploadSpeed.115200=115200
espinotee.menu.UploadSpeed.115200.upload.speed=115200
espinotee.menu.UploadSpeed.9600=9600
espinotee.menu.UploadSpeed.9600.upload.speed=9600
espinotee.menu.UploadSpeed.57600=57600
espinotee.menu.UploadSpeed.57600.upload.speed=57600
-espinotee.menu.UploadSpeed.256000.windows=256000
-espinotee.menu.UploadSpeed.256000.upload.speed=256000
espinotee.menu.UploadSpeed.230400.linux=230400
espinotee.menu.UploadSpeed.230400.macosx=230400
-espinotee.menu.UploadSpeed.230400.macosx=230400
espinotee.menu.UploadSpeed.230400.upload.speed=230400
+espinotee.menu.UploadSpeed.256000.windows=256000
+espinotee.menu.UploadSpeed.256000.upload.speed=256000
espinotee.menu.UploadSpeed.460800.linux=460800
espinotee.menu.UploadSpeed.460800.macosx=460800
espinotee.menu.UploadSpeed.460800.upload.speed=460800
@@ -1506,144 +3397,219 @@ espinotee.menu.UploadSpeed.512000.upload.speed=512000
espinotee.menu.UploadSpeed.921600=921600
espinotee.menu.UploadSpeed.921600.upload.speed=921600
-espinotee.menu.FlashSize.4M3M=4M (3M SPIFFS)
-espinotee.menu.FlashSize.4M3M.build.flash_size=4M
-espinotee.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-espinotee.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-espinotee.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-espinotee.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-espinotee.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-
-espinotee.menu.FlashSize.4M1M=4M (1M SPIFFS)
-espinotee.menu.FlashSize.4M1M.build.flash_size=4M
-espinotee.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-espinotee.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-espinotee.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-espinotee.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-espinotee.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-
##############################################################
wifinfo.name=WifInfo
-
+wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
+wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464
+wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256
+wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
+wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
+wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
+wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
+wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000
+wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000
+wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
+wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
+wifinfo.menu.ESPModule.ESP12.build.spiffs_blocksize=8192
+wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
+wifinfo.build.board=WIFINFO
+wifinfo.build.variant=wifinfo
+wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
+wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
+wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
+wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
wifinfo.upload.tool=esptool
-wifinfo.upload.speed=115200
-wifinfo.upload.resetmethod=nodemcu
-wifinfo.upload.maximum_size=434160
wifinfo.upload.maximum_data_size=81920
wifinfo.upload.wait_for_upload_port=true
+wifinfo.upload.erase_cmd=
wifinfo.serial.disableDTR=true
wifinfo.serial.disableRTS=true
-
wifinfo.build.mcu=esp8266
wifinfo.build.core=esp8266
-wifinfo.build.variant=wifinfo
-wifinfo.build.board=WIFINFO
wifinfo.build.spiffs_pagesize=256
-wifinfo.build.debug_port=Serial1
-wifinfo.build.debug_level=Wifinfo
-
-wifinfo.menu.Debug.Disabled=Disabled
-wifinfo.menu.Debug.Disabled.build.debug_port=
-wifinfo.menu.Debug.Serial=Serial
-wifinfo.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
-wifinfo.menu.Debug.Serial1=Serial1
-wifinfo.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
-
-wifinfo.menu.DebugLevel.None=None
-wifinfo.menu.DebugLevel.None.build.debug_level=
-wifinfo.menu.DebugLevel.Wifinfo=Wifinfo
-wifinfo.menu.DebugLevel.Wifinfo.build.debug_level=-DDEBUG_ESP_WIFINFO
-
-#wifinfo.menu.ESPModule.ESP07512=ESP07 (1M/512K SPIFFS)
-#wifinfo.menu.ESPModule.ESP07512.build.board=ESP8266_ESP07
-#wifinfo.menu.ESPModule.ESP07512.build.flash_size=1M
-#wifinfo.menu.ESPModule.ESP07512.build.flash_ld=eagle.flash.1m512.ld
-#wifinfo.menu.ESPModule.ESP07512.build.spiffs_start=0x7B000
-#wifinfo.menu.ESPModule.ESP07512.build.spiffs_end=0xFB000
-#wifinfo.menu.ESPModule.ESP07512.build.spiffs_blocksize=8192
-#wifinfo.menu.ESPModule.ESP07512.upload.maximum_size=499696
-
-#wifinfo.menu.ESPModule.ESP07256=ESP07 (1M/256K SPIFFS)
-#wifinfo.menu.ESPModule.ESP07256.build.board=ESP8266_ESP07
-#wifinfo.menu.ESPModule.ESP07256.build.flash_size=1M
-#wifinfo.menu.ESPModule.ESP07256.build.flash_ld=eagle.flash.1m256.ld
-#wifinfo.menu.ESPModule.ESP07256.build.spiffs_start=0xBB000
-#wifinfo.menu.ESPModule.ESP07256.build.spiffs_end=0xFB000
-##wifinfo.menu.ESPModule.ESP07256.build.spiffs_blocksize=4096
-#wifinfo.menu.ESPModule.ESP07256.upload.maximum_size=761840
-
-wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K SPIFFS)
-wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07
-wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M
-wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld
-wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000
-wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000
-wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096
-wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376
-
-#wifinfo.menu.ESPModule.ESP07160=ESP07 (1M/160K SPIFFS)
-#wifinfo.menu.ESPModule.ESP07160.build.board=ESP8266_ESP07
-#wifinfo.menu.ESPModule.ESP07160.build.flash_size=1M
-#wifinfo.menu.ESPModule.ESP07160.build.flash_ld=eagle.flash.1m160.ld
-#wifinfo.menu.ESPModule.ESP07160.build.spiffs_start=0xD3000
-#wifinfo.menu.ESPModule.ESP07160.build.spiffs_end=0xFB000
-#wifinfo.menu.ESPModule.ESP07160.build.spiffs_blocksize=4096
-#wifinfo.menu.ESPModule.ESP07160.upload.maximum_size=860144
-#
-#wifinfo.menu.ESPModule.ESP07144=ESP07 (1M/144K SPIFFS)
-#wifinfo.menu.ESPModule.ESP07144.build.board=ESP8266_ESP07
-#wifinfo.menu.ESPModule.ESP07144.build.flash_size=1M
-#wifinfo.menu.ESPModule.ESP07144.build.flash_ld=eagle.flash.1m144.ld
-#wifinfo.menu.ESPModule.ESP07144.build.spiffs_start=0xD7000
-#wifinfo.menu.ESPModule.ESP07144.build.spiffs_end=0xFB000
-#wifinfo.menu.ESPModule.ESP07144.build.spiffs_blocksize=4096
-#wifinfo.menu.ESPModule.ESP07144.upload.maximum_size=876528
-#
-#wifinfo.menu.ESPModule.ESP07=ESP07 (1M/64K SPIFFS)
-#wifinfo.menu.ESPModule.ESP07.build.board=ESP8266_ESP07
-#wifinfo.menu.ESPModule.ESP07.build.flash_size=1M
-#wifinfo.menu.ESPModule.ESP07.build.flash_ld=eagle.flash.1m64.ld
-#wifinfo.menu.ESPModule.ESP07.build.spiffs_start=0xEB000
-#wifinfo.menu.ESPModule.ESP07.build.spiffs_end=0xFB000
-#wifinfo.menu.ESPModule.ESP07.build.spiffs_blocksize=4096
-#wifinfo.menu.ESPModule.ESP07.upload.maximum_size=958448
-
-wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M SPIFFS)
-wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12
-wifinfo.menu.ESPModule.ESP12.build.flash_size=4M
-wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld
-wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000
-wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000
-wifinfo.menu.ESPModule.ESP12.build.spiffs_blocksize=8192
-wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256
-wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464
-
-wifinfo.menu.CpuFrequency.160=160 MHz
-wifinfo.menu.CpuFrequency.160.build.f_cpu=160000000L
+wifinfo.build.debug_port=
+wifinfo.build.debug_level=
wifinfo.menu.CpuFrequency.80=80 MHz
wifinfo.menu.CpuFrequency.80.build.f_cpu=80000000L
-
+wifinfo.menu.CpuFrequency.160=160 MHz
+wifinfo.menu.CpuFrequency.160.build.f_cpu=160000000L
+wifinfo.menu.VTable.flash=Flash
+wifinfo.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+wifinfo.menu.VTable.heap=Heap
+wifinfo.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+wifinfo.menu.VTable.iram=IRAM
+wifinfo.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+wifinfo.upload.resetmethod=nodemcu
+wifinfo.build.flash_mode=qio
wifinfo.menu.FlashFreq.40=40MHz
wifinfo.menu.FlashFreq.40.build.flash_freq=40
wifinfo.menu.FlashFreq.80=80MHz
wifinfo.menu.FlashFreq.80.build.flash_freq=80
-
-wifinfo.menu.FlashMode.qio=QIO
-wifinfo.menu.FlashMode.qio.build.flash_mode=qio
-wifinfo.menu.FlashMode.dio=DIO
-wifinfo.menu.FlashMode.dio.build.flash_mode=dio
-
+wifinfo.menu.FlashSize.1M0=1M (no SPIFFS)
+wifinfo.menu.FlashSize.1M0.build.flash_size=1M
+wifinfo.menu.FlashSize.1M0.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M0.build.flash_ld=eagle.flash.1m0.ld
+wifinfo.menu.FlashSize.1M0.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M0.upload.maximum_size=1023984
+wifinfo.menu.FlashSize.1M0.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M64=1M (64K SPIFFS)
+wifinfo.menu.FlashSize.1M64.build.flash_size=1M
+wifinfo.menu.FlashSize.1M64.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
+wifinfo.menu.FlashSize.1M64.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M64.upload.maximum_size=958448
+wifinfo.menu.FlashSize.1M64.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M64.build.spiffs_start=0xEB000
+wifinfo.menu.FlashSize.1M64.build.spiffs_end=0xFB000
+wifinfo.menu.FlashSize.1M64.build.spiffs_blocksize=4096
+wifinfo.menu.FlashSize.1M128=1M (128K SPIFFS)
+wifinfo.menu.FlashSize.1M128.build.flash_size=1M
+wifinfo.menu.FlashSize.1M128.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
+wifinfo.menu.FlashSize.1M128.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M128.upload.maximum_size=892912
+wifinfo.menu.FlashSize.1M128.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M128.build.spiffs_start=0xDB000
+wifinfo.menu.FlashSize.1M128.build.spiffs_end=0xFB000
+wifinfo.menu.FlashSize.1M128.build.spiffs_blocksize=4096
+wifinfo.menu.FlashSize.1M144=1M (144K SPIFFS)
+wifinfo.menu.FlashSize.1M144.build.flash_size=1M
+wifinfo.menu.FlashSize.1M144.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
+wifinfo.menu.FlashSize.1M144.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M144.upload.maximum_size=876528
+wifinfo.menu.FlashSize.1M144.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M144.build.spiffs_start=0xD7000
+wifinfo.menu.FlashSize.1M144.build.spiffs_end=0xFB000
+wifinfo.menu.FlashSize.1M144.build.spiffs_blocksize=4096
+wifinfo.menu.FlashSize.1M160=1M (160K SPIFFS)
+wifinfo.menu.FlashSize.1M160.build.flash_size=1M
+wifinfo.menu.FlashSize.1M160.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
+wifinfo.menu.FlashSize.1M160.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M160.upload.maximum_size=860144
+wifinfo.menu.FlashSize.1M160.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M160.build.spiffs_start=0xD3000
+wifinfo.menu.FlashSize.1M160.build.spiffs_end=0xFB000
+wifinfo.menu.FlashSize.1M160.build.spiffs_blocksize=4096
+wifinfo.menu.FlashSize.1M192=1M (192K SPIFFS)
+wifinfo.menu.FlashSize.1M192.build.flash_size=1M
+wifinfo.menu.FlashSize.1M192.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
+wifinfo.menu.FlashSize.1M192.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M192.upload.maximum_size=827376
+wifinfo.menu.FlashSize.1M192.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M192.build.spiffs_start=0xCB000
+wifinfo.menu.FlashSize.1M192.build.spiffs_end=0xFB000
+wifinfo.menu.FlashSize.1M192.build.spiffs_blocksize=4096
+wifinfo.menu.FlashSize.1M256=1M (256K SPIFFS)
+wifinfo.menu.FlashSize.1M256.build.flash_size=1M
+wifinfo.menu.FlashSize.1M256.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
+wifinfo.menu.FlashSize.1M256.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M256.upload.maximum_size=761840
+wifinfo.menu.FlashSize.1M256.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M256.build.spiffs_start=0xBB000
+wifinfo.menu.FlashSize.1M256.build.spiffs_end=0xFB000
+wifinfo.menu.FlashSize.1M256.build.spiffs_blocksize=4096
+wifinfo.menu.FlashSize.1M512=1M (512K SPIFFS)
+wifinfo.menu.FlashSize.1M512.build.flash_size=1M
+wifinfo.menu.FlashSize.1M512.build.flash_size_bytes=0x100000
+wifinfo.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
+wifinfo.menu.FlashSize.1M512.build.spiffs_pagesize=256
+wifinfo.menu.FlashSize.1M512.upload.maximum_size=499696
+wifinfo.menu.FlashSize.1M512.build.rfcal_addr=0xFC000
+wifinfo.menu.FlashSize.1M512.build.spiffs_start=0x7B000
+wifinfo.menu.FlashSize.1M512.build.spiffs_end=0xFB000
+wifinfo.menu.FlashSize.1M512.build.spiffs_blocksize=8192
+wifinfo.menu.LwIPVariant.v2mss536=v2 Lower Memory
+wifinfo.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+wifinfo.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+wifinfo.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+wifinfo.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+wifinfo.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+wifinfo.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+wifinfo.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+wifinfo.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+wifinfo.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+wifinfo.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+wifinfo.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+wifinfo.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+wifinfo.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+wifinfo.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+wifinfo.menu.Debug.Disabled=Disabled
+wifinfo.menu.Debug.Disabled.build.debug_port=
+wifinfo.menu.Debug.Serial=Serial
+wifinfo.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+wifinfo.menu.Debug.Serial1=Serial1
+wifinfo.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+wifinfo.menu.DebugLevel.None____=None
+wifinfo.menu.DebugLevel.None____.build.debug_level=
+wifinfo.menu.DebugLevel.SSL=SSL
+wifinfo.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+wifinfo.menu.DebugLevel.TLS_MEM=TLS_MEM
+wifinfo.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+wifinfo.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+wifinfo.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+wifinfo.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+wifinfo.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+wifinfo.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+wifinfo.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+wifinfo.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+wifinfo.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+wifinfo.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+wifinfo.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+wifinfo.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+wifinfo.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+wifinfo.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifinfo.menu.DebugLevel.CORE=CORE
+wifinfo.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+wifinfo.menu.DebugLevel.WIFI=WIFI
+wifinfo.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+wifinfo.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+wifinfo.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+wifinfo.menu.DebugLevel.UPDATER=UPDATER
+wifinfo.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+wifinfo.menu.DebugLevel.OTA=OTA
+wifinfo.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+wifinfo.menu.DebugLevel.OOM=OOM
+wifinfo.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+wifinfo.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+wifinfo.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+wifinfo.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+wifinfo.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+wifinfo.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+wifinfo.menu.FlashErase.none=Only Sketch
+wifinfo.menu.FlashErase.none.upload.erase_cmd=
+wifinfo.menu.FlashErase.sdk=Sketch + WiFi Settings
+wifinfo.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+wifinfo.menu.FlashErase.all=All Flash Contents
+wifinfo.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
wifinfo.menu.UploadSpeed.115200=115200
wifinfo.menu.UploadSpeed.115200.upload.speed=115200
wifinfo.menu.UploadSpeed.9600=9600
wifinfo.menu.UploadSpeed.9600.upload.speed=9600
wifinfo.menu.UploadSpeed.57600=57600
wifinfo.menu.UploadSpeed.57600.upload.speed=57600
-wifinfo.menu.UploadSpeed.256000.windows=256000
-wifinfo.menu.UploadSpeed.256000.upload.speed=256000
wifinfo.menu.UploadSpeed.230400.linux=230400
wifinfo.menu.UploadSpeed.230400.macosx=230400
wifinfo.menu.UploadSpeed.230400.upload.speed=230400
+wifinfo.menu.UploadSpeed.256000.windows=256000
+wifinfo.menu.UploadSpeed.256000.upload.speed=256000
wifinfo.menu.UploadSpeed.460800.linux=460800
wifinfo.menu.UploadSpeed.460800.macosx=460800
wifinfo.menu.UploadSpeed.460800.upload.speed=460800
@@ -1652,243 +3618,851 @@ wifinfo.menu.UploadSpeed.512000.upload.speed=512000
wifinfo.menu.UploadSpeed.921600=921600
wifinfo.menu.UploadSpeed.921600.upload.speed=921600
-
##############################################################
-coredev.name=Core Development Module
-
-coredev.upload.tool=esptool
-coredev.upload.speed=115200
-coredev.upload.resetmethod=ck
-coredev.upload.maximum_size=434160
-coredev.upload.maximum_data_size=81920
-coredev.upload.wait_for_upload_port=true
-coredev.serial.disableDTR=true
-coredev.serial.disableRTS=true
-
-coredev.build.mcu=esp8266
-coredev.build.f_cpu=80000000L
-coredev.build.board=ESP8266_ESP01
-coredev.build.core=esp8266
-coredev.build.variant=generic
-coredev.build.flash_mode=qio
-coredev.build.spiffs_pagesize=256
-coredev.build.debug_port=
-coredev.build.debug_level=
-coredev.build.lwip_lib=-llwip
-coredev.build.lwip_flags=
-
-
-coredev.menu.LwIPVariant.Espressif=Espressif (xcc)
-coredev.menu.LwIPVariant.Espressif.build.lwip_lib=-llwip
-coredev.menu.LwIPVariant.Espressif.build.lwip_flags=-DLWIP_MAYBE_XCC
-coredev.menu.LwIPVariant.Prebuilt=Prebuilt Source (gcc)
-coredev.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
-coredev.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
-coredev.menu.LwIPVariant.OpenSource=Open Source (gcc)
-coredev.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
-coredev.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
-coredev.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
-
-coredev.menu.CpuFrequency.80=80 MHz
-coredev.menu.CpuFrequency.80.build.f_cpu=80000000L
-coredev.menu.CpuFrequency.160=160 MHz
-coredev.menu.CpuFrequency.160.build.f_cpu=160000000L
-
-coredev.menu.FlashFreq.40=40MHz
-coredev.menu.FlashFreq.40.build.flash_freq=40
-coredev.menu.FlashFreq.80=80MHz
-coredev.menu.FlashFreq.80.build.flash_freq=80
-
-coredev.menu.FlashMode.dio=DIO
-coredev.menu.FlashMode.dio.build.flash_mode=dio
-coredev.menu.FlashMode.qio=QIO
-coredev.menu.FlashMode.qio.build.flash_mode=qio
-coredev.menu.FlashMode.dout=DOUT
-coredev.menu.FlashMode.dout.build.flash_mode=dout
-coredev.menu.FlashMode.qout=QOUT
-coredev.menu.FlashMode.qout.build.flash_mode=qout
-
-coredev.menu.UploadSpeed.115200=115200
-coredev.menu.UploadSpeed.115200.upload.speed=115200
-coredev.menu.UploadSpeed.9600=9600
-coredev.menu.UploadSpeed.9600.upload.speed=9600
-coredev.menu.UploadSpeed.57600=57600
-coredev.menu.UploadSpeed.57600.upload.speed=57600
-coredev.menu.UploadSpeed.256000.windows=256000
-coredev.menu.UploadSpeed.256000.upload.speed=256000
-coredev.menu.UploadSpeed.230400.linux=230400
-coredev.menu.UploadSpeed.230400.macosx=230400
-coredev.menu.UploadSpeed.230400.upload.speed=230400
-coredev.menu.UploadSpeed.460800.linux=460800
-coredev.menu.UploadSpeed.460800.macosx=460800
-coredev.menu.UploadSpeed.460800.upload.speed=460800
-coredev.menu.UploadSpeed.512000.windows=512000
-coredev.menu.UploadSpeed.512000.upload.speed=512000
-coredev.menu.UploadSpeed.921600=921600
-coredev.menu.UploadSpeed.921600.upload.speed=921600
-
-coredev.menu.FlashSize.512K64=512K (64K SPIFFS)
-coredev.menu.FlashSize.512K64.build.flash_size=512K
-coredev.menu.FlashSize.512K64.build.flash_ld=eagle.flash.512k64.ld
-coredev.menu.FlashSize.512K64.build.spiffs_start=0x6B000
-coredev.menu.FlashSize.512K64.build.spiffs_end=0x7B000
-coredev.menu.FlashSize.512K64.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.512K64.upload.maximum_size=434160
+arduino-esp8266.name=Arduino
+arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO
+arduino-esp8266.menu.BoardModel.primo.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
+arduino-esp8266.menu.BoardModel.starottodeved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
+arduino-esp8266.menu.BoardModel.starottodeved.build.variant=arduino_uart
+arduino-esp8266.menu.BoardModel.unowifideved.build.board=ESP8266_ARDUINO_UNOWIFI
+arduino-esp8266.menu.BoardModel.unowifideved.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266
+arduino-esp8266.menu.BoardModel.primo=Primo
+arduino-esp8266.menu.BoardModel.unowifideved.build.variant=arduino_uart
+arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi
+arduino-esp8266.menu.BoardModel.starottodeved=Star OTTO
+arduino-esp8266.build.board=ESP8266_ARDUINO
+arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO
+arduino-esp8266.menu.BoardModel.unowifideved=Uno WiFi
+arduino-esp8266.upload.tool=esptool
+arduino-esp8266.upload.maximum_data_size=81920
+arduino-esp8266.upload.wait_for_upload_port=true
+arduino-esp8266.upload.erase_cmd=
+arduino-esp8266.serial.disableDTR=true
+arduino-esp8266.serial.disableRTS=true
+arduino-esp8266.build.mcu=esp8266
+arduino-esp8266.build.core=esp8266
+arduino-esp8266.build.variant=generic
+arduino-esp8266.build.spiffs_pagesize=256
+arduino-esp8266.build.debug_port=
+arduino-esp8266.build.debug_level=
+arduino-esp8266.menu.CpuFrequency.80=80 MHz
+arduino-esp8266.menu.CpuFrequency.80.build.f_cpu=80000000L
+arduino-esp8266.menu.CpuFrequency.160=160 MHz
+arduino-esp8266.menu.CpuFrequency.160.build.f_cpu=160000000L
+arduino-esp8266.menu.VTable.flash=Flash
+arduino-esp8266.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+arduino-esp8266.menu.VTable.heap=Heap
+arduino-esp8266.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+arduino-esp8266.menu.VTable.iram=IRAM
+arduino-esp8266.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+arduino-esp8266.upload.resetmethod=ck
+arduino-esp8266.build.flash_mode=qio
+arduino-esp8266.build.flash_freq=40
+arduino-esp8266.menu.FlashSize.4M1M=4M (1M SPIFFS)
+arduino-esp8266.menu.FlashSize.4M1M.build.flash_size=4M
+arduino-esp8266.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+arduino-esp8266.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+arduino-esp8266.menu.FlashSize.4M1M.upload.maximum_size=1044464
+arduino-esp8266.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+arduino-esp8266.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+arduino-esp8266.menu.FlashSize.4M2M=4M (2M SPIFFS)
+arduino-esp8266.menu.FlashSize.4M2M.build.flash_size=4M
+arduino-esp8266.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+arduino-esp8266.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+arduino-esp8266.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+arduino-esp8266.menu.FlashSize.4M2M.upload.maximum_size=1044464
+arduino-esp8266.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+arduino-esp8266.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+arduino-esp8266.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+arduino-esp8266.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+arduino-esp8266.menu.FlashSize.4M3M=4M (3M SPIFFS)
+arduino-esp8266.menu.FlashSize.4M3M.build.flash_size=4M
+arduino-esp8266.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+arduino-esp8266.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+arduino-esp8266.menu.FlashSize.4M3M.upload.maximum_size=1044464
+arduino-esp8266.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+arduino-esp8266.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+arduino-esp8266.menu.LwIPVariant.v2mss536=v2 Lower Memory
+arduino-esp8266.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+arduino-esp8266.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+arduino-esp8266.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+arduino-esp8266.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+arduino-esp8266.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+arduino-esp8266.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+arduino-esp8266.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+arduino-esp8266.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+arduino-esp8266.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+arduino-esp8266.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+arduino-esp8266.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+arduino-esp8266.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+arduino-esp8266.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+arduino-esp8266.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+arduino-esp8266.menu.Debug.Disabled=Disabled
+arduino-esp8266.menu.Debug.Disabled.build.debug_port=
+arduino-esp8266.menu.Debug.Serial=Serial
+arduino-esp8266.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+arduino-esp8266.menu.Debug.Serial1=Serial1
+arduino-esp8266.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+arduino-esp8266.menu.DebugLevel.None____=None
+arduino-esp8266.menu.DebugLevel.None____.build.debug_level=
+arduino-esp8266.menu.DebugLevel.SSL=SSL
+arduino-esp8266.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+arduino-esp8266.menu.DebugLevel.TLS_MEM=TLS_MEM
+arduino-esp8266.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+arduino-esp8266.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+arduino-esp8266.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+arduino-esp8266.menu.DebugLevel.CORE=CORE
+arduino-esp8266.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+arduino-esp8266.menu.DebugLevel.WIFI=WIFI
+arduino-esp8266.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+arduino-esp8266.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+arduino-esp8266.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+arduino-esp8266.menu.DebugLevel.UPDATER=UPDATER
+arduino-esp8266.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+arduino-esp8266.menu.DebugLevel.OTA=OTA
+arduino-esp8266.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+arduino-esp8266.menu.DebugLevel.OOM=OOM
+arduino-esp8266.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+arduino-esp8266.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+arduino-esp8266.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+arduino-esp8266.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+arduino-esp8266.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+arduino-esp8266.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+arduino-esp8266.menu.FlashErase.none=Only Sketch
+arduino-esp8266.menu.FlashErase.none.upload.erase_cmd=
+arduino-esp8266.menu.FlashErase.sdk=Sketch + WiFi Settings
+arduino-esp8266.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+arduino-esp8266.menu.FlashErase.all=All Flash Contents
+arduino-esp8266.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+arduino-esp8266.menu.UploadSpeed.115200=115200
+arduino-esp8266.menu.UploadSpeed.115200.upload.speed=115200
+arduino-esp8266.menu.UploadSpeed.9600=9600
+arduino-esp8266.menu.UploadSpeed.9600.upload.speed=9600
+arduino-esp8266.menu.UploadSpeed.57600=57600
+arduino-esp8266.menu.UploadSpeed.57600.upload.speed=57600
+arduino-esp8266.menu.UploadSpeed.230400.linux=230400
+arduino-esp8266.menu.UploadSpeed.230400.macosx=230400
+arduino-esp8266.menu.UploadSpeed.230400.upload.speed=230400
+arduino-esp8266.menu.UploadSpeed.256000.windows=256000
+arduino-esp8266.menu.UploadSpeed.256000.upload.speed=256000
+arduino-esp8266.menu.UploadSpeed.460800.linux=460800
+arduino-esp8266.menu.UploadSpeed.460800.macosx=460800
+arduino-esp8266.menu.UploadSpeed.460800.upload.speed=460800
+arduino-esp8266.menu.UploadSpeed.512000.windows=512000
+arduino-esp8266.menu.UploadSpeed.512000.upload.speed=512000
+arduino-esp8266.menu.UploadSpeed.921600=921600
+arduino-esp8266.menu.UploadSpeed.921600.upload.speed=921600
-coredev.menu.FlashSize.512K128=512K (128K SPIFFS)
-coredev.menu.FlashSize.512K128.build.flash_size=512K
-coredev.menu.FlashSize.512K128.build.flash_ld=eagle.flash.512k128.ld
-coredev.menu.FlashSize.512K128.build.spiffs_start=0x5B000
-coredev.menu.FlashSize.512K128.build.spiffs_end=0x7B000
-coredev.menu.FlashSize.512K128.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.512K128.upload.maximum_size=368624
-
-coredev.menu.FlashSize.512K0=512K (no SPIFFS)
-coredev.menu.FlashSize.512K0.build.flash_size=512K
-coredev.menu.FlashSize.512K0.build.flash_ld=eagle.flash.512k0.ld
-coredev.menu.FlashSize.512K0.upload.maximum_size=499696
-
-coredev.menu.FlashSize.1M512=1M (512K SPIFFS)
-coredev.menu.FlashSize.1M512.build.flash_size=1M
-coredev.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
-coredev.menu.FlashSize.1M512.build.spiffs_start=0x7B000
-coredev.menu.FlashSize.1M512.build.spiffs_end=0xFB000
-coredev.menu.FlashSize.1M512.build.spiffs_blocksize=8192
-coredev.menu.FlashSize.1M512.upload.maximum_size=499696
-
-coredev.menu.FlashSize.1M256=1M (256K SPIFFS)
-coredev.menu.FlashSize.1M256.build.flash_size=1M
-coredev.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
-coredev.menu.FlashSize.1M256.build.spiffs_start=0xBB000
-coredev.menu.FlashSize.1M256.build.spiffs_end=0xFB000
-coredev.menu.FlashSize.1M256.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.1M256.upload.maximum_size=761840
-
-coredev.menu.FlashSize.1M192=1M (192K SPIFFS)
-coredev.menu.FlashSize.1M192.build.flash_size=1M
-coredev.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
-coredev.menu.FlashSize.1M192.build.spiffs_start=0xCB000
-coredev.menu.FlashSize.1M192.build.spiffs_end=0xFB000
-coredev.menu.FlashSize.1M192.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.1M192.upload.maximum_size=827376
-
-coredev.menu.FlashSize.1M160=1M (160K SPIFFS)
-coredev.menu.FlashSize.1M160.build.flash_size=1M
-coredev.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
-coredev.menu.FlashSize.1M160.build.spiffs_start=0xD3000
-coredev.menu.FlashSize.1M160.build.spiffs_end=0xFB000
-coredev.menu.FlashSize.1M160.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.1M160.upload.maximum_size=860144
-
-coredev.menu.FlashSize.1M144=1M (144K SPIFFS)
-coredev.menu.FlashSize.1M144.build.flash_size=1M
-coredev.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
-coredev.menu.FlashSize.1M144.build.spiffs_start=0xD7000
-coredev.menu.FlashSize.1M144.build.spiffs_end=0xFB000
-coredev.menu.FlashSize.1M144.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.1M144.upload.maximum_size=876528
-
-coredev.menu.FlashSize.1M128=1M (128K SPIFFS)
-coredev.menu.FlashSize.1M128.build.flash_size=1M
-coredev.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
-coredev.menu.FlashSize.1M128.build.spiffs_start=0xDB000
-coredev.menu.FlashSize.1M128.build.spiffs_end=0xFB000
-coredev.menu.FlashSize.1M128.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.1M128.upload.maximum_size=892912
-
-coredev.menu.FlashSize.1M64=1M (64K SPIFFS)
-coredev.menu.FlashSize.1M64.build.flash_size=1M
-coredev.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
-coredev.menu.FlashSize.1M64.build.spiffs_start=0xEB000
-coredev.menu.FlashSize.1M64.build.spiffs_end=0xFB000
-coredev.menu.FlashSize.1M64.build.spiffs_blocksize=4096
-coredev.menu.FlashSize.1M64.upload.maximum_size=958448
-
-coredev.menu.FlashSize.2M=2M (1M SPIFFS)
-coredev.menu.FlashSize.2M.build.flash_size=2M
-coredev.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld
-coredev.menu.FlashSize.2M.build.spiffs_start=0x100000
-coredev.menu.FlashSize.2M.build.spiffs_end=0x1FB000
-coredev.menu.FlashSize.2M.build.spiffs_blocksize=8192
-coredev.menu.FlashSize.2M.upload.maximum_size=1044464
-
-coredev.menu.FlashSize.4M1M=4M (1M SPIFFS)
-coredev.menu.FlashSize.4M1M.build.flash_size=4M
-coredev.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
-coredev.menu.FlashSize.4M1M.build.spiffs_start=0x300000
-coredev.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
-coredev.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
-coredev.menu.FlashSize.4M1M.build.spiffs_pagesize=256
-coredev.menu.FlashSize.4M1M.upload.maximum_size=1044464
-
-coredev.menu.FlashSize.4M3M=4M (3M SPIFFS)
-coredev.menu.FlashSize.4M3M.build.flash_size=4M
-coredev.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
-coredev.menu.FlashSize.4M3M.build.spiffs_start=0x100000
-coredev.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
-coredev.menu.FlashSize.4M3M.build.spiffs_pagesize=256
-coredev.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
-coredev.menu.FlashSize.4M3M.upload.maximum_size=1044464
-
-coredev.menu.FlashSize.8M7M=8M (7M SPIFFS)
-coredev.menu.FlashSize.8M7M.build.flash_size=8M
-coredev.menu.FlashSize.8M7M.build.flash_ld=eagle.flash.8m.ld
-coredev.menu.FlashSize.8M7M.build.spiffs_start=0x100000
-coredev.menu.FlashSize.8M7M.build.spiffs_end=0x7FB000
-coredev.menu.FlashSize.8M7M.build.spiffs_pagesize=256
-coredev.menu.FlashSize.8M7M.build.spiffs_blocksize=8192
-coredev.menu.FlashSize.8M7M.upload.maximum_size=1044464
+##############################################################
+gen4iod.name=4D Systems gen4 IoD Range
+gen4iod.build.board=GEN4_IOD
+gen4iod.build.f_cpu=160000000L
+gen4iod.build.variant=generic
+gen4iod.upload.tool=esptool
+gen4iod.upload.maximum_data_size=81920
+gen4iod.upload.wait_for_upload_port=true
+gen4iod.upload.erase_cmd=
+gen4iod.serial.disableDTR=true
+gen4iod.serial.disableRTS=true
+gen4iod.build.mcu=esp8266
+gen4iod.build.core=esp8266
+gen4iod.build.spiffs_pagesize=256
+gen4iod.build.debug_port=
+gen4iod.build.debug_level=
+gen4iod.menu.CpuFrequency.80=80 MHz
+gen4iod.menu.CpuFrequency.80.build.f_cpu=80000000L
+gen4iod.menu.CpuFrequency.160=160 MHz
+gen4iod.menu.CpuFrequency.160.build.f_cpu=160000000L
+gen4iod.menu.VTable.flash=Flash
+gen4iod.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+gen4iod.menu.VTable.heap=Heap
+gen4iod.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+gen4iod.menu.VTable.iram=IRAM
+gen4iod.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+gen4iod.upload.resetmethod=nodemcu
+gen4iod.build.flash_mode=dio
+gen4iod.build.flash_freq=80
+gen4iod.menu.FlashSize.512K0=512K (no SPIFFS)
+gen4iod.menu.FlashSize.512K0.build.flash_size=512K
+gen4iod.menu.FlashSize.512K0.build.flash_size_bytes=0x80000
+gen4iod.menu.FlashSize.512K0.build.flash_ld=eagle.flash.512k0.ld
+gen4iod.menu.FlashSize.512K0.build.spiffs_pagesize=256
+gen4iod.menu.FlashSize.512K0.upload.maximum_size=499696
+gen4iod.menu.FlashSize.512K0.build.rfcal_addr=0x7C000
+gen4iod.menu.FlashSize.512K64=512K (64K SPIFFS)
+gen4iod.menu.FlashSize.512K64.build.flash_size=512K
+gen4iod.menu.FlashSize.512K64.build.flash_size_bytes=0x80000
+gen4iod.menu.FlashSize.512K64.build.flash_ld=eagle.flash.512k64.ld
+gen4iod.menu.FlashSize.512K64.build.spiffs_pagesize=256
+gen4iod.menu.FlashSize.512K64.upload.maximum_size=434160
+gen4iod.menu.FlashSize.512K64.build.rfcal_addr=0x7C000
+gen4iod.menu.FlashSize.512K64.build.spiffs_start=0x6B000
+gen4iod.menu.FlashSize.512K64.build.spiffs_end=0x7B000
+gen4iod.menu.FlashSize.512K64.build.spiffs_blocksize=4096
+gen4iod.menu.FlashSize.512K128=512K (128K SPIFFS)
+gen4iod.menu.FlashSize.512K128.build.flash_size=512K
+gen4iod.menu.FlashSize.512K128.build.flash_size_bytes=0x80000
+gen4iod.menu.FlashSize.512K128.build.flash_ld=eagle.flash.512k128.ld
+gen4iod.menu.FlashSize.512K128.build.spiffs_pagesize=256
+gen4iod.menu.FlashSize.512K128.upload.maximum_size=368624
+gen4iod.menu.FlashSize.512K128.build.rfcal_addr=0x7C000
+gen4iod.menu.FlashSize.512K128.build.spiffs_start=0x5B000
+gen4iod.menu.FlashSize.512K128.build.spiffs_end=0x7B000
+gen4iod.menu.FlashSize.512K128.build.spiffs_blocksize=4096
+gen4iod.menu.LwIPVariant.v2mss536=v2 Lower Memory
+gen4iod.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+gen4iod.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+gen4iod.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+gen4iod.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+gen4iod.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+gen4iod.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+gen4iod.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+gen4iod.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+gen4iod.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+gen4iod.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+gen4iod.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+gen4iod.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+gen4iod.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+gen4iod.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+gen4iod.menu.Debug.Disabled=Disabled
+gen4iod.menu.Debug.Disabled.build.debug_port=
+gen4iod.menu.Debug.Serial=Serial
+gen4iod.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+gen4iod.menu.Debug.Serial1=Serial1
+gen4iod.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+gen4iod.menu.DebugLevel.None____=None
+gen4iod.menu.DebugLevel.None____.build.debug_level=
+gen4iod.menu.DebugLevel.SSL=SSL
+gen4iod.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+gen4iod.menu.DebugLevel.TLS_MEM=TLS_MEM
+gen4iod.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+gen4iod.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+gen4iod.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+gen4iod.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+gen4iod.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+gen4iod.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+gen4iod.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+gen4iod.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+gen4iod.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+gen4iod.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+gen4iod.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+gen4iod.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+gen4iod.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+gen4iod.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+gen4iod.menu.DebugLevel.CORE=CORE
+gen4iod.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+gen4iod.menu.DebugLevel.WIFI=WIFI
+gen4iod.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+gen4iod.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+gen4iod.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+gen4iod.menu.DebugLevel.UPDATER=UPDATER
+gen4iod.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+gen4iod.menu.DebugLevel.OTA=OTA
+gen4iod.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+gen4iod.menu.DebugLevel.OOM=OOM
+gen4iod.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+gen4iod.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+gen4iod.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+gen4iod.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+gen4iod.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+gen4iod.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+gen4iod.menu.FlashErase.none=Only Sketch
+gen4iod.menu.FlashErase.none.upload.erase_cmd=
+gen4iod.menu.FlashErase.sdk=Sketch + WiFi Settings
+gen4iod.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+gen4iod.menu.FlashErase.all=All Flash Contents
+gen4iod.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+gen4iod.menu.UploadSpeed.115200=115200
+gen4iod.menu.UploadSpeed.115200.upload.speed=115200
+gen4iod.menu.UploadSpeed.9600=9600
+gen4iod.menu.UploadSpeed.9600.upload.speed=9600
+gen4iod.menu.UploadSpeed.57600=57600
+gen4iod.menu.UploadSpeed.57600.upload.speed=57600
+gen4iod.menu.UploadSpeed.230400.linux=230400
+gen4iod.menu.UploadSpeed.230400.macosx=230400
+gen4iod.menu.UploadSpeed.230400.upload.speed=230400
+gen4iod.menu.UploadSpeed.256000.windows=256000
+gen4iod.menu.UploadSpeed.256000.upload.speed=256000
+gen4iod.menu.UploadSpeed.460800.linux=460800
+gen4iod.menu.UploadSpeed.460800.macosx=460800
+gen4iod.menu.UploadSpeed.460800.upload.speed=460800
+gen4iod.menu.UploadSpeed.512000.windows=512000
+gen4iod.menu.UploadSpeed.512000.upload.speed=512000
+gen4iod.menu.UploadSpeed.921600=921600
+gen4iod.menu.UploadSpeed.921600.upload.speed=921600
-coredev.menu.FlashSize.16M15M=16M (15M SPIFFS)
-coredev.menu.FlashSize.16M15M.build.flash_size=16M
-coredev.menu.FlashSize.16M15M.build.flash_ld=eagle.flash.16m.ld
-coredev.menu.FlashSize.16M15M.build.spiffs_start=0x100000
-coredev.menu.FlashSize.16M15M.build.spiffs_end=0x17FB000
-coredev.menu.FlashSize.16M15M.build.spiffs_pagesize=256
-coredev.menu.FlashSize.16M15M.build.spiffs_blocksize=8192
-coredev.menu.FlashSize.16M15M.upload.maximum_size=1044464
+##############################################################
+oak.name=Digistump Oak
+oak.build.board=ESP8266_OAK
+oak.build.variant=oak
+oak.upload.maximum_size=1040368
+oak.upload.tool=esptool
+oak.upload.maximum_data_size=81920
+oak.upload.wait_for_upload_port=true
+oak.upload.erase_cmd=
+oak.serial.disableDTR=true
+oak.serial.disableRTS=true
+oak.build.mcu=esp8266
+oak.build.core=esp8266
+oak.build.spiffs_pagesize=256
+oak.build.debug_port=
+oak.build.debug_level=
+oak.menu.CpuFrequency.80=80 MHz
+oak.menu.CpuFrequency.80.build.f_cpu=80000000L
+oak.menu.CpuFrequency.160=160 MHz
+oak.menu.CpuFrequency.160.build.f_cpu=160000000L
+oak.menu.VTable.flash=Flash
+oak.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+oak.menu.VTable.heap=Heap
+oak.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+oak.menu.VTable.iram=IRAM
+oak.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+oak.upload.resetmethod=none
+oak.build.flash_mode=dio
+oak.build.flash_freq=40
+oak.menu.FlashSize.4M1M=4M (1M SPIFFS)
+oak.menu.FlashSize.4M1M.build.flash_size=4M
+oak.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+oak.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+oak.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+oak.menu.FlashSize.4M1M.upload.maximum_size=1044464
+oak.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+oak.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+oak.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+oak.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+oak.menu.FlashSize.4M2M=4M (2M SPIFFS)
+oak.menu.FlashSize.4M2M.build.flash_size=4M
+oak.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+oak.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+oak.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+oak.menu.FlashSize.4M2M.upload.maximum_size=1044464
+oak.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+oak.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+oak.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+oak.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+oak.menu.FlashSize.4M3M=4M (3M SPIFFS)
+oak.menu.FlashSize.4M3M.build.flash_size=4M
+oak.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+oak.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+oak.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+oak.menu.FlashSize.4M3M.upload.maximum_size=1044464
+oak.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+oak.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+oak.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+oak.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+oak.menu.LwIPVariant.v2mss536=v2 Lower Memory
+oak.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+oak.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+oak.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+oak.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+oak.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+oak.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+oak.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+oak.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+oak.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+oak.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+oak.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+oak.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+oak.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+oak.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+oak.menu.Debug.Disabled=Disabled
+oak.menu.Debug.Disabled.build.debug_port=
+oak.menu.Debug.Serial=Serial
+oak.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+oak.menu.Debug.Serial1=Serial1
+oak.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+oak.menu.DebugLevel.None____=None
+oak.menu.DebugLevel.None____.build.debug_level=
+oak.menu.DebugLevel.SSL=SSL
+oak.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+oak.menu.DebugLevel.TLS_MEM=TLS_MEM
+oak.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+oak.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+oak.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+oak.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+oak.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+oak.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+oak.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+oak.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+oak.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+oak.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+oak.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+oak.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+oak.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+oak.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+oak.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+oak.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+oak.menu.DebugLevel.CORE=CORE
+oak.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+oak.menu.DebugLevel.WIFI=WIFI
+oak.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+oak.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+oak.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+oak.menu.DebugLevel.UPDATER=UPDATER
+oak.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+oak.menu.DebugLevel.OTA=OTA
+oak.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+oak.menu.DebugLevel.OOM=OOM
+oak.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+oak.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+oak.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+oak.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+oak.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+oak.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+oak.menu.FlashErase.none=Only Sketch
+oak.menu.FlashErase.none.upload.erase_cmd=
+oak.menu.FlashErase.sdk=Sketch + WiFi Settings
+oak.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+oak.menu.FlashErase.all=All Flash Contents
+oak.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+oak.menu.UploadSpeed.921600=921600
+oak.menu.UploadSpeed.921600.upload.speed=921600
+oak.menu.UploadSpeed.9600=9600
+oak.menu.UploadSpeed.9600.upload.speed=9600
+oak.menu.UploadSpeed.57600=57600
+oak.menu.UploadSpeed.57600.upload.speed=57600
+oak.menu.UploadSpeed.115200=115200
+oak.menu.UploadSpeed.115200.upload.speed=115200
+oak.menu.UploadSpeed.230400.linux=230400
+oak.menu.UploadSpeed.230400.macosx=230400
+oak.menu.UploadSpeed.230400.upload.speed=230400
+oak.menu.UploadSpeed.256000.windows=256000
+oak.menu.UploadSpeed.256000.upload.speed=256000
+oak.menu.UploadSpeed.460800.linux=460800
+oak.menu.UploadSpeed.460800.macosx=460800
+oak.menu.UploadSpeed.460800.upload.speed=460800
+oak.menu.UploadSpeed.512000.windows=512000
+oak.menu.UploadSpeed.512000.upload.speed=512000
-coredev.menu.ResetMethod.ck=ck
-coredev.menu.ResetMethod.ck.upload.resetmethod=ck
-coredev.menu.ResetMethod.nodemcu=nodemcu
-coredev.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
+##############################################################
+wifiduino.name=WiFiduino
+wifiduino.build.board=WIFIDUINO_ESP8266
+wifiduino.build.variant=wifiduino
+wifiduino.upload.tool=esptool
+wifiduino.upload.maximum_data_size=81920
+wifiduino.upload.wait_for_upload_port=true
+wifiduino.upload.erase_cmd=
+wifiduino.serial.disableDTR=true
+wifiduino.serial.disableRTS=true
+wifiduino.build.mcu=esp8266
+wifiduino.build.core=esp8266
+wifiduino.build.spiffs_pagesize=256
+wifiduino.build.debug_port=
+wifiduino.build.debug_level=
+wifiduino.menu.CpuFrequency.80=80 MHz
+wifiduino.menu.CpuFrequency.80.build.f_cpu=80000000L
+wifiduino.menu.CpuFrequency.160=160 MHz
+wifiduino.menu.CpuFrequency.160.build.f_cpu=160000000L
+wifiduino.menu.VTable.flash=Flash
+wifiduino.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+wifiduino.menu.VTable.heap=Heap
+wifiduino.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+wifiduino.menu.VTable.iram=IRAM
+wifiduino.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+wifiduino.upload.resetmethod=nodemcu
+wifiduino.build.flash_mode=dio
+wifiduino.build.flash_freq=40
+wifiduino.menu.FlashSize.4M1M=4M (1M SPIFFS)
+wifiduino.menu.FlashSize.4M1M.build.flash_size=4M
+wifiduino.menu.FlashSize.4M1M.build.flash_size_bytes=0x400000
+wifiduino.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
+wifiduino.menu.FlashSize.4M1M.build.spiffs_pagesize=256
+wifiduino.menu.FlashSize.4M1M.upload.maximum_size=1044464
+wifiduino.menu.FlashSize.4M1M.build.rfcal_addr=0x3FC000
+wifiduino.menu.FlashSize.4M1M.build.spiffs_start=0x300000
+wifiduino.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
+wifiduino.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
+wifiduino.menu.FlashSize.4M2M=4M (2M SPIFFS)
+wifiduino.menu.FlashSize.4M2M.build.flash_size=4M
+wifiduino.menu.FlashSize.4M2M.build.flash_size_bytes=0x400000
+wifiduino.menu.FlashSize.4M2M.build.flash_ld=eagle.flash.4m2m.ld
+wifiduino.menu.FlashSize.4M2M.build.spiffs_pagesize=256
+wifiduino.menu.FlashSize.4M2M.upload.maximum_size=1044464
+wifiduino.menu.FlashSize.4M2M.build.rfcal_addr=0x3FC000
+wifiduino.menu.FlashSize.4M2M.build.spiffs_start=0x200000
+wifiduino.menu.FlashSize.4M2M.build.spiffs_end=0x3FB000
+wifiduino.menu.FlashSize.4M2M.build.spiffs_blocksize=8192
+wifiduino.menu.FlashSize.4M3M=4M (3M SPIFFS)
+wifiduino.menu.FlashSize.4M3M.build.flash_size=4M
+wifiduino.menu.FlashSize.4M3M.build.flash_size_bytes=0x400000
+wifiduino.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
+wifiduino.menu.FlashSize.4M3M.build.spiffs_pagesize=256
+wifiduino.menu.FlashSize.4M3M.upload.maximum_size=1044464
+wifiduino.menu.FlashSize.4M3M.build.rfcal_addr=0x3FC000
+wifiduino.menu.FlashSize.4M3M.build.spiffs_start=0x100000
+wifiduino.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
+wifiduino.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
+wifiduino.menu.LwIPVariant.v2mss536=v2 Lower Memory
+wifiduino.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+wifiduino.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+wifiduino.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+wifiduino.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+wifiduino.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+wifiduino.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+wifiduino.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+wifiduino.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+wifiduino.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+wifiduino.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+wifiduino.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+wifiduino.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+wifiduino.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+wifiduino.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+wifiduino.menu.Debug.Disabled=Disabled
+wifiduino.menu.Debug.Disabled.build.debug_port=
+wifiduino.menu.Debug.Serial=Serial
+wifiduino.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+wifiduino.menu.Debug.Serial1=Serial1
+wifiduino.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+wifiduino.menu.DebugLevel.None____=None
+wifiduino.menu.DebugLevel.None____.build.debug_level=
+wifiduino.menu.DebugLevel.SSL=SSL
+wifiduino.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+wifiduino.menu.DebugLevel.TLS_MEM=TLS_MEM
+wifiduino.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+wifiduino.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+wifiduino.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+wifiduino.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+wifiduino.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+wifiduino.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+wifiduino.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+wifiduino.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+wifiduino.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+wifiduino.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+wifiduino.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+wifiduino.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+wifiduino.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+wifiduino.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifiduino.menu.DebugLevel.CORE=CORE
+wifiduino.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+wifiduino.menu.DebugLevel.WIFI=WIFI
+wifiduino.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+wifiduino.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+wifiduino.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+wifiduino.menu.DebugLevel.UPDATER=UPDATER
+wifiduino.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+wifiduino.menu.DebugLevel.OTA=OTA
+wifiduino.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+wifiduino.menu.DebugLevel.OOM=OOM
+wifiduino.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+wifiduino.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+wifiduino.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+wifiduino.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+wifiduino.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+wifiduino.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+wifiduino.menu.FlashErase.none=Only Sketch
+wifiduino.menu.FlashErase.none.upload.erase_cmd=
+wifiduino.menu.FlashErase.sdk=Sketch + WiFi Settings
+wifiduino.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+wifiduino.menu.FlashErase.all=All Flash Contents
+wifiduino.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+wifiduino.menu.UploadSpeed.921600=921600
+wifiduino.menu.UploadSpeed.921600.upload.speed=921600
+wifiduino.menu.UploadSpeed.9600=9600
+wifiduino.menu.UploadSpeed.9600.upload.speed=9600
+wifiduino.menu.UploadSpeed.57600=57600
+wifiduino.menu.UploadSpeed.57600.upload.speed=57600
+wifiduino.menu.UploadSpeed.115200=115200
+wifiduino.menu.UploadSpeed.115200.upload.speed=115200
+wifiduino.menu.UploadSpeed.230400.linux=230400
+wifiduino.menu.UploadSpeed.230400.macosx=230400
+wifiduino.menu.UploadSpeed.230400.upload.speed=230400
+wifiduino.menu.UploadSpeed.256000.windows=256000
+wifiduino.menu.UploadSpeed.256000.upload.speed=256000
+wifiduino.menu.UploadSpeed.460800.linux=460800
+wifiduino.menu.UploadSpeed.460800.macosx=460800
+wifiduino.menu.UploadSpeed.460800.upload.speed=460800
+wifiduino.menu.UploadSpeed.512000.windows=512000
+wifiduino.menu.UploadSpeed.512000.upload.speed=512000
-coredev.menu.Debug.Disabled=Disabled
-coredev.menu.Debug.Disabled.build.debug_port=
-coredev.menu.Debug.Serial=Serial
-coredev.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
-coredev.menu.Debug.Serial1=Serial1
-coredev.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+##############################################################
+wifi_slot.name=Amperka WiFi Slot
+wifi_slot.build.board=AMPERKA_WIFI_SLOT
+wifi_slot.build.variant=wifi_slot
+wifi_slot.upload.tool=esptool
+wifi_slot.upload.maximum_data_size=81920
+wifi_slot.upload.wait_for_upload_port=true
+wifi_slot.upload.erase_cmd=
+wifi_slot.serial.disableDTR=true
+wifi_slot.serial.disableRTS=true
+wifi_slot.build.mcu=esp8266
+wifi_slot.build.core=esp8266
+wifi_slot.build.spiffs_pagesize=256
+wifi_slot.build.debug_port=
+wifi_slot.build.debug_level=
+wifi_slot.menu.CpuFrequency.80=80 MHz
+wifi_slot.menu.CpuFrequency.80.build.f_cpu=80000000L
+wifi_slot.menu.CpuFrequency.160=160 MHz
+wifi_slot.menu.CpuFrequency.160.build.f_cpu=160000000L
+wifi_slot.menu.VTable.flash=Flash
+wifi_slot.menu.VTable.flash.build.vtable_flags=-DVTABLES_IN_FLASH
+wifi_slot.menu.VTable.heap=Heap
+wifi_slot.menu.VTable.heap.build.vtable_flags=-DVTABLES_IN_DRAM
+wifi_slot.menu.VTable.iram=IRAM
+wifi_slot.menu.VTable.iram.build.vtable_flags=-DVTABLES_IN_IRAM
+wifi_slot.upload.resetmethod=nodemcu
+wifi_slot.menu.FlashFreq.40=40MHz
+wifi_slot.menu.FlashFreq.40.build.flash_freq=40
+wifi_slot.menu.FlashFreq.80=80MHz
+wifi_slot.menu.FlashFreq.80.build.flash_freq=80
+wifi_slot.menu.FlashMode.qio=QIO
+wifi_slot.menu.FlashMode.qio.build.flash_mode=qio
+wifi_slot.menu.FlashMode.qout=QOUT
+wifi_slot.menu.FlashMode.qout.build.flash_mode=qout
+wifi_slot.menu.FlashMode.dio=DIO
+wifi_slot.menu.FlashMode.dio.build.flash_mode=dio
+wifi_slot.menu.FlashMode.dout=DOUT
+wifi_slot.menu.FlashMode.dout.build.flash_mode=dout
+wifi_slot.menu.FlashSize.1M0=1M (no SPIFFS)
+wifi_slot.menu.FlashSize.1M0.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M0.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M0.build.flash_ld=eagle.flash.1m0.ld
+wifi_slot.menu.FlashSize.1M0.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M0.upload.maximum_size=1023984
+wifi_slot.menu.FlashSize.1M0.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M64=1M (64K SPIFFS)
+wifi_slot.menu.FlashSize.1M64.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M64.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
+wifi_slot.menu.FlashSize.1M64.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M64.upload.maximum_size=958448
+wifi_slot.menu.FlashSize.1M64.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M64.build.spiffs_start=0xEB000
+wifi_slot.menu.FlashSize.1M64.build.spiffs_end=0xFB000
+wifi_slot.menu.FlashSize.1M64.build.spiffs_blocksize=4096
+wifi_slot.menu.FlashSize.1M128=1M (128K SPIFFS)
+wifi_slot.menu.FlashSize.1M128.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M128.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
+wifi_slot.menu.FlashSize.1M128.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M128.upload.maximum_size=892912
+wifi_slot.menu.FlashSize.1M128.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M128.build.spiffs_start=0xDB000
+wifi_slot.menu.FlashSize.1M128.build.spiffs_end=0xFB000
+wifi_slot.menu.FlashSize.1M128.build.spiffs_blocksize=4096
+wifi_slot.menu.FlashSize.1M144=1M (144K SPIFFS)
+wifi_slot.menu.FlashSize.1M144.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M144.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M144.build.flash_ld=eagle.flash.1m144.ld
+wifi_slot.menu.FlashSize.1M144.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M144.upload.maximum_size=876528
+wifi_slot.menu.FlashSize.1M144.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M144.build.spiffs_start=0xD7000
+wifi_slot.menu.FlashSize.1M144.build.spiffs_end=0xFB000
+wifi_slot.menu.FlashSize.1M144.build.spiffs_blocksize=4096
+wifi_slot.menu.FlashSize.1M160=1M (160K SPIFFS)
+wifi_slot.menu.FlashSize.1M160.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M160.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M160.build.flash_ld=eagle.flash.1m160.ld
+wifi_slot.menu.FlashSize.1M160.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M160.upload.maximum_size=860144
+wifi_slot.menu.FlashSize.1M160.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M160.build.spiffs_start=0xD3000
+wifi_slot.menu.FlashSize.1M160.build.spiffs_end=0xFB000
+wifi_slot.menu.FlashSize.1M160.build.spiffs_blocksize=4096
+wifi_slot.menu.FlashSize.1M192=1M (192K SPIFFS)
+wifi_slot.menu.FlashSize.1M192.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M192.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M192.build.flash_ld=eagle.flash.1m192.ld
+wifi_slot.menu.FlashSize.1M192.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M192.upload.maximum_size=827376
+wifi_slot.menu.FlashSize.1M192.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M192.build.spiffs_start=0xCB000
+wifi_slot.menu.FlashSize.1M192.build.spiffs_end=0xFB000
+wifi_slot.menu.FlashSize.1M192.build.spiffs_blocksize=4096
+wifi_slot.menu.FlashSize.1M256=1M (256K SPIFFS)
+wifi_slot.menu.FlashSize.1M256.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M256.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
+wifi_slot.menu.FlashSize.1M256.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M256.upload.maximum_size=761840
+wifi_slot.menu.FlashSize.1M256.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M256.build.spiffs_start=0xBB000
+wifi_slot.menu.FlashSize.1M256.build.spiffs_end=0xFB000
+wifi_slot.menu.FlashSize.1M256.build.spiffs_blocksize=4096
+wifi_slot.menu.FlashSize.1M512=1M (512K SPIFFS)
+wifi_slot.menu.FlashSize.1M512.build.flash_size=1M
+wifi_slot.menu.FlashSize.1M512.build.flash_size_bytes=0x100000
+wifi_slot.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
+wifi_slot.menu.FlashSize.1M512.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.1M512.upload.maximum_size=499696
+wifi_slot.menu.FlashSize.1M512.build.rfcal_addr=0xFC000
+wifi_slot.menu.FlashSize.1M512.build.spiffs_start=0x7B000
+wifi_slot.menu.FlashSize.1M512.build.spiffs_end=0xFB000
+wifi_slot.menu.FlashSize.1M512.build.spiffs_blocksize=8192
+wifi_slot.menu.FlashSize.2M=2M (1M SPIFFS)
+wifi_slot.menu.FlashSize.2M.build.flash_size=2M
+wifi_slot.menu.FlashSize.2M.build.flash_size_bytes=0x200000
+wifi_slot.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld
+wifi_slot.menu.FlashSize.2M.build.spiffs_pagesize=256
+wifi_slot.menu.FlashSize.2M.upload.maximum_size=1044464
+wifi_slot.menu.FlashSize.2M.build.rfcal_addr=0x1FC000
+wifi_slot.menu.FlashSize.2M.build.spiffs_start=0x100000
+wifi_slot.menu.FlashSize.2M.build.spiffs_end=0x1FB000
+wifi_slot.menu.FlashSize.2M.build.spiffs_blocksize=8192
+wifi_slot.menu.LwIPVariant.v2mss536=v2 Lower Memory
+wifi_slot.menu.LwIPVariant.v2mss536.build.lwip_include=lwip2/include
+wifi_slot.menu.LwIPVariant.v2mss536.build.lwip_lib=-llwip2
+wifi_slot.menu.LwIPVariant.v2mss536.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536
+wifi_slot.menu.LwIPVariant.v2mss1460=v2 Higher Bandwidth
+wifi_slot.menu.LwIPVariant.v2mss1460.build.lwip_include=lwip2/include
+wifi_slot.menu.LwIPVariant.v2mss1460.build.lwip_lib=-llwip2_1460
+wifi_slot.menu.LwIPVariant.v2mss1460.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460
+wifi_slot.menu.LwIPVariant.Prebuilt=v1.4 Higher Bandwidth
+wifi_slot.menu.LwIPVariant.Prebuilt.build.lwip_lib=-llwip_gcc
+wifi_slot.menu.LwIPVariant.Prebuilt.build.lwip_flags=-DLWIP_OPEN_SRC
+wifi_slot.menu.LwIPVariant.OpenSource=v1.4 Compile from source
+wifi_slot.menu.LwIPVariant.OpenSource.build.lwip_lib=-llwip_src
+wifi_slot.menu.LwIPVariant.OpenSource.build.lwip_flags=-DLWIP_OPEN_SRC
+wifi_slot.menu.LwIPVariant.OpenSource.recipe.hooks.sketch.prebuild.1.pattern=make -C "{runtime.platform.path}/tools/sdk/lwip/src" install TOOLS_PATH="{runtime.tools.xtensa-lx106-elf-gcc.path}/bin/xtensa-lx106-elf-"
+wifi_slot.menu.Debug.Disabled=Disabled
+wifi_slot.menu.Debug.Disabled.build.debug_port=
+wifi_slot.menu.Debug.Serial=Serial
+wifi_slot.menu.Debug.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial
+wifi_slot.menu.Debug.Serial1=Serial1
+wifi_slot.menu.Debug.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1
+wifi_slot.menu.DebugLevel.None____=None
+wifi_slot.menu.DebugLevel.None____.build.debug_level=
+wifi_slot.menu.DebugLevel.SSL=SSL
+wifi_slot.menu.DebugLevel.SSL.build.debug_level= -DDEBUG_ESP_SSL
+wifi_slot.menu.DebugLevel.TLS_MEM=TLS_MEM
+wifi_slot.menu.DebugLevel.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM
+wifi_slot.menu.DebugLevel.HTTP_CLIENT=HTTP_CLIENT
+wifi_slot.menu.DebugLevel.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT
+wifi_slot.menu.DebugLevel.HTTP_SERVER=HTTP_SERVER
+wifi_slot.menu.DebugLevel.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLTLS_MEM=SSL+TLS_MEM
+wifi_slot.menu.DebugLevel.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM
+wifi_slot.menu.DebugLevel.SSLHTTP_CLIENT=SSL+HTTP_CLIENT
+wifi_slot.menu.DebugLevel.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT
+wifi_slot.menu.DebugLevel.SSLHTTP_SERVER=SSL+HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT
+wifi_slot.menu.DebugLevel.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+wifi_slot.menu.DebugLevel.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER
+wifi_slot.menu.DebugLevel.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER
+wifi_slot.menu.DebugLevel.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+wifi_slot.menu.DebugLevel.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER
+wifi_slot.menu.DebugLevel.CORE=CORE
+wifi_slot.menu.DebugLevel.CORE.build.debug_level= -DDEBUG_ESP_CORE
+wifi_slot.menu.DebugLevel.WIFI=WIFI
+wifi_slot.menu.DebugLevel.WIFI.build.debug_level= -DDEBUG_ESP_WIFI
+wifi_slot.menu.DebugLevel.HTTP_UPDATE=HTTP_UPDATE
+wifi_slot.menu.DebugLevel.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE
+wifi_slot.menu.DebugLevel.UPDATER=UPDATER
+wifi_slot.menu.DebugLevel.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER
+wifi_slot.menu.DebugLevel.OTA=OTA
+wifi_slot.menu.DebugLevel.OTA.build.debug_level= -DDEBUG_ESP_OTA
+wifi_slot.menu.DebugLevel.OOM=OOM
+wifi_slot.menu.DebugLevel.OOM.build.debug_level= -DDEBUG_ESP_OOM
+wifi_slot.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+wifi_slot.menu.DebugLevel.COREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM
+wifi_slot.menu.DebugLevel.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOM.build.debug_level= -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_OOM
+wifi_slot.menu.DebugLevel.NoAssert-NDEBUG=NoAssert-NDEBUG
+wifi_slot.menu.DebugLevel.NoAssert-NDEBUG.build.debug_level= -DNDEBUG
+wifi_slot.menu.FlashErase.none=Only Sketch
+wifi_slot.menu.FlashErase.none.upload.erase_cmd=
+wifi_slot.menu.FlashErase.sdk=Sketch + WiFi Settings
+wifi_slot.menu.FlashErase.sdk.upload.erase_cmd=-ca "{build.rfcal_addr}" -cz 0x4000
+wifi_slot.menu.FlashErase.all=All Flash Contents
+wifi_slot.menu.FlashErase.all.upload.erase_cmd=-ca 0x0 -cz "{build.flash_size_bytes}"
+wifi_slot.menu.UploadSpeed.115200=115200
+wifi_slot.menu.UploadSpeed.115200.upload.speed=115200
+wifi_slot.menu.UploadSpeed.9600=9600
+wifi_slot.menu.UploadSpeed.9600.upload.speed=9600
+wifi_slot.menu.UploadSpeed.57600=57600
+wifi_slot.menu.UploadSpeed.57600.upload.speed=57600
+wifi_slot.menu.UploadSpeed.230400.linux=230400
+wifi_slot.menu.UploadSpeed.230400.macosx=230400
+wifi_slot.menu.UploadSpeed.230400.upload.speed=230400
+wifi_slot.menu.UploadSpeed.256000.windows=256000
+wifi_slot.menu.UploadSpeed.256000.upload.speed=256000
+wifi_slot.menu.UploadSpeed.460800.linux=460800
+wifi_slot.menu.UploadSpeed.460800.macosx=460800
+wifi_slot.menu.UploadSpeed.460800.upload.speed=460800
+wifi_slot.menu.UploadSpeed.512000.windows=512000
+wifi_slot.menu.UploadSpeed.512000.upload.speed=512000
+wifi_slot.menu.UploadSpeed.921600=921600
+wifi_slot.menu.UploadSpeed.921600.upload.speed=921600
-coredev.menu.DebugLevel.None____=None
-coredev.menu.DebugLevel.None____.build.debug_level=
-coredev.menu.DebugLevel.Core____=Core
-coredev.menu.DebugLevel.Core____.build.debug_level=-DDEBUG_ESP_CORE
-coredev.menu.DebugLevel.SSL_____=Core + SSL
-coredev.menu.DebugLevel.SSL_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL
-coredev.menu.DebugLevel.SSL_MEM_=Core + SSL + TLS Mem
-coredev.menu.DebugLevel.SSL_MEM_.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_TLS_MEM
-coredev.menu.DebugLevel.WiFic___=Core + WiFi
-coredev.menu.DebugLevel.WiFic___.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI
-coredev.menu.DebugLevel.WiFi____=WiFi
-coredev.menu.DebugLevel.WiFi____.build.debug_level=-DDEBUG_ESP_WIFI
-coredev.menu.DebugLevel.HTTPClient=HTTPClient
-coredev.menu.DebugLevel.HTTPClient.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT
-coredev.menu.DebugLevel.HTTPClient2=HTTPClient + SSL
-coredev.menu.DebugLevel.HTTPClient2.build.debug_level=-DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_SSL
-coredev.menu.DebugLevel.HTTPUpdate=HTTPUpdate
-coredev.menu.DebugLevel.HTTPUpdate.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE
-coredev.menu.DebugLevel.HTTPUpdate2=HTTPClient + HTTPUpdate
-coredev.menu.DebugLevel.HTTPUpdate2.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE
-coredev.menu.DebugLevel.HTTPUpdate3=HTTPClient + HTTPUpdate + Updater
-coredev.menu.DebugLevel.HTTPUpdate3.build.debug_level=-DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER
-coredev.menu.DebugLevel.HTTPServer=HTTPServer
-coredev.menu.DebugLevel.HTTPServer.build.debug_level=-DDEBUG_ESP_HTTP_SERVER
-coredev.menu.DebugLevel.UPDATER=Updater
-coredev.menu.DebugLevel.UPDATER.build.debug_level=-DDEBUG_ESP_UPDATER
-coredev.menu.DebugLevel.OTA_____=OTA
-coredev.menu.DebugLevel.OTA_____.build.debug_level=-DDEBUG_ESP_OTA
-coredev.menu.DebugLevel.OTA2____=OTA + Updater
-coredev.menu.DebugLevel.OTA2____.build.debug_level=-DDEBUG_ESP_OTA -DDEBUG_ESP_UPDATER
-coredev.menu.DebugLevel.all_____=All
-coredev.menu.DebugLevel.all_____.build.debug_level=-DDEBUG_ESP_CORE -DDEBUG_ESP_SSL -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_HTTP_SERVER -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_TLS_MEM
diff --git a/cores/esp8266/Arduino.h b/cores/esp8266/Arduino.h
index 90e2da25db..5424d3baf3 100644
--- a/cores/esp8266/Arduino.h
+++ b/cores/esp8266/Arduino.h
@@ -85,9 +85,13 @@ extern "C" {
#define EXTERNAL 0
//timer dividers
-#define TIM_DIV1 0 //80MHz (80 ticks/us - 104857.588 us max)
-#define TIM_DIV16 1 //5MHz (5 ticks/us - 1677721.4 us max)
-#define TIM_DIV265 3 //312.5Khz (1 tick = 3.2us - 26843542.4 us max)
+enum TIM_DIV_ENUM {
+ TIM_DIV1 = 0, //80MHz (80 ticks/us - 104857.588 us max)
+ TIM_DIV16 = 1, //5MHz (5 ticks/us - 1677721.4 us max)
+ TIM_DIV256 = 3 //312.5Khz (1 tick = 3.2us - 26843542.4 us max)
+};
+
+
//timer int_types
#define TIM_EDGE 0
#define TIM_LEVEL 1
@@ -178,7 +182,7 @@ void ets_intr_unlock();
#define _NOP() do { __asm__ volatile ("nop"); } while (0)
#endif
-typedef unsigned int word;
+typedef uint16_t word;
#define bit(b) (1UL << (b))
#define _BV(b) (1UL << (b))
@@ -202,6 +206,7 @@ void analogWriteRange(uint32_t range);
unsigned long millis(void);
unsigned long micros(void);
+uint64_t micros64(void);
void delay(unsigned long);
void delayMicroseconds(unsigned int us);
unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout);
@@ -235,8 +240,18 @@ void optimistic_yield(uint32_t interval_us);
} // extern "C"
#endif
+
+//for compatibility, below 4 lines to be removed in release 3.0.0
#ifdef __cplusplus
+extern "C"
+#endif
+const int TIM_DIV265 __attribute__((deprecated, weak)) = TIM_DIV256;
+
+
+#ifdef __cplusplus
+
+#include
#include "pgmspace.h"
#include "WCharacter.h"
@@ -247,11 +262,10 @@ void optimistic_yield(uint32_t interval_us);
#include "Updater.h"
#include "debug.h"
-#ifndef _GLIBCXX_VECTOR
-// arduino is not compatible with std::vector
-#define min(a,b) ((a)<(b)?(a):(b))
-#define max(a,b) ((a)>(b)?(a):(b))
-#endif
+using std::min;
+using std::max;
+using std::isinf;
+using std::isnan;
#define _min(a,b) ((a)<(b)?(a):(b))
#define _max(a,b) ((a)>(b)?(a):(b))
@@ -283,3 +297,9 @@ extern "C" void configTime(long timezone, int daylightOffset_sec,
#include "pins_arduino.h"
#endif
+
+#ifdef DEBUG_ESP_OOM
+// reinclude *alloc redefinition because of undefining them
+// this is mandatory for allowing OOM *alloc definitions in .ino files
+#include "umm_malloc/umm_malloc_cfg.h"
+#endif
diff --git a/cores/esp8266/Esp-version.cpp b/cores/esp8266/Esp-version.cpp
new file mode 100644
index 0000000000..866d5d2974
--- /dev/null
+++ b/cores/esp8266/Esp-version.cpp
@@ -0,0 +1,57 @@
+/*
+ Esp.cpp - ESP8266-specific APIs
+ Copyright (c) 2015 Ivan Grokhotkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include
+#include
+#include
+#include // LWIP_VERSION_*
+#include // LWIP_HASH_STR (lwip2)
+#include // BEARSSL_GIT short hash
+
+#define STRHELPER(x) #x
+#define STR(x) STRHELPER(x) // stringifier
+
+static const char arduino_esp8266_git_ver [] PROGMEM = STR(ARDUINO_ESP8266_GIT_DESC);
+#if LWIP_VERSION_MAJOR != 1
+static const char lwip2_version [] PROGMEM = "/lwIP:" STR(LWIP_VERSION_MAJOR) "." STR(LWIP_VERSION_MINOR) "." STR(LWIP_VERSION_REVISION);
+#endif
+static const char bearssl_version [] PROGMEM = "/BearSSL:" STR(BEARSSL_GIT);
+
+String EspClass::getFullVersion()
+{
+ return String(F("SDK:")) + system_get_sdk_version()
+ + F("/Core:") + FPSTR(arduino_esp8266_git_ver)
+#if LWIP_VERSION_MAJOR == 1
+ + F("/lwIP:") + String(LWIP_VERSION_MAJOR) + "." + String(LWIP_VERSION_MINOR) + "." + String(LWIP_VERSION_REVISION)
+#else
+ + FPSTR(lwip2_version)
+#endif
+#if LWIP_VERSION_IS_DEVELOPMENT
+ + F("-dev")
+#endif
+#if LWIP_VERSION_IS_RC
+ + F("rc") + String(LWIP_VERSION_RC)
+#endif
+#ifdef LWIP_HASH_STR
+ + "(" + F(LWIP_HASH_STR) + ")"
+#endif
+ + FPSTR(bearssl_version)
+ ;
+}
diff --git a/cores/esp8266/Esp.cpp b/cores/esp8266/Esp.cpp
index e013fa837e..c8969691b8 100644
--- a/cores/esp8266/Esp.cpp
+++ b/cores/esp8266/Esp.cpp
@@ -83,6 +83,7 @@ EspClass ESP;
void EspClass::wdtEnable(uint32_t timeout_ms)
{
+ (void) timeout_ms;
/// This API can only be called if software watchdog is stopped
system_soft_wdt_restart();
}
@@ -106,13 +107,22 @@ void EspClass::wdtFeed(void)
extern "C" void esp_yield();
-void EspClass::deepSleep(uint32_t time_us, WakeMode mode)
+void EspClass::deepSleep(uint64_t time_us, WakeMode mode)
{
system_deep_sleep_set_option(static_cast(mode));
system_deep_sleep(time_us);
esp_yield();
}
+//this calculation was taken verbatim from the SDK api reference for SDK 2.1.0.
+//Note: system_rtc_clock_cali_proc() returns a uint32_t, even though system_deep_sleep() takes a uint64_t.
+uint64_t EspClass::deepSleepMax()
+{
+ //cali*(2^31-1)/(2^12)
+ return (uint64_t)system_rtc_clock_cali_proc()*(0x80000000-1)/(0x1000);
+
+}
+
bool EspClass::rtcUserMemoryRead(uint32_t offset, uint32_t *data, size_t size)
{
if (size + offset > 512) {
@@ -395,23 +405,16 @@ struct rst_info * EspClass::getResetInfoPtr(void) {
}
bool EspClass::eraseConfig(void) {
- bool ret = true;
- size_t cfgAddr = (ESP.getFlashChipSize() - 0x4000);
- size_t cfgSize = (8*1024);
+ const size_t cfgSize = 0x4000;
+ size_t cfgAddr = ESP.getFlashChipSize() - cfgSize;
- noInterrupts();
- while(cfgSize) {
-
- if(spi_flash_erase_sector((cfgAddr / SPI_FLASH_SEC_SIZE)) != SPI_FLASH_RESULT_OK) {
- ret = false;
+ for (size_t offset = 0; offset < cfgSize; offset += SPI_FLASH_SEC_SIZE) {
+ if (!flashEraseSector((cfgAddr + offset) / SPI_FLASH_SEC_SIZE)) {
+ return false;
}
-
- cfgSize -= SPI_FLASH_SEC_SIZE;
- cfgAddr += SPI_FLASH_SEC_SIZE;
}
- interrupts();
- return ret;
+ return true;
}
uint32_t EspClass::getSketchSize() {
@@ -432,7 +435,7 @@ uint32_t EspClass::getSketchSize() {
section_index < image_header.num_segments;
++section_index)
{
- section_header_t section_header = {0};
+ section_header_t section_header = {0, 0};
if (spi_flash_read(pos, (uint32_t*) §ion_header, sizeof(section_header))) {
return 0;
}
diff --git a/cores/esp8266/Esp.h b/cores/esp8266/Esp.h
index e6754019db..43842a6ae7 100644
--- a/cores/esp8266/Esp.h
+++ b/cores/esp8266/Esp.h
@@ -92,7 +92,8 @@ class EspClass {
void wdtDisable();
void wdtFeed();
- void deepSleep(uint32_t time_us, RFMode mode = RF_DEFAULT);
+ void deepSleep(uint64_t time_us, RFMode mode = RF_DEFAULT);
+ uint64_t deepSleepMax();
bool rtcUserMemoryRead(uint32_t offset, uint32_t *data, size_t size);
bool rtcUserMemoryWrite(uint32_t offset, uint32_t *data, size_t size);
@@ -107,6 +108,7 @@ class EspClass {
const char * getSdkVersion();
String getCoreVersion();
+ String getFullVersion();
uint8_t getBootVersion();
uint8_t getBootMode();
diff --git a/cores/esp8266/FunctionalInterrupt.cpp b/cores/esp8266/FunctionalInterrupt.cpp
new file mode 100644
index 0000000000..b7c7dd1434
--- /dev/null
+++ b/cores/esp8266/FunctionalInterrupt.cpp
@@ -0,0 +1,24 @@
+#include
+
+
+// Duplicate typedefs from core_esp8266_wiring_digital_c
+typedef void (*voidFuncPtr)(void);
+
+// Helper functions for Functional interrupt routines
+extern "C" void ICACHE_RAM_ATTR __attachInterruptArg(uint8_t pin, voidFuncPtr userFunc, void*fp , int mode);
+
+// Structure for communication
+struct ArgStructure {
+ std::function reqFunction;
+};
+
+void interruptFunctional(void* arg)
+{
+ ((ArgStructure*)arg)->reqFunction();
+}
+
+void attachInterrupt(uint8_t pin, std::function intRoutine, int mode)
+{
+ // use the local interrupt routine which takes the ArgStructure as argument
+ __attachInterruptArg (pin, (voidFuncPtr)interruptFunctional, new ArgStructure{intRoutine}, mode);
+}
diff --git a/cores/esp8266/FunctionalInterrupt.h b/cores/esp8266/FunctionalInterrupt.h
new file mode 100644
index 0000000000..fedc20ad68
--- /dev/null
+++ b/cores/esp8266/FunctionalInterrupt.h
@@ -0,0 +1,15 @@
+#ifndef FUNCTIONALINTERRUPT_H
+#define FUNCTIONALINTERRUPT_H
+
+#include
+#include
+#include
+
+extern "C" {
+#include "c_types.h"
+#include "ets_sys.h"
+}
+
+void attachInterrupt(uint8_t pin, std::function intRoutine, int mode);
+
+#endif //INTERRUPTS_H
diff --git a/cores/esp8266/HardwareSerial.cpp b/cores/esp8266/HardwareSerial.cpp
index 979b0c0da4..416aa73c43 100644
--- a/cores/esp8266/HardwareSerial.cpp
+++ b/cores/esp8266/HardwareSerial.cpp
@@ -29,7 +29,7 @@
#include
#include "Arduino.h"
#include "HardwareSerial.h"
-
+#include "Esp.h"
HardwareSerial::HardwareSerial(int uart_nr)
: _uart_nr(uart_nr), _rx_size(256)
@@ -39,6 +39,14 @@ void HardwareSerial::begin(unsigned long baud, SerialConfig config, SerialMode m
{
end();
_uart = uart_init(_uart_nr, baud, (int) config, (int) mode, tx_pin, _rx_size);
+#if defined(DEBUG_ESP_PORT) && !defined(NDEBUG)
+ if (static_cast(this) == static_cast(&DEBUG_ESP_PORT))
+ {
+ setDebugOutput(true);
+ println();
+ println(ESP.getFullVersion());
+ }
+#endif
}
void HardwareSerial::end()
@@ -47,10 +55,8 @@ void HardwareSerial::end()
uart_set_debug(UART_NO);
}
- if (_uart) {
- uart_uninit(_uart);
- _uart = NULL;
- }
+ uart_uninit(_uart);
+ _uart = NULL;
}
size_t HardwareSerial::setRxBufferSize(size_t size){
@@ -62,30 +68,6 @@ size_t HardwareSerial::setRxBufferSize(size_t size){
return _rx_size;
}
-void HardwareSerial::swap(uint8_t tx_pin)
-{
- if(!_uart) {
- return;
- }
- uart_swap(_uart, tx_pin);
-}
-
-void HardwareSerial::set_tx(uint8_t tx_pin)
-{
- if(!_uart) {
- return;
- }
- uart_set_tx(_uart, tx_pin);
-}
-
-void HardwareSerial::pins(uint8_t tx, uint8_t rx)
-{
- if(!_uart) {
- return;
- }
- uart_set_pins(_uart, tx, rx);
-}
-
void HardwareSerial::setDebugOutput(bool en)
{
if(!_uart) {
@@ -105,16 +87,6 @@ void HardwareSerial::setDebugOutput(bool en)
}
}
-bool HardwareSerial::isTxEnabled(void)
-{
- return _uart && uart_tx_enabled(_uart);
-}
-
-bool HardwareSerial::isRxEnabled(void)
-{
- return _uart && uart_rx_enabled(_uart);
-}
-
int HardwareSerial::available(void)
{
int result = static_cast(uart_rx_available(_uart));
@@ -124,27 +96,6 @@ int HardwareSerial::available(void)
return result;
}
-int HardwareSerial::peek(void)
-{
- // this may return -1, but that's okay
- return uart_peek_char(_uart);
-}
-
-int HardwareSerial::read(void)
-{
- // this may return -1, but that's okay
- return uart_read_char(_uart);
-}
-
-int HardwareSerial::availableForWrite(void)
-{
- if(!_uart || !uart_tx_enabled(_uart)) {
- return 0;
- }
-
- return static_cast(uart_tx_free(_uart));
-}
-
void HardwareSerial::flush()
{
if(!_uart || !uart_tx_enabled(_uart)) {
@@ -152,30 +103,14 @@ void HardwareSerial::flush()
}
uart_wait_tx_empty(_uart);
+ //Workaround for a bug in serial not actually being finished yet
+ //Wait for 8 data bits, 1 parity and 2 stop bits, just in case
+ delayMicroseconds(11000000 / uart_get_baudrate(_uart) + 1);
}
-size_t HardwareSerial::write(uint8_t c)
-{
- if(!_uart || !uart_tx_enabled(_uart)) {
- return 0;
- }
-
- uart_write_char(_uart, c);
- return 1;
-}
-
-int HardwareSerial::baudRate(void)
-{
- // Null pointer on _uart is checked by SDK
- return uart_get_baudrate(_uart);
-}
-
-
-HardwareSerial::operator bool() const
-{
- return _uart != 0;
-}
-
-
+#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
HardwareSerial Serial(UART0);
+#endif
+#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL1)
HardwareSerial Serial1(UART1);
+#endif
diff --git a/cores/esp8266/HardwareSerial.h b/cores/esp8266/HardwareSerial.h
index 4b384fee53..0333d4ca87 100644
--- a/cores/esp8266/HardwareSerial.h
+++ b/cores/esp8266/HardwareSerial.h
@@ -93,26 +93,50 @@ class HardwareSerial: public Stream
{
swap(1);
}
- void swap(uint8_t tx_pin); //toggle between use of GPIO13/GPIO15 or GPIO3/GPIO(1/2) as RX and TX
+ void swap(uint8_t tx_pin) //toggle between use of GPIO13/GPIO15 or GPIO3/GPIO(1/2) as RX and TX
+ {
+ uart_swap(_uart, tx_pin);
+ }
/*
* Toggle between use of GPIO1 and GPIO2 as TX on UART 0.
* Note: UART 1 can't be used if GPIO2 is used with UART 0!
*/
- void set_tx(uint8_t tx_pin);
+ void set_tx(uint8_t tx_pin)
+ {
+ uart_set_tx(_uart, tx_pin);
+ }
/*
* UART 0 possible options are (1, 3), (2, 3) or (15, 13)
* UART 1 allows only TX on 2 if UART 0 is not (2, 3)
*/
- void pins(uint8_t tx, uint8_t rx);
+ void pins(uint8_t tx, uint8_t rx)
+ {
+ uart_set_pins(_uart, tx, rx);
+ }
int available(void) override;
- int peek(void) override;
- int read(void) override;
- int availableForWrite(void);
+
+ int peek(void) override
+ {
+ // this may return -1, but that's okay
+ return uart_peek_char(_uart);
+ }
+ int read(void) override
+ {
+ // this may return -1, but that's okay
+ return uart_read_char(_uart);
+ }
+ int availableForWrite(void)
+ {
+ return static_cast(uart_tx_free(_uart));
+ }
void flush(void) override;
- size_t write(uint8_t) override;
+ size_t write(uint8_t c) override
+ {
+ return uart_write_char(_uart, c);
+ }
inline size_t write(unsigned long n)
{
return write((uint8_t) n);
@@ -129,13 +153,36 @@ class HardwareSerial: public Stream
{
return write((uint8_t) n);
}
- using Print::write; // pull in write(str) and write(buf, size) from Print
- operator bool() const;
-
+ size_t write(const uint8_t *buffer, size_t size)
+ {
+ return uart_write(_uart, (const char*)buffer, size);
+ }
+ size_t write(const char *buffer)
+ {
+ return buffer? uart_write(_uart, buffer, strlen(buffer)): 0;
+ }
+ operator bool() const
+ {
+ return _uart != 0;
+ }
void setDebugOutput(bool);
- bool isTxEnabled(void);
- bool isRxEnabled(void);
- int baudRate(void);
+ bool isTxEnabled(void)
+ {
+ return uart_tx_enabled(_uart);
+ }
+ bool isRxEnabled(void)
+ {
+ return uart_rx_enabled(_uart);
+ }
+ int baudRate(void)
+ {
+ return uart_get_baudrate(_uart);
+ }
+
+ bool hasOverrun(void)
+ {
+ return uart_has_overrun(_uart);
+ }
protected:
int _uart_nr;
diff --git a/cores/esp8266/IPAddress.cpp b/cores/esp8266/IPAddress.cpp
index 3349c2c5b1..ab051bfe38 100644
--- a/cores/esp8266/IPAddress.cpp
+++ b/cores/esp8266/IPAddress.cpp
@@ -112,4 +112,12 @@ String IPAddress::toString() const
return String(szRet);
}
+bool IPAddress::isValid(const String& arg) {
+ return IPAddress().fromString(arg);
+}
+
+bool IPAddress::isValid(const char* arg) {
+ return IPAddress().fromString(arg);
+}
+
const IPAddress INADDR_NONE(0, 0, 0, 0);
diff --git a/cores/esp8266/IPAddress.h b/cores/esp8266/IPAddress.h
index 1d0d3acafd..0ef1eba725 100644
--- a/cores/esp8266/IPAddress.h
+++ b/cores/esp8266/IPAddress.h
@@ -79,6 +79,14 @@ class IPAddress: public Printable {
virtual size_t printTo(Print& p) const;
String toString() const;
+ /*
+ check if input string(arg) is a valid IPV4 address or not.
+ return true on valid.
+ return false on invalid.
+ */
+ static bool isValid(const String& arg);
+ static bool isValid(const char* arg);
+
friend class EthernetClass;
friend class UDP;
friend class Client;
diff --git a/cores/esp8266/MD5Builder.cpp b/cores/esp8266/MD5Builder.cpp
index ac4fa29ee2..b32693ed73 100644
--- a/cores/esp8266/MD5Builder.cpp
+++ b/cores/esp8266/MD5Builder.cpp
@@ -1,26 +1,22 @@
#include
#include
-uint8_t hex_char_to_byte(uint8_t c)
-{
+uint8_t hex_char_to_byte(uint8_t c){
return (c >= 'a' && c <= 'f') ? (c - ((uint8_t)'a' - 0xa)) :
(c >= 'A' && c <= 'F') ? (c - ((uint8_t)'A' - 0xA)) :
(c >= '0' && c<= '9') ? (c - (uint8_t)'0') : 0;
}
-void MD5Builder::begin(void)
-{
+void MD5Builder::begin(void){
memset(_buf, 0x00, 16);
MD5Init(&_ctx);
}
-void MD5Builder::add(uint8_t * data, uint16_t len)
-{
+void MD5Builder::add(const uint8_t * data, const uint16_t len){
MD5Update(&_ctx, data, len);
}
-void MD5Builder::addHexString(const char * data)
-{
+void MD5Builder::addHexString(const char * data){
uint16_t i, len = strlen(data);
uint8_t * tmp = (uint8_t*)malloc(len/2);
if(tmp == NULL) {
@@ -35,8 +31,7 @@ void MD5Builder::addHexString(const char * data)
free(tmp);
}
-bool MD5Builder::addStream(Stream & stream, const size_t maxLen)
-{
+bool MD5Builder::addStream(Stream & stream, const size_t maxLen){
const int buf_size = 512;
int maxLengthLeft = maxLen;
uint8_t * buf = (uint8_t*) malloc(buf_size);
@@ -76,25 +71,21 @@ bool MD5Builder::addStream(Stream & stream, const size_t maxLen)
return true;
}
-void MD5Builder::calculate(void)
-{
+void MD5Builder::calculate(void){
MD5Final(_buf, &_ctx);
}
-void MD5Builder::getBytes(uint8_t * output)
-{
+void MD5Builder::getBytes(uint8_t * output){
memcpy(output, _buf, 16);
}
-void MD5Builder::getChars(char * output)
-{
+void MD5Builder::getChars(char * output){
for(uint8_t i = 0; i < 16; i++) {
sprintf(output + (i * 2), "%02x", _buf[i]);
}
}
-String MD5Builder::toString(void)
-{
+String MD5Builder::toString(void){
char out[33];
getChars(out);
return String(out);
diff --git a/cores/esp8266/MD5Builder.h b/cores/esp8266/MD5Builder.h
index d4e336fca9..0a2f22b43b 100644
--- a/cores/esp8266/MD5Builder.h
+++ b/cores/esp8266/MD5Builder.h
@@ -1,9 +1,9 @@
-/*
+/*
md5.h - exposed md5 ROM functions for esp8266
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -31,13 +31,13 @@ class MD5Builder {
uint8_t _buf[16];
public:
void begin(void);
- void add(uint8_t * data, uint16_t len);
- void add(const char * data){ add((uint8_t*)data, strlen(data)); }
+ void add(const uint8_t * data, const uint16_t len);
+ void add(const char * data){ add((const uint8_t*)data, strlen(data)); }
void add(char * data){ add((const char*)data); }
- void add(String data){ add(data.c_str()); }
+ void add(const String data){ add(data.c_str()); }
void addHexString(const char * data);
void addHexString(char * data){ addHexString((const char*)data); }
- void addHexString(String data){ addHexString(data.c_str()); }
+ void addHexString(const String data){ addHexString(data.c_str()); }
bool addStream(Stream & stream, const size_t maxLen);
void calculate(void);
void getBytes(uint8_t * output);
diff --git a/cores/esp8266/Print.cpp b/cores/esp8266/Print.cpp
index 0c3d362ab7..c276d8e982 100644
--- a/cores/esp8266/Print.cpp
+++ b/cores/esp8266/Print.cpp
@@ -33,9 +33,24 @@
/* default implementation: may be overridden */
size_t Print::write(const uint8_t *buffer, size_t size) {
+
+#ifdef DEBUG_ESP_CORE
+ static char not_the_best_way [] ICACHE_RODATA_ATTR STORE_ATTR = "Print::write(data,len) should be overridden for better efficiency\r\n";
+ static bool once = false;
+ if (!once) {
+ once = true;
+ os_printf_plus(not_the_best_way);
+ }
+#endif
+
size_t n = 0;
- while(size--) {
- n += write(*buffer++);
+ while (size--) {
+ size_t ret = write(*buffer++);
+ if (ret == 0) {
+ // Write of last byte didn't complete, abort additional processing
+ break;
+ }
+ n += ret;
}
return n;
}
diff --git a/cores/esp8266/Print.h b/cores/esp8266/Print.h
index 69f5ad6216..73a955b4dd 100644
--- a/cores/esp8266/Print.h
+++ b/cores/esp8266/Print.h
@@ -89,6 +89,8 @@ class Print {
size_t println(double, int = 2);
size_t println(const Printable&);
size_t println(void);
+
+ virtual void flush() { /* Empty implementation for backward compatibility */ }
};
#endif
diff --git a/cores/esp8266/Schedule.cpp b/cores/esp8266/Schedule.cpp
index 5c3861200e..27b9731954 100644
--- a/cores/esp8266/Schedule.cpp
+++ b/cores/esp8266/Schedule.cpp
@@ -14,25 +14,6 @@ static scheduled_fn_t* sLastUnused = 0;
static int sCount = 0;
-static void init_lists()
-{
- if (sCount != 0) {
- return;
- }
- while (sCount < SCHEDULED_FN_INITIAL_COUNT) {
- scheduled_fn_t* it = new scheduled_fn_t;
- if (sCount == 0) {
- sFirstUnused = it;
- }
- else {
- sLastUnused->mNext = it;
- }
- sLastUnused = it;
- ++sCount;
- }
- sLastUnused->mNext = NULL;
-}
-
static scheduled_fn_t* get_fn() {
scheduled_fn_t* result = NULL;
// try to get an item from unused items list
@@ -84,12 +65,12 @@ bool schedule_function(std::function fn)
void run_scheduled_functions()
{
- while (sFirst) {
- scheduled_fn_t* item = sFirst;
- sFirst = item->mNext;
- if (sFirst == NULL) {
- sLast = NULL;
- }
+ scheduled_fn_t* rFirst = sFirst;
+ sFirst = NULL;
+ sLast = NULL;
+ while (rFirst) {
+ scheduled_fn_t* item = rFirst;
+ rFirst = item->mNext;
item->mFunc();
item->mFunc = std::function();
recycle_fn(item);
diff --git a/cores/esp8266/Stream.h b/cores/esp8266/Stream.h
index 6d2646d77c..290971cf42 100644
--- a/cores/esp8266/Stream.h
+++ b/cores/esp8266/Stream.h
@@ -47,7 +47,6 @@ class Stream: public Print {
virtual int available() = 0;
virtual int read() = 0;
virtual int peek() = 0;
- virtual void flush() = 0;
Stream() {
_timeout = 1000;
diff --git a/cores/esp8266/Tone.cpp b/cores/esp8266/Tone.cpp
index bcdd358a85..fb7837ee46 100644
--- a/cores/esp8266/Tone.cpp
+++ b/cores/esp8266/Tone.cpp
@@ -64,6 +64,13 @@ void tone(uint8_t _pin, unsigned int frequency, unsigned long duration) {
// Set the pinMode as OUTPUT
pinMode(_pin, OUTPUT);
+ // Alternate handling of zero freqency to avoid divide by zero errors
+ if (frequency == 0)
+ {
+ noTone(_pin);
+ return;
+ }
+
// Calculate the toggle count
if (duration > 0) {
toggle_counts[_index] = 2 * frequency * duration / 1000;
diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp
index 258d899c3a..e01eca0bc6 100644
--- a/cores/esp8266/Updater.cpp
+++ b/cores/esp8266/Updater.cpp
@@ -2,6 +2,7 @@
#include "Arduino.h"
#include "eboot_command.h"
#include "interrupts.h"
+#include "esp8266_peri.h"
//#define DEBUG_UPDATER Serial
@@ -39,35 +40,40 @@ void UpdaterClass::_reset() {
bool UpdaterClass::begin(size_t size, int command) {
if(_size > 0){
#ifdef DEBUG_UPDATER
- DEBUG_UPDATER.println("[begin] already running");
+ DEBUG_UPDATER.println(F("[begin] already running"));
#endif
return false;
}
+ /* Check boot mode; if boot mode is 1 (UART download mode),
+ we will not be able to reset into normal mode once update is done.
+ Fail early to avoid frustration.
+ https://github.com/esp8266/Arduino/issues/1017#issuecomment-200605576
+ */
+ int boot_mode = (GPI >> 16) & 0xf;
+ if (boot_mode == 1) {
+ _setError(UPDATE_ERROR_BOOTSTRAP);
+ return false;
+ }
+
#ifdef DEBUG_UPDATER
if (command == U_SPIFFS) {
- DEBUG_UPDATER.println("[begin] Update SPIFFS.");
+ DEBUG_UPDATER.println(F("[begin] Update SPIFFS."));
}
#endif
if(size == 0) {
- _error = UPDATE_ERROR_SIZE;
-#ifdef DEBUG_UPDATER
- printError(DEBUG_UPDATER);
-#endif
+ _setError(UPDATE_ERROR_SIZE);
return false;
}
if(!ESP.checkFlashConfig(false)) {
- _error = UPDATE_ERROR_FLASH_CONFIG;
-#ifdef DEBUG_UPDATER
- printError(DEBUG_UPDATER);
-#endif
+ _setError(UPDATE_ERROR_FLASH_CONFIG);
return false;
}
_reset();
- _error = 0;
+ clearError(); // _error = 0
wifi_set_sleep_type(NONE_SLEEP_T);
@@ -80,7 +86,7 @@ bool UpdaterClass::begin(size_t size, int command) {
//size of the update rounded to a sector
uint32_t roundedSize = (size + FLASH_SECTOR_SIZE - 1) & (~(FLASH_SECTOR_SIZE - 1));
//address where we will start writing the update
- updateStartAddress = updateEndAddress - roundedSize;
+ updateStartAddress = (updateEndAddress > roundedSize)? (updateEndAddress - roundedSize) : 0;
#ifdef DEBUG_UPDATER
DEBUG_UPDATER.printf("[begin] roundedSize: 0x%08X (%d)\n", roundedSize, roundedSize);
@@ -90,10 +96,7 @@ bool UpdaterClass::begin(size_t size, int command) {
//make sure that the size of both sketches is less than the total space (updateEndAddress)
if(updateStartAddress < currentSketchSize) {
- _error = UPDATE_ERROR_SPACE;
-#ifdef DEBUG_UPDATER
- printError(DEBUG_UPDATER);
-#endif
+ _setError(UPDATE_ERROR_SPACE);
return false;
}
}
@@ -103,7 +106,7 @@ bool UpdaterClass::begin(size_t size, int command) {
else {
// unknown command
#ifdef DEBUG_UPDATER
- DEBUG_UPDATER.println("[begin] Unknown update command.");
+ DEBUG_UPDATER.println(F("[begin] Unknown update command."));
#endif
return false;
}
@@ -112,7 +115,12 @@ bool UpdaterClass::begin(size_t size, int command) {
_startAddress = updateStartAddress;
_currentAddress = _startAddress;
_size = size;
- _buffer = new uint8_t[FLASH_SECTOR_SIZE];
+ if (ESP.getFreeHeap() > 2 * FLASH_SECTOR_SIZE) {
+ _bufferSize = FLASH_SECTOR_SIZE;
+ } else {
+ _bufferSize = 256;
+ }
+ _buffer = new uint8_t[_bufferSize];
_command = command;
#ifdef DEBUG_UPDATER
@@ -137,7 +145,7 @@ bool UpdaterClass::setMD5(const char * expected_md5){
bool UpdaterClass::end(bool evenIfRemaining){
if(_size == 0){
#ifdef DEBUG_UPDATER
- DEBUG_UPDATER.println("no update");
+ DEBUG_UPDATER.println(F("no update"));
#endif
return false;
}
@@ -161,10 +169,7 @@ bool UpdaterClass::end(bool evenIfRemaining){
_md5.calculate();
if(_target_md5.length()) {
if(_target_md5 != _md5.toString()){
- _error = UPDATE_ERROR_MD5;
-#ifdef DEBUG_UPDATER
- DEBUG_UPDATER.printf("MD5 Failed: expected:%s, calculated:%s\n", _target_md5.c_str(), _md5.toString().c_str());
-#endif
+ _setError(UPDATE_ERROR_MD5);
_reset();
return false;
}
@@ -174,9 +179,6 @@ bool UpdaterClass::end(bool evenIfRemaining){
}
if(!_verifyEnd()) {
-#ifdef DEBUG_UPDATER
- printError(DEBUG_UPDATER);
-#endif
_reset();
return false;
}
@@ -203,20 +205,24 @@ bool UpdaterClass::end(bool evenIfRemaining){
bool UpdaterClass::_writeBuffer(){
- if(!_async) yield();
- bool result = ESP.flashEraseSector(_currentAddress/FLASH_SECTOR_SIZE);
- if(!_async) yield();
- if (result) {
- result = ESP.flashWrite(_currentAddress, (uint32_t*) _buffer, _bufferLen);
+ bool eraseResult = true, writeResult = true;
+ if (_currentAddress % FLASH_SECTOR_SIZE == 0) {
+ if(!_async) yield();
+ eraseResult = ESP.flashEraseSector(_currentAddress/FLASH_SECTOR_SIZE);
+ }
+
+ if (eraseResult) {
+ if(!_async) yield();
+ writeResult = ESP.flashWrite(_currentAddress, (uint32_t*) _buffer, _bufferLen);
+ } else { // if erase was unsuccessful
+ _currentAddress = (_startAddress + _size);
+ _setError(UPDATE_ERROR_ERASE);
+ return false;
}
- if(!_async) yield();
- if (!result) {
- _error = UPDATE_ERROR_WRITE;
+ if (!writeResult) {
_currentAddress = (_startAddress + _size);
-#ifdef DEBUG_UPDATER
- printError(DEBUG_UPDATER);
-#endif
+ _setError(UPDATE_ERROR_WRITE);
return false;
}
_md5.add(_buffer, _bufferLen);
@@ -232,14 +238,14 @@ size_t UpdaterClass::write(uint8_t *data, size_t len) {
if(len > remaining()){
//len = remaining();
//fail instead
- _error = UPDATE_ERROR_SPACE;
+ _setError(UPDATE_ERROR_SPACE);
return 0;
}
size_t left = len;
- while((_bufferLen + left) > FLASH_SECTOR_SIZE) {
- size_t toBuff = FLASH_SECTOR_SIZE - _bufferLen;
+ while((_bufferLen + left) > _bufferSize) {
+ size_t toBuff = _bufferSize - _bufferLen;
memcpy(_buffer + _bufferLen, data + (len - left), toBuff);
_bufferLen += toBuff;
if(!_writeBuffer()){
@@ -264,8 +270,8 @@ bool UpdaterClass::_verifyHeader(uint8_t data) {
if(_command == U_FLASH) {
// check for valid first magic byte (is always 0xE9)
if(data != 0xE9) {
- _error = UPDATE_ERROR_MAGIC_BYTE;
_currentAddress = (_startAddress + _size);
+ _setError(UPDATE_ERROR_MAGIC_BYTE);
return false;
}
return true;
@@ -281,15 +287,15 @@ bool UpdaterClass::_verifyEnd() {
uint8_t buf[4];
if(!ESP.flashRead(_startAddress, (uint32_t *) &buf[0], 4)) {
- _error = UPDATE_ERROR_READ;
_currentAddress = (_startAddress);
+ _setError(UPDATE_ERROR_READ);
return false;
}
// check for valid first magic byte
if(buf[0] != 0xE9) {
- _error = UPDATE_ERROR_MAGIC_BYTE;
_currentAddress = (_startAddress);
+ _setError(UPDATE_ERROR_MAGIC_BYTE);
return false;
}
@@ -297,8 +303,8 @@ bool UpdaterClass::_verifyEnd() {
// check if new bin fits to SPI flash
if(bin_flash_size > ESP.getFlashChipRealSize()) {
- _error = UPDATE_ERROR_NEW_FLASH_CONFIG;
_currentAddress = (_startAddress);
+ _setError(UPDATE_ERROR_NEW_FLASH_CONFIG);
return false;
}
@@ -325,22 +331,19 @@ size_t UpdaterClass::writeStream(Stream &data) {
}
while(remaining()) {
- toRead = data.readBytes(_buffer + _bufferLen, (FLASH_SECTOR_SIZE - _bufferLen));
+ toRead = data.readBytes(_buffer + _bufferLen, (_bufferSize - _bufferLen));
if(toRead == 0) { //Timeout
delay(100);
- toRead = data.readBytes(_buffer + _bufferLen, (FLASH_SECTOR_SIZE - _bufferLen));
+ toRead = data.readBytes(_buffer + _bufferLen, (_bufferSize - _bufferLen));
if(toRead == 0) { //Timeout
- _error = UPDATE_ERROR_STREAM;
_currentAddress = (_startAddress + _size);
-#ifdef DEBUG_UPDATER
- printError(DEBUG_UPDATER);
-#endif
+ _setError(UPDATE_ERROR_STREAM);
_reset();
return written;
}
}
_bufferLen += toRead;
- if((_bufferLen == remaining() || _bufferLen == FLASH_SECTOR_SIZE) && !_writeBuffer())
+ if((_bufferLen == remaining() || _bufferLen == _bufferSize) && !_writeBuffer())
return written;
written += toRead;
yield();
@@ -348,32 +351,42 @@ size_t UpdaterClass::writeStream(Stream &data) {
return written;
}
-void UpdaterClass::printError(Stream &out){
- out.printf("ERROR[%u]: ", _error);
+void UpdaterClass::_setError(int error){
+ _error = error;
+#ifdef DEBUG_UPDATER
+ printError(DEBUG_UPDATER);
+#endif
+}
+
+void UpdaterClass::printError(Print &out){
+ out.printf_P(PSTR("ERROR[%u]: "), _error);
if(_error == UPDATE_ERROR_OK){
- out.println("No Error");
+ out.println(F("No Error"));
} else if(_error == UPDATE_ERROR_WRITE){
- out.println("Flash Write Failed");
+ out.println(F("Flash Write Failed"));
} else if(_error == UPDATE_ERROR_ERASE){
- out.println("Flash Erase Failed");
+ out.println(F("Flash Erase Failed"));
} else if(_error == UPDATE_ERROR_READ){
- out.println("Flash Read Failed");
+ out.println(F("Flash Read Failed"));
} else if(_error == UPDATE_ERROR_SPACE){
- out.println("Not Enough Space");
+ out.println(F("Not Enough Space"));
} else if(_error == UPDATE_ERROR_SIZE){
- out.println("Bad Size Given");
+ out.println(F("Bad Size Given"));
} else if(_error == UPDATE_ERROR_STREAM){
- out.println("Stream Read Timeout");
+ out.println(F("Stream Read Timeout"));
} else if(_error == UPDATE_ERROR_MD5){
- out.println("MD5 Check Failed");
+ //out.println(F("MD5 Check Failed"));
+ out.printf("MD5 Failed: expected:%s, calculated:%s\n", _target_md5.c_str(), _md5.toString().c_str());
} else if(_error == UPDATE_ERROR_FLASH_CONFIG){
- out.printf("Flash config wrong real: %d IDE: %d\n", ESP.getFlashChipRealSize(), ESP.getFlashChipSize());
+ out.printf_P(PSTR("Flash config wrong real: %d IDE: %d\n"), ESP.getFlashChipRealSize(), ESP.getFlashChipSize());
} else if(_error == UPDATE_ERROR_NEW_FLASH_CONFIG){
- out.printf("new Flash config wrong real: %d\n", ESP.getFlashChipRealSize());
+ out.printf_P(PSTR("new Flash config wrong real: %d\n"), ESP.getFlashChipRealSize());
} else if(_error == UPDATE_ERROR_MAGIC_BYTE){
- out.println("Magic byte is wrong, not 0xE9");
+ out.println(F("Magic byte is wrong, not 0xE9"));
+ } else if (_error == UPDATE_ERROR_BOOTSTRAP){
+ out.println(F("Invalid bootstrapping state, reset ESP8266 before updating"));
} else {
- out.println("UNKNOWN");
+ out.println(F("UNKNOWN"));
}
}
diff --git a/cores/esp8266/Updater.h b/cores/esp8266/Updater.h
index 046ff1667b..2509988ca8 100644
--- a/cores/esp8266/Updater.h
+++ b/cores/esp8266/Updater.h
@@ -16,7 +16,7 @@
#define UPDATE_ERROR_FLASH_CONFIG (8)
#define UPDATE_ERROR_NEW_FLASH_CONFIG (9)
#define UPDATE_ERROR_MAGIC_BYTE (10)
-
+#define UPDATE_ERROR_BOOTSTRAP (11)
#define U_FLASH 0
#define U_SPIFFS 100
@@ -61,18 +61,18 @@ class UpdaterClass {
If all bytes are written
this call will write the config to eboot
and return true
- If there is already an update running but is not finished and !evenIfRemainanig
+ If there is already an update running but is not finished and !evenIfRemaining
or there is an error
this will clear everything and return false
the last error is available through getError()
- evenIfRemaining is helpfull when you update without knowing the final size first
+ evenIfRemaining is helpful when you update without knowing the final size first
*/
bool end(bool evenIfRemaining = false);
/*
Prints the last error to an output stream
*/
- void printError(Stream &out);
+ void printError(Print &out);
/*
sets the expected MD5 for the firmware (hexString)
@@ -116,8 +116,8 @@ class UpdaterClass {
if(_bufferLen + available > remaining()){
available = remaining() - _bufferLen;
}
- if(_bufferLen + available > FLASH_SECTOR_SIZE) {
- size_t toBuff = FLASH_SECTOR_SIZE - _bufferLen;
+ if(_bufferLen + available > _bufferSize) {
+ size_t toBuff = _bufferSize - _bufferLen;
data.read(_buffer + _bufferLen, toBuff);
_bufferLen += toBuff;
if(!_writeBuffer())
@@ -148,10 +148,13 @@ class UpdaterClass {
bool _verifyHeader(uint8_t data);
bool _verifyEnd();
+ void _setError(int error);
+
bool _async;
uint8_t _error;
uint8_t *_buffer;
- size_t _bufferLen;
+ size_t _bufferLen; // amount of data written into _buffer
+ size_t _bufferSize; // total size of _buffer
size_t _size;
uint32_t _startAddress;
uint32_t _currentAddress;
diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp
index c66f5da957..c81b594d6c 100644
--- a/cores/esp8266/WString.cpp
+++ b/cores/esp8266/WString.cpp
@@ -113,10 +113,7 @@ String::String(double value, unsigned char decimalPlaces) {
}
String::~String() {
- if(buffer) {
- free(buffer);
- }
- init();
+ invalidate();
}
// /*********************************************/
@@ -159,7 +156,6 @@ unsigned char String::changeBuffer(unsigned int maxStrLen) {
buffer = newbuffer;
return 1;
}
- buffer = newbuffer;
return 0;
}
@@ -478,6 +474,33 @@ unsigned char String::equalsIgnoreCase(const String &s2) const {
return 1;
}
+unsigned char String::equalsConstantTime(const String &s2) const {
+ // To avoid possible time-based attacks present function
+ // compares given strings in a constant time.
+ if(len != s2.len)
+ return 0;
+ //at this point lengths are the same
+ if(len == 0)
+ return 1;
+ //at this point lenghts are the same and non-zero
+ const char *p1 = buffer;
+ const char *p2 = s2.buffer;
+ unsigned int equalchars = 0;
+ unsigned int diffchars = 0;
+ while(*p1) {
+ if(*p1 == *p2)
+ ++equalchars;
+ else
+ ++diffchars;
+ ++p1;
+ ++p2;
+ }
+ //the following should force a constant time eval of the condition without a compiler "logical shortcut"
+ unsigned char equalcond = (equalchars == len);
+ unsigned char diffcond = (diffchars == 0);
+ return (equalcond & diffcond); //bitwise AND
+}
+
unsigned char String::startsWith(const String &s2) const {
if(len < s2.len)
return 0;
diff --git a/cores/esp8266/WString.h b/cores/esp8266/WString.h
index a3bb40c130..fbf3c59b2f 100644
--- a/cores/esp8266/WString.h
+++ b/cores/esp8266/WString.h
@@ -194,6 +194,7 @@ class String {
unsigned char operator <=(const String &rhs) const;
unsigned char operator >=(const String &rhs) const;
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 String &prefix, unsigned int offset) const;
unsigned char endsWith(const String &suffix) const;
diff --git a/cores/esp8266/abi.cpp b/cores/esp8266/abi.cpp
index 2cb6889d88..8001c185a5 100644
--- a/cores/esp8266/abi.cpp
+++ b/cores/esp8266/abi.cpp
@@ -24,14 +24,28 @@
using __cxxabiv1::__guard;
+// Debugging helper, last allocation which returned NULL
+extern void *umm_last_fail_alloc_addr;
+extern int umm_last_fail_alloc_size;
+
void *operator new(size_t size)
{
- return malloc(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)
{
- return malloc(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 delete(void * ptr)
@@ -104,11 +118,13 @@ void __throw_bad_alloc()
void __throw_logic_error(const char* str)
{
+ (void) str;
panic();
}
void __throw_out_of_range(const char* str)
{
+ (void) str;
panic();
}
}
diff --git a/cores/esp8266/avr/pgmspace.h b/cores/esp8266/avr/pgmspace.h
new file mode 100644
index 0000000000..310b81e10f
--- /dev/null
+++ b/cores/esp8266/avr/pgmspace.h
@@ -0,0 +1 @@
+#include "../pgmspace.h"
diff --git a/cores/esp8266/base64.cpp b/cores/esp8266/base64.cpp
old mode 100644
new mode 100755
index 11deb0af04..a1e6261890
--- a/cores/esp8266/base64.cpp
+++ b/cores/esp8266/base64.cpp
@@ -35,13 +35,20 @@ extern "C" {
* @param length size_t
* @return String
*/
-String base64::encode(uint8_t * data, size_t length) {
+String base64::encode(uint8_t * data, size_t length, bool doNewLines) {
// base64 needs more size then the source data
size_t size = ((length * 1.6f) + 1);
char * buffer = (char *) malloc(size);
if(buffer) {
base64_encodestate _state;
- base64_init_encodestate(&_state);
+ if(doNewLines)
+ {
+ base64_init_encodestate(&_state);
+ }
+ else
+ {
+ base64_init_encodestate_nonewlines(&_state);
+ }
int len = base64_encode_block((const char *) &data[0], length, &buffer[0], &_state);
len = base64_encode_blockend((buffer + len), &_state);
@@ -57,7 +64,7 @@ String base64::encode(uint8_t * data, size_t length) {
* @param text String
* @return String
*/
-String base64::encode(String text) {
- return base64::encode((uint8_t *) text.c_str(), text.length());
+String base64::encode(String text, bool doNewLines) {
+ return base64::encode((uint8_t *) text.c_str(), text.length(), doNewLines);
}
diff --git a/cores/esp8266/base64.h b/cores/esp8266/base64.h
old mode 100644
new mode 100755
index 39be2d397c..67140123ed
--- a/cores/esp8266/base64.h
+++ b/cores/esp8266/base64.h
@@ -27,8 +27,11 @@
class base64 {
public:
- static String encode(uint8_t * data, size_t length);
- static String encode(String text);
+ // NOTE: The default behaviour of backend (lib64)
+ // is to add a newline every 72 (encoded) characters output.
+ // This may 'break' longer uris and json variables
+ static String encode(uint8_t * data, size_t length, bool doNewLines = true);
+ static String encode(String text, bool doNewLines = true);
private:
};
diff --git a/cores/esp8266/cbuf.cpp b/cores/esp8266/cbuf.cpp
index ca5977df48..e655ca6fc6 100644
--- a/cores/esp8266/cbuf.cpp
+++ b/cores/esp8266/cbuf.cpp
@@ -39,7 +39,7 @@ size_t cbuf::resize(size_t newSize) {
// not lose any data
// if data can be lost use remove or flush before resize
- if((newSize < bytes_available) || (newSize == _size)) {
+ if((newSize <= bytes_available) || (newSize == _size)) {
return _size;
}
diff --git a/cores/esp8266/cont.S b/cores/esp8266/cont.S
index 06ad2a74cc..4304db448c 100644
--- a/cores/esp8266/cont.S
+++ b/cores/esp8266/cont.S
@@ -58,6 +58,30 @@ cont_continue:
ret
.size cont_yield, . - cont_yield
+////////////////////////////////////////////////////
+
+/*
+ The purpose of cont_wrapper is to signal to xtensa-gdb
+ that we want to treat this function as the outermost one.
+
+ From: binutils-gdb-xtensa/gdb/xtensa-tdep.c:2677
+ "Special case for terminating backtrace at a function that wants to
+ be seen as the outermost one. Such a function will clear it's RA (A0)
+ register to 0 in the prologue instead of saving its original value."
+*/
+
+ .text
+ .align 4
+ .literal_position
+ .global cont_wrapper
+ .type cont_wrapper, @function
+cont_wrapper:
+ movi a0, 0
+ callx0 a3
+ movi a2, cont_norm
+ jx a2
+ .size cont_wrapper, . - cont_wrapper
+
////////////////////////////////////////////////////
.text
@@ -91,8 +115,8 @@ cont_run:
/* set new stack*/
l32i a1, a2, 16;
/* goto pfn */
- movi a0, cont_norm
- jx a3
+ movi a2, cont_wrapper
+ jx a2
cont_resume:
/* a1 <- cont_ctx.sp_yield */
diff --git a/cores/esp8266/cont_util.c b/cores/esp8266/cont_util.c
index 52a79e34e9..08704702b6 100644
--- a/cores/esp8266/cont_util.c
+++ b/cores/esp8266/cont_util.c
@@ -20,19 +20,22 @@
#include "cont.h"
#include
+#include
#include "ets_sys.h"
#define CONT_STACKGUARD 0xfeefeffe
-void ICACHE_RAM_ATTR cont_init(cont_t* cont) {
+void cont_init(cont_t* cont) {
+ memset(cont, 0, sizeof(cont_t));
+
cont->stack_guard1 = CONT_STACKGUARD;
cont->stack_guard2 = CONT_STACKGUARD;
cont->stack_end = cont->stack + (sizeof(cont->stack) / 4);
cont->struct_start = (unsigned*) cont;
// fill stack with magic values to check high water mark
- for(int pos = 0; pos < sizeof(cont->stack) / 4; pos++)
+ for(int pos = 0; pos < (int)(sizeof(cont->stack) / 4); pos++)
{
cont->stack[pos] = CONT_STACKGUARD;
}
diff --git a/cores/esp8266/core_esp8266_i2s.c b/cores/esp8266/core_esp8266_i2s.c
index 3a7ca505ed..046c6dd064 100644
--- a/cores/esp8266/core_esp8266_i2s.c
+++ b/cores/esp8266/core_esp8266_i2s.c
@@ -24,90 +24,205 @@
#include "osapi.h"
#include "ets_sys.h"
+
#include "i2s_reg.h"
#include "i2s.h"
-extern void ets_wdt_enable(void);
-extern void ets_wdt_disable(void);
+#define SLC_BUF_CNT (8) // Number of buffers in the I2S circular buffer
+#define SLC_BUF_LEN (64) // Length of one buffer, in 32-bit words.
+
+// We use a queue to keep track of the DMA buffers that are empty. The ISR
+// will push buffers to the back of the queue, the I2S transmitter will pull
+// them from the front and fill them. For ease, the queue will contain
+// *pointers* to the DMA buffers, not the data itself. The queue depth is
+// one smaller than the amount of buffers we have, because there's always a
+// buffer that is being used by the DMA subsystem *right now* and we don't
+// want to be able to write to that simultaneously.
+
+// For RX, it's a little different. The buffers in i2s_slc_queue are
+// placed onto the list when they're filled by DMA
+
+typedef struct slc_queue_item {
+ uint32_t blocksize : 12;
+ uint32_t datalen : 12;
+ uint32_t unused : 5;
+ uint32_t sub_sof : 1;
+ uint32_t eof : 1;
+ volatile uint32_t owner : 1; // DMA can change this value
+ uint32_t * buf_ptr;
+ struct slc_queue_item * next_link_ptr;
+} slc_queue_item_t;
+
+typedef struct i2s_state {
+ uint32_t * slc_queue[SLC_BUF_CNT];
+ volatile uint8_t slc_queue_len;
+ uint32_t * slc_buf_pntr[SLC_BUF_CNT]; // Pointer to the I2S DMA buffer data
+ slc_queue_item_t slc_items[SLC_BUF_CNT]; // I2S DMA buffer descriptors
+ uint32_t * curr_slc_buf; // Current buffer for writing
+ uint32_t curr_slc_buf_pos; // Position in the current buffer
+ void (*callback) (void);
+ // Callback function should be defined as 'void ICACHE_RAM_ATTR function_name()',
+ // and be placed in IRAM for faster execution. Avoid long computational tasks in this
+ // function, use it to set flags and process later.
+} i2s_state_t;
+
+// RX = I2S receive (i.e. microphone), TX = I2S transmit (i.e. DAC)
+static i2s_state_t *rx = NULL;
+static i2s_state_t *tx = NULL;
+
+// Last I2S sample rate requested
+static uint32_t _i2s_sample_rate;
-#define SLC_BUF_CNT (8) //Number of buffers in the I2S circular buffer
-#define SLC_BUF_LEN (64) //Length of one buffer, in 32-bit words.
+// IOs used for I2S. Not defined in i2s.h, unfortunately.
+// Note these are internal GPIO numbers and not pins on an
+// Arduino board. Users need to verify their particular wiring.
+#define I2SO_DATA 3
+#define I2SO_BCK 15
+#define I2SO_WS 2
+#define I2SI_DATA 12
+#define I2SI_BCK 13
+#define I2SI_WS 14
+
+static bool _i2s_is_full(const i2s_state_t *ch) {
+ if (!ch) {
+ return false;
+ }
+ return (ch->curr_slc_buf_pos==SLC_BUF_LEN || ch->curr_slc_buf==NULL) && (ch->slc_queue_len == 0);
+}
-//We use a queue to keep track of the DMA buffers that are empty. The ISR will push buffers to the back of the queue,
-//the mp3 decode will pull them from the front and fill them. For ease, the queue will contain *pointers* to the DMA
-//buffers, not the data itself. The queue depth is one smaller than the amount of buffers we have, because there's
-//always a buffer that is being used by the DMA subsystem *right now* and we don't want to be able to write to that
-//simultaneously.
+bool i2s_is_full() {
+ return _i2s_is_full( tx );
+}
-struct slc_queue_item {
- uint32 blocksize:12;
- uint32 datalen:12;
- uint32 unused:5;
- uint32 sub_sof:1;
- uint32 eof:1;
- uint32 owner:1;
- uint32 buf_ptr;
- uint32 next_link_ptr;
-};
+bool i2s_rx_is_full() {
+ return _i2s_is_full( rx );
+}
-static uint32_t i2s_slc_queue[SLC_BUF_CNT-1];
-static uint8_t i2s_slc_queue_len;
-static uint32_t *i2s_slc_buf_pntr[SLC_BUF_CNT]; //Pointer to the I2S DMA buffer data
-static struct slc_queue_item i2s_slc_items[SLC_BUF_CNT]; //I2S DMA buffer descriptors
-static uint32_t *i2s_curr_slc_buf=NULL;//current buffer for writing
-static int i2s_curr_slc_buf_pos=0; //position in the current buffer
+static bool _i2s_is_empty(const i2s_state_t *ch) {
+ if (!ch) {
+ return false;
+ }
+ return (ch->slc_queue_len >= SLC_BUF_CNT-1);
+}
+
+bool i2s_is_empty() {
+ return _i2s_is_empty( tx );
+}
+
+bool i2s_rx_is_empty() {
+ return _i2s_is_empty( rx );
+}
+
+static int16_t _i2s_available(const i2s_state_t *ch) {
+ if (!ch) {
+ return 0;
+ }
+ return (SLC_BUF_CNT - ch->slc_queue_len) * SLC_BUF_LEN;
+}
-bool ICACHE_FLASH_ATTR i2s_is_full(){
- return (i2s_curr_slc_buf_pos==SLC_BUF_LEN || i2s_curr_slc_buf==NULL) && (i2s_slc_queue_len == 0);
+int16_t i2s_available(){
+ return _i2s_available( tx );
}
-bool ICACHE_FLASH_ATTR i2s_is_empty(){
- return (i2s_slc_queue_len >= SLC_BUF_CNT-1);
+int16_t i2s_rx_available(){
+ return _i2s_available( rx );
}
-uint32_t ICACHE_FLASH_ATTR i2s_slc_queue_next_item(){ //pop the top off the queue
+// Pop the top off of the queue and return it
+static uint32_t * ICACHE_RAM_ATTR i2s_slc_queue_next_item(i2s_state_t *ch) {
uint8_t i;
- uint32_t item = i2s_slc_queue[0];
- i2s_slc_queue_len--;
- for(i=0;islc_queue[0];
+ ch->slc_queue_len--;
+ for ( i = 0; i < ch->slc_queue_len; i++) {
+ ch->slc_queue[i] = ch->slc_queue[i+1];
+ }
return item;
}
-//This routine is called as soon as the DMA routine has something to tell us. All we
-//handle here is the RX_EOF_INT status, which indicate the DMA has sent a buffer whose
-//descriptor has the 'EOF' field set to 1.
-void ICACHE_FLASH_ATTR i2s_slc_isr(void) {
+// Append an item to the end of the queue from receive
+static void ICACHE_RAM_ATTR i2s_slc_queue_append_item(i2s_state_t *ch, uint32_t *item) {
+ // Shift everything up, except for the one corresponding to this item
+ for (int i=0, dest=0; i < ch->slc_queue_len; i++) {
+ if (ch->slc_queue[i] != item) {
+ ch->slc_queue[dest++] = ch->slc_queue[i];
+ }
+ }
+ if (ch->slc_queue_len < SLC_BUF_CNT - 1) {
+ ch->slc_queue[ch->slc_queue_len++] = item;
+ } else {
+ ch->slc_queue[ch->slc_queue_len] = item;
+ }
+}
+
+static void ICACHE_RAM_ATTR i2s_slc_isr(void) {
+ ETS_SLC_INTR_DISABLE();
uint32_t slc_intr_status = SLCIS;
SLCIC = 0xFFFFFFFF;
if (slc_intr_status & SLCIRXEOF) {
- ETS_SLC_INTR_DISABLE();
- struct slc_queue_item *finished_item = (struct slc_queue_item*)SLCRXEDA;
- memset((void *)finished_item->buf_ptr, 0x00, SLC_BUF_LEN * 4);//zero the buffer so it is mute in case of underflow
- if (i2s_slc_queue_len >= SLC_BUF_CNT-1) { //All buffers are empty. This means we have an underflow
- i2s_slc_queue_next_item(); //free space for finished_item
+ slc_queue_item_t *finished_item = (slc_queue_item_t *)SLCRXEDA;
+ // Zero the buffer so it is mute in case of underflow
+ ets_memset((void *)finished_item->buf_ptr, 0x00, SLC_BUF_LEN * 4);
+ if (tx->slc_queue_len >= SLC_BUF_CNT-1) {
+ // All buffers are empty. This means we have an underflow
+ i2s_slc_queue_next_item(tx); // Free space for finished_item
+ }
+ tx->slc_queue[tx->slc_queue_len++] = finished_item->buf_ptr;
+ if (tx->callback) {
+ tx->callback();
}
- i2s_slc_queue[i2s_slc_queue_len++] = finished_item->buf_ptr;
- ETS_SLC_INTR_ENABLE();
}
+ if (slc_intr_status & SLCITXEOF) {
+ slc_queue_item_t *finished_item = (slc_queue_item_t *)SLCTXEDA;
+ // Set owner back to 1 (SW) or else RX stops. TX has no such restriction.
+ finished_item->owner = 1;
+ i2s_slc_queue_append_item(rx, finished_item->buf_ptr);
+ if (rx->callback) {
+ rx->callback();
+ }
+ }
+ ETS_SLC_INTR_ENABLE();
}
-void ICACHE_FLASH_ATTR i2s_slc_begin(){
- i2s_slc_queue_len = 0;
- int x, y;
-
- for (x=0; xcallback = callback;
+}
+
+void i2s_rx_set_callback(void (*callback) (void)) {
+ rx->callback = callback;
+}
- i2s_slc_items[x].unused = 0;
- i2s_slc_items[x].owner = 1;
- i2s_slc_items[x].eof = 1;
- i2s_slc_items[x].sub_sof = 0;
- i2s_slc_items[x].datalen = SLC_BUF_LEN*4;
- i2s_slc_items[x].blocksize = SLC_BUF_LEN*4;
- i2s_slc_items[x].buf_ptr = (uint32_t)&i2s_slc_buf_pntr[x][0];
- i2s_slc_items[x].next_link_ptr = (int)((x<(SLC_BUF_CNT-1))?(&i2s_slc_items[x+1]):(&i2s_slc_items[0]));
+static bool _alloc_channel(i2s_state_t *ch) {
+ ch->slc_queue_len = 0;
+ for (int x=0; xslc_buf_pntr[x] = (uint32_t *)malloc(SLC_BUF_LEN * sizeof(ch->slc_buf_pntr[0][0]));
+ if (!ch->slc_buf_pntr[x]) {
+ // OOM, the upper layer will free up any partially allocated channels.
+ return false;
+ }
+ memset(ch->slc_buf_pntr[x], 0, SLC_BUF_LEN * sizeof(ch->slc_buf_pntr[x][0]));
+
+ ch->slc_items[x].unused = 0;
+ ch->slc_items[x].owner = 1;
+ ch->slc_items[x].eof = 1;
+ ch->slc_items[x].sub_sof = 0;
+ ch->slc_items[x].datalen = SLC_BUF_LEN * 4;
+ ch->slc_items[x].blocksize = SLC_BUF_LEN * 4;
+ ch->slc_items[x].buf_ptr = (uint32_t*)&ch->slc_buf_pntr[x][0];
+ ch->slc_items[x].next_link_ptr = (x<(SLC_BUF_CNT-1))?(&ch->slc_items[x+1]):(&ch->slc_items[0]);
+ }
+ return true;
+}
+
+static bool i2s_slc_begin() {
+ if (tx) {
+ if (!_alloc_channel(tx)) {
+ return false;
+ }
+ }
+ if (rx) {
+ if (!_alloc_channel(rx)) {
+ return false;
+ }
}
ETS_SLC_INTR_DISABLE();
@@ -115,131 +230,278 @@ void ICACHE_FLASH_ATTR i2s_slc_begin(){
SLCC0 &= ~(SLCRXLR | SLCTXLR);
SLCIC = 0xFFFFFFFF;
- //Configure DMA
- SLCC0 &= ~(SLCMM << SLCM); //clear DMA MODE
- SLCC0 |= (1 << SLCM); //set DMA MODE to 1
- SLCRXDC |= SLCBINR | SLCBTNR; //enable INFOR_NO_REPLACE and TOKEN_NO_REPLACE
- SLCRXDC &= ~(SLCBRXFE | SLCBRXEM | SLCBRXFM); //disable RX_FILL, RX_EOF_MODE and RX_FILL_MODE
+ // Configure DMA
+ SLCC0 &= ~(SLCMM << SLCM); // Clear DMA MODE
+ SLCC0 |= (1 << SLCM); // Set DMA MODE to 1
+ SLCRXDC |= SLCBINR | SLCBTNR; // Enable INFOR_NO_REPLACE and TOKEN_NO_REPLACE
+ SLCRXDC &= ~(SLCBRXFE | SLCBRXEM | SLCBRXFM); // Disable RX_FILL, RX_EOF_MODE and RX_FILL_MODE
//Feed DMA the 1st buffer desc addr
//To send data to the I2S subsystem, counter-intuitively we use the RXLINK part, not the TXLINK as you might
//expect. The TXLINK part still needs a valid DMA descriptor, even if it's unused: the DMA engine will throw
//an error at us otherwise. Just feed it any random descriptor.
SLCTXL &= ~(SLCTXLAM << SLCTXLA); // clear TX descriptor address
- SLCTXL |= (uint32)&i2s_slc_items[1] << SLCTXLA; //set TX descriptor address. any random desc is OK, we don't use TX but it needs to be valid
SLCRXL &= ~(SLCRXLAM << SLCRXLA); // clear RX descriptor address
- SLCRXL |= (uint32)&i2s_slc_items[0] << SLCRXLA; //set RX descriptor address
+ if (!rx) {
+ SLCTXL |= (uint32)&tx->slc_items[1] << SLCTXLA; // Set fake (unused) RX descriptor address
+ } else {
+ SLCTXL |= (uint32)&rx->slc_items[0] << SLCTXLA; // Set real RX address
+ }
+ if (!tx) {
+ SLCRXL |= (uint32)&rx->slc_items[1] << SLCRXLA; // Set fake (unused) TX descriptor address
+ } else {
+ SLCRXL |= (uint32)&tx->slc_items[0] << SLCRXLA; // Set real TX address
+ }
ETS_SLC_INTR_ATTACH(i2s_slc_isr, NULL);
- SLCIE = SLCIRXEOF; //Enable only for RX EOF interrupt
+ SLCIE = (tx?SLCIRXEOF:0) | (rx?SLCITXEOF:0); // Enable appropriate EOF IRQ
ETS_SLC_INTR_ENABLE();
- //Start transmission
+ // Start transmission ("TX" DMA always needed to be enabled)
SLCTXL |= SLCTXLS;
- SLCRXL |= SLCRXLS;
+ if (tx) {
+ SLCRXL |= SLCRXLS;
+ }
+
+ return true;
}
-void ICACHE_FLASH_ATTR i2s_slc_end(){
+static void i2s_slc_end(){
ETS_SLC_INTR_DISABLE();
SLCIC = 0xFFFFFFFF;
SLCIE = 0;
SLCTXL &= ~(SLCTXLAM << SLCTXLA); // clear TX descriptor address
SLCRXL &= ~(SLCRXLAM << SLCRXLA); // clear RX descriptor address
+
+ for (int x = 0; xslc_buf_pntr[x]);
+ tx->slc_buf_pntr[x] = NULL;
+ }
+ if (rx) {
+ free(rx->slc_buf_pntr[x]);
+ rx->slc_buf_pntr[x] = NULL;
+ }
+ }
}
-//This routine pushes a single, 32-bit sample to the I2S buffers. Call this at (on average)
-//at least the current sample rate. You can also call it quicker: it will suspend the calling
-//thread if the buffer is full and resume when there's room again.
+// These routines push a single, 32-bit sample to the I2S buffers. Call at (on average)
+// at least the current sample rate.
+static bool _i2s_write_sample(uint32_t sample, bool nb) {
+ if (!tx) {
+ return false;
+ }
-bool ICACHE_FLASH_ATTR i2s_write_sample(uint32_t sample) {
- if (i2s_curr_slc_buf_pos==SLC_BUF_LEN || i2s_curr_slc_buf==NULL) {
- if(i2s_slc_queue_len == 0){
- while(1){
- if(i2s_slc_queue_len > 0){
+ if (tx->curr_slc_buf_pos==SLC_BUF_LEN || tx->curr_slc_buf==NULL) {
+ if (tx->slc_queue_len == 0) {
+ if (nb) {
+ // Don't wait if nonblocking, just notify upper levels
+ return false;
+ }
+ while (1) {
+ if (tx->slc_queue_len > 0) {
break;
} else {
- ets_wdt_disable();
- ets_wdt_enable();
+ optimistic_yield(10000);
}
}
}
ETS_SLC_INTR_DISABLE();
- i2s_curr_slc_buf = (uint32_t *)i2s_slc_queue_next_item();
+ tx->curr_slc_buf = (uint32_t *)i2s_slc_queue_next_item(tx);
ETS_SLC_INTR_ENABLE();
- i2s_curr_slc_buf_pos=0;
+ tx->curr_slc_buf_pos=0;
}
- i2s_curr_slc_buf[i2s_curr_slc_buf_pos++]=sample;
+ tx->curr_slc_buf[tx->curr_slc_buf_pos++]=sample;
return true;
}
-bool ICACHE_FLASH_ATTR i2s_write_sample_nb(uint32_t sample) {
- if (i2s_curr_slc_buf_pos==SLC_BUF_LEN || i2s_curr_slc_buf==NULL) {
- if(i2s_slc_queue_len == 0){
- return false;
- }
- ETS_SLC_INTR_DISABLE();
- i2s_curr_slc_buf = (uint32_t *)i2s_slc_queue_next_item();
- ETS_SLC_INTR_ENABLE();
- i2s_curr_slc_buf_pos=0;
- }
- i2s_curr_slc_buf[i2s_curr_slc_buf_pos++]=sample;
- return true;
+bool i2s_write_sample(uint32_t sample) {
+ return _i2s_write_sample(sample, false);
+}
+
+bool i2s_write_sample_nb(uint32_t sample) {
+ return _i2s_write_sample(sample, true);
}
-bool ICACHE_FLASH_ATTR i2s_write_lr(int16_t left, int16_t right){
+bool i2s_write_lr(int16_t left, int16_t right){
int sample = right & 0xFFFF;
sample = sample << 16;
sample |= left & 0xFFFF;
return i2s_write_sample(sample);
}
-// END DMA
-// =========
-// START I2S
+bool i2s_read_sample(int16_t *left, int16_t *right, bool blocking) {
+ if (!rx) {
+ return false;
+ }
+ if (rx->curr_slc_buf_pos==SLC_BUF_LEN || rx->curr_slc_buf==NULL) {
+ if (rx->slc_queue_len == 0) {
+ if (!blocking) {
+ return false;
+ }
+ while (1) {
+ if (rx->slc_queue_len > 0){
+ break;
+ } else {
+ optimistic_yield(10000);
+ }
+ }
+ }
+ ETS_SLC_INTR_DISABLE();
+ rx->curr_slc_buf = (uint32_t *)i2s_slc_queue_next_item(rx);
+ ETS_SLC_INTR_ENABLE();
+ rx->curr_slc_buf_pos=0;
+ }
+ uint32_t sample = rx->curr_slc_buf[rx->curr_slc_buf_pos++];
+ if (left) {
+ *left = sample & 0xffff;
+ }
+ if (right) {
+ *right = sample >> 16;
+ }
-static uint32_t _i2s_sample_rate;
+ return true;
+}
-void ICACHE_FLASH_ATTR i2s_set_rate(uint32_t rate){ //Rate in HZ
- if(rate == _i2s_sample_rate) return;
+
+void i2s_set_rate(uint32_t rate) { //Rate in HZ
+ if (rate == _i2s_sample_rate) {
+ return;
+ }
_i2s_sample_rate = rate;
- uint32_t i2s_clock_div = (I2SBASEFREQ/(_i2s_sample_rate*32)) & I2SCDM;
- uint8_t i2s_bck_div = (I2SBASEFREQ/(_i2s_sample_rate*i2s_clock_div*2)) & I2SBDM;
- //os_printf("Rate %u Div %u Bck %u Frq %u\n", _i2s_sample_rate, i2s_clock_div, i2s_bck_div, I2SBASEFREQ/(i2s_clock_div*i2s_bck_div*2));
- //!trans master, !bits mod, rece slave mod, rece msb shift, right first, msb right
- I2SC &= ~(I2STSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
- I2SC |= I2SRF | I2SMR | I2SRSM | I2SRMS | ((i2s_bck_div-1) << I2SBD) | ((i2s_clock_div-1) << I2SCD);
+ uint32_t scaled_base_freq = I2SBASEFREQ/32;
+ float delta_best = scaled_base_freq;
+
+ uint8_t sbd_div_best=1;
+ uint8_t scd_div_best=1;
+ for (uint8_t i=1; i<64; i++) {
+ for (uint8_t j=i; j<64; j++) {
+ float new_delta = fabs(((float)scaled_base_freq/i/j) - rate);
+ if (new_delta < delta_best){
+ delta_best = new_delta;
+ sbd_div_best = i;
+ scd_div_best = j;
+ }
+ }
+ }
+
+ i2s_set_dividers( sbd_div_best, scd_div_best );
+}
+
+void i2s_set_dividers(uint8_t div1, uint8_t div2) {
+ // Ensure dividers fit in bit fields
+ div1 &= I2SBDM;
+ div2 &= I2SCDM;
+
+ // trans master(active low), recv master(active_low), !bits mod(==16 bits/chanel), clear clock dividers
+ I2SC &= ~(I2STSM | I2SRSM | (I2SBMM << I2SBM) | (I2SBDM << I2SBD) | (I2SCDM << I2SCD));
+
+ // I2SRF = Send/recv right channel first (? may be swapped form I2S spec of WS=0 => left)
+ // I2SMR = MSB recv/xmit first
+ // I2SRMS, I2STMS = 1-bit delay from WS to MSB (I2S format)
+ // div1, div2 = Set I2S WS clock frequency. BCLK seems to be generated from 32x this
+ I2SC |= I2SRF | I2SMR | I2SRMS | I2STMS | (div1 << I2SBD) | (div2 << I2SCD);
}
-void ICACHE_FLASH_ATTR i2s_begin(){
+float i2s_get_real_rate(){
+ return (float)I2SBASEFREQ/32/((I2SC>>I2SBD) & I2SBDM)/((I2SC >> I2SCD) & I2SCDM);
+}
+
+bool i2s_rxtx_begin(bool enableRx, bool enableTx) {
+ if (tx || rx) {
+ i2s_end(); // Stop and free any ongoing stuff
+ }
+
+ if (enableTx) {
+ tx = (i2s_state_t*)calloc(1, sizeof(*tx));
+ if (!tx) {
+ // Nothing to clean up yet
+ return false; // OOM Error!
+ }
+ pinMode(I2SO_WS, FUNCTION_1);
+ pinMode(I2SO_DATA, FUNCTION_1);
+ pinMode(I2SO_BCK, FUNCTION_1);
+ }
+ if (enableRx) {
+ rx = (i2s_state_t*)calloc(1, sizeof(*rx));
+ if (!rx) {
+ i2s_end(); // Clean up any TX or pin changes
+ return false; // OOM error!
+ }
+ pinMode(I2SI_WS, OUTPUT);
+ pinMode(I2SI_BCK, OUTPUT);
+ pinMode(I2SI_DATA, INPUT);
+ PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDI_U, FUNC_I2SI_DATA);
+ PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, FUNC_I2SI_BCK);
+ PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, FUNC_I2SI_WS);
+ }
+
_i2s_sample_rate = 0;
- i2s_slc_begin();
-
- pinMode(2, FUNCTION_1); //I2SO_WS (LRCK)
- pinMode(3, FUNCTION_1); //I2SO_DATA (SDIN)
- pinMode(15, FUNCTION_1); //I2SO_BCK (SCLK)
+ if (!i2s_slc_begin()) {
+ // OOM in SLC memory allocations, tear it all down and abort!
+ i2s_end();
+ return false;
+ }
I2S_CLK_ENABLE();
I2SIC = 0x3F;
I2SIE = 0;
- //Reset I2S
+ // Reset I2S
I2SC &= ~(I2SRST);
I2SC |= I2SRST;
I2SC &= ~(I2SRST);
- I2SFC &= ~(I2SDE | (I2STXFMM << I2STXFM) | (I2SRXFMM << I2SRXFM)); //Set RX/TX FIFO_MOD=0 and disable DMA (FIFO only)
- I2SFC |= I2SDE; //Enable DMA
- I2SCC &= ~((I2STXCMM << I2STXCM) | (I2SRXCMM << I2SRXCM)); //Set RX/TX CHAN_MOD=0
+ // I2STXFMM, I2SRXFMM=0 => 16-bit, dual channel data shifted in/out
+ I2SFC &= ~(I2SDE | (I2STXFMM << I2STXFM) | (I2SRXFMM << I2SRXFM)); // Set RX/TX FIFO_MOD=0 and disable DMA (FIFO only)
+ I2SFC |= I2SDE; // Enable DMA
+
+ // I2STXCMM, I2SRXCMM=0 => Dual channel mode
+ I2SCC &= ~((I2STXCMM << I2STXCM) | (I2SRXCMM << I2SRXCM)); // Set RX/TX CHAN_MOD=0
+
i2s_set_rate(44100);
- I2SC |= I2STXS; //Start transmission
+
+ if (rx) {
+ // Need to prime the # of samples to receive in the engine
+ I2SRXEN = SLC_BUF_LEN;
+ }
+
+ I2SC |= (rx?I2SRXS:0) | (tx?I2STXS:0); // Start transmission/reception
+
+ return true;
}
-void ICACHE_FLASH_ATTR i2s_end(){
+void i2s_begin() {
+ i2s_rxtx_begin(false, true);
+}
+
+void i2s_end() {
+ // Disable any I2S send or receive
+ // ? Maybe not needed since we're resetting on the next line...
+ I2SC &= ~(I2STXS | I2SRXS);
+
+ // Reset I2S
+ I2SC &= ~(I2SRST);
+ I2SC |= I2SRST;
+ I2SC &= ~(I2SRST);
+
i2s_slc_end();
- pinMode(2, INPUT);
- pinMode(3, INPUT);
- pinMode(15, INPUT);
+
+ if (tx) {
+ pinMode(I2SO_DATA, INPUT);
+ pinMode(I2SO_BCK, INPUT);
+ pinMode(I2SO_WS, INPUT);
+ free(tx);
+ tx = NULL;
+ }
+ if (rx) {
+ pinMode(I2SI_DATA, INPUT);
+ pinMode(I2SI_BCK, INPUT);
+ pinMode(I2SI_WS, INPUT);
+ free(rx);
+ rx = NULL;
+ }
}
diff --git a/cores/esp8266/core_esp8266_main.cpp b/cores/esp8266/core_esp8266_main.cpp
index 13bb645e25..52ba57857b 100644
--- a/cores/esp8266/core_esp8266_main.cpp
+++ b/cores/esp8266/core_esp8266_main.cpp
@@ -33,14 +33,34 @@ extern "C" {
#include "cont.h"
}
#include
+#include "gdb_hooks.h"
#define LOOP_TASK_PRIORITY 1
#define LOOP_QUEUE_SIZE 1
-
#define OPTIMISTIC_YIELD_TIME_US 16000
+extern "C" void call_user_start();
+extern void loop();
+extern void setup();
+extern void (*__init_array_start)(void);
+extern void (*__init_array_end)(void);
+
+/* Not static, used in Esp.cpp */
struct rst_info resetInfo;
+/* Not static, used in core_esp8266_postmortem.c.
+ * Placed into noinit section because we assign value to this variable
+ * before .bss is zero-filled, and need to preserve the value.
+ */
+cont_t* g_pcont __attribute__((section(".noinit")));
+
+/* Event queue used by the main (arduino) task */
+static os_event_t s_loop_queue[LOOP_QUEUE_SIZE];
+
+/* Used to implement optimistic_yield */
+static uint32_t s_micros_at_task_start;
+
+
extern "C" {
extern const uint32_t __attribute__((section(".ver_number"))) core_version = ARDUINO_ESP8266_GIT_VER;
const char* core_release =
@@ -51,18 +71,10 @@ const char* core_release =
#endif
} // extern "C"
-int atexit(void (*func)()) {
- return 0;
-}
-
-extern "C" void ets_update_cpu_frequency(int freqmhz);
void initVariant() __attribute__((weak));
void initVariant() {
}
-extern void loop();
-extern void setup();
-
void preloop_update_frequency() __attribute__((weak));
void preloop_update_frequency() {
#if defined(F_CPU) && (F_CPU == 160000000L)
@@ -71,17 +83,10 @@ void preloop_update_frequency() {
#endif
}
-extern void (*__init_array_start)(void);
-extern void (*__init_array_end)(void);
-
-cont_t g_cont __attribute__ ((aligned (16)));
-static os_event_t g_loop_queue[LOOP_QUEUE_SIZE];
-
-static uint32_t g_micros_at_task_start;
extern "C" void esp_yield() {
- if (cont_can_yield(&g_cont)) {
- cont_yield(&g_cont);
+ if (cont_can_yield(g_pcont)) {
+ cont_yield(g_pcont);
}
}
@@ -90,7 +95,7 @@ extern "C" void esp_schedule() {
}
extern "C" void __yield() {
- if (cont_can_yield(&g_cont)) {
+ if (cont_can_yield(g_pcont)) {
esp_schedule();
esp_yield();
}
@@ -102,8 +107,8 @@ extern "C" void __yield() {
extern "C" void yield(void) __attribute__ ((weak, alias("__yield")));
extern "C" void optimistic_yield(uint32_t interval_us) {
- if (cont_can_yield(&g_cont) &&
- (system_get_time() - g_micros_at_task_start) > interval_us)
+ if (cont_can_yield(g_pcont) &&
+ (system_get_time() - s_micros_at_task_start) > interval_us)
{
yield();
}
@@ -114,9 +119,6 @@ static void loop_wrapper() {
preloop_update_frequency();
if(!setup_done) {
setup();
-#ifdef DEBUG_ESP_PORT
- DEBUG_ESP_PORT.setDebugOutput(true);
-#endif
setup_done = true;
}
loop();
@@ -125,9 +127,10 @@ static void loop_wrapper() {
}
static void loop_task(os_event_t *events) {
- g_micros_at_task_start = system_get_time();
- cont_run(&g_cont, &loop_wrapper);
- if (cont_check(&g_cont) != 0) {
+ (void) events;
+ s_micros_at_task_start = system_get_time();
+ cont_run(g_pcont, &loop_wrapper);
+ if (cont_check(g_pcont) != 0) {
panic();
}
}
@@ -138,20 +141,29 @@ static void do_global_ctors(void) {
(*--p)();
}
-extern "C" void __gdb_init() {}
-extern "C" void gdb_init(void) __attribute__ ((weak, alias("__gdb_init")));
-
-extern "C" void __gdb_do_break(){}
-extern "C" void gdb_do_break(void) __attribute__ ((weak, alias("__gdb_do_break")));
-
void init_done() {
system_set_os_print(1);
gdb_init();
do_global_ctors();
- printf("\n%08x\n", core_version);
esp_schedule();
}
+/* This is the entry point of the application.
+ * It gets called on the default stack, which grows down from the top
+ * of DRAM area.
+ * .bss has not been zeroed out yet, but .data and .rodata are in place.
+ * Cache is not enabled, so only ROM and IRAM functions can be called.
+ * Peripherals (except for SPI0 and UART0) are not initialized.
+ * This function does not return.
+ */
+extern "C" void ICACHE_RAM_ATTR app_entry(void)
+{
+ /* Allocate continuation context on this stack, and save pointer to it. */
+ cont_t s_cont __attribute__((aligned(16)));
+ g_pcont = &s_cont;
+ /* Call the entry point of the SDK code. */
+ call_user_start();
+}
extern "C" void user_init(void) {
struct rst_info *rtc_info_ptr = system_get_rst_info();
@@ -163,10 +175,10 @@ extern "C" void user_init(void) {
initVariant();
- cont_init(&g_cont);
+ cont_init(g_pcont);
ets_task(loop_task,
- LOOP_TASK_PRIORITY, g_loop_queue,
+ LOOP_TASK_PRIORITY, s_loop_queue,
LOOP_QUEUE_SIZE);
system_init_done_cb(&init_done);
diff --git a/cores/esp8266/core_esp8266_phy.c b/cores/esp8266/core_esp8266_phy.c
index 2391ffa374..df3701ec3e 100644
--- a/cores/esp8266/core_esp8266_phy.c
+++ b/cores/esp8266/core_esp8266_phy.c
@@ -25,11 +25,13 @@
#include
#include
#include "c_types.h"
+ #include "ets_sys.h"
+ #include "spi_flash.h"
static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
{
[0] = 5, // Reserved, do not change
- [1] = 0, // Reserved, do not change
+ [1] = 8, // Reserved, do not change
[2] = 4, // Reserved, do not change
[3] = 2, // Reserved, do not change
[4] = 5, // Reserved, do not change
@@ -66,12 +68,12 @@ static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
[32] = 0xf8, // Reserved, do not change
[33] = 0xf8, // Reserved, do not change
- [34] = 82, // target_power_qdb_0, 82 means target power is 82/4=20.5dbm
- [35] = 78, // target_power_qdb_1, 78 means target power is 78/4=19.5dbm
- [36] = 74, // target_power_qdb_2, 74 means target power is 74/4=18.5dbm
- [37] = 68, // target_power_qdb_3, 68 means target power is 68/4=17dbm
- [38] = 64, // target_power_qdb_4, 64 means target power is 64/4=16dbm
- [39] = 56, // target_power_qdb_5, 56 means target power is 56/4=14dbm
+ [34] = 78, // target_power_qdb_0, target power is 78/4=19.5dbm
+ [35] = 74, // target_power_qdb_1, target power is 74/4=18.5dbm
+ [36] = 70, // target_power_qdb_2, target power is 70/4=17.5dbm
+ [37] = 64, // target_power_qdb_3, target power is 64/4=16dbm
+ [38] = 60, // target_power_qdb_4, target power is 60/4=15dbm
+ [39] = 56, // target_power_qdb_5, target power is 56/4=14dbm
[40] = 0, // target_power_index_mcs0
[41] = 0, // target_power_index_mcs1
@@ -86,7 +88,11 @@ static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
// 0: 40MHz
// 1: 26MHz
// 2: 24MHz
- [48] = 1,
+ #if F_CRYSTAL == 40000000
+ [48] = 0,
+ #else
+ [48] = 1,
+ #endif
@@ -228,7 +234,7 @@ static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
// 3: auto measure frequency offset and correct it, bbpll is 160M, it only can correct + frequency offset.
// 5: use 113 byte force_freq_offset to correct frequency offset, bbpll is 168M, it can correct + and - frequency offset.
// 7: use 113 byte force_freq_offset to correct frequency offset, bbpll is 160M , it only can correct + frequency offset.
- [112] = 3,
+ [112] = 0,
// force_freq_offset
// signed, unit is 8kHz
@@ -250,14 +256,20 @@ static const uint8_t ICACHE_FLASH_ATTR phy_init_data[128] =
#define __get_rf_mode _Z13__get_rf_modev
#define __run_user_rf_pre_init _Z22__run_user_rf_pre_initv
-extern int __real_register_chipv6_phy(uint8_t* init_data);
-extern int __wrap_register_chipv6_phy(uint8_t* init_data)
+static bool spoof_init_data = false;
+
+extern int __real_spi_flash_read(uint32_t addr, uint32_t* dst, size_t size);
+extern int ICACHE_RAM_ATTR __wrap_spi_flash_read(uint32_t addr, uint32_t* dst, size_t size);
+
+extern int ICACHE_RAM_ATTR __wrap_spi_flash_read(uint32_t addr, uint32_t* dst, size_t size)
{
- if (init_data != NULL) {
- memcpy(init_data, phy_init_data, sizeof(phy_init_data));
- init_data[107] = __get_adc_mode();
+ if (!spoof_init_data || size != 128) {
+ return __real_spi_flash_read(addr, dst, size);
}
- return __real_register_chipv6_phy(init_data);
+
+ memcpy(dst, phy_init_data, sizeof(phy_init_data));
+ ((uint8_t*)dst)[107] = __get_adc_mode();
+ return 0;
}
extern int __get_rf_mode(void) __attribute__((weak));
@@ -278,10 +290,16 @@ extern void __run_user_rf_pre_init(void)
return; // default do noting
}
+uint32_t user_rf_cal_sector_set(void)
+{
+ spoof_init_data = true;
+ return flashchip->chip_size/SPI_FLASH_SEC_SIZE - 4;
+}
+
void user_rf_pre_init()
{
// *((volatile uint32_t*) 0x60000710) = 0;
-
+ spoof_init_data = false;
volatile uint32_t* rtc_reg = (volatile uint32_t*) 0x60001000;
if((rtc_reg[24] >> 16) > 4) {
rtc_reg[24] &= 0xFFFF;
@@ -295,3 +313,6 @@ void user_rf_pre_init()
}
__run_user_rf_pre_init();
}
+
+
+void ICACHE_RAM_ATTR user_spi_flash_dio_to_qio_pre_init() {}
diff --git a/cores/esp8266/core_esp8266_postmortem.c b/cores/esp8266/core_esp8266_postmortem.c
index 407ede2e24..3878cf1b9d 100644
--- a/cores/esp8266/core_esp8266_postmortem.c
+++ b/cores/esp8266/core_esp8266_postmortem.c
@@ -27,32 +27,77 @@
#include "user_interface.h"
#include "esp8266_peri.h"
#include "cont.h"
+#include "pgmspace.h"
+#include "gdb_hooks.h"
extern void __real_system_restart_local();
-extern void gdb_do_break();
-extern cont_t g_cont;
+extern cont_t* g_pcont;
+// These will be pointers to PROGMEM const strings
static const char* s_panic_file = 0;
static int s_panic_line = 0;
static const char* s_panic_func = 0;
+static const char* s_panic_what = 0;
static bool s_abort_called = false;
-void uart_write_char_d(char c);
+void abort() __attribute__((noreturn));
+static void uart_write_char_d(char c);
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);
-//static void print_pcs(uint32_t start, uint32_t end);
+
+// 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;
+
+static void raise_exception() __attribute__((noreturn));
extern void __custom_crash_callback( struct rst_info * rst_info, uint32_t stack, uint32_t stack_end ) {
+ (void) rst_info;
+ (void) stack;
+ (void) stack_end;
}
extern void custom_crash_callback( struct rst_info * rst_info, uint32_t stack, uint32_t stack_end ) __attribute__ ((weak, alias("__custom_crash_callback")));
+// Single, non-inlined copy of pgm_read_byte to save IRAM space (as this is not timing critical)
+static char ICACHE_RAM_ATTR iram_read_byte (const char *addr) {
+ return pgm_read_byte(addr);
+}
+
+// Required to output the s_panic_file, it's stored in PMEM
+#define ets_puts_P(pstr) \
+{ \
+ char c; \
+ do { \
+ c = iram_read_byte(pstr++); \
+ if (c) ets_putc(c); \
+ } while (c); \
+}
+
+// Place these strings in .text because the SPI interface may be in bad shape during an exception.
+#define ets_printf_P(str, ...) \
+{ \
+ static const char istr[] ICACHE_RAM_ATTR = (str); \
+ char mstr[sizeof(str)]; \
+ for (size_t i=0; i < sizeof(str); i++) mstr[i] = iram_read_byte(&istr[i]); \
+ ets_printf(mstr, ##__VA_ARGS__); \
+}
+
void __wrap_system_restart_local() {
register uint32_t sp asm("a1");
+ 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 = {0};
system_rtc_mem_read(0, &rst_info, sizeof(rst_info));
if (rst_info.reason != REASON_SOFT_WDT_RST &&
@@ -65,21 +110,29 @@ void __wrap_system_restart_local() {
ets_install_putc1(&uart_write_char_d);
if (s_panic_line) {
- ets_printf("\nPanic %s:%d %s\n", s_panic_file, s_panic_line, s_panic_func);
+ ets_printf_P("\nPanic ");
+ ets_puts_P(s_panic_file); // This is in PROGMEM, need special output because ets_printf can't handle ROM parameters
+ ets_printf_P(":%d %s", s_panic_line, s_panic_func);
+ if (s_panic_what) {
+ ets_printf_P(": Assertion '");
+ ets_puts_P(s_panic_what); // This is also in PMEM
+ ets_printf_P("' failed.");
+ }
+ ets_putc('\n');
}
else if (s_abort_called) {
- ets_printf("Abort called\n");
+ ets_printf_P("\nAbort called\n");
}
else if (rst_info.reason == REASON_EXCEPTION_RST) {
- ets_printf("\nException (%d):\nepc1=0x%08x epc2=0x%08x epc3=0x%08x excvaddr=0x%08x depc=0x%08x\n",
+ ets_printf_P("\nException (%d):\nepc1=0x%08x epc2=0x%08x epc3=0x%08x excvaddr=0x%08x depc=0x%08x\n",
rst_info.exccause, rst_info.epc1, rst_info.epc2, rst_info.epc3, rst_info.excvaddr, rst_info.depc);
}
else if (rst_info.reason == REASON_SOFT_WDT_RST) {
- ets_printf("\nSoft WDT reset\n");
+ ets_printf_P("\nSoft WDT reset\n");
}
- uint32_t cont_stack_start = (uint32_t) &(g_cont.stack);
- uint32_t cont_stack_end = (uint32_t) g_cont.stack_end;
+ uint32_t cont_stack_start = (uint32_t) &(g_pcont->stack);
+ uint32_t cont_stack_end = (uint32_t) g_pcont->stack_end;
uint32_t stack_end;
// amount of stack taken by interrupt or exception handler
@@ -97,21 +150,25 @@ void __wrap_system_restart_local() {
}
if (sp > cont_stack_start && sp < cont_stack_end) {
- ets_printf("\nctx: cont \n");
+ ets_printf_P("\nctx: cont \n");
stack_end = cont_stack_end;
}
else {
- ets_printf("\nctx: sys \n");
+ ets_printf_P("\nctx: sys \n");
stack_end = 0x3fffffb0;
// it's actually 0x3ffffff0, but the stuff below ets_run
// is likely not really relevant to the crash
}
- ets_printf("sp: %08x end: %08x offset: %04x\n", sp, stack_end, offset);
+ ets_printf_P("sp: %08x end: %08x offset: %04x\n", sp, stack_end, offset);
- // print_pcs(sp + offset, stack_end);
print_stack(sp + offset, stack_end);
+ // Use cap-X formatting to ensure the standard EspExceptionDecoder doesn't match the address
+ if (umm_last_fail_alloc_addr) {
+ ets_printf("\nlast failed alloc call: %08X(%d)\n", (uint32_t)umm_last_fail_alloc_addr, umm_last_fail_alloc_size);
+ }
+
custom_crash_callback( &rst_info, sp + offset, stack_end );
delayMicroseconds(10000);
@@ -119,38 +176,21 @@ void __wrap_system_restart_local() {
}
-static void print_stack(uint32_t start, uint32_t end) {
- ets_printf("\n>>>stack>>>\n");
+static void ICACHE_RAM_ATTR print_stack(uint32_t start, uint32_t end) {
+ ets_printf_P("\n>>>stack>>>\n");
for (uint32_t pos = start; pos < end; pos += 0x10) {
uint32_t* values = (uint32_t*)(pos);
// rough indicator: stack frames usually have SP saved as the second word
bool looksLikeStackFrame = (values[2] == pos + 0x10);
- ets_printf("%08x: %08x %08x %08x %08x %c\n",
+ ets_printf_P("%08x: %08x %08x %08x %08x %c\n",
pos, values[0], values[1], values[2], values[3], (looksLikeStackFrame)?'<':' ');
}
- ets_printf("<<>>pc>>>\n");
- for (uint32_t pos = start; pos < end; pos += 16, ++n) {
- uint32_t* sf = (uint32_t*) pos;
-
- uint32_t pc_ret = sf[3];
- uint32_t sp_ret = sf[2];
- if (pc_ret < 0x40000000 || pc_ret > 0x40f00000 || sp_ret != pos + 16)
- continue;
- ets_printf("%08x\n", pc_ret);
- }
- ets_printf("<<0){ //if SDA low, read the bits slaves have to sent to a max
+ while (SDA_READ()==0 && clockCount>0) { //if SDA low, read the bits slaves have to sent to a max
+ --clockCount;
twi_read_bit();
- if (SCL_READ()==0) return I2C_SCL_HELD_LOW_AFTER_READ; //I2C bus error. SCL held low beyond slave clock stretch time
+ if (SCL_READ()==0)
+ return I2C_SCL_HELD_LOW_AFTER_READ; //I2C bus error. SCL held low beyond slave clock stretch time
}
- if (SDA_READ()==0) return I2C_SDA_HELD_LOW; //I2C bus error. SDA line held low by slave/another_master after n bits.
+ if (SDA_READ()==0)
+ return I2C_SDA_HELD_LOW; //I2C bus error. SDA line held low by slave/another_master after n bits.
- if(!twi_write_start()) return I2C_SDA_HELD_LOW_AFTER_INIT; //line busy. SDA again held low by another device. 2nd master?
- else return I2C_OK; //all ok
-}
\ No newline at end of file
+ if(!twi_write_start())
+ return I2C_SDA_HELD_LOW_AFTER_INIT; //line busy. SDA again held low by another device. 2nd master?
+
+ return I2C_OK; //all ok
+
+}
diff --git a/cores/esp8266/core_esp8266_sigma_delta.c b/cores/esp8266/core_esp8266_sigma_delta.c
new file mode 100644
index 0000000000..d101401c2e
--- /dev/null
+++ b/cores/esp8266/core_esp8266_sigma_delta.c
@@ -0,0 +1,174 @@
+/*
+ core_esp8266_sigma_delta.c - sigma delta library for esp8266
+
+ Copyright (c) 2014 Ivan Grokhotkov. All rights reserved.
+ This file is part of the esp8266 core for Arduino environment.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "Arduino.h" // using pinMode
+
+// definitions in esp8266_peri.h style
+#define GPSD ESP8266_REG(0x368) // GPIO_SIGMA_DELTA register @ 0x600000368
+#define GPSDT 0 // target, 8 bits
+#define GPSDP 8 // prescaler, 8 bits
+#define GPSDE 16 // enable
+
+void sigmaDeltaSetPrescaler(uint8_t prescaler); // avoids compiler warning
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaEnable
+ * Description : enable the internal sigma delta source
+ * Parameters : none
+ * Returns : none
+*******************************************************************************/
+void ICACHE_FLASH_ATTR sigmaDeltaEnable()
+{
+ GPSD = (0 << GPSDT) | (0 << GPSDP) | (1 << GPSDE); //SIGMA_DELTA_TARGET(0) | SIGMA_DELTA_PRESCALER(0) | SIGMA_DELTA_ENABLE(ENABLED)
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaDisable
+ * Description : stop the internal sigma delta source
+ * Parameters : none
+ * Returns : none
+*******************************************************************************/
+void ICACHE_FLASH_ATTR sigmaDeltaDisable()
+{
+ GPSD = (0 << GPSDT) | (0 << GPSDP) | (0 << GPSDE); //SIGMA_DELTA_TARGET(0) | SIGMA_DELTA_PRESCALER(0) | SIGMA_DELTA_ENABLE(DISABLED)
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaAttachPin
+ * Description : connects the sigma delta source to a physical output pin
+ * Parameters : pin (0..15), channel = unused, for compatibility with ESP32
+ * Returns : none
+*******************************************************************************/
+void ICACHE_FLASH_ATTR sigmaDeltaAttachPin(uint8_t pin, uint8_t channel)
+{
+ (void) channel;
+ // make the chosen pin an output pin
+ pinMode (pin, OUTPUT);
+ if (pin < 16) {
+ // set its source to the sigma delta source
+ GPC(pin) |= (1 << GPCS); //SOURCE 0:GPIO_DATA,1:SigmaDelta
+ }
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaDetachPin
+ * Description : disconnects the sigma delta source from a physical output pin
+ * Parameters : pin (0..16)
+ * Returns : none
+*******************************************************************************/
+void ICACHE_FLASH_ATTR sigmaDeltaDetachPin(uint8_t pin)
+{
+ if (pin < 16) {
+ // set its source to the sigma delta source
+ GPC(pin) &= ~(1 << GPCS); //SOURCE 0:GPIO_DATA,1:SigmaDelta
+ }
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaIsPinAttached
+ * Description : query if pin is attached
+ * Parameters : pin (0..16)
+ * Returns : bool
+*******************************************************************************/
+bool ICACHE_FLASH_ATTR sigmaDeltaIsPinAttached(uint8_t pin)
+{
+ if (pin < 16) {
+ // set its source to the sigma delta source
+ return (GPC(pin) & (1 << GPCS)); //SOURCE 0:GPIO_DATA,1:SigmaDelta
+ }
+ else
+ return false;
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaSetup
+ * Description : start the sigma delta generator with the chosen parameters
+ * Parameters : channel = unused (for compatibility with ESP32),
+ * freq : 1220-312500 (lowest frequency in the output signal's spectrum)
+ * Returns : uint32_t the actual frequency, closest to the input parameter
+*******************************************************************************/
+uint32_t ICACHE_FLASH_ATTR sigmaDeltaSetup(uint8_t channel, uint32_t freq)
+{
+ (void) channel;
+
+ uint32_t prescaler = ((uint32_t)10000000/(freq*32)) - 1;
+
+ if(prescaler > 0xFF) {
+ prescaler = 0xFF;
+ }
+ sigmaDeltaEnable();
+ sigmaDeltaSetPrescaler ((uint8_t) prescaler);
+
+ return 10000000/((prescaler + 1) * 32);
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaWrite
+ * Description : set the duty cycle for the sigma-delta source
+ * Parameters : uint8 duty, 0-255, duty cycle = target/256,
+ * channel = unused, for compatibility with ESP32
+ * Returns : none
+*******************************************************************************/
+void ICACHE_FLASH_ATTR sigmaDeltaWrite(uint8_t channel, uint8_t duty)
+{
+ uint32_t reg = GPSD;
+ (void) channel;
+
+ reg = (reg & ~(0xFF << GPSDT)) | ((duty & 0xFF) << GPSDT);
+ GPSD = reg;
+
+}
+/******************************************************************************
+ * FunctionName : sigmaDeltaRead
+ * Description : get the duty cycle for the sigma-delta source
+ * Parameters : channel = unused, for compatibility with ESP32
+ * Returns : uint8_t duty cycle value 0..255
+*******************************************************************************/
+uint8_t ICACHE_FLASH_ATTR sigmaDeltaRead(uint8_t channel)
+{
+ (void) channel;
+ return (uint8_t)((GPSD >> GPSDT) & 0xFF);
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaSetPrescaler
+ * Description : set the clock divider for the sigma-delta source
+ * Parameters : uint8 prescaler, 0-255, divides the 80MHz base clock by this amount
+ * Returns : none
+*******************************************************************************/
+void ICACHE_FLASH_ATTR sigmaDeltaSetPrescaler(uint8_t prescaler)
+{
+ uint32_t reg = GPSD;
+
+ reg = (reg & ~(0xFF << GPSDP)) | ((prescaler & 0xFF) << GPSDP);
+ GPSD = reg;
+}
+
+/******************************************************************************
+ * FunctionName : sigmaDeltaGetPrescaler
+ * Description : get the prescaler value from the GPIO_SIGMA_DELTA register
+ * Parameters : none
+ * Returns : uint8 prescaler, CLK_DIV , 0-255
+*******************************************************************************/
+uint8_t ICACHE_FLASH_ATTR sigmaDeltaGetPrescaler(void)
+{
+ return (uint8_t)((GPSD >> GPSDP) & 0xFF);
+}
diff --git a/cores/esp8266/core_esp8266_timer.c b/cores/esp8266/core_esp8266_timer.c
index d10b7c4ee6..1b18861ae4 100644
--- a/cores/esp8266/core_esp8266_timer.c
+++ b/cores/esp8266/core_esp8266_timer.c
@@ -30,6 +30,7 @@
static volatile timercallback timer1_user_cb = NULL;
void ICACHE_RAM_ATTR timer1_isr_handler(void *para){
+ (void) para;
if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable
T1I = 0;
if (timer1_user_cb) {
@@ -77,6 +78,7 @@ void ICACHE_RAM_ATTR timer1_disable(){
static volatile timercallback timer0_user_cb = NULL;
void ICACHE_RAM_ATTR timer0_isr_handler(void* para){
+ (void) para;
if (timer0_user_cb) {
// to make ISR compatible to Arduino AVR model where interrupts are disabled
// we disable them before we call the client ISR
diff --git a/cores/esp8266/core_esp8266_wiring.c b/cores/esp8266/core_esp8266_wiring.c
index 3a8f0f293d..3d91043d34 100644
--- a/cores/esp8266/core_esp8266_wiring.c
+++ b/cores/esp8266/core_esp8266_wiring.c
@@ -36,6 +36,7 @@ static uint32_t micros_overflow_count = 0;
#define REPEAT 1
void delay_end(void* arg) {
+ (void) arg;
esp_schedule();
}
@@ -53,22 +54,152 @@ void delay(unsigned long ms) {
}
void micros_overflow_tick(void* arg) {
+ (void) arg;
uint32_t m = system_get_time();
if(m < micros_at_last_overflow_tick)
++micros_overflow_count;
micros_at_last_overflow_tick = m;
}
-unsigned long ICACHE_RAM_ATTR millis() {
- uint32_t m = system_get_time();
- uint32_t c = micros_overflow_count + ((m < micros_at_last_overflow_tick) ? 1 : 0);
- return c * 4294967 + m / 1000;
-}
+//---------------------------------------------------------------------------
+// millis() 'magic multiplier' approximation
+//
+// This function corrects the cumlative (296us / usec overflow) drift
+// seen in the orignal 'millis()' function.
+//
+// Input:
+// 'm' - 32-bit usec counter, 0 <= m <= 0xFFFFFFFF
+// 'c' - 32-bit usec overflow counter 0 <= c < 0x00400000
+// Output:
+// Returns milliseconds in modulo 0x1,0000,0000 (0 to 0xFFFFFFFF)
+//
+// Notes:
+//
+// 1) This routine approximates the 64-bit integer division,
+//
+// quotient = ( 2^32 c + m ) / 1000,
+//
+// through the use of 'magic' multipliers. A slow division is replaced by
+// a faster multiply using a scaled multiplicative inverse of the divisor:
+//
+// quotient =~ ( 2^32 c + m ) * k, where k = Ceiling[ 2^n / 1000 ]
+//
+// The precision difference between multiplier and divisor sets the
+// upper-bound of the dividend which can be successfully divided.
+//
+// For this application, n = 64, and the divisor (1000) has 10-bits of
+// precision. This sets the dividend upper-bound to (64 - 10) = 54 bits,
+// and that of 'c' to (54 - 32) = 22 bits. This corresponds to a value
+// for 'c' = 0x0040,0000 , or +570 years of usec counter overflows.
+//
+// 2) A distributed multiply with offset-summing is used find k( 2^32 c + m ):
+//
+// prd = (2^32 kh + kl) * ( 2^32 c + m )
+// = 2^64 kh c + 2^32 kl c + 2^32 kh m + kl m
+// (d) (c) (b) (a)
+//
+// Graphically, the offset-sums align in little endian like this:
+// LS -> MS
+// 32 64 96 128
+// | a[-1] | a[0] | a[1] | a[2] |
+// | m kl | 0 | 0 | a[-1] not needed
+// | | m kh | |
+// | | c kl | | a[1] holds the result
+// | | | c kh | a[2] can be discarded
+//
+// As only the high-word of 'm kl' and low-word of 'c kh' contribute to the
+// overall result, only (2) 32-bit words are needed for the accumulator.
+//
+// 3) As C++ does not intrinsically test for addition overflows, one must
+// code specifically to detect them. This approximation skips these
+// overflow checks for speed, hence the sum,
+//
+// highword( m kl ) + m kh + c kl < (2^64-1), MUST NOT OVERFLOW.
+//
+// To meet this criteria, not only do we have to pick 'k' to achieve our
+// desired precision, we also have to split 'k' appropriately to avoid
+// any addition overflows.
+//
+// 'k' should be also chosen to align the various products on byte
+// boundaries to avoid any 64-bit shifts before additions, as they incur
+// major time penalties. The 'k' chosen for this specific division by 1000
+// was picked primarily to avoid shifts as well as for precision.
+//
+// For the reasons list above, this routine is NOT a general one.
+// Changing divisors could break the overflow requirement and force
+// picking a 'k' split which requires shifts before additions.
+//
+// ** Test THOROUGHLY after making changes **
+//
+// 4) Results of time benchmarks run on an ESP8266 Huzzah feather are:
+//
+// usec x Orig Comment
+// Orig: 3.18 1.00 Original code
+// Corr: 13.21 4.15 64-bit reference code
+// Test: 4.60 1.45 64-bit magic multiply, 4x32
+//
+// The magic multiplier routine runs ~3x faster than the reference. Execution
+// times can vary considerably with the numbers being multiplied, so one
+// should derate this factor to around 2x, worst case.
+//
+// Reference function: corrected millis(), 64-bit arithmetic,
+// truncated to 32-bits by return
+// unsigned long ICACHE_RAM_ATTR millis_corr_DEBUG( void )
+// {
+// // Get usec system time, usec overflow conter
+// ......
+// return ( (c * 4294967296 + m) / 1000 ); // 64-bit division is SLOW
+// } //millis_corr
+//
+// 5) See this link for a good discussion on magic multipliers:
+// http://ridiculousfish.com/blog/posts/labor-of-division-episode-i.html
+//
+
+#define MAGIC_1E3_wLO 0x4bc6a7f0 // LS part
+#define MAGIC_1E3_wHI 0x00418937 // MS part, magic multiplier
+
+unsigned long ICACHE_RAM_ATTR millis()
+{
+ union {
+ uint64_t q; // Accumulator, 64-bit, little endian
+ uint32_t a[2]; // ..........., 32-bit segments
+ } acc;
+ acc.a[1] = 0; // Zero high-acc
+
+ // Get usec system time, usec overflow counter
+ uint32_t m = system_get_time();
+ uint32_t c = micros_overflow_count +
+ ((m < micros_at_last_overflow_tick) ? 1 : 0);
+
+ // (a) Init. low-acc with high-word of 1st product. The right-shift
+ // falls on a byte boundary, hence is relatively quick.
+
+ acc.q = ( (uint64_t)( m * (uint64_t)MAGIC_1E3_wLO ) >> 32 );
+
+ // (b) Offset sum, low-acc
+ acc.q += ( m * (uint64_t)MAGIC_1E3_wHI );
+
+ // (c) Offset sum, low-acc
+ acc.q += ( c * (uint64_t)MAGIC_1E3_wLO );
+
+ // (d) Truncated sum, high-acc
+ acc.a[1] += (uint32_t)( c * (uint64_t)MAGIC_1E3_wHI );
+
+ return ( acc.a[1] ); // Extract result, high-acc
+
+} //millis
unsigned long ICACHE_RAM_ATTR micros() {
return system_get_time();
}
+uint64_t ICACHE_RAM_ATTR micros64() {
+ uint32_t low32_us = system_get_time();
+ uint32_t high32_us = micros_overflow_count + ((low32_us < micros_at_last_overflow_tick) ? 1 : 0);
+ uint64_t duration64_us = (uint64_t)high32_us << 32 | low32_us;
+ return duration64_us;
+}
+
void ICACHE_RAM_ATTR delayMicroseconds(unsigned int us) {
os_delay_us(us);
}
diff --git a/cores/esp8266/core_esp8266_wiring_digital.c b/cores/esp8266/core_esp8266_wiring_digital.c
index 1961b42283..6b9b129cac 100644
--- a/cores/esp8266/core_esp8266_wiring_digital.c
+++ b/cores/esp8266/core_esp8266_wiring_digital.c
@@ -105,16 +105,20 @@ extern int ICACHE_RAM_ATTR __digitalRead(uint8_t pin) {
*/
typedef void (*voidFuncPtr)(void);
+typedef void (*voidFuncPtrArg)(void*);
typedef struct {
uint8_t mode;
void (*fn)(void);
+ void * arg;
} interrupt_handler_t;
+
static interrupt_handler_t interrupt_handlers[16];
static uint32_t interrupt_reg = 0;
void ICACHE_RAM_ATTR interrupt_handler(void *arg) {
+ (void) arg;
uint32_t status = GPIE;
GPIEC = status;//clear them interrupts
uint32_t levels = GPI;
@@ -126,39 +130,59 @@ void ICACHE_RAM_ATTR interrupt_handler(void *arg) {
while(!(changedbits & (1 << i))) i++;
changedbits &= ~(1 << i);
interrupt_handler_t *handler = &interrupt_handlers[i];
- if (handler->fn &&
- (handler->mode == CHANGE ||
+ if (handler->fn &&
+ (handler->mode == CHANGE ||
(handler->mode & 1) == !!(levels & (1 << i)))) {
// to make ISR compatible to Arduino AVR model where interrupts are disabled
// we disable them before we call the client ISR
- uint32_t savedPS = xt_rsil(15); // stop other interrupts
- handler->fn();
- xt_wsr_ps(savedPS);
+ uint32_t savedPS = xt_rsil(15); // stop other interrupts
+ if (handler->arg)
+ {
+ ((voidFuncPtrArg)handler->fn)(handler->arg);
+ }
+ else
+ {
+ handler->fn();
+ }
+ xt_wsr_ps(savedPS);
}
}
ETS_GPIO_INTR_ENABLE();
}
-extern void ICACHE_RAM_ATTR __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int mode) {
+extern void ICACHE_RAM_ATTR __attachInterruptArg(uint8_t pin, voidFuncPtr userFunc, void *arg, int mode) {
if(pin < 16) {
+ ETS_GPIO_INTR_DISABLE();
interrupt_handler_t *handler = &interrupt_handlers[pin];
handler->mode = mode;
handler->fn = userFunc;
+ handler->arg = arg;
interrupt_reg |= (1 << pin);
GPC(pin) &= ~(0xF << GPCI);//INT mode disabled
GPIEC = (1 << pin); //Clear Interrupt for this pin
GPC(pin) |= ((mode & 0xF) << GPCI);//INT mode "mode"
+ ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg);
+ ETS_GPIO_INTR_ENABLE();
}
}
+extern void ICACHE_RAM_ATTR __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int mode )
+{
+ __attachInterruptArg (pin, userFunc, 0, mode);
+}
+
extern void ICACHE_RAM_ATTR __detachInterrupt(uint8_t pin) {
if(pin < 16) {
+ ETS_GPIO_INTR_DISABLE();
GPC(pin) &= ~(0xF << GPCI);//INT mode disabled
GPIEC = (1 << pin); //Clear Interrupt for this pin
interrupt_reg &= ~(1 << pin);
interrupt_handler_t *handler = &interrupt_handlers[pin];
handler->mode = 0;
handler->fn = 0;
+ handler->arg = 0;
+ if (interrupt_reg)
+ ETS_GPIO_INTR_ENABLE();
}
}
@@ -175,9 +199,6 @@ void initPins() {
for (int i = 12; i <= 16; ++i) {
pinMode(i, INPUT);
}
-
- ETS_GPIO_INTR_ATTACH(interrupt_handler, &interrupt_reg);
- ETS_GPIO_INTR_ENABLE();
}
extern void pinMode(uint8_t pin, uint8_t mode) __attribute__ ((weak, alias("__pinMode")));
@@ -185,3 +206,4 @@ extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__ ((weak, alias("
extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead")));
extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));
+
diff --git a/cores/esp8266/core_esp8266_wiring_pwm.c b/cores/esp8266/core_esp8266_wiring_pwm.c
index 8d1ec15604..671eaa4145 100644
--- a/cores/esp8266/core_esp8266_wiring_pwm.c
+++ b/cores/esp8266/core_esp8266_wiring_pwm.c
@@ -187,7 +187,7 @@ extern void __analogWrite(uint8_t pin, int value)
}
if((pwm_mask & (1 << pin)) == 0) {
if(pwm_mask == 0) {
- memset(&_pwm_isr_data, 0, sizeof(struct pwm_isr_data*));
+ memset(&_pwm_isr_data, 0, sizeof(_pwm_isr_data));
start_timer = true;
}
pinMode(pin, OUTPUT);
diff --git a/cores/esp8266/core_version.h b/cores/esp8266/core_version.h
index 09e384c1fd..e4556d7e03 100644
--- a/cores/esp8266/core_version.h
+++ b/cores/esp8266/core_version.h
@@ -1,4 +1,5 @@
#define ARDUINO_ESP8266_GIT_VER 0x00000000
+#define ARDUINO_ESP8266_GIT_DESC unspecified
// ARDUINO_ESP8266_RELEASE is defined for released versions as a string containing the version name, i.e. "2_3_0_RC1"
// ARDUINO_ESP8266_RELEASE is used in the core internally. Please use ESP.getCoreVersion() function instead.
diff --git a/cores/esp8266/coredecls.h b/cores/esp8266/coredecls.h
new file mode 100644
index 0000000000..9e06419ca4
--- /dev/null
+++ b/cores/esp8266/coredecls.h
@@ -0,0 +1,20 @@
+
+#ifndef __COREDECLS_H
+#define __COREDECLS_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// TODO: put declarations here, get rid of -Wno-implicit-function-declaration
+
+extern bool timeshift64_is_set;
+
+void tune_timeshift64 (uint64_t now_us);
+void settimeofday_cb (void (*cb)(void));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // __COREDECLS_H
diff --git a/cores/esp8266/debug.cpp b/cores/esp8266/debug.cpp
index 478fe7392d..6a99510fe6 100644
--- a/cores/esp8266/debug.cpp
+++ b/cores/esp8266/debug.cpp
@@ -21,15 +21,16 @@
#include "Arduino.h"
#include "debug.h"
-void ICACHE_RAM_ATTR hexdump(uint8_t *mem, uint32_t len, uint8_t cols) {
- os_printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (size_t)mem, len, len);
+void ICACHE_RAM_ATTR hexdump(const void *mem, uint32_t len, uint8_t cols) {
+ const uint8_t* src = (const uint8_t*) mem;
+ os_printf("\n[HEXDUMP] Address: 0x%08X len: 0x%X (%d)", (ptrdiff_t)src, len, len);
for(uint32_t i = 0; i < len; i++) {
if(i % cols == 0) {
- os_printf("\n[0x%08X] 0x%08X: ", (size_t)mem, i);
+ os_printf("\n[0x%08X] 0x%08X: ", (ptrdiff_t)src, i);
yield();
}
- os_printf("%02X ", *mem);
- mem++;
+ os_printf("%02X ", *src);
+ src++;
}
os_printf("\n");
}
diff --git a/cores/esp8266/debug.h b/cores/esp8266/debug.h
index 89d18c05b8..92d1356dce 100644
--- a/cores/esp8266/debug.h
+++ b/cores/esp8266/debug.h
@@ -13,9 +13,9 @@
#endif
#ifdef __cplusplus
-void hexdump(uint8_t *mem, uint32_t len, uint8_t cols = 16);
+void hexdump(const void *mem, uint32_t len, uint8_t cols = 16);
#else
-void hexdump(uint8_t *mem, uint32_t len, uint8_t cols);
+void hexdump(const void *mem, uint32_t len, uint8_t cols);
#endif
#ifdef __cplusplus
diff --git a/cores/esp8266/esp8266_peri.h b/cores/esp8266/esp8266_peri.h
index 0ad689353c..01f2a417cd 100644
--- a/cores/esp8266/esp8266_peri.h
+++ b/cores/esp8266/esp8266_peri.h
@@ -586,6 +586,10 @@ extern uint8_t esp8266_gpioToFn[16];
#define SPIE2IHEN 0x3 //SPI_INT_HOLD_ENA
#define SPIE2IHEN_S 0 //SPI_INT_HOLD_ENA_S
+//SPI PIN (SPIxP)
+#define SPIPCS2DIS (1 << 2)
+#define SPIPCS1DIS (1 << 1)
+#define SPIPCS0DIS (1 << 0)
//SLC (DMA) Registers
#define SLCC0 ESP8266_REG(0xB00) //SLC_CONF0
@@ -750,7 +754,7 @@ extern uint8_t esp8266_gpioToFn[16];
#define i2c_bbpll_en_audio_clock_out_msb 7
#define i2c_bbpll_en_audio_clock_out_lsb 7
#define I2S_CLK_ENABLE() i2c_writeReg_Mask_def(i2c_bbpll, i2c_bbpll_en_audio_clock_out, 1)
-#define I2SBASEFREQ (12000000L)
+#define I2SBASEFREQ (160000000L)
#define I2STXF ESP8266_REG(0xe00) //I2STXFIFO (32bit)
#define I2SRXF ESP8266_REG(0xe04) //I2SRXFIFO (32bit)
diff --git a/cores/esp8266/gdb_hooks.c b/cores/esp8266/gdb_hooks.c
new file mode 100644
index 0000000000..9d5eb3c3ab
--- /dev/null
+++ b/cores/esp8266/gdb_hooks.c
@@ -0,0 +1,36 @@
+/*
+ gdb_hooks.c - Default (no-op) hooks for GDB Stub library
+ Copyright (c) 2018 Ivan Grokhotkov. All right reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#include "ets_sys.h"
+#include "gdb_hooks.h"
+
+
+/* gdb_init and gdb_do_break do not return anything, but since the return
+ value is in register, it doesn't hurt to return a bool, so that the
+ same stub can be used for gdb_present. */
+
+bool ICACHE_RAM_ATTR __gdb_no_op()
+{
+ return false;
+}
+
+extern void gdb_init(void) __attribute__ ((weak, alias("__gdb_no_op")));
+extern void gdb_do_break(void) __attribute__ ((weak, alias("__gdb_no_op")));
+extern bool gdb_present(void) __attribute__ ((weak, alias("__gdb_no_op")));
+
diff --git a/cores/esp8266/gdb_hooks.h b/cores/esp8266/gdb_hooks.h
new file mode 100644
index 0000000000..1d7a375d6c
--- /dev/null
+++ b/cores/esp8266/gdb_hooks.h
@@ -0,0 +1,57 @@
+/*
+ gdb_hooks.h - Hooks for GDB Stub library
+ Copyright (c) 2018 Ivan Grokhotkov. All right reserved.
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+*/
+
+#pragma once
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @brief Initialize GDB stub, if present
+ *
+ * By default, this function is a no-op. When GDBStub library is linked,
+ * this function is overriden and does necessary initialization of that library.
+ * Called early at startup.
+ */
+void gdb_init(void);
+
+/**
+ * @brief Break into GDB, if present
+ *
+ * By default, this function is a no-op. When GDBStub library is linked,
+ * this function is overriden and triggers entry into the debugger, which
+ * looks like a breakpoint hit.
+ */
+void gdb_do_break(void);
+
+/**
+ * @brief Check if GDB stub is present.
+ *
+ * By default, this function returns false. When GDBStub library is linked,
+ * this function is overriden and returns true. Can be used to check whether
+ * GDB is used.
+ *
+ * @return true if GDB stub is present
+ */
+bool gdb_present(void);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/cores/esp8266/heap.c b/cores/esp8266/heap.c
index 3a8154d405..5f5aaef799 100644
--- a/cores/esp8266/heap.c
+++ b/cores/esp8266/heap.c
@@ -8,51 +8,173 @@
#include
#include
+// Debugging helper, last allocation which returned NULL
+void *umm_last_fail_alloc_addr = NULL;
+int umm_last_fail_alloc_size = 0;
+
void* _malloc_r(struct _reent* unused, size_t size)
{
- return malloc(size);
+ (void) unused;
+ 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 _free_r(struct _reent* unused, void* ptr)
{
+ (void) unused;
return free(ptr);
}
void* _realloc_r(struct _reent* unused, void* ptr, size_t size)
{
- return realloc(ptr, size);
+ (void) unused;
+ void *ret = realloc(ptr, size);
+ if (0 != size && 0 == ret) {
+ umm_last_fail_alloc_addr = __builtin_return_address(0);
+ umm_last_fail_alloc_size = size;
+ }
+ return ret;
}
void* _calloc_r(struct _reent* unused, size_t count, size_t size)
{
- return calloc(count, size);
+ (void) unused;
+ void *ret = calloc(count, size);
+ if (0 != (count * size) && 0 == ret) {
+ umm_last_fail_alloc_addr = __builtin_return_address(0);
+ umm_last_fail_alloc_size = count * size;
+ }
+ return ret;
}
+void ICACHE_RAM_ATTR vPortFree(void *ptr, const char* file, int line)
+{
+ (void) file;
+ (void) line;
+ free(ptr);
+}
+
+#ifdef DEBUG_ESP_OOM
+
void* ICACHE_RAM_ATTR pvPortMalloc(size_t size, const char* file, int line)
{
- return malloc(size);
+ return malloc_loc(size, file, line);
}
-void ICACHE_RAM_ATTR vPortFree(void *ptr, const char* file, int line)
+void* ICACHE_RAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, int line)
{
- free(ptr);
+ return calloc_loc(count, size, file, line);
+}
+
+void* ICACHE_RAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line)
+{
+ return realloc_loc(ptr, size, file, line);
+}
+
+void* ICACHE_RAM_ATTR pvPortZalloc(size_t size, const char* file, int line)
+{
+ return calloc_loc(1, size, file, line);
+}
+
+#undef malloc
+#undef calloc
+#undef realloc
+
+static const char oom_fmt[] ICACHE_RODATA_ATTR STORE_ATTR = ":oom(%d)@?\n";
+static const char oom_fmt_1[] ICACHE_RODATA_ATTR STORE_ATTR = ":oom(%d)@";
+static const char oom_fmt_2[] ICACHE_RODATA_ATTR STORE_ATTR = ":%d\n";
+
+void* malloc (size_t s)
+{
+ void* ret = umm_malloc(s);
+ if (!ret)
+ os_printf(oom_fmt, (int)s);
+ return ret;
+}
+
+void* calloc (size_t n, size_t s)
+{
+ void* ret = umm_calloc(n, s);
+ if (!ret)
+ os_printf(oom_fmt, (int)s);
+ return ret;
+}
+
+void* realloc (void* p, size_t s)
+{
+ void* ret = umm_realloc(p, s);
+ if (!ret)
+ os_printf(oom_fmt, (int)s);
+ return ret;
+}
+
+void print_loc (size_t s, const char* file, int line)
+{
+ os_printf(oom_fmt_1, (int)s);
+ os_printf(file);
+ os_printf(oom_fmt_2, line);
+}
+
+void* malloc_loc (size_t s, const char* file, int line)
+{
+ void* ret = umm_malloc(s);
+ if (!ret)
+ print_loc(s, file, line);
+ return ret;
+}
+
+void* calloc_loc (size_t n, size_t s, const char* file, int line)
+{
+ void* ret = umm_calloc(n, s);
+ if (!ret)
+ print_loc(s, file, line);
+ return ret;
+}
+
+void* realloc_loc (void* p, size_t s, const char* file, int line)
+{
+ void* ret = umm_realloc(p, s);
+ if (!ret)
+ print_loc(s, file, line);
+ return ret;
+}
+
+#else
+
+void* ICACHE_RAM_ATTR pvPortMalloc(size_t size, const char* file, int line)
+{
+ (void) file;
+ (void) line;
+ return malloc(size);
}
void* ICACHE_RAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, int line)
{
+ (void) file;
+ (void) line;
return calloc(count, size);
}
void* ICACHE_RAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line)
{
+ (void) file;
+ (void) line;
return realloc(ptr, size);
}
void* ICACHE_RAM_ATTR pvPortZalloc(size_t size, const char* file, int line)
{
+ (void) file;
+ (void) line;
return calloc(1, size);
}
+#endif // !defined(DEBUG_ESP_OOM)
+
size_t xPortGetFreeHeapSize(void)
{
return umm_free_heap_size();
diff --git a/cores/esp8266/i2s.h b/cores/esp8266/i2s.h
index f248d590c4..6f1761e6fa 100644
--- a/cores/esp8266/i2s.h
+++ b/cores/esp8266/i2s.h
@@ -40,17 +40,27 @@ speed.
extern "C" {
#endif
-void i2s_begin();
+void i2s_begin(); // Enable TX only, for compatibility
+bool i2s_rxtx_begin(bool enableRx, bool enableTx); // Allow TX and/or RX, returns false on OOM error
void i2s_end();
void i2s_set_rate(uint32_t rate);//Sample Rate in Hz (ex 44100, 48000)
+void i2s_set_dividers(uint8_t div1, uint8_t div2);//Direct control over output rate
+float i2s_get_real_rate();//The actual Sample Rate on output
bool i2s_write_sample(uint32_t sample);//32bit sample with channels being upper and lower 16 bits (blocking when DMA is full)
bool i2s_write_sample_nb(uint32_t sample);//same as above but does not block when DMA is full and returns false instead
bool i2s_write_lr(int16_t left, int16_t right);//combines both channels and calls i2s_write_sample with the result
+bool i2s_read_sample(int16_t *left, int16_t *right, bool blocking); // RX data returned in both 16-bit outputs.
bool i2s_is_full();//returns true if DMA is full and can not take more bytes (overflow)
bool i2s_is_empty();//returns true if DMA is empty (underflow)
+bool i2s_rx_is_full();
+bool i2s_rx_is_empty();
+int16_t i2s_available();// returns the number of samples than can be written before blocking
+int16_t i2s_rx_available();// returns the number of samples than can be written before blocking
+void i2s_set_callback(void (*callback) (void));
+void i2s_rx_set_callback(void (*callback) (void));
#ifdef __cplusplus
}
#endif
-#endif
\ No newline at end of file
+#endif
diff --git a/cores/esp8266/interrupts.h b/cores/esp8266/interrupts.h
index b4a2ed44b3..868a4a08ec 100644
--- a/cores/esp8266/interrupts.h
+++ b/cores/esp8266/interrupts.h
@@ -11,7 +11,7 @@ extern "C" {
// these auto classes wrap up xt_rsil so your code can be simplier, but can only be
// used in an ino or cpp files.
-// InterruptLock is used when you want to completely disable locks
+// InterruptLock is used when you want to completely disable interrupts
//{
// {
// InterruptLock lock;
diff --git a/cores/esp8266/libb64/cdecode.c b/cores/esp8266/libb64/cdecode.c
index 25e5c384cc..aa84ef60a8 100755
--- a/cores/esp8266/libb64/cdecode.c
+++ b/cores/esp8266/libb64/cdecode.c
@@ -6,10 +6,11 @@ For details, see http://sourceforge.net/projects/libb64
*/
#include "cdecode.h"
+#include
-int base64_decode_value(char value_in){
- static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
- static const char decoding_size = sizeof(decoding);
+static int base64_decode_value_signed(int8_t value_in){
+ static const int8_t decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51};
+ static const int8_t decoding_size = sizeof(decoding);
value_in -= 43;
if (value_in < 0 || value_in > decoding_size) return -1;
return decoding[(int)value_in];
@@ -20,10 +21,10 @@ void base64_init_decodestate(base64_decodestate* state_in){
state_in->plainchar = 0;
}
-int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in){
- const char* codechar = code_in;
- char* plainchar = plaintext_out;
- char fragment;
+static int base64_decode_block_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out, base64_decodestate* state_in){
+ const int8_t* codechar = code_in;
+ int8_t* plainchar = plaintext_out;
+ int8_t fragment;
*plainchar = state_in->plainchar;
@@ -36,7 +37,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
- fragment = (char)base64_decode_value(*codechar++);
+ fragment = (int8_t)base64_decode_value_signed(*codechar++);
} while (fragment < 0);
*plainchar = (fragment & 0x03f) << 2;
case step_b:
@@ -46,7 +47,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
- fragment = (char)base64_decode_value(*codechar++);
+ fragment = (int8_t)base64_decode_value_signed(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x030) >> 4;
*plainchar = (fragment & 0x00f) << 4;
@@ -57,7 +58,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
- fragment = (char)base64_decode_value(*codechar++);
+ fragment = (int8_t)base64_decode_value_signed(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x03c) >> 2;
*plainchar = (fragment & 0x003) << 6;
@@ -68,7 +69,7 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
state_in->plainchar = *plainchar;
return plainchar - plaintext_out;
}
- fragment = (char)base64_decode_value(*codechar++);
+ fragment = (int8_t)base64_decode_value_signed(*codechar++);
} while (fragment < 0);
*plainchar++ |= (fragment & 0x03f);
}
@@ -77,10 +78,22 @@ int base64_decode_block(const char* code_in, const int length_in, char* plaintex
return plainchar - plaintext_out;
}
-int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out){
+static int base64_decode_chars_signed(const int8_t* code_in, const int length_in, int8_t* plaintext_out){
base64_decodestate _state;
base64_init_decodestate(&_state);
- int len = base64_decode_block(code_in, length_in, plaintext_out, &_state);
+ int len = base64_decode_block_signed(code_in, length_in, plaintext_out, &_state);
if(len > 0) plaintext_out[len] = 0;
return len;
}
+
+int base64_decode_value(char value_in){
+ return base64_decode_value_signed(*((int8_t *) &value_in));
+}
+
+int base64_decode_block(const char* code_in, const int length_in, char* plaintext_out, base64_decodestate* state_in){
+ return base64_decode_block_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out, state_in);
+}
+
+int base64_decode_chars(const char* code_in, const int length_in, char* plaintext_out){
+ return base64_decode_chars_signed((int8_t *) code_in, length_in, (int8_t *) plaintext_out);
+}
diff --git a/cores/esp8266/libb64/cencode.c b/cores/esp8266/libb64/cencode.c
index 4631f09ed2..4b902997de 100755
--- a/cores/esp8266/libb64/cencode.c
+++ b/cores/esp8266/libb64/cencode.c
@@ -7,12 +7,17 @@ For details, see http://sourceforge.net/projects/libb64
#include "cencode.h"
-const int CHARS_PER_LINE = 72;
-
void base64_init_encodestate(base64_encodestate* state_in){
state_in->step = step_A;
state_in->result = 0;
state_in->stepcount = 0;
+ state_in->stepsnewline = BASE64_CHARS_PER_LINE;
+}
+
+
+void base64_init_encodestate_nonewlines(base64_encodestate* state_in){
+ base64_init_encodestate(state_in);
+ state_in->stepsnewline = -1;
}
char base64_encode_value(char value_in){
@@ -65,7 +70,7 @@ int base64_encode_block(const char* plaintext_in, int length_in, char* code_out,
*codechar++ = base64_encode_value(result);
++(state_in->stepcount);
- if (state_in->stepcount == CHARS_PER_LINE/4){
+ if ((state_in->stepcount == BASE64_CHARS_PER_LINE/4) && (state_in->stepsnewline > 0)){
*codechar++ = '\n';
state_in->stepcount = 0;
}
diff --git a/cores/esp8266/libb64/cencode.h b/cores/esp8266/libb64/cencode.h
index 058cc5d1a6..7c0efc22a0 100755
--- a/cores/esp8266/libb64/cencode.h
+++ b/cores/esp8266/libb64/cencode.h
@@ -8,7 +8,12 @@ For details, see http://sourceforge.net/projects/libb64
#ifndef BASE64_CENCODE_H
#define BASE64_CENCODE_H
-#define base64_encode_expected_len(n) ((((4 * n) / 3) + 3) & ~3)
+#define BASE64_CHARS_PER_LINE 72
+
+#define base64_encode_expected_len_nonewlines(n) ((((4 * (n)) / 3) + 3) & ~3)
+#define base64_encode_expected_len(n) \
+ (base64_encode_expected_len_nonewlines(n) + ((n / ((BASE64_CHARS_PER_LINE * 3) / 4)) + 1))
+
#ifdef __cplusplus
extern "C" {
@@ -22,9 +27,11 @@ typedef struct {
base64_encodestep step;
char result;
int stepcount;
+ int stepsnewline;
} base64_encodestate;
void base64_init_encodestate(base64_encodestate* state_in);
+void base64_init_encodestate_nonewlines(base64_encodestate* state_in);
char base64_encode_value(char value_in);
diff --git a/cores/esp8266/libc_replacements.c b/cores/esp8266/libc_replacements.c
index 6f517694bf..fe111ba4cb 100644
--- a/cores/esp8266/libc_replacements.c
+++ b/cores/esp8266/libc_replacements.c
@@ -83,6 +83,7 @@ int ICACHE_RAM_ATTR _read_r(struct _reent* unused, int file, char *ptr, int len)
}
int ICACHE_RAM_ATTR _write_r(struct _reent* r, int file, char *ptr, int len) {
+ (void) r;
if (file == STDOUT_FILENO) {
while(len--) {
ets_putc(*ptr);
@@ -93,6 +94,7 @@ int ICACHE_RAM_ATTR _write_r(struct _reent* r, int file, char *ptr, int len) {
}
int ICACHE_RAM_ATTR _putc_r(struct _reent* r, int c, FILE* file) {
+ (void) r;
if (file->_file == STDOUT_FILENO) {
return ets_putc(c);
}
@@ -115,39 +117,12 @@ int ICACHE_RAM_ATTR putchar(int c) {
return c;
}
-#if 0
-
-int ICACHE_RAM_ATTR printf(const char* format, ...) {
- va_list arglist;
- va_start(arglist, format);
- int ret = ets_vprintf(ets_putc, format, arglist);
- va_end(arglist);
- return ret;
-}
-
-int ICACHE_RAM_ATTR sprintf(char* buffer, const char* format, ...) {
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = ets_vsprintf(buffer, format, arglist);
- va_end(arglist);
- return ret;
-}
-
-int ICACHE_RAM_ATTR snprintf(char* buffer, size_t size, const char* format, ...) {
- int ret;
- va_list arglist;
- va_start(arglist, format);
- ret = ets_vsnprintf(buffer, size, format, arglist);
- va_end(arglist);
- return ret;
-}
-
-int ICACHE_RAM_ATTR vprintf(const char * format, va_list arg) {
- return ets_vprintf(ets_putc, format, arg);
+void _exit(int status) {
+ (void) status;
+ abort();
}
-int ICACHE_RAM_ATTR vsnprintf(char * buffer, size_t size, const char * format, va_list arg) {
- return ets_vsnprintf(buffer, size, format, arg);
+int atexit(void (*func)()) {
+ (void) func;
+ return 0;
}
-#endif
diff --git a/cores/esp8266/md5.h b/cores/esp8266/md5.h
index b3f1f54533..4efcaa9553 100644
--- a/cores/esp8266/md5.h
+++ b/cores/esp8266/md5.h
@@ -1,11 +1,11 @@
-/*
+/*
md5.h - exposed md5 ROM functions for esp8266
Copyright (c) 2015 Hristo Gochkov. All rights reserved.
This file is part of the esp8266 core for Arduino environment.
-
+
original C source from https://github.com/morrissinger/ESP8266-Websocket/raw/master/MD5.h
-
+
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@@ -34,7 +34,7 @@ typedef struct {
} md5_context_t;
extern void MD5Init (md5_context_t *);
-extern void MD5Update (md5_context_t *, uint8_t *, uint16_t);
+extern void MD5Update (md5_context_t *, const uint8_t *, const uint16_t);
extern void MD5Final (uint8_t [16], md5_context_t *);
#ifdef __cplusplus
diff --git a/cores/esp8266/pgmspace.cpp b/cores/esp8266/pgmspace.cpp
index 75de541d06..f3c376dcab 100644
--- a/cores/esp8266/pgmspace.cpp
+++ b/cores/esp8266/pgmspace.cpp
@@ -24,6 +24,8 @@
#include
#include "pgmspace.h"
+extern "C" {
+
size_t strnlen_P(PGM_P s, size_t size) {
const char* cp;
for (cp = s; size != 0 && pgm_read_byte(cp) != '\0'; cp++, size--);
@@ -147,6 +149,7 @@ void* memmem_P(const void* buf, size_t bufSize, PGM_VOID_P findP, size_t findPSi
char* strncpy_P(char* dest, PGM_P src, size_t size) {
+ bool size_known = (size != SIZE_IRRELEVANT);
const char* read = src;
char* write = dest;
char ch = '.';
@@ -156,6 +159,14 @@ char* strncpy_P(char* dest, PGM_P src, size_t size) {
*write++ = ch;
size--;
}
+ if (size_known)
+ {
+ while (size > 0)
+ {
+ *write++ = 0;
+ size--;
+ }
+ }
return dest;
}
@@ -234,7 +245,7 @@ int printf_P(PGM_P formatP, ...) {
char* format = new char[fmtLen + 1];
strcpy_P(format, formatP);
- ret = printf(format, arglist);
+ ret = vprintf(format, arglist);
delete[] format;
@@ -277,3 +288,5 @@ int vsnprintf_P(char* str, size_t strSize, PGM_P formatP, va_list ap) {
return ret;
}
+
+} // extern "C"
diff --git a/cores/esp8266/pgmspace.h b/cores/esp8266/pgmspace.h
index 6f04b10229..d793324dda 100644
--- a/cores/esp8266/pgmspace.h
+++ b/cores/esp8266/pgmspace.h
@@ -4,16 +4,11 @@
#include
#include
+
#ifdef __ets__
-#ifdef __cplusplus
-extern "C" {
-#endif
#include "ets_sys.h"
#include "osapi.h"
-#ifdef __cplusplus
-}
-#endif
#define PROGMEM ICACHE_RODATA_ATTR
#define PGM_P const char *
@@ -28,8 +23,14 @@ extern "C" {
#endif // __ets__
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define _SFR_BYTE(n) (n)
+#ifdef __PROG_TYPES_COMPAT__
+
typedef void prog_void;
typedef char prog_char;
typedef unsigned char prog_uchar;
@@ -40,6 +41,8 @@ typedef uint16_t prog_uint16_t;
typedef int32_t prog_int32_t;
typedef uint32_t prog_uint32_t;
+#endif // defined(__PROG_TYPES_COMPAT__)
+
#define SIZE_IRRELEVANT 0x7fffffff
// memchr_P and memrchr_P are not implemented due to danger in its use, and
@@ -87,23 +90,40 @@ int vsnprintf_P(char *str, size_t strSize, PGM_P formatP, va_list ap) __attribut
// w1, w0
#ifdef __ets__
-#define pgm_read_byte(addr) \
-(__extension__({ \
- PGM_P __local = (PGM_P)(addr); /* isolate varible for macro expansion */ \
- ptrdiff_t __offset = ((uint32_t)__local & 0x00000003); /* byte aligned mask */ \
- const uint32_t* __addr32 = (const uint32_t*)((const uint8_t*)(__local)-__offset); \
- uint8_t __result = ((*__addr32) >> (__offset * 8)); \
- __result; \
-}))
-
-#define pgm_read_word(addr) \
-(__extension__({ \
- PGM_P __local = (PGM_P)(addr); /* isolate varible for macro expansion */ \
- ptrdiff_t __offset = ((uint32_t)__local & 0x00000002); /* word aligned mask */ \
- const uint32_t* __addr32 = (const uint32_t*)((const uint8_t*)(__local) - __offset); \
- uint16_t __result = ((*__addr32) >> (__offset * 8)); \
- __result; \
-}))
+
+#define pgm_read_with_offset(addr, res) \
+ asm("extui %0, %1, 0, 2\n" /* Extract offset within word (in bytes) */ \
+ "sub %1, %1, %0\n" /* Subtract offset from addr, yielding an aligned address */ \
+ "l32i.n %1, %1, 0x0\n" /* Load word from aligned address */ \
+ "slli %0, %0, 3\n" /* Mulitiply offset by 8, yielding an offset in bits */ \
+ "ssr %0\n" /* Prepare to shift by offset (in bits) */ \
+ "srl %0, %1\n" /* Shift right; now the requested byte is the first one */ \
+ :"=r"(res), "=r"(addr) \
+ :"1"(addr) \
+ :);
+
+static inline uint8_t pgm_read_byte_inlined(const void* addr) {
+ register uint32_t res;
+ pgm_read_with_offset(addr, res);
+ return (uint8_t) res; /* This masks the lower byte from the returned word */
+}
+
+/* Although this says "word", it's actually 16 bit, i.e. half word on Xtensa */
+static inline uint16_t pgm_read_word_inlined(const void* addr) {
+ register uint32_t res;
+ pgm_read_with_offset(addr, res);
+ return (uint16_t) res; /* This masks the lower half-word from the returned word */
+}
+
+// Make sure, that libraries checking existence of this macro are not failing
+#ifdef __PROG_TYPES_COMPAT__
+#define pgm_read_byte(addr) pgm_read_byte_inlined((const void*)(addr))
+#define pgm_read_word(addr) pgm_read_word_inlined((const void*)(addr))
+#else
+#define pgm_read_byte(addr) pgm_read_byte_inlined(addr)
+#define pgm_read_word(addr) pgm_read_word_inlined(addr)
+#endif
+
#else //__ets__
#define pgm_read_byte(addr) (*reinterpret_cast(addr))
#define pgm_read_word(addr) (*reinterpret_cast(addr))
@@ -124,4 +144,8 @@ int vsnprintf_P(char *str, size_t strSize, PGM_P formatP, va_list ap) __attribut
#define pgm_read_float_far(addr) pgm_read_float(addr)
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
+#ifdef __cplusplus
+}
+#endif
+
#endif //__PGMSPACE_H_
diff --git a/cores/esp8266/sigma_delta.h b/cores/esp8266/sigma_delta.h
index 2e8bdc092f..6792f931cb 100644
--- a/cores/esp8266/sigma_delta.h
+++ b/cores/esp8266/sigma_delta.h
@@ -18,15 +18,55 @@
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+
+ /*******************************************************************************
+ * Info Sigma delta module
+
+This module controls the esp8266 internal sigma delta source
+Each pin can be connected to the sigma delta source
+The target duty and frequency can be modified via the register GPIO_SIGMA_DELTA
+
+THE TARGET FREQUENCY IS DEFINED AS:
+
+FREQ = 80,000,000/prescaler * target /256 HZ, 0
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+//channel parameter is unused (only for ESP32 compatibility) freq 1220-312500 duty 0-255
+void sigmaDeltaEnable(void);
+void sigmaDeltaDisable(void);
+uint32_t sigmaDeltaSetup(uint8_t channel, uint32_t freq);
+void sigmaDeltaWrite(uint8_t channel, uint8_t duty);
+uint8_t sigmaDeltaRead(uint8_t channel = 0);
+void sigmaDeltaAttachPin(uint8_t pin, uint8_t channel = 0);
+void sigmaDeltaDetachPin(uint8_t pin);
+bool sigmaDeltaIsPinAttached(uint8_t pin);
+
+// alternative way to control the sigma delta generator frequency
+uint8_t sigmaDeltaGetPrescaler(void);
+void sigmaDeltaSetPrescaler(uint8_t prescaler);
+
-void sigma_delta_close(uint32_t gpio);
-void set_sigma_target(uint8_t target);
-void set_sigma_prescale(uint8_t prescale);
-void set_sigma_duty_312KHz(uint8_t duty);
+#ifdef __cplusplus
+}
+#endif
#endif//SIGMA_DELTA_H
diff --git a/cores/esp8266/sntp-lwip2.c b/cores/esp8266/sntp-lwip2.c
new file mode 100644
index 0000000000..2eabf12412
--- /dev/null
+++ b/cores/esp8266/sntp-lwip2.c
@@ -0,0 +1,463 @@
+/*
+ * sntp-lwip2.c - ESP8266-specific functions for SNTP and lwIP-v2
+ * Copyright (c) 2015 Espressif (license is tools/sdk/lwip/src/core/sntp.c's)
+ * Redistribution and use in source and binary forms, with or without modification,
+ * are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright notice,
+ * this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright notice,
+ * this list of conditions and the following disclaimer in the documentation
+ * and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
+ * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
+ * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
+ * OF SUCH DAMAGE.
+ *
+ *
+ * History:
+ * This code is extracted from lwip1.4-espressif's sntp.c
+ * which is a patched version of the original lwip1's sntp.
+ * (check the mix-up in tools/sdk/lwip/src/core/sntp.c)
+ * It is moved here as-is and cleaned for maintainability and
+ * because it does not belong to lwip.
+ *
+ * TODOs:
+ * settimeofday(): handle tv->tv_usec
+ * sntp_mktm_r(): review, fix DST handling (this one is currently untouched from lwip-1.4)
+ * implement adjtime()
+ */
+
+#include
+#include
+#include
+#include
+#include "coredecls.h"
+
+static void (*_settimeofday_cb)(void) = NULL;
+
+void settimeofday_cb (void (*cb)(void))
+{
+ _settimeofday_cb = cb;
+}
+
+#if LWIP_VERSION_MAJOR == 1
+
+#include
+
+static const char stod14[] PROGMEM = "settimeofday() can't set time!\n";
+
+int settimeofday(const struct timeval* tv, const struct timezone* tz)
+{
+ if (tz) /*before*/
+ {
+ sntp_set_timezone(tz->tz_minuteswest / 60);
+ // apparently tz->tz_dsttime is a bitfield and should not be further used (cf man)
+ sntp_set_daylight(0);
+ }
+ if (tv) /* after*/
+ {
+ // can't call lwip1.4's static sntp_set_system_time()
+ os_printf(stod14);
+
+ // reset time subsystem
+ timeshift64_is_set = false;
+
+ return -1;
+ }
+ return 0;
+}
+
+#endif // lwip 1.4 only
+
+#if LWIP_VERSION_MAJOR == 2
+
+#include
+
+static uint32 realtime_stamp = 0;
+static uint16 dst = 0;
+static sint8 time_zone = 8; // espressif HQ's default timezone
+LOCAL os_timer_t sntp_timer;
+
+/*****************************************/
+#define SECSPERMIN 60L
+#define MINSPERHOUR 60L
+#define HOURSPERDAY 24L
+#define SECSPERHOUR (SECSPERMIN * MINSPERHOUR)
+#define SECSPERDAY (SECSPERHOUR * HOURSPERDAY)
+#define DAYSPERWEEK 7
+#define MONSPERYEAR 12
+
+#define YEAR_BASE 1900
+#define EPOCH_YEAR 1970
+#define EPOCH_WDAY 4
+#define EPOCH_YEARS_SINCE_LEAP 2
+#define EPOCH_YEARS_SINCE_CENTURY 70
+#define EPOCH_YEARS_SINCE_LEAP_CENTURY 370
+
+#define isleap(y) ((((y) % 4) == 0 && ((y) % 100) != 0) || ((y) % 400) == 0)
+
+int __tznorth;
+int __tzyear;
+char reult[100];
+static const int mon_lengths[2][12] = {
+ {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31},
+ {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}
+} ;
+
+static const int year_lengths[2] = {
+ 365,
+ 366
+} ;
+struct tm
+{
+ int tm_sec;
+ int tm_min;
+ int tm_hour;
+ int tm_mday;
+ int tm_mon;
+ int tm_year;
+ int tm_wday;
+ int tm_yday;
+ int tm_isdst;
+};
+
+struct tm res_buf;
+typedef struct __tzrule_struct
+{
+ char ch;
+ int m;
+ int n;
+ int d;
+ int s;
+ time_t change;
+ int offset;
+} __tzrule_type;
+
+__tzrule_type sntp__tzrule[2];
+struct tm *
+sntp_mktm_r(const time_t * tim_p ,struct tm *res ,int is_gmtime)
+{
+ long days, rem;
+ time_t lcltime;
+ int y;
+ int yleap;
+ const int *ip;
+
+ /* base decision about std/dst time on current time */
+ lcltime = *tim_p;
+
+ days = ((long)lcltime) / SECSPERDAY;
+ rem = ((long)lcltime) % SECSPERDAY;
+ while (rem < 0)
+ {
+ rem += SECSPERDAY;
+ --days;
+ }
+ while (rem >= SECSPERDAY)
+ {
+ rem -= SECSPERDAY;
+ ++days;
+ }
+
+ /* compute hour, min, and sec */
+ res->tm_hour = (int) (rem / SECSPERHOUR);
+ rem %= SECSPERHOUR;
+ res->tm_min = (int) (rem / SECSPERMIN);
+ res->tm_sec = (int) (rem % SECSPERMIN);
+
+ /* compute day of week */
+ if ((res->tm_wday = ((EPOCH_WDAY + days) % DAYSPERWEEK)) < 0)
+ res->tm_wday += DAYSPERWEEK;
+
+ /* compute year & day of year */
+ y = EPOCH_YEAR;
+ if (days >= 0)
+ {
+ for (;;)
+ {
+ yleap = isleap(y);
+ if (days < year_lengths[yleap])
+ break;
+ y++;
+ days -= year_lengths[yleap];
+ }
+ }
+ else
+ {
+ do
+ {
+ --y;
+ yleap = isleap(y);
+ days += year_lengths[yleap];
+ } while (days < 0);
+ }
+
+ res->tm_year = y - YEAR_BASE;
+ res->tm_yday = days;
+ ip = mon_lengths[yleap];
+ for (res->tm_mon = 0; days >= ip[res->tm_mon]; ++res->tm_mon)
+ days -= ip[res->tm_mon];
+ res->tm_mday = days + 1;
+
+ if (!is_gmtime)
+ {
+ int offset;
+ int hours, mins, secs;
+
+// TZ_LOCK;
+// if (_daylight)
+// {
+// if (y == __tzyear || __tzcalc_limits (y))
+// res->tm_isdst = (__tznorth
+// ? (*tim_p >= __tzrule[0].change && *tim_p < __tzrule[1].change)
+// : (*tim_p >= __tzrule[0].change || *tim_p < __tzrule[1].change));
+// else
+// res->tm_isdst = -1;
+// }
+// else
+ res->tm_isdst = -1;
+
+ offset = (res->tm_isdst == 1 ? sntp__tzrule[1].offset : sntp__tzrule[0].offset);
+
+ hours = offset / SECSPERHOUR;
+ offset = offset % SECSPERHOUR;
+
+ mins = offset / SECSPERMIN;
+ secs = offset % SECSPERMIN;
+
+ res->tm_sec -= secs;
+ res->tm_min -= mins;
+ res->tm_hour -= hours;
+
+ if (res->tm_sec >= SECSPERMIN)
+ {
+ res->tm_min += 1;
+ res->tm_sec -= SECSPERMIN;
+ }
+ else if (res->tm_sec < 0)
+ {
+ res->tm_min -= 1;
+ res->tm_sec += SECSPERMIN;
+ }
+ if (res->tm_min >= MINSPERHOUR)
+ {
+ res->tm_hour += 1;
+ res->tm_min -= MINSPERHOUR;
+ }
+ else if (res->tm_min < 0)
+ {
+ res->tm_hour -= 1;
+ res->tm_min += MINSPERHOUR;
+ }
+ if (res->tm_hour >= HOURSPERDAY)
+ {
+ ++res->tm_yday;
+ ++res->tm_wday;
+ if (res->tm_wday > 6)
+ res->tm_wday = 0;
+ ++res->tm_mday;
+ res->tm_hour -= HOURSPERDAY;
+ if (res->tm_mday > ip[res->tm_mon])
+ {
+ res->tm_mday -= ip[res->tm_mon];
+ res->tm_mon += 1;
+ if (res->tm_mon == 12)
+ {
+ res->tm_mon = 0;
+ res->tm_year += 1;
+ res->tm_yday = 0;
+ }
+ }
+ }
+ else if (res->tm_hour < 0)
+ {
+ res->tm_yday -= 1;
+ res->tm_wday -= 1;
+ if (res->tm_wday < 0)
+ res->tm_wday = 6;
+ res->tm_mday -= 1;
+ res->tm_hour += 24;
+ if (res->tm_mday == 0)
+ {
+ res->tm_mon -= 1;
+ if (res->tm_mon < 0)
+ {
+ res->tm_mon = 11;
+ res->tm_year -= 1;
+ res->tm_yday = 365 + isleap(res->tm_year);
+ }
+ res->tm_mday = ip[res->tm_mon];
+ }
+ }
+// TZ_UNLOCK;
+ }
+ else
+ res->tm_isdst = 0;
+// os_printf("res %d %d %d %d %d\n",res->tm_year,res->tm_mon,res->tm_mday,res->tm_yday,res->tm_hour);
+ return (res);
+}
+struct tm *
+sntp_localtime_r(const time_t * tim_p ,
+ struct tm *res)
+{
+ return sntp_mktm_r (tim_p, res, 0);
+}
+
+struct tm *
+sntp_localtime(const time_t * tim_p)
+{
+ return sntp_localtime_r (tim_p, &res_buf);
+}
+
+int sntp__tzcalc_limits(int year)
+{
+ int days, year_days, years;
+ int i, j;
+
+ if (year < EPOCH_YEAR)
+ return 0;
+
+ __tzyear = year;
+
+ years = (year - EPOCH_YEAR);
+
+ year_days = years * 365 +
+ (years - 1 + EPOCH_YEARS_SINCE_LEAP) / 4 - (years - 1 + EPOCH_YEARS_SINCE_CENTURY) / 100 +
+ (years - 1 + EPOCH_YEARS_SINCE_LEAP_CENTURY) / 400;
+
+ for (i = 0; i < 2; ++i)
+ {
+ if (sntp__tzrule[i].ch == 'J')
+ days = year_days + sntp__tzrule[i].d + (isleap(year) && sntp__tzrule[i].d >= 60);
+ else if (sntp__tzrule[i].ch == 'D')
+ days = year_days + sntp__tzrule[i].d;
+ else
+ {
+ int yleap = isleap(year);
+ int m_day, m_wday, wday_diff;
+ const int *ip = mon_lengths[yleap];
+
+ days = year_days;
+
+ for (j = 1; j < sntp__tzrule[i].m; ++j)
+ days += ip[j-1];
+
+ m_wday = (EPOCH_WDAY + days) % DAYSPERWEEK;
+
+ wday_diff = sntp__tzrule[i].d - m_wday;
+ if (wday_diff < 0)
+ wday_diff += DAYSPERWEEK;
+ m_day = (sntp__tzrule[i].n - 1) * DAYSPERWEEK + wday_diff;
+
+ while (m_day >= ip[j-1])
+ m_day -= DAYSPERWEEK;
+
+ days += m_day;
+ }
+
+ /* store the change-over time in GMT form by adding offset */
+ sntp__tzrule[i].change = days * SECSPERDAY + sntp__tzrule[i].s + sntp__tzrule[i].offset;
+ }
+
+ __tznorth = (sntp__tzrule[0].change < sntp__tzrule[1].change);
+
+ return 1;
+}
+
+char* sntp_asctime_r(struct tm *tim_p ,char *result)
+{
+ static const char day_name[7][4] = {
+ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
+ };
+ static const char mon_name[12][4] = {
+ "Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
+ };
+ os_sprintf (result, "%s %s %02d %02d:%02d:%02d %02d\n",
+ day_name[tim_p->tm_wday],
+ mon_name[tim_p->tm_mon],
+ tim_p->tm_mday, tim_p->tm_hour, tim_p->tm_min,
+ tim_p->tm_sec, 1900 + tim_p->tm_year);
+ return result;
+}
+
+char* sntp_asctime(struct tm *tim_p)
+{
+ return sntp_asctime_r (tim_p, reult);
+}
+
+uint32 ICACHE_RAM_ATTR sntp_get_current_timestamp(void)
+{
+ return realtime_stamp;
+}
+
+char* sntp_get_real_time(time_t t)
+{
+ return sntp_asctime(sntp_localtime (&t));
+}
+
+sint8 sntp_get_timezone(void)
+{
+ return time_zone;
+}
+
+bool sntp_set_timezone(sint8 timezone)
+{
+ if(timezone >= -11 || timezone <= 13) {
+ time_zone = timezone;
+ return true;
+ } else {
+ return false;
+ }
+}
+
+void sntp_set_daylight(int daylight)
+{
+ dst = daylight;
+}
+
+void ICACHE_RAM_ATTR sntp_time_inc (void)
+{
+ realtime_stamp++;
+}
+
+static void sntp_set_system_time (uint32_t t)
+{
+ realtime_stamp = t + time_zone * 60 * 60 + dst;
+ os_timer_disarm(&sntp_timer);
+ os_timer_setfn(&sntp_timer, (os_timer_func_t *)sntp_time_inc, NULL);
+ os_timer_arm(&sntp_timer, 1000, 1);
+}
+
+int settimeofday(const struct timeval* tv, const struct timezone* tz)
+{
+ if (tz) /*before*/
+ {
+ sntp_set_timezone(tz->tz_minuteswest / 60);
+ // apparently tz->tz_dsttime is a bitfield and should not be further used (cf man)
+ sntp_set_daylight(0);
+ }
+ if (tv) /* after*/
+ {
+ // reset time subsystem
+ tune_timeshift64(tv->tv_sec * 1000000ULL + tv->tv_usec);
+
+ sntp_set_system_time(tv->tv_sec);
+
+ if (_settimeofday_cb)
+ _settimeofday_cb();
+ }
+ return 0;
+}
+
+#endif // lwip2 only
diff --git a/cores/esp8266/spiffs/LICENSE b/cores/esp8266/spiffs/LICENSE
index e9b0c67777..5fb2427b41 100644
--- a/cores/esp8266/spiffs/LICENSE
+++ b/cores/esp8266/spiffs/LICENSE
@@ -1,6 +1,6 @@
The MIT License (MIT)
-Copyright (c) 2013-2015 Peter Andersson (pelleplutt1976gmail.com)
+Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
diff --git a/cores/esp8266/spiffs/README.md b/cores/esp8266/spiffs/README.md
index 5f8efd8da4..64ffcc36b3 100644
--- a/cores/esp8266/spiffs/README.md
+++ b/cores/esp8266/spiffs/README.md
@@ -1,7 +1,9 @@
# SPIFFS (SPI Flash File System)
-**V0.3.4**
+**V0.3.7**
-Copyright (c) 2013-2016 Peter Andersson (pelleplutt1976 at gmail.com)
+[](https://travis-ci.org/pellepl/spiffs)
+
+Copyright (c) 2013-2017 Peter Andersson (pelleplutt1976 at gmail.com)
For legal stuff, see [LICENSE](https://github.com/pellepl/spiffs/blob/master/LICENSE). Basically, you may do whatever you want with the source. Use, modify, sell, print it out, roll it and smoke it - as long as I won't be held responsible.
@@ -21,27 +23,36 @@ Spiffs is designed with following characteristics in mind:
- Wear leveling
+## BUILDING
+
+`mkdir build; make`
+
+Otherwise, configure the `builddir` variable towards the top of `makefile` as something opposed to the default `build`. Sanity check on the host via `make test` and refer to `.travis.yml` for the official in-depth testing procedure. See the wiki for [integrating](https://github.com/pellepl/spiffs/wiki/Integrate-spiffs) spiffs into projects and [spiffsimg](https://github.com/nodemcu/nodemcu-firmware/tree/master/tools/spiffsimg) from [nodemcu](https://github.com/nodemcu) is a good example on the subject.
+
+
## FEATURES
What spiffs does:
- Specifically designed for low ram usage
- Uses statically sized ram buffers, independent of number of files
- Posix-like api: open, close, read, write, seek, stat, etc
- - It can be run on any NOR flash, not only SPI flash - theoretically also on embedded flash of an microprocessor
- - Multiple spiffs configurations can be run on same target - and even on same SPI flash device
+ - It can run on any NOR flash, not only SPI flash - theoretically also on embedded flash of a microprocessor
+ - Multiple spiffs configurations can run on same target - and even on same SPI flash device
- Implements static wear leveling
- Built in file system consistency checks
+ - Highly configurable
What spiffs does not:
- Presently, spiffs does not support directories. It produces a flat structure. Creating a file with path *tmp/myfile.txt* will create a file called *tmp/myfile.txt* instead of a *myfile.txt* under directory *tmp*.
- - It is not a realtime stack. One write operation might take much longer than another.
- - Poor scalability. Spiffs is intended for small memory devices - the normal sizes for SPI flashes. Going beyond ~128MB is probably a bad idea. This is a side effect of the design goal to use as little ram as possible.
+ - It is not a realtime stack. One write operation might last much longer than another.
+ - Poor scalability. Spiffs is intended for small memory devices - the normal sizes for SPI flashes. Going beyond ~128Mbyte is probably a bad idea. This is a side effect of the design goal to use as little ram as possible.
- Presently, it does not detect or handle bad blocks.
+ - One configuration, one binary. There's no generic spiffs binary that handles all types of configurations.
## MORE INFO
-See the [wiki](https://github.com/pellepl/spiffs/wiki) for configuring, integrating and using spiffs.
+See the [wiki](https://github.com/pellepl/spiffs/wiki) for [configuring](https://github.com/pellepl/spiffs/wiki/Configure-spiffs), [integrating](https://github.com/pellepl/spiffs/wiki/Integrate-spiffs), [using](https://github.com/pellepl/spiffs/wiki/Using-spiffs), and [optimizing](https://github.com/pellepl/spiffs/wiki/Performance-and-Optimizing) spiffs.
For design, see [docs/TECH_SPEC](https://github.com/pellepl/spiffs/blob/master/docs/TECH_SPEC).
@@ -49,6 +60,61 @@ For a generic spi flash driver, see [this](https://github.com/pellepl/spiflash_d
## HISTORY
+### 0.3.7
+- fixed prevent seeking to negative offsets #158
+- fixed file descriptor offsets not updated for multiple fds on same file #157
+- fixed cache page not closed for removed files #156
+- fixed a lseek bug when seeking exactly to end of a fully indexed first level LUT #148
+- fixed wear leveling issue #145
+- fixed attempt to write out of bounds in flash #130,
+- set file offset when seeking over end #121 (thanks @sensslen)
+- fixed seeking in virgin files #120 (thanks @sensslen)
+- Optional file metadata #128 (thanks @cesanta)
+- AFL testing framework #100 #143 (thanks @pjsg)
+- Testframe updates
+
+New API functions:
+- `SPIFFS_update_meta, SPIFFS_fupdate_meta` - updates metadata for a file
+
+New config defines:
+- `SPIFFS_OBJ_META_LEN` - enable possibility to add extra metadata to files
+
+### 0.3.6
+- Fix range bug in index memory mapping #98
+- Add index memory mapping #97
+- Optimize SPIFFS_read for large files #96
+- Add temporal cache for opening files #95
+- More robust gc #93 (thanks @dismirlian)
+- Fixed a double write of same data in certain cache situations
+- Fixed an open bug in READ_ONLY builds
+- File not visible in SPIFFS_readdir #90 (thanks @benpicco-tmp)
+- Cache load code cleanup #92 (thanks @niclash)
+- Fixed lock/unlock asymmetry #88 #87 (thanks @JackJefferson, @dpruessner)
+- Testframe updates
+
+New API functions:
+- `SPIFFS_ix_map` - map index meta data to memory for a file
+- `SPIFFS_ix_unmap` - unmaps index meta data for a file
+- `SPIFFS_ix_remap` - changes file offset for index metadata map
+- `SPIFFS_bytes_to_ix_map_entries` - utility, get length of needed vector for given amount of bytes
+- `SPIFFS_ix_map_entries_to_bytes` - utility, get number of bytes a vector can represent given length
+
+New config defines:
+- `SPIFFS_IX_MAP` - enable possibility to map index meta data to memory for reading faster
+- `SPIFFS_TEMPORAL_FD_CACHE` - enable temporal cache for opening files faster
+- `SPIFFS_TEMPORAL_CACHE_HIT_SCORE` - for tuning the temporal cache
+
+### 0.3.5
+- Fixed a bug in fs check
+- API returns actual error codes #84) (thanks @Nails)
+- Fix compiler warnings for non-gcc #83 #81 (thanks @Nails)
+- Unable to recover from full fs #82 (thanks @rojer)
+- Define SPIFFS_O_* flags #80
+- Problem with long filenames #79 (thanks @psjg)
+- Duplicate file name bug fix #74 (thanks @igrr)
+- SPIFFS_eof and SPIFFS_tell return wrong value #72 (thanks @ArtemPisarenko)
+- Bunch of testframe updates #77 #78 #86 (thanks @dpreussner, @psjg a.o)
+
### 0.3.4
- Added user callback file func.
- Fixed a stat bug with obj id.
diff --git a/cores/esp8266/spiffs/spiffs.h b/cores/esp8266/spiffs/spiffs.h
index c625d93150..534c3df8bd 100644
--- a/cores/esp8266/spiffs/spiffs.h
+++ b/cores/esp8266/spiffs/spiffs.h
@@ -54,6 +54,15 @@ extern "C" {
#define SPIFFS_ERR_RO_ABORTED_OPERATION -10033
#define SPIFFS_ERR_PROBE_TOO_FEW_BLOCKS -10034
#define SPIFFS_ERR_PROBE_NOT_A_FS -10035
+#define SPIFFS_ERR_NAME_TOO_LONG -10036
+
+#define SPIFFS_ERR_IX_MAP_UNMAPPED -10037
+#define SPIFFS_ERR_IX_MAP_MAPPED -10038
+#define SPIFFS_ERR_IX_MAP_BAD_RANGE -10039
+
+#define SPIFFS_ERR_SEEK_BOUNDS -10040
+
+
#define SPIFFS_ERR_INTERNAL -10050
#define SPIFFS_ERR_TEST -10100
@@ -104,7 +113,7 @@ typedef enum {
SPIFFS_CHECK_FIX_LOOKUP,
SPIFFS_CHECK_DELETE_ORPHANED_INDEX,
SPIFFS_CHECK_DELETE_PAGE,
- SPIFFS_CHECK_DELETE_BAD_FILE,
+ SPIFFS_CHECK_DELETE_BAD_FILE
} spiffs_check_report;
/* file system check callback function */
@@ -123,7 +132,7 @@ typedef enum {
/* the file has been updated or moved to another page */
SPIFFS_CB_UPDATED,
/* the file has been deleted */
- SPIFFS_CB_DELETED,
+ SPIFFS_CB_DELETED
} spiffs_fileop_type;
/* file system listener callback function */
@@ -131,7 +140,7 @@ typedef void (*spiffs_file_callback)(struct spiffs_t *fs, spiffs_fileop_type op,
#ifndef SPIFFS_DBG
#define SPIFFS_DBG(...) \
- print(__VA_ARGS__)
+ printf(__VA_ARGS__)
#endif
#ifndef SPIFFS_GC_DBG
#define SPIFFS_GC_DBG(...) printf(__VA_ARGS__)
@@ -145,20 +154,28 @@ typedef void (*spiffs_file_callback)(struct spiffs_t *fs, spiffs_fileop_type op,
/* Any write to the filehandle is appended to end of the file */
#define SPIFFS_APPEND (1<<0)
+#define SPIFFS_O_APPEND SPIFFS_APPEND
/* If the opened file exists, it will be truncated to zero length before opened */
#define SPIFFS_TRUNC (1<<1)
+#define SPIFFS_O_TRUNC SPIFFS_TRUNC
/* If the opened file does not exist, it will be created before opened */
#define SPIFFS_CREAT (1<<2)
+#define SPIFFS_O_CREAT SPIFFS_CREAT
/* The opened file may only be read */
#define SPIFFS_RDONLY (1<<3)
-/* The opened file may only be writted */
+#define SPIFFS_O_RDONLY SPIFFS_RDONLY
+/* The opened file may only be written */
#define SPIFFS_WRONLY (1<<4)
-/* The opened file may be both read and writted */
+#define SPIFFS_O_WRONLY SPIFFS_WRONLY
+/* The opened file may be both read and written */
#define SPIFFS_RDWR (SPIFFS_RDONLY | SPIFFS_WRONLY)
-/* Any writes to the filehandle will never be cached */
+#define SPIFFS_O_RDWR SPIFFS_RDWR
+/* Any writes to the filehandle will never be cached but flushed directly */
#define SPIFFS_DIRECT (1<<5)
-/* If SPIFFS_CREAT and SPIFFS_EXCL are set, SPIFFS_open() shall fail if the file exists */
+#define SPIFFS_O_DIRECT SPIFFS_DIRECT
+/* If SPIFFS_O_CREAT and SPIFFS_O_EXCL are set, SPIFFS_open() shall fail if the file exists */
#define SPIFFS_EXCL (1<<6)
+#define SPIFFS_O_EXCL SPIFFS_EXCL
#define SPIFFS_SEEK_SET (0)
#define SPIFFS_SEEK_CUR (1)
@@ -283,6 +300,9 @@ typedef struct {
spiffs_obj_type type;
spiffs_page_ix pix;
u8_t name[SPIFFS_OBJ_NAME_LEN];
+#if SPIFFS_OBJ_META_LEN
+ u8_t meta[SPIFFS_OBJ_META_LEN];
+#endif
} spiffs_stat;
struct spiffs_dirent {
@@ -291,6 +311,9 @@ struct spiffs_dirent {
spiffs_obj_type type;
u32_t size;
spiffs_page_ix pix;
+#if SPIFFS_OBJ_META_LEN
+ u8_t meta[SPIFFS_OBJ_META_LEN];
+#endif
};
typedef struct {
@@ -299,6 +322,21 @@ typedef struct {
int entry;
} spiffs_DIR;
+#if SPIFFS_IX_MAP
+
+typedef struct {
+ // buffer with looked up data pixes
+ spiffs_page_ix *map_buf;
+ // precise file byte offset
+ u32_t offset;
+ // start data span index of lookup buffer
+ spiffs_span_ix start_spix;
+ // end data span index of lookup buffer
+ spiffs_span_ix end_spix;
+} spiffs_ix_map;
+
+#endif
+
// functions
#if SPIFFS_USE_MAGIC && SPIFFS_USE_MAGIC_LENGTH && SPIFFS_SINGLETON==0
@@ -375,8 +413,8 @@ s32_t SPIFFS_creat(spiffs *fs, const char *path, spiffs_mode mode);
* @param fs the file system struct
* @param path the path of the new file
* @param flags the flags for the open command, can be combinations of
- * SPIFFS_APPEND, SPIFFS_TRUNC, SPIFFS_CREAT, SPIFFS_RD_ONLY,
- * SPIFFS_WR_ONLY, SPIFFS_RDWR, SPIFFS_DIRECT
+ * SPIFFS_O_APPEND, SPIFFS_O_TRUNC, SPIFFS_O_CREAT, SPIFFS_O_RDONLY,
+ * SPIFFS_O_WRONLY, SPIFFS_O_RDWR, SPIFFS_O_DIRECT, SPIFFS_O_EXCL
* @param mode ignored, for posix compliance
*/
spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs_mode mode);
@@ -496,6 +534,24 @@ s32_t SPIFFS_close(spiffs *fs, spiffs_file fh);
*/
s32_t SPIFFS_rename(spiffs *fs, const char *old, const char *newPath);
+#if SPIFFS_OBJ_META_LEN
+/**
+ * Updates file's metadata
+ * @param fs the file system struct
+ * @param path path to the file
+ * @param meta new metadata. must be SPIFFS_OBJ_META_LEN bytes long.
+ */
+s32_t SPIFFS_update_meta(spiffs *fs, const char *name, const void *meta);
+
+/**
+ * Updates file's metadata
+ * @param fs the file system struct
+ * @param fh file handle of the file
+ * @param meta new metadata. must be SPIFFS_OBJ_META_LEN bytes long.
+ */
+s32_t SPIFFS_fupdate_meta(spiffs *fs, spiffs_file fh, const void *meta);
+#endif
+
/**
* Returns last error of last file operation.
* @param fs the file system struct
@@ -648,6 +704,85 @@ s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh);
*/
s32_t SPIFFS_set_file_callback_func(spiffs *fs, spiffs_file_callback cb_func);
+#if SPIFFS_IX_MAP
+
+/**
+ * Maps the first level index lookup to a given memory map.
+ * This will make reading big files faster, as the memory map will be used for
+ * looking up data pages instead of searching for the indices on the physical
+ * medium. When mapping, all affected indicies are found and the information is
+ * copied to the array.
+ * Whole file or only parts of it may be mapped. The index map will cover file
+ * contents from argument offset until and including arguments (offset+len).
+ * It is valid to map a longer range than the current file size. The map will
+ * then be populated when the file grows.
+ * On garbage collections and file data page movements, the map array will be
+ * automatically updated. Do not tamper with the map array, as this contains
+ * the references to the data pages. Modifying it from outside will corrupt any
+ * future readings using this file descriptor.
+ * The map will no longer be used when the file descriptor closed or the file
+ * is unmapped.
+ * This can be useful to get faster and more deterministic timing when reading
+ * large files, or when seeking and reading a lot within a file.
+ * @param fs the file system struct
+ * @param fh the file handle of the file to map
+ * @param map a spiffs_ix_map struct, describing the index map
+ * @param offset absolute file offset where to start the index map
+ * @param len length of the mapping in actual file bytes
+ * @param map_buf the array buffer for the look up data - number of required
+ * elements in the array can be derived from function
+ * SPIFFS_bytes_to_ix_map_entries given the length
+ */
+s32_t SPIFFS_ix_map(spiffs *fs, spiffs_file fh, spiffs_ix_map *map,
+ u32_t offset, u32_t len, spiffs_page_ix *map_buf);
+
+/**
+ * Unmaps the index lookup from this filehandle. All future readings will
+ * proceed as normal, requiring reading of the first level indices from
+ * physical media.
+ * The map and map buffer given in function SPIFFS_ix_map will no longer be
+ * referenced by spiffs.
+ * It is not strictly necessary to unmap a file before closing it, as closing
+ * a file will automatically unmap it.
+ * @param fs the file system struct
+ * @param fh the file handle of the file to unmap
+ */
+s32_t SPIFFS_ix_unmap(spiffs *fs, spiffs_file fh);
+
+/**
+ * Moves the offset for the index map given in function SPIFFS_ix_map. Parts or
+ * all of the map buffer will repopulated.
+ * @param fs the file system struct
+ * @param fh the mapped file handle of the file to remap
+ * @param offset new absolute file offset where to start the index map
+ */
+s32_t SPIFFS_ix_remap(spiffs *fs, spiffs_file fh, u32_t offs);
+
+/**
+ * Utility function to get number of spiffs_page_ix entries a map buffer must
+ * contain on order to map given amount of file data in bytes.
+ * See function SPIFFS_ix_map and SPIFFS_ix_map_entries_to_bytes.
+ * @param fs the file system struct
+ * @param bytes number of file data bytes to map
+ * @return needed number of elements in a spiffs_page_ix array needed to
+ * map given amount of bytes in a file
+ */
+s32_t SPIFFS_bytes_to_ix_map_entries(spiffs *fs, u32_t bytes);
+
+/**
+ * Utility function to amount of file data bytes that can be mapped when
+ * mapping a file with buffer having given number of spiffs_page_ix entries.
+ * See function SPIFFS_ix_map and SPIFFS_bytes_to_ix_map_entries.
+ * @param fs the file system struct
+ * @param map_page_ix_entries number of entries in a spiffs_page_ix array
+ * @return amount of file data in bytes that can be mapped given a map
+ * buffer having given amount of spiffs_page_ix entries
+ */
+s32_t SPIFFS_ix_map_entries_to_bytes(spiffs *fs, u32_t map_page_ix_entries);
+
+#endif // SPIFFS_IX_MAP
+
+
#if SPIFFS_TEST_VISUALISATION
/**
* Prints out a visualization of the filesystem.
diff --git a/cores/esp8266/spiffs/spiffs_cache.c b/cores/esp8266/spiffs/spiffs_cache.c
index ea9bc82c5d..e7cd4b7376 100644
--- a/cores/esp8266/spiffs/spiffs_cache.c
+++ b/cores/esp8266/spiffs/spiffs_cache.c
@@ -20,12 +20,12 @@ static spiffs_cache_page *spiffs_cache_page_get(spiffs *fs, spiffs_page_ix pix)
if ((cache->cpage_use_map & (1<flags & SPIFFS_CACHE_FLAG_TYPE_WR) == 0 &&
cp->pix == pix ) {
- SPIFFS_CACHE_DBG("CACHE_GET: have cache page %i for %04x\n", i, pix);
+ //SPIFFS_CACHE_DBG("CACHE_GET: have cache page "_SPIPRIi" for "_SPIPRIpg"\n", i, pix);
cp->last_access = cache->last_access;
return cp;
}
}
- //SPIFFS_CACHE_DBG("CACHE_GET: no cache for %04x\n", pix);
+ //SPIFFS_CACHE_DBG("CACHE_GET: no cache for "_SPIPRIpg"\n", pix);
return 0;
}
@@ -39,17 +39,20 @@ static s32_t spiffs_cache_page_free(spiffs *fs, int ix, u8_t write_back) {
(cp->flags & SPIFFS_CACHE_FLAG_TYPE_WR) == 0 &&
(cp->flags & SPIFFS_CACHE_FLAG_DIRTY)) {
u8_t *mem = spiffs_get_cache_page(fs, cache, ix);
+ SPIFFS_CACHE_DBG("CACHE_FREE: write cache page "_SPIPRIi" pix "_SPIPRIpg"\n", ix, cp->pix);
res = SPIFFS_HAL_WRITE(fs, SPIFFS_PAGE_TO_PADDR(fs, cp->pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), mem);
}
- cp->flags = 0;
- cache->cpage_use_map &= ~(1 << ix);
-
+#if SPIFFS_CACHE_WR
if (cp->flags & SPIFFS_CACHE_FLAG_TYPE_WR) {
- SPIFFS_CACHE_DBG("CACHE_FREE: free cache page %i objid %04x\n", ix, cp->obj_id);
- } else {
- SPIFFS_CACHE_DBG("CACHE_FREE: free cache page %i pix %04x\n", ix, cp->pix);
+ SPIFFS_CACHE_DBG("CACHE_FREE: free cache page "_SPIPRIi" objid "_SPIPRIid"\n", ix, cp->obj_id);
+ } else
+#endif
+ {
+ SPIFFS_CACHE_DBG("CACHE_FREE: free cache page "_SPIPRIi" pix "_SPIPRIpg"\n", ix, cp->pix);
}
+ cache->cpage_use_map &= ~(1 << ix);
+ cp->flags = 0;
}
return res;
@@ -98,7 +101,7 @@ static spiffs_cache_page *spiffs_cache_page_allocate(spiffs *fs) {
spiffs_cache_page *cp = spiffs_get_cache_page_hdr(fs, cache, i);
cache->cpage_use_map |= (1<last_access = cache->last_access;
- SPIFFS_CACHE_DBG("CACHE_ALLO: allocated cache page %i\n", i);
+ //SPIFFS_CACHE_DBG("CACHE_ALLO: allocated cache page "_SPIPRIi"\n", i);
return cp;
}
}
@@ -130,10 +133,13 @@ s32_t spiffs_phys_rd(
spiffs_cache_page *cp = spiffs_cache_page_get(fs, SPIFFS_PADDR_TO_PAGE(fs, addr));
cache->last_access++;
if (cp) {
+ // we've already got one, you see
#if SPIFFS_CACHE_STATS
fs->cache_hits++;
#endif
cp->last_access = cache->last_access;
+ u8_t *mem = spiffs_get_cache_page(fs, cache, cp->ix);
+ _SPIFFS_MEMCPY(dst, &mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], len);
} else {
if ((op & SPIFFS_OP_TYPE_MASK) == SPIFFS_OP_T_OBJ_LU2) {
// for second layer lookup functions, we do not cache in order to prevent shredding
@@ -142,22 +148,35 @@ s32_t spiffs_phys_rd(
#if SPIFFS_CACHE_STATS
fs->cache_misses++;
#endif
+ // this operation will always free one cache page (unless all already free),
+ // the result code stems from the write operation of the possibly freed cache page
res = spiffs_cache_page_remove_oldest(fs, SPIFFS_CACHE_FLAG_TYPE_WR, 0);
+
cp = spiffs_cache_page_allocate(fs);
if (cp) {
cp->flags = SPIFFS_CACHE_FLAG_WRTHRU;
cp->pix = SPIFFS_PADDR_TO_PAGE(fs, addr);
- }
- s32_t res2 = SPIFFS_HAL_READ(fs,
- addr - SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr),
- SPIFFS_CFG_LOG_PAGE_SZ(fs),
- spiffs_get_cache_page(fs, cache, cp->ix));
- if (res2 != SPIFFS_OK) {
- res = res2;
+ SPIFFS_CACHE_DBG("CACHE_ALLO: allocated cache page "_SPIPRIi" for pix "_SPIPRIpg "\n", cp->ix, cp->pix);
+
+ s32_t res2 = SPIFFS_HAL_READ(fs,
+ addr - SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr),
+ SPIFFS_CFG_LOG_PAGE_SZ(fs),
+ spiffs_get_cache_page(fs, cache, cp->ix));
+ if (res2 != SPIFFS_OK) {
+ // honor read failure before possible write failure (bad idea?)
+ res = res2;
+ }
+ u8_t *mem = spiffs_get_cache_page(fs, cache, cp->ix);
+ _SPIFFS_MEMCPY(dst, &mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], len);
+ } else {
+ // this will never happen, last resort for sake of symmetry
+ s32_t res2 = SPIFFS_HAL_READ(fs, addr, len, dst);
+ if (res2 != SPIFFS_OK) {
+ // honor read failure before possible write failure (bad idea?)
+ res = res2;
+ }
}
}
- u8_t *mem = spiffs_get_cache_page(fs, cache, cp->ix);
- memcpy(dst, &mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], len);
return res;
}
@@ -186,7 +205,7 @@ s32_t spiffs_phys_wr(
}
u8_t *mem = spiffs_get_cache_page(fs, cache, cp->ix);
- memcpy(&mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], src, len);
+ _SPIFFS_MEMCPY(&mem[SPIFFS_PADDR_TO_PAGE_OFFSET(fs, addr)], src, len);
cache->last_access++;
cp->last_access = cache->last_access;
@@ -241,6 +260,7 @@ spiffs_cache_page *spiffs_cache_page_allocate_by_fd(spiffs *fs, spiffs_fd *fd) {
cp->flags = SPIFFS_CACHE_FLAG_TYPE_WR;
cp->obj_id = fd->obj_id;
fd->cache_page = cp;
+ SPIFFS_CACHE_DBG("CACHE_ALLO: allocated cache page "_SPIPRIi" for fd "_SPIPRIfd ":"_SPIPRIid "\n", cp->ix, fd->file_nbr, fd->obj_id);
return cp;
}
@@ -284,7 +304,7 @@ void spiffs_cache_init(spiffs *fs) {
cache.cpage_use_map = 0xffffffff;
cache.cpage_use_mask = cache_mask;
- memcpy(fs->cache, &cache, sizeof(spiffs_cache));
+ _SPIFFS_MEMCPY(fs->cache, &cache, sizeof(spiffs_cache));
spiffs_cache *c = spiffs_get_cache(fs);
diff --git a/cores/esp8266/spiffs/spiffs_check.c b/cores/esp8266/spiffs/spiffs_check.c
index 8dd6665bd2..dde85eff3c 100644
--- a/cores/esp8266/spiffs/spiffs_check.c
+++ b/cores/esp8266/spiffs/spiffs_check.c
@@ -182,7 +182,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
if (((lu_obj_id == SPIFFS_OBJ_ID_DELETED) && (p_hdr->flags & SPIFFS_PH_FLAG_DELET)) ||
((lu_obj_id == SPIFFS_OBJ_ID_FREE) && (p_hdr->flags & SPIFFS_PH_FLAG_USED) == 0)) {
// look up entry deleted / free but used in page header
- SPIFFS_CHECK_DBG("LU: pix %04x deleted/free in lu but not on page\n", cur_pix);
+ SPIFFS_CHECK_DBG("LU: pix "_SPIPRIpg" deleted/free in lu but not on page\n", cur_pix);
*reload_lu = 1;
delete_page = 1;
if (p_hdr->flags & SPIFFS_PH_FLAG_INDEX) {
@@ -199,14 +199,14 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
// copy page to new place and re-write the object index to new place
spiffs_page_ix new_pix;
res = spiffs_rewrite_page(fs, cur_pix, p_hdr, &new_pix);
- SPIFFS_CHECK_DBG("LU: FIXUP: data page not found elsewhere, rewriting %04x to new page %04x\n", cur_pix, new_pix);
+ SPIFFS_CHECK_DBG("LU: FIXUP: data page not found elsewhere, rewriting "_SPIPRIpg" to new page "_SPIPRIpg"\n", cur_pix, new_pix);
SPIFFS_CHECK_RES(res);
*reload_lu = 1;
- SPIFFS_CHECK_DBG("LU: FIXUP: %04x rewritten to %04x, affected objix_pix %04x\n", cur_pix, new_pix, objix_pix);
+ SPIFFS_CHECK_DBG("LU: FIXUP: "_SPIPRIpg" rewritten to "_SPIPRIpg", affected objix_pix "_SPIPRIpg"\n", cur_pix, new_pix, objix_pix);
res = spiffs_rewrite_index(fs, p_hdr->obj_id, p_hdr->span_ix, new_pix, objix_pix);
if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) {
// index bad also, cannot mend this file
- SPIFFS_CHECK_DBG("LU: FIXUP: index bad %i, cannot mend!\n", res);
+ SPIFFS_CHECK_DBG("LU: FIXUP: index bad "_SPIPRIi", cannot mend!\n", res);
res = spiffs_page_delete(fs, new_pix);
SPIFFS_CHECK_RES(res);
res = spiffs_delete_obj_lazy(fs, p_hdr->obj_id);
@@ -229,7 +229,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
// got a data page also, assume lu corruption only, rewrite to new page
spiffs_page_ix new_pix;
res = spiffs_rewrite_page(fs, cur_pix, p_hdr, &new_pix);
- SPIFFS_CHECK_DBG("LU: FIXUP: ix page with data not found elsewhere, rewriting %04x to new page %04x\n", cur_pix, new_pix);
+ SPIFFS_CHECK_DBG("LU: FIXUP: ix page with data not found elsewhere, rewriting "_SPIPRIpg" to new page "_SPIPRIpg"\n", cur_pix, new_pix);
SPIFFS_CHECK_RES(res);
*reload_lu = 1;
CHECK_CB(fs, SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix);
@@ -242,7 +242,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
if (lu_obj_id != SPIFFS_OBJ_ID_FREE && lu_obj_id != SPIFFS_OBJ_ID_DELETED) {
// look up entry used
if ((p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG) != (lu_obj_id | SPIFFS_OBJ_ID_IX_FLAG)) {
- SPIFFS_CHECK_DBG("LU: pix %04x differ in obj_id lu:%04x ph:%04x\n", cur_pix, lu_obj_id, p_hdr->obj_id);
+ SPIFFS_CHECK_DBG("LU: pix "_SPIPRIpg" differ in obj_id lu:"_SPIPRIid" ph:"_SPIPRIid"\n", cur_pix, lu_obj_id, p_hdr->obj_id);
delete_page = 1;
if ((p_hdr->flags & SPIFFS_PH_FLAG_DELET) == 0 ||
(p_hdr->flags & SPIFFS_PH_FLAG_FINAL) ||
@@ -265,7 +265,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
res = spiffs_rewrite_index(fs, p_hdr->obj_id, p_hdr->span_ix, new_pix, objix_pix);
if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) {
// index bad also, cannot mend this file
- SPIFFS_CHECK_DBG("LU: FIXUP: index bad %i, cannot mend!\n", res);
+ SPIFFS_CHECK_DBG("LU: FIXUP: index bad "_SPIPRIi", cannot mend!\n", res);
res = spiffs_page_delete(fs, new_pix);
SPIFFS_CHECK_RES(res);
res = spiffs_delete_obj_lazy(fs, p_hdr->obj_id);
@@ -321,7 +321,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
// rewrite as obj_id_ph
new_ph.obj_id = p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG;
res = spiffs_rewrite_page(fs, cur_pix, &new_ph, &new_pix);
- SPIFFS_CHECK_DBG("LU: FIXUP: rewrite page %04x as %04x to pix %04x\n", cur_pix, new_ph.obj_id, new_pix);
+ SPIFFS_CHECK_DBG("LU: FIXUP: rewrite page "_SPIPRIpg" as "_SPIPRIid" to pix "_SPIPRIpg"\n", cur_pix, new_ph.obj_id, new_pix);
CHECK_CB(fs, SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix);
SPIFFS_CHECK_RES(res);
*reload_lu = 1;
@@ -330,7 +330,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
// got a data page for look up obj id
// rewrite as obj_id_lu
new_ph.obj_id = lu_obj_id | SPIFFS_OBJ_ID_IX_FLAG;
- SPIFFS_CHECK_DBG("LU: FIXUP: rewrite page %04x as %04x\n", cur_pix, new_ph.obj_id);
+ SPIFFS_CHECK_DBG("LU: FIXUP: rewrite page "_SPIPRIpg" as "_SPIPRIid"\n", cur_pix, new_ph.obj_id);
CHECK_CB(fs, SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_FIX_LOOKUP, p_hdr->obj_id, p_hdr->span_ix);
res = spiffs_rewrite_page(fs, cur_pix, &new_ph, &new_pix);
SPIFFS_CHECK_RES(res);
@@ -344,7 +344,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
}
} else if (((lu_obj_id & SPIFFS_OBJ_ID_IX_FLAG) && (p_hdr->flags & SPIFFS_PH_FLAG_INDEX)) ||
((lu_obj_id & SPIFFS_OBJ_ID_IX_FLAG) == 0 && (p_hdr->flags & SPIFFS_PH_FLAG_INDEX) == 0)) {
- SPIFFS_CHECK_DBG("LU: %04x lu/page index marking differ\n", cur_pix);
+ SPIFFS_CHECK_DBG("LU: "_SPIPRIpg" lu/page index marking differ\n", cur_pix);
spiffs_page_ix data_pix, objix_pix_d;
// see if other data page exists for given obj id and span index
res = spiffs_obj_lu_find_id_and_span(fs, lu_obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, p_hdr->span_ix, cur_pix, &data_pix);
@@ -402,10 +402,10 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
}
}
else if ((p_hdr->flags & SPIFFS_PH_FLAG_DELET) == 0) {
- SPIFFS_CHECK_DBG("LU: pix %04x busy in lu but deleted on page\n", cur_pix);
+ SPIFFS_CHECK_DBG("LU: pix "_SPIPRIpg" busy in lu but deleted on page\n", cur_pix);
delete_page = 1;
} else if ((p_hdr->flags & SPIFFS_PH_FLAG_FINAL)) {
- SPIFFS_CHECK_DBG("LU: pix %04x busy but not final\n", cur_pix);
+ SPIFFS_CHECK_DBG("LU: pix "_SPIPRIpg" busy but not final\n", cur_pix);
// page can be removed if not referenced by object index
*reload_lu = 1;
res = spiffs_object_get_data_page_index_reference(fs, lu_obj_id, p_hdr->span_ix, &ref_pix, &objix_pix);
@@ -433,7 +433,7 @@ static s32_t spiffs_lookup_check_validate(spiffs *fs, spiffs_obj_id lu_obj_id, s
}
if (delete_page) {
- SPIFFS_CHECK_DBG("LU: FIXUP: deleting page %04x\n", cur_pix);
+ SPIFFS_CHECK_DBG("LU: FIXUP: deleting page "_SPIPRIpg"\n", cur_pix);
CHECK_CB(fs, SPIFFS_CHECK_LOOKUP, SPIFFS_CHECK_DELETE_PAGE, cur_pix, 0);
res = spiffs_page_delete(fs, cur_pix);
SPIFFS_CHECK_RES(res);
@@ -530,7 +530,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
spiffs_page_ix cur_pix = SPIFFS_OBJ_LOOKUP_PAGES(fs) + SPIFFS_PAGES_PER_BLOCK(fs) * cur_block;
while (!restart && cur_pix < SPIFFS_PAGES_PER_BLOCK(fs) * (cur_block+1)) {
//if ((cur_pix & 0xff) == 0)
- // SPIFFS_CHECK_DBG("PA: processing pix %08x, block %08x of pix %08x, block %08x\n",
+ // SPIFFS_CHECK_DBG("PA: processing pix "_SPIPRIpg", block "_SPIPRIbl" of pix "_SPIPRIpg", block "_SPIPRIbl"\n",
// cur_pix, cur_block, SPIFFS_PAGES_PER_BLOCK(fs) * fs->block_count, fs->block_count);
// read header
@@ -589,7 +589,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
|| (rpix_within_range && SPIFFS_IS_LOOKUP_PAGE(fs, rpix))) {
// bad reference
- SPIFFS_CHECK_DBG("PA: pix %04x bad pix / LU referenced from page %04x\n",
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg"x bad pix / LU referenced from page "_SPIPRIpg"\n",
rpix, cur_pix);
// check for data page elsewhere
spiffs_page_ix data_pix;
@@ -608,15 +608,15 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
new_ph.span_ix = data_spix_offset + i;
res = spiffs_page_allocate_data(fs, new_ph.obj_id, &new_ph, 0, 0, 0, 1, &data_pix);
SPIFFS_CHECK_RES(res);
- SPIFFS_CHECK_DBG("PA: FIXUP: found no existing data page, created new @ %04x\n", data_pix);
+ SPIFFS_CHECK_DBG("PA: FIXUP: found no existing data page, created new @ "_SPIPRIpg"\n", data_pix);
}
// remap index
- SPIFFS_CHECK_DBG("PA: FIXUP: rewriting index pix %04x\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: FIXUP: rewriting index pix "_SPIPRIpg"\n", cur_pix);
res = spiffs_rewrite_index(fs, objix_p_hdr->obj_id | SPIFFS_OBJ_ID_IX_FLAG,
data_spix_offset + i, data_pix, cur_pix);
if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) {
// index bad also, cannot mend this file
- SPIFFS_CHECK_DBG("PA: FIXUP: index bad %i, cannot mend - delete object\n", res);
+ SPIFFS_CHECK_DBG("PA: FIXUP: index bad "_SPIPRIi", cannot mend - delete object\n", res);
CHECK_CB(fs, SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, objix_p_hdr->obj_id, 0);
// delete file
res = spiffs_page_delete(fs, cur_pix);
@@ -640,7 +640,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
rp_hdr.span_ix != data_spix_offset + i ||
(rp_hdr.flags & (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_USED)) !=
(SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_INDEX)) {
- SPIFFS_CHECK_DBG("PA: pix %04x has inconsistent page header ix id/span:%04x/%04x, ref id/span:%04x/%04x flags:%02x\n",
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg" has inconsistent page header ix id/span:"_SPIPRIid"/"_SPIPRIsp", ref id/span:"_SPIPRIid"/"_SPIPRIsp" flags:"_SPIPRIfl"\n",
rpix, p_hdr.obj_id & ~SPIFFS_OBJ_ID_IX_FLAG, data_spix_offset + i,
rp_hdr.obj_id, rp_hdr.span_ix, rp_hdr.flags);
// try finding correct page
@@ -654,19 +654,19 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
SPIFFS_CHECK_RES(res);
if (data_pix == 0) {
// not found, this index is badly borked
- SPIFFS_CHECK_DBG("PA: FIXUP: index bad, delete object id %04x\n", p_hdr.obj_id);
+ SPIFFS_CHECK_DBG("PA: FIXUP: index bad, delete object id "_SPIPRIid"\n", p_hdr.obj_id);
CHECK_CB(fs, SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0);
res = spiffs_delete_obj_lazy(fs, p_hdr.obj_id);
SPIFFS_CHECK_RES(res);
break;
} else {
// found it, so rewrite index
- SPIFFS_CHECK_DBG("PA: FIXUP: found correct data pix %04x, rewrite ix pix %04x id %04x\n",
+ SPIFFS_CHECK_DBG("PA: FIXUP: found correct data pix "_SPIPRIpg", rewrite ix pix "_SPIPRIpg" id "_SPIPRIid"\n",
data_pix, cur_pix, p_hdr.obj_id);
res = spiffs_rewrite_index(fs, p_hdr.obj_id, data_spix_offset + i, data_pix, cur_pix);
if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) {
// index bad also, cannot mend this file
- SPIFFS_CHECK_DBG("PA: FIXUP: index bad %i, cannot mend!\n", res);
+ SPIFFS_CHECK_DBG("PA: FIXUP: index bad "_SPIPRIi", cannot mend!\n", res);
CHECK_CB(fs, SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0);
res = spiffs_delete_obj_lazy(fs, p_hdr.obj_id);
} else {
@@ -681,12 +681,12 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
const u32_t rpix_byte_ix = (rpix - pix_offset) / (8/bits);
const u8_t rpix_bit_ix = (rpix & ((8/bits)-1)) * bits;
if (fs->work[rpix_byte_ix] & (1<<(rpix_bit_ix + 1))) {
- SPIFFS_CHECK_DBG("PA: pix %04x multiple referenced from page %04x\n",
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg" multiple referenced from page "_SPIPRIpg"\n",
rpix, cur_pix);
// Here, we should have fixed all broken references - getting this means there
// must be multiple files with same object id. Only solution is to delete
// the object which is referring to this page
- SPIFFS_CHECK_DBG("PA: FIXUP: removing object %04x and page %04x\n",
+ SPIFFS_CHECK_DBG("PA: FIXUP: removing object "_SPIPRIid" and page "_SPIPRIpg"\n",
p_hdr.obj_id, cur_pix);
CHECK_CB(fs, SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0);
res = spiffs_delete_obj_lazy(fs, p_hdr.obj_id);
@@ -725,7 +725,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
if (bitmask == 0x1) {
// 001
- SPIFFS_CHECK_DBG("PA: pix %04x USED, UNREFERENCED, not index\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg" USED, UNREFERENCED, not index\n", cur_pix);
u8_t rewrite_ix_to_this = 0;
u8_t delete_page = 0;
@@ -741,7 +741,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
if (((rpix == (spiffs_page_ix)-1 || rpix > SPIFFS_MAX_PAGES(fs)) || (SPIFFS_IS_LOOKUP_PAGE(fs, rpix)))) {
// pointing to a bad page altogether, rewrite index to this
rewrite_ix_to_this = 1;
- SPIFFS_CHECK_DBG("PA: corresponding ref is bad: %04x, rewrite to this %04x\n", rpix, cur_pix);
+ SPIFFS_CHECK_DBG("PA: corresponding ref is bad: "_SPIPRIpg", rewrite to this "_SPIPRIpg"\n", rpix, cur_pix);
} else {
// pointing to something else, check what
spiffs_page_header rp_hdr;
@@ -752,12 +752,12 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
((rp_hdr.flags & (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_FINAL)) ==
(SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_DELET))) {
// pointing to something else valid, just delete this page then
- SPIFFS_CHECK_DBG("PA: corresponding ref is good but different: %04x, delete this %04x\n", rpix, cur_pix);
+ SPIFFS_CHECK_DBG("PA: corresponding ref is good but different: "_SPIPRIpg", delete this "_SPIPRIpg"\n", rpix, cur_pix);
delete_page = 1;
} else {
// pointing to something weird, update index to point to this page instead
if (rpix != cur_pix) {
- SPIFFS_CHECK_DBG("PA: corresponding ref is weird: %04x %s%s%s%s, rewrite this %04x\n", rpix,
+ SPIFFS_CHECK_DBG("PA: corresponding ref is weird: "_SPIPRIpg" %s%s%s%s, rewrite this "_SPIPRIpg"\n", rpix,
(rp_hdr.flags & SPIFFS_PH_FLAG_INDEX) ? "" : "INDEX ",
(rp_hdr.flags & SPIFFS_PH_FLAG_DELET) ? "" : "DELETED ",
(rp_hdr.flags & SPIFFS_PH_FLAG_USED) ? "NOTUSED " : "",
@@ -770,19 +770,19 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
}
}
} else if (res == SPIFFS_ERR_NOT_FOUND) {
- SPIFFS_CHECK_DBG("PA: corresponding ref not found, delete %04x\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: corresponding ref not found, delete "_SPIPRIpg"\n", cur_pix);
delete_page = 1;
res = SPIFFS_OK;
}
if (rewrite_ix_to_this) {
// if pointing to invalid page, redirect index to this page
- SPIFFS_CHECK_DBG("PA: FIXUP: rewrite index id %04x data spix %04x to point to this pix: %04x\n",
+ SPIFFS_CHECK_DBG("PA: FIXUP: rewrite index id "_SPIPRIid" data spix "_SPIPRIsp" to point to this pix: "_SPIPRIpg"\n",
p_hdr.obj_id, p_hdr.span_ix, cur_pix);
res = spiffs_rewrite_index(fs, p_hdr.obj_id, p_hdr.span_ix, cur_pix, objix_pix);
if (res <= _SPIFFS_ERR_CHECK_FIRST && res > _SPIFFS_ERR_CHECK_LAST) {
// index bad also, cannot mend this file
- SPIFFS_CHECK_DBG("PA: FIXUP: index bad %i, cannot mend!\n", res);
+ SPIFFS_CHECK_DBG("PA: FIXUP: index bad "_SPIPRIi", cannot mend!\n", res);
CHECK_CB(fs, SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_BAD_FILE, p_hdr.obj_id, 0);
res = spiffs_page_delete(fs, cur_pix);
SPIFFS_CHECK_RES(res);
@@ -794,7 +794,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
restart = 1;
continue;
} else if (delete_page) {
- SPIFFS_CHECK_DBG("PA: FIXUP: deleting page %04x\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: FIXUP: deleting page "_SPIPRIpg"\n", cur_pix);
CHECK_CB(fs, SPIFFS_CHECK_PAGE, SPIFFS_CHECK_DELETE_PAGE, cur_pix, 0);
res = spiffs_page_delete(fs, cur_pix);
}
@@ -803,7 +803,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
if (bitmask == 0x2) {
// 010
- SPIFFS_CHECK_DBG("PA: pix %04x FREE, REFERENCED, not index\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg" FREE, REFERENCED, not index\n", cur_pix);
// no op, this should be taken care of when checking valid references
}
@@ -813,7 +813,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
if (bitmask == 0x4) {
// 100
- SPIFFS_CHECK_DBG("PA: pix %04x FREE, unreferenced, INDEX\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg" FREE, unreferenced, INDEX\n", cur_pix);
// this should never happen, major fubar
}
@@ -823,14 +823,14 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
if (bitmask == 0x6) {
// 110
- SPIFFS_CHECK_DBG("PA: pix %04x FREE, REFERENCED, INDEX\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg" FREE, REFERENCED, INDEX\n", cur_pix);
// no op, this should be taken care of when checking valid references
}
if (bitmask == 0x7) {
// 111
- SPIFFS_CHECK_DBG("PA: pix %04x USED, REFERENCED, INDEX\n", cur_pix);
+ SPIFFS_CHECK_DBG("PA: pix "_SPIPRIpg" USED, REFERENCED, INDEX\n", cur_pix);
// no op, this should be taken care of when checking valid references
}
@@ -838,7 +838,7 @@ static s32_t spiffs_page_consistency_check_i(spiffs *fs) {
}
}
- SPIFFS_CHECK_DBG("PA: processed %04x, restart %i\n", pix_offset, restart);
+ SPIFFS_CHECK_DBG("PA: processed "_SPIPRIpg", restart "_SPIPRIi"\n", pix_offset, restart);
// next page range
if (!restart) {
pix_offset += pages_per_scan;
@@ -898,7 +898,7 @@ static s32_t spiffs_object_index_consistency_check_v(spiffs *fs, spiffs_obj_id o
if (p_hdr.span_ix == 0 &&
(p_hdr.flags & (SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) ==
(SPIFFS_PH_FLAG_DELET)) {
- SPIFFS_CHECK_DBG("IX: pix %04x, obj id:%04x spix:%04x header not fully deleted - deleting\n",
+ SPIFFS_CHECK_DBG("IX: pix "_SPIPRIpg", obj id:"_SPIPRIid" spix:"_SPIPRIsp" header not fully deleted - deleting\n",
cur_pix, obj_id, p_hdr.span_ix);
CHECK_CB(fs, SPIFFS_CHECK_INDEX, SPIFFS_CHECK_DELETE_PAGE, cur_pix, obj_id);
res = spiffs_page_delete(fs, cur_pix);
@@ -954,7 +954,7 @@ static s32_t spiffs_object_index_consistency_check_v(spiffs *fs, spiffs_obj_id o
}
if (delete) {
- SPIFFS_CHECK_DBG("IX: FIXUP: pix %04x, obj id:%04x spix:%04x is orphan index - deleting\n",
+ SPIFFS_CHECK_DBG("IX: FIXUP: pix "_SPIPRIpg", obj id:"_SPIPRIid" spix:"_SPIPRIsp" is orphan index - deleting\n",
cur_pix, obj_id, p_hdr.span_ix);
CHECK_CB(fs, SPIFFS_CHECK_INDEX, SPIFFS_CHECK_DELETE_ORPHANED_INDEX, cur_pix, obj_id);
res = spiffs_page_delete(fs, cur_pix);
@@ -980,8 +980,8 @@ s32_t spiffs_object_index_consistency_check(spiffs *fs) {
memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs));
u32_t obj_id_log_ix = 0;
CHECK_CB(fs, SPIFFS_CHECK_INDEX, SPIFFS_CHECK_PROGRESS, 0, 0);
- res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_object_index_consistency_check_v, &obj_id_log_ix,
- 0, 0, 0);
+ res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_object_index_consistency_check_v, 0, &obj_id_log_ix,
+ 0, 0);
if (res == SPIFFS_VIS_END) {
res = SPIFFS_OK;
}
diff --git a/cores/esp8266/spiffs/spiffs_config.h b/cores/esp8266/spiffs/spiffs_config.h
index 2fe03b1fda..c3343fe2fe 100644
--- a/cores/esp8266/spiffs/spiffs_config.h
+++ b/cores/esp8266/spiffs/spiffs_config.h
@@ -59,6 +59,44 @@ typedef uint8_t u8_t;
#ifndef SPIFFS_CHECK_DBG
#define SPIFFS_CHECK_DBG(...) //printf(__VA_ARGS__)
#endif
+// Set spiffs debug output call for all api invocations.
+#ifndef SPIFFS_API_DBG
+#define SPIFFS_API_DBG(...) //printf(__VA_ARGS__)
+#endif
+
+// Defines spiffs debug print formatters
+// some general signed number
+#ifndef _SPIPRIi
+#define _SPIPRIi "%d"
+#endif
+// address
+#ifndef _SPIPRIad
+#define _SPIPRIad "%08x"
+#endif
+// block
+#ifndef _SPIPRIbl
+#define _SPIPRIbl "%04x"
+#endif
+// page
+#ifndef _SPIPRIpg
+#define _SPIPRIpg "%04x"
+#endif
+// span index
+#ifndef _SPIPRIsp
+#define _SPIPRIsp "%04x"
+#endif
+// file descriptor
+#ifndef _SPIPRIfd
+#define _SPIPRIfd "%d"
+#endif
+// file object id
+#ifndef _SPIPRIid
+#define _SPIPRIid "%04x"
+#endif
+// file flags
+#ifndef _SPIPRIfl
+#define _SPIPRIfl "%02x"
+#endif
// Enable/disable API functions to determine exact number of bytes
// for filedescriptor and cache buffers. Once decided for a configuration,
@@ -127,6 +165,20 @@ typedef uint8_t u8_t;
#define SPIFFS_OBJ_NAME_LEN (32)
#endif
+// Maximum length of the metadata associated with an object.
+// Setting to non-zero value enables metadata-related API but also
+// changes the on-disk format, so the change is not backward-compatible.
+//
+// Do note: the meta length must never exceed
+// logical_page_size - (SPIFFS_OBJ_NAME_LEN + 64)
+//
+// This is derived from following:
+// logical_page_size - (SPIFFS_OBJ_NAME_LEN + sizeof(spiffs_page_header) +
+// spiffs_object_ix_header fields + at least some LUT entries)
+#ifndef SPIFFS_OBJ_META_LEN
+#define SPIFFS_OBJ_META_LEN (0)
+#endif
+
// Size of buffer allocated on stack used when copying data.
// Lower value generates more read/writes. No meaning having it bigger
// than logical page size.
@@ -142,6 +194,17 @@ typedef uint8_t u8_t;
#define SPIFFS_USE_MAGIC (1)
#endif
+#if SPIFFS_USE_MAGIC
+// Only valid when SPIFFS_USE_MAGIC is enabled. If SPIFFS_USE_MAGIC_LENGTH is
+// enabled, the magic will also be dependent on the length of the filesystem.
+// For example, a filesystem configured and formatted for 4 megabytes will not
+// be accepted for mounting with a configuration defining the filesystem as 2
+// megabytes.
+#ifndef SPIFFS_USE_MAGIC_LENGTH
+#define SPIFFS_USE_MAGIC_LENGTH (0)
+#endif
+#endif
+
// SPIFFS_LOCK and SPIFFS_UNLOCK protects spiffs from reentrancy on api level
// These should be defined on a multithreaded system
@@ -202,6 +265,67 @@ typedef uint8_t u8_t;
#define SPIFFS_FILEHDL_OFFSET 0
#endif
+// Enable this to compile a read only version of spiffs.
+// This will reduce binary size of spiffs. All code comprising modification
+// of the file system will not be compiled. Some config will be ignored.
+// HAL functions for erasing and writing to spi-flash may be null. Cache
+// can be disabled for even further binary size reduction (and ram savings).
+// Functions modifying the fs will return SPIFFS_ERR_RO_NOT_IMPL.
+// If the file system cannot be mounted due to aborted erase operation and
+// SPIFFS_USE_MAGIC is enabled, SPIFFS_ERR_RO_ABORTED_OPERATION will be
+// returned.
+// Might be useful for e.g. bootloaders and such.
+#ifndef SPIFFS_READ_ONLY
+#define SPIFFS_READ_ONLY 0
+#endif
+
+// Enable this to add a temporal file cache using the fd buffer.
+// The effects of the cache is that SPIFFS_open will find the file faster in
+// certain cases. It will make it a lot easier for spiffs to find files
+// opened frequently, reducing number of readings from the spi flash for
+// finding those files.
+// This will grow each fd by 6 bytes. If your files are opened in patterns
+// with a degree of temporal locality, the system is optimized.
+// Examples can be letting spiffs serve web content, where one file is the css.
+// The css is accessed for each html file that is opened, meaning it is
+// accessed almost every second time a file is opened. Another example could be
+// a log file that is often opened, written, and closed.
+// The size of the cache is number of given file descriptors, as it piggybacks
+// on the fd update mechanism. The cache lives in the closed file descriptors.
+// When closed, the fd know the whereabouts of the file. Instead of forgetting
+// this, the temporal cache will keep handling updates to that file even if the
+// fd is closed. If the file is opened again, the location of the file is found
+// directly. If all available descriptors become opened, all cache memory is
+// lost.
+#ifndef SPIFFS_TEMPORAL_FD_CACHE
+#define SPIFFS_TEMPORAL_FD_CACHE 1
+#endif
+
+// Temporal file cache hit score. Each time a file is opened, all cached files
+// will lose one point. If the opened file is found in cache, that entry will
+// gain SPIFFS_TEMPORAL_CACHE_HIT_SCORE points. One can experiment with this
+// value for the specific access patterns of the application. However, it must
+// be between 1 (no gain for hitting a cached entry often) and 255.
+#ifndef SPIFFS_TEMPORAL_CACHE_HIT_SCORE
+#define SPIFFS_TEMPORAL_CACHE_HIT_SCORE 4
+#endif
+
+// Enable to be able to map object indices to memory.
+// This allows for faster and more deterministic reading if cases of reading
+// large files and when changing file offset by seeking around a lot.
+// When mapping a file's index, the file system will be scanned for index pages
+// and the info will be put in memory provided by user. When reading, the
+// memory map can be looked up instead of searching for index pages on the
+// medium. This way, user can trade memory against performance.
+// Whole, parts of, or future parts not being written yet can be mapped. The
+// memory array will be owned by spiffs and updated accordingly during garbage
+// collecting or when modifying the indices. The latter is invoked by when the
+// file is modified in some way. The index buffer is tied to the file
+// descriptor.
+#ifndef SPIFFS_IX_MAP
+#define SPIFFS_IX_MAP 1
+#endif
+
// Set SPIFFS_TEST_VISUALISATION to non-zero to enable SPIFFS_vis function
// in the api. This function will visualize all filesystem using given printf
// function.
diff --git a/cores/esp8266/spiffs/spiffs_gc.c b/cores/esp8266/spiffs/spiffs_gc.c
index 8abb8dfc36..db1af4ccf6 100644
--- a/cores/esp8266/spiffs/spiffs_gc.c
+++ b/cores/esp8266/spiffs/spiffs_gc.c
@@ -11,7 +11,7 @@ static s32_t spiffs_gc_erase_block(
spiffs_block_ix bix) {
s32_t res;
- SPIFFS_GC_DBG("gc: erase block %i\n", bix);
+ SPIFFS_GC_DBG("gc: erase block "_SPIPRIbl"\n", bix);
res = spiffs_erase_block(fs, bix);
SPIFFS_CHECK_RES(res);
@@ -122,19 +122,19 @@ s32_t spiffs_gc_check(
u32_t needed_pages = (len + SPIFFS_DATA_PAGE_SIZE(fs) - 1) / SPIFFS_DATA_PAGE_SIZE(fs);
// if (fs->free_blocks <= 2 && (s32_t)needed_pages > free_pages) {
-// SPIFFS_GC_DBG("gc: full freeblk:%i needed:%i free:%i dele:%i\n", fs->free_blocks, needed_pages, free_pages, fs->stats_p_deleted);
+// SPIFFS_GC_DBG("gc: full freeblk:"_SPIPRIi" needed:"_SPIPRIi" free:"_SPIPRIi" dele:"_SPIPRIi"\n", fs->free_blocks, needed_pages, free_pages, fs->stats_p_deleted);
// return SPIFFS_ERR_FULL;
// }
if ((s32_t)needed_pages > (s32_t)(free_pages + fs->stats_p_deleted)) {
- SPIFFS_GC_DBG("gc_check: full freeblk:%i needed:%i free:%i dele:%i\n", fs->free_blocks, needed_pages, free_pages, fs->stats_p_deleted);
+ SPIFFS_GC_DBG("gc_check: full freeblk:"_SPIPRIi" needed:"_SPIPRIi" free:"_SPIPRIi" dele:"_SPIPRIi"\n", fs->free_blocks, needed_pages, free_pages, fs->stats_p_deleted);
return SPIFFS_ERR_FULL;
}
do {
- SPIFFS_GC_DBG("\ngc_check #%i: run gc free_blocks:%i pfree:%i pallo:%i pdele:%i [%i] len:%i of %i\n",
+ SPIFFS_GC_DBG("\ngc_check #"_SPIPRIi": run gc free_blocks:"_SPIPRIi" pfree:"_SPIPRIi" pallo:"_SPIPRIi" pdele:"_SPIPRIi" ["_SPIPRIi"] len:"_SPIPRIi" of "_SPIPRIi"\n",
tries,
fs->free_blocks, free_pages, fs->stats_p_allocated, fs->stats_p_deleted, (free_pages+fs->stats_p_allocated+fs->stats_p_deleted),
- len, free_pages*SPIFFS_DATA_PAGE_SIZE(fs));
+ len, (u32_t)(free_pages*SPIFFS_DATA_PAGE_SIZE(fs)));
spiffs_block_ix *cands;
int count;
@@ -152,13 +152,13 @@ s32_t spiffs_gc_check(
#endif
cand = cands[0];
fs->cleaning = 1;
- //printf("gcing: cleaning block %i\n", cand);
+ //SPIFFS_GC_DBG("gcing: cleaning block "_SPIPRIi"\n", cand);
res = spiffs_gc_clean(fs, cand);
fs->cleaning = 0;
if (res < 0) {
- SPIFFS_GC_DBG("gc_check: cleaning block %i, result %i\n", cand, res);
+ SPIFFS_GC_DBG("gc_check: cleaning block "_SPIPRIi", result "_SPIPRIi"\n", cand, res);
} else {
- SPIFFS_GC_DBG("gc_check: cleaning block %i, result %i\n", cand, res);
+ SPIFFS_GC_DBG("gc_check: cleaning block "_SPIPRIi", result "_SPIPRIi"\n", cand, res);
}
SPIFFS_CHECK_RES(res);
@@ -188,7 +188,7 @@ s32_t spiffs_gc_check(
res = SPIFFS_ERR_FULL;
}
- SPIFFS_GC_DBG("gc_check: finished, %i dirty, blocks %i free, %i pages free, %i tries, res %i\n",
+ SPIFFS_GC_DBG("gc_check: finished, "_SPIPRIi" dirty, blocks "_SPIPRIi" free, "_SPIPRIi" pages free, "_SPIPRIi" tries, res "_SPIPRIi"\n",
fs->stats_p_allocated + fs->stats_p_deleted,
fs->free_blocks, free_pages, tries, res);
@@ -226,7 +226,7 @@ s32_t spiffs_gc_erase_page_stats(
} // per entry
obj_lookup_page++;
} // per object lookup page
- SPIFFS_GC_DBG("gc_check: wipe pallo:%i pdele:%i\n", allo, dele);
+ SPIFFS_GC_DBG("gc_check: wipe pallo:"_SPIPRIi" pdele:"_SPIPRIi"\n", allo, dele);
fs->stats_p_allocated -= allo;
fs->stats_p_deleted -= dele;
return res;
@@ -255,10 +255,7 @@ s32_t spiffs_gc_find_candidate(
s32_t *cand_scores = (s32_t *)(fs->work + max_candidates * sizeof(spiffs_block_ix));
// align cand_scores on s32_t boundary
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
- cand_scores = (s32_t*)(((ptrdiff_t)cand_scores + sizeof(ptrdiff_t) - 1) & ~(sizeof(ptrdiff_t) - 1));
-#pragma GCC diagnostic pop
+ cand_scores = (s32_t*)(((intptr_t)cand_scores + sizeof(intptr_t) - 1) & ~(sizeof(intptr_t) - 1));
*block_candidates = cand_blocks;
@@ -297,7 +294,7 @@ s32_t spiffs_gc_find_candidate(
// calculate score and insert into candidate table
// stoneage sort, but probably not so many blocks
- if (res == SPIFFS_OK && deleted_pages_in_block > 0) {
+ if (res == SPIFFS_OK /*&& deleted_pages_in_block > 0*/) {
// read erase count
spiffs_obj_id erase_count;
res = _spiffs_rd(fs, SPIFFS_OP_C_READ | SPIFFS_OP_T_OBJ_LU2, 0,
@@ -317,7 +314,7 @@ s32_t spiffs_gc_find_candidate(
used_pages_in_block * SPIFFS_GC_HEUR_W_USED +
erase_age * (fs_crammed ? 0 : SPIFFS_GC_HEUR_W_ERASE_AGE);
int cand_ix = 0;
- SPIFFS_GC_DBG("gc_check: bix:%i del:%i use:%i score:%i\n", cur_block, deleted_pages_in_block, used_pages_in_block, score);
+ SPIFFS_GC_DBG("gc_check: bix:"_SPIPRIbl" del:"_SPIPRIi" use:"_SPIPRIi" score:"_SPIPRIi"\n", cur_block, deleted_pages_in_block, used_pages_in_block, score);
while (cand_ix < max_candidates) {
if (cand_blocks[cand_ix] == (spiffs_block_ix)-1) {
cand_blocks[cand_ix] = cur_block;
@@ -359,6 +356,7 @@ typedef struct {
spiffs_obj_id cur_obj_id;
spiffs_span_ix cur_objix_spix;
spiffs_page_ix cur_objix_pix;
+ spiffs_page_ix cur_data_pix;
int stored_scan_entry_index;
u8_t obj_id_found;
} spiffs_gc;
@@ -378,15 +376,16 @@ typedef struct {
//
s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
s32_t res = SPIFFS_OK;
- int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id));
+ const int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id));
+ // this is the global localizer being pushed and popped
int cur_entry = 0;
spiffs_obj_id *obj_lu_buf = (spiffs_obj_id *)fs->lu_work;
- spiffs_gc gc;
+ spiffs_gc gc; // our stack frame/state
spiffs_page_ix cur_pix = 0;
spiffs_page_object_ix_header *objix_hdr = (spiffs_page_object_ix_header *)fs->work;
spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work;
- SPIFFS_GC_DBG("gc_clean: cleaning block %i\n", bix);
+ SPIFFS_GC_DBG("gc_clean: cleaning block "_SPIPRIbl"\n", bix);
memset(&gc, 0, sizeof(spiffs_gc));
gc.state = FIND_OBJ_DATA;
@@ -395,12 +394,12 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
// move free cursor to next block, cannot use free pages from the block we want to clean
fs->free_cursor_block_ix = (bix+1)%fs->block_count;
fs->free_cursor_obj_lu_entry = 0;
- SPIFFS_GC_DBG("gc_clean: move free cursor to block %i\n", fs->free_cursor_block_ix);
+ SPIFFS_GC_DBG("gc_clean: move free cursor to block "_SPIPRIbl"\n", fs->free_cursor_block_ix);
}
while (res == SPIFFS_OK && gc.state != FINISHED) {
- SPIFFS_GC_DBG("gc_clean: state = %i entry:%i\n", gc.state, cur_entry);
- gc.obj_id_found = 0;
+ SPIFFS_GC_DBG("gc_clean: state = "_SPIPRIi" entry:"_SPIPRIi"\n", gc.state, cur_entry);
+ gc.obj_id_found = 0; // reset (to no found data page)
// scan through lookup pages
int obj_lookup_page = cur_entry / entries_per_page;
@@ -411,7 +410,7 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ,
0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page),
SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work);
- // check each entry
+ // check each object lookup entry
while (scan && res == SPIFFS_OK &&
cur_entry - entry_offset < entries_per_page && cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) {
spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset];
@@ -420,21 +419,26 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
// act upon object id depending on gc state
switch (gc.state) {
case FIND_OBJ_DATA:
+ // find a data page
if (obj_id != SPIFFS_OBJ_ID_DELETED && obj_id != SPIFFS_OBJ_ID_FREE &&
((obj_id & SPIFFS_OBJ_ID_IX_FLAG) == 0)) {
- SPIFFS_GC_DBG("gc_clean: FIND_DATA state:%i - found obj id %04x\n", gc.state, obj_id);
+ // found a data page, stop scanning and handle in switch case below
+ SPIFFS_GC_DBG("gc_clean: FIND_DATA state:"_SPIPRIi" - found obj id "_SPIPRIid"\n", gc.state, obj_id);
gc.obj_id_found = 1;
gc.cur_obj_id = obj_id;
+ gc.cur_data_pix = cur_pix;
scan = 0;
}
break;
case MOVE_OBJ_DATA:
+ // evacuate found data pages for corresponding object index we have in memory,
+ // update memory representation
if (obj_id == gc.cur_obj_id) {
spiffs_page_header p_hdr;
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ,
0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr);
SPIFFS_CHECK_RES(res);
- SPIFFS_GC_DBG("gc_clean: MOVE_DATA found data page %04x:%04x @ %04x\n", gc.cur_obj_id, p_hdr.span_ix, cur_pix);
+ SPIFFS_GC_DBG("gc_clean: MOVE_DATA found data page "_SPIPRIid":"_SPIPRIsp" @ "_SPIPRIpg"\n", gc.cur_obj_id, p_hdr.span_ix, cur_pix);
if (SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, p_hdr.span_ix) != gc.cur_objix_spix) {
SPIFFS_GC_DBG("gc_clean: MOVE_DATA no objix spix match, take in another run\n");
} else {
@@ -442,7 +446,7 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
if (p_hdr.flags & SPIFFS_PH_FLAG_DELET) {
// move page
res = spiffs_page_move(fs, 0, 0, obj_id, &p_hdr, cur_pix, &new_data_pix);
- SPIFFS_GC_DBG("gc_clean: MOVE_DATA move objix %04x:%04x page %04x to %04x\n", gc.cur_obj_id, p_hdr.span_ix, cur_pix, new_data_pix);
+ SPIFFS_GC_DBG("gc_clean: MOVE_DATA move objix "_SPIPRIid":"_SPIPRIsp" page "_SPIPRIpg" to "_SPIPRIpg"\n", gc.cur_obj_id, p_hdr.span_ix, cur_pix, new_data_pix);
SPIFFS_CHECK_RES(res);
// move wipes obj_lu, reload it
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ,
@@ -450,8 +454,10 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work);
SPIFFS_CHECK_RES(res);
} else {
- // page is deleted but not deleted in lookup, scrap it
- SPIFFS_GC_DBG("gc_clean: MOVE_DATA wipe objix %04x:%04x page %04x\n", obj_id, p_hdr.span_ix, cur_pix);
+ // page is deleted but not deleted in lookup, scrap it -
+ // might seem unnecessary as we will erase this block, but
+ // we might get aborted
+ SPIFFS_GC_DBG("gc_clean: MOVE_DATA wipe objix "_SPIPRIid":"_SPIPRIsp" page "_SPIPRIpg"\n", obj_id, p_hdr.span_ix, cur_pix);
res = spiffs_page_delete(fs, cur_pix);
SPIFFS_CHECK_RES(res);
new_data_pix = SPIFFS_OBJ_ID_FREE;
@@ -460,16 +466,17 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
if (gc.cur_objix_spix == 0) {
// update object index header page
((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[p_hdr.span_ix] = new_data_pix;
- SPIFFS_GC_DBG("gc_clean: MOVE_DATA wrote page %04x to objix_hdr entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix));
+ SPIFFS_GC_DBG("gc_clean: MOVE_DATA wrote page "_SPIPRIpg" to objix_hdr entry "_SPIPRIsp" in mem\n", new_data_pix, (spiffs_span_ix)SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix));
} else {
// update object index page
((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix)] = new_data_pix;
- SPIFFS_GC_DBG("gc_clean: MOVE_DATA wrote page %04x to objix entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix));
+ SPIFFS_GC_DBG("gc_clean: MOVE_DATA wrote page "_SPIPRIpg" to objix entry "_SPIPRIsp" in mem\n", new_data_pix, (spiffs_span_ix)SPIFFS_OBJ_IX_ENTRY(fs, p_hdr.span_ix));
}
}
}
break;
case MOVE_OBJ_IX:
+ // find and evacuate object index pages
if (obj_id != SPIFFS_OBJ_ID_DELETED && obj_id != SPIFFS_OBJ_ID_FREE &&
(obj_id & SPIFFS_OBJ_ID_IX_FLAG)) {
// found an index object id
@@ -482,20 +489,24 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
if (p_hdr.flags & SPIFFS_PH_FLAG_DELET) {
// move page
res = spiffs_page_move(fs, 0, 0, obj_id, &p_hdr, cur_pix, &new_pix);
- SPIFFS_GC_DBG("gc_clean: MOVE_OBJIX move objix %04x:%04x page %04x to %04x\n", obj_id, p_hdr.span_ix, cur_pix, new_pix);
+ SPIFFS_GC_DBG("gc_clean: MOVE_OBJIX move objix "_SPIPRIid":"_SPIPRIsp" page "_SPIPRIpg" to "_SPIPRIpg"\n", obj_id, p_hdr.span_ix, cur_pix, new_pix);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_UPD, obj_id, p_hdr.span_ix, new_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)&p_hdr,
+ SPIFFS_EV_IX_MOV, obj_id, p_hdr.span_ix, new_pix, 0);
// move wipes obj_lu, reload it
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_READ,
0, bix * SPIFFS_CFG_LOG_BLOCK_SZ(fs) + SPIFFS_PAGE_TO_PADDR(fs, obj_lookup_page),
SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->lu_work);
SPIFFS_CHECK_RES(res);
} else {
- // page is deleted but not deleted in lookup, scrap it
- SPIFFS_GC_DBG("gc_clean: MOVE_OBJIX wipe objix %04x:%04x page %04x\n", obj_id, p_hdr.span_ix, cur_pix);
+ // page is deleted but not deleted in lookup, scrap it -
+ // might seem unnecessary as we will erase this block, but
+ // we might get aborted
+ SPIFFS_GC_DBG("gc_clean: MOVE_OBJIX wipe objix "_SPIPRIid":"_SPIPRIsp" page "_SPIPRIpg"\n", obj_id, p_hdr.span_ix, cur_pix);
res = spiffs_page_delete(fs, cur_pix);
if (res == SPIFFS_OK) {
- spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_DEL, obj_id, p_hdr.span_ix, cur_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)0,
+ SPIFFS_EV_IX_DEL, obj_id, p_hdr.span_ix, cur_pix, 0);
}
}
SPIFFS_CHECK_RES(res);
@@ -504,69 +515,88 @@ s32_t spiffs_gc_clean(spiffs *fs, spiffs_block_ix bix) {
default:
scan = 0;
break;
- }
+ } // switch gc state
cur_entry++;
} // per entry
- obj_lookup_page++;
+ obj_lookup_page++; // no need to check scan variable here, obj_lookup_page is set in start of loop
} // per object lookup page
-
if (res != SPIFFS_OK) break;
// state finalization and switch
switch (gc.state) {
case FIND_OBJ_DATA:
if (gc.obj_id_found) {
+ // handle found data page -
// find out corresponding obj ix page and load it to memory
spiffs_page_header p_hdr;
spiffs_page_ix objix_pix;
- gc.stored_scan_entry_index = cur_entry;
- cur_entry = 0;
+ gc.stored_scan_entry_index = cur_entry; // push cursor
+ cur_entry = 0; // restart scan from start
gc.state = MOVE_OBJ_DATA;
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ,
0, SPIFFS_PAGE_TO_PADDR(fs, cur_pix), sizeof(spiffs_page_header), (u8_t*)&p_hdr);
SPIFFS_CHECK_RES(res);
gc.cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, p_hdr.span_ix);
- SPIFFS_GC_DBG("gc_clean: FIND_DATA find objix span_ix:%04x\n", gc.cur_objix_spix);
+ SPIFFS_GC_DBG("gc_clean: FIND_DATA find objix span_ix:"_SPIPRIsp"\n", gc.cur_objix_spix);
res = spiffs_obj_lu_find_id_and_span(fs, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, gc.cur_objix_spix, 0, &objix_pix);
+ if (res == SPIFFS_ERR_NOT_FOUND) {
+ // on borked systems we might get an ERR_NOT_FOUND here -
+ // this is handled by simply deleting the page as it is not referenced
+ // from anywhere
+ SPIFFS_GC_DBG("gc_clean: FIND_OBJ_DATA objix not found! Wipe page "_SPIPRIpg"\n", gc.cur_data_pix);
+ res = spiffs_page_delete(fs, gc.cur_data_pix);
+ SPIFFS_CHECK_RES(res);
+ // then we restore states and continue scanning for data pages
+ cur_entry = gc.stored_scan_entry_index; // pop cursor
+ gc.state = FIND_OBJ_DATA;
+ break; // done
+ }
SPIFFS_CHECK_RES(res);
- SPIFFS_GC_DBG("gc_clean: FIND_DATA found object index at page %04x\n", objix_pix);
+ SPIFFS_GC_DBG("gc_clean: FIND_DATA found object index at page "_SPIPRIpg"\n", objix_pix);
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ,
0, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
+ // cannot allow a gc if the presumed index in fact is no index, a
+ // check must run or lot of data may be lost
SPIFFS_VALIDATE_OBJIX(objix->p_hdr, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, gc.cur_objix_spix);
gc.cur_objix_pix = objix_pix;
} else {
+ // no more data pages found, passed thru all block, start evacuating object indices
gc.state = MOVE_OBJ_IX;
cur_entry = 0; // restart entry scan index
}
break;
case MOVE_OBJ_DATA: {
- // store modified objix (hdr) page
+ // store modified objix (hdr) page residing in memory now that all
+ // data pages belonging to this object index and residing in the block
+ // we want to evacuate
spiffs_page_ix new_objix_pix;
gc.state = FIND_OBJ_DATA;
- cur_entry = gc.stored_scan_entry_index;
+ cur_entry = gc.stored_scan_entry_index; // pop cursor
if (gc.cur_objix_spix == 0) {
// store object index header page
- res = spiffs_object_update_index_hdr(fs, 0, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, gc.cur_objix_pix, fs->work, 0, 0, &new_objix_pix);
- SPIFFS_GC_DBG("gc_clean: MOVE_DATA store modified objix_hdr page, %04x:%04x\n", new_objix_pix, 0);
+ res = spiffs_object_update_index_hdr(fs, 0, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, gc.cur_objix_pix, fs->work, 0, 0, 0, &new_objix_pix);
+ SPIFFS_GC_DBG("gc_clean: MOVE_DATA store modified objix_hdr page, "_SPIPRIpg":"_SPIPRIsp"\n", new_objix_pix, 0);
SPIFFS_CHECK_RES(res);
} else {
// store object index page
res = spiffs_page_move(fs, 0, fs->work, gc.cur_obj_id | SPIFFS_OBJ_ID_IX_FLAG, 0, gc.cur_objix_pix, &new_objix_pix);
- SPIFFS_GC_DBG("gc_clean: MOVE_DATA store modified objix page, %04x:%04x\n", new_objix_pix, objix->p_hdr.span_ix);
+ SPIFFS_GC_DBG("gc_clean: MOVE_DATA store modified objix page, "_SPIPRIpg":"_SPIPRIsp"\n", new_objix_pix, objix->p_hdr.span_ix);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_UPD, gc.cur_obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)fs->work,
+ SPIFFS_EV_IX_UPD, gc.cur_obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
}
}
break;
case MOVE_OBJ_IX:
+ // scanned thru all block, no more object indices found - our work here is done
gc.state = FINISHED;
break;
default:
cur_entry = 0;
break;
- }
- SPIFFS_GC_DBG("gc_clean: state-> %i\n", gc.state);
+ } // switch gc.state
+ SPIFFS_GC_DBG("gc_clean: state-> "_SPIPRIi"\n", gc.state);
} // while state != FINISHED
diff --git a/cores/esp8266/spiffs/spiffs_hydrogen.c b/cores/esp8266/spiffs/spiffs_hydrogen.c
index c43ddcdc33..18c8bb4148 100644
--- a/cores/esp8266/spiffs/spiffs_hydrogen.c
+++ b/cores/esp8266/spiffs/spiffs_hydrogen.c
@@ -8,20 +8,13 @@
#include "spiffs.h"
#include "spiffs_nucleus.h"
-#if SPIFFS_FILEHDL_OFFSET
-#define SPIFFS_FH_OFFS(fs, fh) ((fh) != 0 ? ((fh) + (fs)->cfg.fh_ix_offset) : 0)
-#define SPIFFS_FH_UNOFFS(fs, fh) ((fh) != 0 ? ((fh) - (fs)->cfg.fh_ix_offset) : 0)
-#else
-#define SPIFFS_FH_OFFS(fs, fh) (fh)
-#define SPIFFS_FH_UNOFFS(fs, fh) (fh)
-#endif
-
#if SPIFFS_CACHE == 1
static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh);
#endif
#if SPIFFS_BUFFER_HELP
u32_t SPIFFS_buffer_bytes_for_filedescs(spiffs *fs, u32_t num_descs) {
+ (void)fs; // unused, avoid warning
return num_descs * sizeof(spiffs_fd);
}
#if SPIFFS_CACHE
@@ -69,6 +62,7 @@ s32_t SPIFFS_format(spiffs *fs) {
#if SPIFFS_USE_MAGIC && SPIFFS_USE_MAGIC_LENGTH && SPIFFS_SINGLETON==0
s32_t SPIFFS_probe_fs(spiffs_config *config) {
+ SPIFFS_API_DBG("%s\n", __func__);
s32_t res = spiffs_probe(config);
return res;
}
@@ -79,22 +73,31 @@ s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work,
u8_t *fd_space, u32_t fd_space_size,
void *cache, u32_t cache_size,
spiffs_check_callback check_cb_f) {
+ SPIFFS_API_DBG("%s "
+ " sz:"_SPIPRIi " logpgsz:"_SPIPRIi " logblksz:"_SPIPRIi " perasz:"_SPIPRIi
+ " addr:"_SPIPRIad
+ " fdsz:"_SPIPRIi " cachesz:"_SPIPRIi
+ "\n",
+ __func__,
+ SPIFFS_CFG_PHYS_SZ(fs),
+ SPIFFS_CFG_LOG_PAGE_SZ(fs),
+ SPIFFS_CFG_LOG_BLOCK_SZ(fs),
+ SPIFFS_CFG_PHYS_ERASE_SZ(fs),
+ SPIFFS_CFG_PHYS_ADDR(fs),
+ fd_space_size, cache_size);
void *user_data;
SPIFFS_LOCK(fs);
user_data = fs->user_data;
memset(fs, 0, sizeof(spiffs));
- memcpy(&fs->cfg, config, sizeof(spiffs_config));
+ _SPIFFS_MEMCPY(&fs->cfg, config, sizeof(spiffs_config));
fs->user_data = user_data;
fs->block_count = SPIFFS_CFG_PHYS_SZ(fs) / SPIFFS_CFG_LOG_BLOCK_SZ(fs);
fs->work = &work[0];
fs->lu_work = &work[SPIFFS_CFG_LOG_PAGE_SZ(fs)];
memset(fd_space, 0, fd_space_size);
- // align fd_space pointer to pointer size byte boundary, below is safe
+ // align fd_space pointer to pointer size byte boundary
u8_t ptr_size = sizeof(void*);
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
- u8_t addr_lsb = ((u8_t)fd_space) & (ptr_size-1);
-#pragma GCC diagnostic pop
+ u8_t addr_lsb = ((u8_t)(intptr_t)fd_space) & (ptr_size-1);
if (addr_lsb) {
fd_space += (ptr_size-addr_lsb);
fd_space_size -= (ptr_size-addr_lsb);
@@ -102,11 +105,8 @@ s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work,
fs->fd_space = fd_space;
fs->fd_count = (fd_space_size/sizeof(spiffs_fd));
- // align cache pointer to 4 byte boundary, below is safe
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
- addr_lsb = ((u8_t)cache) & (ptr_size-1);
-#pragma GCC diagnostic pop
+ // align cache pointer to 4 byte boundary
+ addr_lsb = ((u8_t)(intptr_t)cache) & (ptr_size-1);
if (addr_lsb) {
u8_t *cache_8 = (u8_t *)cache;
cache_8 += (ptr_size-addr_lsb);
@@ -135,14 +135,14 @@ s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work,
res = spiffs_obj_lu_scan(fs);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- SPIFFS_DBG("page index byte len: %i\n", SPIFFS_CFG_LOG_PAGE_SZ(fs));
- SPIFFS_DBG("object lookup pages: %i\n", SPIFFS_OBJ_LOOKUP_PAGES(fs));
- SPIFFS_DBG("page pages per block: %i\n", SPIFFS_PAGES_PER_BLOCK(fs));
- SPIFFS_DBG("page header length: %i\n", sizeof(spiffs_page_header));
- SPIFFS_DBG("object header index entries: %i\n", SPIFFS_OBJ_HDR_IX_LEN(fs));
- SPIFFS_DBG("object index entries: %i\n", SPIFFS_OBJ_IX_LEN(fs));
- SPIFFS_DBG("available file descriptors: %i\n", fs->fd_count);
- SPIFFS_DBG("free blocks: %i\n", fs->free_blocks);
+ SPIFFS_DBG("page index byte len: "_SPIPRIi"\n", (u32_t)SPIFFS_CFG_LOG_PAGE_SZ(fs));
+ SPIFFS_DBG("object lookup pages: "_SPIPRIi"\n", (u32_t)SPIFFS_OBJ_LOOKUP_PAGES(fs));
+ SPIFFS_DBG("page pages per block: "_SPIPRIi"\n", (u32_t)SPIFFS_PAGES_PER_BLOCK(fs));
+ SPIFFS_DBG("page header length: "_SPIPRIi"\n", (u32_t)sizeof(spiffs_page_header));
+ SPIFFS_DBG("object header index entries: "_SPIPRIi"\n", (u32_t)SPIFFS_OBJ_HDR_IX_LEN(fs));
+ SPIFFS_DBG("object index entries: "_SPIPRIi"\n", (u32_t)SPIFFS_OBJ_IX_LEN(fs));
+ SPIFFS_DBG("available file descriptors: "_SPIPRIi"\n", (u32_t)fs->fd_count);
+ SPIFFS_DBG("free blocks: "_SPIPRIi"\n", (u32_t)fs->free_blocks);
fs->check_cb_f = check_cb_f;
@@ -154,6 +154,7 @@ s32_t SPIFFS_mount(spiffs *fs, spiffs_config *config, u8_t *work,
}
void SPIFFS_unmount(spiffs *fs) {
+ SPIFFS_API_DBG("%s\n", __func__);
if (!SPIFFS_CHECK_CFG(fs) || !SPIFFS_CHECK_MOUNT(fs)) return;
SPIFFS_LOCK(fs);
u32_t i;
@@ -177,10 +178,12 @@ s32_t SPIFFS_errno(spiffs *fs) {
}
void SPIFFS_clearerr(spiffs *fs) {
+ SPIFFS_API_DBG("%s\n", __func__);
fs->err_code = SPIFFS_OK;
}
s32_t SPIFFS_creat(spiffs *fs, const char *path, spiffs_mode mode) {
+ SPIFFS_API_DBG("%s '%s'\n", __func__, path);
#if SPIFFS_READ_ONLY
(void)fs; (void)path; (void)mode;
return SPIFFS_ERR_RO_NOT_IMPL;
@@ -188,13 +191,16 @@ s32_t SPIFFS_creat(spiffs *fs, const char *path, spiffs_mode mode) {
(void)mode;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
+ if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
+ SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
+ }
SPIFFS_LOCK(fs);
spiffs_obj_id obj_id;
s32_t res;
res = spiffs_obj_lu_find_free_obj_id(fs, &obj_id, (const u8_t*)path);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- res = spiffs_object_create(fs, obj_id, (const u8_t*)path, SPIFFS_TYPE_FILE, 0);
+ res = spiffs_object_create(fs, obj_id, (const u8_t*)path, 0, SPIFFS_TYPE_FILE, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
SPIFFS_UNLOCK(fs);
return 0;
@@ -202,9 +208,13 @@ s32_t SPIFFS_creat(spiffs *fs, const char *path, spiffs_mode mode) {
}
spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs_mode mode) {
+ SPIFFS_API_DBG("%s '%s' "_SPIPRIfl "\n", __func__, path, flags);
(void)mode;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
+ if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
+ SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
+ }
SPIFFS_LOCK(fs);
spiffs_fd *fd;
@@ -212,14 +222,14 @@ spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs
#if SPIFFS_READ_ONLY
// not valid flags in read only mode
- flags &= ~SPIFFS_WRONLY | SPIFFS_CREAT | SPIFFS_TRUNC;
+ flags &= ~(SPIFFS_WRONLY | SPIFFS_CREAT | SPIFFS_TRUNC);
#endif // SPIFFS_READ_ONLY
- s32_t res = spiffs_fd_find_new(fs, &fd);
+ s32_t res = spiffs_fd_find_new(fs, &fd, path);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)path, &pix);
- if ((flags & SPIFFS_CREAT) == 0) {
+ if ((flags & SPIFFS_O_CREAT) == 0) {
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
@@ -227,14 +237,14 @@ spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs
}
if (res == SPIFFS_OK &&
- (flags & (SPIFFS_CREAT | SPIFFS_EXCL)) == (SPIFFS_CREAT | SPIFFS_EXCL)) {
+ (flags & (SPIFFS_O_CREAT | SPIFFS_O_EXCL)) == (SPIFFS_O_CREAT | SPIFFS_O_EXCL)) {
// creat and excl and file exists - fail
res = SPIFFS_ERR_FILE_EXISTS;
spiffs_fd_return(fs, fd->file_nbr);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
- if ((flags & SPIFFS_CREAT) && res == SPIFFS_ERR_NOT_FOUND) {
+ if ((flags & SPIFFS_O_CREAT) && res == SPIFFS_ERR_NOT_FOUND) {
#if !SPIFFS_READ_ONLY
spiffs_obj_id obj_id;
// no need to enter conflicting name here, already looked for it above
@@ -243,12 +253,12 @@ spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- res = spiffs_object_create(fs, obj_id, (const u8_t*)path, SPIFFS_TYPE_FILE, &pix);
+ res = spiffs_object_create(fs, obj_id, (const u8_t*)path, 0, SPIFFS_TYPE_FILE, &pix);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- flags &= ~SPIFFS_TRUNC;
+ flags &= ~SPIFFS_O_TRUNC;
#endif // !SPIFFS_READ_ONLY
} else {
if (res < SPIFFS_OK) {
@@ -262,7 +272,7 @@ spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if !SPIFFS_READ_ONLY
- if (flags & SPIFFS_TRUNC) {
+ if (flags & SPIFFS_O_TRUNC) {
res = spiffs_object_truncate(fd, 0, 0);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
@@ -279,13 +289,14 @@ spiffs_file SPIFFS_open(spiffs *fs, const char *path, spiffs_flags flags, spiffs
}
spiffs_file SPIFFS_open_by_dirent(spiffs *fs, struct spiffs_dirent *e, spiffs_flags flags, spiffs_mode mode) {
+ SPIFFS_API_DBG("%s '%s':"_SPIPRIid " "_SPIPRIfl "\n", __func__, e->name, e->obj_id, flags);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
- s32_t res = spiffs_fd_find_new(fs, &fd);
+ s32_t res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_open_by_page(fs, e->pix, fd, flags, mode);
@@ -294,7 +305,7 @@ spiffs_file SPIFFS_open_by_dirent(spiffs *fs, struct spiffs_dirent *e, spiffs_fl
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if !SPIFFS_READ_ONLY
- if (flags & SPIFFS_TRUNC) {
+ if (flags & SPIFFS_O_TRUNC) {
res = spiffs_object_truncate(fd, 0, 0);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
@@ -311,13 +322,14 @@ spiffs_file SPIFFS_open_by_dirent(spiffs *fs, struct spiffs_dirent *e, spiffs_fl
}
spiffs_file SPIFFS_open_by_page(spiffs *fs, spiffs_page_ix page_ix, spiffs_flags flags, spiffs_mode mode) {
+ SPIFFS_API_DBG("%s "_SPIPRIpg " "_SPIPRIfl "\n", __func__, page_ix, flags);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
spiffs_fd *fd;
- s32_t res = spiffs_fd_find_new(fs, &fd);
+ s32_t res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
if (SPIFFS_IS_LOOKUP_PAGE(fs, page_ix)) {
@@ -340,7 +352,7 @@ spiffs_file SPIFFS_open_by_page(spiffs *fs, spiffs_page_ix page_ix, spiffs_flags
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if !SPIFFS_READ_ONLY
- if (flags & SPIFFS_TRUNC) {
+ if (flags & SPIFFS_O_TRUNC) {
res = spiffs_object_truncate(fd, 0, 0);
if (res < SPIFFS_OK) {
spiffs_fd_return(fs, fd->file_nbr);
@@ -356,7 +368,7 @@ spiffs_file SPIFFS_open_by_page(spiffs *fs, spiffs_page_ix page_ix, spiffs_flags
return SPIFFS_FH_OFFS(fs, fd->file_nbr);
}
-s32_t SPIFFS_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
+static s32_t spiffs_hydro_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
@@ -368,7 +380,7 @@ s32_t SPIFFS_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- if ((fd->flags & SPIFFS_RDONLY) == 0) {
+ if ((fd->flags & SPIFFS_O_RDONLY) == 0) {
res = SPIFFS_ERR_NOT_READABLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
@@ -410,6 +422,16 @@ s32_t SPIFFS_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
return len;
}
+s32_t SPIFFS_read(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd " "_SPIPRIi "\n", __func__, fh, len);
+ s32_t res = spiffs_hydro_read(fs, fh, buf, len);
+ if (res == SPIFFS_ERR_END_OF_OBJECT) {
+ res = 0;
+ }
+ return res;
+}
+
+
#if !SPIFFS_READ_ONLY
static s32_t spiffs_hydro_write(spiffs *fs, spiffs_fd *fd, void *buf, u32_t offset, s32_t len) {
(void)fs;
@@ -435,6 +457,7 @@ static s32_t spiffs_hydro_write(spiffs *fs, spiffs_fd *fd, void *buf, u32_t offs
#endif // !SPIFFS_READ_ONLY
s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd " "_SPIPRIi "\n", __func__, fh, len);
#if SPIFFS_READ_ONLY
(void)fs; (void)fh; (void)buf; (void)len;
return SPIFFS_ERR_RO_NOT_IMPL;
@@ -451,15 +474,14 @@ s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- if ((fd->flags & SPIFFS_WRONLY) == 0) {
+ if ((fd->flags & SPIFFS_O_WRONLY) == 0) {
res = SPIFFS_ERR_NOT_WRITABLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
- if ((fd->flags & SPIFFS_APPEND)) {
+ if ((fd->flags & SPIFFS_O_APPEND)) {
fd->fdoffset = fd->size == SPIFFS_UNDEFINED_LEN ? 0 : fd->size;
}
-
offset = fd->fdoffset;
#if SPIFFS_CACHE_WR
@@ -468,7 +490,7 @@ s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
fd->cache_page = spiffs_cache_page_get_by_fd(fs, fd);
}
#endif
- if (fd->flags & SPIFFS_APPEND) {
+ if (fd->flags & SPIFFS_O_APPEND) {
if (fd->size == SPIFFS_UNDEFINED_LEN) {
offset = 0;
} else {
@@ -482,7 +504,7 @@ s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
}
#if SPIFFS_CACHE_WR
- if ((fd->flags & SPIFFS_DIRECT) == 0) {
+ if ((fd->flags & SPIFFS_O_DIRECT) == 0) {
if (len < (s32_t)SPIFFS_CFG_LOG_PAGE_SZ(fs)) {
// small write, try to cache it
u8_t alloc_cpage = 1;
@@ -493,13 +515,13 @@ s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
offset + len > fd->cache_page->offset + SPIFFS_CFG_LOG_PAGE_SZ(fs)) // writing beyond cache page
{
// boundary violation, write back cache first and allocate new
- SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page %i for fd %i:%04x, boundary viol, offs:%i size:%i\n",
+ SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page "_SPIPRIi" for fd "_SPIPRIfd":"_SPIPRIid", boundary viol, offs:"_SPIPRIi" size:"_SPIPRIi"\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size);
res = spiffs_hydro_write(fs, fd,
spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix),
fd->cache_page->offset, fd->cache_page->size);
spiffs_cache_fd_release(fs, fd->cache_page);
- SPIFFS_API_CHECK_RES(fs, res);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
} else {
// writing within cache
alloc_cpage = 0;
@@ -511,26 +533,37 @@ s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
if (fd->cache_page) {
fd->cache_page->offset = offset;
fd->cache_page->size = 0;
- SPIFFS_CACHE_DBG("CACHE_WR_ALLO: allocating cache page %i for fd %i:%04x\n",
+ SPIFFS_CACHE_DBG("CACHE_WR_ALLO: allocating cache page "_SPIPRIi" for fd "_SPIPRIfd":"_SPIPRIid"\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id);
}
}
if (fd->cache_page) {
u32_t offset_in_cpage = offset - fd->cache_page->offset;
- SPIFFS_CACHE_DBG("CACHE_WR_WRITE: storing to cache page %i for fd %i:%04x, offs %i:%i len %i\n",
+ SPIFFS_CACHE_DBG("CACHE_WR_WRITE: storing to cache page "_SPIPRIi" for fd "_SPIPRIfd":"_SPIPRIid", offs "_SPIPRIi":"_SPIPRIi" len "_SPIPRIi"\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id,
offset, offset_in_cpage, len);
spiffs_cache *cache = spiffs_get_cache(fs);
u8_t *cpage_data = spiffs_get_cache_page(fs, cache, fd->cache_page->ix);
- memcpy(&cpage_data[offset_in_cpage], buf, len);
+#ifdef _SPIFFS_TEST
+ {
+ intptr_t __a1 = (u8_t*)&cpage_data[offset_in_cpage]-(u8_t*)cache;
+ intptr_t __a2 = (u8_t*)&cpage_data[offset_in_cpage]+len-(u8_t*)cache;
+ intptr_t __b = sizeof(spiffs_cache) + cache->cpage_count * (sizeof(spiffs_cache_page) + SPIFFS_CFG_LOG_PAGE_SZ(fs));
+ if (__a1 > __b || __a2 > __b) {
+ printf("FATAL OOB: CACHE_WR: memcpy to cache buffer ixs:%4ld..%4ld of %4ld\n", __a1, __a2, __b);
+ ERREXIT();
+ }
+ }
+#endif
+ _SPIFFS_MEMCPY(&cpage_data[offset_in_cpage], buf, len);
fd->cache_page->size = MAX(fd->cache_page->size, offset_in_cpage + len);
fd->fdoffset += len;
SPIFFS_UNLOCK(fs);
return len;
} else {
res = spiffs_hydro_write(fs, fd, buf, offset, len);
- SPIFFS_API_CHECK_RES(fs, res);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
fd->fdoffset += len;
SPIFFS_UNLOCK(fs);
return res;
@@ -539,22 +572,21 @@ s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
// big write, no need to cache it - but first check if there is a cached write already
if (fd->cache_page) {
// write back cache first
- SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page %i for fd %i:%04x, big write, offs:%i size:%i\n",
+ SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page "_SPIPRIi" for fd "_SPIPRIfd":"_SPIPRIid", big write, offs:"_SPIPRIi" size:"_SPIPRIi"\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size);
res = spiffs_hydro_write(fs, fd,
spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix),
fd->cache_page->offset, fd->cache_page->size);
spiffs_cache_fd_release(fs, fd->cache_page);
- SPIFFS_API_CHECK_RES(fs, res);
- res = spiffs_hydro_write(fs, fd, buf, offset, len);
- SPIFFS_API_CHECK_RES(fs, res);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+ // data written below
}
}
}
#endif
res = spiffs_hydro_write(fs, fd, buf, offset, len);
- SPIFFS_API_CHECK_RES(fs, res);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
fd->fdoffset += len;
SPIFFS_UNLOCK(fs);
@@ -564,6 +596,7 @@ s32_t SPIFFS_write(spiffs *fs, spiffs_file fh, void *buf, s32_t len) {
}
s32_t SPIFFS_lseek(spiffs *fs, spiffs_file fh, s32_t offs, int whence) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd " "_SPIPRIi " %s\n", __func__, fh, offs, (const char* []){"SET","CUR","END","???"}[MIN(whence,3)]);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
@@ -572,27 +605,32 @@ s32_t SPIFFS_lseek(spiffs *fs, spiffs_file fh, s32_t offs, int whence) {
s32_t res;
fh = SPIFFS_FH_UNOFFS(fs, fh);
res = spiffs_fd_get(fs, fh, &fd);
- SPIFFS_API_CHECK_RES(fs, res);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
#if SPIFFS_CACHE_WR
spiffs_fflush_cache(fs, fh);
#endif
+ s32_t file_size = fd->size == SPIFFS_UNDEFINED_LEN ? 0 : fd->size;
+
switch (whence) {
case SPIFFS_SEEK_CUR:
offs = fd->fdoffset+offs;
break;
case SPIFFS_SEEK_END:
- offs = (fd->size == SPIFFS_UNDEFINED_LEN ? 0 : fd->size) + offs;
+ offs = file_size + offs;
break;
}
-
- if ((offs > (s32_t)fd->size) && (SPIFFS_UNDEFINED_LEN != fd->size)) {
+ if (offs < 0) {
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_SEEK_BOUNDS);
+ }
+ if (offs > file_size) {
+ fd->fdoffset = file_size;
res = SPIFFS_ERR_END_OF_OBJECT;
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- spiffs_span_ix data_spix = offs / SPIFFS_DATA_PAGE_SIZE(fs);
+ spiffs_span_ix data_spix = (offs > 0 ? (offs-1) : 0) / SPIFFS_DATA_PAGE_SIZE(fs);
spiffs_span_ix objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix);
if (fd->cursor_objix_spix != objix_spix) {
spiffs_page_ix pix;
@@ -610,19 +648,23 @@ s32_t SPIFFS_lseek(spiffs *fs, spiffs_file fh, s32_t offs, int whence) {
}
s32_t SPIFFS_remove(spiffs *fs, const char *path) {
+ SPIFFS_API_DBG("%s '%s'\n", __func__, path);
#if SPIFFS_READ_ONLY
(void)fs; (void)path;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
+ if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
+ SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
+ }
SPIFFS_LOCK(fs);
spiffs_fd *fd;
spiffs_page_ix pix;
s32_t res;
- res = spiffs_fd_find_new(fs, &fd);
+ res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)path, &pix);
@@ -649,6 +691,7 @@ s32_t SPIFFS_remove(spiffs *fs, const char *path) {
}
s32_t SPIFFS_fremove(spiffs *fs, spiffs_file fh) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd "\n", __func__, fh);
#if SPIFFS_READ_ONLY
(void)fs; (void)fh;
return SPIFFS_ERR_RO_NOT_IMPL;
@@ -663,7 +706,7 @@ s32_t SPIFFS_fremove(spiffs *fs, spiffs_file fh) {
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- if ((fd->flags & SPIFFS_WRONLY) == 0) {
+ if ((fd->flags & SPIFFS_O_WRONLY) == 0) {
res = SPIFFS_ERR_NOT_WRITABLE;
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
}
@@ -701,13 +744,20 @@ static s32_t spiffs_stat_pix(spiffs *fs, spiffs_page_ix pix, spiffs_file fh, spi
s->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size;
s->pix = pix;
strncpy((char *)s->name, (char *)objix_hdr.name, SPIFFS_OBJ_NAME_LEN);
+#if SPIFFS_OBJ_META_LEN
+ _SPIFFS_MEMCPY(s->meta, objix_hdr.meta, SPIFFS_OBJ_META_LEN);
+#endif
return res;
}
s32_t SPIFFS_stat(spiffs *fs, const char *path, spiffs_stat *s) {
+ SPIFFS_API_DBG("%s '%s'\n", __func__, path);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
+ if (strlen(path) > SPIFFS_OBJ_NAME_LEN - 1) {
+ SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
+ }
SPIFFS_LOCK(fs);
s32_t res;
@@ -724,6 +774,7 @@ s32_t SPIFFS_stat(spiffs *fs, const char *path, spiffs_stat *s) {
}
s32_t SPIFFS_fstat(spiffs *fs, spiffs_file fh, spiffs_stat *s) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd "\n", __func__, fh);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
SPIFFS_LOCK(fs);
@@ -759,13 +810,13 @@ static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh) {
res = spiffs_fd_get(fs, fh, &fd);
SPIFFS_API_CHECK_RES(fs, res);
- if ((fd->flags & SPIFFS_DIRECT) == 0) {
+ if ((fd->flags & SPIFFS_O_DIRECT) == 0) {
if (fd->cache_page == 0) {
// see if object id is associated with cache already
fd->cache_page = spiffs_cache_page_get_by_fd(fs, fd);
}
if (fd->cache_page) {
- SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page %i for fd %i:%04x, flush, offs:%i size:%i\n",
+ SPIFFS_CACHE_DBG("CACHE_WR_DUMP: dumping cache page "_SPIPRIi" for fd "_SPIPRIfd":"_SPIPRIid", flush, offs:"_SPIPRIi" size:"_SPIPRIi"\n",
fd->cache_page->ix, fd->file_nbr, fd->obj_id, fd->cache_page->offset, fd->cache_page->size);
res = spiffs_hydro_write(fs, fd,
spiffs_get_cache_page(fs, spiffs_get_cache(fs), fd->cache_page->ix),
@@ -783,6 +834,7 @@ static s32_t spiffs_fflush_cache(spiffs *fs, spiffs_file fh) {
#endif
s32_t SPIFFS_fflush(spiffs *fs, spiffs_file fh) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd "\n", __func__, fh);
(void)fh;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
@@ -799,6 +851,7 @@ s32_t SPIFFS_fflush(spiffs *fs, spiffs_file fh) {
}
s32_t SPIFFS_close(spiffs *fs, spiffs_file fh) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd "\n", __func__, fh);
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
@@ -818,22 +871,27 @@ s32_t SPIFFS_close(spiffs *fs, spiffs_file fh) {
return res;
}
-s32_t SPIFFS_rename(spiffs *fs, const char *old, const char *new) {
+s32_t SPIFFS_rename(spiffs *fs, const char *old_path, const char *new_path) {
+ SPIFFS_API_DBG("%s %s %s\n", __func__, old_path, new_path);
#if SPIFFS_READ_ONLY
- (void)fs; (void)old; (void)new;
+ (void)fs; (void)old_path; (void)new_path;
return SPIFFS_ERR_RO_NOT_IMPL;
#else
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
+ if (strlen(new_path) > SPIFFS_OBJ_NAME_LEN - 1 ||
+ strlen(old_path) > SPIFFS_OBJ_NAME_LEN - 1) {
+ SPIFFS_API_CHECK_RES(fs, SPIFFS_ERR_NAME_TOO_LONG);
+ }
SPIFFS_LOCK(fs);
spiffs_page_ix pix_old, pix_dummy;
spiffs_fd *fd;
- s32_t res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)old, &pix_old);
+ s32_t res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)old_path, &pix_old);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)new, &pix_dummy);
+ res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)new_path, &pix_dummy);
if (res == SPIFFS_ERR_NOT_FOUND) {
res = SPIFFS_OK;
} else if (res == SPIFFS_OK) {
@@ -841,7 +899,7 @@ s32_t SPIFFS_rename(spiffs *fs, const char *old, const char *new) {
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- res = spiffs_fd_find_new(fs, &fd);
+ res = spiffs_fd_find_new(fs, &fd, 0);
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
res = spiffs_object_open_by_page(fs, pix_old, fd, 0, 0);
@@ -850,7 +908,50 @@ s32_t SPIFFS_rename(spiffs *fs, const char *old, const char *new) {
}
SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
- res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, (const u8_t*)new,
+ res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, (const u8_t*)new_path,
+ 0, 0, &pix_dummy);
+#if SPIFFS_TEMPORAL_FD_CACHE
+ if (res == SPIFFS_OK) {
+ spiffs_fd_temporal_cache_rehash(fs, old_path, new_path);
+ }
+#endif
+
+ spiffs_fd_return(fs, fd->file_nbr);
+
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ SPIFFS_UNLOCK(fs);
+
+ return res;
+#endif // SPIFFS_READ_ONLY
+}
+
+#if SPIFFS_OBJ_META_LEN
+s32_t SPIFFS_update_meta(spiffs *fs, const char *name, const void *meta) {
+#if SPIFFS_READ_ONLY
+ (void)fs; (void)name; (void)meta;
+ return SPIFFS_ERR_RO_NOT_IMPL;
+#else
+ SPIFFS_API_CHECK_CFG(fs);
+ SPIFFS_API_CHECK_MOUNT(fs);
+ SPIFFS_LOCK(fs);
+
+ spiffs_page_ix pix, pix_dummy;
+ spiffs_fd *fd;
+
+ s32_t res = spiffs_object_find_object_index_header_by_name(fs, (const u8_t*)name, &pix);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ res = spiffs_fd_find_new(fs, &fd, 0);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ res = spiffs_object_open_by_page(fs, pix, fd, 0, 0);
+ if (res != SPIFFS_OK) {
+ spiffs_fd_return(fs, fd->file_nbr);
+ }
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, 0, meta,
0, &pix_dummy);
spiffs_fd_return(fs, fd->file_nbr);
@@ -863,7 +964,42 @@ s32_t SPIFFS_rename(spiffs *fs, const char *old, const char *new) {
#endif // SPIFFS_READ_ONLY
}
+s32_t SPIFFS_fupdate_meta(spiffs *fs, spiffs_file fh, const void *meta) {
+#if SPIFFS_READ_ONLY
+ (void)fs; (void)fh; (void)meta;
+ return SPIFFS_ERR_RO_NOT_IMPL;
+#else
+ SPIFFS_API_CHECK_CFG(fs);
+ SPIFFS_API_CHECK_MOUNT(fs);
+ SPIFFS_LOCK(fs);
+
+ s32_t res;
+ spiffs_fd *fd;
+ spiffs_page_ix pix_dummy;
+
+ fh = SPIFFS_FH_UNOFFS(fs, fh);
+ res = spiffs_fd_get(fs, fh, &fd);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ if ((fd->flags & SPIFFS_O_WRONLY) == 0) {
+ res = SPIFFS_ERR_NOT_WRITABLE;
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+ }
+
+ res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id, fd->objix_hdr_pix, 0, 0, meta,
+ 0, &pix_dummy);
+
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ SPIFFS_UNLOCK(fs);
+
+ return res;
+#endif // SPIFFS_READ_ONLY
+}
+#endif // SPIFFS_OBJ_META_LEN
+
spiffs_DIR *SPIFFS_opendir(spiffs *fs, const char *name, spiffs_DIR *d) {
+ SPIFFS_API_DBG("%s\n", __func__);
(void)name;
if (!SPIFFS_CHECK_CFG((fs))) {
@@ -903,7 +1039,7 @@ static s32_t spiffs_read_dir_v(
if (res != SPIFFS_OK) return res;
if ((obj_id & SPIFFS_OBJ_ID_IX_FLAG) &&
objix_hdr.p_hdr.span_ix == 0 &&
- (objix_hdr.p_hdr.flags& (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE)) ==
+ (objix_hdr.p_hdr.flags & (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE)) ==
(SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE)) {
struct spiffs_dirent *e = (struct spiffs_dirent*)user_var_p;
e->obj_id = obj_id;
@@ -911,13 +1047,16 @@ static s32_t spiffs_read_dir_v(
e->type = objix_hdr.type;
e->size = objix_hdr.size == SPIFFS_UNDEFINED_LEN ? 0 : objix_hdr.size;
e->pix = pix;
+#if SPIFFS_OBJ_META_LEN
+ _SPIFFS_MEMCPY(e->meta, objix_hdr.meta, SPIFFS_OBJ_META_LEN);
+#endif
return SPIFFS_OK;
}
-
return SPIFFS_VIS_COUNTINUE;
}
struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e) {
+ SPIFFS_API_DBG("%s\n", __func__);
if (!SPIFFS_CHECK_MOUNT(d->fs)) {
d->fs->err_code = SPIFFS_ERR_NOT_MOUNTED;
return 0;
@@ -942,6 +1081,7 @@ struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e) {
if (res == SPIFFS_OK) {
d->block = bix;
d->entry = entry + 1;
+ e->obj_id &= ~SPIFFS_OBJ_ID_IX_FLAG;
ret = e;
} else {
d->fs->err_code = res;
@@ -951,12 +1091,14 @@ struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e) {
}
s32_t SPIFFS_closedir(spiffs_DIR *d) {
+ SPIFFS_API_DBG("%s\n", __func__);
SPIFFS_API_CHECK_CFG(d->fs);
SPIFFS_API_CHECK_MOUNT(d->fs);
return 0;
}
s32_t SPIFFS_check(spiffs *fs) {
+ SPIFFS_API_DBG("%s\n", __func__);
#if SPIFFS_READ_ONLY
(void)fs;
return SPIFFS_ERR_RO_NOT_IMPL;
@@ -980,6 +1122,7 @@ s32_t SPIFFS_check(spiffs *fs) {
}
s32_t SPIFFS_info(spiffs *fs, u32_t *total, u32_t *used) {
+ SPIFFS_API_DBG("%s\n", __func__);
s32_t res = SPIFFS_OK;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
@@ -1004,6 +1147,7 @@ s32_t SPIFFS_info(spiffs *fs, u32_t *total, u32_t *used) {
}
s32_t SPIFFS_gc_quick(spiffs *fs, u16_t max_free_pages) {
+ SPIFFS_API_DBG("%s "_SPIPRIi "\n", __func__, max_free_pages);
#if SPIFFS_READ_ONLY
(void)fs; (void)max_free_pages;
return SPIFFS_ERR_RO_NOT_IMPL;
@@ -1023,6 +1167,7 @@ s32_t SPIFFS_gc_quick(spiffs *fs, u16_t max_free_pages) {
s32_t SPIFFS_gc(spiffs *fs, u32_t size) {
+ SPIFFS_API_DBG("%s "_SPIPRIi "\n", __func__, size);
#if SPIFFS_READ_ONLY
(void)fs; (void)size;
return SPIFFS_ERR_RO_NOT_IMPL;
@@ -1041,6 +1186,7 @@ s32_t SPIFFS_gc(spiffs *fs, u32_t size) {
}
s32_t SPIFFS_eof(spiffs *fs, spiffs_file fh) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd "\n", __func__, fh);
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
@@ -1064,6 +1210,7 @@ s32_t SPIFFS_eof(spiffs *fs, spiffs_file fh) {
}
s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd "\n", __func__, fh);
s32_t res;
SPIFFS_API_CHECK_CFG(fs);
SPIFFS_API_CHECK_MOUNT(fs);
@@ -1087,12 +1234,148 @@ s32_t SPIFFS_tell(spiffs *fs, spiffs_file fh) {
}
s32_t SPIFFS_set_file_callback_func(spiffs *fs, spiffs_file_callback cb_func) {
+ SPIFFS_API_DBG("%s\n", __func__);
SPIFFS_LOCK(fs);
fs->file_cb_f = cb_func;
SPIFFS_UNLOCK(fs);
return 0;
}
+#if SPIFFS_IX_MAP
+
+s32_t SPIFFS_ix_map(spiffs *fs, spiffs_file fh, spiffs_ix_map *map,
+ u32_t offset, u32_t len, spiffs_page_ix *map_buf) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd " "_SPIPRIi " "_SPIPRIi "\n", __func__, fh, offset, len);
+ s32_t res;
+ SPIFFS_API_CHECK_CFG(fs);
+ SPIFFS_API_CHECK_MOUNT(fs);
+ SPIFFS_LOCK(fs);
+
+ fh = SPIFFS_FH_UNOFFS(fs, fh);
+
+ spiffs_fd *fd;
+ res = spiffs_fd_get(fs, fh, &fd);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ if (fd->ix_map) {
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_IX_MAP_MAPPED);
+ }
+
+ map->map_buf = map_buf;
+ map->offset = offset;
+ // nb: spix range includes last
+ map->start_spix = offset / SPIFFS_DATA_PAGE_SIZE(fs);
+ map->end_spix = (offset + len) / SPIFFS_DATA_PAGE_SIZE(fs);
+ memset(map_buf, 0, sizeof(spiffs_page_ix) * (map->end_spix - map->start_spix + 1));
+ fd->ix_map = map;
+
+ // scan for pixes
+ res = spiffs_populate_ix_map(fs, fd, 0, map->end_spix - map->start_spix + 1);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ SPIFFS_UNLOCK(fs);
+ return res;
+}
+
+s32_t SPIFFS_ix_unmap(spiffs *fs, spiffs_file fh) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd "\n", __func__, fh);
+ s32_t res;
+ SPIFFS_API_CHECK_CFG(fs);
+ SPIFFS_API_CHECK_MOUNT(fs);
+ SPIFFS_LOCK(fs);
+
+ fh = SPIFFS_FH_UNOFFS(fs, fh);
+
+ spiffs_fd *fd;
+ res = spiffs_fd_get(fs, fh, &fd);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ if (fd->ix_map == 0) {
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_IX_MAP_UNMAPPED);
+ }
+
+ fd->ix_map = 0;
+
+ SPIFFS_UNLOCK(fs);
+ return res;
+}
+
+s32_t SPIFFS_ix_remap(spiffs *fs, spiffs_file fh, u32_t offset) {
+ SPIFFS_API_DBG("%s "_SPIPRIfd " "_SPIPRIi "\n", __func__, fh, offset);
+ s32_t res = SPIFFS_OK;
+ SPIFFS_API_CHECK_CFG(fs);
+ SPIFFS_API_CHECK_MOUNT(fs);
+ SPIFFS_LOCK(fs);
+
+ fh = SPIFFS_FH_UNOFFS(fs, fh);
+
+ spiffs_fd *fd;
+ res = spiffs_fd_get(fs, fh, &fd);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+
+ if (fd->ix_map == 0) {
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, SPIFFS_ERR_IX_MAP_UNMAPPED);
+ }
+
+ spiffs_ix_map *map = fd->ix_map;
+
+ s32_t spix_diff = offset / SPIFFS_DATA_PAGE_SIZE(fs) - map->start_spix;
+ map->offset = offset;
+
+ // move existing pixes if within map offs
+ if (spix_diff != 0) {
+ // move vector
+ int i;
+ const s32_t vec_len = map->end_spix - map->start_spix + 1; // spix range includes last
+ map->start_spix += spix_diff;
+ map->end_spix += spix_diff;
+ if (spix_diff >= vec_len) {
+ // moving beyond range
+ memset(&map->map_buf, 0, vec_len * sizeof(spiffs_page_ix));
+ // populate_ix_map is inclusive
+ res = spiffs_populate_ix_map(fs, fd, 0, vec_len-1);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+ } else if (spix_diff > 0) {
+ // diff positive
+ for (i = 0; i < vec_len - spix_diff; i++) {
+ map->map_buf[i] = map->map_buf[i + spix_diff];
+ }
+ // memset is non-inclusive
+ memset(&map->map_buf[vec_len - spix_diff], 0, spix_diff * sizeof(spiffs_page_ix));
+ // populate_ix_map is inclusive
+ res = spiffs_populate_ix_map(fs, fd, vec_len - spix_diff, vec_len-1);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+ } else {
+ // diff negative
+ for (i = vec_len - 1; i >= -spix_diff; i--) {
+ map->map_buf[i] = map->map_buf[i + spix_diff];
+ }
+ // memset is non-inclusive
+ memset(&map->map_buf[0], 0, -spix_diff * sizeof(spiffs_page_ix));
+ // populate_ix_map is inclusive
+ res = spiffs_populate_ix_map(fs, fd, 0, -spix_diff - 1);
+ SPIFFS_API_CHECK_RES_UNLOCK(fs, res);
+ }
+
+ }
+
+ SPIFFS_UNLOCK(fs);
+ return res;
+}
+
+s32_t SPIFFS_bytes_to_ix_map_entries(spiffs *fs, u32_t bytes) {
+ SPIFFS_API_CHECK_CFG(fs);
+ // always add one extra page, the offset might change to the middle of a page
+ return (bytes + SPIFFS_DATA_PAGE_SIZE(fs) ) / SPIFFS_DATA_PAGE_SIZE(fs);
+}
+
+s32_t SPIFFS_ix_map_entries_to_bytes(spiffs *fs, u32_t map_page_ix_entries) {
+ SPIFFS_API_CHECK_CFG(fs);
+ return map_page_ix_entries * SPIFFS_DATA_PAGE_SIZE(fs);
+}
+
+#endif // SPIFFS_IX_MAP
+
#if SPIFFS_TEST_VISUALISATION
s32_t SPIFFS_vis(spiffs *fs) {
s32_t res = SPIFFS_OK;
@@ -1118,7 +1401,7 @@ s32_t SPIFFS_vis(spiffs *fs) {
cur_entry - entry_offset < entries_per_page && cur_entry < (int)(SPIFFS_PAGES_PER_BLOCK(fs)-SPIFFS_OBJ_LOOKUP_PAGES(fs))) {
spiffs_obj_id obj_id = obj_lu_buf[cur_entry-entry_offset];
if (cur_entry == 0) {
- spiffs_printf("%4i ", bix);
+ spiffs_printf(_SPIPRIbl" ", bix);
} else if ((cur_entry & 0x3f) == 0) {
spiffs_printf(" ");
}
@@ -1146,7 +1429,7 @@ s32_t SPIFFS_vis(spiffs *fs) {
SPIFFS_CHECK_RES(res);
if (erase_count != (spiffs_obj_id)-1) {
- spiffs_printf("\tera_cnt: %i\n", erase_count);
+ spiffs_printf("\tera_cnt: "_SPIPRIi"\n", erase_count);
} else {
spiffs_printf("\tera_cnt: N/A\n");
}
@@ -1154,17 +1437,16 @@ s32_t SPIFFS_vis(spiffs *fs) {
bix++;
} // per block
- spiffs_printf("era_cnt_max: %i\n", fs->max_erase_count);
- spiffs_printf("last_errno: %i\n", fs->err_code);
- spiffs_printf("blocks: %i\n", fs->block_count);
- spiffs_printf("free_blocks: %i\n", fs->free_blocks);
- spiffs_printf("page_alloc: %i\n", fs->stats_p_allocated);
- spiffs_printf("page_delet: %i\n", fs->stats_p_deleted);
+ spiffs_printf("era_cnt_max: "_SPIPRIi"\n", fs->max_erase_count);
+ spiffs_printf("last_errno: "_SPIPRIi"\n", fs->err_code);
+ spiffs_printf("blocks: "_SPIPRIi"\n", fs->block_count);
+ spiffs_printf("free_blocks: "_SPIPRIi"\n", fs->free_blocks);
+ spiffs_printf("page_alloc: "_SPIPRIi"\n", fs->stats_p_allocated);
+ spiffs_printf("page_delet: "_SPIPRIi"\n", fs->stats_p_deleted);
+ SPIFFS_UNLOCK(fs);
u32_t total, used;
SPIFFS_info(fs, &total, &used);
- spiffs_printf("used: %i of %i\n", used, total);
-
- SPIFFS_UNLOCK(fs);
+ spiffs_printf("used: "_SPIPRIi" of "_SPIPRIi"\n", used, total);
return res;
}
#endif
diff --git a/cores/esp8266/spiffs/spiffs_nucleus.c b/cores/esp8266/spiffs/spiffs_nucleus.c
index 8a3c725306..27ecdff2a6 100644
--- a/cores/esp8266/spiffs/spiffs_nucleus.c
+++ b/cores/esp8266/spiffs/spiffs_nucleus.c
@@ -142,7 +142,7 @@ s32_t spiffs_obj_lu_find_entry_visitor(
int entries_per_page = (SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(spiffs_obj_id));
// wrap initial
- if (cur_entry >= (int)SPIFFS_OBJ_LOOKUP_MAX_ENTRIES(fs) - 1) {
+ if (cur_entry > (int)SPIFFS_OBJ_LOOKUP_MAX_ENTRIES(fs) - 1) {
cur_entry = 0;
cur_block++;
cur_block_addr = cur_block * SPIFFS_CFG_LOG_BLOCK_SZ(fs);
@@ -232,7 +232,7 @@ s32_t spiffs_erase_block(
// here we ignore res, just try erasing the block
while (size > 0) {
- SPIFFS_DBG("erase %08x:%08x\n", addr, SPIFFS_CFG_PHYS_ERASE_SZ(fs));
+ SPIFFS_DBG("erase "_SPIPRIad":"_SPIPRIi"\n", addr, SPIFFS_CFG_PHYS_ERASE_SZ(fs));
SPIFFS_HAL_ERASE(fs, addr, SPIFFS_CFG_PHYS_ERASE_SZ(fs));
addr += SPIFFS_CFG_PHYS_ERASE_SZ(fs);
@@ -270,7 +270,7 @@ s32_t spiffs_probe(
s32_t res;
u32_t paddr;
spiffs dummy_fs; // create a dummy fs struct just to be able to use macros
- memcpy(&dummy_fs.cfg, cfg, sizeof(spiffs_config));
+ _SPIFFS_MEMCPY(&dummy_fs.cfg, cfg, sizeof(spiffs_config));
dummy_fs.block_count = 0;
// Read three magics, as one block may be in an aborted erase state.
@@ -407,7 +407,7 @@ s32_t spiffs_obj_lu_scan(
#if SPIFFS_USE_MAGIC
if (unerased_bix != (spiffs_block_ix)-1) {
// found one unerased block, remedy
- SPIFFS_DBG("mount: erase block %i\n", bix);
+ SPIFFS_DBG("mount: erase block "_SPIPRIbl"\n", bix);
#if SPIFFS_READ_ONLY
res = SPIFFS_ERR_RO_ABORTED_OPERATION;
#else
@@ -467,7 +467,7 @@ s32_t spiffs_obj_lu_find_free(
SPIFFS_OBJ_ID_FREE, block_ix, lu_entry);
if (res == SPIFFS_OK) {
fs->free_cursor_block_ix = *block_ix;
- fs->free_cursor_obj_lu_entry = *lu_entry;
+ fs->free_cursor_obj_lu_entry = (*lu_entry) + 1;
if (*lu_entry == 0) {
fs->free_blocks--;
}
@@ -600,6 +600,152 @@ s32_t spiffs_obj_lu_find_id_and_span_by_phdr(
return res;
}
+#if SPIFFS_IX_MAP
+
+// update index map of given fd with given object index data
+static void spiffs_update_ix_map(spiffs *fs,
+ spiffs_fd *fd, spiffs_span_ix objix_spix, spiffs_page_object_ix *objix) {
+#if SPIFFS_SINGLETON
+ (void)fs;
+#endif
+ spiffs_ix_map *map = fd->ix_map;
+ spiffs_span_ix map_objix_start_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, map->start_spix);
+ spiffs_span_ix map_objix_end_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, map->end_spix);
+
+ // check if updated ix is within map range
+ if (objix_spix < map_objix_start_spix || objix_spix > map_objix_end_spix) {
+ return;
+ }
+
+ // update memory mapped page index buffer to new pages
+
+ // get range of updated object index map data span indices
+ spiffs_span_ix objix_data_spix_start =
+ SPIFFS_DATA_SPAN_IX_FOR_OBJ_IX_SPAN_IX(fs, objix_spix);
+ spiffs_span_ix objix_data_spix_end = objix_data_spix_start +
+ (objix_spix == 0 ? SPIFFS_OBJ_HDR_IX_LEN(fs) : SPIFFS_OBJ_IX_LEN(fs));
+
+ // calc union of object index range and index map range array
+ spiffs_span_ix map_spix = MAX(map->start_spix, objix_data_spix_start);
+ spiffs_span_ix map_spix_end = MIN(map->end_spix + 1, objix_data_spix_end);
+
+ while (map_spix < map_spix_end) {
+ spiffs_page_ix objix_data_pix;
+ if (objix_spix == 0) {
+ // get data page from object index header page
+ objix_data_pix = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix_header)))[map_spix];
+ } else {
+ // get data page from object index page
+ objix_data_pix = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, map_spix)];
+ }
+
+ if (objix_data_pix == (spiffs_page_ix)-1) {
+ // reached end of object, abort
+ break;
+ }
+
+ map->map_buf[map_spix - map->start_spix] = objix_data_pix;
+ SPIFFS_DBG("map "_SPIPRIid":"_SPIPRIsp" ("_SPIPRIsp"--"_SPIPRIsp") objix.spix:"_SPIPRIsp" to pix "_SPIPRIpg"\n",
+ fd->obj_id, map_spix - map->start_spix,
+ map->start_spix, map->end_spix,
+ objix->p_hdr.span_ix,
+ objix_data_pix);
+
+ map_spix++;
+ }
+}
+
+typedef struct {
+ spiffs_fd *fd;
+ u32_t remaining_objix_pages_to_visit;
+ spiffs_span_ix map_objix_start_spix;
+ spiffs_span_ix map_objix_end_spix;
+} spiffs_ix_map_populate_state;
+
+static s32_t spiffs_populate_ix_map_v(
+ spiffs *fs,
+ spiffs_obj_id obj_id,
+ spiffs_block_ix bix,
+ int ix_entry,
+ const void *user_const_p,
+ void *user_var_p) {
+ (void)user_const_p;
+ s32_t res;
+ spiffs_ix_map_populate_state *state = (spiffs_ix_map_populate_state *)user_var_p;
+ spiffs_page_ix pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, ix_entry);
+
+ // load header to check it
+ spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work;
+ res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ,
+ 0, SPIFFS_PAGE_TO_PADDR(fs, pix), sizeof(spiffs_page_object_ix), (u8_t *)objix);
+ SPIFFS_CHECK_RES(res);
+ SPIFFS_VALIDATE_OBJIX(objix->p_hdr, obj_id, objix->p_hdr.span_ix);
+
+ // check if hdr is ok, and if objix range overlap with ix map range
+ if ((objix->p_hdr.flags & (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE)) ==
+ (SPIFFS_PH_FLAG_DELET | SPIFFS_PH_FLAG_IXDELE) &&
+ objix->p_hdr.span_ix >= state->map_objix_start_spix &&
+ objix->p_hdr.span_ix <= state->map_objix_end_spix) {
+ // ok, load rest of object index
+ res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_LU2 | SPIFFS_OP_C_READ,
+ 0, SPIFFS_PAGE_TO_PADDR(fs, pix) + sizeof(spiffs_page_object_ix),
+ SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_object_ix),
+ (u8_t *)objix + sizeof(spiffs_page_object_ix));
+ SPIFFS_CHECK_RES(res);
+
+ spiffs_update_ix_map(fs, state->fd, objix->p_hdr.span_ix, objix);
+
+ state->remaining_objix_pages_to_visit--;
+ SPIFFS_DBG("map "_SPIPRIid" ("_SPIPRIsp"--"_SPIPRIsp") remaining objix pages "_SPIPRIi"\n",
+ state->fd->obj_id,
+ state->fd->ix_map->start_spix, state->fd->ix_map->end_spix,
+ state->remaining_objix_pages_to_visit);
+ }
+
+ if (res == SPIFFS_OK) {
+ res = state->remaining_objix_pages_to_visit ? SPIFFS_VIS_COUNTINUE : SPIFFS_VIS_END;
+ }
+ return res;
+}
+
+// populates index map, from vector entry start to vector entry end, inclusive
+s32_t spiffs_populate_ix_map(spiffs *fs, spiffs_fd *fd, u32_t vec_entry_start, u32_t vec_entry_end) {
+ s32_t res;
+ spiffs_ix_map *map = fd->ix_map;
+ spiffs_ix_map_populate_state state;
+ vec_entry_start = MIN((u32_t)(map->end_spix - map->start_spix), vec_entry_start);
+ vec_entry_end = MAX((u32_t)(map->end_spix - map->start_spix), vec_entry_end);
+ if (vec_entry_start > vec_entry_end) {
+ return SPIFFS_ERR_IX_MAP_BAD_RANGE;
+ }
+ state.map_objix_start_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, map->start_spix + vec_entry_start);
+ state.map_objix_end_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, map->start_spix + vec_entry_end);
+ state.remaining_objix_pages_to_visit =
+ state.map_objix_end_spix - state.map_objix_start_spix + 1;
+ state.fd = fd;
+
+ res = spiffs_obj_lu_find_entry_visitor(
+ fs,
+ SPIFFS_BLOCK_FOR_PAGE(fs, fd->objix_hdr_pix),
+ SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, fd->objix_hdr_pix),
+ SPIFFS_VIS_CHECK_ID,
+ fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG,
+ spiffs_populate_ix_map_v,
+ 0,
+ &state,
+ 0,
+ 0);
+
+ if (res == SPIFFS_VIS_END) {
+ res = SPIFFS_OK;
+ }
+
+ return res;
+}
+
+#endif
+
+
#if !SPIFFS_READ_ONLY
// Allocates a free defined page with given obj_id
// Occupies object lookup entry and page
@@ -761,7 +907,8 @@ s32_t spiffs_page_delete(
s32_t spiffs_object_create(
spiffs *fs,
spiffs_obj_id obj_id,
- const u8_t name[SPIFFS_OBJ_NAME_LEN],
+ const u8_t name[],
+ const u8_t meta[],
spiffs_obj_type type,
spiffs_page_ix *objix_hdr_pix) {
s32_t res = SPIFFS_OK;
@@ -777,7 +924,7 @@ s32_t spiffs_object_create(
// find free entry
res = spiffs_obj_lu_find_free(fs, fs->free_cursor_block_ix, fs->free_cursor_obj_lu_entry, &bix, &entry);
SPIFFS_CHECK_RES(res);
- SPIFFS_DBG("create: found free page @ %04x bix:%i entry:%i\n", SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), bix, entry);
+ SPIFFS_DBG("create: found free page @ "_SPIPRIpg" bix:"_SPIPRIbl" entry:"_SPIPRIsp"\n", (spiffs_page_ix)SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), bix, entry);
// occupy page in object lookup
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_LU | SPIFFS_OP_C_UPDT,
@@ -792,15 +939,24 @@ s32_t spiffs_object_create(
oix_hdr.p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_USED);
oix_hdr.type = type;
oix_hdr.size = SPIFFS_UNDEFINED_LEN; // keep ones so we can update later without wasting this page
- strncpy((char*)&oix_hdr.name, (const char*)name, SPIFFS_OBJ_NAME_LEN);
-
+ strncpy((char*)oix_hdr.name, (const char*)name, SPIFFS_OBJ_NAME_LEN);
+#if SPIFFS_OBJ_META_LEN
+ if (meta) {
+ _SPIFFS_MEMCPY(oix_hdr.meta, meta, SPIFFS_OBJ_META_LEN);
+ } else {
+ memset(oix_hdr.meta, 0xff, SPIFFS_OBJ_META_LEN);
+ }
+#else
+ (void) meta;
+#endif
// update page
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT,
0, SPIFFS_OBJ_LOOKUP_ENTRY_TO_PADDR(fs, bix, entry), sizeof(spiffs_page_object_ix_header), (u8_t*)&oix_hdr);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, 0, SPIFFS_EV_IX_NEW, obj_id, 0, SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), SPIFFS_UNDEFINED_LEN);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)&oix_hdr,
+ SPIFFS_EV_IX_NEW, obj_id, 0, SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry), SPIFFS_UNDEFINED_LEN);
if (objix_hdr_pix) {
*objix_hdr_pix = SPIFFS_OBJ_LOOKUP_ENTRY_TO_PIX(fs, bix, entry);
@@ -821,7 +977,8 @@ s32_t spiffs_object_update_index_hdr(
spiffs_obj_id obj_id,
spiffs_page_ix objix_hdr_pix,
u8_t *new_objix_hdr_data,
- const u8_t name[SPIFFS_OBJ_NAME_LEN],
+ const u8_t name[],
+ const u8_t meta[],
u32_t size,
spiffs_page_ix *new_pix) {
s32_t res = SPIFFS_OK;
@@ -847,6 +1004,13 @@ s32_t spiffs_object_update_index_hdr(
if (name) {
strncpy((char*)objix_hdr->name, (const char*)name, SPIFFS_OBJ_NAME_LEN);
}
+#if SPIFFS_OBJ_META_LEN
+ if (meta) {
+ _SPIFFS_MEMCPY(objix_hdr->meta, meta, SPIFFS_OBJ_META_LEN);
+ }
+#else
+ (void) meta;
+#endif
if (size) {
objix_hdr->size = size;
}
@@ -859,7 +1023,9 @@ s32_t spiffs_object_update_index_hdr(
*new_pix = new_objix_hdr_pix;
}
// callback on object index update
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, obj_id, objix_hdr->p_hdr.span_ix, new_objix_hdr_pix, objix_hdr->size);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)objix_hdr,
+ new_objix_hdr_data ? SPIFFS_EV_IX_UPD : SPIFFS_EV_IX_UPD_HDR,
+ obj_id, objix_hdr->p_hdr.span_ix, new_objix_hdr_pix, objix_hdr->size);
if (fd) fd->objix_hdr_pix = new_objix_hdr_pix; // if this is not in the registered cluster
}
@@ -869,53 +1035,110 @@ s32_t spiffs_object_update_index_hdr(
void spiffs_cb_object_event(
spiffs *fs,
- spiffs_fd *fd,
+ spiffs_page_object_ix *objix,
int ev,
spiffs_obj_id obj_id_raw,
spiffs_span_ix spix,
spiffs_page_ix new_pix,
u32_t new_size) {
- (void)fd;
+#if SPIFFS_IX_MAP == 0
+ (void)objix;
+#endif
// update index caches in all file descriptors
spiffs_obj_id obj_id = obj_id_raw & ~SPIFFS_OBJ_ID_IX_FLAG;
u32_t i;
spiffs_fd *fds = (spiffs_fd *)fs->fd_space;
+ SPIFFS_DBG(" CALLBACK %s obj_id:"_SPIPRIid" spix:"_SPIPRIsp" npix:"_SPIPRIpg" nsz:"_SPIPRIi"\n", (const char *[]){"UPD", "NEW", "DEL", "MOV", "HUP","???"}[MIN(ev,5)],
+ obj_id_raw, spix, new_pix, new_size);
for (i = 0; i < fs->fd_count; i++) {
spiffs_fd *cur_fd = &fds[i];
- if (cur_fd->file_nbr == 0 || (cur_fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG) != obj_id) continue;
- if (spix == 0) {
- if (ev == SPIFFS_EV_IX_NEW || ev == SPIFFS_EV_IX_UPD) {
- SPIFFS_DBG(" callback: setting fd %i:%04x objix_hdr_pix to %04x, size:%i\n", cur_fd->file_nbr, cur_fd->obj_id, new_pix, new_size);
+ if ((cur_fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG) != obj_id) continue; // fd not related to updated file
+#if !SPIFFS_TEMPORAL_FD_CACHE
+ if (cur_fd->file_nbr == 0) continue; // fd closed
+#endif
+ if (spix == 0) { // object index header update
+ if (ev != SPIFFS_EV_IX_DEL) {
+#if SPIFFS_TEMPORAL_FD_CACHE
+ if (cur_fd->score == 0) continue; // never used fd
+#endif
+ SPIFFS_DBG(" callback: setting fd "_SPIPRIfd":"_SPIPRIid"(fdoffs:"_SPIPRIi" offs:"_SPIPRIi") objix_hdr_pix to "_SPIPRIpg", size:"_SPIPRIi"\n",
+ SPIFFS_FH_OFFS(fs, cur_fd->file_nbr), cur_fd->obj_id, cur_fd->fdoffset, cur_fd->offset, new_pix, new_size);
cur_fd->objix_hdr_pix = new_pix;
if (new_size != 0) {
+ // update size and offsets for fds to this file
cur_fd->size = new_size;
+ u32_t act_new_size = new_size == SPIFFS_UNDEFINED_LEN ? 0 : new_size;
+#if SPIFFS_CACHE_WR
+ if (act_new_size > 0 && cur_fd->cache_page) {
+ act_new_size = MAX(act_new_size, cur_fd->cache_page->offset + cur_fd->cache_page->size);
+ }
+#endif
+ if (cur_fd->offset > act_new_size) {
+ cur_fd->offset = act_new_size;
+ }
+ if (cur_fd->fdoffset > act_new_size) {
+ cur_fd->fdoffset = act_new_size;
+ }
+#if SPIFFS_CACHE_WR
+ if (cur_fd->cache_page && cur_fd->cache_page->offset > act_new_size+1) {
+ SPIFFS_CACHE_DBG("CACHE_DROP: file trunced, dropping cache page "_SPIPRIi", no writeback\n", cur_fd->cache_page->ix);
+ spiffs_cache_fd_release(fs, cur_fd->cache_page);
+ }
+#endif
}
- } else if (ev == SPIFFS_EV_IX_DEL) {
+ } else {
+ // removing file
+#if SPIFFS_CACHE_WR
+ if (cur_fd->file_nbr && cur_fd->cache_page) {
+ SPIFFS_CACHE_DBG("CACHE_DROP: file deleted, dropping cache page "_SPIPRIi", no writeback\n", cur_fd->cache_page->ix);
+ spiffs_cache_fd_release(fs, cur_fd->cache_page);
+ }
+#endif
+ SPIFFS_DBG(" callback: release fd "_SPIPRIfd":"_SPIPRIid" span:"_SPIPRIsp" objix_pix to "_SPIPRIpg"\n", SPIFFS_FH_OFFS(fs, cur_fd->file_nbr), cur_fd->obj_id, spix, new_pix);
cur_fd->file_nbr = 0;
cur_fd->obj_id = SPIFFS_OBJ_ID_DELETED;
}
- }
+ } // object index header update
if (cur_fd->cursor_objix_spix == spix) {
- if (ev == SPIFFS_EV_IX_NEW || ev == SPIFFS_EV_IX_UPD) {
- SPIFFS_DBG(" callback: setting fd %i:%04x span:%04x objix_pix to %04x\n", cur_fd->file_nbr, cur_fd->obj_id, spix, new_pix);
+ if (ev != SPIFFS_EV_IX_DEL) {
+ SPIFFS_DBG(" callback: setting fd "_SPIPRIfd":"_SPIPRIid" span:"_SPIPRIsp" objix_pix to "_SPIPRIpg"\n", SPIFFS_FH_OFFS(fs, cur_fd->file_nbr), cur_fd->obj_id, spix, new_pix);
cur_fd->cursor_objix_pix = new_pix;
} else {
cur_fd->cursor_objix_pix = 0;
}
}
+ } // fd update loop
+
+#if SPIFFS_IX_MAP
+
+ // update index maps
+ if (ev == SPIFFS_EV_IX_UPD || ev == SPIFFS_EV_IX_NEW) {
+ for (i = 0; i < fs->fd_count; i++) {
+ spiffs_fd *cur_fd = &fds[i];
+ // check fd opened, having ix map, match obj id
+ if (cur_fd->file_nbr == 0 ||
+ cur_fd->ix_map == 0 ||
+ (cur_fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG) != obj_id) continue;
+ SPIFFS_DBG(" callback: map ix update fd "_SPIPRIfd":"_SPIPRIid" span:"_SPIPRIsp"\n", SPIFFS_FH_OFFS(fs, cur_fd->file_nbr), cur_fd->obj_id, spix);
+ spiffs_update_ix_map(fs, cur_fd, spix, objix);
+ }
}
+#endif
+
// callback to user if object index header
if (fs->file_cb_f && spix == 0 && (obj_id_raw & SPIFFS_OBJ_ID_IX_FLAG)) {
spiffs_fileop_type op;
if (ev == SPIFFS_EV_IX_NEW) {
op = SPIFFS_CB_CREATED;
- } else if (ev == SPIFFS_EV_IX_UPD) {
+ } else if (ev == SPIFFS_EV_IX_UPD ||
+ ev == SPIFFS_EV_IX_MOV ||
+ ev == SPIFFS_EV_IX_UPD_HDR) {
op = SPIFFS_CB_UPDATED;
} else if (ev == SPIFFS_EV_IX_DEL) {
op = SPIFFS_CB_DELETED;
} else {
- SPIFFS_DBG(" callback: WARNING unknown callback event %02x\n", ev);
+ SPIFFS_DBG(" callback: WARNING unknown callback event "_SPIPRIi"\n", ev);
return; // bail out
}
fs->file_cb_f(fs, op, obj_id, new_pix);
@@ -973,7 +1196,7 @@ s32_t spiffs_object_open_by_page(
SPIFFS_VALIDATE_OBJIX(oix_hdr.p_hdr, fd->obj_id, 0);
- SPIFFS_DBG("open: fd %i is obj id %04x\n", fd->file_nbr, fd->obj_id);
+ SPIFFS_DBG("open: fd "_SPIPRIfd" is obj id "_SPIPRIid"\n", SPIFFS_FH_OFFS(fs, fd->file_nbr), fd->obj_id);
return res;
}
@@ -986,7 +1209,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
s32_t res = SPIFFS_OK;
u32_t written = 0;
- SPIFFS_DBG("append: %i bytes @ offs %i of size %i\n", len, offset, fd->size);
+ SPIFFS_DBG("append: "_SPIPRIi" bytes @ offs "_SPIPRIi" of size "_SPIPRIi"\n", len, offset, fd->size);
if (offset > fd->size) {
SPIFFS_DBG("append: offset reversed to size\n");
@@ -995,7 +1218,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
res = spiffs_gc_check(fs, len + SPIFFS_DATA_PAGE_SIZE(fs)); // add an extra page of data worth for meta
if (res != SPIFFS_OK) {
- SPIFFS_DBG("append: gc check fail %i\n", res);
+ SPIFFS_DBG("append: gc check fail "_SPIPRIi"\n", res);
}
SPIFFS_CHECK_RES(res);
@@ -1023,7 +1246,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
// within this clause we return directly if something fails, object index mess-up
if (written > 0) {
// store previous object index page, unless first pass
- SPIFFS_DBG("append: %04x store objix %04x:%04x, written %i\n", fd->obj_id,
+ SPIFFS_DBG("append: "_SPIPRIid" store objix "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", fd->obj_id,
cur_objix_pix, prev_objix_spix, written);
if (prev_objix_spix == 0) {
// this is an update to object index header page
@@ -1038,9 +1261,9 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
} else {
// was a nonempty object, update to new page
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, fs->work, 0, offset+written, &new_objix_hdr_page);
+ fd->objix_hdr_pix, fs->work, 0, 0, offset+written, &new_objix_hdr_page);
SPIFFS_CHECK_RES(res);
- SPIFFS_DBG("append: %04x store new objix_hdr, %04x:%04x, written %i\n", fd->obj_id,
+ SPIFFS_DBG("append: "_SPIPRIid" store new objix_hdr, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", fd->obj_id,
new_objix_hdr_page, 0, written);
}
} else {
@@ -1051,12 +1274,13 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD,fd->obj_id, objix->p_hdr.span_ix, cur_objix_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)fs->work,
+ SPIFFS_EV_IX_UPD,fd->obj_id, objix->p_hdr.span_ix, cur_objix_pix, 0);
// update length in object index header page
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, 0, 0, offset+written, &new_objix_hdr_page);
+ fd->objix_hdr_pix, 0, 0, 0, offset+written, &new_objix_hdr_page);
SPIFFS_CHECK_RES(res);
- SPIFFS_DBG("append: %04x store new size I %i in objix_hdr, %04x:%04x, written %i\n", fd->obj_id,
+ SPIFFS_DBG("append: "_SPIPRIid" store new size I "_SPIPRIi" in objix_hdr, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", fd->obj_id,
offset+written, new_objix_hdr_page, 0, written);
}
fd->size = offset+written;
@@ -1066,7 +1290,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
// create or load new object index page
if (cur_objix_spix == 0) {
// load object index header page, must always exist
- SPIFFS_DBG("append: %04x load objixhdr page %04x:%04x\n", fd->obj_id, cur_objix_pix, cur_objix_spix);
+ SPIFFS_DBG("append: "_SPIPRIid" load objixhdr page "_SPIPRIpg":"_SPIPRIsp"\n", fd->obj_id, cur_objix_pix, cur_objix_spix);
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
@@ -1081,23 +1305,24 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
res = spiffs_page_allocate_data(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG,
&p_hdr, 0, 0, 0, 1, &cur_objix_pix);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_NEW, fd->obj_id, cur_objix_spix, cur_objix_pix, 0);
// quick "load" of new object index page
memset(fs->work, 0xff, SPIFFS_CFG_LOG_PAGE_SZ(fs));
- memcpy(fs->work, &p_hdr, sizeof(spiffs_page_header));
- SPIFFS_DBG("append: %04x create objix page, %04x:%04x, written %i\n", fd->obj_id
+ _SPIFFS_MEMCPY(fs->work, &p_hdr, sizeof(spiffs_page_header));
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)fs->work,
+ SPIFFS_EV_IX_NEW, fd->obj_id, cur_objix_spix, cur_objix_pix, 0);
+ SPIFFS_DBG("append: "_SPIPRIid" create objix page, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", fd->obj_id
, cur_objix_pix, cur_objix_spix, written);
} else {
// on first pass, we load existing object index page
spiffs_page_ix pix;
- SPIFFS_DBG("append: %04x find objix span_ix:%04x\n", fd->obj_id, cur_objix_spix);
+ SPIFFS_DBG("append: "_SPIPRIid" find objix span_ix:"_SPIPRIsp"\n", fd->obj_id, cur_objix_spix);
if (fd->cursor_objix_spix == cur_objix_spix) {
pix = fd->cursor_objix_pix;
} else {
res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &pix);
SPIFFS_CHECK_RES(res);
}
- SPIFFS_DBG("append: %04x found object index at page %04x [fd size %i]\n", fd->obj_id, pix, fd->size);
+ SPIFFS_DBG("append: "_SPIPRIid" found object index at page "_SPIPRIpg" [fd size "_SPIPRIi"]\n", fd->obj_id, pix, fd->size);
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
@@ -1121,7 +1346,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
p_hdr.flags = 0xff & ~(SPIFFS_PH_FLAG_FINAL); // finalize immediately
res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG,
&p_hdr, &data[written], to_write, page_offs, 1, &data_page);
- SPIFFS_DBG("append: %04x store new data page, %04x:%04x offset:%i, len %i, written %i\n", fd->obj_id,
+ SPIFFS_DBG("append: "_SPIPRIid" store new data page, "_SPIPRIpg":"_SPIPRIsp" offset:"_SPIPRIi", len "_SPIPRIi", written "_SPIPRIi"\n", fd->obj_id,
data_page, data_spix, page_offs, to_write, written);
} else {
// append to existing page, fill out free data in existing page
@@ -1138,7 +1363,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_DA | SPIFFS_OP_C_UPDT,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, data_page) + sizeof(spiffs_page_header) + page_offs, to_write, &data[written]);
- SPIFFS_DBG("append: %04x store to existing data page, %04x:%04x offset:%i, len %i, written %i\n", fd->obj_id
+ SPIFFS_DBG("append: "_SPIPRIid" store to existing data page, "_SPIPRIpg":"_SPIPRIsp" offset:"_SPIPRIi", len "_SPIPRIi", written "_SPIPRIi"\n", fd->obj_id
, data_page, data_spix, page_offs, to_write, written);
}
@@ -1148,14 +1373,14 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
if (cur_objix_spix == 0) {
// update object index header page
((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix] = data_page;
- SPIFFS_DBG("append: %04x wrote page %04x to objix_hdr entry %02x in mem\n", fd->obj_id
+ SPIFFS_DBG("append: "_SPIPRIid" wrote page "_SPIPRIpg" to objix_hdr entry "_SPIPRIsp" in mem\n", fd->obj_id
, data_page, data_spix);
objix_hdr->size = offset+written;
} else {
// update object index page
((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = data_page;
- SPIFFS_DBG("append: %04x wrote page %04x to objix entry %02x in mem\n", fd->obj_id
- , data_page, SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
+ SPIFFS_DBG("append: "_SPIPRIid" wrote page "_SPIPRIpg" to objix entry "_SPIPRIsp" in mem\n", fd->obj_id
+ , data_page, (spiffs_span_ix)SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
}
// update internals
@@ -1174,7 +1399,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
if (cur_objix_spix != 0) {
// wrote beyond object index header page
// write last modified object index page, unless object header index page
- SPIFFS_DBG("append: %04x store objix page, %04x:%04x, written %i\n", fd->obj_id,
+ SPIFFS_DBG("append: "_SPIPRIid" store objix page, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", fd->obj_id,
cur_objix_pix, cur_objix_spix, written);
res2 = spiffs_page_index_check(fs, fd, cur_objix_pix, cur_objix_spix);
@@ -1183,12 +1408,13 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
res2 = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res2);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, cur_objix_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)fs->work,
+ SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, cur_objix_pix, 0);
// update size in object header index page
res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, 0, 0, offset+written, &new_objix_hdr_page);
- SPIFFS_DBG("append: %04x store new size II %i in objix_hdr, %04x:%04x, written %i, res %i\n", fd->obj_id
+ fd->objix_hdr_pix, 0, 0, 0, offset+written, &new_objix_hdr_page);
+ SPIFFS_DBG("append: "_SPIPRIid" store new size II "_SPIPRIi" in objix_hdr, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi", res "_SPIPRIi"\n", fd->obj_id
, offset+written, new_objix_hdr_page, 0, written, res2);
SPIFFS_CHECK_RES(res2);
} else {
@@ -1196,7 +1422,7 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
if (offset == 0) {
// wrote to empty object - simply update size and write whole page
objix_hdr->size = offset+written;
- SPIFFS_DBG("append: %04x store fresh objix_hdr page, %04x:%04x, written %i\n", fd->obj_id
+ SPIFFS_DBG("append: "_SPIPRIid" store fresh objix_hdr page, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", fd->obj_id
, cur_objix_pix, cur_objix_spix, written);
res2 = spiffs_page_index_check(fs, fd, cur_objix_pix, cur_objix_spix);
@@ -1206,12 +1432,13 @@ s32_t spiffs_object_append(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res2);
// callback on object index update
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix_hdr->p_hdr.span_ix, cur_objix_pix, objix_hdr->size);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)fs->work,
+ SPIFFS_EV_IX_UPD_HDR, fd->obj_id, objix_hdr->p_hdr.span_ix, cur_objix_pix, objix_hdr->size);
} else {
// modifying object index header page, update size and make new copy
res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, fs->work, 0, offset+written, &new_objix_hdr_page);
- SPIFFS_DBG("append: %04x store modified objix_hdr page, %04x:%04x, written %i\n", fd->obj_id
+ fd->objix_hdr_pix, fs->work, 0, 0, offset+written, &new_objix_hdr_page);
+ SPIFFS_DBG("append: "_SPIPRIid" store modified objix_hdr page, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", fd->obj_id
, new_objix_hdr_page, 0, written);
SPIFFS_CHECK_RES(res2);
}
@@ -1260,8 +1487,8 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
if (prev_objix_spix == 0) {
// store previous object index header page
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, fs->work, 0, 0, &new_objix_hdr_pix);
- SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %i\n", new_objix_hdr_pix, 0, written);
+ fd->objix_hdr_pix, fs->work, 0, 0, 0, &new_objix_hdr_pix);
+ SPIFFS_DBG("modify: store modified objix_hdr page, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", new_objix_hdr_pix, 0, written);
SPIFFS_CHECK_RES(res);
} else {
// store new version of previous object index page
@@ -1271,16 +1498,17 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
SPIFFS_CHECK_RES(res);
res = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix, fd->obj_id, 0, cur_objix_pix, &new_objix_pix);
- SPIFFS_DBG("modify: store previous modified objix page, %04x:%04x, written %i\n", new_objix_pix, objix->p_hdr.span_ix, written);
+ SPIFFS_DBG("modify: store previous modified objix page, "_SPIPRIid":"_SPIPRIsp", written "_SPIPRIi"\n", new_objix_pix, objix->p_hdr.span_ix, written);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)objix,
+ SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
}
}
// load next object index page
if (cur_objix_spix == 0) {
// load object index header page, must exist
- SPIFFS_DBG("modify: load objixhdr page %04x:%04x\n", cur_objix_pix, cur_objix_spix);
+ SPIFFS_DBG("modify: load objixhdr page "_SPIPRIpg":"_SPIPRIsp"\n", cur_objix_pix, cur_objix_spix);
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, cur_objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
@@ -1288,14 +1516,14 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
} else {
// load existing object index page on first pass
spiffs_page_ix pix;
- SPIFFS_DBG("modify: find objix span_ix:%04x\n", cur_objix_spix);
+ SPIFFS_DBG("modify: find objix span_ix:"_SPIPRIsp"\n", cur_objix_spix);
if (fd->cursor_objix_spix == cur_objix_spix) {
pix = fd->cursor_objix_pix;
} else {
res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &pix);
SPIFFS_CHECK_RES(res);
}
- SPIFFS_DBG("modify: found object index at page %04x\n", pix);
+ SPIFFS_DBG("modify: found object index at page "_SPIPRIpg"\n", pix);
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
@@ -1326,7 +1554,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
// a full page, allocate and write a new page of data
res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG,
&p_hdr, &data[written], to_write, page_offs, 1, &data_pix);
- SPIFFS_DBG("modify: store new data page, %04x:%04x offset:%i, len %i, written %i\n", data_pix, data_spix, page_offs, to_write, written);
+ SPIFFS_DBG("modify: store new data page, "_SPIPRIpg":"_SPIPRIsp" offset:"_SPIPRIi", len "_SPIPRIi", written "_SPIPRIi"\n", data_pix, data_spix, page_offs, to_write, written);
} else {
// write to existing page, allocate new and copy unmodified data
@@ -1367,7 +1595,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
(u8_t *)&p_hdr.flags);
if (res != SPIFFS_OK) break;
- SPIFFS_DBG("modify: store to existing data page, src:%04x, dst:%04x:%04x offset:%i, len %i, written %i\n", orig_data_pix, data_pix, data_spix, page_offs, to_write, written);
+ SPIFFS_DBG("modify: store to existing data page, src:"_SPIPRIpg", dst:"_SPIPRIpg":"_SPIPRIsp" offset:"_SPIPRIi", len "_SPIPRIi", written "_SPIPRIi"\n", orig_data_pix, data_pix, data_spix, page_offs, to_write, written);
}
// delete original data page
@@ -1377,11 +1605,11 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
if (cur_objix_spix == 0) {
// update object index header page
((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix] = data_pix;
- SPIFFS_DBG("modify: wrote page %04x to objix_hdr entry %02x in mem\n", data_pix, data_spix);
+ SPIFFS_DBG("modify: wrote page "_SPIPRIpg" to objix_hdr entry "_SPIPRIsp" in mem\n", data_pix, data_spix);
} else {
// update object index page
((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = data_pix;
- SPIFFS_DBG("modify: wrote page %04x to objix entry %02x in mem\n", data_pix, SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
+ SPIFFS_DBG("modify: wrote page "_SPIPRIpg" to objix entry "_SPIPRIsp" in mem\n", data_pix, (spiffs_span_ix)SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
}
// update internals
@@ -1406,17 +1634,18 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
SPIFFS_CHECK_RES(res2);
res2 = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix, fd->obj_id, 0, cur_objix_pix, &new_objix_pix);
- SPIFFS_DBG("modify: store modified objix page, %04x:%04x, written %i\n", new_objix_pix, cur_objix_spix, written);
+ SPIFFS_DBG("modify: store modified objix page, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", new_objix_pix, cur_objix_spix, written);
fd->cursor_objix_pix = new_objix_pix;
fd->cursor_objix_spix = cur_objix_spix;
SPIFFS_CHECK_RES(res2);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)objix,
+ SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
} else {
// wrote within object index header page
res2 = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, fs->work, 0, 0, &new_objix_hdr_pix);
- SPIFFS_DBG("modify: store modified objix_hdr page, %04x:%04x, written %i\n", new_objix_hdr_pix, 0, written);
+ fd->objix_hdr_pix, fs->work, 0, 0, 0, &new_objix_hdr_pix);
+ SPIFFS_DBG("modify: store modified objix_hdr page, "_SPIPRIpg":"_SPIPRIsp", written "_SPIPRIi"\n", new_objix_hdr_pix, 0, written);
SPIFFS_CHECK_RES(res2);
}
@@ -1493,18 +1722,20 @@ s32_t spiffs_object_find_object_index_header_by_name(
s32_t spiffs_object_truncate(
spiffs_fd *fd,
u32_t new_size,
- u8_t remove) {
+ u8_t remove_full) {
s32_t res = SPIFFS_OK;
spiffs *fs = fd->fs;
- if ((fd->size == SPIFFS_UNDEFINED_LEN || fd->size == 0) && !remove) {
+ if ((fd->size == SPIFFS_UNDEFINED_LEN || fd->size == 0) && !remove_full) {
// no op
return res;
}
// need 2 pages if not removing: object index page + possibly chopped data page
- res = spiffs_gc_check(fs, remove ? 0 : SPIFFS_DATA_PAGE_SIZE(fs) * 2);
- SPIFFS_CHECK_RES(res);
+ if (remove_full == 0) {
+ res = spiffs_gc_check(fs, SPIFFS_DATA_PAGE_SIZE(fs) * 2);
+ SPIFFS_CHECK_RES(res);
+ }
spiffs_page_ix objix_pix = fd->objix_hdr_pix;
spiffs_span_ix data_spix = (fd->size > 0 ? fd->size-1 : 0) / SPIFFS_DATA_PAGE_SIZE(fs);
@@ -1517,7 +1748,7 @@ s32_t spiffs_object_truncate(
spiffs_page_ix new_objix_hdr_pix;
// before truncating, check if object is to be fully removed and mark this
- if (remove && new_size == 0) {
+ if (remove_full && new_size == 0) {
u8_t flags = ~( SPIFFS_PH_FLAG_USED | SPIFFS_PH_FLAG_INDEX | SPIFFS_PH_FLAG_FINAL | SPIFFS_PH_FLAG_IXDELE);
res = _spiffs_wr(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_UPDT,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, fd->objix_hdr_pix) + offsetof(spiffs_page_header, flags),
@@ -1534,20 +1765,28 @@ s32_t spiffs_object_truncate(
if (prev_objix_spix != cur_objix_spix) {
if (prev_objix_spix != (spiffs_span_ix)-1) {
// remove previous object index page
- SPIFFS_DBG("truncate: delete objix page %04x:%04x\n", objix_pix, prev_objix_spix);
+ SPIFFS_DBG("truncate: delete objix page "_SPIPRIpg":"_SPIPRIsp"\n", objix_pix, prev_objix_spix);
res = spiffs_page_index_check(fs, fd, objix_pix, prev_objix_spix);
SPIFFS_CHECK_RES(res);
res = spiffs_page_delete(fs, objix_pix);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_DEL, fd->obj_id, objix->p_hdr.span_ix, objix_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)0,
+ SPIFFS_EV_IX_DEL, fd->obj_id, objix->p_hdr.span_ix, objix_pix, 0);
if (prev_objix_spix > 0) {
- // update object index header page
- SPIFFS_DBG("truncate: update objix hdr page %04x:%04x to size %i\n", fd->objix_hdr_pix, prev_objix_spix, cur_size);
- res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, 0, 0, cur_size, &new_objix_hdr_pix);
- SPIFFS_CHECK_RES(res);
+ // Update object index header page, unless we totally want to remove the file.
+ // If fully removing, we're not keeping consistency as good as when storing the header between chunks,
+ // would we be aborted. But when removing full files, a crammed system may otherwise
+ // report ERR_FULL a la windows. We cannot have that.
+ // Hence, take the risk - if aborted, a file check would free the lost pages and mend things
+ // as the file is marked as fully deleted in the beginning.
+ if (remove_full == 0) {
+ SPIFFS_DBG("truncate: update objix hdr page "_SPIPRIpg":"_SPIPRIsp" to size "_SPIPRIi"\n", fd->objix_hdr_pix, prev_objix_spix, cur_size);
+ res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
+ fd->objix_hdr_pix, 0, 0, 0, cur_size, &new_objix_hdr_pix);
+ SPIFFS_CHECK_RES(res);
+ }
fd->size = cur_size;
}
}
@@ -1559,7 +1798,7 @@ s32_t spiffs_object_truncate(
SPIFFS_CHECK_RES(res);
}
- SPIFFS_DBG("truncate: load objix page %04x:%04x for data spix:%04x\n", objix_pix, cur_objix_spix, data_spix);
+ SPIFFS_DBG("truncate: load objix page "_SPIPRIpg":"_SPIPRIsp" for data spix:"_SPIPRIsp"\n", objix_pix, cur_objix_spix, data_spix);
res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
@@ -1581,20 +1820,20 @@ s32_t spiffs_object_truncate(
((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = SPIFFS_OBJ_ID_FREE;
}
- SPIFFS_DBG("truncate: got data pix %04x\n", data_pix);
+ SPIFFS_DBG("truncate: got data pix "_SPIPRIpg"\n", data_pix);
- if (new_size == 0 || remove || cur_size - new_size >= SPIFFS_DATA_PAGE_SIZE(fs)) {
+ if (new_size == 0 || remove_full || cur_size - new_size >= SPIFFS_DATA_PAGE_SIZE(fs)) {
// delete full data page
res = spiffs_page_data_check(fs, fd, data_pix, data_spix);
if (res != SPIFFS_ERR_DELETED && res != SPIFFS_OK && res != SPIFFS_ERR_INDEX_REF_FREE) {
- SPIFFS_DBG("truncate: err validating data pix %i\n", res);
+ SPIFFS_DBG("truncate: err validating data pix "_SPIPRIi"\n", res);
break;
}
if (res == SPIFFS_OK) {
res = spiffs_page_delete(fs, data_pix);
if (res != SPIFFS_OK) {
- SPIFFS_DBG("truncate: err deleting data pix %i\n", res);
+ SPIFFS_DBG("truncate: err deleting data pix "_SPIPRIi"\n", res);
break;
}
} else if (res == SPIFFS_ERR_DELETED || res == SPIFFS_ERR_INDEX_REF_FREE) {
@@ -1609,13 +1848,13 @@ s32_t spiffs_object_truncate(
}
fd->size = cur_size;
fd->offset = cur_size;
- SPIFFS_DBG("truncate: delete data page %04x for data spix:%04x, cur_size:%i\n", data_pix, data_spix, cur_size);
+ SPIFFS_DBG("truncate: delete data page "_SPIPRIpg" for data spix:"_SPIPRIsp", cur_size:"_SPIPRIi"\n", data_pix, data_spix, cur_size);
} else {
// delete last page, partially
spiffs_page_header p_hdr;
spiffs_page_ix new_data_pix;
u32_t bytes_to_remove = SPIFFS_DATA_PAGE_SIZE(fs) - (new_size % SPIFFS_DATA_PAGE_SIZE(fs));
- SPIFFS_DBG("truncate: delete %i bytes from data page %04x for data spix:%04x, cur_size:%i\n", bytes_to_remove, data_pix, data_spix, cur_size);
+ SPIFFS_DBG("truncate: delete "_SPIPRIi" bytes from data page "_SPIPRIpg" for data spix:"_SPIPRIsp", cur_size:"_SPIPRIi"\n", bytes_to_remove, data_pix, data_spix, cur_size);
res = spiffs_page_data_check(fs, fd, data_pix, data_spix);
if (res != SPIFFS_OK) break;
@@ -1647,11 +1886,11 @@ s32_t spiffs_object_truncate(
if (cur_objix_spix == 0) {
// update object index header page
((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix] = new_data_pix;
- SPIFFS_DBG("truncate: wrote page %04x to objix_hdr entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
+ SPIFFS_DBG("truncate: wrote page "_SPIPRIpg" to objix_hdr entry "_SPIPRIsp" in mem\n", new_data_pix, (spiffs_span_ix)SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
} else {
// update object index page
((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)] = new_data_pix;
- SPIFFS_DBG("truncate: wrote page %04x to objix entry %02x in mem\n", new_data_pix, SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
+ SPIFFS_DBG("truncate: wrote page "_SPIPRIpg" to objix entry "_SPIPRIsp" in mem\n", new_data_pix, (spiffs_span_ix)SPIFFS_OBJ_IX_ENTRY(fs, data_spix));
}
cur_size = new_size;
fd->size = new_size;
@@ -1665,30 +1904,31 @@ s32_t spiffs_object_truncate(
if (cur_objix_spix == 0) {
// update object index header page
if (cur_size == 0) {
- if (remove) {
+ if (remove_full) {
// remove object altogether
- SPIFFS_DBG("truncate: remove object index header page %04x\n", objix_pix);
+ SPIFFS_DBG("truncate: remove object index header page "_SPIPRIpg"\n", objix_pix);
res = spiffs_page_index_check(fs, fd, objix_pix, 0);
SPIFFS_CHECK_RES(res);
res = spiffs_page_delete(fs, objix_pix);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_DEL, fd->obj_id, 0, objix_pix, 0);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)0,
+ SPIFFS_EV_IX_DEL, fd->obj_id, 0, objix_pix, 0);
} else {
// make uninitialized object
- SPIFFS_DBG("truncate: reset objix_hdr page %04x\n", objix_pix);
+ SPIFFS_DBG("truncate: reset objix_hdr page "_SPIPRIpg"\n", objix_pix);
memset(fs->work + sizeof(spiffs_page_object_ix_header), 0xff,
SPIFFS_CFG_LOG_PAGE_SZ(fs) - sizeof(spiffs_page_object_ix_header));
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- objix_pix, fs->work, 0, SPIFFS_UNDEFINED_LEN, &new_objix_hdr_pix);
+ objix_pix, fs->work, 0, 0, SPIFFS_UNDEFINED_LEN, &new_objix_hdr_pix);
SPIFFS_CHECK_RES(res);
}
} else {
// update object index header page
SPIFFS_DBG("truncate: update object index header page with indices and size\n");
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- objix_pix, fs->work, 0, cur_size, &new_objix_hdr_pix);
+ objix_pix, fs->work, 0, 0, cur_size, &new_objix_hdr_pix);
SPIFFS_CHECK_RES(res);
}
} else {
@@ -1701,14 +1941,15 @@ s32_t spiffs_object_truncate(
// move and update object index page
res = spiffs_page_move(fs, fd->file_nbr, (u8_t*)objix_hdr, fd->obj_id, 0, objix_pix, &new_objix_pix);
SPIFFS_CHECK_RES(res);
- spiffs_cb_object_event(fs, fd, SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
- SPIFFS_DBG("truncate: store modified objix page, %04x:%04x\n", new_objix_pix, cur_objix_spix);
+ spiffs_cb_object_event(fs, (spiffs_page_object_ix *)objix_hdr,
+ SPIFFS_EV_IX_UPD, fd->obj_id, objix->p_hdr.span_ix, new_objix_pix, 0);
+ SPIFFS_DBG("truncate: store modified objix page, "_SPIPRIpg":"_SPIPRIsp"\n", new_objix_pix, cur_objix_spix);
fd->cursor_objix_pix = new_objix_pix;
fd->cursor_objix_spix = cur_objix_spix;
fd->offset = cur_size;
// update object index header page with new size
res = spiffs_object_update_index_hdr(fs, fd, fd->obj_id,
- fd->objix_hdr_pix, 0, 0, cur_size, &new_objix_hdr_pix);
+ fd->objix_hdr_pix, 0, 0, 0, cur_size, &new_objix_hdr_pix);
SPIFFS_CHECK_RES(res);
}
fd->size = cur_size;
@@ -1734,45 +1975,59 @@ s32_t spiffs_object_read(
spiffs_page_object_ix *objix = (spiffs_page_object_ix *)fs->work;
while (cur_offset < offset + len) {
- cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix);
- if (prev_objix_spix != cur_objix_spix) {
- // load current object index (header) page
- if (cur_objix_spix == 0) {
- objix_pix = fd->objix_hdr_pix;
- } else {
- SPIFFS_DBG("read: find objix %04x:%04x\n", fd->obj_id, cur_objix_spix);
- res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &objix_pix);
+#if SPIFFS_IX_MAP
+ // check if we have a memory, index map and if so, if we're within index map's range
+ // and if so, if the entry is populated
+ if (fd->ix_map && data_spix >= fd->ix_map->start_spix && data_spix <= fd->ix_map->end_spix
+ && fd->ix_map->map_buf[data_spix - fd->ix_map->start_spix]) {
+ data_pix = fd->ix_map->map_buf[data_spix - fd->ix_map->start_spix];
+ } else {
+#endif
+ cur_objix_spix = SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, data_spix);
+ if (prev_objix_spix != cur_objix_spix) {
+ // load current object index (header) page
+ if (cur_objix_spix == 0) {
+ objix_pix = fd->objix_hdr_pix;
+ } else {
+ SPIFFS_DBG("read: find objix "_SPIPRIid":"_SPIPRIsp"\n", fd->obj_id, cur_objix_spix);
+ if (fd->cursor_objix_spix == cur_objix_spix) {
+ objix_pix = fd->cursor_objix_pix;
+ } else {
+ res = spiffs_obj_lu_find_id_and_span(fs, fd->obj_id | SPIFFS_OBJ_ID_IX_FLAG, cur_objix_spix, 0, &objix_pix);
+ SPIFFS_CHECK_RES(res);
+ }
+ }
+ SPIFFS_DBG("read: load objix page "_SPIPRIpg":"_SPIPRIsp" for data spix:"_SPIPRIsp"\n", objix_pix, cur_objix_spix, data_spix);
+ res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
+ fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
SPIFFS_CHECK_RES(res);
- }
- SPIFFS_DBG("read: load objix page %04x:%04x for data spix:%04x\n", objix_pix, cur_objix_spix, data_spix);
- res = _spiffs_rd(fs, SPIFFS_OP_T_OBJ_IX | SPIFFS_OP_C_READ,
- fd->file_nbr, SPIFFS_PAGE_TO_PADDR(fs, objix_pix), SPIFFS_CFG_LOG_PAGE_SZ(fs), fs->work);
- SPIFFS_CHECK_RES(res);
- SPIFFS_VALIDATE_OBJIX(objix->p_hdr, fd->obj_id, cur_objix_spix);
+ SPIFFS_VALIDATE_OBJIX(objix->p_hdr, fd->obj_id, cur_objix_spix);
- fd->offset = cur_offset;
- fd->cursor_objix_pix = objix_pix;
- fd->cursor_objix_spix = cur_objix_spix;
+ fd->offset = cur_offset;
+ fd->cursor_objix_pix = objix_pix;
+ fd->cursor_objix_spix = cur_objix_spix;
- prev_objix_spix = cur_objix_spix;
- }
+ prev_objix_spix = cur_objix_spix;
+ }
- if (cur_objix_spix == 0) {
- // get data page from object index header page
- data_pix = ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix];
- } else {
- // get data page from object index page
- data_pix = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)];
+ if (cur_objix_spix == 0) {
+ // get data page from object index header page
+ data_pix = ((spiffs_page_ix*)((u8_t *)objix_hdr + sizeof(spiffs_page_object_ix_header)))[data_spix];
+ } else {
+ // get data page from object index page
+ data_pix = ((spiffs_page_ix*)((u8_t *)objix + sizeof(spiffs_page_object_ix)))[SPIFFS_OBJ_IX_ENTRY(fs, data_spix)];
+ }
+#if SPIFFS_IX_MAP
}
-
+#endif
// all remaining data
u32_t len_to_read = offset + len - cur_offset;
// remaining data in page
len_to_read = MIN(len_to_read, SPIFFS_DATA_PAGE_SIZE(fs) - (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs)));
// remaining data in file
len_to_read = MIN(len_to_read, fd->size);
- SPIFFS_DBG("read: offset:%i rd:%i data spix:%04x is data_pix:%04x addr:%08x\n", cur_offset, len_to_read, data_spix, data_pix,
- SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header) + (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs)));
+ SPIFFS_DBG("read: offset:"_SPIPRIi" rd:"_SPIPRIi" data spix:"_SPIPRIsp" is data_pix:"_SPIPRIpg" addr:"_SPIPRIad"\n", cur_offset, len_to_read, data_spix, data_pix,
+ (u32_t)(SPIFFS_PAGE_TO_PADDR(fs, data_pix) + sizeof(spiffs_page_header) + (cur_offset % SPIFFS_DATA_PAGE_SIZE(fs))));
if (len_to_read <= 0) {
res = SPIFFS_ERR_END_OF_OBJECT;
break;
@@ -1858,7 +2113,7 @@ static s32_t spiffs_obj_lu_find_free_obj_id_compact_v(spiffs *fs, spiffs_obj_id
if (id >= state->min_obj_id && id <= state->max_obj_id) {
u8_t *map = (u8_t *)fs->work;
int ix = (id - state->min_obj_id) / state->compaction;
- //SPIFFS_DBG("free_obj_id: add ix %i for id %04x min:%04x max%04x comp:%i\n", ix, id, state->min_obj_id, state->max_obj_id, state->compaction);
+ //SPIFFS_DBG("free_obj_id: add ix "_SPIPRIi" for id "_SPIPRIid" min"_SPIPRIid" max"_SPIPRIid" comp:"_SPIPRIi"\n", ix, id, state->min_obj_id, state->max_obj_id, state->compaction);
map[ix]++;
}
}
@@ -1886,7 +2141,7 @@ s32_t spiffs_obj_lu_find_free_obj_id(spiffs *fs, spiffs_obj_id *obj_id, const u8
if (state.max_obj_id - state.min_obj_id <= (spiffs_obj_id)SPIFFS_CFG_LOG_PAGE_SZ(fs)*8) {
// possible to represent in bitmap
u32_t i, j;
- SPIFFS_DBG("free_obj_id: BITM min:%04x max:%04x\n", state.min_obj_id, state.max_obj_id);
+ SPIFFS_DBG("free_obj_id: BITM min:"_SPIPRIid" max:"_SPIPRIid"\n", state.min_obj_id, state.max_obj_id);
memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs));
res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_obj_lu_find_free_obj_id_bitmap_v,
@@ -1931,14 +2186,14 @@ s32_t spiffs_obj_lu_find_free_obj_id(spiffs *fs, spiffs_obj_id *obj_id, const u8
return SPIFFS_ERR_FULL;
}
- SPIFFS_DBG("free_obj_id: COMP select index:%i min_count:%i min:%04x max:%04x compact:%i\n", min_i, min_count, state.min_obj_id, state.max_obj_id, state.compaction);
+ SPIFFS_DBG("free_obj_id: COMP select index:"_SPIPRIi" min_count:"_SPIPRIi" min:"_SPIPRIid" max:"_SPIPRIid" compact:"_SPIPRIi"\n", min_i, min_count, state.min_obj_id, state.max_obj_id, state.compaction);
if (min_count == 0) {
// no id in this range, skip compacting and use directly
*obj_id = min_i * state.compaction + state.min_obj_id;
return SPIFFS_OK;
} else {
- SPIFFS_DBG("free_obj_id: COMP SEL chunk:%04x min:%04x -> %04x\n", state.compaction, state.min_obj_id, state.min_obj_id + min_i * state.compaction);
+ SPIFFS_DBG("free_obj_id: COMP SEL chunk:"_SPIPRIi" min:"_SPIPRIid" -> "_SPIPRIid"\n", state.compaction, state.min_obj_id, state.min_obj_id + min_i * state.compaction);
state.min_obj_id += min_i * state.compaction;
state.max_obj_id = state.min_obj_id + state.compaction;
// decrease compaction
@@ -1951,7 +2206,7 @@ s32_t spiffs_obj_lu_find_free_obj_id(spiffs *fs, spiffs_obj_id *obj_id, const u8
// in a work memory of log_page_size bytes, we may fit in log_page_size ids
// todo what if compaction is > 255 - then we cannot fit it in a byte
state.compaction = (state.max_obj_id-state.min_obj_id) / ((SPIFFS_CFG_LOG_PAGE_SZ(fs) / sizeof(u8_t)));
- SPIFFS_DBG("free_obj_id: COMP min:%04x max:%04x compact:%i\n", state.min_obj_id, state.max_obj_id, state.compaction);
+ SPIFFS_DBG("free_obj_id: COMP min:"_SPIPRIid" max:"_SPIPRIid" compact:"_SPIPRIi"\n", state.min_obj_id, state.max_obj_id, state.compaction);
memset(fs->work, 0, SPIFFS_CFG_LOG_PAGE_SZ(fs));
res = spiffs_obj_lu_find_entry_visitor(fs, 0, 0, 0, 0, spiffs_obj_lu_find_free_obj_id_compact_v, &state, 0, 0, 0);
@@ -1965,7 +2220,84 @@ s32_t spiffs_obj_lu_find_free_obj_id(spiffs *fs, spiffs_obj_id *obj_id, const u8
}
#endif // !SPIFFS_READ_ONLY
-s32_t spiffs_fd_find_new(spiffs *fs, spiffs_fd **fd) {
+#if SPIFFS_TEMPORAL_FD_CACHE
+// djb2 hash
+static u32_t spiffs_hash(spiffs *fs, const u8_t *name) {
+ (void)fs;
+ u32_t hash = 5381;
+ u8_t c;
+ int i = 0;
+ while ((c = name[i++]) && i < SPIFFS_OBJ_NAME_LEN) {
+ hash = (hash * 33) ^ c;
+ }
+ return hash;
+}
+#endif
+
+s32_t spiffs_fd_find_new(spiffs *fs, spiffs_fd **fd, const char *name) {
+#if SPIFFS_TEMPORAL_FD_CACHE
+ u32_t i;
+ u16_t min_score = 0xffff;
+ u32_t cand_ix = (u32_t)-1;
+ u32_t name_hash = name ? spiffs_hash(fs, (const u8_t *)name) : 0;
+ spiffs_fd *fds = (spiffs_fd *)fs->fd_space;
+
+ if (name) {
+ // first, decrease score of all closed descriptors
+ for (i = 0; i < fs->fd_count; i++) {
+ spiffs_fd *cur_fd = &fds[i];
+ if (cur_fd->file_nbr == 0) {
+ if (cur_fd->score > 1) { // score == 0 indicates never used fd
+ cur_fd->score--;
+ }
+ }
+ }
+ }
+
+ // find the free fd with least score or name match
+ for (i = 0; i < fs->fd_count; i++) {
+ spiffs_fd *cur_fd = &fds[i];
+ if (cur_fd->file_nbr == 0) {
+ if (name && cur_fd->name_hash == name_hash) {
+ cand_ix = i;
+ break;
+ }
+ if (cur_fd->score < min_score) {
+ min_score = cur_fd->score;
+ cand_ix = i;
+ }
+ }
+ }
+
+ if (cand_ix != (u32_t)-1) {
+ spiffs_fd *cur_fd = &fds[cand_ix];
+ if (name) {
+ if (cur_fd->name_hash == name_hash && cur_fd->score > 0) {
+ // opened an fd with same name hash, assume same file
+ // set search point to saved obj index page and hope we have a correct match directly
+ // when start searching - if not, we will just keep searching until it is found
+ fs->cursor_block_ix = SPIFFS_BLOCK_FOR_PAGE(fs, cur_fd->objix_hdr_pix);
+ fs->cursor_obj_lu_entry = SPIFFS_OBJ_LOOKUP_ENTRY_FOR_PAGE(fs, cur_fd->objix_hdr_pix);
+ // update score
+ if (cur_fd->score < 0xffff-SPIFFS_TEMPORAL_CACHE_HIT_SCORE) {
+ cur_fd->score += SPIFFS_TEMPORAL_CACHE_HIT_SCORE;
+ } else {
+ cur_fd->score = 0xffff;
+ }
+ } else {
+ // no hash hit, restore this fd to initial state
+ cur_fd->score = SPIFFS_TEMPORAL_CACHE_HIT_SCORE;
+ cur_fd->name_hash = name_hash;
+ }
+ }
+ cur_fd->file_nbr = cand_ix+1;
+ *fd = cur_fd;
+ return SPIFFS_OK;
+ } else {
+ return SPIFFS_ERR_OUT_OF_FILE_DESCS;
+ }
+#else
+ (void)name;
u32_t i;
spiffs_fd *fds = (spiffs_fd *)fs->fd_space;
for (i = 0; i < fs->fd_count; i++) {
@@ -1977,6 +2309,7 @@ s32_t spiffs_fd_find_new(spiffs *fs, spiffs_fd **fd) {
}
}
return SPIFFS_ERR_OUT_OF_FILE_DESCS;
+#endif
}
s32_t spiffs_fd_return(spiffs *fs, spiffs_file f) {
@@ -1989,6 +2322,9 @@ s32_t spiffs_fd_return(spiffs *fs, spiffs_file f) {
return SPIFFS_ERR_FILE_CLOSED;
}
fd->file_nbr = 0;
+#if SPIFFS_IX_MAP
+ fd->ix_map = 0;
+#endif
return SPIFFS_OK;
}
@@ -2003,3 +2339,21 @@ s32_t spiffs_fd_get(spiffs *fs, spiffs_file f, spiffs_fd **fd) {
}
return SPIFFS_OK;
}
+
+#if SPIFFS_TEMPORAL_FD_CACHE
+void spiffs_fd_temporal_cache_rehash(
+ spiffs *fs,
+ const char *old_path,
+ const char *new_path) {
+ u32_t i;
+ u32_t old_hash = spiffs_hash(fs, (const u8_t *)old_path);
+ u32_t new_hash = spiffs_hash(fs, (const u8_t *)new_path);
+ spiffs_fd *fds = (spiffs_fd *)fs->fd_space;
+ for (i = 0; i < fs->fd_count; i++) {
+ spiffs_fd *cur_fd = &fds[i];
+ if (cur_fd->score > 0 && cur_fd->name_hash == old_hash) {
+ cur_fd->name_hash = new_hash;
+ }
+ }
+}
+#endif
diff --git a/cores/esp8266/spiffs/spiffs_nucleus.h b/cores/esp8266/spiffs/spiffs_nucleus.h
index 6e4e8ac33f..dd1c414bc7 100644
--- a/cores/esp8266/spiffs/spiffs_nucleus.h
+++ b/cores/esp8266/spiffs/spiffs_nucleus.h
@@ -116,13 +116,23 @@
#define SPIFFS_ERR_CHECK_FLAGS_BAD (SPIFFS_ERR_INTERNAL - 3)
#define _SPIFFS_ERR_CHECK_LAST (SPIFFS_ERR_INTERNAL - 4)
+// visitor result, continue searching
#define SPIFFS_VIS_COUNTINUE (SPIFFS_ERR_INTERNAL - 20)
+// visitor result, continue searching after reloading lu buffer
#define SPIFFS_VIS_COUNTINUE_RELOAD (SPIFFS_ERR_INTERNAL - 21)
+// visitor result, stop searching
#define SPIFFS_VIS_END (SPIFFS_ERR_INTERNAL - 22)
-#define SPIFFS_EV_IX_UPD 0
-#define SPIFFS_EV_IX_NEW 1
-#define SPIFFS_EV_IX_DEL 2
+// updating an object index contents
+#define SPIFFS_EV_IX_UPD (0)
+// creating a new object index
+#define SPIFFS_EV_IX_NEW (1)
+// deleting an object index
+#define SPIFFS_EV_IX_DEL (2)
+// moving an object index without updating contents
+#define SPIFFS_EV_IX_MOV (3)
+// updating an object index header data only, not the table itself
+#define SPIFFS_EV_IX_UPD_HDR (4)
#define SPIFFS_OBJ_ID_IX_FLAG ((spiffs_obj_id)(1<<(8*sizeof(spiffs_obj_id)-1)))
@@ -131,6 +141,22 @@
#define SPIFFS_OBJ_ID_DELETED ((spiffs_obj_id)0)
#define SPIFFS_OBJ_ID_FREE ((spiffs_obj_id)-1)
+
+
+#if defined(__GNUC__) || defined(__clang__)
+ /* For GCC and clang */
+#define SPIFFS_PACKED __attribute__((packed))
+#elif defined(__ICCARM__) || defined(__CC_ARM)
+ /* For IAR ARM and Keil MDK-ARM compilers */
+#define SPIFFS_PACKED
+
+#else
+ /* Unknown compiler */
+#define SPIFFS_PACKED
+#endif
+
+
+
#if SPIFFS_USE_MAGIC
#if !SPIFFS_USE_MAGIC_LENGTH
#define SPIFFS_MAGIC(fs, bix) \
@@ -228,6 +254,17 @@
// object index span index number for given data span index or entry
#define SPIFFS_OBJ_IX_ENTRY_SPAN_IX(fs, spix) \
((spix) < SPIFFS_OBJ_HDR_IX_LEN(fs) ? 0 : (1+((spix)-SPIFFS_OBJ_HDR_IX_LEN(fs))/SPIFFS_OBJ_IX_LEN(fs)))
+// get data span index for object index span index
+#define SPIFFS_DATA_SPAN_IX_FOR_OBJ_IX_SPAN_IX(fs, spix) \
+ ( (spix) == 0 ? 0 : (SPIFFS_OBJ_HDR_IX_LEN(fs) + (((spix)-1) * SPIFFS_OBJ_IX_LEN(fs))) )
+
+#if SPIFFS_FILEHDL_OFFSET
+#define SPIFFS_FH_OFFS(fs, fh) ((fh) != 0 ? ((fh) + (fs)->cfg.fh_ix_offset) : 0)
+#define SPIFFS_FH_UNOFFS(fs, fh) ((fh) != 0 ? ((fh) - (fs)->cfg.fh_ix_offset) : 0)
+#else
+#define SPIFFS_FH_OFFS(fs, fh) (fh)
+#define SPIFFS_FH_UNOFFS(fs, fh) (fh)
+#endif
#define SPIFFS_OP_T_OBJ_LU (0<<0)
@@ -272,26 +309,26 @@
#define SPIFFS_API_CHECK_MOUNT(fs) \
if (!SPIFFS_CHECK_MOUNT((fs))) { \
(fs)->err_code = SPIFFS_ERR_NOT_MOUNTED; \
- return -1; \
+ return SPIFFS_ERR_NOT_MOUNTED; \
}
#define SPIFFS_API_CHECK_CFG(fs) \
if (!SPIFFS_CHECK_CFG((fs))) { \
(fs)->err_code = SPIFFS_ERR_NOT_CONFIGURED; \
- return -1; \
+ return SPIFFS_ERR_NOT_CONFIGURED; \
}
#define SPIFFS_API_CHECK_RES(fs, res) \
if ((res) < SPIFFS_OK) { \
(fs)->err_code = (res); \
- return -1; \
+ return (res); \
}
#define SPIFFS_API_CHECK_RES_UNLOCK(fs, res) \
if ((res) < SPIFFS_OK) { \
(fs)->err_code = (res); \
SPIFFS_UNLOCK(fs); \
- return -1; \
+ return (res); \
}
#define SPIFFS_VALIDATE_OBJIX(ph, objid, spix) \
@@ -312,7 +349,7 @@
if ((ph).span_ix != (spix)) return SPIFFS_ERR_DATA_SPAN_MISMATCH;
-// check id
+// check id, only visit matching objec ids
#define SPIFFS_VIS_CHECK_ID (1<<0)
// report argument object id to visitor - else object lookup id is reported
#define SPIFFS_VIS_CHECK_PH (1<<1)
@@ -418,13 +455,23 @@ typedef struct {
spiffs_span_ix cursor_objix_spix;
// current absolute offset
u32_t offset;
- // current file descriptor offset
+ // current file descriptor offset (cached)
u32_t fdoffset;
// fd flags
spiffs_flags flags;
#if SPIFFS_CACHE_WR
spiffs_cache_page *cache_page;
#endif
+#if SPIFFS_TEMPORAL_FD_CACHE
+ // djb2 hash of filename
+ u32_t name_hash;
+ // hit score (score == 0 indicates never used fd)
+ u16_t score;
+#endif
+#if SPIFFS_IX_MAP
+ // spiffs index map, if 0 it means unmapped
+ spiffs_ix_map *ix_map;
+#endif
} spiffs_fd;
@@ -433,7 +480,7 @@ typedef struct {
// page header, part of each page except object lookup pages
// NB: this is always aligned when the data page is an object index,
// as in this case struct spiffs_page_object_ix is used
-typedef struct __attribute(( packed )) {
+typedef struct SPIFFS_PACKED {
// object id
spiffs_obj_id obj_id;
// object span index
@@ -443,7 +490,7 @@ typedef struct __attribute(( packed )) {
} spiffs_page_header;
// object index header page header
-typedef struct __attribute(( packed ))
+typedef struct SPIFFS_PACKED
#if SPIFFS_ALIGNED_OBJECT_INDEX_TABLES
__attribute(( aligned(sizeof(spiffs_page_ix)) ))
#endif
@@ -458,10 +505,14 @@ typedef struct __attribute(( packed ))
spiffs_obj_type type;
// name of object
u8_t name[SPIFFS_OBJ_NAME_LEN];
+#if SPIFFS_OBJ_META_LEN
+ // metadata. not interpreted by SPIFFS in any way.
+ u8_t meta[SPIFFS_OBJ_META_LEN];
+#endif
} spiffs_page_object_ix_header;
// object index page header
-typedef struct __attribute(( packed )) {
+typedef struct SPIFFS_PACKED {
spiffs_page_header p_hdr;
u8_t _align[4 - ((sizeof(spiffs_page_header)&3)==0 ? 4 : (sizeof(spiffs_page_header)&3))];
} spiffs_page_object_ix;
@@ -612,7 +663,8 @@ s32_t spiffs_page_delete(
s32_t spiffs_object_create(
spiffs *fs,
spiffs_obj_id obj_id,
- const u8_t name[SPIFFS_OBJ_NAME_LEN],
+ const u8_t name[],
+ const u8_t meta[],
spiffs_obj_type type,
spiffs_page_ix *objix_hdr_pix);
@@ -622,13 +674,24 @@ s32_t spiffs_object_update_index_hdr(
spiffs_obj_id obj_id,
spiffs_page_ix objix_hdr_pix,
u8_t *new_objix_hdr_data,
- const u8_t name[SPIFFS_OBJ_NAME_LEN],
+ const u8_t name[],
+ const u8_t meta[],
u32_t size,
spiffs_page_ix *new_pix);
-void spiffs_cb_object_event(
+#if SPIFFS_IX_MAP
+
+s32_t spiffs_populate_ix_map(
spiffs *fs,
spiffs_fd *fd,
+ u32_t vec_entry_start,
+ u32_t vec_entry_end);
+
+#endif
+
+void spiffs_cb_object_event(
+ spiffs *fs,
+ spiffs_page_object_ix *objix,
int ev,
spiffs_obj_id obj_id,
spiffs_span_ix spix,
@@ -704,7 +767,8 @@ s32_t spiffs_gc_quick(
s32_t spiffs_fd_find_new(
spiffs *fs,
- spiffs_fd **fd);
+ spiffs_fd **fd,
+ const char *name);
s32_t spiffs_fd_return(
spiffs *fs,
@@ -715,6 +779,13 @@ s32_t spiffs_fd_get(
spiffs_file f,
spiffs_fd **fd);
+#if SPIFFS_TEMPORAL_FD_CACHE
+void spiffs_fd_temporal_cache_rehash(
+ spiffs *fs,
+ const char *old_path,
+ const char *new_path);
+#endif
+
#if SPIFFS_CACHE
void spiffs_cache_init(
spiffs *fs);
@@ -748,4 +819,24 @@ s32_t spiffs_page_consistency_check(
s32_t spiffs_object_index_consistency_check(
spiffs *fs);
+// memcpy macro,
+// checked in test builds, otherwise plain memcpy (unless already defined)
+#ifdef _SPIFFS_TEST
+#define _SPIFFS_MEMCPY(__d, __s, __l) do { \
+ intptr_t __a1 = (intptr_t)((u8_t*)(__s)); \
+ intptr_t __a2 = (intptr_t)((u8_t*)(__s)+(__l)); \
+ intptr_t __b1 = (intptr_t)((u8_t*)(__d)); \
+ intptr_t __b2 = (intptr_t)((u8_t*)(__d)+(__l)); \
+ if (__a1 <= __b2 && __b1 <= __a2) { \
+ printf("FATAL OVERLAP: memcpy from %lx..%lx to %lx..%lx\n", __a1, __a2, __b1, __b2); \
+ ERREXIT(); \
+ } \
+ memcpy((__d),(__s),(__l)); \
+} while (0)
+#else
+#ifndef _SPIFFS_MEMCPY
+#define _SPIFFS_MEMCPY(__d, __s, __l) do{memcpy((__d),(__s),(__l));}while(0)
+#endif
+#endif //_SPIFFS_TEST
+
#endif /* SPIFFS_NUCLEUS_H_ */
diff --git a/cores/esp8266/spiffs_api.h b/cores/esp8266/spiffs_api.h
index f98df1195b..4ce8d3e6ba 100644
--- a/cores/esp8266/spiffs_api.h
+++ b/cores/esp8266/spiffs_api.h
@@ -49,13 +49,13 @@ class SPIFFSImpl : public FSImpl
{
public:
SPIFFSImpl(uint32_t start, uint32_t size, uint32_t pageSize, uint32_t blockSize, uint32_t maxOpenFds)
- : _fs({0})
- , _start(start)
+ : _start(start)
, _size(size)
, _pageSize(pageSize)
, _blockSize(blockSize)
, _maxOpenFds(maxOpenFds)
{
+ memset(&_fs, 0, sizeof(_fs));
}
FileImplPtr open(const char* path, OpenMode openMode, AccessMode accessMode) override;
@@ -176,7 +176,8 @@ class SPIFFSImpl : public FSImpl
bool _tryMount()
{
- spiffs_config config = {0};
+ spiffs_config config;
+ memset(&config, 0, sizeof(config));
config.hal_read_f = &spiffs_hal_read;
config.hal_write_f = &spiffs_hal_write;
@@ -242,6 +243,11 @@ class SPIFFSImpl : public FSImpl
static void _check_cb(spiffs_check_type type, spiffs_check_report report,
uint32_t arg1, uint32_t arg2)
{
+ (void) type;
+ (void) report;
+ (void) arg1;
+ (void) arg2;
+
// TODO: spiffs doesn't pass any context pointer along with _check_cb,
// so we can't do anything useful here other than perhaps
// feeding the watchdog
@@ -268,9 +274,9 @@ class SPIFFSFileImpl : public FileImpl
SPIFFSFileImpl(SPIFFSImpl* fs, spiffs_file fd)
: _fs(fs)
, _fd(fd)
- , _stat({0})
, _written(false)
{
+ memset(&_stat, 0, sizeof(_stat));
_getStat();
}
@@ -323,7 +329,7 @@ class SPIFFSFileImpl : public FileImpl
if (mode == SeekEnd) {
offset = -offset;
}
- auto rc = SPIFFS_lseek(_fs->getFs(), _fd, pos, (int) mode);
+ auto rc = SPIFFS_lseek(_fs->getFs(), _fd, offset, (int) mode);
if (rc < 0) {
DEBUGV("SPIFFS_lseek rc=%d\r\n", rc);
return false;
@@ -376,7 +382,7 @@ class SPIFFSFileImpl : public FileImpl
auto rc = SPIFFS_fstat(_fs->getFs(), _fd, &_stat);
if (rc != SPIFFS_OK) {
DEBUGV("SPIFFS_fstat rc=%d\r\n", rc);
- _stat = {0};
+ memset(&_stat, 0, sizeof(_stat));
}
_written = false;
}
diff --git a/cores/esp8266/spiffs_hal.cpp b/cores/esp8266/spiffs_hal.cpp
index 7f3245c0d0..2d66bd54df 100644
--- a/cores/esp8266/spiffs_hal.cpp
+++ b/cores/esp8266/spiffs_hal.cpp
@@ -60,7 +60,7 @@ int32_t spiffs_hal_read(uint32_t addr, uint32_t size, uint8_t *dst) {
__LINE__, addr, size, alignedBegin, alignedEnd);
return SPIFFS_ERR_INTERNAL;
}
- memcpy(dst, &tmp + 4 - nb, nb);
+ memcpy(dst, ((uint8_t*) &tmp) + 4 - nb, nb);
}
if (alignedEnd != alignedBegin) {
diff --git a/cores/esp8266/time.c b/cores/esp8266/time.c
index eba8ff2ea1..19b0dee522 100644
--- a/cores/esp8266/time.c
+++ b/cores/esp8266/time.c
@@ -17,9 +17,10 @@
*/
#include
+#include
#include
#include "sntp.h"
-
+#include "coredecls.h"
#ifndef _TIMEVAL_DEFINED
#define _TIMEVAL_DEFINED
@@ -31,25 +32,18 @@ struct timeval {
extern char* sntp_asctime(const struct tm *t);
extern struct tm* sntp_localtime(const time_t *clock);
+extern uint64_t micros64();
// time gap in seconds from 01.01.1900 (NTP time) to 01.01.1970 (UNIX time)
#define DIFF1900TO1970 2208988800UL
-static int s_daylightOffset_sec = 0;
-static long s_timezone_sec = 0;
-static time_t s_bootTime = 0;
+bool timeshift64_is_set = false;
+static uint64_t timeshift64 = 0;
-// calculate offset used in gettimeofday
-static void ensureBootTimeIsSet()
+void tune_timeshift64 (uint64_t now_us)
{
- if (!s_bootTime)
- {
- time_t now = sntp_get_current_timestamp();
- if (now)
- {
- s_bootTime = now - millis() / 1000;
- }
- }
+ timeshift64 = now_us - micros64();
+ timeshift64_is_set = true;
}
static void setServer(int id, const char* name_or_ip)
@@ -69,16 +63,17 @@ void configTime(int timezone, int daylightOffset_sec, const char* server1, const
setServer(1, server2);
setServer(2, server3);
- s_timezone_sec = timezone;
- s_daylightOffset_sec = daylightOffset_sec;
sntp_set_timezone(timezone/3600);
+ sntp_set_daylight(daylightOffset_sec);
sntp_init();
}
int clock_gettime(clockid_t unused, struct timespec *tp)
{
- tp->tv_sec = millis() / 1000;
- tp->tv_nsec = micros() * 1000;
+ (void) unused;
+ uint64_t m = micros64();
+ tp->tv_sec = m / 1000000;
+ tp->tv_nsec = (m % 1000000) * 1000;
return 0;
}
@@ -94,11 +89,15 @@ time_t time(time_t * t)
int _gettimeofday_r(struct _reent* unused, struct timeval *tp, void *tzp)
{
+ (void) unused;
+ (void) tzp;
if (tp)
{
- ensureBootTimeIsSet();
- tp->tv_sec = s_bootTime + millis() / 1000;
- tp->tv_usec = micros() * 1000;
+ if (!timeshift64_is_set)
+ tune_timeshift64(sntp_get_current_timestamp() * 1000000ULL);
+ uint64_t currentTime_us = timeshift64 + micros64();
+ tp->tv_sec = currentTime_us / 1000000ULL;
+ tp->tv_usec = currentTime_us % 1000000ULL;
}
return 0;
}
diff --git a/cores/esp8266/uart.c b/cores/esp8266/uart.c
index 375381e7ed..47814f7a9d 100644
--- a/cores/esp8266/uart.c
+++ b/cores/esp8266/uart.c
@@ -45,122 +45,242 @@
#include "esp8266_peri.h"
#include "user_interface.h"
+const char overrun_str [] ICACHE_RODATA_ATTR STORE_ATTR = "uart input full!\r\n";
static int s_uart_debug_nr = UART0;
-struct uart_rx_buffer_ {
+
+struct uart_rx_buffer_
+{
size_t size;
size_t rpos;
size_t wpos;
uint8_t * buffer;
};
-struct uart_ {
+struct uart_
+{
int uart_nr;
int baud_rate;
bool rx_enabled;
bool tx_enabled;
+ bool overrun;
uint8_t rx_pin;
uint8_t tx_pin;
struct uart_rx_buffer_ * rx_buffer;
};
-size_t uart_resize_rx_buffer(uart_t* uart, size_t new_size)
+
+/*
+ In the context of the naming conventions in this file, "_unsafe" means two things:
+ 1. the input arguments are not checked. It is up to the caller to check argument sanity.
+ 2. The function body is not interrupt-safe, i.e.: the isr could fire anywhen during the
+ body execution, leading to corruption of the data shared between the body and the isr
+ (parts of the rx_buffer).
+
+ The unsafe versions of the functions are private to this TU. There are "safe" versions that
+ wrap the unsafe ones with disabling/enabling of the uart interrupt for safe public use.
+*/
+
+
+
+inline size_t
+uart_rx_fifo_available(const int uart_nr)
{
- if(uart == NULL || !uart->rx_enabled) {
- return 0;
- }
- if(uart->rx_buffer->size == new_size) {
- return uart->rx_buffer->size;
- }
- uint8_t * new_buf = (uint8_t*)malloc(new_size);
- if(!new_buf) {
- return uart->rx_buffer->size;
- }
- size_t new_wpos = 0;
- ETS_UART_INTR_DISABLE();
- while(uart_rx_available(uart) && new_wpos < new_size) {
- new_buf[new_wpos++] = uart_read_char(uart);
- }
- uint8_t * old_buf = uart->rx_buffer->buffer;
- uart->rx_buffer->rpos = 0;
- uart->rx_buffer->wpos = new_wpos;
- uart->rx_buffer->size = new_size;
- uart->rx_buffer->buffer = new_buf;
- free(old_buf);
- ETS_UART_INTR_ENABLE();
- return uart->rx_buffer->size;
+ return (USS(uart_nr) >> USRXC) & 0xFF;
}
-int uart_peek_char(uart_t* uart)
+
+/**********************************************************/
+/************ UNSAFE FUNCTIONS ****************************/
+/**********************************************************/
+inline size_t
+uart_rx_buffer_available_unsafe(const struct uart_rx_buffer_ * rx_buffer)
{
- if(uart == NULL || !uart->rx_enabled) {
- return -1;
+ if(rx_buffer->wpos < rx_buffer->rpos)
+ return (rx_buffer->wpos + rx_buffer->size) - rx_buffer->rpos;
+
+ return rx_buffer->wpos - rx_buffer->rpos;
+}
+
+inline size_t
+uart_rx_available_unsafe(uart_t* uart)
+{
+ return uart_rx_buffer_available_unsafe(uart->rx_buffer) + uart_rx_fifo_available(uart->uart_nr);
+}
+
+
+//#define UART_DISCARD_NEWEST
+
+// Copy all the rx fifo bytes that fit into the rx buffer
+inline void
+uart_rx_copy_fifo_to_buffer_unsafe(uart_t* uart)
+{
+ struct uart_rx_buffer_ *rx_buffer = uart->rx_buffer;
+
+ while(uart_rx_fifo_available(uart->uart_nr))
+ {
+ size_t nextPos = (rx_buffer->wpos + 1) % rx_buffer->size;
+ if(nextPos == rx_buffer->rpos)
+ {
+
+ if (!uart->overrun)
+ {
+ uart->overrun = true;
+ os_printf_plus(overrun_str);
+ }
+
+ // a choice has to be made here,
+ // do we discard newest or oldest data?
+#ifdef UART_DISCARD_NEWEST
+ // discard newest data
+ // Stop copying if rx buffer is full
+ USF(uart->uart_nr);
+ break;
+#else
+ // discard oldest data
+ if (++rx_buffer->rpos == rx_buffer->size)
+ rx_buffer->rpos = 0;
+#endif
+ }
+ uint8_t data = USF(uart->uart_nr);
+ rx_buffer->buffer[rx_buffer->wpos] = data;
+ rx_buffer->wpos = nextPos;
}
- if (!uart_rx_available(uart)) {
+}
+
+inline int
+uart_peek_char_unsafe(uart_t* uart)
+{
+ if (!uart_rx_available_unsafe(uart))
return -1;
- }
+
+ //without the following if statement and body, there is a good chance of a fifo overrun
+ if (uart_rx_buffer_available_unsafe(uart->rx_buffer) == 0)
+ uart_rx_copy_fifo_to_buffer_unsafe(uart);
+
return uart->rx_buffer->buffer[uart->rx_buffer->rpos];
}
-int uart_read_char(uart_t* uart)
+inline int
+uart_read_char_unsafe(uart_t* uart)
{
- int data = uart_peek_char(uart);
- if(data != -1) {
+ int data = uart_peek_char_unsafe(uart);
+ if(data != -1)
uart->rx_buffer->rpos = (uart->rx_buffer->rpos + 1) % uart->rx_buffer->size;
- }
return data;
}
-size_t uart_rx_available(uart_t* uart)
+
+/**********************************************************/
+
+
+
+size_t
+uart_rx_available(uart_t* uart)
{
- if(uart == NULL || !uart->rx_enabled) {
+ if(uart == NULL || !uart->rx_enabled)
return 0;
- }
- if(uart->rx_buffer->wpos < uart->rx_buffer->rpos) {
- return (uart->rx_buffer->wpos + uart->rx_buffer->size) - uart->rx_buffer->rpos;
- }
- return uart->rx_buffer->wpos - uart->rx_buffer->rpos;
+
+ ETS_UART_INTR_DISABLE();
+ int uartrxbufferavailable = uart_rx_buffer_available_unsafe(uart->rx_buffer);
+ ETS_UART_INTR_ENABLE();
+
+ return uartrxbufferavailable + uart_rx_fifo_available(uart->uart_nr);
}
+int
+uart_peek_char(uart_t* uart)
+{
+ if(uart == NULL || !uart->rx_enabled)
+ return -1;
+
+ ETS_UART_INTR_DISABLE(); //access to rx_buffer can be interrupted by the isr (similar to a critical section), so disable interrupts here
+ int ret = uart_peek_char_unsafe(uart);
+ ETS_UART_INTR_ENABLE();
+ return ret;
+}
+
+int
+uart_read_char(uart_t* uart)
+{
+ if(uart == NULL || !uart->rx_enabled)
+ return -1;
+
+ ETS_UART_INTR_DISABLE();
+ int data = uart_read_char_unsafe(uart);
+ ETS_UART_INTR_ENABLE();
+ return data;
+}
-void ICACHE_RAM_ATTR uart_isr(void * arg)
+size_t
+uart_resize_rx_buffer(uart_t* uart, size_t new_size)
+{
+ if(uart == NULL || !uart->rx_enabled)
+ return 0;
+
+ if(uart->rx_buffer->size == new_size)
+ return uart->rx_buffer->size;
+
+ uint8_t * new_buf = (uint8_t*)malloc(new_size);
+ if(!new_buf)
+ return uart->rx_buffer->size;
+
+ size_t new_wpos = 0;
+ ETS_UART_INTR_DISABLE();
+ while(uart_rx_available_unsafe(uart) && new_wpos < new_size)
+ new_buf[new_wpos++] = uart_read_char_unsafe(uart); //if uart_rx_available_unsafe() returns non-0, uart_read_char_unsafe() can't return -1
+
+ uint8_t * old_buf = uart->rx_buffer->buffer;
+ uart->rx_buffer->rpos = 0;
+ uart->rx_buffer->wpos = new_wpos;
+ uart->rx_buffer->size = new_size;
+ uart->rx_buffer->buffer = new_buf;
+ ETS_UART_INTR_ENABLE();
+ free(old_buf);
+ return uart->rx_buffer->size;
+}
+
+
+
+void ICACHE_RAM_ATTR
+uart_isr(void * arg)
{
uart_t* uart = (uart_t*)arg;
- if(uart == NULL || !uart->rx_enabled) {
+ if(uart == NULL || !uart->rx_enabled)
+ {
USIC(uart->uart_nr) = USIS(uart->uart_nr);
ETS_UART_INTR_DISABLE();
return;
}
- if(USIS(uart->uart_nr) & ((1 << UIFF) | (1 << UITO))){
- while((USS(uart->uart_nr) >> USRXC) & 0x7F){
- uint8_t data = USF(uart->uart_nr);
- size_t nextPos = (uart->rx_buffer->wpos + 1) % uart->rx_buffer->size;
- if(nextPos != uart->rx_buffer->rpos) {
- uart->rx_buffer->buffer[uart->rx_buffer->wpos] = data;
- uart->rx_buffer->wpos = nextPos;
- }
- }
- }
+ if(USIS(uart->uart_nr) & ((1 << UIFF) | (1 << UITO)))
+ uart_rx_copy_fifo_to_buffer_unsafe(uart);
+
USIC(uart->uart_nr) = USIS(uart->uart_nr);
}
-void uart_start_isr(uart_t* uart)
+static void
+uart_start_isr(uart_t* uart)
{
- if(uart == NULL || !uart->rx_enabled) {
+ if(uart == NULL || !uart->rx_enabled)
return;
- }
- USC1(uart->uart_nr) = (127 << UCFFT) | (0x02 << UCTOT) | (1 <uart_nr) = (100 << UCFFT) | (0x02 << UCTOT) | (1 <uart_nr) = 0xffff;
USIE(uart->uart_nr) = (1 << UIFF) | (1 << UIFR) | (1 << UITO);
ETS_UART_INTR_ATTACH(uart_isr, (void *)uart);
ETS_UART_INTR_ENABLE();
}
-void uart_stop_isr(uart_t* uart)
+static void
+uart_stop_isr(uart_t* uart)
{
- if(uart == NULL || !uart->rx_enabled) {
+ if(uart == NULL || !uart->rx_enabled)
return;
- }
+
ETS_UART_INTR_DISABLE();
USC1(uart->uart_nr) = 0;
USIC(uart->uart_nr) = 0xffff;
@@ -169,51 +289,89 @@ void uart_stop_isr(uart_t* uart)
}
-void uart_write_char(uart_t* uart, char c)
+
+/*
+ Reference for uart_tx_fifo_available() and uart_tx_fifo_full():
+ -Espressif Techinical Reference doc, chapter 11.3.7
+ -tools/sdk/uart_register.h
+ -cores/esp8266/esp8266_peri.h
+ */
+inline size_t
+uart_tx_fifo_available(const int uart_nr)
{
- if(uart == NULL || !uart->tx_enabled) {
- return;
- }
- while((USS(uart->uart_nr) >> USTXC) >= 0x7f);
- USF(uart->uart_nr) = c;
+ return (USS(uart_nr) >> USTXC) & 0xff;
}
-void uart_write(uart_t* uart, const char* buf, size_t size)
+inline bool
+uart_tx_fifo_full(const int uart_nr)
{
- if(uart == NULL || !uart->tx_enabled) {
- return;
- }
- while(size--) {
- uart_write_char(uart, *buf++);
- }
+ return uart_tx_fifo_available(uart_nr) >= 0x7f;
+}
+
+
+static void
+uart_do_write_char(const int uart_nr, char c)
+{
+ while(uart_tx_fifo_full(uart_nr));
+
+ USF(uart_nr) = c;
}
-size_t uart_tx_free(uart_t* uart)
+size_t
+uart_write_char(uart_t* uart, char c)
{
- if(uart == NULL || !uart->tx_enabled) {
+ if(uart == NULL || !uart->tx_enabled)
return 0;
- }
- return UART_TX_FIFO_SIZE - ((USS(uart->uart_nr) >> USTXC) & 0xff);
+
+ uart_do_write_char(uart->uart_nr, c);
+ return 1;
}
-void uart_wait_tx_empty(uart_t* uart)
+size_t
+uart_write(uart_t* uart, const char* buf, size_t size)
{
- if(uart == NULL || !uart->tx_enabled) {
+ if(uart == NULL || !uart->tx_enabled)
+ return 0;
+
+ size_t ret = size;
+ const int uart_nr = uart->uart_nr;
+ while (size--)
+ uart_do_write_char(uart_nr, *buf++);
+
+ return ret;
+}
+
+
+
+size_t
+uart_tx_free(uart_t* uart)
+{
+ if(uart == NULL || !uart->tx_enabled)
+ return 0;
+
+ return UART_TX_FIFO_SIZE - uart_tx_fifo_available(uart->uart_nr);
+}
+
+void
+uart_wait_tx_empty(uart_t* uart)
+{
+ if(uart == NULL || !uart->tx_enabled)
return;
- }
- while(((USS(uart->uart_nr) >> USTXC) & 0xff) > 0) {
+
+ while(uart_tx_fifo_available(uart->uart_nr) > 0)
delay(0);
- }
+
}
-void uart_flush(uart_t* uart)
+void
+uart_flush(uart_t* uart)
{
- if(uart == NULL) {
+ if(uart == NULL)
return;
- }
uint32_t tmp = 0x00000000;
- if(uart->rx_enabled) {
+ if(uart->rx_enabled)
+ {
tmp |= (1 << UCRXRST);
ETS_UART_INTR_DISABLE();
uart->rx_buffer->rpos = 0;
@@ -221,50 +379,55 @@ void uart_flush(uart_t* uart)
ETS_UART_INTR_ENABLE();
}
- if(uart->tx_enabled) {
+ if(uart->tx_enabled)
tmp |= (1 << UCTXRST);
- }
USC0(uart->uart_nr) |= (tmp);
USC0(uart->uart_nr) &= ~(tmp);
}
-void uart_set_baudrate(uart_t* uart, int baud_rate)
+void
+uart_set_baudrate(uart_t* uart, int baud_rate)
{
- if(uart == NULL) {
+ if(uart == NULL)
return;
- }
+
uart->baud_rate = baud_rate;
USD(uart->uart_nr) = (ESP8266_CLOCK / uart->baud_rate);
}
-int uart_get_baudrate(uart_t* uart)
+int
+uart_get_baudrate(uart_t* uart)
{
- if(uart == NULL) {
+ if(uart == NULL)
return 0;
- }
+
return uart->baud_rate;
}
-uart_t* uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size)
+uart_t*
+uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size)
{
uart_t* uart = (uart_t*) malloc(sizeof(uart_t));
- if(uart == NULL) {
+ if(uart == NULL)
return NULL;
- }
uart->uart_nr = uart_nr;
+ uart->overrun = false;
- switch(uart->uart_nr) {
+ switch(uart->uart_nr)
+ {
case UART0:
ETS_UART_INTR_DISABLE();
ETS_UART_INTR_ATTACH(NULL, NULL);
uart->rx_enabled = (mode != UART_TX_ONLY);
uart->tx_enabled = (mode != UART_RX_ONLY);
uart->rx_pin = (uart->rx_enabled)?3:255;
- if(uart->rx_enabled) {
+ if(uart->rx_enabled)
+ {
struct uart_rx_buffer_ * rx_buffer = (struct uart_rx_buffer_ *)malloc(sizeof(struct uart_rx_buffer_));
- if(rx_buffer == NULL) {
+ if(rx_buffer == NULL)
+ {
free(uart);
return NULL;
}
@@ -272,7 +435,8 @@ uart_t* uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, s
rx_buffer->rpos = 0;
rx_buffer->wpos = 0;
rx_buffer->buffer = (uint8_t *)malloc(rx_buffer->size);
- if(rx_buffer->buffer == NULL) {
+ if(rx_buffer->buffer == NULL)
+ {
free(rx_buffer);
free(uart);
return NULL;
@@ -280,29 +444,37 @@ uart_t* uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, s
uart->rx_buffer = rx_buffer;
pinMode(uart->rx_pin, SPECIAL);
}
- if(uart->tx_enabled) {
- if (tx_pin == 2) {
+ if(uart->tx_enabled)
+ {
+ if (tx_pin == 2)
+ {
uart->tx_pin = 2;
pinMode(uart->tx_pin, FUNCTION_4);
- } else {
+ }
+ else
+ {
uart->tx_pin = 1;
pinMode(uart->tx_pin, FUNCTION_0);
}
- } else {
+ }
+ else
+ {
uart->tx_pin = 255;
}
IOSWAP &= ~(1 << IOSWAPU0);
break;
+
case UART1:
// Note: uart_interrupt_handler does not support RX on UART 1.
uart->rx_enabled = false;
uart->tx_enabled = (mode != UART_RX_ONLY);
uart->rx_pin = 255;
uart->tx_pin = (uart->tx_enabled)?2:255; // GPIO7 as TX not possible! See GPIO pins used by UART
- if(uart->tx_enabled) {
+ if(uart->tx_enabled)
pinMode(uart->tx_pin, SPECIAL);
- }
+
break;
+
case UART_NO:
default:
// big fail!
@@ -316,20 +488,22 @@ uart_t* uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, s
USC1(uart->uart_nr) = 0;
USIC(uart->uart_nr) = 0xffff;
USIE(uart->uart_nr) = 0;
- if(uart->uart_nr == UART0 && uart->rx_enabled) {
+ if(uart->uart_nr == UART0 && uart->rx_enabled)
uart_start_isr(uart);
- }
return uart;
}
-void uart_uninit(uart_t* uart)
+void
+uart_uninit(uart_t* uart)
{
- if(uart == NULL) {
+ if(uart == NULL)
return;
- }
- switch(uart->rx_pin) {
+ uart_stop_isr(uart);
+
+ switch(uart->rx_pin)
+ {
case 3:
pinMode(3, INPUT);
break;
@@ -338,7 +512,8 @@ void uart_uninit(uart_t* uart)
break;
}
- switch(uart->tx_pin) {
+ switch(uart->tx_pin)
+ {
case 1:
pinMode(1, INPUT);
break;
@@ -350,52 +525,62 @@ void uart_uninit(uart_t* uart)
break;
}
- if(uart->rx_enabled){
+ if(uart->rx_enabled)
+ {
+ uart_stop_isr(uart);
free(uart->rx_buffer->buffer);
free(uart->rx_buffer);
- uart_stop_isr(uart);
}
free(uart);
}
-void uart_swap(uart_t* uart, int tx_pin)
+void
+uart_swap(uart_t* uart, int tx_pin)
{
- if(uart == NULL) {
+ if(uart == NULL)
return;
- }
- switch(uart->uart_nr) {
+
+ switch(uart->uart_nr)
+ {
case UART0:
- if(((uart->tx_pin == 1 || uart->tx_pin == 2) && uart->tx_enabled) || (uart->rx_pin == 3 && uart->rx_enabled)) {
- if(uart->tx_enabled) { //TX
+ if(((uart->tx_pin == 1 || uart->tx_pin == 2) && uart->tx_enabled) || (uart->rx_pin == 3 && uart->rx_enabled))
+ {
+ if(uart->tx_enabled) //TX
+ {
pinMode(uart->tx_pin, INPUT);
uart->tx_pin = 15;
}
- if(uart->rx_enabled) { //RX
+ if(uart->rx_enabled) //RX
+ {
pinMode(uart->rx_pin, INPUT);
uart->rx_pin = 13;
}
- if(uart->tx_enabled) {
+ if(uart->tx_enabled)
pinMode(uart->tx_pin, FUNCTION_4); //TX
- }
- if(uart->rx_enabled) {
+
+ if(uart->rx_enabled)
pinMode(uart->rx_pin, FUNCTION_4); //RX
- }
+
IOSWAP |= (1 << IOSWAPU0);
- } else {
- if(uart->tx_enabled) { //TX
+ }
+ else
+ {
+ if(uart->tx_enabled) //TX
+ {
pinMode(uart->tx_pin, INPUT);
uart->tx_pin = (tx_pin == 2)?2:1;
}
- if(uart->rx_enabled) { //RX
+ if(uart->rx_enabled) //RX
+ {
pinMode(uart->rx_pin, INPUT);
uart->rx_pin = 3;
}
- if(uart->tx_enabled) {
+ if(uart->tx_enabled)
pinMode(uart->tx_pin, (tx_pin == 2)?FUNCTION_4:SPECIAL); //TX
- }
- if(uart->rx_enabled) {
+
+ if(uart->rx_enabled)
pinMode(3, SPECIAL); //RX
- }
+
IOSWAP &= ~(1 << IOSWAPU0);
}
@@ -408,19 +593,25 @@ void uart_swap(uart_t* uart, int tx_pin)
}
}
-void uart_set_tx(uart_t* uart, int tx_pin)
+void
+uart_set_tx(uart_t* uart, int tx_pin)
{
- if(uart == NULL) {
+ if(uart == NULL)
return;
- }
- switch(uart->uart_nr) {
+
+ switch(uart->uart_nr)
+ {
case UART0:
- if(uart->tx_enabled) {
- if (uart->tx_pin == 1 && tx_pin == 2) {
+ if(uart->tx_enabled)
+ {
+ if (uart->tx_pin == 1 && tx_pin == 2)
+ {
pinMode(uart->tx_pin, INPUT);
uart->tx_pin = 2;
pinMode(uart->tx_pin, FUNCTION_4);
- } else if (uart->tx_pin == 2 && tx_pin != 2) {
+ }
+ else if (uart->tx_pin == 2 && tx_pin != 2)
+ {
pinMode(uart->tx_pin, INPUT);
uart->tx_pin = 1;
pinMode(uart->tx_pin, SPECIAL);
@@ -436,72 +627,97 @@ void uart_set_tx(uart_t* uart, int tx_pin)
}
}
-void uart_set_pins(uart_t* uart, int tx, int rx)
+void
+uart_set_pins(uart_t* uart, int tx, int rx)
{
- if(uart == NULL) {
+ if(uart == NULL)
return;
- }
- if(uart->uart_nr == UART0) { // Only UART0 allows pin changes
- if(uart->tx_enabled && uart->tx_pin != tx) {
- if( rx == 13 && tx == 15) {
+ if(uart->uart_nr == UART0) // Only UART0 allows pin changes
+ {
+ if(uart->tx_enabled && uart->tx_pin != tx)
+ {
+ if( rx == 13 && tx == 15)
+ {
uart_swap(uart, 15);
- } else if (rx == 3 && (tx == 1 || tx == 2)) {
- if (uart->rx_pin != rx) {
+ }
+ else if (rx == 3 && (tx == 1 || tx == 2))
+ {
+ if (uart->rx_pin != rx)
uart_swap(uart, tx);
- } else {
+ else
uart_set_tx(uart, tx);
- }
}
}
- if(uart->rx_enabled && uart->rx_pin != rx && rx == 13 && tx == 15) {
+ if(uart->rx_enabled && uart->rx_pin != rx && rx == 13 && tx == 15)
uart_swap(uart, 15);
- }
}
}
-bool uart_tx_enabled(uart_t* uart)
+bool
+uart_tx_enabled(uart_t* uart)
{
- if(uart == NULL) {
+ if(uart == NULL)
return false;
- }
+
return uart->tx_enabled;
}
-bool uart_rx_enabled(uart_t* uart)
+bool
+uart_rx_enabled(uart_t* uart)
{
- if(uart == NULL) {
+ if(uart == NULL)
return false;
- }
+
return uart->rx_enabled;
}
+bool
+uart_has_overrun (uart_t* uart)
+{
+ if (uart == NULL || !uart->overrun)
+ return false;
-static void uart_ignore_char(char c)
+ // clear flag
+ uart->overrun = false;
+ return true;
+}
+
+static void
+uart_ignore_char(char c)
{
+ (void) c;
}
-static void uart0_write_char(char c)
+inline void
+uart_write_char_delay(const int uart_nr, char c)
{
- while(((USS(0) >> USTXC) & 0xff) >= 0x7F) {
+ while(uart_tx_fifo_full(uart_nr))
delay(0);
- }
- USF(0) = c;
+
+ USF(uart_nr) = c;
+
}
-static void uart1_write_char(char c)
+static void
+uart0_write_char(char c)
{
- while(((USS(1) >> USTXC) & 0xff) >= 0x7F) {
- delay(0);
- }
- USF(1) = c;
+ uart_write_char_delay(0, c);
+}
+
+static void
+uart1_write_char(char c)
+{
+ uart_write_char_delay(1, c);
}
-void uart_set_debug(int uart_nr)
+void
+uart_set_debug(int uart_nr)
{
s_uart_debug_nr = uart_nr;
- switch(s_uart_debug_nr) {
+ switch(s_uart_debug_nr)
+ {
case UART0:
system_set_os_print(1);
ets_install_putc1((void *) &uart0_write_char);
@@ -518,7 +734,8 @@ void uart_set_debug(int uart_nr)
}
}
-int uart_get_debug()
+int
+uart_get_debug()
{
return s_uart_debug_nr;
}
diff --git a/cores/esp8266/uart.h b/cores/esp8266/uart.h
index b79745adf5..127c5d0ebb 100644
--- a/cores/esp8266/uart.h
+++ b/cores/esp8266/uart.h
@@ -127,8 +127,8 @@ int uart_get_baudrate(uart_t* uart);
size_t uart_resize_rx_buffer(uart_t* uart, size_t new_size);
-void uart_write_char(uart_t* uart, char c);
-void uart_write(uart_t* uart, const char* buf, size_t size);
+size_t uart_write_char(uart_t* uart, char c);
+size_t uart_write(uart_t* uart, const char* buf, size_t size);
int uart_read_char(uart_t* uart);
int uart_peek_char(uart_t* uart);
size_t uart_rx_available(uart_t* uart);
@@ -136,6 +136,8 @@ size_t uart_tx_free(uart_t* uart);
void uart_wait_tx_empty(uart_t* uart);
void uart_flush(uart_t* uart);
+bool uart_has_overrun (uart_t* uart); // returns then clear overrun flag
+
void uart_set_debug(int uart_nr);
int uart_get_debug();
diff --git a/cores/esp8266/umm_malloc/umm_malloc.c b/cores/esp8266/umm_malloc/umm_malloc.c
index 3c8c95050a..d65eac781d 100644
--- a/cores/esp8266/umm_malloc/umm_malloc.c
+++ b/cores/esp8266/umm_malloc/umm_malloc.c
@@ -493,11 +493,16 @@
#include
#include
+#include
#include "umm_malloc.h"
#include "umm_malloc_cfg.h" /* user-dependent */
+// 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;
+
#ifndef UMM_FIRST_FIT
# ifndef UMM_BEST_FIT
# define UMM_BEST_FIT
@@ -512,6 +517,9 @@
# define DBG_LOG_LEVEL DBG_LOG_LEVEL
#endif
+// Macro to place constant strings into PROGMEM and print them properly
+#define printf(fmt, ...) do { static const char fstr[] PROGMEM = fmt; char rstr[sizeof(fmt)]; for (size_t i=0; i
+#include
+
#include "c_types.h"
-#ifdef __cplusplus
-}
-#endif
/*
* There are a number of defines you can set at compile time that affect how
* the memory allocator will operate.
@@ -59,8 +60,34 @@ extern "C" {
* ----------------------------------------------------------------------------
*/
+/////////////////////////////////////////////////
+#ifdef DEBUG_ESP_OOM
+
+#define MEMLEAK_DEBUG
+
+// umm_*alloc are not renamed to *alloc
+
+void *umm_malloc( size_t size );
+void *umm_calloc( size_t num, size_t size );
+void *umm_realloc( void *ptr, size_t size );
+#define umm_free free
+#define umm_zalloc(s) umm_calloc(1,s)
+
+void* malloc_loc (size_t s, const char* file, int line);
+void* calloc_loc (size_t n, size_t s, const char* file, int line);
+void* realloc_loc (void* p, size_t s, const char* file, int line);
+
+// *alloc are macro calling *alloc_loc calling+checking umm_*alloc()
+// they are defined at the bottom of this file
+
+/////////////////////////////////////////////////
+#else // !defined(ESP_DEBUG_OOM)
+
+ // umm_*alloc are renamed to *alloc
#define UMM_REDEFINE_MEM_FUNCTIONS
+#endif
+
#define UMM_BEST_FIT
/* Start addresses and the size of the heap */
@@ -140,4 +167,18 @@ extern char _heap_start;
#define UMM_POISONED_BLOCK_LEN_TYPE uint32_t
#define UMM_HEAP_CORRUPTION_CB() panic()
+
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _UMM_MALLOC_CFG_H */
+
+#ifdef DEBUG_ESP_OOM
+// this must be outside from "#ifndef _UMM_MALLOC_CFG_H"
+// because Arduino.h's does #undef *alloc
+// Arduino.h recall us to redefine them
+#define malloc(s) ({ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; malloc_loc(s, mem_debug_file, __LINE__); })
+#define calloc(n,s) ({ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; calloc_loc(n, s, mem_debug_file, __LINE__); })
+#define realloc(p,s) ({ static const char mem_debug_file[] ICACHE_RODATA_ATTR STORE_ATTR = __FILE__; realloc_loc(p, s, mem_debug_file, __LINE__); })
+#endif /* DEBUG_ESP_OOM */
diff --git a/doc/.gitignore b/doc/.gitignore
new file mode 100644
index 0000000000..e35d8850c9
--- /dev/null
+++ b/doc/.gitignore
@@ -0,0 +1 @@
+_build
diff --git a/doc/Makefile b/doc/Makefile
new file mode 100644
index 0000000000..36b4923488
--- /dev/null
+++ b/doc/Makefile
@@ -0,0 +1,20 @@
+# Minimal makefile for Sphinx documentation
+#
+
+# You can set these variables from the command line.
+SPHINXOPTS =
+SPHINXBUILD = sphinx-build
+SPHINXPROJ = ESP8266ArduinoCore
+SOURCEDIR = .
+BUILDDIR = _build
+
+# Put it first so that "make" without argument is like "make help".
+help:
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+.PHONY: help Makefile
+
+# Catch-all target: route all unknown targets to Sphinx using the new
+# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
+%: Makefile
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
\ No newline at end of file
diff --git a/doc/PROGMEM.rst b/doc/PROGMEM.rst
new file mode 100644
index 0000000000..43f1ad95d5
--- /dev/null
+++ b/doc/PROGMEM.rst
@@ -0,0 +1,253 @@
+Guide to PROGMEM on ESP8266 and Arduino IDE
+===========================================
+
+Intro
+-----
+
+PROGMEM is a Arduino AVR feature that has been ported to ESP8266 to
+ensure compatability with existing Arduino libraries, as well as, saving
+RAM. On the esp8266 declaring a string such as ``const char * xyz =
+"this is a string"`` will place this string in RAM, not flash. It is
+possible to place a String into flash, and then load it into RAM when
+it is needed. On an 8bit AVR this process is very simple. On the 32bit
+ESP8266 there are conditions that must be met to read back from flash.
+
+On the ESP8266 PROGMEM is a macro:
+
+.. code:: cpp
+
+ #define PROGMEM ICACHE_RODATA_ATTR
+
+``ICACHE_RODATA_ATTR`` is defined by:
+
+.. code:: cpp
+
+ #define ICACHE_RODATA_ATTR __attribute__((section(".irom.text")))
+
+Which places the variable in the .irom.text section in flash. Placing strings in
+flash requires using any of the methods above.
+
+| ### Declare a global string to be stored in flash.
+
+.. code:: cpp
+
+ static const char xyz[] PROGMEM = "This is a string stored in flash";
+
+Declare a flash string within code block.
+-----------------------------------------
+
+For this you can use the PSTR macro. Which are all defined in
+`pgmspace.h `__
+
+.. code:: cpp
+
+ #define PGM_P const char *
+ #define PGM_VOID_P const void *
+ #define PSTR(s) (__extension__({static const char __c[] PROGMEM = (s); &__c[0];}))
+
+In practice:
+
+.. code:: cpp
+
+ void myfunction(void) {
+ PGM_P xyz = PSTR("Store this string in flash");
+ const char * abc = PSTR("Also Store this string in flash");
+ }
+
+The two examples above will store these strings in flash. To retrieve
+and manipulate flash strings they must be read from flash in 4byte words.
+In the Arduino IDE for esp8266 there are several functions that can help
+retrieve strings from flash that have been stored using PROGMEM. Both of
+the examples above return ``const char *``. However use of these pointers,
+without correct 32bit alignment you will cause a segmentation fault and
+the ESP8266 will crash. You must read from the flash 32 bit aligned.
+
+Functions to read back from PROGMEM
+-----------------------------------
+
+Which are all defined in
+`pgmspace.h `__
+
+.. code:: cpp
+
+ int memcmp_P(const void* buf1, PGM_VOID_P buf2P, size_t size);
+ void* memccpy_P(void* dest, PGM_VOID_P src, int c, size_t count);
+ void* memmem_P(const void* buf, size_t bufSize, PGM_VOID_P findP, size_t findPSize);
+ void* memcpy_P(void* dest, PGM_VOID_P src, size_t count);
+ char* strncpy_P(char* dest, PGM_P src, size_t size);
+ char* strcpy_P(dest, src)
+ char* strncat_P(char* dest, PGM_P src, size_t size);
+ char* strcat_P(dest, src)
+ int strncmp_P(const char* str1, PGM_P str2P, size_t size);
+ int strcmp_P(str1, str2P)
+ int strncasecmp_P(const char* str1, PGM_P str2P, size_t size);
+ int strcasecmp_P(str1, str2P)
+ size_t strnlen_P(PGM_P s, size_t size);
+ size_t strlen_P(strP)
+ char* strstr_P(const char* haystack, PGM_P needle);
+ int printf_P(PGM_P formatP, ...);
+ int sprintf_P(char *str, PGM_P formatP, ...);
+ int snprintf_P(char *str, size_t strSize, PGM_P formatP, ...);
+ int vsnprintf_P(char *str, size_t strSize, PGM_P formatP, va_list ap);
+
+There are a lot of functions there but in reality they are ``_P``
+versions of standard c functions that are adapted to read from the
+esp8266 32bit aligned flash. All of them take a ``PGM_P`` which is
+essentially a ``const char *``. Under the hood these functions all use, a
+process to ensure that 4 bytes are read, and the request byte is returned.
+
+This works well when you have designed a function as above that is
+specialised for dealing with PROGMEM pointers but there is no type
+checking except against ``const char *``. This means that it is totally
+legitimate, as far as the compiler is concerned, for you to pass it any
+``const char *`` string, which is obviously not true and will lead to
+undefined behaviour. This makes it impossible to create any overloaded
+functions that can use flash strings when they are defined as ``PGM_P``.
+If you try you will get an ambiguous overload error as ``PGM_P`` ==
+``const char *``.
+
+Enter the \_\_FlashStringHelper... This is a wrapper class that allows flash
+strings to be used as a class, this means that type checking and function
+overloading can be used with flash strings. Most people will be familiar with
+the ``F()`` macro and possibly the FPSTR() macro. These are defined in `WString.h `__:
+
+.. code:: cpp
+
+ #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
+``__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.
+
+.. code:: cpp
+
+ static const char xyz[] PROGMEM = "This is a string stored in flash";
+ Serial.println(FPSTR(xyz));
+
+The ``F()`` combines both of these methods to create an easy and quick
+way to store an inline string in flash, and return the type
+``__FlashStringHelper``. For example:
+
+.. code:: cpp
+
+ Serial.println(F("This is a string stored in flash"));
+
+Although these two functions provide a similar function, they serve
+different roles. ``FPSTR()`` allows you to define a global flash string
+and then use it in any function that takes ``__FlashStringHelper``.
+``F()`` allows you to define these flash strings in place, but you can't
+use them anywhere else. The consequence of this is sharing common
+strings is possible using ``FPSTR()`` but not ``F()``.
+``__FlashStringHelper`` is what the String class uses to overload its
+constructor:
+
+.. code:: cpp
+
+ String(const char *cstr = ""); // constructor from const char *
+ String(const String &str); // copy constructor
+ String(const __FlashStringHelper *str); // constructor for flash strings
+
+This allows you to write:
+
+.. code:: cpp
+
+ String mystring(F("This string is stored in flash"));
+
+How do I write a function to use \_\_FlashStringHelper? Simples: cast the pointer back to a PGM\_P and use the ``_P`` functions shown above. This an example implementation for String for the concat function.
+
+.. code:: cpp
+
+ unsigned char String::concat(const __FlashStringHelper * str) {
+ if (!str) return 0; // return if the pointer is void
+ int length = strlen_P((PGM_P)str); // cast it to PGM_P, which is basically const char *, and measure it using the _P version of strlen.
+ if (length == 0) return 1;
+ unsigned int newlen = len + length;
+ if (!reserve(newlen)) return 0; // create a buffer of the correct length
+ strcpy_P(buffer + len, (PGM_P)str); //copy the string in using strcpy_P
+ len = newlen;
+ return 1;
+ }
+
+How do I declare a global flash string and use it?
+--------------------------------------------------
+
+.. code:: cpp
+
+ static const char xyz[] PROGMEM = "This is a string stored in flash. Len = %u";
+
+ void setup() {
+ Serial.begin(115200); Serial.println();
+ Serial.println( FPSTR(xyz) ); // just prints the string, must convert it to FlashStringHelper first using FPSTR().
+ Serial.printf_P( xyz, strlen_P(xyz)); // use printf with PROGMEM string
+ }
+
+How do I use inline flash strings?
+----------------------------------
+
+.. code:: cpp
+
+ void setup() {
+ Serial.begin(115200); Serial.println();
+ Serial.println( F("This is an inline string")); //
+ Serial.printf_P( PSTR("This is an inline string using printf %s"), "hello");
+ }
+
+How do I declare and use data in PROGMEM?
+-----------------------------------------
+
+.. code:: cpp
+
+ const size_t len_xyz = 30;
+ const uint8_t xyz[] PROGMEM = {
+ 0x53, 0x61, 0x79, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20,
+ 0x74, 0x6f, 0x20, 0x4d, 0x79, 0x20, 0x4c, 0x69, 0x74, 0x74,
+ 0x6c, 0x65, 0x20, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x00};
+
+ void setup() {
+ Serial.begin(115200); Serial.println();
+ uint8_t * buf = new uint8_t[len_xyz];
+ if (buf) {
+ memcpy_P(buf, xyz, len_xyz);
+ Serial.write(buf, len_xyz); // output the buffer.
+ }
+ }
+
+How do I declare some data in PROGMEM, and retrieve one byte from it.
+---------------------------------------------------------------------
+
+Declare the data as done previously, then use ``pgm_read_byte`` to get
+the value back.
+
+.. code:: cpp
+
+ const size_t len_xyz = 30;
+ const uint8_t xyz[] PROGMEM = {
+ 0x53, 0x61, 0x79, 0x20, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20,
+ 0x74, 0x6f, 0x20, 0x4d, 0x79, 0x20, 0x4c, 0x69, 0x74, 0x74,
+ 0x6c, 0x65, 0x20, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x00
+ };
+
+ void setup() {
+ Serial.begin(115200); Serial.println();
+ for (int i = 0; i < len_xyz; i++) {
+ uint8_t byteval = pgm_read_byte(xyz + i);
+ Serial.write(byteval); // output the buffer.
+ }
+ }
+
+In summary
+----------
+
+It is easy to store strings in flash using ``PROGMEM`` and ``PSTR`` but
+you have to create functions that specifically use the pointers they
+generate as they are basically ``const char *``. On the other hand
+``FPSTR`` and ``F()`` give you a class that you can do implicit
+conversions from, very useful when overloading functions, and doing
+implicit type conversions. It is worth adding that if you wish to store
+an ``int``, ``float`` or pointer these can be stored and read back
+directly as they are 4 bytes in size and therefor will be always
+aligned!
+
+Hope this helps.
diff --git a/doc/Troubleshooting/debugging.md b/doc/Troubleshooting/debugging.md
deleted file mode 100644
index 47a3cbebb4..0000000000
--- a/doc/Troubleshooting/debugging.md
+++ /dev/null
@@ -1,102 +0,0 @@
----
-title: Debugging
----
-
-## Table of Contents
- * [Introduction](#introduction)
- * [Requirements](#requirements)
- * [Usage](#Usage)
- * [Informations](#Informations)
- * [For Developers](#for-developers)
-
-## Introduction
-
-Since 2.1.0-rc1 the core includes a Debugging feature that is controllable over the IDE menu.
-
-The new menu points manage the real-time Debug messages.
-
-### Requirements
-
-For usage of the debugging a Serial connection is required (Serial or Serial1).
-
-The Serial Interface need to be initialized in the ```setup()```.
-
-Set the Serial baud rate as high as possible for your Hardware setup.
-
-Minimum sketch to use debugging:
-```cpp
-void setup() {
- Serial.begin(115200);
-}
-
-void loop() {
-}
-```
-
-### Usage
-
-1. Select the Serial interface for the Debugging messages:
-
-
-2. Select which type / level you want debug messages for:
-
-
-3. Check if the Serial interface is initialized in ```setup()``` (see [Requirements](#requirements))
-
-4. Flash sketch
-
-5. Check the Serial Output
-
-
-
-## Informations
-
-It work with every sketch that enables the Serial interface that is selected as debug port.
-
-The Serial interface can still be used normal in the Sketch.
-
-The debug output is additional and will not disable any interface from usage in the sketch.
-
-### For Developers
-
-For the debug handling uses defines.
-
-The defined are set by command line.
-
-#### Debug Port
-
-The port has the define ```DEBUG_ESP_PORT``` possible value:
- - Disabled: define not existing
- - Serial: Serial
- - Serial1: Serial1
-
-#### Debug Level
-
-All defines for the different levels starts with ```DEBUG_ESP_```
-
-a full list can be found here in the [boards.txt](https://github.com/esp8266/Arduino/blob/master/boards.txt#L180)
-
-#### Example for own debug messages
-
-The debug messages will be only shown when the Debug Port in the IDE menu is set.
-
-```cpp
-#ifdef DEBUG_ESP_PORT
-#define DEBUG_MSG(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
-#else
-#define DEBUG_MSG(...)
-#endif
-
-void setup() {
- Serial.begin(115200);
-
- delay(3000);
- DEBUG_MSG("bootup...\n");
-}
-
-void loop() {
- DEBUG_MSG("loop %d\n", millis());
- delay(1000);
-}
-```
-
diff --git a/doc/Troubleshooting/debugging.rst b/doc/Troubleshooting/debugging.rst
new file mode 100644
index 0000000000..970cb0e7b6
--- /dev/null
+++ b/doc/Troubleshooting/debugging.rst
@@ -0,0 +1,107 @@
+Debugging
+=========
+
+Introduction
+------------
+
+Since 2.1.0-rc1 the core includes a Debugging feature that is
+controllable over the IDE menu.
+
+The new menu points manage the real-time Debug messages.
+
+Requirements
+~~~~~~~~~~~~
+
+For usage of the debugging a Serial connection is required (Serial or
+Serial1).
+
+The Serial Interface need to be initialized in the ``setup()``.
+
+Set the Serial baud rate as high as possible for your Hardware setup.
+
+Minimum sketch to use debugging:
+
+.. code:: cpp
+
+ void setup() {
+ Serial.begin(115200);
+ }
+
+ void loop() {
+ }
+
+Usage
+~~~~~
+
+1. Select the Serial interface for the Debugging messages: |Debug-Port|
+
+2. Select which type / level you want debug messages for: |Debug-Level|
+
+3. Check if the Serial interface is initialized in ``setup()`` (see
+ `Requirements <#requirements>`__)
+
+4. Flash sketch
+
+5. Check the Serial Output
+
+Informations
+------------
+
+It work with every sketch that enables the Serial interface that is
+selected as debug port.
+
+The Serial interface can still be used normal in the Sketch.
+
+The debug output is additional and will not disable any interface from
+usage in the sketch.
+
+For Developers
+~~~~~~~~~~~~~~
+
+For the debug handling uses defines.
+
+The defined are set by command line.
+
+Debug Port
+^^^^^^^^^^
+
+The port has the define ``DEBUG_ESP_PORT`` possible value: - Disabled:
+define not existing - Serial: Serial - Serial1: Serial1
+
+Debug Level
+^^^^^^^^^^^
+
+All defines for the different levels starts with ``DEBUG_ESP_``
+
+a full list can be found here in the
+`boards.txt `__
+
+Example for own debug messages
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The debug messages will be only shown when the Debug Port in the IDE
+menu is set.
+
+.. code:: cpp
+
+ #ifdef DEBUG_ESP_PORT
+ #define DEBUG_MSG(...) DEBUG_ESP_PORT.printf( __VA_ARGS__ )
+ #else
+ #define DEBUG_MSG(...)
+ #endif
+
+ void setup() {
+ Serial.begin(115200);
+
+ delay(3000);
+ DEBUG_MSG("bootup...\n");
+ }
+
+ void loop() {
+ DEBUG_MSG("loop %d\n", millis());
+ delay(1000);
+ }
+
+.. |Debug-Port| image:: debug_port.png
+.. |Debug-Level| image:: debug_level.png
+
diff --git a/doc/Troubleshooting/stack_dump.md b/doc/Troubleshooting/stack_dump.md
deleted file mode 100644
index 49c544940e..0000000000
--- a/doc/Troubleshooting/stack_dump.md
+++ /dev/null
@@ -1,66 +0,0 @@
----
-title: Debugging
----
-
-## Table of Contents
- * [Introduction](#introduction)
- * [Decode](#Decode)
-
-## Introduction
-
-If the ESP crash the Exception Cause will be shown and the current stack will be dumped.
-
-example:
-
-```
-Exception (0): epc1=0x402103f4 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
-
-ctx: sys
-sp: 3ffffc10 end: 3fffffb0 offset: 01a0
-
->>>stack>>>
-3ffffdb0: 40223e00 3fff6f50 00000010 60000600
-3ffffdc0: 00000001 4021f774 3fffc250 4000050c
-3ffffdd0: 400043d5 00000030 00000016 ffffffff
-3ffffde0: 400044ab 3fffc718 3ffffed0 08000000
-3ffffdf0: 60000200 08000000 00000003 00000000
-3ffffe00: 0000ffff 00000001 04000002 003fd000
-3ffffe10: 3fff7188 000003fd 3fff2564 00000030
-3ffffe20: 40101709 00000008 00000008 00000020
-3ffffe30: c1948db3 394c5e70 7f2060f2 c6ba0c87
-3ffffe40: 3fff7058 00000001 40238d41 3fff6ff0
-3ffffe50: 3fff6f50 00000010 60000600 00000020
-3ffffe60: 402301a8 3fff7098 3fff7014 40238c77
-3ffffe70: 4022fb6c 40230ebe 3fff1a5b 3fff6f00
-3ffffe80: 3ffffec8 00000010 40231061 3fff0f90
-3ffffe90: 3fff6848 3ffed0c0 60000600 3fff6ae0
-3ffffea0: 3fff0f90 3fff0f90 3fff6848 3fff6d40
-3ffffeb0: 3fff28e8 40101233 d634fe1a fffeffff
-3ffffec0: 00000001 00000000 4022d5d6 3fff6848
-3ffffed0: 00000002 4000410f 3fff2394 3fff6848
-3ffffee0: 3fffc718 40004a3c 000003fd 3fff7188
-3ffffef0: 3fffc718 40101510 00000378 3fff1a5b
-3fffff00: 000003fd 4021d2e7 00000378 000003ff
-3fffff10: 00001000 4021d37d 3fff2564 000003ff
-3fffff20: 000003fd 60000600 003fd000 3fff2564
-3fffff30: ffffff00 55aa55aa 00000312 0000001c
-3fffff40: 0000001c 0000008a 0000006d 000003ff
-3fffff50: 4021d224 3ffecf90 00000000 3ffed0c0
-3fffff60: 00000001 4021c2e9 00000003 3fff1238
-3fffff70: 4021c071 3ffecf84 3ffecf30 0026a2b0
-3fffff80: 4021c0b6 3fffdab0 00000000 3fffdcb0
-3fffff90: 3ffecf40 3fffdab0 00000000 3fffdcc0
-3fffffa0: 40000f49 40000f49 3fffdab0 40000f49
-<<>>stack>>>
+ 3ffffdb0: 40223e00 3fff6f50 00000010 60000600
+ 3ffffdc0: 00000001 4021f774 3fffc250 4000050c
+ 3ffffdd0: 400043d5 00000030 00000016 ffffffff
+ 3ffffde0: 400044ab 3fffc718 3ffffed0 08000000
+ 3ffffdf0: 60000200 08000000 00000003 00000000
+ 3ffffe00: 0000ffff 00000001 04000002 003fd000
+ 3ffffe10: 3fff7188 000003fd 3fff2564 00000030
+ 3ffffe20: 40101709 00000008 00000008 00000020
+ 3ffffe30: c1948db3 394c5e70 7f2060f2 c6ba0c87
+ 3ffffe40: 3fff7058 00000001 40238d41 3fff6ff0
+ 3ffffe50: 3fff6f50 00000010 60000600 00000020
+ 3ffffe60: 402301a8 3fff7098 3fff7014 40238c77
+ 3ffffe70: 4022fb6c 40230ebe 3fff1a5b 3fff6f00
+ 3ffffe80: 3ffffec8 00000010 40231061 3fff0f90
+ 3ffffe90: 3fff6848 3ffed0c0 60000600 3fff6ae0
+ 3ffffea0: 3fff0f90 3fff0f90 3fff6848 3fff6d40
+ 3ffffeb0: 3fff28e8 40101233 d634fe1a fffeffff
+ 3ffffec0: 00000001 00000000 4022d5d6 3fff6848
+ 3ffffed0: 00000002 4000410f 3fff2394 3fff6848
+ 3ffffee0: 3fffc718 40004a3c 000003fd 3fff7188
+ 3ffffef0: 3fffc718 40101510 00000378 3fff1a5b
+ 3fffff00: 000003fd 4021d2e7 00000378 000003ff
+ 3fffff10: 00001000 4021d37d 3fff2564 000003ff
+ 3fffff20: 000003fd 60000600 003fd000 3fff2564
+ 3fffff30: ffffff00 55aa55aa 00000312 0000001c
+ 3fffff40: 0000001c 0000008a 0000006d 000003ff
+ 3fffff50: 4021d224 3ffecf90 00000000 3ffed0c0
+ 3fffff60: 00000001 4021c2e9 00000003 3fff1238
+ 3fffff70: 4021c071 3ffecf84 3ffecf30 0026a2b0
+ 3fffff80: 4021c0b6 3fffdab0 00000000 3fffdcb0
+ 3fffff90: 3ffecf40 3fffdab0 00000000 3fffdcc0
+ 3fffffa0: 40000f49 40000f49 3fffdab0 40000f49
+ <<`
+the hex after are the stack dump.
+
+Decode
+~~~~~~
+
+It's possible to decode the Stack to readable information. For more info see the `Esp Exception Decoder `__ tool.
+
+.. figure:: ESP_Exception_Decoderp.png
+ :alt: ESP Exception Decoder
+
+ ESP Exception Decoder
diff --git a/doc/_static/.keep b/doc/_static/.keep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/doc/boards.md b/doc/boards.md
deleted file mode 100644
index f500263b0d..0000000000
--- a/doc/boards.md
+++ /dev/null
@@ -1,308 +0,0 @@
----
-title: Supported Hardware
----
-
-## Table of contents
- * [Adafruit HUZZAH ESP8266 (ESP\-12)](#adafruit-huzzah-esp8266-esp-12)
- * [ESPresso Lite 1\.0](#espresso-lite-10)
- * [ESPresso Lite 2\.0](#espresso-lite-20)
- * [NodeMCU 0\.9 ](#nodemcu-09-)
- * [Pin mapping](#pin-mapping)
- * [NodeMCU 1\.0](#nodemcu-10)
- * [Olimex MOD\-WIFI\-ESP8266\-DEV](#olimex-mod-wifi-esp8266-dev)
- * [Olimex MOD\-WIFI\-ESP8266](#olimex-mod-wifi-esp8266)
- * [Olimex ESP8266\-EVB](#olimex-esp8266-evb)
- * [Phoenix 1\.0](#phoenix-10)
- * [Phoenix 2\.0](#phoenix-20)
- * [SparkFun ESP8266 Thing](#sparkfun-esp8266-thing)
- * [SweetPea ESP\-210](#sweetpea-esp-210)
- * [ESPino](#espino)
- * [WifInfo](#WifInfo)
- * [Generic ESP8266 modules](#generic-esp8266-modules)
- * [Generic ESP8285 modules](#generic-esp8285-modules)
- * [Serial Adapter](#serial-adapter)
- * [Minimal Hardware Setup for Bootloading and Usage](#minimal-hardware-setup-for-bootloading-and-usage)
- * [ESP to Serial](#esp-to-serial)
- * [Minimal Hardware Setup for Bootloading only](#minimal-hardware-setup-for-bootloading-only)
- * [Minimal Hardware Setup for Running only](#minimal-hardware-setup-for-running-only)
- * [Minimal](#minimal)
- * [Improved Stability](#improved-stability)
- * [Boot Messages and Modes](#boot-messages-and-modes)
- * [rst cause](#rst-cause)
- * [boot mode](#boot-mode)
- * [WeMos D1](#wemos-d1)
- * [WeMos D1 mini](#wemos-d1-mini)
- * [ESPino by ThaiEasyElec](#espinotee)
-
-## Adafruit HUZZAH ESP8266 (ESP-12)
-
-*TODO: add notes*
-
-## ESPresso Lite 1.0
-
-ESPresso Lite 1.0 (beta version) is an Arduino-compatible Wi-Fi development board powered by Espressif System's own ESP8266 WROOM-02 module. It has breadboard-friendly breakout pins with in-built LED, two reset/flash buttons and a user programmable button . The operating voltage is 3.3VDC, regulated with 800mA maximum current. Special distinctive features include on-board I2C pads that allow direct connection to OLED LCD and sensor boards.
-
-## ESPresso Lite 2.0
-
-ESPresso Lite 2.0 is an Arduino-compatible Wi-Fi development board based on an earlier V1 (beta version). Re-designed together with Cytron Technologies, the newly-revised ESPresso Lite V2.0 features the auto-load/auto-program function, eliminating the previous need to reset the board manually before flashing a new program. It also feature two user programmable side buttons and a reset button. The special distinctive features of on-board pads for I2C sensor and actuator is retained.
-
-## Phoenix 1.0
-
-Product page: http://www.espert.co
-
-## Phoenix 2.0
-
-Product page: http://www.espert.co
-
-## NodeMCU 0.9
-
-### Pin mapping
-
-Pin numbers written on the board itself do not correspond to ESP8266 GPIO pin numbers. Constants are defined to make using this board easier:
-
-```C++
-static const uint8_t D0 = 16;
-static const uint8_t D1 = 5;
-static const uint8_t D2 = 4;
-static const uint8_t D3 = 0;
-static const uint8_t D4 = 2;
-static const uint8_t D5 = 14;
-static const uint8_t D6 = 12;
-static const uint8_t D7 = 13;
-static const uint8_t D8 = 15;
-static const uint8_t D9 = 3;
-static const uint8_t D10 = 1;
-```
-
-If you want to use NodeMCU pin 5, use D5 for pin number, and it will be translated to 'real' GPIO pin 14.
-
-## NodeMCU 1.0
-
-This module is sold under many names for around $6.50 on AliExpress and it's one of the cheapest, fully integrated ESP8266 solutions.
-
-It's an open hardware design with an ESP-12E core and 4 MB of SPI flash.
-
-Acording to the manufacturer, "with a micro USB cable, you can connect NodeMCU devkit to your laptop and flash it without any trouble". This is more or less true: the board comes with a CP2102 onboard USB to serial adapter which just works, well, the majority of the time. Sometimes flashing fails and you have to reset the board by holding down FLASH + RST, then releasing FLASH, then releasing RST. This forces the CP2102 device to power cycle and to be re-numbered by Linux.
-
-The board also features a NCP1117 voltage regulator, a blue LED on GPIO16 and a 220k/100k Ohm voltage divider on the ADC input pin.
-
-Full pinout and PDF schematics can be found [here](https://github.com/nodemcu/nodemcu-devkit-v1.0)
-
-## Olimex MOD-WIFI-ESP8266-DEV
-
-This board comes with 2 MB of SPI flash and optional accessories (e.g. evaluation board ESP8266-EVB or BAT-BOX for batteries).
-
-The basic module has three solder jumpers that allow you to switch the operating mode between SDIO, UART and FLASH.
-
-The board is shipped for FLASH operation mode, with jumpers TD0JP=0, IO0JP=1, IO2JP=1.
-
-Since jumper IO0JP is tied to GPIO0, which is PIN 21, you'll have to ground it before programming with a USB to serial adapter and reset the board by power cycling it.
-
-UART pins for programming and serial I/O are GPIO1 (TXD, pin 3) and GPIO3 (RXD, pin 4).
-
-You can find the board schematics [here](https://github.com/OLIMEX/ESP8266/blob/master/HARDWARE/MOD-WIFI-ESP8266-DEV/MOD-WIFI-ESP8266-DEV_schematic.pdf)
-
-## Olimex MOD-WIFI-ESP8266
-
-This is a stripped down version of the above. Behaves identically in terms of jumpers but has less pins readily available for I/O. Still 2 MB of SPI flash.
-
-## Olimex ESP8266-EVB
-
-It's a Olimex MOD-WIFI-ESP8266-DEV module installed on the headers of a development board which features some breakout connectors, a button (GPIO0) and a relay (GPIO5).
-
-Programming is pretty straightforward: the board is supported in the Arduino IDE after [installing it via the Board Manager](https://github.com/esp8266/Arduino#installing-with-boards-manager). To download a program you just have to connect GND/RX/TX from a serial/USB adapter to the UEXT connector and press the only button before applying power to enter UART mode.
-
-Don't connect 5V from the serial/USB adapter to the board or you won't be able to power cycle it for UART mode.
-
-You can find the board schematics [here](https://github.com/OLIMEX/ESP8266/blob/master/HARDWARE/ESP8266-EVB/ESP8266-EVB_Rev_A.pdf).
-
-[This guide](https://www.olimex.com/Products/IoT/ESP8266-EVB/resources/ESP8266-EVB-how-to-use-Arduino.pdf) is also useful for the first setup, since it contains the UEXT connector pinout.
-
-Board variants include:
- * ESP8266-EVB-BAT: comes with built-in LiPo charger and step-up converter
- * ESP8266-EVB-BAT-BOX: as above, but enclosd in a plastic box (non-weatherproof)
-
-## SparkFun ESP8266 Thing ###
-
-Product page: https://www.sparkfun.com/products/13231
-
-*TODO: add notes*
-
-## SweetPea ESP-210
-
-*TODO: add notes*
-
-## ESPino
-
-ESPino integrates the ESP-12 module with a 3.3v regulator, CP2104 USB-Serial bridge and a micro USB connector for easy programming. It is designed for fitting in a breadboard and has an RGB Led and two buttons for easy prototyping.
-
-For more information about the hardware, pinout diagram and programming procedures, please see the [datasheet](https://github.com/makerlabmx/ESPino-tools/raw/master/Docs/ESPino-Datasheet-EN.pdf).
-
-Product page: http://www.espino.io/en
-
-## WifInfo
-
-WifInfo integrates the ESP-12 or ESP-07+Ext antenna module with a 3.3v regulator and the hardware to be able to measure French telemetry issue from ERDF powering meter serial output. It has a USB connector for powering, an RGB WS2812 Led, 4 pins I2C connector to fit OLED or sensor, and two buttons + FTDI connector and auto reset feature.
-
-For more information, please see WifInfo related [blog](http://hallard.me/category/wifinfo/) entries, [github](https://github.com/hallard/WifInfo) and [community](https://community.hallard.me/category/16/wifinfo) forum.
-
-## Generic ESP8266 modules
-
-These modules come in different form factors and pinouts. See the page at ESP8266 community wiki for more info:
-[ESP8266 Module Family](http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family).
-
-Usually these modules have no bootstapping resistors on board, insufficient decoupling capacitors, no voltage regulator, no reset circuit, and no USB-serial adapter. This makes using them somewhat tricky, compared to development boards which add these features.
-
-In order to use these modules, make sure to observe the following:
-
-- **Provide sufficient power to the module.** For stable use of the ESP8266 a power supply with 3.3V and >= 250mA is required. Using the power available from USB to Serial adapter is not recommended, these adapters typically do not supply enough current to run ESP8266 reliably in every situation. An external supply or regulator along with filtering capacitors is preferred.
-
-- **Connect bootstapping resistors** to GPIO0, GPIO2, GPIO15 according to the schematics below.
-
-- **Put ESP8266 into bootloader mode** before uploading code.
-
-## Serial Adapter
-
-There are many different USB to Serial adapters / boards.
-To be able to put ESP8266 into bootloader mode using serial handshaking lines, you need the adapter which breaks out RTS and DTR outputs. CTS and DSR are not useful for upload (they are inputs). Make sure the adapter can work with 3.3V IO voltage: it should have a jumper or a switch to select between 5V and 3.3V, or be marked as 3.3V only.
-
-Adapters based around the following ICs should work:
-
- - FT232RL
- - CP2102
- - CH340G
-
-PL2303-based adapters are known not to work on Mac OS X. See https://github.com/igrr/esptool-ck/issues/9 for more info.
-
-## Minimal Hardware Setup for Bootloading and Usage
-
-
-| PIN | Resistor | Serial Adapter |
-| ------------- | -------- | -------------- |
-| VCC | | VCC (3.3V) |
-| GND | | GND |
-| TX or GPIO2* | | RX |
-| RX | | TX |
-| GPIO0 | PullUp | DTR |
-| Reset* | PullUp | RTS |
-| GPIO15* | PullDown | |
-| CH_PD | PullUp | |
-
-* Note
- - GPIO15 is also named MTDO
- - Reset is also named RSBT or REST (adding PullUp improves the stability of the module)
- - GPIO2 is alternative TX for the boot loader mode
- - **Directly connecting a pin to VCC or GND is not a substitute for a PullUp or PullDown resistor, doing this can break upload management and the serial console, instability has also been noted in some cases.**
-
-## ESP to Serial
-
-
-### Minimal Hardware Setup for Bootloading only ##
-ESPxx Hardware
-
-| PIN | Resistor | Serial Adapter |
-| ------------- | -------- | --------------- |
-| VCC | | VCC (3.3V) |
-| GND | | GND |
-| TX or GPIO2 | | RX |
-| RX | | TX |
-| GPIO0 | | GND |
-| Reset | | RTS* |
-| GPIO15 | PullDown | |
-| CH_PD | PullUp | |
-
-* Note
- - if no RTS is used a manual power toggle is needed
-
-### Minimal Hardware Setup for Running only ##
-
-ESPxx Hardware
-
-| PIN | Resistor | Power supply |
-| ------------- | -------- | --------------- |
-| VCC | | VCC (3.3V) |
-| GND | | GND |
-| GPIO0 | PullUp | |
-| GPIO15 | PullDown | |
-| CH_PD | PullUp | |
-
-## Minimal
-
-
-## Improved Stability
-
-
-## Boot Messages and Modes
-
-The ESP module checks at every boot the Pins 0, 2 and 15.
-based on them its boots in different modes:
-
-| GPIO15 | GPIO0 | GPIO2 | Mode |
-| ------ | ----- | ----- | -------------------------------- |
-| 0V | 0V | 3.3V | Uart Bootloader |
-| 0V | 3.3V | 3.3V | Boot sketch (SPI flash) |
-| 3.3V | x | x | SDIO mode (not used for Arduino) |
-
-
-at startup the ESP prints out the current boot mode example:
-```
-rst cause:2, boot mode:(3,6)
-```
-
-note:
- - GPIO2 is used as TX output and the internal Pullup is enabled on boot.
-
-### rst cause
-
-| Number | Description |
-| ------ | ---------------------- |
-| 0 | unknown |
-| 1 | normal boot |
-| 2 | reset pin |
-| 3 | software reset |
-| 4 | watchdog reset |
-
-
-### boot mode
-
-the first value respects the pin setup of the Pins 0, 2 and 15.
-
-| Number | GPIO15 | GPIO0 | GPIO2 | Mode |
-| ------ | ------ | ----- | ----- | ---------- |
-| 0 | 0V | 0V | 0V | Not valid |
-| 1 | 0V | 0V | 3.3V | Uart |
-| 2 | 0V | 3.3V | 0V | Not valid |
-| 3 | 0V | 3.3V | 3.3V | Flash |
-| 4 | 3.3V | 0V | 0V | SDIO |
-| 5 | 3.3V | 0V | 3.3V | SDIO |
-| 6 | 3.3V | 3.3V | 0V | SDIO |
-| 7 | 3.3V | 3.3V | 3.3V | SDIO |
-
-note:
- - number = ((GPIO15 << 2) | (GPIO0 << 1) | GPIO2);
-
-## Generic ESP8285 modules
-
-ESP8285 ([datasheet](http://espressif.com/sites/default/files/documentation/0a-esp8285_datasheet_en_v1.0_20160422.pdf)) is a multi-chip package which contains ESP8266 and 1MB flash.
-All points related to bootstrapping resistors and recommended circuits listed above apply to ESP8285 as well.
-
-Note that since ESP8285 has SPI flash memory internally connected in DOUT mode, pins 9 and 10 may be used as GPIO / I2C / PWM pins.
-
-## WeMos D1
-Product page: http://wemos.cc
-
-## WeMos D1 mini
-Product page: http://wemos.cc
-
-## ESPino (WROOM-02 Module) by ThaiEasyElec
-ESPino by ThaiEasyElec using WROOM-02 module from Espressif Systems with 4 MB Flash.
-
-We will update an English description soon.
-- Product page: http://thaieasyelec.com/products/wireless-modules/wifi-modules/espino-wifi-development-board-detail.html
-- Schematics: www.thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_Schematic.pdf
-- Dimensions: http://thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_Dimension.pdf
-- Pinouts: http://thaieasyelec.com/downloads/ETEE052/ETEE052_ESPino_User_Manual_TH_v1_0_20160204.pdf (Please see pg. 8)
-
-
-
-
diff --git a/doc/boards.rst b/doc/boards.rst
new file mode 100644
index 0000000000..d83e032b4e
--- /dev/null
+++ b/doc/boards.rst
@@ -0,0 +1,396 @@
+Boards
+======
+
+Generic ESP8266 Module
+----------------------
+
+These modules come in different form factors and pinouts. See the page at ESP8266 community wiki for more info: `ESP8266 Module Family `__.
+
+Usually these modules have no bootstapping resistors on board, insufficient decoupling capacitors, no voltage regulator, no reset circuit, and no USB-serial adapter. This makes using them somewhat tricky, compared to development boards which add these features.
+
+In order to use these modules, make sure to observe the following:
+
+- **Provide sufficient power to the module.** For stable use of the ESP8266 a power supply with 3.3V and >= 250mA is required. Using the power available from USB to Serial adapter is not recommended, these adapters typically do not supply enough current to run ESP8266 reliably in every situation. An external supply or regulator alongwith filtering capacitors is preferred.
+
+- **Connect bootstapping resistors** to GPIO0, GPIO2, GPIO15 according to the schematics below.
+
+- **Put ESP8266 into bootloader mode** before uploading code.
+
+Serial Adapter
+--------------
+
+There are many different USB to Serial adapters / boards. To be able to put ESP8266 into bootloader mode using serial handshaking lines, you need the adapter which breaks out RTS and DTR outputs. CTS and DSR are not useful for upload (they are inputs). Make sure the adapter can work with 3.3V IO voltage: it should have a jumper or a switch to select between 5V and 3.3V, or be marked as 3.3V only.
+
+Adapters based around the following ICs should work:
+
+- FT232RL
+- CP2102
+- CH340G
+
+PL2303-based adapters are known not to work on Mac OS X. See https://github.com/igrr/esptool-ck/issues/9 for more info.
+
+Minimal Hardware Setup for Bootloading and Usage
+------------------------------------------------
+
++-----------------+------------+------------------+
+| PIN | Resistor | Serial Adapter |
++=================+============+==================+
+| VCC | | VCC (3.3V) |
++-----------------+------------+------------------+
+| GND | | GND |
++-----------------+------------+------------------+
+| TX or GPIO2\* | | RX |
++-----------------+------------+------------------+
+| RX | | TX |
++-----------------+------------+------------------+
+| GPIO0 | PullUp | DTR |
++-----------------+------------+------------------+
+| Reset\* | PullUp | RTS |
++-----------------+------------+------------------+
+| GPIO15\* | PullDown | |
++-----------------+------------+------------------+
+| CH\_PD | PullUp | |
++-----------------+------------+------------------+
+
+- Note
+- GPIO15 is also named MTDO
+- Reset is also named RSBT or REST (adding PullUp improves the
+ stability of the module)
+- GPIO2 is alternative TX for the boot loader mode
+- **Directly connecting a pin to VCC or GND is not a substitute for a
+ PullUp or PullDown resistor, doing this can break upload management
+ and the serial console, instability has also been noted in some
+ cases.**
+
+ESP to Serial
+-------------
+
+.. figure:: ESP_to_serial.png
+ :alt: ESP to Serial
+
+ ESP to Serial
+
+Minimal Hardware Setup for Bootloading only
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ESPxx Hardware
+
++---------------+------------+------------------+
+| PIN | Resistor | Serial Adapter |
++===============+============+==================+
+| VCC | | VCC (3.3V) |
++---------------+------------+------------------+
+| GND | | GND |
++---------------+------------+------------------+
+| TX or GPIO2 | | RX |
++---------------+------------+------------------+
+| RX | | TX |
++---------------+------------+------------------+
+| GPIO0 | | GND |
++---------------+------------+------------------+
+| Reset | | RTS\* |
++---------------+------------+------------------+
+| GPIO15 | PullDown | |
++---------------+------------+------------------+
+| CH\_PD | PullUp | |
++---------------+------------+------------------+
+
+- Note
+- if no RTS is used a manual power toggle is needed
+
+Minimal Hardware Setup for Running only
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ESPxx Hardware
+
++----------+------------+----------------+
+| PIN | Resistor | Power supply |
++==========+============+================+
+| VCC | | VCC (3.3V) |
++----------+------------+----------------+
+| GND | | GND |
++----------+------------+----------------+
+| GPIO0 | PullUp | |
++----------+------------+----------------+
+| GPIO15 | PullDown | |
++----------+------------+----------------+
+| CH\_PD | PullUp | |
++----------+------------+----------------+
+
+Minimal
+-------
+
+.. figure:: ESP_min.png
+ :alt: ESP min
+
+ ESP min
+
+Improved Stability
+------------------
+
+.. figure:: ESP_improved_stability.png
+ :alt: ESP improved stability
+
+ ESP improved stability
+
+Boot Messages and Modes
+-----------------------
+
+The ESP module checks at every boot the Pins 0, 2 and 15. based on them its boots in different modes:
+
++----------+---------+---------+------------------------------------+
+| GPIO15 | GPIO0 | GPIO2 | Mode |
++==========+=========+=========+====================================+
+| 0V | 0V | 3.3V | Uart Bootloader |
++----------+---------+---------+------------------------------------+
+| 0V | 3.3V | 3.3V | Boot sketch (SPI flash) |
++----------+---------+---------+------------------------------------+
+| 3.3V | x | x | SDIO mode (not used for Arduino) |
++----------+---------+---------+------------------------------------+
+
+at startup the ESP prints out the current boot mode example:
+
+::
+
+ rst cause:2, boot mode:(3,6)
+
+note: - GPIO2 is used as TX output and the internal Pullup is enabled on boot.
+
+rst cause
+~~~~~~~~~
+
++----------+------------------+
+| Number | Description |
++==========+==================+
+| 0 | unknown |
++----------+------------------+
+| 1 | normal boot |
++----------+------------------+
+| 2 | reset pin |
++----------+------------------+
+| 3 | software reset |
++----------+------------------+
+| 4 | watchdog reset |
++----------+------------------+
+
+boot mode
+~~~~~~~~~
+
+the first value respects the pin setup of the Pins 0, 2 and 15.
+
++----------+----------+---------+---------+-------------+
+| Number | GPIO15 | GPIO0 | GPIO2 | Mode |
++==========+==========+=========+=========+=============+
+| 0 | 0V | 0V | 0V | Not valid |
++----------+----------+---------+---------+-------------+
+| 1 | 0V | 0V | 3.3V | Uart |
++----------+----------+---------+---------+-------------+
+| 2 | 0V | 3.3V | 0V | Not valid |
++----------+----------+---------+---------+-------------+
+| 3 | 0V | 3.3V | 3.3V | Flash |
++----------+----------+---------+---------+-------------+
+| 4 | 3.3V | 0V | 0V | SDIO |
++----------+----------+---------+---------+-------------+
+| 5 | 3.3V | 0V | 3.3V | SDIO |
++----------+----------+---------+---------+-------------+
+| 6 | 3.3V | 3.3V | 0V | SDIO |
++----------+----------+---------+---------+-------------+
+| 7 | 3.3V | 3.3V | 3.3V | SDIO |
++----------+----------+---------+---------+-------------+
+
+note: - number = ((GPIO15 << 2) \| (GPIO0 << 1) \| GPIO2);
+
+Generic ESP8285 Module
+----------------------
+
+ESP8285 (`datasheet `__) is a multi-chip package which contains ESP8266 and 1MB flash. All points related to bootstrapping resistors and recommended circuits listed above apply to ESP8285 as well.
+
+Note that since ESP8285 has SPI flash memory internally connected in DOUT mode, pins 9 and 10 may be used as GPIO / I2C / PWM pins.
+
+ESPDuino (ESP-13 Module)
+------------------------
+
+*TODO*
+
+Adafruit Feather HUZZAH ESP8266
+-------------------------------
+
+The Adafruit Feather HUZZAH ESP8266 is an Arduino-compatible Wi-Fi development board powered by Ai-Thinker's ESP-12S, clocked at 80 MHz at 3.3V logic. A high-quality SiLabs CP2104 USB-Serial chip is included so that you can upload code at a blistering 921600 baud for fast development time. It also has auto-reset so no noodling with pins and reset button pressings. A 3.7V Lithium polymer battery connector is included, making it ideal for portable projects. The Adafruit Feather HUZZAH ESP8266 will automatically recharge a connected battery when USB power is available.
+
+Product page: https://www.adafruit.com/product/2821
+
+ESPresso Lite 1.0
+-----------------
+
+ESPresso Lite 1.0 (beta version) is an Arduino-compatible Wi-Fi development board powered by Espressif System's own ESP8266 WROOM-02 module. It has breadboard-friendly breakout pins with in-built LED, two reset/flash buttons and a user programmable button . The operating voltage is 3.3VDC, regulated with 800mA maximum current. Special distinctive features include on-board I2C pads that allow direct connection to OLED LCD and sensor boards.
+
+ESPresso Lite 2.0
+-----------------
+
+ESPresso Lite 2.0 is an Arduino-compatible Wi-Fi development board based on an earlier V1 (beta version). Re-designed together with Cytron Technologies, the newly-revised ESPresso Lite V2.0 features the auto-load/auto-program function, eliminating the previous need to reset the board manually before flashing a new program. It also feature two user programmable side buttons and a reset button. The special distinctive features of on-board pads for I2C sensor and actuator is retained.
+
+Phoenix 1.0
+-----------
+
+Product page: http://www.espert.co
+
+Phoenix 2.0
+-----------
+
+Product page: http://www.espert.co
+
+NodeMCU 0.9 (ESP-12 Module)
+---------------------------
+
+Pin mapping
+~~~~~~~~~~~
+
+Pin numbers written on the board itself do not correspond to ESP8266 GPIO pin numbers. Constants are defined to make using this board easier:
+
+.. code:: c++
+
+ static const uint8_t D0 = 16;
+ static const uint8_t D1 = 5;
+ static const uint8_t D2 = 4;
+ static const uint8_t D3 = 0;
+ static const uint8_t D4 = 2;
+ static const uint8_t D5 = 14;
+ static const uint8_t D6 = 12;
+ static const uint8_t D7 = 13;
+ static const uint8_t D8 = 15;
+ static const uint8_t D9 = 3;
+ static const uint8_t D10 = 1;
+
+If you want to use NodeMCU pin 5, use D5 for pin number, and it will be translated to 'real' GPIO pin 14.
+
+NodeMCU 1.0 (ESP-12E Module)
+----------------------------
+
+This module is sold under many names for around $6.50 on AliExpress and it's one of the cheapest, fully integrated ESP8266 solutions.
+
+It's an open hardware design with an ESP-12E core and 4 MB of SPI flash.
+
+According to the manufacturer, "with a micro USB cable, you can connect NodeMCU devkit to your laptop and flash it without any trouble". This is more or less true: the board comes with a CP2102 onboard USB to serial adapter which just works, well, the majority of the time. Sometimes flashing fails and you have to reset the board by holding down FLASH +
+RST, then releasing FLASH, then releasing RST. This forces the CP2102 device to power cycle and to be re-numbered by Linux.
+
+The board also features a NCP1117 voltage regulator, a blue LED on GPIO16 and a 220k/100k Ohm voltage divider on the ADC input pin.
+
+Full pinout and PDF schematics can be found `here `__
+
+Olimex MOD-WIFI-ESP8266(-DEV)
+-----------------------------
+
+This board comes with 2 MB of SPI flash and optional accessories (e.g. evaluation board ESP8266-EVB or BAT-BOX for batteries).
+
+The basic module has three solder jumpers that allow you to switch the operating mode between SDIO, UART and FLASH.
+
+The board is shipped for FLASH operation mode, with jumpers TD0JP=0, IO0JP=1, IO2JP=1.
+
+Since jumper IO0JP is tied to GPIO0, which is PIN 21, you'll have to ground it before programming with a USB to serial adapter and reset the board by power cycling it.
+
+UART pins for programming and serial I/O are GPIO1 (TXD, pin 3) and GPIO3 (RXD, pin 4).
+
+You can find the board schematics `here `__
+
+SparkFun ESP8266 Thing
+----------------------
+
+Product page: https://www.sparkfun.com/products/13231
+
+SparkFun ESP8266 Thing Dev
+--------------------------
+
+Product page: https://www.sparkfun.com/products/13711
+
+SweetPea ESP-210
+----------------
+
+*TODO*
+
+WeMos D1 R2 & mini
+------------------
+
+Product page: https://www.wemos.cc/
+
+WeMos D1 mini Pro
+-----------------
+
+Product page: https://www.wemos.cc/
+
+WeMos D1 mini Lite
+------------------
+
+Product page: https://www.wemos.cc/
+
+WeMos D1 R1
+-----------
+
+Product page: https://www.wemos.cc/
+
+ESPino (ESP-12 Module)
+----------------------
+
+ESPino integrates the ESP-12 module with a 3.3v regulator, CP2104 USB-Serial bridge and a micro USB connector for easy programming. It is designed for fitting in a breadboard and has an RGB Led and two buttons for easy prototyping.
+
+For more information about the hardware, pinout diagram and programming procedures, please see the `datasheet `__.
+
+Product page: http://www.espino.io/en
+
+ThaiEasyElec's ESPino
+---------------------
+
+ESPino by ThaiEasyElec using WROOM-02 module from Espressif Systems with 4 MB Flash.
+
+We will update an English description soon. - Product page:
+http://thaieasyelec.com/products/wireless-modules/wifi-modules/espino-wifi-development-board-detail.html
+- Schematics:
+www.thaieasyelec.com/downloads/ETEE052/ETEE052\_ESPino\_Schematic.pdf -
+Dimensions:
+http://thaieasyelec.com/downloads/ETEE052/ETEE052\_ESPino\_Dimension.pdf
+- Pinouts:
+http://thaieasyelec.com/downloads/ETEE052/ETEE052\_ESPino\_User\_Manual\_TH\_v1\_0\_20160204.pdf (Please see pg. 8)
+
+WifInfo
+-------
+
+WifInfo integrates the ESP-12 or ESP-07+Ext antenna module with a 3.3v regulator and the hardware to be able to measure French telemetry issue from ERDF powering meter serial output. It has a USB connector for powering, an RGB WS2812 Led, 4 pins I2C connector to fit OLED or sensor, and two buttons + FTDI connector and auto reset feature.
+
+For more information, please see WifInfo related `blog `__ entries, `github `__ and `community `__ forum.
+
+Arduino
+-------
+
+*TODO*
+
+4D Systems gen4 IoD Range
+-------------------------
+
+gen4-IoD Range of ESP8266 powered Display Modules by 4D Systems.
+
+2.4", 2.8" and 3.2" TFT LCD with uSD card socket and Resistive Touch. Chip Antenna + uFL Connector.
+
+Datasheet and associated downloads can be found on the 4D Systems product page.
+
+The gen4-IoD range can be programmed using the Arduino IDE and also the 4D Systems Workshop4 IDE, which incorporates many additional graphics benefits. GFX4d library is available, along with a number of demo applications.
+
+- Product page: http://www.4dsystems.com.au/product/gen4-IoD
+
+Digistump Oak
+-------------
+
+The Oak requires an `Serial Adapter`_ for a serial connection or flashing; its micro USB port is only for power.
+
+To make a serial connection, wire the adapter's **TX to P3**, **RX to P4**, and **GND** to **GND**. Supply 3.3v from the serial adapter if not already powered via USB.
+
+To put the board into bootloader mode, configure a serial connection as above, connect **P2 to GND**, then re-apply power. Once flashing is complete, remove the connection from P2 to GND, then re-apply power to boot into normal mode.
+
+WiFiduino
+---------
+
+Product page: https://wifiduino.com/esp8266
+
+Amperka WiFi Slot
+-----------------
+
+Product page: http://wiki.amperka.ru/wifi-slot
+
diff --git a/doc/changes.md b/doc/changes.md
deleted file mode 100644
index df07d5a95e..0000000000
--- a/doc/changes.md
+++ /dev/null
@@ -1,364 +0,0 @@
----
-title: Change Log
----
-
-## 2.3.0
-June 23, 2016
-
-Package link: `http://arduino.esp8266.com/versions/2.3.0/package_esp8266com_index.json`.
-
-### Core
-- Fix NMI interrupt handler alignment
-- Update SDK to 1.5.3
-- umm_malloc: print block start address before heap corruption callback is triggered
-- If GDBStub library is used, break into gdb on assert and panic
-- Add option to keep FS classes in namespace (#2030)
-- Add SPIFFS::end (#1657)
-- Add ArduinoOTA::getHostname() interface
-- Add __throw_out_of_range
-- Add support for RTC user memory in ESP-specific APIs. (#1836)
-- Expose RTC_USER_MEM in esp8266_peri.h
-- Remove DISABLED macro (#2072)
-- Execute global constructors in correct order (#2074)
-- Real board name available in Sketch/MDNS/OTA (#2054)
-- Add DOUT/QOUT flash modes
-- Add ESP8285 entry in boards menu
-- Move timer detachInterrupt functions into IRAM (#2083)
-- Make Updater be able to run inside async callbacks (#2096)
-- Add new boards Phoenix 1.0 & Phoenix 2.0 (#2088)
-- Store git version of the core in the compiled binary (#2099)
-- Rebuild libstdc++ with mlongcalls and link against it (#1983)
-- Add mechanism for posting functions to the main loop (#2082)
-- MD5Builder::addStream: fixed falsy calculated hash for len > filelength (#2126)
-- Fix SPIFFS.openDir("") (#2143)
-- Bring back old semantics to random and randomSeed, add secureRandom (#1710) (#2142)
-- Add missing pgm_read_ptr{_near/_far} macros (#2160)
-- Add macro for maximum open SPIFFS files, settings it to 1 saves about 1k heap. (#2167)
-- Fix UART pins setting (#2098)
-- Fix ESP.getSketchSize, add ESP.getSketchMD5 (#2158)
-- Add Serial.baudRate() to get current baud rate (#2079)
-
-### Libraries
-
-- SNI support in WiFiClientSecure (#1285)
-- Update axTLS to 139914f
-- HTTPClient: return error when HTTPClient::begin is called with HTTPS URL without certificate fingerprint (#1941)
-- HTTPClient: fix default port not being set
-- HTTPClient: fix handling of chunked transfer encoding (#1975)
-- ESP8266SSDP: switch SSDP send arguments around
-- ESP8266WiFi: fix UdpContext::peek to return int (#1946)
-- ESP8266WiFi: fix WiFiSleepType_t values to match SDK ones
-- LwIP: use gcc-built LwIP by default (#1926)
-- LwIP: fix crash in igmp_start_timer (#1826)
-- HTTPClient: include non-standard ports in Host: header
-- ESP8266WiFi: Prevent WiFi config corruption (#1997 #1856 #1699 #1675)
-- GDBStub: fix section attribute for core gdbstub functions
-- Wire: I2C bus reset with info to user
-- ESP8266HTTPClient: allow HTTP header value without LWS
-- ESP8266mDNS: Fix mDNS doesn't accept queryService responses from avahi-daemon (#2015)
-- Add MFRC522 to supported libraries (#2044)
-- Update axTLS to ab516f7 (1.5.3+)
-- Mention ESP8266Ping library
-- ESP8266HTTPClient: fix duplicate Content-Length headers (#1902)
-- ESP8266HTTPUpdateServer: make HTTP Update Server more secure (#2104)
-- ESP8266WiFi: add virtual destructor to WiFiServer class (#2116)
-- ESP8266WiFi: fix error when calling `WiFiServer::close` more than once
-- ESP8266WiFi: WiFi event handling refactoring (#2119)
-- ESP8266mDNS: restart listening when WiFi STA is connected/disconnected (#1828)
-- ESP8266WiFi: allow DHCP client to be re-enabled using WiFi.config(0U, 0U, 0U) (#1896)
-- ESP8266WiFi: enable SO_REUSE in LwIP and WiFiServer (#1431)
-- ESP8266WebServer: make ESP8266WebServer::urlDecode public (#1419)
-- LwIP: sntp_localtime: return -1 in tm_isdst field (#2010)
-- ESP8266WiFi: fix for crash in WiFiClientSecure when WiFi is disconnected (#2139)
-- SD: Prevent WDT resets in SD library (#1815)
-- ESP8266WiFi: Fix issue when WiFi.begin(ssid, pass) is called right after WiFi.mode(WIFI_OFF)
-
-### Tools
-
-- Python 3 compatibility for get.py
-- Device side test library and test runner
-- Fix ARM toolchain files permissions (#2004)
-- Update esptool to 0.4.9
-
-## 2.2.0
-April 18, 2016
-
-Package link: `http://arduino.esp8266.com/versions/2.2.0/package_esp8266com_index.json`.
-
-### Core
-- Leverage realloc() in String::changeBuffer()
-- Clean up core files
-- Add host side tests
-- Fix possible null pointer in umm_malloc
-- Remove "Upload Using" option from Tools menu
-- Move attachInterrupt and detachInterrupt into IRAM (#1734)
-- Implement strstr_P
-- Allow indefinite duration for tone()
-- Fix crashes when using tone()
-- Fix RF_MODE and ADC_MODE
-- Move micros, delayMicroseconds, millis to IRAM (#1326)
-- Fix pulseIn (#1072, #1149)
-- Accept both named constant and ADC channel number in analogRead (#1766)
-- Enable heap poisoning only when debug options are enabled (#1800)
-- Bootloader: don't touch RTC memory if it doesn't contain a valid command (#619)
-- Update SDK to 1.5.2 (#1653)
-- Clean up variants, fix digitalPinHasPWM definition (#1831)
-- Don't set RF mode on boot unless it was overridden
-- Change build.board property for boards which renumber pins like NodeMCU (#1878)
-- Fix Exception 2 when using printf or vprintf
-
-### Libraries
-- Update axTLS to 5b4be7d
-- WiFiClientSecure: implement connection timeout, fix connected method behavior
-- WiFiClient: fix write behavior when connection is closed by remote side
-- ESP8266HTTPServer: add font MIME types, fix #1601
-- ESP8266mDNS: add client support
-- Update SPIFFS to 82aeac6
-- Servo: move some functions into IRAM (#1742)
-- Update SoftwareSerial to version 3.1.0
-- ESP8266SSDP: change templates to include deviceType
-- ESP8266WebServer: handle more file types
-- SPI: add CPOL setting
-- ESP8266WebServer: Fix buffer overflow in ESP8266WebServer::authenticate (#1790)
-- ESP8266WiFi: fix undefined behavior in WiFiServer::setNoDelay (#1695)
-- Servo: use peripheral clock frequency when calculating FRC1 tick count (#1789)
-- ESP8266WiFi: avoid multiple instances of INADDR_NONE
-- Add LwIP binary built with gcc
-- ESP8266WiFi: Allow PSK instead of passphrase in WiFiSTA::begin
-- SPI: Fix SPI.transfer16() using wrong endianness
-- HTTPClient: decouple transport layer handling + save some RAM
-- ESP8266httpUpdate: decouple HTTPS overloads + save some RAM
-- Update and move lwIP headers, add options to use different lwIP build
-- ESP8266WebServer: wait for data to arrive
-- ESP8266WebServer: save RAM by moving response strings to flash (#1732)
-- SPI: Speed up SPI.writePattern()
-
-
-### Tools
-- Add ARM tools (#269)
-
----
-## 2.1.0
-February 27, 2016
-
-Package link: `http://arduino.esp8266.com/versions/2.1.0/package_esp8266com_index.json`.
-
-### Core
-
-- Add function to know last reset reason.
-- Allow control of enabling debug and debug level from IDE
-- Add espduino board
-- Rework StreamString::write to use String internal buffer directly (#1289)
-- Add function to measure stack high water mark
-- Fix RAM corruption caused by our hook of register_chipv6_phy(init_data*).
-- Optimize PWM interrupt handler for better precision
-- Add warning levels configurable through Preferences
-- SPIFFS: check if path length is valid (#1089)
-- Set CPU frequency before running setup
-- Add core_esp8266_features.h to be able to detect the features and libraries included in the ESP core
-- Add ESPino to supported boards
-- Fix pwm first step getting skipped
-- Update SDK to 1.5.1_16_01_08
-- Bufferless and interruptless HardwareSerial
-- HardwareSerial: allow mapping of UART0 TX to GPIO2
-- Add 128K SPIFFS for 512KB modules
-- Reduce stack usage by Print::printf
-- Fix a crash in String::changeBuffer()
-- Implement static initialization guards (#500)
-- Implementation of Tone API using timer1
-- Use umm_malloc for heap management
-- Configurable I2C clock stretching limit
-- Add a new board entry for the SparkFun Thing Dev
-
-### Libraries
-
-- ESP8266HTTPClient: add CHUNKED encoding support (#1324)
-- Fixed crash bug with mDNS where a string buffer could be used uninitialized
-- Add WiFi TX power control
-- Add WiFi sleep management
-- Allow to hook into WiFi events from sketch
-- Allow setting TCP timeout
-- Add setSleepMode + getSleepMode and setPhyMode + getPhyMode to WiFi
-- Update GDBStub library with the source of esp-gdbstub
-- Servo: fix detach and attach
-- ESP8266mDNS: refactoring, add TXT support
-- Add HTTP Basic Auth to WebServer and libb64 (base64) to core
-- Fix link-time dependency of ESP8266WebServer on SPIFFS (#862)
-- Allow setting client side TLS key and certificate
-- Replace chain of UDP pbufs with a single pbuf before sending (#1009)
-- Unique Built-In libraries library.properties name
-- Improvements for MD5Builder with Stream
-- ESP8266SSDP: fixing TTL to 2 per spec
-- ESP8266WebServer: a content length of zero should also be sent
-- Use SoftwareSerial version 2.2
-- EEPROM: optimised `_dirty` flag
-- ESP8266mDNS: advertise all hosted services
-- Remove bundled OneWire - ESP8266 support has been merged in the official OneWire sources
-- WiFiClientSecure: don't panic if memory allocation fails
-- Verify domain name in WiFiClientSecure::verify
-- Speed up WiFi.hostByName when the hostname is actually an IP
-- Fix WiFi scan issue (#1355)
-- Workaround for LwIP not handling ERR_ABRT
-- Servo value read and write fixes
-
-### Tools
-
-- espota.py: add support for manually selecting ip and port for host side
-- Update esptool to 0.4.8
-- Make espota compatible with python 3.5
-
----
-## 2.0.0
-November 30, 2015
-
-Package link: `http://arduino.esp8266.com/versions/2.0.0/package_esp8266com_index.json`.
-
-### Core
-
-- Add file system APIs and documentation
-- Add ConfigFile example
-- Allow user to run code in user_rf_pre_init
-- Add strtoul and strtol, fix strtod
-- Update documentation for NodeMCU and Olimex boards
-- Disable interrupts inside ESP.getVcc (#567)
-- Erase RTC RAM only if RF mode looks invalid (#619)
-- Get pin levels at time of interrupt, rather than the time of calling the handler.
-- Move interrupt handlers to ram.
-- Improve debug output on critical errors
-- Add ArduinoOTA library and docs
-- Add WeMos D1 & D1 mini boards
-- Add documentation about boot messages and mode meaning
-- Disable sleep mode before doing OTA (#1005)
-- Add the ability to be called back when the device is about to reset
-- Add "Reset Method" menu
-- Add MD5 to core
-- I2C: generate STOP in case of NACK (fix #698, #254)
-- Add libc time functions
-- Fix linker script for 512k(no SPIFFS) variant (#966)
-- I2S optimizations
-- Support Sketch > Export compiled binary
-- Update SPIFFS wrapper for 0.3.3
-- Fix placement of code into RAM, enable gc-sections
-- Make soft wdt reset more obvious
-- Force disable IOSWAP for UART0 in HardwareSerial initialization (#744)
-- Add IPAddress::toString()
-
-
-### Libraries
-
-- ESP8266WebServer: support for sending of PROGMEM strings
-- ESP8266WebServer: support for serving files from file system
-- ESP8266WiFi: fix mode selection (#529)
-- ESP8266mDNS: allow to work on SoftAP interface
-- EEPROM: round requested size to 4 bytes (#659)
-- Add ESP8266AVRISP library
-- Add ESP8266HTTPUpdate library
-- Add HTTPClient library
-- Add WiFiClientSecure
-- ESP8266WiFi library: add persistent option, fix #1054
-- Make RequestHandler handle uploads
-- Add Digest Authentication to OTA and espota.py
-- Don't close UDP pcbs when WiFi connection drops (#969)
-- Add espsoftwareserial library
-- Add HTTP Updater library
-- Add Ethernet library for W5100
-- Add SPIFFS WebServer Example
-- add dnsIP() to ESP8266WiFi class
-- OTA support encapsulated to ArduinoOTA class
-- Add gdb stub library
-- Extracted the WebUpdate example into a library.
-- Fix to Servo allowing write() to be called before attach()
-- ESP8266WiFi: add function `begin` without any parameters and add `psk` function to return current PSK form sdk config
-- Fix a crash due to abort() called from TCP error callback (#428)
-- Adding support for OPTIONS requests to ESP8266WebServer
-- Add HTTPS request sample (#43)
-- Fix _useClientMode & _useApMode in SDK auto connect mode (#754)
-- Add ESP8266WebServer::sendContent_P with 'size_t size' argument for binary content
-- Fix bug in WiFiClient::write_P when content was binary
-- Add WiFiClient::write_P to be used with PROGMEM
-
-### Tools
-
-- Update SDK to 1.3.0_15_08_10_p1
-- Update esptool to 0.4.6
-- Bump toolchain version to force libm update on Windows
-- ESP8266FS tool update
-
----
-## 1.6.5-947-g39819f0
-July 23, 2015
-
-Package link: `http://arduino.esp8266.com/versions/1.6.5-947-g39819f0/package_esp8266com_index.json`.
-
-### Core
-
-- I2C library updated to better handle repeated start for certain devices,
- improved waveforms, higher frequencies for 160MHz core clock, fix case where
- using different pins would not work with libs calling begin internally.
-- Add Adafruit HUZZAH board
-- Add SparkFun Thing board
-- Add SweetPea ESP-210 board
-- Add eboot bootloader
-- Timer0 support
-- Add PWM range and frequency control
-- Add ESP.eraseConfig method
-- Fix pin change interrupt handling (#322)
-- Add SLC and I2S register definitions
-- Fix math functions calling themselves recursively (#233, #354)
-- Print stack on exception and soft WDT reset
-- Add Updater class
-- Remove implementations of WDT-related functions
-- Provide selection between A0 and VCC (#443, #338)
-
-### Libraries
-
-- ESP8266WebServer: add gzip streaming, fix sendContent behaviour,
- add setContentSize method.
-- ESP8266WiFi: add BSSID, channel, isHidden methods, fix AP/STA mode
- selection (#28).
-- Better handling of WiFi disconnect (#231)
-- Add API to set the beginning of local ports range for WiFiClient.
-- Add RSSI function
-- Add function to get the MAC / BSSID as String
-- Servo library support
-- Add ESP8266WiFiMesh library
-- Add ESP8266SSDP library
-- Add DNS-SD support to ESP8266mDNS library
-
-### Tools
-
-- Update SDK to v1.2.0_15_07_03
-- Better sketch size reporting (#314)
-- Update esptool to 0.4.5
-
----
-
-## 1.6.4-673-g8cd3697
-May 22, 2015
-
-Package link: `http://arduino.esp8266.com/versions/1.6.4-673-g8cd3697/package_esp8266com_index.json`.
-
-### Tools
-
-- Add 32-bit Linux toolchain.
-- Rebuild toolchain and esptool with support for OS X down to 10.6.
-
-### Libraries
-
-- Better connection handling in ESP8266WebServer.
- The server now sends Content-Length and Connection: close headers,
- then waits for the client to disconnect. By not closing the connection
- actively, server avoids TIME_WAIT TCP state, and TCP stack is able to
- release the memory immediately, without waiting for 2xMSL period.
- If the client doesn't disconnect in 2000ms, the server closes the connection
- actively.
-- Add Hash library, which has a function to calculate SHA1 hash.
-- SD, Adafruit_ILI9341, and OneWire libraries are now bundled.
-- Fix incorrect sector calculation in EEPROM library.
-
----
-
-## 1.6.4-628-g545ffde
-May 19, 2015
-
-- Initial release of Boards Manager package for ESP8266 platform.
diff --git a/doc/conf.py b/doc/conf.py
new file mode 100644
index 0000000000..856262e08c
--- /dev/null
+++ b/doc/conf.py
@@ -0,0 +1,169 @@
+# -*- coding: utf-8 -*-
+#
+# ESP8266 Arduino Core documentation build configuration file, created by
+# sphinx-quickstart on Sun Feb 19 14:51:34 2017.
+#
+# This file is execfile()d with the current directory set to its
+# containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#
+import os
+import sys
+# sys.path.insert(0, os.path.abspath('.'))
+
+
+# -- General configuration ------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#
+# needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be
+# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
+# ones.
+extensions = []
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix(es) of source filenames.
+# You can specify multiple suffix as a list of string:
+#
+# source_suffix = ['.rst', '.md']
+source_suffix = '.rst'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'ESP8266 Arduino Core'
+copyright = u'2017, Ivan Grokhotkov'
+author = u'Ivan Grokhotkov'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = u'2.4.0'
+# The full version, including alpha/beta/rc tags.
+release = u'2.4.0'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#
+# This is also used if you do content translation via gettext catalogs.
+# Usually you set "language" from the command line for these cases.
+language = None
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+# This patterns also effect to html_static_path and html_extra_path
+exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# If true, `todo` and `todoList` produce output, else they produce nothing.
+todo_include_todos = False
+
+
+# -- Options for HTML output ----------------------------------------------
+
+# The theme to use for HTML and HTML Help pages. See the documentation for
+# a list of builtin themes.
+#
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further. For a list of options available for each theme, see the
+# documentation.
+#
+# html_theme_options = {}
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+html_static_path = ['_static']
+
+
+# -- Options for HTMLHelp output ------------------------------------------
+
+# Output file base name for HTML help builder.
+htmlhelp_basename = 'ESP8266ArduinoCoredoc'
+
+
+# -- Options for LaTeX output ---------------------------------------------
+
+latex_elements = {
+ # The paper size ('letterpaper' or 'a4paper').
+ #
+ # 'papersize': 'letterpaper',
+
+ # The font size ('10pt', '11pt' or '12pt').
+ #
+ # 'pointsize': '10pt',
+
+ # Additional stuff for the LaTeX preamble.
+ #
+ # 'preamble': '',
+
+ # Latex figure (float) alignment
+ #
+ # 'figure_align': 'htbp',
+}
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title,
+# author, documentclass [howto, manual, or own class]).
+latex_documents = [
+ (master_doc, 'ESP8266ArduinoCore.tex', u'ESP8266 Arduino Core Documentation',
+ u'Ivan Grokhotkov', 'manual'),
+]
+
+
+# -- Options for manual page output ---------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+ (master_doc, 'esp8266arduinocore', u'ESP8266 Arduino Core Documentation',
+ [author], 1)
+]
+
+
+# -- Options for Texinfo output -------------------------------------------
+
+# Grouping the document tree into Texinfo files. List of tuples
+# (source start file, target name, title, author,
+# dir menu entry, description, category)
+texinfo_documents = [
+ (master_doc, 'ESP8266ArduinoCore', u'ESP8266 Arduino Core Documentation',
+ author, 'ESP8266ArduinoCore', 'One line description of project.',
+ 'Miscellaneous'),
+]
+
+linkcheck_anchors_ignore = ["/#!"]
+
+# -- Use sphinx_rtd_theme for local builds --------------------------------
+# ref. https://github.com/snide/sphinx_rtd_theme#using-this-theme-locally-then-building-on-read-the-docs
+#
+# on_rtd is whether we are on readthedocs.org
+env_readthedocs = os.environ.get('READTHEDOCS', None)
+print(env_readthedocs)
+
+if not env_readthedocs: # only import and set the theme if we're building docs locally
+ import sphinx_rtd_theme
+ html_theme = 'sphinx_rtd_theme'
+ html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
+
+
diff --git a/doc/eclipse/eclipse.md b/doc/eclipse/eclipse.md
deleted file mode 100644
index 348d1cf19e..0000000000
--- a/doc/eclipse/eclipse.md
+++ /dev/null
@@ -1,38 +0,0 @@
-using Eclipse with Arduino ESP8266
-===========================================
-
-### What to Download ###
-- [arduino IDE](https://www.arduino.cc/en/Main/Software)
-- [Eclipse IDE for C/C++ Developers](http://www.eclipse.org/downloads/packages/eclipse-ide-cc-developers/marsr)
-- [Java](http://www.java.com/)
-
-### Setup Arduino ###
- see the [Readme](https://github.com/esp8266/Arduino#installing-with-boards-manager)
-
-### Setup Eclipse ###
-- [step 1](http://www.baeyens.it/eclipse/how_to.shtml#/c)
-- [step 2](http://www.baeyens.it/eclipse/how_to.shtml#/e)
-- go to Window --> preferences --> Arduino
-- add as private hardware path the Part to the ESP8266
-
-###### example private hardware path
- Windows: C:\Users\[username]\AppData\Roaming\Arduino15\packages\esp8266\hardware
- Linux: /home/[username]/.arduino15/packages/esp8266/hardware
-
-### Eclipse wont build ###
-if eclipse dont find the path to the Compiler add to the platform.txt
-after:
-```
-version=1.6.4
-```
-this:
-```
-runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/../../../tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9
-runtime.tools.esptool.path={runtime.platform.path}/../../../tools/esptool/0.4.4
-```
-Note:
- - the path may changed, check the current version.
- - each update over the Arduino IDE will remove the fix
- - may not needed in future if Eclipse Plugin get an Update
-
-
\ No newline at end of file
diff --git a/doc/eclipse/eclipse.rst b/doc/eclipse/eclipse.rst
new file mode 100644
index 0000000000..285e121765
--- /dev/null
+++ b/doc/eclipse/eclipse.rst
@@ -0,0 +1,53 @@
+Using Eclipse with Arduino ESP8266
+==================================
+
+What to Download
+~~~~~~~~~~~~~~~~
+
+- `arduino IDE `__
+- `Eclipse IDE for C/C++
+ Developers `__
+- `Java `__
+
+Setup Arduino
+~~~~~~~~~~~~~
+
+See the
+`Readme `__
+
+Setup Eclipse
+~~~~~~~~~~~~~
+
+- `step 1 `__
+- `step 2 `__
+- go to Window --> preferences --> Arduino
+- add as private hardware path the Part to the ESP8266
+
+example private hardware path
+
+
+::
+
+ Windows: C:\Users\[username]\AppData\Roaming\Arduino15\packages\esp8266\hardware
+ Linux: /home/[username]/.arduino15/packages/esp8266/hardware
+
+Eclipse wont build
+~~~~~~~~~~~~~~~~~~
+
+if eclipse dont find the path to the Compiler add to the platform.txt
+after:
+
+::
+
+ version=1.6.4
+
+this:
+
+::
+
+ runtime.tools.xtensa-lx106-elf-gcc.path={runtime.platform.path}/../../../tools/xtensa-lx106-elf-gcc/1.20.0-26-gb404fb9
+ runtime.tools.esptool.path={runtime.platform.path}/../../../tools/esptool/0.4.4
+
+Note: - the path may changed, check the current version. - each update
+over the Arduino IDE will remove the fix - may not needed in future if
+Eclipse Plugin get an Update
diff --git a/doc/esp8266wifi/client-class.md b/doc/esp8266wifi/client-class.md
deleted file mode 100644
index 8be1d4720e..0000000000
--- a/doc/esp8266wifi/client-class.md
+++ /dev/null
@@ -1,65 +0,0 @@
----
-title: ESP8266WiFi Client Class
----
-
-[ESP8266WiFi Library :back:](readme.md#client)
-
-
-## Client Class
-
-Methods documented for [Client](https://www.arduino.cc/en/Reference/WiFiClientConstructor) in [Arduino](https://github.com/arduino/Arduino)
-
-1. [WiFiClient()](https://www.arduino.cc/en/Reference/WiFiClient)
-2. [connected()](https://www.arduino.cc/en/Reference/WiFiClientConnected)
-3. [connect()](https://www.arduino.cc/en/Reference/WiFiClientConnect)
-4. [write()](https://www.arduino.cc/en/Reference/WiFiClientWrite)
-5. [print()](https://www.arduino.cc/en/Reference/WiFiClientPrint)
-6. [println()](https://www.arduino.cc/en/Reference/WiFiClientPrintln)
-7. [available()](https://www.arduino.cc/en/Reference/WiFiClientAvailable)
-8. [read()](https://www.arduino.cc/en/Reference/WiFiClientRead)
-9. [flush()](https://www.arduino.cc/en/Reference/WiFiClientFlush)
-10. [stop()](https://www.arduino.cc/en/Reference/WiFIClientStop)
-
-
-Methods and properties described further down are specific to ESP8266. They are not covered in [Arduino WiFi library](https://www.arduino.cc/en/Reference/WiFi) documentation. Before they are fully documented please refer to information below.
-
-
-### setNoDelay
-
-```cpp
-setNoDelay(nodelay)
-```
-
-With `nodelay` set to `true`, this function will to disable [Nagle algorithm](https://en.wikipedia.org/wiki/Nagle%27s_algorithm).
-
-This algorithm is intended to reduce TCP/IP traffic of small packets sent over the network by combining a number of small outgoing messages, and sending them all at once. The downside of such approach is effectively delaying individual messages until a big enough packet is assembled.
-
-*Example:*
-```cpp
-clinet.setNoDelay(true);
-```
-
-
-### Other Function Calls
-
-```cpp
-uint8_t status ()
-virtual size_t write (const uint8_t *buf, size_t size)
-size_t write_P (PGM_P buf, size_t size)
-size_t write (Stream &stream)
-size_t write (Stream &stream, size_t unitSize) __attribute__((deprecated))
-virtual int read (uint8_t *buf, size_t size)
-virtual int peek ()
-virtual size_t peekBytes (uint8_t *buffer, size_t length)
-size_t peekBytes (char *buffer, size_t length)
-virtual operator bool ()
-IPAddress remoteIP ()
-uint16_t remotePort ()
-IPAddress localIP ()
-uint16_t localPort ()
-bool getNoDelay ()
-```
-Documentation for the above functions is not yet prepared.
-
-
-For code samples please refer to separate section with [examples :arrow_right:](client-examples.md) dedicated specifically to the Client Class.
diff --git a/doc/esp8266wifi/client-class.rst b/doc/esp8266wifi/client-class.rst
new file mode 100644
index 0000000000..9ddd46b458
--- /dev/null
+++ b/doc/esp8266wifi/client-class.rst
@@ -0,0 +1,62 @@
+:orphan:
+
+Client Class
+------------
+
+Methods documented for `Client `__ in `Arduino `__
+
+1. `WiFiClient() `__
+2. `connected() `__
+3. `connect() `__
+4. `write() `__
+5. `print() `__
+6. `println() `__
+7. `available() `__
+8. `read() `__
+9. `flush() `__
+10. `stop() `__
+
+Methods and properties described further down are specific to ESP8266. They are not covered in `Arduino WiFi library `__ documentation. Before they are fully documented please refer to information below.
+
+setNoDelay
+~~~~~~~~~~
+
+.. code:: cpp
+
+ setNoDelay(nodelay)
+
+With ``nodelay`` set to ``true``, this function will to disable `Nagle algorithm `__.
+
+This algorithm is intended to reduce TCP/IP traffic of small packets sent over the network by combining a number of small outgoing messages, and sending them all at once. The downside of such approach is effectively delaying individual messages until a big enough packet is assembled.
+
+*Example:*
+
+.. code:: cpp
+
+ client.setNoDelay(true);
+
+Other Function Calls
+~~~~~~~~~~~~~~~~~~~~
+
+.. code:: cpp
+
+ uint8_t status ()
+ virtual size_t write (const uint8_t *buf, size_t size)
+ size_t write_P (PGM_P buf, size_t size)
+ size_t write (Stream &stream)
+ size_t write (Stream &stream, size_t unitSize) __attribute__((deprecated))
+ virtual int read (uint8_t *buf, size_t size)
+ virtual int peek ()
+ virtual size_t peekBytes (uint8_t *buffer, size_t length)
+ size_t peekBytes (char *buffer, size_t length)
+ virtual operator bool ()
+ IPAddress remoteIP ()
+ uint16_t remotePort ()
+ IPAddress localIP ()
+ uint16_t localPort ()
+ bool getNoDelay ()
+
+Documentation for the above functions is not yet prepared.
+
+For code samples please refer to separate section with `examples
+:arrow\_right: `__ dedicated specifically to the Client Class.
diff --git a/doc/esp8266wifi/client-examples.md b/doc/esp8266wifi/client-examples.md
deleted file mode 100644
index a38ff37af3..0000000000
--- a/doc/esp8266wifi/client-examples.md
+++ /dev/null
@@ -1,256 +0,0 @@
----
-title: ESP8266WiFi Client Class - Sketch Examples
----
-
-[ESP8266WiFi Library :back:](readme.md#client)
-
-
-## Client
-
-Let's write a simple client program to access a single web page and display its contents on a serial monitor. This is typical operation performed by a client to access server's API to retrieve specific information. For instance we may want to contact GitHub's API to periodically check the number of open issues reported on [esp8266 / Arduino](https://github.com/esp8266/Arduino/issues) repository.
-
-
-## Table of Contents
- * [Introduction](#introduction)
- * [Get Connected to Wi-Fi](#get-connected-to-wi-fi)
- * [Select a Server](#select-a-server)
- * [Instantiate the Client](#instantiate-the-client)
- * [Get Connected to the Server](#get-connected-to-the-server)
- * [Request the Data](#request-the-data)
- * [Read Reply from the Server](#read-reply-from-the-server)
- * [Now to the Sketch](#now-to-the-sketch)
- * [Test it Live](#test-it-live)
- * [Test it More](#test-it-more)
- * [Conclusion](#conclusion)
-
-
-### Introduction
-
-This time we are going to concentrate just on retrieving a web page contents sent by a server, to demonstrate basic client's functionality. Once you are able to retrieve information from a server, you should be able to phrase it and extract specific data you need.
-
-
-### Get Connected to Wi-Fi
-
-We should start with connecting the module to an access point to obtain an access to internet. The code to provide this functionality has been already discussed in chapter [Quick Start](readme.md#quick-start). Please refer to it for details.
-
-
-### Select a Server
-
-Once connected to the network we should connect to the specific server. Web address of this server is declared in `host` character string as below.
-
-```cpp
-const char* host = "www.example.com";
-```
-I have selected `www.example.com` domain name and you can select any other. Just check if you can access it using a web browser.
-
-
-
-
-### Instantiate the Client
-
-Now we should declare a client that will be contacting the host (server):
-
-```cpp
-WiFiClient client;
-```
-
-
-### Get Connected to the Server
-
-In next line we will connect to the host and check the connection result. Note `80`, that is the standard port number used for web access.
-
-```cpp
-if (client.connect(host, 80))
-{
- // we are connected to the host!
-}
-else
-{
- // connection failure
-}
-```
-
-
-### Request the Data
-
-If connection is successful, we should send request the host to provide specific information we need. This is done using the [HTTP GET](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol#Request_methods) request as in the following lines:
-
-```cpp
-client.print(String("GET /") + " HTTP/1.1\r\n" +
- "Host: " + host + "\r\n" +
- "Connection: close\r\n" +
- "\r\n"
- );
-```
-
-### Read Reply from the Server
-
-Then, while connection by our client is still alive (`while (client.connected())`, see below) we can read line by line and print out server's response:
-
-```cpp
-while (client.connected())
-{
- if (client.available())
- {
- String line = client.readStringUntil('\n');
- Serial.println(line);
- }
-}
-```
-
-The inner `if (client.available())` is checking if there are any data available from the server. If so, then they are printed out.
-
-Once server sends all requested data it will disconnect and program will exit the `while` loop.
-
-
-### Now to the Sketch
-
-Complete sketch, including a case when contention to the server fails, is presented below.
-
-```cpp
-#include
-
-const char* ssid = "********";
-const char* password = "********";
-
-const char* host = "www.example.com";
-
-
-void setup()
-{
- Serial.begin(115200);
- Serial.println();
-
- Serial.printf("Connecting to %s ", ssid);
- WiFi.begin(ssid, password);
- while (WiFi.status() != WL_CONNECTED)
- {
- delay(500);
- Serial.print(".");
- }
- Serial.println(" connected");
-}
-
-
-void loop()
-{
- WiFiClient client;
-
- Serial.printf("\n[Connecting to %s ... ", host);
- if (client.connect(host, 80))
- {
- Serial.println("connected]");
-
- Serial.println("[Sending a request]");
- client.print(String("GET /") + " HTTP/1.1\r\n" +
- "Host: " + host + "\r\n" +
- "Connection: close\r\n" +
- "\r\n"
- );
-
- Serial.println("[Response:]");
- while (client.connected())
- {
- if (client.available())
- {
- String line = client.readStringUntil('\n');
- Serial.println(line);
- }
- }
- client.stop();
- Serial.println("\n[Disconnected]");
- }
- else
- {
- Serial.println("connection failed!]");
- client.stop();
- }
- delay(5000);
-}
-```
-
-
-### Test it Live
-
-Upload sketch the module and open serial monitor. You should see a log similar to presented below.
-
-First, after establishing Wi-Fi connection, you should see confirmation, that client connected to the server and send the request:
-
-```
-Connecting to sensor-net ........ connected
-
-[Connecting to www.example.com ... connected]
-[Sending a request]
-```
-
-Then, after getting the request, server will first respond with a header that specifies what type of information will follow (e.g. `Content-Type: text/html`), how long it is (like `Content-Length: 1270`), etc.:
-
-```
-[Response:]
-HTTP/1.1 200 OK
-
-Cache-Control: max-age=604800
-Content-Type: text/html
-Date: Sat, 30 Jul 2016 12:30:45 GMT
-Etag: "359670651+ident"
-Expires: Sat, 06 Aug 2016 12:30:45 GMT
-Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT
-Server: ECS (ewr/15BD)
-Vary: Accept-Encoding
-X-Cache: HIT
-x-ec-custom-error: 1
-Content-Length: 1270
-Connection: close
-```
-
-End of header is marked with an empty line and then you should see the HTML code of requested web page.
-
-```
-
-
-
- Example Domain
-
-
-
-
-