diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index fe4d6792c..5369369ec 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -30,7 +30,7 @@ jobs: uses: actions/cache@v2 with: path: ./tools/dist - key: key-linux-toolchain + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} - name: Build Sketches env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -62,7 +62,7 @@ jobs: uses: actions/cache@v2 with: path: ./tools/dist - key: key-linux-toolchain + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} - name: Build Sketches env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -90,7 +90,7 @@ jobs: uses: actions/cache@v2 with: path: ./tools/dist - key: key-windows-toolchain + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} - name: Build Sketch env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -122,7 +122,7 @@ jobs: uses: actions/cache@v2 with: path: ./tools/dist - key: key-mac-toolchain + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} - name: Build Sketch env: TRAVIS_BUILD_DIR: ${{ github.workspace }} @@ -260,7 +260,7 @@ jobs: uses: actions/cache@v2 with: path: ./tools/dist - key: key-linux-toolchain + key: ${{ runner.os }}-${{ hashFiles('package/package_esp8266com_index.template.json', 'tests/common.sh') }} - name: Boards.txt diff env: TRAVIS_BUILD_DIR: ${{ github.workspace }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 858c284bc..000000000 --- a/.travis.yml +++ /dev/null @@ -1,71 +0,0 @@ -# TravisCI left in repo as a backup CI solution in case GitHub CI suffers a -# major disruption. Only a few, quick tests are run in order to keep the -# TravisCI runtime equal to the GitHub CI time (to avoid bottlenecking on -# TravisCI). -# -# If GitHub CI goes away, it would make sense to drop this .YML file and -# use the complete one from release tag 2.7.2 - - -language: bash -os: linux -dist: bionic - -git: - depth: 1 - submodules: false - -before_install: - - git submodule update --init # no recursive update - -stages: - - build - - deploy - - -# Run only 5 jobs since TravisCI only allows 5 in parallel -jobs: - include: - - name: "Platform.IO" - stage: build - script: $TRAVIS_BUILD_DIR/tests/platformio.sh - install: - - sudo apt-get install python3-pip python3-setuptools - env: - # PIO is very slow, so do 1/2 as many builds as Arduino - - BUILD_PARITY=custom mod=20 rem=5 - - - name: "Build 1/4" - stage: build - script: $TRAVIS_BUILD_DIR/tests/build.sh - env: - - BUILD_PARITY=custom mod=10 rem=1 - - - name: "Build 2/4" - stage: build - script: $TRAVIS_BUILD_DIR/tests/build.sh - env: - - BUILD_PARITY=custom mod=10 rem=2 - - - name: "Build 3/4" - stage: build - script: $TRAVIS_BUILD_DIR/tests/build.sh - env: - - BUILD_PARITY=custom mod=10 rem=3 - - - name: "Build 4/4" - stage: build - script: $TRAVIS_BUILD_DIR/tests/build.sh - env: - - BUILD_PARITY=custom mod=10 rem=4 - -notifications: - email: - on_success: change - on_failure: change - webhooks: - urls: - - secure: "dnSY+KA7NK+KD+Z71copmANDUsyVePrZ0iXvXxmqMEQv+lp3j2Z87G5pHn7j0WNcNZrejJqOdbElJ9Q4QESRaAYxTR7cA6ameJeEKHiFJrQtN/4abvoXb9E1CxpL8aNON/xgnqCk+fycOK3nbWWXlJBodzBm7KN64vrcHO7et+M=" - on_success: change # options: [always|never|change] default: always - on_failure: always # options: [always|never|change] default: always - on_start: false # default: false diff --git a/README.md b/README.md index 237e9a133..dc0ef30d6 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Starting with 1.6.4, Arduino allows installation of third-party platform package - Install the current upstream Arduino IDE at the 1.8.9 level or later. The current version is on the [Arduino website](https://www.arduino.cc/en/main/software). - Start Arduino and open the Preferences window. -- Enter ```https://arduino.esp8266.com/stable/package_esp8266com_index.json``` into the *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas. +- Enter ```https://arduino.esp8266.com/stable/package_esp8266com_index.json``` into the *File>Preferences>Additional Boards Manager URLs* field of the Arduino IDE. 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). #### Latest release [![Latest release](https://img.shields.io/github/release/esp8266/Arduino.svg)](https://github.com/esp8266/Arduino/releases/latest/) diff --git a/boards.txt b/boards.txt index fee7b23c8..dbbf04f6b 100644 --- a/boards.txt +++ b/boards.txt @@ -23,6 +23,8 @@ menu.stacksmash=Stack Protection menu.wipe=Erase Flash menu.sdk=Espressif FW menu.ssl=SSL Support +menu.mmu=MMU +menu.non32xfer=Non-32-Bit Access ############################################################## generic.name=Generic ESP8266 Module @@ -63,6 +65,18 @@ generic.menu.ssl.all=All SSL ciphers (most compatible) generic.menu.ssl.all.build.sslflags= generic.menu.ssl.basic=Basic SSL ciphers (lower ROM use) generic.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +generic.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +generic.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +generic.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +generic.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +generic.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +generic.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +generic.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +generic.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +generic.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +generic.menu.non32xfer.fast.build.non32xferflags= +generic.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +generic.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER generic.menu.ResetMethod.nodemcu=dtr (aka nodemcu) generic.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset generic.menu.ResetMethod.ck=no dtr (aka ck) @@ -532,6 +546,18 @@ esp8285.menu.ssl.all=All SSL ciphers (most compatible) esp8285.menu.ssl.all.build.sslflags= esp8285.menu.ssl.basic=Basic SSL ciphers (lower ROM use) esp8285.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +esp8285.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +esp8285.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +esp8285.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +esp8285.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +esp8285.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +esp8285.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +esp8285.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +esp8285.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +esp8285.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +esp8285.menu.non32xfer.fast.build.non32xferflags= +esp8285.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +esp8285.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER esp8285.menu.ResetMethod.nodemcu=dtr (aka nodemcu) esp8285.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset esp8285.menu.ResetMethod.ck=no dtr (aka ck) @@ -831,4456 +857,6 @@ esp8285.menu.baud.921600.upload.speed=921600 esp8285.menu.baud.3000000=3000000 esp8285.menu.baud.3000000.upload.speed=3000000 -############################################################## -espduino.name=ESPDuino (ESP-13 Module) -espduino.build.board=ESP8266_ESP13 -espduino.build.variant=ESPDuino -espduino.menu.ResetMethod.v1=ESPduino-V1 -espduino.menu.ResetMethod.v1.upload.resetmethod=--before no_reset --after soft_reset -espduino.menu.ResetMethod.v2=ESPduino-V2 -espduino.menu.ResetMethod.v2.upload.resetmethod=--before default_reset --after hard_reset -espduino.menu.UploadTool.espota=OTA -espduino.menu.UploadTool.espota.upload.tool=espota -espduino.menu.UploadTool.esptool=Serial -espduino.menu.UploadTool.esptool.upload.tool=esptool -espduino.menu.UploadTool.esptool.upload.verbose=--trace -espduino.upload.tool=esptool -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.core=esp8266 -espduino.build.spiffs_pagesize=256 -espduino.build.debug_port= -espduino.build.debug_level= -espduino.menu.xtal.80=80 MHz -espduino.menu.xtal.80.build.f_cpu=80000000L -espduino.menu.xtal.160=160 MHz -espduino.menu.xtal.160.build.f_cpu=160000000L -espduino.menu.vt.flash=Flash -espduino.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -espduino.menu.vt.heap=Heap -espduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -espduino.menu.vt.iram=IRAM -espduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espduino.menu.exception.disabled=Disabled (new aborts on oom) -espduino.menu.exception.disabled.build.exception_flags=-fno-exceptions -espduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -espduino.menu.exception.enabled=Enabled -espduino.menu.exception.enabled.build.exception_flags=-fexceptions -espduino.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -espduino.menu.stacksmash.disabled=Disabled -espduino.menu.stacksmash.disabled.build.stacksmash_flags= -espduino.menu.stacksmash.enabled=Enabled -espduino.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -espduino.menu.ssl.all=All SSL ciphers (most compatible) -espduino.menu.ssl.all.build.sslflags= -espduino.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -espduino.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -espduino.build.flash_mode=dio -espduino.build.flash_flags=-DFLASHMODE_DIO -espduino.build.flash_freq=40 -espduino.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -espduino.menu.eesz.4M2M.build.flash_size=4M -espduino.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -espduino.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -espduino.menu.eesz.4M2M.build.spiffs_pagesize=256 -espduino.menu.eesz.4M2M.upload.maximum_size=1044464 -espduino.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -espduino.menu.eesz.4M2M.build.spiffs_start=0x200000 -espduino.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -espduino.menu.eesz.4M2M.build.spiffs_blocksize=8192 -espduino.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -espduino.menu.eesz.4M3M.build.flash_size=4M -espduino.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -espduino.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -espduino.menu.eesz.4M3M.build.spiffs_pagesize=256 -espduino.menu.eesz.4M3M.upload.maximum_size=1044464 -espduino.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -espduino.menu.eesz.4M3M.build.spiffs_start=0x100000 -espduino.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -espduino.menu.eesz.4M3M.build.spiffs_blocksize=8192 -espduino.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -espduino.menu.eesz.4M1M.build.flash_size=4M -espduino.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -espduino.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -espduino.menu.eesz.4M1M.build.spiffs_pagesize=256 -espduino.menu.eesz.4M1M.upload.maximum_size=1044464 -espduino.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -espduino.menu.eesz.4M1M.build.spiffs_start=0x300000 -espduino.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -espduino.menu.eesz.4M1M.build.spiffs_blocksize=8192 -espduino.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -espduino.menu.eesz.4M.build.flash_size=4M -espduino.menu.eesz.4M.build.flash_size_bytes=0x400000 -espduino.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -espduino.menu.eesz.4M.build.spiffs_pagesize=256 -espduino.menu.eesz.4M.upload.maximum_size=1044464 -espduino.menu.eesz.4M.build.rfcal_addr=0x3FC000 -espduino.menu.ip.lm2f=v2 Lower Memory -espduino.menu.ip.lm2f.build.lwip_include=lwip2/include -espduino.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -espduino.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espduino.menu.ip.hb2f=v2 Higher Bandwidth -espduino.menu.ip.hb2f.build.lwip_include=lwip2/include -espduino.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -espduino.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espduino.menu.ip.lm2n=v2 Lower Memory (no features) -espduino.menu.ip.lm2n.build.lwip_include=lwip2/include -espduino.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -espduino.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espduino.menu.ip.hb2n=v2 Higher Bandwidth (no features) -espduino.menu.ip.hb2n.build.lwip_include=lwip2/include -espduino.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -espduino.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espduino.menu.ip.lm6f=v2 IPv6 Lower Memory -espduino.menu.ip.lm6f.build.lwip_include=lwip2/include -espduino.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -espduino.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espduino.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -espduino.menu.ip.hb6f.build.lwip_include=lwip2/include -espduino.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -espduino.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espduino.menu.dbg.Disabled=Disabled -espduino.menu.dbg.Disabled.build.debug_port= -espduino.menu.dbg.Serial=Serial -espduino.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -espduino.menu.dbg.Serial1=Serial1 -espduino.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -espduino.menu.lvl.None____=None -espduino.menu.lvl.None____.build.debug_level= -espduino.menu.lvl.SSL=SSL -espduino.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -espduino.menu.lvl.TLS_MEM=TLS_MEM -espduino.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -espduino.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -espduino.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -espduino.menu.lvl.HTTP_SERVER=HTTP_SERVER -espduino.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -espduino.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -espduino.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -espduino.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -espduino.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -espduino.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -espduino.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espduino.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -espduino.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -espduino.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espduino.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -espduino.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -espduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espduino.menu.lvl.CORE=CORE -espduino.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -espduino.menu.lvl.WIFI=WIFI -espduino.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -espduino.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -espduino.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -espduino.menu.lvl.UPDATER=UPDATER -espduino.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -espduino.menu.lvl.OTA=OTA -espduino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -espduino.menu.lvl.OOM=OOM -espduino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espduino.menu.lvl.MDNS=MDNS -espduino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -espduino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -espduino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -espduino.menu.wipe.none=Only Sketch -espduino.menu.wipe.none.upload.erase_cmd= -espduino.menu.wipe.sdk=Sketch + WiFi Settings -espduino.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -espduino.menu.wipe.all=All Flash Contents -espduino.menu.wipe.all.upload.erase_cmd=erase_flash -espduino.menu.baud.115200=115200 -espduino.menu.baud.115200.upload.speed=115200 -espduino.menu.baud.57600=57600 -espduino.menu.baud.57600.upload.speed=57600 -espduino.menu.baud.230400.linux=230400 -espduino.menu.baud.230400.macosx=230400 -espduino.menu.baud.230400.upload.speed=230400 -espduino.menu.baud.256000.windows=256000 -espduino.menu.baud.256000.upload.speed=256000 -espduino.menu.baud.460800.linux=460800 -espduino.menu.baud.460800.macosx=460800 -espduino.menu.baud.460800.upload.speed=460800 -espduino.menu.baud.512000.windows=512000 -espduino.menu.baud.512000.upload.speed=512000 -espduino.menu.baud.921600=921600 -espduino.menu.baud.921600.upload.speed=921600 -espduino.menu.baud.3000000=3000000 -espduino.menu.baud.3000000.upload.speed=3000000 - -############################################################## -huzzah.name=Adafruit Feather HUZZAH ESP8266 -huzzah.build.board=ESP8266_ESP12 -huzzah.build.variant=adafruit -huzzah.upload.tool=esptool -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.core=esp8266 -huzzah.build.spiffs_pagesize=256 -huzzah.build.debug_port= -huzzah.build.debug_level= -huzzah.menu.xtal.80=80 MHz -huzzah.menu.xtal.80.build.f_cpu=80000000L -huzzah.menu.xtal.160=160 MHz -huzzah.menu.xtal.160.build.f_cpu=160000000L -huzzah.menu.vt.flash=Flash -huzzah.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -huzzah.menu.vt.heap=Heap -huzzah.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -huzzah.menu.vt.iram=IRAM -huzzah.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -huzzah.menu.exception.disabled=Disabled (new aborts on oom) -huzzah.menu.exception.disabled.build.exception_flags=-fno-exceptions -huzzah.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -huzzah.menu.exception.enabled=Enabled -huzzah.menu.exception.enabled.build.exception_flags=-fexceptions -huzzah.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -huzzah.menu.stacksmash.disabled=Disabled -huzzah.menu.stacksmash.disabled.build.stacksmash_flags= -huzzah.menu.stacksmash.enabled=Enabled -huzzah.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -huzzah.menu.ssl.all=All SSL ciphers (most compatible) -huzzah.menu.ssl.all.build.sslflags= -huzzah.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -huzzah.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -huzzah.upload.resetmethod=--before default_reset --after hard_reset -huzzah.build.flash_mode=qio -huzzah.build.flash_flags=-DFLASHMODE_QIO -huzzah.build.flash_freq=40 -huzzah.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -huzzah.menu.eesz.4M2M.build.flash_size=4M -huzzah.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -huzzah.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -huzzah.menu.eesz.4M2M.build.spiffs_pagesize=256 -huzzah.menu.eesz.4M2M.upload.maximum_size=1044464 -huzzah.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -huzzah.menu.eesz.4M2M.build.spiffs_start=0x200000 -huzzah.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -huzzah.menu.eesz.4M2M.build.spiffs_blocksize=8192 -huzzah.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -huzzah.menu.eesz.4M3M.build.flash_size=4M -huzzah.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -huzzah.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -huzzah.menu.eesz.4M3M.build.spiffs_pagesize=256 -huzzah.menu.eesz.4M3M.upload.maximum_size=1044464 -huzzah.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -huzzah.menu.eesz.4M3M.build.spiffs_start=0x100000 -huzzah.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -huzzah.menu.eesz.4M3M.build.spiffs_blocksize=8192 -huzzah.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -huzzah.menu.eesz.4M1M.build.flash_size=4M -huzzah.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -huzzah.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -huzzah.menu.eesz.4M1M.build.spiffs_pagesize=256 -huzzah.menu.eesz.4M1M.upload.maximum_size=1044464 -huzzah.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -huzzah.menu.eesz.4M1M.build.spiffs_start=0x300000 -huzzah.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -huzzah.menu.eesz.4M1M.build.spiffs_blocksize=8192 -huzzah.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -huzzah.menu.eesz.4M.build.flash_size=4M -huzzah.menu.eesz.4M.build.flash_size_bytes=0x400000 -huzzah.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -huzzah.menu.eesz.4M.build.spiffs_pagesize=256 -huzzah.menu.eesz.4M.upload.maximum_size=1044464 -huzzah.menu.eesz.4M.build.rfcal_addr=0x3FC000 -huzzah.menu.ip.lm2f=v2 Lower Memory -huzzah.menu.ip.lm2f.build.lwip_include=lwip2/include -huzzah.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -huzzah.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -huzzah.menu.ip.hb2f=v2 Higher Bandwidth -huzzah.menu.ip.hb2f.build.lwip_include=lwip2/include -huzzah.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -huzzah.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -huzzah.menu.ip.lm2n=v2 Lower Memory (no features) -huzzah.menu.ip.lm2n.build.lwip_include=lwip2/include -huzzah.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -huzzah.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -huzzah.menu.ip.hb2n=v2 Higher Bandwidth (no features) -huzzah.menu.ip.hb2n.build.lwip_include=lwip2/include -huzzah.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -huzzah.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -huzzah.menu.ip.lm6f=v2 IPv6 Lower Memory -huzzah.menu.ip.lm6f.build.lwip_include=lwip2/include -huzzah.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -huzzah.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -huzzah.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -huzzah.menu.ip.hb6f.build.lwip_include=lwip2/include -huzzah.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -huzzah.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -huzzah.menu.dbg.Disabled=Disabled -huzzah.menu.dbg.Disabled.build.debug_port= -huzzah.menu.dbg.Serial=Serial -huzzah.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -huzzah.menu.dbg.Serial1=Serial1 -huzzah.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -huzzah.menu.lvl.None____=None -huzzah.menu.lvl.None____.build.debug_level= -huzzah.menu.lvl.SSL=SSL -huzzah.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -huzzah.menu.lvl.TLS_MEM=TLS_MEM -huzzah.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -huzzah.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -huzzah.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -huzzah.menu.lvl.HTTP_SERVER=HTTP_SERVER -huzzah.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -huzzah.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -huzzah.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -huzzah.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -huzzah.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -huzzah.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -huzzah.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -huzzah.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -huzzah.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -huzzah.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -huzzah.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -huzzah.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -huzzah.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -huzzah.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -huzzah.menu.lvl.CORE=CORE -huzzah.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -huzzah.menu.lvl.WIFI=WIFI -huzzah.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -huzzah.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -huzzah.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -huzzah.menu.lvl.UPDATER=UPDATER -huzzah.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -huzzah.menu.lvl.OTA=OTA -huzzah.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -huzzah.menu.lvl.OOM=OOM -huzzah.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -huzzah.menu.lvl.MDNS=MDNS -huzzah.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -huzzah.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -huzzah.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -huzzah.menu.wipe.none=Only Sketch -huzzah.menu.wipe.none.upload.erase_cmd= -huzzah.menu.wipe.sdk=Sketch + WiFi Settings -huzzah.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -huzzah.menu.wipe.all=All Flash Contents -huzzah.menu.wipe.all.upload.erase_cmd=erase_flash -huzzah.menu.baud.115200=115200 -huzzah.menu.baud.115200.upload.speed=115200 -huzzah.menu.baud.57600=57600 -huzzah.menu.baud.57600.upload.speed=57600 -huzzah.menu.baud.230400.linux=230400 -huzzah.menu.baud.230400.macosx=230400 -huzzah.menu.baud.230400.upload.speed=230400 -huzzah.menu.baud.256000.windows=256000 -huzzah.menu.baud.256000.upload.speed=256000 -huzzah.menu.baud.460800.linux=460800 -huzzah.menu.baud.460800.macosx=460800 -huzzah.menu.baud.460800.upload.speed=460800 -huzzah.menu.baud.512000.windows=512000 -huzzah.menu.baud.512000.upload.speed=512000 -huzzah.menu.baud.921600=921600 -huzzah.menu.baud.921600.upload.speed=921600 -huzzah.menu.baud.3000000=3000000 -huzzah.menu.baud.3000000.upload.speed=3000000 - -############################################################## -inventone.name=Invent One -inventone.build.board=ESP8266_GENERIC -inventone.build.variant=inventone -inventone.upload.tool=esptool -inventone.upload.maximum_data_size=81920 -inventone.upload.wait_for_upload_port=true -inventone.upload.erase_cmd= -inventone.serial.disableDTR=true -inventone.serial.disableRTS=true -inventone.build.mcu=esp8266 -inventone.build.core=esp8266 -inventone.build.spiffs_pagesize=256 -inventone.build.debug_port= -inventone.build.debug_level= -inventone.menu.xtal.80=80 MHz -inventone.menu.xtal.80.build.f_cpu=80000000L -inventone.menu.xtal.160=160 MHz -inventone.menu.xtal.160.build.f_cpu=160000000L -inventone.menu.vt.flash=Flash -inventone.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -inventone.menu.vt.heap=Heap -inventone.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -inventone.menu.vt.iram=IRAM -inventone.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -inventone.menu.exception.disabled=Disabled (new aborts on oom) -inventone.menu.exception.disabled.build.exception_flags=-fno-exceptions -inventone.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -inventone.menu.exception.enabled=Enabled -inventone.menu.exception.enabled.build.exception_flags=-fexceptions -inventone.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -inventone.menu.stacksmash.disabled=Disabled -inventone.menu.stacksmash.disabled.build.stacksmash_flags= -inventone.menu.stacksmash.enabled=Enabled -inventone.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -inventone.menu.ssl.all=All SSL ciphers (most compatible) -inventone.menu.ssl.all.build.sslflags= -inventone.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -inventone.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -inventone.upload.resetmethod=--before default_reset --after hard_reset -inventone.build.flash_mode=dio -inventone.build.flash_flags=-DFLASHMODE_DIO -inventone.build.flash_freq=40 -inventone.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -inventone.menu.eesz.4M2M.build.flash_size=4M -inventone.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -inventone.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -inventone.menu.eesz.4M2M.build.spiffs_pagesize=256 -inventone.menu.eesz.4M2M.upload.maximum_size=1044464 -inventone.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -inventone.menu.eesz.4M2M.build.spiffs_start=0x200000 -inventone.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -inventone.menu.eesz.4M2M.build.spiffs_blocksize=8192 -inventone.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -inventone.menu.eesz.4M3M.build.flash_size=4M -inventone.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -inventone.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -inventone.menu.eesz.4M3M.build.spiffs_pagesize=256 -inventone.menu.eesz.4M3M.upload.maximum_size=1044464 -inventone.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -inventone.menu.eesz.4M3M.build.spiffs_start=0x100000 -inventone.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -inventone.menu.eesz.4M3M.build.spiffs_blocksize=8192 -inventone.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -inventone.menu.eesz.4M1M.build.flash_size=4M -inventone.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -inventone.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -inventone.menu.eesz.4M1M.build.spiffs_pagesize=256 -inventone.menu.eesz.4M1M.upload.maximum_size=1044464 -inventone.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -inventone.menu.eesz.4M1M.build.spiffs_start=0x300000 -inventone.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -inventone.menu.eesz.4M1M.build.spiffs_blocksize=8192 -inventone.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -inventone.menu.eesz.4M.build.flash_size=4M -inventone.menu.eesz.4M.build.flash_size_bytes=0x400000 -inventone.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -inventone.menu.eesz.4M.build.spiffs_pagesize=256 -inventone.menu.eesz.4M.upload.maximum_size=1044464 -inventone.menu.eesz.4M.build.rfcal_addr=0x3FC000 -inventone.menu.ip.lm2f=v2 Lower Memory -inventone.menu.ip.lm2f.build.lwip_include=lwip2/include -inventone.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -inventone.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -inventone.menu.ip.hb2f=v2 Higher Bandwidth -inventone.menu.ip.hb2f.build.lwip_include=lwip2/include -inventone.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -inventone.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -inventone.menu.ip.lm2n=v2 Lower Memory (no features) -inventone.menu.ip.lm2n.build.lwip_include=lwip2/include -inventone.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -inventone.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -inventone.menu.ip.hb2n=v2 Higher Bandwidth (no features) -inventone.menu.ip.hb2n.build.lwip_include=lwip2/include -inventone.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -inventone.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -inventone.menu.ip.lm6f=v2 IPv6 Lower Memory -inventone.menu.ip.lm6f.build.lwip_include=lwip2/include -inventone.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -inventone.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -inventone.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -inventone.menu.ip.hb6f.build.lwip_include=lwip2/include -inventone.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -inventone.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -inventone.menu.dbg.Disabled=Disabled -inventone.menu.dbg.Disabled.build.debug_port= -inventone.menu.dbg.Serial=Serial -inventone.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -inventone.menu.dbg.Serial1=Serial1 -inventone.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -inventone.menu.lvl.None____=None -inventone.menu.lvl.None____.build.debug_level= -inventone.menu.lvl.SSL=SSL -inventone.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -inventone.menu.lvl.TLS_MEM=TLS_MEM -inventone.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -inventone.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -inventone.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -inventone.menu.lvl.HTTP_SERVER=HTTP_SERVER -inventone.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -inventone.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -inventone.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -inventone.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -inventone.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -inventone.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -inventone.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -inventone.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -inventone.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -inventone.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -inventone.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -inventone.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -inventone.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -inventone.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -inventone.menu.lvl.CORE=CORE -inventone.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -inventone.menu.lvl.WIFI=WIFI -inventone.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -inventone.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -inventone.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -inventone.menu.lvl.UPDATER=UPDATER -inventone.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -inventone.menu.lvl.OTA=OTA -inventone.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -inventone.menu.lvl.OOM=OOM -inventone.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -inventone.menu.lvl.MDNS=MDNS -inventone.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -inventone.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -inventone.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -inventone.menu.wipe.none=Only Sketch -inventone.menu.wipe.none.upload.erase_cmd= -inventone.menu.wipe.sdk=Sketch + WiFi Settings -inventone.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -inventone.menu.wipe.all=All Flash Contents -inventone.menu.wipe.all.upload.erase_cmd=erase_flash -inventone.menu.baud.115200=115200 -inventone.menu.baud.115200.upload.speed=115200 -inventone.menu.baud.57600=57600 -inventone.menu.baud.57600.upload.speed=57600 -inventone.menu.baud.230400.linux=230400 -inventone.menu.baud.230400.macosx=230400 -inventone.menu.baud.230400.upload.speed=230400 -inventone.menu.baud.256000.windows=256000 -inventone.menu.baud.256000.upload.speed=256000 -inventone.menu.baud.460800.linux=460800 -inventone.menu.baud.460800.macosx=460800 -inventone.menu.baud.460800.upload.speed=460800 -inventone.menu.baud.512000.windows=512000 -inventone.menu.baud.512000.upload.speed=512000 -inventone.menu.baud.921600=921600 -inventone.menu.baud.921600.upload.speed=921600 -inventone.menu.baud.3000000=3000000 -inventone.menu.baud.3000000.upload.speed=3000000 - -############################################################## -cw01.name=XinaBox CW01 -cw01.build.board=ESP8266_GENERIC -cw01.build.variant=xinabox -cw01.upload.tool=esptool -cw01.upload.maximum_data_size=81920 -cw01.upload.wait_for_upload_port=true -cw01.upload.erase_cmd= -cw01.serial.disableDTR=true -cw01.serial.disableRTS=true -cw01.build.mcu=esp8266 -cw01.build.core=esp8266 -cw01.build.spiffs_pagesize=256 -cw01.build.debug_port= -cw01.build.debug_level= -cw01.menu.xtal.80=80 MHz -cw01.menu.xtal.80.build.f_cpu=80000000L -cw01.menu.xtal.160=160 MHz -cw01.menu.xtal.160.build.f_cpu=160000000L -cw01.menu.vt.flash=Flash -cw01.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -cw01.menu.vt.heap=Heap -cw01.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -cw01.menu.vt.iram=IRAM -cw01.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -cw01.menu.exception.disabled=Disabled (new aborts on oom) -cw01.menu.exception.disabled.build.exception_flags=-fno-exceptions -cw01.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -cw01.menu.exception.enabled=Enabled -cw01.menu.exception.enabled.build.exception_flags=-fexceptions -cw01.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -cw01.menu.stacksmash.disabled=Disabled -cw01.menu.stacksmash.disabled.build.stacksmash_flags= -cw01.menu.stacksmash.enabled=Enabled -cw01.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -cw01.menu.ssl.all=All SSL ciphers (most compatible) -cw01.menu.ssl.all.build.sslflags= -cw01.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -cw01.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -cw01.upload.resetmethod=--before default_reset --after hard_reset -cw01.menu.CrystalFreq.26=26 MHz -cw01.menu.CrystalFreq.40=40 MHz -cw01.menu.CrystalFreq.40.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 -cw01.build.flash_mode=dio -cw01.build.flash_flags=-DFLASHMODE_DIO -cw01.build.flash_freq=40 -cw01.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -cw01.menu.eesz.4M2M.build.flash_size=4M -cw01.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -cw01.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -cw01.menu.eesz.4M2M.build.spiffs_pagesize=256 -cw01.menu.eesz.4M2M.upload.maximum_size=1044464 -cw01.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -cw01.menu.eesz.4M2M.build.spiffs_start=0x200000 -cw01.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -cw01.menu.eesz.4M2M.build.spiffs_blocksize=8192 -cw01.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -cw01.menu.eesz.4M3M.build.flash_size=4M -cw01.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -cw01.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -cw01.menu.eesz.4M3M.build.spiffs_pagesize=256 -cw01.menu.eesz.4M3M.upload.maximum_size=1044464 -cw01.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -cw01.menu.eesz.4M3M.build.spiffs_start=0x100000 -cw01.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -cw01.menu.eesz.4M3M.build.spiffs_blocksize=8192 -cw01.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -cw01.menu.eesz.4M1M.build.flash_size=4M -cw01.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -cw01.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -cw01.menu.eesz.4M1M.build.spiffs_pagesize=256 -cw01.menu.eesz.4M1M.upload.maximum_size=1044464 -cw01.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -cw01.menu.eesz.4M1M.build.spiffs_start=0x300000 -cw01.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -cw01.menu.eesz.4M1M.build.spiffs_blocksize=8192 -cw01.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -cw01.menu.eesz.4M.build.flash_size=4M -cw01.menu.eesz.4M.build.flash_size_bytes=0x400000 -cw01.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -cw01.menu.eesz.4M.build.spiffs_pagesize=256 -cw01.menu.eesz.4M.upload.maximum_size=1044464 -cw01.menu.eesz.4M.build.rfcal_addr=0x3FC000 -cw01.menu.ip.lm2f=v2 Lower Memory -cw01.menu.ip.lm2f.build.lwip_include=lwip2/include -cw01.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -cw01.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -cw01.menu.ip.hb2f=v2 Higher Bandwidth -cw01.menu.ip.hb2f.build.lwip_include=lwip2/include -cw01.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -cw01.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -cw01.menu.ip.lm2n=v2 Lower Memory (no features) -cw01.menu.ip.lm2n.build.lwip_include=lwip2/include -cw01.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -cw01.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -cw01.menu.ip.hb2n=v2 Higher Bandwidth (no features) -cw01.menu.ip.hb2n.build.lwip_include=lwip2/include -cw01.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -cw01.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -cw01.menu.ip.lm6f=v2 IPv6 Lower Memory -cw01.menu.ip.lm6f.build.lwip_include=lwip2/include -cw01.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -cw01.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -cw01.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -cw01.menu.ip.hb6f.build.lwip_include=lwip2/include -cw01.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -cw01.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -cw01.menu.dbg.Disabled=Disabled -cw01.menu.dbg.Disabled.build.debug_port= -cw01.menu.dbg.Serial=Serial -cw01.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -cw01.menu.dbg.Serial1=Serial1 -cw01.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -cw01.menu.lvl.None____=None -cw01.menu.lvl.None____.build.debug_level= -cw01.menu.lvl.SSL=SSL -cw01.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -cw01.menu.lvl.TLS_MEM=TLS_MEM -cw01.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -cw01.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -cw01.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -cw01.menu.lvl.HTTP_SERVER=HTTP_SERVER -cw01.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -cw01.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -cw01.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -cw01.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -cw01.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -cw01.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -cw01.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -cw01.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -cw01.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -cw01.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -cw01.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -cw01.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -cw01.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -cw01.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -cw01.menu.lvl.CORE=CORE -cw01.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -cw01.menu.lvl.WIFI=WIFI -cw01.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -cw01.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -cw01.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -cw01.menu.lvl.UPDATER=UPDATER -cw01.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -cw01.menu.lvl.OTA=OTA -cw01.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -cw01.menu.lvl.OOM=OOM -cw01.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -cw01.menu.lvl.MDNS=MDNS -cw01.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -cw01.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -cw01.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -cw01.menu.wipe.none=Only Sketch -cw01.menu.wipe.none.upload.erase_cmd= -cw01.menu.wipe.sdk=Sketch + WiFi Settings -cw01.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -cw01.menu.wipe.all=All Flash Contents -cw01.menu.wipe.all.upload.erase_cmd=erase_flash -cw01.menu.baud.115200=115200 -cw01.menu.baud.115200.upload.speed=115200 -cw01.menu.baud.57600=57600 -cw01.menu.baud.57600.upload.speed=57600 -cw01.menu.baud.230400.linux=230400 -cw01.menu.baud.230400.macosx=230400 -cw01.menu.baud.230400.upload.speed=230400 -cw01.menu.baud.256000.windows=256000 -cw01.menu.baud.256000.upload.speed=256000 -cw01.menu.baud.460800.linux=460800 -cw01.menu.baud.460800.macosx=460800 -cw01.menu.baud.460800.upload.speed=460800 -cw01.menu.baud.512000.windows=512000 -cw01.menu.baud.512000.upload.speed=512000 -cw01.menu.baud.921600=921600 -cw01.menu.baud.921600.upload.speed=921600 -cw01.menu.baud.3000000=3000000 -cw01.menu.baud.3000000.upload.speed=3000000 - -############################################################## -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.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.core=esp8266 -espresso_lite_v1.build.spiffs_pagesize=256 -espresso_lite_v1.build.debug_port= -espresso_lite_v1.build.debug_level= -espresso_lite_v1.menu.xtal.80=80 MHz -espresso_lite_v1.menu.xtal.80.build.f_cpu=80000000L -espresso_lite_v1.menu.xtal.160=160 MHz -espresso_lite_v1.menu.xtal.160.build.f_cpu=160000000L -espresso_lite_v1.menu.vt.flash=Flash -espresso_lite_v1.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -espresso_lite_v1.menu.vt.heap=Heap -espresso_lite_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -espresso_lite_v1.menu.vt.iram=IRAM -espresso_lite_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espresso_lite_v1.menu.exception.disabled=Disabled (new aborts on oom) -espresso_lite_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions -espresso_lite_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -espresso_lite_v1.menu.exception.enabled=Enabled -espresso_lite_v1.menu.exception.enabled.build.exception_flags=-fexceptions -espresso_lite_v1.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -espresso_lite_v1.menu.stacksmash.disabled=Disabled -espresso_lite_v1.menu.stacksmash.disabled.build.stacksmash_flags= -espresso_lite_v1.menu.stacksmash.enabled=Enabled -espresso_lite_v1.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -espresso_lite_v1.menu.ssl.all=All SSL ciphers (most compatible) -espresso_lite_v1.menu.ssl.all.build.sslflags= -espresso_lite_v1.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -espresso_lite_v1.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -espresso_lite_v1.build.flash_mode=dio -espresso_lite_v1.build.flash_flags=-DFLASHMODE_DIO -espresso_lite_v1.build.flash_freq=40 -espresso_lite_v1.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -espresso_lite_v1.menu.eesz.4M2M.build.flash_size=4M -espresso_lite_v1.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -espresso_lite_v1.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -espresso_lite_v1.menu.eesz.4M2M.build.spiffs_pagesize=256 -espresso_lite_v1.menu.eesz.4M2M.upload.maximum_size=1044464 -espresso_lite_v1.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -espresso_lite_v1.menu.eesz.4M2M.build.spiffs_start=0x200000 -espresso_lite_v1.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -espresso_lite_v1.menu.eesz.4M2M.build.spiffs_blocksize=8192 -espresso_lite_v1.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -espresso_lite_v1.menu.eesz.4M3M.build.flash_size=4M -espresso_lite_v1.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -espresso_lite_v1.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -espresso_lite_v1.menu.eesz.4M3M.build.spiffs_pagesize=256 -espresso_lite_v1.menu.eesz.4M3M.upload.maximum_size=1044464 -espresso_lite_v1.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -espresso_lite_v1.menu.eesz.4M3M.build.spiffs_start=0x100000 -espresso_lite_v1.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -espresso_lite_v1.menu.eesz.4M3M.build.spiffs_blocksize=8192 -espresso_lite_v1.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -espresso_lite_v1.menu.eesz.4M1M.build.flash_size=4M -espresso_lite_v1.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -espresso_lite_v1.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -espresso_lite_v1.menu.eesz.4M1M.build.spiffs_pagesize=256 -espresso_lite_v1.menu.eesz.4M1M.upload.maximum_size=1044464 -espresso_lite_v1.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -espresso_lite_v1.menu.eesz.4M1M.build.spiffs_start=0x300000 -espresso_lite_v1.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -espresso_lite_v1.menu.eesz.4M1M.build.spiffs_blocksize=8192 -espresso_lite_v1.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -espresso_lite_v1.menu.eesz.4M.build.flash_size=4M -espresso_lite_v1.menu.eesz.4M.build.flash_size_bytes=0x400000 -espresso_lite_v1.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -espresso_lite_v1.menu.eesz.4M.build.spiffs_pagesize=256 -espresso_lite_v1.menu.eesz.4M.upload.maximum_size=1044464 -espresso_lite_v1.menu.eesz.4M.build.rfcal_addr=0x3FC000 -espresso_lite_v1.menu.ResetMethod.nodemcu=dtr (aka nodemcu) -espresso_lite_v1.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset -espresso_lite_v1.menu.ResetMethod.ck=no dtr (aka ck) -espresso_lite_v1.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset -espresso_lite_v1.menu.ip.lm2f=v2 Lower Memory -espresso_lite_v1.menu.ip.lm2f.build.lwip_include=lwip2/include -espresso_lite_v1.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -espresso_lite_v1.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espresso_lite_v1.menu.ip.hb2f=v2 Higher Bandwidth -espresso_lite_v1.menu.ip.hb2f.build.lwip_include=lwip2/include -espresso_lite_v1.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -espresso_lite_v1.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espresso_lite_v1.menu.ip.lm2n=v2 Lower Memory (no features) -espresso_lite_v1.menu.ip.lm2n.build.lwip_include=lwip2/include -espresso_lite_v1.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -espresso_lite_v1.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espresso_lite_v1.menu.ip.hb2n=v2 Higher Bandwidth (no features) -espresso_lite_v1.menu.ip.hb2n.build.lwip_include=lwip2/include -espresso_lite_v1.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -espresso_lite_v1.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espresso_lite_v1.menu.ip.lm6f=v2 IPv6 Lower Memory -espresso_lite_v1.menu.ip.lm6f.build.lwip_include=lwip2/include -espresso_lite_v1.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -espresso_lite_v1.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espresso_lite_v1.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -espresso_lite_v1.menu.ip.hb6f.build.lwip_include=lwip2/include -espresso_lite_v1.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -espresso_lite_v1.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espresso_lite_v1.menu.dbg.Disabled=Disabled -espresso_lite_v1.menu.dbg.Disabled.build.debug_port= -espresso_lite_v1.menu.dbg.Serial=Serial -espresso_lite_v1.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -espresso_lite_v1.menu.dbg.Serial1=Serial1 -espresso_lite_v1.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -espresso_lite_v1.menu.lvl.None____=None -espresso_lite_v1.menu.lvl.None____.build.debug_level= -espresso_lite_v1.menu.lvl.SSL=SSL -espresso_lite_v1.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -espresso_lite_v1.menu.lvl.TLS_MEM=TLS_MEM -espresso_lite_v1.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -espresso_lite_v1.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -espresso_lite_v1.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v1.menu.lvl.HTTP_SERVER=HTTP_SERVER -espresso_lite_v1.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v1.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -espresso_lite_v1.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -espresso_lite_v1.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -espresso_lite_v1.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v1.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -espresso_lite_v1.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v1.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -espresso_lite_v1.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -espresso_lite_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -espresso_lite_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espresso_lite_v1.menu.lvl.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.lvl.CORE=CORE -espresso_lite_v1.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -espresso_lite_v1.menu.lvl.WIFI=WIFI -espresso_lite_v1.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -espresso_lite_v1.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -espresso_lite_v1.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -espresso_lite_v1.menu.lvl.UPDATER=UPDATER -espresso_lite_v1.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -espresso_lite_v1.menu.lvl.OTA=OTA -espresso_lite_v1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -espresso_lite_v1.menu.lvl.OOM=OOM -espresso_lite_v1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espresso_lite_v1.menu.lvl.MDNS=MDNS -espresso_lite_v1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -espresso_lite_v1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -espresso_lite_v1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -espresso_lite_v1.menu.wipe.none=Only Sketch -espresso_lite_v1.menu.wipe.none.upload.erase_cmd= -espresso_lite_v1.menu.wipe.sdk=Sketch + WiFi Settings -espresso_lite_v1.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -espresso_lite_v1.menu.wipe.all=All Flash Contents -espresso_lite_v1.menu.wipe.all.upload.erase_cmd=erase_flash -espresso_lite_v1.menu.baud.115200=115200 -espresso_lite_v1.menu.baud.115200.upload.speed=115200 -espresso_lite_v1.menu.baud.57600=57600 -espresso_lite_v1.menu.baud.57600.upload.speed=57600 -espresso_lite_v1.menu.baud.230400.linux=230400 -espresso_lite_v1.menu.baud.230400.macosx=230400 -espresso_lite_v1.menu.baud.230400.upload.speed=230400 -espresso_lite_v1.menu.baud.256000.windows=256000 -espresso_lite_v1.menu.baud.256000.upload.speed=256000 -espresso_lite_v1.menu.baud.460800.linux=460800 -espresso_lite_v1.menu.baud.460800.macosx=460800 -espresso_lite_v1.menu.baud.460800.upload.speed=460800 -espresso_lite_v1.menu.baud.512000.windows=512000 -espresso_lite_v1.menu.baud.512000.upload.speed=512000 -espresso_lite_v1.menu.baud.921600=921600 -espresso_lite_v1.menu.baud.921600.upload.speed=921600 -espresso_lite_v1.menu.baud.3000000=3000000 -espresso_lite_v1.menu.baud.3000000.upload.speed=3000000 - -############################################################## -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.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.core=esp8266 -espresso_lite_v2.build.spiffs_pagesize=256 -espresso_lite_v2.build.debug_port= -espresso_lite_v2.build.debug_level= -espresso_lite_v2.menu.xtal.80=80 MHz -espresso_lite_v2.menu.xtal.80.build.f_cpu=80000000L -espresso_lite_v2.menu.xtal.160=160 MHz -espresso_lite_v2.menu.xtal.160.build.f_cpu=160000000L -espresso_lite_v2.menu.vt.flash=Flash -espresso_lite_v2.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -espresso_lite_v2.menu.vt.heap=Heap -espresso_lite_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -espresso_lite_v2.menu.vt.iram=IRAM -espresso_lite_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espresso_lite_v2.menu.exception.disabled=Disabled (new aborts on oom) -espresso_lite_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions -espresso_lite_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -espresso_lite_v2.menu.exception.enabled=Enabled -espresso_lite_v2.menu.exception.enabled.build.exception_flags=-fexceptions -espresso_lite_v2.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -espresso_lite_v2.menu.stacksmash.disabled=Disabled -espresso_lite_v2.menu.stacksmash.disabled.build.stacksmash_flags= -espresso_lite_v2.menu.stacksmash.enabled=Enabled -espresso_lite_v2.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -espresso_lite_v2.menu.ssl.all=All SSL ciphers (most compatible) -espresso_lite_v2.menu.ssl.all.build.sslflags= -espresso_lite_v2.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -espresso_lite_v2.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -espresso_lite_v2.build.flash_mode=dio -espresso_lite_v2.build.flash_flags=-DFLASHMODE_DIO -espresso_lite_v2.build.flash_freq=40 -espresso_lite_v2.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -espresso_lite_v2.menu.eesz.4M2M.build.flash_size=4M -espresso_lite_v2.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -espresso_lite_v2.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -espresso_lite_v2.menu.eesz.4M2M.build.spiffs_pagesize=256 -espresso_lite_v2.menu.eesz.4M2M.upload.maximum_size=1044464 -espresso_lite_v2.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -espresso_lite_v2.menu.eesz.4M2M.build.spiffs_start=0x200000 -espresso_lite_v2.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -espresso_lite_v2.menu.eesz.4M2M.build.spiffs_blocksize=8192 -espresso_lite_v2.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -espresso_lite_v2.menu.eesz.4M3M.build.flash_size=4M -espresso_lite_v2.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -espresso_lite_v2.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -espresso_lite_v2.menu.eesz.4M3M.build.spiffs_pagesize=256 -espresso_lite_v2.menu.eesz.4M3M.upload.maximum_size=1044464 -espresso_lite_v2.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -espresso_lite_v2.menu.eesz.4M3M.build.spiffs_start=0x100000 -espresso_lite_v2.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -espresso_lite_v2.menu.eesz.4M3M.build.spiffs_blocksize=8192 -espresso_lite_v2.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -espresso_lite_v2.menu.eesz.4M1M.build.flash_size=4M -espresso_lite_v2.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -espresso_lite_v2.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -espresso_lite_v2.menu.eesz.4M1M.build.spiffs_pagesize=256 -espresso_lite_v2.menu.eesz.4M1M.upload.maximum_size=1044464 -espresso_lite_v2.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -espresso_lite_v2.menu.eesz.4M1M.build.spiffs_start=0x300000 -espresso_lite_v2.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -espresso_lite_v2.menu.eesz.4M1M.build.spiffs_blocksize=8192 -espresso_lite_v2.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -espresso_lite_v2.menu.eesz.4M.build.flash_size=4M -espresso_lite_v2.menu.eesz.4M.build.flash_size_bytes=0x400000 -espresso_lite_v2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -espresso_lite_v2.menu.eesz.4M.build.spiffs_pagesize=256 -espresso_lite_v2.menu.eesz.4M.upload.maximum_size=1044464 -espresso_lite_v2.menu.eesz.4M.build.rfcal_addr=0x3FC000 -espresso_lite_v2.menu.ResetMethod.nodemcu=dtr (aka nodemcu) -espresso_lite_v2.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset -espresso_lite_v2.menu.ResetMethod.ck=no dtr (aka ck) -espresso_lite_v2.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset -espresso_lite_v2.menu.ip.lm2f=v2 Lower Memory -espresso_lite_v2.menu.ip.lm2f.build.lwip_include=lwip2/include -espresso_lite_v2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -espresso_lite_v2.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espresso_lite_v2.menu.ip.hb2f=v2 Higher Bandwidth -espresso_lite_v2.menu.ip.hb2f.build.lwip_include=lwip2/include -espresso_lite_v2.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -espresso_lite_v2.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espresso_lite_v2.menu.ip.lm2n=v2 Lower Memory (no features) -espresso_lite_v2.menu.ip.lm2n.build.lwip_include=lwip2/include -espresso_lite_v2.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -espresso_lite_v2.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espresso_lite_v2.menu.ip.hb2n=v2 Higher Bandwidth (no features) -espresso_lite_v2.menu.ip.hb2n.build.lwip_include=lwip2/include -espresso_lite_v2.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -espresso_lite_v2.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espresso_lite_v2.menu.ip.lm6f=v2 IPv6 Lower Memory -espresso_lite_v2.menu.ip.lm6f.build.lwip_include=lwip2/include -espresso_lite_v2.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -espresso_lite_v2.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espresso_lite_v2.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -espresso_lite_v2.menu.ip.hb6f.build.lwip_include=lwip2/include -espresso_lite_v2.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -espresso_lite_v2.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espresso_lite_v2.menu.dbg.Disabled=Disabled -espresso_lite_v2.menu.dbg.Disabled.build.debug_port= -espresso_lite_v2.menu.dbg.Serial=Serial -espresso_lite_v2.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -espresso_lite_v2.menu.dbg.Serial1=Serial1 -espresso_lite_v2.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -espresso_lite_v2.menu.lvl.None____=None -espresso_lite_v2.menu.lvl.None____.build.debug_level= -espresso_lite_v2.menu.lvl.SSL=SSL -espresso_lite_v2.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -espresso_lite_v2.menu.lvl.TLS_MEM=TLS_MEM -espresso_lite_v2.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -espresso_lite_v2.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -espresso_lite_v2.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v2.menu.lvl.HTTP_SERVER=HTTP_SERVER -espresso_lite_v2.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v2.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -espresso_lite_v2.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -espresso_lite_v2.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -espresso_lite_v2.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v2.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -espresso_lite_v2.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v2.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -espresso_lite_v2.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -espresso_lite_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -espresso_lite_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espresso_lite_v2.menu.lvl.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.lvl.CORE=CORE -espresso_lite_v2.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -espresso_lite_v2.menu.lvl.WIFI=WIFI -espresso_lite_v2.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -espresso_lite_v2.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -espresso_lite_v2.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -espresso_lite_v2.menu.lvl.UPDATER=UPDATER -espresso_lite_v2.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -espresso_lite_v2.menu.lvl.OTA=OTA -espresso_lite_v2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -espresso_lite_v2.menu.lvl.OOM=OOM -espresso_lite_v2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espresso_lite_v2.menu.lvl.MDNS=MDNS -espresso_lite_v2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -espresso_lite_v2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -espresso_lite_v2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -espresso_lite_v2.menu.wipe.none=Only Sketch -espresso_lite_v2.menu.wipe.none.upload.erase_cmd= -espresso_lite_v2.menu.wipe.sdk=Sketch + WiFi Settings -espresso_lite_v2.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -espresso_lite_v2.menu.wipe.all=All Flash Contents -espresso_lite_v2.menu.wipe.all.upload.erase_cmd=erase_flash -espresso_lite_v2.menu.baud.115200=115200 -espresso_lite_v2.menu.baud.115200.upload.speed=115200 -espresso_lite_v2.menu.baud.57600=57600 -espresso_lite_v2.menu.baud.57600.upload.speed=57600 -espresso_lite_v2.menu.baud.230400.linux=230400 -espresso_lite_v2.menu.baud.230400.macosx=230400 -espresso_lite_v2.menu.baud.230400.upload.speed=230400 -espresso_lite_v2.menu.baud.256000.windows=256000 -espresso_lite_v2.menu.baud.256000.upload.speed=256000 -espresso_lite_v2.menu.baud.460800.linux=460800 -espresso_lite_v2.menu.baud.460800.macosx=460800 -espresso_lite_v2.menu.baud.460800.upload.speed=460800 -espresso_lite_v2.menu.baud.512000.windows=512000 -espresso_lite_v2.menu.baud.512000.upload.speed=512000 -espresso_lite_v2.menu.baud.921600=921600 -espresso_lite_v2.menu.baud.921600.upload.speed=921600 -espresso_lite_v2.menu.baud.3000000=3000000 -espresso_lite_v2.menu.baud.3000000.upload.speed=3000000 - -############################################################## -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.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.core=esp8266 -phoenix_v1.build.spiffs_pagesize=256 -phoenix_v1.build.debug_port= -phoenix_v1.build.debug_level= -phoenix_v1.menu.xtal.80=80 MHz -phoenix_v1.menu.xtal.80.build.f_cpu=80000000L -phoenix_v1.menu.xtal.160=160 MHz -phoenix_v1.menu.xtal.160.build.f_cpu=160000000L -phoenix_v1.menu.vt.flash=Flash -phoenix_v1.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -phoenix_v1.menu.vt.heap=Heap -phoenix_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -phoenix_v1.menu.vt.iram=IRAM -phoenix_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -phoenix_v1.menu.exception.disabled=Disabled (new aborts on oom) -phoenix_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions -phoenix_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -phoenix_v1.menu.exception.enabled=Enabled -phoenix_v1.menu.exception.enabled.build.exception_flags=-fexceptions -phoenix_v1.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -phoenix_v1.menu.stacksmash.disabled=Disabled -phoenix_v1.menu.stacksmash.disabled.build.stacksmash_flags= -phoenix_v1.menu.stacksmash.enabled=Enabled -phoenix_v1.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -phoenix_v1.menu.ssl.all=All SSL ciphers (most compatible) -phoenix_v1.menu.ssl.all.build.sslflags= -phoenix_v1.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -phoenix_v1.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -phoenix_v1.build.flash_mode=dio -phoenix_v1.build.flash_flags=-DFLASHMODE_DIO -phoenix_v1.build.flash_freq=40 -phoenix_v1.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -phoenix_v1.menu.eesz.4M2M.build.flash_size=4M -phoenix_v1.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -phoenix_v1.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -phoenix_v1.menu.eesz.4M2M.build.spiffs_pagesize=256 -phoenix_v1.menu.eesz.4M2M.upload.maximum_size=1044464 -phoenix_v1.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -phoenix_v1.menu.eesz.4M2M.build.spiffs_start=0x200000 -phoenix_v1.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -phoenix_v1.menu.eesz.4M2M.build.spiffs_blocksize=8192 -phoenix_v1.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -phoenix_v1.menu.eesz.4M3M.build.flash_size=4M -phoenix_v1.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -phoenix_v1.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -phoenix_v1.menu.eesz.4M3M.build.spiffs_pagesize=256 -phoenix_v1.menu.eesz.4M3M.upload.maximum_size=1044464 -phoenix_v1.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -phoenix_v1.menu.eesz.4M3M.build.spiffs_start=0x100000 -phoenix_v1.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -phoenix_v1.menu.eesz.4M3M.build.spiffs_blocksize=8192 -phoenix_v1.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -phoenix_v1.menu.eesz.4M1M.build.flash_size=4M -phoenix_v1.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -phoenix_v1.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -phoenix_v1.menu.eesz.4M1M.build.spiffs_pagesize=256 -phoenix_v1.menu.eesz.4M1M.upload.maximum_size=1044464 -phoenix_v1.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -phoenix_v1.menu.eesz.4M1M.build.spiffs_start=0x300000 -phoenix_v1.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -phoenix_v1.menu.eesz.4M1M.build.spiffs_blocksize=8192 -phoenix_v1.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -phoenix_v1.menu.eesz.4M.build.flash_size=4M -phoenix_v1.menu.eesz.4M.build.flash_size_bytes=0x400000 -phoenix_v1.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -phoenix_v1.menu.eesz.4M.build.spiffs_pagesize=256 -phoenix_v1.menu.eesz.4M.upload.maximum_size=1044464 -phoenix_v1.menu.eesz.4M.build.rfcal_addr=0x3FC000 -phoenix_v1.menu.ResetMethod.nodemcu=dtr (aka nodemcu) -phoenix_v1.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset -phoenix_v1.menu.ResetMethod.ck=no dtr (aka ck) -phoenix_v1.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset -phoenix_v1.menu.ip.lm2f=v2 Lower Memory -phoenix_v1.menu.ip.lm2f.build.lwip_include=lwip2/include -phoenix_v1.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -phoenix_v1.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -phoenix_v1.menu.ip.hb2f=v2 Higher Bandwidth -phoenix_v1.menu.ip.hb2f.build.lwip_include=lwip2/include -phoenix_v1.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -phoenix_v1.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -phoenix_v1.menu.ip.lm2n=v2 Lower Memory (no features) -phoenix_v1.menu.ip.lm2n.build.lwip_include=lwip2/include -phoenix_v1.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -phoenix_v1.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -phoenix_v1.menu.ip.hb2n=v2 Higher Bandwidth (no features) -phoenix_v1.menu.ip.hb2n.build.lwip_include=lwip2/include -phoenix_v1.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -phoenix_v1.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -phoenix_v1.menu.ip.lm6f=v2 IPv6 Lower Memory -phoenix_v1.menu.ip.lm6f.build.lwip_include=lwip2/include -phoenix_v1.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -phoenix_v1.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -phoenix_v1.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -phoenix_v1.menu.ip.hb6f.build.lwip_include=lwip2/include -phoenix_v1.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -phoenix_v1.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -phoenix_v1.menu.dbg.Disabled=Disabled -phoenix_v1.menu.dbg.Disabled.build.debug_port= -phoenix_v1.menu.dbg.Serial=Serial -phoenix_v1.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -phoenix_v1.menu.dbg.Serial1=Serial1 -phoenix_v1.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -phoenix_v1.menu.lvl.None____=None -phoenix_v1.menu.lvl.None____.build.debug_level= -phoenix_v1.menu.lvl.SSL=SSL -phoenix_v1.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -phoenix_v1.menu.lvl.TLS_MEM=TLS_MEM -phoenix_v1.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -phoenix_v1.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -phoenix_v1.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -phoenix_v1.menu.lvl.HTTP_SERVER=HTTP_SERVER -phoenix_v1.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -phoenix_v1.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -phoenix_v1.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -phoenix_v1.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -phoenix_v1.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -phoenix_v1.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -phoenix_v1.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -phoenix_v1.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -phoenix_v1.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -phoenix_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -phoenix_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -phoenix_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -phoenix_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -phoenix_v1.menu.lvl.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.lvl.CORE=CORE -phoenix_v1.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -phoenix_v1.menu.lvl.WIFI=WIFI -phoenix_v1.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -phoenix_v1.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -phoenix_v1.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -phoenix_v1.menu.lvl.UPDATER=UPDATER -phoenix_v1.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -phoenix_v1.menu.lvl.OTA=OTA -phoenix_v1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -phoenix_v1.menu.lvl.OOM=OOM -phoenix_v1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -phoenix_v1.menu.lvl.MDNS=MDNS -phoenix_v1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -phoenix_v1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -phoenix_v1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -phoenix_v1.menu.wipe.none=Only Sketch -phoenix_v1.menu.wipe.none.upload.erase_cmd= -phoenix_v1.menu.wipe.sdk=Sketch + WiFi Settings -phoenix_v1.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -phoenix_v1.menu.wipe.all=All Flash Contents -phoenix_v1.menu.wipe.all.upload.erase_cmd=erase_flash -phoenix_v1.menu.baud.115200=115200 -phoenix_v1.menu.baud.115200.upload.speed=115200 -phoenix_v1.menu.baud.57600=57600 -phoenix_v1.menu.baud.57600.upload.speed=57600 -phoenix_v1.menu.baud.230400.linux=230400 -phoenix_v1.menu.baud.230400.macosx=230400 -phoenix_v1.menu.baud.230400.upload.speed=230400 -phoenix_v1.menu.baud.256000.windows=256000 -phoenix_v1.menu.baud.256000.upload.speed=256000 -phoenix_v1.menu.baud.460800.linux=460800 -phoenix_v1.menu.baud.460800.macosx=460800 -phoenix_v1.menu.baud.460800.upload.speed=460800 -phoenix_v1.menu.baud.512000.windows=512000 -phoenix_v1.menu.baud.512000.upload.speed=512000 -phoenix_v1.menu.baud.921600=921600 -phoenix_v1.menu.baud.921600.upload.speed=921600 -phoenix_v1.menu.baud.3000000=3000000 -phoenix_v1.menu.baud.3000000.upload.speed=3000000 - -############################################################## -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.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.core=esp8266 -phoenix_v2.build.spiffs_pagesize=256 -phoenix_v2.build.debug_port= -phoenix_v2.build.debug_level= -phoenix_v2.menu.xtal.80=80 MHz -phoenix_v2.menu.xtal.80.build.f_cpu=80000000L -phoenix_v2.menu.xtal.160=160 MHz -phoenix_v2.menu.xtal.160.build.f_cpu=160000000L -phoenix_v2.menu.vt.flash=Flash -phoenix_v2.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -phoenix_v2.menu.vt.heap=Heap -phoenix_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -phoenix_v2.menu.vt.iram=IRAM -phoenix_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -phoenix_v2.menu.exception.disabled=Disabled (new aborts on oom) -phoenix_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions -phoenix_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -phoenix_v2.menu.exception.enabled=Enabled -phoenix_v2.menu.exception.enabled.build.exception_flags=-fexceptions -phoenix_v2.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -phoenix_v2.menu.stacksmash.disabled=Disabled -phoenix_v2.menu.stacksmash.disabled.build.stacksmash_flags= -phoenix_v2.menu.stacksmash.enabled=Enabled -phoenix_v2.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -phoenix_v2.menu.ssl.all=All SSL ciphers (most compatible) -phoenix_v2.menu.ssl.all.build.sslflags= -phoenix_v2.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -phoenix_v2.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -phoenix_v2.build.flash_mode=dio -phoenix_v2.build.flash_flags=-DFLASHMODE_DIO -phoenix_v2.build.flash_freq=40 -phoenix_v2.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -phoenix_v2.menu.eesz.4M2M.build.flash_size=4M -phoenix_v2.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -phoenix_v2.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -phoenix_v2.menu.eesz.4M2M.build.spiffs_pagesize=256 -phoenix_v2.menu.eesz.4M2M.upload.maximum_size=1044464 -phoenix_v2.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -phoenix_v2.menu.eesz.4M2M.build.spiffs_start=0x200000 -phoenix_v2.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -phoenix_v2.menu.eesz.4M2M.build.spiffs_blocksize=8192 -phoenix_v2.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -phoenix_v2.menu.eesz.4M3M.build.flash_size=4M -phoenix_v2.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -phoenix_v2.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -phoenix_v2.menu.eesz.4M3M.build.spiffs_pagesize=256 -phoenix_v2.menu.eesz.4M3M.upload.maximum_size=1044464 -phoenix_v2.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -phoenix_v2.menu.eesz.4M3M.build.spiffs_start=0x100000 -phoenix_v2.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -phoenix_v2.menu.eesz.4M3M.build.spiffs_blocksize=8192 -phoenix_v2.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -phoenix_v2.menu.eesz.4M1M.build.flash_size=4M -phoenix_v2.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -phoenix_v2.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -phoenix_v2.menu.eesz.4M1M.build.spiffs_pagesize=256 -phoenix_v2.menu.eesz.4M1M.upload.maximum_size=1044464 -phoenix_v2.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -phoenix_v2.menu.eesz.4M1M.build.spiffs_start=0x300000 -phoenix_v2.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -phoenix_v2.menu.eesz.4M1M.build.spiffs_blocksize=8192 -phoenix_v2.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -phoenix_v2.menu.eesz.4M.build.flash_size=4M -phoenix_v2.menu.eesz.4M.build.flash_size_bytes=0x400000 -phoenix_v2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -phoenix_v2.menu.eesz.4M.build.spiffs_pagesize=256 -phoenix_v2.menu.eesz.4M.upload.maximum_size=1044464 -phoenix_v2.menu.eesz.4M.build.rfcal_addr=0x3FC000 -phoenix_v2.menu.ResetMethod.nodemcu=dtr (aka nodemcu) -phoenix_v2.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset -phoenix_v2.menu.ResetMethod.ck=no dtr (aka ck) -phoenix_v2.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset -phoenix_v2.menu.ip.lm2f=v2 Lower Memory -phoenix_v2.menu.ip.lm2f.build.lwip_include=lwip2/include -phoenix_v2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -phoenix_v2.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -phoenix_v2.menu.ip.hb2f=v2 Higher Bandwidth -phoenix_v2.menu.ip.hb2f.build.lwip_include=lwip2/include -phoenix_v2.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -phoenix_v2.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -phoenix_v2.menu.ip.lm2n=v2 Lower Memory (no features) -phoenix_v2.menu.ip.lm2n.build.lwip_include=lwip2/include -phoenix_v2.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -phoenix_v2.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -phoenix_v2.menu.ip.hb2n=v2 Higher Bandwidth (no features) -phoenix_v2.menu.ip.hb2n.build.lwip_include=lwip2/include -phoenix_v2.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -phoenix_v2.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -phoenix_v2.menu.ip.lm6f=v2 IPv6 Lower Memory -phoenix_v2.menu.ip.lm6f.build.lwip_include=lwip2/include -phoenix_v2.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -phoenix_v2.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -phoenix_v2.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -phoenix_v2.menu.ip.hb6f.build.lwip_include=lwip2/include -phoenix_v2.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -phoenix_v2.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -phoenix_v2.menu.dbg.Disabled=Disabled -phoenix_v2.menu.dbg.Disabled.build.debug_port= -phoenix_v2.menu.dbg.Serial=Serial -phoenix_v2.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -phoenix_v2.menu.dbg.Serial1=Serial1 -phoenix_v2.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -phoenix_v2.menu.lvl.None____=None -phoenix_v2.menu.lvl.None____.build.debug_level= -phoenix_v2.menu.lvl.SSL=SSL -phoenix_v2.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -phoenix_v2.menu.lvl.TLS_MEM=TLS_MEM -phoenix_v2.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -phoenix_v2.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -phoenix_v2.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -phoenix_v2.menu.lvl.HTTP_SERVER=HTTP_SERVER -phoenix_v2.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -phoenix_v2.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -phoenix_v2.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -phoenix_v2.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -phoenix_v2.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -phoenix_v2.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -phoenix_v2.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -phoenix_v2.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -phoenix_v2.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -phoenix_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -phoenix_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -phoenix_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -phoenix_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -phoenix_v2.menu.lvl.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.lvl.CORE=CORE -phoenix_v2.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -phoenix_v2.menu.lvl.WIFI=WIFI -phoenix_v2.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -phoenix_v2.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -phoenix_v2.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -phoenix_v2.menu.lvl.UPDATER=UPDATER -phoenix_v2.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -phoenix_v2.menu.lvl.OTA=OTA -phoenix_v2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -phoenix_v2.menu.lvl.OOM=OOM -phoenix_v2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -phoenix_v2.menu.lvl.MDNS=MDNS -phoenix_v2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -phoenix_v2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -phoenix_v2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -phoenix_v2.menu.wipe.none=Only Sketch -phoenix_v2.menu.wipe.none.upload.erase_cmd= -phoenix_v2.menu.wipe.sdk=Sketch + WiFi Settings -phoenix_v2.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -phoenix_v2.menu.wipe.all=All Flash Contents -phoenix_v2.menu.wipe.all.upload.erase_cmd=erase_flash -phoenix_v2.menu.baud.115200=115200 -phoenix_v2.menu.baud.115200.upload.speed=115200 -phoenix_v2.menu.baud.57600=57600 -phoenix_v2.menu.baud.57600.upload.speed=57600 -phoenix_v2.menu.baud.230400.linux=230400 -phoenix_v2.menu.baud.230400.macosx=230400 -phoenix_v2.menu.baud.230400.upload.speed=230400 -phoenix_v2.menu.baud.256000.windows=256000 -phoenix_v2.menu.baud.256000.upload.speed=256000 -phoenix_v2.menu.baud.460800.linux=460800 -phoenix_v2.menu.baud.460800.macosx=460800 -phoenix_v2.menu.baud.460800.upload.speed=460800 -phoenix_v2.menu.baud.512000.windows=512000 -phoenix_v2.menu.baud.512000.upload.speed=512000 -phoenix_v2.menu.baud.921600=921600 -phoenix_v2.menu.baud.921600.upload.speed=921600 -phoenix_v2.menu.baud.3000000=3000000 -phoenix_v2.menu.baud.3000000.upload.speed=3000000 - -############################################################## -nodemcu.name=NodeMCU 0.9 (ESP-12 Module) -nodemcu.build.board=ESP8266_NODEMCU -nodemcu.build.variant=nodemcu -nodemcu.upload.tool=esptool -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.core=esp8266 -nodemcu.build.spiffs_pagesize=256 -nodemcu.build.debug_port= -nodemcu.build.debug_level= -nodemcu.menu.xtal.80=80 MHz -nodemcu.menu.xtal.80.build.f_cpu=80000000L -nodemcu.menu.xtal.160=160 MHz -nodemcu.menu.xtal.160.build.f_cpu=160000000L -nodemcu.menu.vt.flash=Flash -nodemcu.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -nodemcu.menu.vt.heap=Heap -nodemcu.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -nodemcu.menu.vt.iram=IRAM -nodemcu.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -nodemcu.menu.exception.disabled=Disabled (new aborts on oom) -nodemcu.menu.exception.disabled.build.exception_flags=-fno-exceptions -nodemcu.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -nodemcu.menu.exception.enabled=Enabled -nodemcu.menu.exception.enabled.build.exception_flags=-fexceptions -nodemcu.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -nodemcu.menu.stacksmash.disabled=Disabled -nodemcu.menu.stacksmash.disabled.build.stacksmash_flags= -nodemcu.menu.stacksmash.enabled=Enabled -nodemcu.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -nodemcu.menu.ssl.all=All SSL ciphers (most compatible) -nodemcu.menu.ssl.all.build.sslflags= -nodemcu.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -nodemcu.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -nodemcu.upload.resetmethod=--before default_reset --after hard_reset -nodemcu.build.flash_mode=qio -nodemcu.build.flash_flags=-DFLASHMODE_QIO -nodemcu.build.flash_freq=40 -nodemcu.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -nodemcu.menu.eesz.4M2M.build.flash_size=4M -nodemcu.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -nodemcu.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -nodemcu.menu.eesz.4M2M.build.spiffs_pagesize=256 -nodemcu.menu.eesz.4M2M.upload.maximum_size=1044464 -nodemcu.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -nodemcu.menu.eesz.4M2M.build.spiffs_start=0x200000 -nodemcu.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -nodemcu.menu.eesz.4M2M.build.spiffs_blocksize=8192 -nodemcu.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -nodemcu.menu.eesz.4M3M.build.flash_size=4M -nodemcu.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -nodemcu.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -nodemcu.menu.eesz.4M3M.build.spiffs_pagesize=256 -nodemcu.menu.eesz.4M3M.upload.maximum_size=1044464 -nodemcu.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -nodemcu.menu.eesz.4M3M.build.spiffs_start=0x100000 -nodemcu.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -nodemcu.menu.eesz.4M3M.build.spiffs_blocksize=8192 -nodemcu.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -nodemcu.menu.eesz.4M1M.build.flash_size=4M -nodemcu.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -nodemcu.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -nodemcu.menu.eesz.4M1M.build.spiffs_pagesize=256 -nodemcu.menu.eesz.4M1M.upload.maximum_size=1044464 -nodemcu.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -nodemcu.menu.eesz.4M1M.build.spiffs_start=0x300000 -nodemcu.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -nodemcu.menu.eesz.4M1M.build.spiffs_blocksize=8192 -nodemcu.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -nodemcu.menu.eesz.4M.build.flash_size=4M -nodemcu.menu.eesz.4M.build.flash_size_bytes=0x400000 -nodemcu.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -nodemcu.menu.eesz.4M.build.spiffs_pagesize=256 -nodemcu.menu.eesz.4M.upload.maximum_size=1044464 -nodemcu.menu.eesz.4M.build.rfcal_addr=0x3FC000 -nodemcu.menu.ip.lm2f=v2 Lower Memory -nodemcu.menu.ip.lm2f.build.lwip_include=lwip2/include -nodemcu.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -nodemcu.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -nodemcu.menu.ip.hb2f=v2 Higher Bandwidth -nodemcu.menu.ip.hb2f.build.lwip_include=lwip2/include -nodemcu.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -nodemcu.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -nodemcu.menu.ip.lm2n=v2 Lower Memory (no features) -nodemcu.menu.ip.lm2n.build.lwip_include=lwip2/include -nodemcu.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -nodemcu.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -nodemcu.menu.ip.hb2n=v2 Higher Bandwidth (no features) -nodemcu.menu.ip.hb2n.build.lwip_include=lwip2/include -nodemcu.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -nodemcu.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -nodemcu.menu.ip.lm6f=v2 IPv6 Lower Memory -nodemcu.menu.ip.lm6f.build.lwip_include=lwip2/include -nodemcu.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -nodemcu.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -nodemcu.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -nodemcu.menu.ip.hb6f.build.lwip_include=lwip2/include -nodemcu.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -nodemcu.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -nodemcu.menu.dbg.Disabled=Disabled -nodemcu.menu.dbg.Disabled.build.debug_port= -nodemcu.menu.dbg.Serial=Serial -nodemcu.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -nodemcu.menu.dbg.Serial1=Serial1 -nodemcu.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -nodemcu.menu.lvl.None____=None -nodemcu.menu.lvl.None____.build.debug_level= -nodemcu.menu.lvl.SSL=SSL -nodemcu.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -nodemcu.menu.lvl.TLS_MEM=TLS_MEM -nodemcu.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -nodemcu.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -nodemcu.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -nodemcu.menu.lvl.HTTP_SERVER=HTTP_SERVER -nodemcu.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -nodemcu.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -nodemcu.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -nodemcu.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -nodemcu.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -nodemcu.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -nodemcu.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -nodemcu.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -nodemcu.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -nodemcu.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -nodemcu.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -nodemcu.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -nodemcu.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -nodemcu.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcu.menu.lvl.CORE=CORE -nodemcu.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -nodemcu.menu.lvl.WIFI=WIFI -nodemcu.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -nodemcu.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -nodemcu.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -nodemcu.menu.lvl.UPDATER=UPDATER -nodemcu.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -nodemcu.menu.lvl.OTA=OTA -nodemcu.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -nodemcu.menu.lvl.OOM=OOM -nodemcu.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -nodemcu.menu.lvl.MDNS=MDNS -nodemcu.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -nodemcu.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -nodemcu.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -nodemcu.menu.wipe.none=Only Sketch -nodemcu.menu.wipe.none.upload.erase_cmd= -nodemcu.menu.wipe.sdk=Sketch + WiFi Settings -nodemcu.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -nodemcu.menu.wipe.all=All Flash Contents -nodemcu.menu.wipe.all.upload.erase_cmd=erase_flash -nodemcu.menu.baud.115200=115200 -nodemcu.menu.baud.115200.upload.speed=115200 -nodemcu.menu.baud.57600=57600 -nodemcu.menu.baud.57600.upload.speed=57600 -nodemcu.menu.baud.230400.linux=230400 -nodemcu.menu.baud.230400.macosx=230400 -nodemcu.menu.baud.230400.upload.speed=230400 -nodemcu.menu.baud.256000.windows=256000 -nodemcu.menu.baud.256000.upload.speed=256000 -nodemcu.menu.baud.460800.linux=460800 -nodemcu.menu.baud.460800.macosx=460800 -nodemcu.menu.baud.460800.upload.speed=460800 -nodemcu.menu.baud.512000.windows=512000 -nodemcu.menu.baud.512000.upload.speed=512000 -nodemcu.menu.baud.921600=921600 -nodemcu.menu.baud.921600.upload.speed=921600 -nodemcu.menu.baud.3000000=3000000 -nodemcu.menu.baud.3000000.upload.speed=3000000 - -############################################################## -nodemcuv2.name=NodeMCU 1.0 (ESP-12E Module) -nodemcuv2.build.board=ESP8266_NODEMCU -nodemcuv2.build.variant=nodemcu -nodemcuv2.upload.tool=esptool -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.core=esp8266 -nodemcuv2.build.spiffs_pagesize=256 -nodemcuv2.build.debug_port= -nodemcuv2.build.debug_level= -nodemcuv2.menu.xtal.80=80 MHz -nodemcuv2.menu.xtal.80.build.f_cpu=80000000L -nodemcuv2.menu.xtal.160=160 MHz -nodemcuv2.menu.xtal.160.build.f_cpu=160000000L -nodemcuv2.menu.vt.flash=Flash -nodemcuv2.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -nodemcuv2.menu.vt.heap=Heap -nodemcuv2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -nodemcuv2.menu.vt.iram=IRAM -nodemcuv2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -nodemcuv2.menu.exception.disabled=Disabled (new aborts on oom) -nodemcuv2.menu.exception.disabled.build.exception_flags=-fno-exceptions -nodemcuv2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -nodemcuv2.menu.exception.enabled=Enabled -nodemcuv2.menu.exception.enabled.build.exception_flags=-fexceptions -nodemcuv2.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -nodemcuv2.menu.stacksmash.disabled=Disabled -nodemcuv2.menu.stacksmash.disabled.build.stacksmash_flags= -nodemcuv2.menu.stacksmash.enabled=Enabled -nodemcuv2.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -nodemcuv2.menu.ssl.all=All SSL ciphers (most compatible) -nodemcuv2.menu.ssl.all.build.sslflags= -nodemcuv2.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -nodemcuv2.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -nodemcuv2.upload.resetmethod=--before default_reset --after hard_reset -nodemcuv2.build.flash_mode=dio -nodemcuv2.build.flash_flags=-DFLASHMODE_DIO -nodemcuv2.build.flash_freq=40 -nodemcuv2.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -nodemcuv2.menu.eesz.4M2M.build.flash_size=4M -nodemcuv2.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -nodemcuv2.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -nodemcuv2.menu.eesz.4M2M.build.spiffs_pagesize=256 -nodemcuv2.menu.eesz.4M2M.upload.maximum_size=1044464 -nodemcuv2.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -nodemcuv2.menu.eesz.4M2M.build.spiffs_start=0x200000 -nodemcuv2.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -nodemcuv2.menu.eesz.4M2M.build.spiffs_blocksize=8192 -nodemcuv2.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -nodemcuv2.menu.eesz.4M3M.build.flash_size=4M -nodemcuv2.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -nodemcuv2.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -nodemcuv2.menu.eesz.4M3M.build.spiffs_pagesize=256 -nodemcuv2.menu.eesz.4M3M.upload.maximum_size=1044464 -nodemcuv2.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -nodemcuv2.menu.eesz.4M3M.build.spiffs_start=0x100000 -nodemcuv2.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -nodemcuv2.menu.eesz.4M3M.build.spiffs_blocksize=8192 -nodemcuv2.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -nodemcuv2.menu.eesz.4M1M.build.flash_size=4M -nodemcuv2.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -nodemcuv2.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -nodemcuv2.menu.eesz.4M1M.build.spiffs_pagesize=256 -nodemcuv2.menu.eesz.4M1M.upload.maximum_size=1044464 -nodemcuv2.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -nodemcuv2.menu.eesz.4M1M.build.spiffs_start=0x300000 -nodemcuv2.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -nodemcuv2.menu.eesz.4M1M.build.spiffs_blocksize=8192 -nodemcuv2.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -nodemcuv2.menu.eesz.4M.build.flash_size=4M -nodemcuv2.menu.eesz.4M.build.flash_size_bytes=0x400000 -nodemcuv2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -nodemcuv2.menu.eesz.4M.build.spiffs_pagesize=256 -nodemcuv2.menu.eesz.4M.upload.maximum_size=1044464 -nodemcuv2.menu.eesz.4M.build.rfcal_addr=0x3FC000 -nodemcuv2.menu.led.2=2 -nodemcuv2.menu.led.2.build.led=-DLED_BUILTIN=2 -nodemcuv2.menu.led.16=16 -nodemcuv2.menu.led.16.build.led=-DLED_BUILTIN=16 -nodemcuv2.menu.ip.lm2f=v2 Lower Memory -nodemcuv2.menu.ip.lm2f.build.lwip_include=lwip2/include -nodemcuv2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -nodemcuv2.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -nodemcuv2.menu.ip.hb2f=v2 Higher Bandwidth -nodemcuv2.menu.ip.hb2f.build.lwip_include=lwip2/include -nodemcuv2.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -nodemcuv2.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -nodemcuv2.menu.ip.lm2n=v2 Lower Memory (no features) -nodemcuv2.menu.ip.lm2n.build.lwip_include=lwip2/include -nodemcuv2.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -nodemcuv2.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -nodemcuv2.menu.ip.hb2n=v2 Higher Bandwidth (no features) -nodemcuv2.menu.ip.hb2n.build.lwip_include=lwip2/include -nodemcuv2.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -nodemcuv2.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -nodemcuv2.menu.ip.lm6f=v2 IPv6 Lower Memory -nodemcuv2.menu.ip.lm6f.build.lwip_include=lwip2/include -nodemcuv2.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -nodemcuv2.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -nodemcuv2.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -nodemcuv2.menu.ip.hb6f.build.lwip_include=lwip2/include -nodemcuv2.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -nodemcuv2.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -nodemcuv2.menu.dbg.Disabled=Disabled -nodemcuv2.menu.dbg.Disabled.build.debug_port= -nodemcuv2.menu.dbg.Serial=Serial -nodemcuv2.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -nodemcuv2.menu.dbg.Serial1=Serial1 -nodemcuv2.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -nodemcuv2.menu.lvl.None____=None -nodemcuv2.menu.lvl.None____.build.debug_level= -nodemcuv2.menu.lvl.SSL=SSL -nodemcuv2.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -nodemcuv2.menu.lvl.TLS_MEM=TLS_MEM -nodemcuv2.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -nodemcuv2.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -nodemcuv2.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -nodemcuv2.menu.lvl.HTTP_SERVER=HTTP_SERVER -nodemcuv2.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -nodemcuv2.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -nodemcuv2.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -nodemcuv2.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -nodemcuv2.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -nodemcuv2.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -nodemcuv2.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -nodemcuv2.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -nodemcuv2.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -nodemcuv2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -nodemcuv2.menu.lvl.CORE=CORE -nodemcuv2.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -nodemcuv2.menu.lvl.WIFI=WIFI -nodemcuv2.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -nodemcuv2.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -nodemcuv2.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -nodemcuv2.menu.lvl.UPDATER=UPDATER -nodemcuv2.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -nodemcuv2.menu.lvl.OTA=OTA -nodemcuv2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -nodemcuv2.menu.lvl.OOM=OOM -nodemcuv2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -nodemcuv2.menu.lvl.MDNS=MDNS -nodemcuv2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -nodemcuv2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -nodemcuv2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -nodemcuv2.menu.wipe.none=Only Sketch -nodemcuv2.menu.wipe.none.upload.erase_cmd= -nodemcuv2.menu.wipe.sdk=Sketch + WiFi Settings -nodemcuv2.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -nodemcuv2.menu.wipe.all=All Flash Contents -nodemcuv2.menu.wipe.all.upload.erase_cmd=erase_flash -nodemcuv2.menu.baud.115200=115200 -nodemcuv2.menu.baud.115200.upload.speed=115200 -nodemcuv2.menu.baud.57600=57600 -nodemcuv2.menu.baud.57600.upload.speed=57600 -nodemcuv2.menu.baud.230400.linux=230400 -nodemcuv2.menu.baud.230400.macosx=230400 -nodemcuv2.menu.baud.230400.upload.speed=230400 -nodemcuv2.menu.baud.256000.windows=256000 -nodemcuv2.menu.baud.256000.upload.speed=256000 -nodemcuv2.menu.baud.460800.linux=460800 -nodemcuv2.menu.baud.460800.macosx=460800 -nodemcuv2.menu.baud.460800.upload.speed=460800 -nodemcuv2.menu.baud.512000.windows=512000 -nodemcuv2.menu.baud.512000.upload.speed=512000 -nodemcuv2.menu.baud.921600=921600 -nodemcuv2.menu.baud.921600.upload.speed=921600 -nodemcuv2.menu.baud.3000000=3000000 -nodemcuv2.menu.baud.3000000.upload.speed=3000000 - -############################################################## -modwifi.name=Olimex MOD-WIFI-ESP8266(-DEV) -modwifi.build.board=MOD_WIFI_ESP8266 -modwifi.build.variant=modwifi -modwifi.upload.tool=esptool -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.core=esp8266 -modwifi.build.spiffs_pagesize=256 -modwifi.build.debug_port= -modwifi.build.debug_level= -modwifi.menu.xtal.80=80 MHz -modwifi.menu.xtal.80.build.f_cpu=80000000L -modwifi.menu.xtal.160=160 MHz -modwifi.menu.xtal.160.build.f_cpu=160000000L -modwifi.menu.vt.flash=Flash -modwifi.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -modwifi.menu.vt.heap=Heap -modwifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -modwifi.menu.vt.iram=IRAM -modwifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -modwifi.menu.exception.disabled=Disabled (new aborts on oom) -modwifi.menu.exception.disabled.build.exception_flags=-fno-exceptions -modwifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -modwifi.menu.exception.enabled=Enabled -modwifi.menu.exception.enabled.build.exception_flags=-fexceptions -modwifi.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -modwifi.menu.stacksmash.disabled=Disabled -modwifi.menu.stacksmash.disabled.build.stacksmash_flags= -modwifi.menu.stacksmash.enabled=Enabled -modwifi.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -modwifi.menu.ssl.all=All SSL ciphers (most compatible) -modwifi.menu.ssl.all.build.sslflags= -modwifi.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -modwifi.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -modwifi.upload.resetmethod=--before no_reset --after soft_reset -modwifi.build.flash_mode=qio -modwifi.build.flash_flags=-DFLASHMODE_QIO -modwifi.build.flash_freq=40 -modwifi.menu.eesz.2M64=2MB (FS:64KB OTA:~992KB) -modwifi.menu.eesz.2M64.build.flash_size=2M -modwifi.menu.eesz.2M64.build.flash_size_bytes=0x200000 -modwifi.menu.eesz.2M64.build.flash_ld=eagle.flash.2m64.ld -modwifi.menu.eesz.2M64.build.spiffs_pagesize=256 -modwifi.menu.eesz.2M64.upload.maximum_size=1044464 -modwifi.menu.eesz.2M64.build.rfcal_addr=0x1FC000 -modwifi.menu.eesz.2M64.build.spiffs_start=0x1F0000 -modwifi.menu.eesz.2M64.build.spiffs_end=0x1FB000 -modwifi.menu.eesz.2M64.build.spiffs_blocksize=4096 -modwifi.menu.eesz.2M128=2MB (FS:128KB OTA:~960KB) -modwifi.menu.eesz.2M128.build.flash_size=2M -modwifi.menu.eesz.2M128.build.flash_size_bytes=0x200000 -modwifi.menu.eesz.2M128.build.flash_ld=eagle.flash.2m128.ld -modwifi.menu.eesz.2M128.build.spiffs_pagesize=256 -modwifi.menu.eesz.2M128.upload.maximum_size=1044464 -modwifi.menu.eesz.2M128.build.rfcal_addr=0x1FC000 -modwifi.menu.eesz.2M128.build.spiffs_start=0x1E0000 -modwifi.menu.eesz.2M128.build.spiffs_end=0x1FB000 -modwifi.menu.eesz.2M128.build.spiffs_blocksize=4096 -modwifi.menu.eesz.2M256=2MB (FS:256KB OTA:~896KB) -modwifi.menu.eesz.2M256.build.flash_size=2M -modwifi.menu.eesz.2M256.build.flash_size_bytes=0x200000 -modwifi.menu.eesz.2M256.build.flash_ld=eagle.flash.2m256.ld -modwifi.menu.eesz.2M256.build.spiffs_pagesize=256 -modwifi.menu.eesz.2M256.upload.maximum_size=1044464 -modwifi.menu.eesz.2M256.build.rfcal_addr=0x1FC000 -modwifi.menu.eesz.2M256.build.spiffs_start=0x1C0000 -modwifi.menu.eesz.2M256.build.spiffs_end=0x1FB000 -modwifi.menu.eesz.2M256.build.spiffs_blocksize=4096 -modwifi.menu.eesz.2M512=2MB (FS:512KB OTA:~768KB) -modwifi.menu.eesz.2M512.build.flash_size=2M -modwifi.menu.eesz.2M512.build.flash_size_bytes=0x200000 -modwifi.menu.eesz.2M512.build.flash_ld=eagle.flash.2m512.ld -modwifi.menu.eesz.2M512.build.spiffs_pagesize=256 -modwifi.menu.eesz.2M512.upload.maximum_size=1044464 -modwifi.menu.eesz.2M512.build.rfcal_addr=0x1FC000 -modwifi.menu.eesz.2M512.build.spiffs_start=0x180000 -modwifi.menu.eesz.2M512.build.spiffs_end=0x1FA000 -modwifi.menu.eesz.2M512.build.spiffs_blocksize=8192 -modwifi.menu.eesz.2M1M=2MB (FS:1MB OTA:~512KB) -modwifi.menu.eesz.2M1M.build.flash_size=2M -modwifi.menu.eesz.2M1M.build.flash_size_bytes=0x200000 -modwifi.menu.eesz.2M1M.build.flash_ld=eagle.flash.2m1m.ld -modwifi.menu.eesz.2M1M.build.spiffs_pagesize=256 -modwifi.menu.eesz.2M1M.upload.maximum_size=1044464 -modwifi.menu.eesz.2M1M.build.rfcal_addr=0x1FC000 -modwifi.menu.eesz.2M1M.build.spiffs_start=0x100000 -modwifi.menu.eesz.2M1M.build.spiffs_end=0x1FA000 -modwifi.menu.eesz.2M1M.build.spiffs_blocksize=8192 -modwifi.menu.eesz.2M=2MB (FS:none OTA:~1019KB) -modwifi.menu.eesz.2M.build.flash_size=2M -modwifi.menu.eesz.2M.build.flash_size_bytes=0x200000 -modwifi.menu.eesz.2M.build.flash_ld=eagle.flash.2m.ld -modwifi.menu.eesz.2M.build.spiffs_pagesize=256 -modwifi.menu.eesz.2M.upload.maximum_size=1044464 -modwifi.menu.eesz.2M.build.rfcal_addr=0x1FC000 -modwifi.menu.ip.lm2f=v2 Lower Memory -modwifi.menu.ip.lm2f.build.lwip_include=lwip2/include -modwifi.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -modwifi.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -modwifi.menu.ip.hb2f=v2 Higher Bandwidth -modwifi.menu.ip.hb2f.build.lwip_include=lwip2/include -modwifi.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -modwifi.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -modwifi.menu.ip.lm2n=v2 Lower Memory (no features) -modwifi.menu.ip.lm2n.build.lwip_include=lwip2/include -modwifi.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -modwifi.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -modwifi.menu.ip.hb2n=v2 Higher Bandwidth (no features) -modwifi.menu.ip.hb2n.build.lwip_include=lwip2/include -modwifi.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -modwifi.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -modwifi.menu.ip.lm6f=v2 IPv6 Lower Memory -modwifi.menu.ip.lm6f.build.lwip_include=lwip2/include -modwifi.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -modwifi.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -modwifi.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -modwifi.menu.ip.hb6f.build.lwip_include=lwip2/include -modwifi.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -modwifi.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -modwifi.menu.dbg.Disabled=Disabled -modwifi.menu.dbg.Disabled.build.debug_port= -modwifi.menu.dbg.Serial=Serial -modwifi.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -modwifi.menu.dbg.Serial1=Serial1 -modwifi.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -modwifi.menu.lvl.None____=None -modwifi.menu.lvl.None____.build.debug_level= -modwifi.menu.lvl.SSL=SSL -modwifi.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -modwifi.menu.lvl.TLS_MEM=TLS_MEM -modwifi.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -modwifi.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -modwifi.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -modwifi.menu.lvl.HTTP_SERVER=HTTP_SERVER -modwifi.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -modwifi.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -modwifi.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -modwifi.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -modwifi.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -modwifi.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -modwifi.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -modwifi.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -modwifi.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -modwifi.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -modwifi.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -modwifi.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -modwifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -modwifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -modwifi.menu.lvl.CORE=CORE -modwifi.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -modwifi.menu.lvl.WIFI=WIFI -modwifi.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -modwifi.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -modwifi.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -modwifi.menu.lvl.UPDATER=UPDATER -modwifi.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -modwifi.menu.lvl.OTA=OTA -modwifi.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -modwifi.menu.lvl.OOM=OOM -modwifi.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -modwifi.menu.lvl.MDNS=MDNS -modwifi.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -modwifi.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -modwifi.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -modwifi.menu.wipe.none=Only Sketch -modwifi.menu.wipe.none.upload.erase_cmd= -modwifi.menu.wipe.sdk=Sketch + WiFi Settings -modwifi.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -modwifi.menu.wipe.all=All Flash Contents -modwifi.menu.wipe.all.upload.erase_cmd=erase_flash -modwifi.menu.baud.115200=115200 -modwifi.menu.baud.115200.upload.speed=115200 -modwifi.menu.baud.57600=57600 -modwifi.menu.baud.57600.upload.speed=57600 -modwifi.menu.baud.230400.linux=230400 -modwifi.menu.baud.230400.macosx=230400 -modwifi.menu.baud.230400.upload.speed=230400 -modwifi.menu.baud.256000.windows=256000 -modwifi.menu.baud.256000.upload.speed=256000 -modwifi.menu.baud.460800.linux=460800 -modwifi.menu.baud.460800.macosx=460800 -modwifi.menu.baud.460800.upload.speed=460800 -modwifi.menu.baud.512000.windows=512000 -modwifi.menu.baud.512000.upload.speed=512000 -modwifi.menu.baud.921600=921600 -modwifi.menu.baud.921600.upload.speed=921600 -modwifi.menu.baud.3000000=3000000 -modwifi.menu.baud.3000000.upload.speed=3000000 - -############################################################## -thing.name=SparkFun ESP8266 Thing -thing.build.board=ESP8266_THING -thing.build.variant=thing -thing.upload.tool=esptool -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.core=esp8266 -thing.build.spiffs_pagesize=256 -thing.build.debug_port= -thing.build.debug_level= -thing.menu.xtal.80=80 MHz -thing.menu.xtal.80.build.f_cpu=80000000L -thing.menu.xtal.160=160 MHz -thing.menu.xtal.160.build.f_cpu=160000000L -thing.menu.vt.flash=Flash -thing.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -thing.menu.vt.heap=Heap -thing.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -thing.menu.vt.iram=IRAM -thing.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -thing.menu.exception.disabled=Disabled (new aborts on oom) -thing.menu.exception.disabled.build.exception_flags=-fno-exceptions -thing.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -thing.menu.exception.enabled=Enabled -thing.menu.exception.enabled.build.exception_flags=-fexceptions -thing.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -thing.menu.stacksmash.disabled=Disabled -thing.menu.stacksmash.disabled.build.stacksmash_flags= -thing.menu.stacksmash.enabled=Enabled -thing.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -thing.menu.ssl.all=All SSL ciphers (most compatible) -thing.menu.ssl.all.build.sslflags= -thing.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -thing.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -thing.upload.resetmethod=--before no_reset --after soft_reset -thing.build.flash_mode=qio -thing.build.flash_flags=-DFLASHMODE_QIO -thing.build.flash_freq=40 -thing.menu.eesz.512K32=512KB (FS:32KB OTA:~230KB) -thing.menu.eesz.512K32.build.flash_size=512K -thing.menu.eesz.512K32.build.flash_size_bytes=0x80000 -thing.menu.eesz.512K32.build.flash_ld=eagle.flash.512k32.ld -thing.menu.eesz.512K32.build.spiffs_pagesize=256 -thing.menu.eesz.512K32.upload.maximum_size=466928 -thing.menu.eesz.512K32.build.rfcal_addr=0x7C000 -thing.menu.eesz.512K32.build.spiffs_start=0x73000 -thing.menu.eesz.512K32.build.spiffs_end=0x7B000 -thing.menu.eesz.512K32.build.spiffs_blocksize=4096 -thing.menu.eesz.512K64=512KB (FS:64KB OTA:~214KB) -thing.menu.eesz.512K64.build.flash_size=512K -thing.menu.eesz.512K64.build.flash_size_bytes=0x80000 -thing.menu.eesz.512K64.build.flash_ld=eagle.flash.512k64.ld -thing.menu.eesz.512K64.build.spiffs_pagesize=256 -thing.menu.eesz.512K64.upload.maximum_size=434160 -thing.menu.eesz.512K64.build.rfcal_addr=0x7C000 -thing.menu.eesz.512K64.build.spiffs_start=0x6B000 -thing.menu.eesz.512K64.build.spiffs_end=0x7B000 -thing.menu.eesz.512K64.build.spiffs_blocksize=4096 -thing.menu.eesz.512K128=512KB (FS:128KB OTA:~182KB) -thing.menu.eesz.512K128.build.flash_size=512K -thing.menu.eesz.512K128.build.flash_size_bytes=0x80000 -thing.menu.eesz.512K128.build.flash_ld=eagle.flash.512k128.ld -thing.menu.eesz.512K128.build.spiffs_pagesize=256 -thing.menu.eesz.512K128.upload.maximum_size=368624 -thing.menu.eesz.512K128.build.rfcal_addr=0x7C000 -thing.menu.eesz.512K128.build.spiffs_start=0x5B000 -thing.menu.eesz.512K128.build.spiffs_end=0x7B000 -thing.menu.eesz.512K128.build.spiffs_blocksize=4096 -thing.menu.eesz.512K=512KB (FS:none OTA:~246KB) -thing.menu.eesz.512K.build.flash_size=512K -thing.menu.eesz.512K.build.flash_size_bytes=0x80000 -thing.menu.eesz.512K.build.flash_ld=eagle.flash.512k.ld -thing.menu.eesz.512K.build.spiffs_pagesize=256 -thing.menu.eesz.512K.upload.maximum_size=499696 -thing.menu.eesz.512K.build.rfcal_addr=0x7C000 -thing.menu.ip.lm2f=v2 Lower Memory -thing.menu.ip.lm2f.build.lwip_include=lwip2/include -thing.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -thing.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -thing.menu.ip.hb2f=v2 Higher Bandwidth -thing.menu.ip.hb2f.build.lwip_include=lwip2/include -thing.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -thing.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -thing.menu.ip.lm2n=v2 Lower Memory (no features) -thing.menu.ip.lm2n.build.lwip_include=lwip2/include -thing.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -thing.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -thing.menu.ip.hb2n=v2 Higher Bandwidth (no features) -thing.menu.ip.hb2n.build.lwip_include=lwip2/include -thing.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -thing.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -thing.menu.ip.lm6f=v2 IPv6 Lower Memory -thing.menu.ip.lm6f.build.lwip_include=lwip2/include -thing.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -thing.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -thing.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -thing.menu.ip.hb6f.build.lwip_include=lwip2/include -thing.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -thing.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -thing.menu.dbg.Disabled=Disabled -thing.menu.dbg.Disabled.build.debug_port= -thing.menu.dbg.Serial=Serial -thing.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -thing.menu.dbg.Serial1=Serial1 -thing.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -thing.menu.lvl.None____=None -thing.menu.lvl.None____.build.debug_level= -thing.menu.lvl.SSL=SSL -thing.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -thing.menu.lvl.TLS_MEM=TLS_MEM -thing.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -thing.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -thing.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -thing.menu.lvl.HTTP_SERVER=HTTP_SERVER -thing.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -thing.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -thing.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -thing.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -thing.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -thing.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -thing.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -thing.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -thing.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -thing.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -thing.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -thing.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -thing.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -thing.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thing.menu.lvl.CORE=CORE -thing.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -thing.menu.lvl.WIFI=WIFI -thing.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -thing.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -thing.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -thing.menu.lvl.UPDATER=UPDATER -thing.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -thing.menu.lvl.OTA=OTA -thing.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -thing.menu.lvl.OOM=OOM -thing.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -thing.menu.lvl.MDNS=MDNS -thing.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -thing.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -thing.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -thing.menu.wipe.none=Only Sketch -thing.menu.wipe.none.upload.erase_cmd= -thing.menu.wipe.sdk=Sketch + WiFi Settings -thing.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -thing.menu.wipe.all=All Flash Contents -thing.menu.wipe.all.upload.erase_cmd=erase_flash -thing.menu.baud.115200=115200 -thing.menu.baud.115200.upload.speed=115200 -thing.menu.baud.57600=57600 -thing.menu.baud.57600.upload.speed=57600 -thing.menu.baud.230400.linux=230400 -thing.menu.baud.230400.macosx=230400 -thing.menu.baud.230400.upload.speed=230400 -thing.menu.baud.256000.windows=256000 -thing.menu.baud.256000.upload.speed=256000 -thing.menu.baud.460800.linux=460800 -thing.menu.baud.460800.macosx=460800 -thing.menu.baud.460800.upload.speed=460800 -thing.menu.baud.512000.windows=512000 -thing.menu.baud.512000.upload.speed=512000 -thing.menu.baud.921600=921600 -thing.menu.baud.921600.upload.speed=921600 -thing.menu.baud.3000000=3000000 -thing.menu.baud.3000000.upload.speed=3000000 - -############################################################## -thingdev.name=SparkFun ESP8266 Thing Dev -thingdev.build.board=ESP8266_THING_DEV -thingdev.build.variant=thing -thingdev.upload.tool=esptool -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.core=esp8266 -thingdev.build.spiffs_pagesize=256 -thingdev.build.debug_port= -thingdev.build.debug_level= -thingdev.menu.xtal.80=80 MHz -thingdev.menu.xtal.80.build.f_cpu=80000000L -thingdev.menu.xtal.160=160 MHz -thingdev.menu.xtal.160.build.f_cpu=160000000L -thingdev.menu.vt.flash=Flash -thingdev.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -thingdev.menu.vt.heap=Heap -thingdev.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -thingdev.menu.vt.iram=IRAM -thingdev.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -thingdev.menu.exception.disabled=Disabled (new aborts on oom) -thingdev.menu.exception.disabled.build.exception_flags=-fno-exceptions -thingdev.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -thingdev.menu.exception.enabled=Enabled -thingdev.menu.exception.enabled.build.exception_flags=-fexceptions -thingdev.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -thingdev.menu.stacksmash.disabled=Disabled -thingdev.menu.stacksmash.disabled.build.stacksmash_flags= -thingdev.menu.stacksmash.enabled=Enabled -thingdev.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -thingdev.menu.ssl.all=All SSL ciphers (most compatible) -thingdev.menu.ssl.all.build.sslflags= -thingdev.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -thingdev.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -thingdev.upload.resetmethod=--before default_reset --after hard_reset -thingdev.build.flash_mode=dio -thingdev.build.flash_flags=-DFLASHMODE_DIO -thingdev.build.flash_freq=40 -thingdev.menu.eesz.512K32=512KB (FS:32KB OTA:~230KB) -thingdev.menu.eesz.512K32.build.flash_size=512K -thingdev.menu.eesz.512K32.build.flash_size_bytes=0x80000 -thingdev.menu.eesz.512K32.build.flash_ld=eagle.flash.512k32.ld -thingdev.menu.eesz.512K32.build.spiffs_pagesize=256 -thingdev.menu.eesz.512K32.upload.maximum_size=466928 -thingdev.menu.eesz.512K32.build.rfcal_addr=0x7C000 -thingdev.menu.eesz.512K32.build.spiffs_start=0x73000 -thingdev.menu.eesz.512K32.build.spiffs_end=0x7B000 -thingdev.menu.eesz.512K32.build.spiffs_blocksize=4096 -thingdev.menu.eesz.512K64=512KB (FS:64KB OTA:~214KB) -thingdev.menu.eesz.512K64.build.flash_size=512K -thingdev.menu.eesz.512K64.build.flash_size_bytes=0x80000 -thingdev.menu.eesz.512K64.build.flash_ld=eagle.flash.512k64.ld -thingdev.menu.eesz.512K64.build.spiffs_pagesize=256 -thingdev.menu.eesz.512K64.upload.maximum_size=434160 -thingdev.menu.eesz.512K64.build.rfcal_addr=0x7C000 -thingdev.menu.eesz.512K64.build.spiffs_start=0x6B000 -thingdev.menu.eesz.512K64.build.spiffs_end=0x7B000 -thingdev.menu.eesz.512K64.build.spiffs_blocksize=4096 -thingdev.menu.eesz.512K128=512KB (FS:128KB OTA:~182KB) -thingdev.menu.eesz.512K128.build.flash_size=512K -thingdev.menu.eesz.512K128.build.flash_size_bytes=0x80000 -thingdev.menu.eesz.512K128.build.flash_ld=eagle.flash.512k128.ld -thingdev.menu.eesz.512K128.build.spiffs_pagesize=256 -thingdev.menu.eesz.512K128.upload.maximum_size=368624 -thingdev.menu.eesz.512K128.build.rfcal_addr=0x7C000 -thingdev.menu.eesz.512K128.build.spiffs_start=0x5B000 -thingdev.menu.eesz.512K128.build.spiffs_end=0x7B000 -thingdev.menu.eesz.512K128.build.spiffs_blocksize=4096 -thingdev.menu.eesz.512K=512KB (FS:none OTA:~246KB) -thingdev.menu.eesz.512K.build.flash_size=512K -thingdev.menu.eesz.512K.build.flash_size_bytes=0x80000 -thingdev.menu.eesz.512K.build.flash_ld=eagle.flash.512k.ld -thingdev.menu.eesz.512K.build.spiffs_pagesize=256 -thingdev.menu.eesz.512K.upload.maximum_size=499696 -thingdev.menu.eesz.512K.build.rfcal_addr=0x7C000 -thingdev.menu.ip.lm2f=v2 Lower Memory -thingdev.menu.ip.lm2f.build.lwip_include=lwip2/include -thingdev.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -thingdev.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -thingdev.menu.ip.hb2f=v2 Higher Bandwidth -thingdev.menu.ip.hb2f.build.lwip_include=lwip2/include -thingdev.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -thingdev.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -thingdev.menu.ip.lm2n=v2 Lower Memory (no features) -thingdev.menu.ip.lm2n.build.lwip_include=lwip2/include -thingdev.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -thingdev.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -thingdev.menu.ip.hb2n=v2 Higher Bandwidth (no features) -thingdev.menu.ip.hb2n.build.lwip_include=lwip2/include -thingdev.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -thingdev.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -thingdev.menu.ip.lm6f=v2 IPv6 Lower Memory -thingdev.menu.ip.lm6f.build.lwip_include=lwip2/include -thingdev.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -thingdev.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -thingdev.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -thingdev.menu.ip.hb6f.build.lwip_include=lwip2/include -thingdev.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -thingdev.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -thingdev.menu.dbg.Disabled=Disabled -thingdev.menu.dbg.Disabled.build.debug_port= -thingdev.menu.dbg.Serial=Serial -thingdev.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -thingdev.menu.dbg.Serial1=Serial1 -thingdev.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -thingdev.menu.lvl.None____=None -thingdev.menu.lvl.None____.build.debug_level= -thingdev.menu.lvl.SSL=SSL -thingdev.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -thingdev.menu.lvl.TLS_MEM=TLS_MEM -thingdev.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -thingdev.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -thingdev.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -thingdev.menu.lvl.HTTP_SERVER=HTTP_SERVER -thingdev.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -thingdev.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -thingdev.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -thingdev.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -thingdev.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -thingdev.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -thingdev.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -thingdev.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -thingdev.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -thingdev.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -thingdev.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -thingdev.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -thingdev.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -thingdev.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -thingdev.menu.lvl.CORE=CORE -thingdev.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -thingdev.menu.lvl.WIFI=WIFI -thingdev.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -thingdev.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -thingdev.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -thingdev.menu.lvl.UPDATER=UPDATER -thingdev.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -thingdev.menu.lvl.OTA=OTA -thingdev.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -thingdev.menu.lvl.OOM=OOM -thingdev.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -thingdev.menu.lvl.MDNS=MDNS -thingdev.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -thingdev.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -thingdev.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -thingdev.menu.wipe.none=Only Sketch -thingdev.menu.wipe.none.upload.erase_cmd= -thingdev.menu.wipe.sdk=Sketch + WiFi Settings -thingdev.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -thingdev.menu.wipe.all=All Flash Contents -thingdev.menu.wipe.all.upload.erase_cmd=erase_flash -thingdev.menu.baud.115200=115200 -thingdev.menu.baud.115200.upload.speed=115200 -thingdev.menu.baud.57600=57600 -thingdev.menu.baud.57600.upload.speed=57600 -thingdev.menu.baud.230400.linux=230400 -thingdev.menu.baud.230400.macosx=230400 -thingdev.menu.baud.230400.upload.speed=230400 -thingdev.menu.baud.256000.windows=256000 -thingdev.menu.baud.256000.upload.speed=256000 -thingdev.menu.baud.460800.linux=460800 -thingdev.menu.baud.460800.macosx=460800 -thingdev.menu.baud.460800.upload.speed=460800 -thingdev.menu.baud.512000.windows=512000 -thingdev.menu.baud.512000.upload.speed=512000 -thingdev.menu.baud.921600=921600 -thingdev.menu.baud.921600.upload.speed=921600 -thingdev.menu.baud.3000000=3000000 -thingdev.menu.baud.3000000.upload.speed=3000000 - -############################################################## -blynk.name=SparkFun Blynk Board -blynk.build.board=ESP8266_THING -blynk.build.variant=thing -blynk.upload.tool=esptool -blynk.upload.maximum_data_size=81920 -blynk.upload.wait_for_upload_port=true -blynk.upload.erase_cmd= -blynk.serial.disableDTR=true -blynk.serial.disableRTS=true -blynk.build.mcu=esp8266 -blynk.build.core=esp8266 -blynk.build.spiffs_pagesize=256 -blynk.build.debug_port= -blynk.build.debug_level= -blynk.menu.xtal.80=80 MHz -blynk.menu.xtal.80.build.f_cpu=80000000L -blynk.menu.xtal.160=160 MHz -blynk.menu.xtal.160.build.f_cpu=160000000L -blynk.menu.vt.flash=Flash -blynk.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -blynk.menu.vt.heap=Heap -blynk.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -blynk.menu.vt.iram=IRAM -blynk.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -blynk.menu.exception.disabled=Disabled (new aborts on oom) -blynk.menu.exception.disabled.build.exception_flags=-fno-exceptions -blynk.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -blynk.menu.exception.enabled=Enabled -blynk.menu.exception.enabled.build.exception_flags=-fexceptions -blynk.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -blynk.menu.stacksmash.disabled=Disabled -blynk.menu.stacksmash.disabled.build.stacksmash_flags= -blynk.menu.stacksmash.enabled=Enabled -blynk.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -blynk.menu.ssl.all=All SSL ciphers (most compatible) -blynk.menu.ssl.all.build.sslflags= -blynk.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -blynk.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -blynk.upload.resetmethod=--before default_reset --after hard_reset -blynk.build.flash_mode=qio -blynk.build.flash_flags=-DFLASHMODE_QIO -blynk.build.flash_freq=40 -blynk.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -blynk.menu.eesz.4M2M.build.flash_size=4M -blynk.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -blynk.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -blynk.menu.eesz.4M2M.build.spiffs_pagesize=256 -blynk.menu.eesz.4M2M.upload.maximum_size=1044464 -blynk.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -blynk.menu.eesz.4M2M.build.spiffs_start=0x200000 -blynk.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -blynk.menu.eesz.4M2M.build.spiffs_blocksize=8192 -blynk.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -blynk.menu.eesz.4M3M.build.flash_size=4M -blynk.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -blynk.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -blynk.menu.eesz.4M3M.build.spiffs_pagesize=256 -blynk.menu.eesz.4M3M.upload.maximum_size=1044464 -blynk.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -blynk.menu.eesz.4M3M.build.spiffs_start=0x100000 -blynk.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -blynk.menu.eesz.4M3M.build.spiffs_blocksize=8192 -blynk.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -blynk.menu.eesz.4M1M.build.flash_size=4M -blynk.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -blynk.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -blynk.menu.eesz.4M1M.build.spiffs_pagesize=256 -blynk.menu.eesz.4M1M.upload.maximum_size=1044464 -blynk.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -blynk.menu.eesz.4M1M.build.spiffs_start=0x300000 -blynk.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -blynk.menu.eesz.4M1M.build.spiffs_blocksize=8192 -blynk.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -blynk.menu.eesz.4M.build.flash_size=4M -blynk.menu.eesz.4M.build.flash_size_bytes=0x400000 -blynk.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -blynk.menu.eesz.4M.build.spiffs_pagesize=256 -blynk.menu.eesz.4M.upload.maximum_size=1044464 -blynk.menu.eesz.4M.build.rfcal_addr=0x3FC000 -blynk.menu.ip.lm2f=v2 Lower Memory -blynk.menu.ip.lm2f.build.lwip_include=lwip2/include -blynk.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -blynk.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -blynk.menu.ip.hb2f=v2 Higher Bandwidth -blynk.menu.ip.hb2f.build.lwip_include=lwip2/include -blynk.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -blynk.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -blynk.menu.ip.lm2n=v2 Lower Memory (no features) -blynk.menu.ip.lm2n.build.lwip_include=lwip2/include -blynk.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -blynk.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -blynk.menu.ip.hb2n=v2 Higher Bandwidth (no features) -blynk.menu.ip.hb2n.build.lwip_include=lwip2/include -blynk.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -blynk.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -blynk.menu.ip.lm6f=v2 IPv6 Lower Memory -blynk.menu.ip.lm6f.build.lwip_include=lwip2/include -blynk.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -blynk.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -blynk.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -blynk.menu.ip.hb6f.build.lwip_include=lwip2/include -blynk.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -blynk.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -blynk.menu.dbg.Disabled=Disabled -blynk.menu.dbg.Disabled.build.debug_port= -blynk.menu.dbg.Serial=Serial -blynk.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -blynk.menu.dbg.Serial1=Serial1 -blynk.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -blynk.menu.lvl.None____=None -blynk.menu.lvl.None____.build.debug_level= -blynk.menu.lvl.SSL=SSL -blynk.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -blynk.menu.lvl.TLS_MEM=TLS_MEM -blynk.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -blynk.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -blynk.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -blynk.menu.lvl.HTTP_SERVER=HTTP_SERVER -blynk.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -blynk.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -blynk.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -blynk.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -blynk.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -blynk.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -blynk.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -blynk.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -blynk.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -blynk.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -blynk.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -blynk.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -blynk.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -blynk.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -blynk.menu.lvl.CORE=CORE -blynk.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -blynk.menu.lvl.WIFI=WIFI -blynk.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -blynk.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -blynk.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -blynk.menu.lvl.UPDATER=UPDATER -blynk.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -blynk.menu.lvl.OTA=OTA -blynk.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -blynk.menu.lvl.OOM=OOM -blynk.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -blynk.menu.lvl.MDNS=MDNS -blynk.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -blynk.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -blynk.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -blynk.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -blynk.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -blynk.menu.wipe.none=Only Sketch -blynk.menu.wipe.none.upload.erase_cmd= -blynk.menu.wipe.sdk=Sketch + WiFi Settings -blynk.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -blynk.menu.wipe.all=All Flash Contents -blynk.menu.wipe.all.upload.erase_cmd=erase_flash -blynk.menu.baud.115200=115200 -blynk.menu.baud.115200.upload.speed=115200 -blynk.menu.baud.57600=57600 -blynk.menu.baud.57600.upload.speed=57600 -blynk.menu.baud.230400.linux=230400 -blynk.menu.baud.230400.macosx=230400 -blynk.menu.baud.230400.upload.speed=230400 -blynk.menu.baud.256000.windows=256000 -blynk.menu.baud.256000.upload.speed=256000 -blynk.menu.baud.460800.linux=460800 -blynk.menu.baud.460800.macosx=460800 -blynk.menu.baud.460800.upload.speed=460800 -blynk.menu.baud.512000.windows=512000 -blynk.menu.baud.512000.upload.speed=512000 -blynk.menu.baud.921600=921600 -blynk.menu.baud.921600.upload.speed=921600 -blynk.menu.baud.3000000=3000000 -blynk.menu.baud.3000000.upload.speed=3000000 - -############################################################## -esp210.name=SweetPea ESP-210 -esp210.build.board=ESP8266_ESP210 -esp210.upload.tool=esptool -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.core=esp8266 -esp210.build.variant=generic -esp210.build.spiffs_pagesize=256 -esp210.build.debug_port= -esp210.build.debug_level= -esp210.menu.xtal.80=80 MHz -esp210.menu.xtal.80.build.f_cpu=80000000L -esp210.menu.xtal.160=160 MHz -esp210.menu.xtal.160.build.f_cpu=160000000L -esp210.menu.vt.flash=Flash -esp210.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -esp210.menu.vt.heap=Heap -esp210.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -esp210.menu.vt.iram=IRAM -esp210.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -esp210.menu.exception.disabled=Disabled (new aborts on oom) -esp210.menu.exception.disabled.build.exception_flags=-fno-exceptions -esp210.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -esp210.menu.exception.enabled=Enabled -esp210.menu.exception.enabled.build.exception_flags=-fexceptions -esp210.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -esp210.menu.stacksmash.disabled=Disabled -esp210.menu.stacksmash.disabled.build.stacksmash_flags= -esp210.menu.stacksmash.enabled=Enabled -esp210.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -esp210.menu.ssl.all=All SSL ciphers (most compatible) -esp210.menu.ssl.all.build.sslflags= -esp210.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -esp210.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -esp210.upload.resetmethod=--before no_reset --after soft_reset -esp210.build.flash_mode=qio -esp210.build.flash_flags=-DFLASHMODE_QIO -esp210.build.flash_freq=40 -esp210.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -esp210.menu.eesz.4M2M.build.flash_size=4M -esp210.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -esp210.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -esp210.menu.eesz.4M2M.build.spiffs_pagesize=256 -esp210.menu.eesz.4M2M.upload.maximum_size=1044464 -esp210.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -esp210.menu.eesz.4M2M.build.spiffs_start=0x200000 -esp210.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -esp210.menu.eesz.4M2M.build.spiffs_blocksize=8192 -esp210.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -esp210.menu.eesz.4M3M.build.flash_size=4M -esp210.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -esp210.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -esp210.menu.eesz.4M3M.build.spiffs_pagesize=256 -esp210.menu.eesz.4M3M.upload.maximum_size=1044464 -esp210.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -esp210.menu.eesz.4M3M.build.spiffs_start=0x100000 -esp210.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -esp210.menu.eesz.4M3M.build.spiffs_blocksize=8192 -esp210.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -esp210.menu.eesz.4M1M.build.flash_size=4M -esp210.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -esp210.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -esp210.menu.eesz.4M1M.build.spiffs_pagesize=256 -esp210.menu.eesz.4M1M.upload.maximum_size=1044464 -esp210.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -esp210.menu.eesz.4M1M.build.spiffs_start=0x300000 -esp210.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -esp210.menu.eesz.4M1M.build.spiffs_blocksize=8192 -esp210.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -esp210.menu.eesz.4M.build.flash_size=4M -esp210.menu.eesz.4M.build.flash_size_bytes=0x400000 -esp210.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -esp210.menu.eesz.4M.build.spiffs_pagesize=256 -esp210.menu.eesz.4M.upload.maximum_size=1044464 -esp210.menu.eesz.4M.build.rfcal_addr=0x3FC000 -esp210.menu.ip.lm2f=v2 Lower Memory -esp210.menu.ip.lm2f.build.lwip_include=lwip2/include -esp210.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -esp210.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -esp210.menu.ip.hb2f=v2 Higher Bandwidth -esp210.menu.ip.hb2f.build.lwip_include=lwip2/include -esp210.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -esp210.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -esp210.menu.ip.lm2n=v2 Lower Memory (no features) -esp210.menu.ip.lm2n.build.lwip_include=lwip2/include -esp210.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -esp210.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -esp210.menu.ip.hb2n=v2 Higher Bandwidth (no features) -esp210.menu.ip.hb2n.build.lwip_include=lwip2/include -esp210.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -esp210.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -esp210.menu.ip.lm6f=v2 IPv6 Lower Memory -esp210.menu.ip.lm6f.build.lwip_include=lwip2/include -esp210.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -esp210.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -esp210.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -esp210.menu.ip.hb6f.build.lwip_include=lwip2/include -esp210.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -esp210.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -esp210.menu.dbg.Disabled=Disabled -esp210.menu.dbg.Disabled.build.debug_port= -esp210.menu.dbg.Serial=Serial -esp210.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -esp210.menu.dbg.Serial1=Serial1 -esp210.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -esp210.menu.lvl.None____=None -esp210.menu.lvl.None____.build.debug_level= -esp210.menu.lvl.SSL=SSL -esp210.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -esp210.menu.lvl.TLS_MEM=TLS_MEM -esp210.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -esp210.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -esp210.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -esp210.menu.lvl.HTTP_SERVER=HTTP_SERVER -esp210.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -esp210.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -esp210.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -esp210.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -esp210.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -esp210.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -esp210.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -esp210.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -esp210.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -esp210.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -esp210.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -esp210.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -esp210.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -esp210.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -esp210.menu.lvl.CORE=CORE -esp210.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -esp210.menu.lvl.WIFI=WIFI -esp210.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -esp210.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -esp210.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -esp210.menu.lvl.UPDATER=UPDATER -esp210.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -esp210.menu.lvl.OTA=OTA -esp210.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -esp210.menu.lvl.OOM=OOM -esp210.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -esp210.menu.lvl.MDNS=MDNS -esp210.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -esp210.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -esp210.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -esp210.menu.wipe.none=Only Sketch -esp210.menu.wipe.none.upload.erase_cmd= -esp210.menu.wipe.sdk=Sketch + WiFi Settings -esp210.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -esp210.menu.wipe.all=All Flash Contents -esp210.menu.wipe.all.upload.erase_cmd=erase_flash -esp210.menu.baud.57600=57600 -esp210.menu.baud.57600.upload.speed=57600 -esp210.menu.baud.115200=115200 -esp210.menu.baud.115200.upload.speed=115200 -esp210.menu.baud.230400.linux=230400 -esp210.menu.baud.230400.macosx=230400 -esp210.menu.baud.230400.upload.speed=230400 -esp210.menu.baud.256000.windows=256000 -esp210.menu.baud.256000.upload.speed=256000 -esp210.menu.baud.460800.linux=460800 -esp210.menu.baud.460800.macosx=460800 -esp210.menu.baud.460800.upload.speed=460800 -esp210.menu.baud.512000.windows=512000 -esp210.menu.baud.512000.upload.speed=512000 -esp210.menu.baud.921600=921600 -esp210.menu.baud.921600.upload.speed=921600 -esp210.menu.baud.3000000=3000000 -esp210.menu.baud.3000000.upload.speed=3000000 - -############################################################## -d1_mini.name=LOLIN(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.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.core=esp8266 -d1_mini.build.spiffs_pagesize=256 -d1_mini.build.debug_port= -d1_mini.build.debug_level= -d1_mini.menu.xtal.80=80 MHz -d1_mini.menu.xtal.80.build.f_cpu=80000000L -d1_mini.menu.xtal.160=160 MHz -d1_mini.menu.xtal.160.build.f_cpu=160000000L -d1_mini.menu.vt.flash=Flash -d1_mini.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -d1_mini.menu.vt.heap=Heap -d1_mini.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -d1_mini.menu.vt.iram=IRAM -d1_mini.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini.menu.exception.disabled=Disabled (new aborts on oom) -d1_mini.menu.exception.disabled.build.exception_flags=-fno-exceptions -d1_mini.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -d1_mini.menu.exception.enabled=Enabled -d1_mini.menu.exception.enabled.build.exception_flags=-fexceptions -d1_mini.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -d1_mini.menu.stacksmash.disabled=Disabled -d1_mini.menu.stacksmash.disabled.build.stacksmash_flags= -d1_mini.menu.stacksmash.enabled=Enabled -d1_mini.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -d1_mini.menu.ssl.all=All SSL ciphers (most compatible) -d1_mini.menu.ssl.all.build.sslflags= -d1_mini.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -d1_mini.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -d1_mini.upload.resetmethod=--before default_reset --after hard_reset -d1_mini.build.flash_mode=dio -d1_mini.build.flash_flags=-DFLASHMODE_DIO -d1_mini.build.flash_freq=40 -d1_mini.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -d1_mini.menu.eesz.4M2M.build.flash_size=4M -d1_mini.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -d1_mini.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -d1_mini.menu.eesz.4M2M.build.spiffs_pagesize=256 -d1_mini.menu.eesz.4M2M.upload.maximum_size=1044464 -d1_mini.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -d1_mini.menu.eesz.4M2M.build.spiffs_start=0x200000 -d1_mini.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -d1_mini.menu.eesz.4M2M.build.spiffs_blocksize=8192 -d1_mini.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -d1_mini.menu.eesz.4M3M.build.flash_size=4M -d1_mini.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -d1_mini.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -d1_mini.menu.eesz.4M3M.build.spiffs_pagesize=256 -d1_mini.menu.eesz.4M3M.upload.maximum_size=1044464 -d1_mini.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -d1_mini.menu.eesz.4M3M.build.spiffs_start=0x100000 -d1_mini.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -d1_mini.menu.eesz.4M3M.build.spiffs_blocksize=8192 -d1_mini.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -d1_mini.menu.eesz.4M1M.build.flash_size=4M -d1_mini.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -d1_mini.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -d1_mini.menu.eesz.4M1M.build.spiffs_pagesize=256 -d1_mini.menu.eesz.4M1M.upload.maximum_size=1044464 -d1_mini.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -d1_mini.menu.eesz.4M1M.build.spiffs_start=0x300000 -d1_mini.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -d1_mini.menu.eesz.4M1M.build.spiffs_blocksize=8192 -d1_mini.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -d1_mini.menu.eesz.4M.build.flash_size=4M -d1_mini.menu.eesz.4M.build.flash_size_bytes=0x400000 -d1_mini.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -d1_mini.menu.eesz.4M.build.spiffs_pagesize=256 -d1_mini.menu.eesz.4M.upload.maximum_size=1044464 -d1_mini.menu.eesz.4M.build.rfcal_addr=0x3FC000 -d1_mini.menu.ip.lm2f=v2 Lower Memory -d1_mini.menu.ip.lm2f.build.lwip_include=lwip2/include -d1_mini.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -d1_mini.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1_mini.menu.ip.hb2f=v2 Higher Bandwidth -d1_mini.menu.ip.hb2f.build.lwip_include=lwip2/include -d1_mini.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -d1_mini.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1_mini.menu.ip.lm2n=v2 Lower Memory (no features) -d1_mini.menu.ip.lm2n.build.lwip_include=lwip2/include -d1_mini.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -d1_mini.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1_mini.menu.ip.hb2n=v2 Higher Bandwidth (no features) -d1_mini.menu.ip.hb2n.build.lwip_include=lwip2/include -d1_mini.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -d1_mini.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1_mini.menu.ip.lm6f=v2 IPv6 Lower Memory -d1_mini.menu.ip.lm6f.build.lwip_include=lwip2/include -d1_mini.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -d1_mini.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1_mini.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -d1_mini.menu.ip.hb6f.build.lwip_include=lwip2/include -d1_mini.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -d1_mini.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1_mini.menu.dbg.Disabled=Disabled -d1_mini.menu.dbg.Disabled.build.debug_port= -d1_mini.menu.dbg.Serial=Serial -d1_mini.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -d1_mini.menu.dbg.Serial1=Serial1 -d1_mini.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -d1_mini.menu.lvl.None____=None -d1_mini.menu.lvl.None____.build.debug_level= -d1_mini.menu.lvl.SSL=SSL -d1_mini.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -d1_mini.menu.lvl.TLS_MEM=TLS_MEM -d1_mini.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -d1_mini.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -d1_mini.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -d1_mini.menu.lvl.HTTP_SERVER=HTTP_SERVER -d1_mini.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -d1_mini.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -d1_mini.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -d1_mini.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -d1_mini.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -d1_mini.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -d1_mini.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -d1_mini.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -d1_mini.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1_mini.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -d1_mini.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1_mini.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -d1_mini.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1_mini.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -d1_mini.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1_mini.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -d1_mini.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1_mini.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1_mini.menu.lvl.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.lvl.CORE=CORE -d1_mini.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -d1_mini.menu.lvl.WIFI=WIFI -d1_mini.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -d1_mini.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -d1_mini.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -d1_mini.menu.lvl.UPDATER=UPDATER -d1_mini.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -d1_mini.menu.lvl.OTA=OTA -d1_mini.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -d1_mini.menu.lvl.OOM=OOM -d1_mini.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1_mini.menu.lvl.MDNS=MDNS -d1_mini.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -d1_mini.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -d1_mini.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -d1_mini.menu.wipe.none=Only Sketch -d1_mini.menu.wipe.none.upload.erase_cmd= -d1_mini.menu.wipe.sdk=Sketch + WiFi Settings -d1_mini.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -d1_mini.menu.wipe.all=All Flash Contents -d1_mini.menu.wipe.all.upload.erase_cmd=erase_flash -d1_mini.menu.baud.921600=921600 -d1_mini.menu.baud.921600.upload.speed=921600 -d1_mini.menu.baud.57600=57600 -d1_mini.menu.baud.57600.upload.speed=57600 -d1_mini.menu.baud.115200=115200 -d1_mini.menu.baud.115200.upload.speed=115200 -d1_mini.menu.baud.230400.linux=230400 -d1_mini.menu.baud.230400.macosx=230400 -d1_mini.menu.baud.230400.upload.speed=230400 -d1_mini.menu.baud.256000.windows=256000 -d1_mini.menu.baud.256000.upload.speed=256000 -d1_mini.menu.baud.460800.linux=460800 -d1_mini.menu.baud.460800.macosx=460800 -d1_mini.menu.baud.460800.upload.speed=460800 -d1_mini.menu.baud.512000.windows=512000 -d1_mini.menu.baud.512000.upload.speed=512000 -d1_mini.menu.baud.3000000=3000000 -d1_mini.menu.baud.3000000.upload.speed=3000000 - -############################################################## -d1_mini_pro.name=LOLIN(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.xtal.80=80 MHz -d1_mini_pro.menu.xtal.80.build.f_cpu=80000000L -d1_mini_pro.menu.xtal.160=160 MHz -d1_mini_pro.menu.xtal.160.build.f_cpu=160000000L -d1_mini_pro.menu.vt.flash=Flash -d1_mini_pro.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -d1_mini_pro.menu.vt.heap=Heap -d1_mini_pro.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -d1_mini_pro.menu.vt.iram=IRAM -d1_mini_pro.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini_pro.menu.exception.disabled=Disabled (new aborts on oom) -d1_mini_pro.menu.exception.disabled.build.exception_flags=-fno-exceptions -d1_mini_pro.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -d1_mini_pro.menu.exception.enabled=Enabled -d1_mini_pro.menu.exception.enabled.build.exception_flags=-fexceptions -d1_mini_pro.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -d1_mini_pro.menu.stacksmash.disabled=Disabled -d1_mini_pro.menu.stacksmash.disabled.build.stacksmash_flags= -d1_mini_pro.menu.stacksmash.enabled=Enabled -d1_mini_pro.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -d1_mini_pro.menu.ssl.all=All SSL ciphers (most compatible) -d1_mini_pro.menu.ssl.all.build.sslflags= -d1_mini_pro.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -d1_mini_pro.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -d1_mini_pro.upload.resetmethod=--before default_reset --after hard_reset -d1_mini_pro.build.flash_mode=dio -d1_mini_pro.build.flash_flags=-DFLASHMODE_DIO -d1_mini_pro.build.flash_freq=40 -d1_mini_pro.menu.eesz.16M14M=16MB (FS:14MB OTA:~1019KB) -d1_mini_pro.menu.eesz.16M14M.build.flash_size=16M -d1_mini_pro.menu.eesz.16M14M.build.flash_size_bytes=0x1000000 -d1_mini_pro.menu.eesz.16M14M.build.flash_ld=eagle.flash.16m14m.ld -d1_mini_pro.menu.eesz.16M14M.build.spiffs_pagesize=256 -d1_mini_pro.menu.eesz.16M14M.upload.maximum_size=1044464 -d1_mini_pro.menu.eesz.16M14M.build.rfcal_addr=0xFFC000 -d1_mini_pro.menu.eesz.16M14M.build.spiffs_start=0x200000 -d1_mini_pro.menu.eesz.16M14M.build.spiffs_end=0xFFA000 -d1_mini_pro.menu.eesz.16M14M.build.spiffs_blocksize=8192 -d1_mini_pro.menu.eesz.16M15M=16MB (FS:15MB OTA:~512KB) -d1_mini_pro.menu.eesz.16M15M.build.flash_size=16M -d1_mini_pro.menu.eesz.16M15M.build.flash_size_bytes=0x1000000 -d1_mini_pro.menu.eesz.16M15M.build.flash_ld=eagle.flash.16m15m.ld -d1_mini_pro.menu.eesz.16M15M.build.spiffs_pagesize=256 -d1_mini_pro.menu.eesz.16M15M.upload.maximum_size=1044464 -d1_mini_pro.menu.eesz.16M15M.build.rfcal_addr=0xFFC000 -d1_mini_pro.menu.eesz.16M15M.build.spiffs_start=0x100000 -d1_mini_pro.menu.eesz.16M15M.build.spiffs_end=0xFFA000 -d1_mini_pro.menu.eesz.16M15M.build.spiffs_blocksize=8192 -d1_mini_pro.menu.ip.lm2f=v2 Lower Memory -d1_mini_pro.menu.ip.lm2f.build.lwip_include=lwip2/include -d1_mini_pro.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -d1_mini_pro.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1_mini_pro.menu.ip.hb2f=v2 Higher Bandwidth -d1_mini_pro.menu.ip.hb2f.build.lwip_include=lwip2/include -d1_mini_pro.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -d1_mini_pro.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1_mini_pro.menu.ip.lm2n=v2 Lower Memory (no features) -d1_mini_pro.menu.ip.lm2n.build.lwip_include=lwip2/include -d1_mini_pro.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -d1_mini_pro.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1_mini_pro.menu.ip.hb2n=v2 Higher Bandwidth (no features) -d1_mini_pro.menu.ip.hb2n.build.lwip_include=lwip2/include -d1_mini_pro.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -d1_mini_pro.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1_mini_pro.menu.ip.lm6f=v2 IPv6 Lower Memory -d1_mini_pro.menu.ip.lm6f.build.lwip_include=lwip2/include -d1_mini_pro.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -d1_mini_pro.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1_mini_pro.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -d1_mini_pro.menu.ip.hb6f.build.lwip_include=lwip2/include -d1_mini_pro.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -d1_mini_pro.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1_mini_pro.menu.dbg.Disabled=Disabled -d1_mini_pro.menu.dbg.Disabled.build.debug_port= -d1_mini_pro.menu.dbg.Serial=Serial -d1_mini_pro.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -d1_mini_pro.menu.dbg.Serial1=Serial1 -d1_mini_pro.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -d1_mini_pro.menu.lvl.None____=None -d1_mini_pro.menu.lvl.None____.build.debug_level= -d1_mini_pro.menu.lvl.SSL=SSL -d1_mini_pro.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -d1_mini_pro.menu.lvl.TLS_MEM=TLS_MEM -d1_mini_pro.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -d1_mini_pro.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -d1_mini_pro.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -d1_mini_pro.menu.lvl.HTTP_SERVER=HTTP_SERVER -d1_mini_pro.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -d1_mini_pro.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -d1_mini_pro.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -d1_mini_pro.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -d1_mini_pro.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -d1_mini_pro.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -d1_mini_pro.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1_mini_pro.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -d1_mini_pro.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1_mini_pro.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -d1_mini_pro.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1_mini_pro.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -d1_mini_pro.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1_mini_pro.menu.lvl.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.lvl.CORE=CORE -d1_mini_pro.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -d1_mini_pro.menu.lvl.WIFI=WIFI -d1_mini_pro.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -d1_mini_pro.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -d1_mini_pro.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -d1_mini_pro.menu.lvl.UPDATER=UPDATER -d1_mini_pro.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -d1_mini_pro.menu.lvl.OTA=OTA -d1_mini_pro.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -d1_mini_pro.menu.lvl.OOM=OOM -d1_mini_pro.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1_mini_pro.menu.lvl.MDNS=MDNS -d1_mini_pro.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -d1_mini_pro.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -d1_mini_pro.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -d1_mini_pro.menu.wipe.none=Only Sketch -d1_mini_pro.menu.wipe.none.upload.erase_cmd= -d1_mini_pro.menu.wipe.sdk=Sketch + WiFi Settings -d1_mini_pro.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -d1_mini_pro.menu.wipe.all=All Flash Contents -d1_mini_pro.menu.wipe.all.upload.erase_cmd=erase_flash -d1_mini_pro.menu.baud.921600=921600 -d1_mini_pro.menu.baud.921600.upload.speed=921600 -d1_mini_pro.menu.baud.57600=57600 -d1_mini_pro.menu.baud.57600.upload.speed=57600 -d1_mini_pro.menu.baud.115200=115200 -d1_mini_pro.menu.baud.115200.upload.speed=115200 -d1_mini_pro.menu.baud.230400.linux=230400 -d1_mini_pro.menu.baud.230400.macosx=230400 -d1_mini_pro.menu.baud.230400.upload.speed=230400 -d1_mini_pro.menu.baud.256000.windows=256000 -d1_mini_pro.menu.baud.256000.upload.speed=256000 -d1_mini_pro.menu.baud.460800.linux=460800 -d1_mini_pro.menu.baud.460800.macosx=460800 -d1_mini_pro.menu.baud.460800.upload.speed=460800 -d1_mini_pro.menu.baud.512000.windows=512000 -d1_mini_pro.menu.baud.512000.upload.speed=512000 -d1_mini_pro.menu.baud.3000000=3000000 -d1_mini_pro.menu.baud.3000000.upload.speed=3000000 - -############################################################## -d1_mini_lite.name=LOLIN(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.xtal.80=80 MHz -d1_mini_lite.menu.xtal.80.build.f_cpu=80000000L -d1_mini_lite.menu.xtal.160=160 MHz -d1_mini_lite.menu.xtal.160.build.f_cpu=160000000L -d1_mini_lite.menu.vt.flash=Flash -d1_mini_lite.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -d1_mini_lite.menu.vt.heap=Heap -d1_mini_lite.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -d1_mini_lite.menu.vt.iram=IRAM -d1_mini_lite.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1_mini_lite.menu.exception.disabled=Disabled (new aborts on oom) -d1_mini_lite.menu.exception.disabled.build.exception_flags=-fno-exceptions -d1_mini_lite.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -d1_mini_lite.menu.exception.enabled=Enabled -d1_mini_lite.menu.exception.enabled.build.exception_flags=-fexceptions -d1_mini_lite.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -d1_mini_lite.menu.stacksmash.disabled=Disabled -d1_mini_lite.menu.stacksmash.disabled.build.stacksmash_flags= -d1_mini_lite.menu.stacksmash.enabled=Enabled -d1_mini_lite.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -d1_mini_lite.menu.ssl.all=All SSL ciphers (most compatible) -d1_mini_lite.menu.ssl.all.build.sslflags= -d1_mini_lite.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -d1_mini_lite.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -d1_mini_lite.upload.resetmethod=--before default_reset --after hard_reset -d1_mini_lite.build.flash_mode=dout -d1_mini_lite.build.flash_flags=-DFLASHMODE_DOUT -d1_mini_lite.build.flash_freq=40 -d1_mini_lite.menu.eesz.1M64=1MB (FS:64KB OTA:~470KB) -d1_mini_lite.menu.eesz.1M64.build.flash_size=1M -d1_mini_lite.menu.eesz.1M64.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M64.build.flash_ld=eagle.flash.1m64.ld -d1_mini_lite.menu.eesz.1M64.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M64.upload.maximum_size=958448 -d1_mini_lite.menu.eesz.1M64.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.eesz.1M64.build.spiffs_start=0xEB000 -d1_mini_lite.menu.eesz.1M64.build.spiffs_end=0xFB000 -d1_mini_lite.menu.eesz.1M64.build.spiffs_blocksize=4096 -d1_mini_lite.menu.eesz.1M128=1MB (FS:128KB OTA:~438KB) -d1_mini_lite.menu.eesz.1M128.build.flash_size=1M -d1_mini_lite.menu.eesz.1M128.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M128.build.flash_ld=eagle.flash.1m128.ld -d1_mini_lite.menu.eesz.1M128.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M128.upload.maximum_size=892912 -d1_mini_lite.menu.eesz.1M128.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.eesz.1M128.build.spiffs_start=0xDB000 -d1_mini_lite.menu.eesz.1M128.build.spiffs_end=0xFB000 -d1_mini_lite.menu.eesz.1M128.build.spiffs_blocksize=4096 -d1_mini_lite.menu.eesz.1M144=1MB (FS:144KB OTA:~430KB) -d1_mini_lite.menu.eesz.1M144.build.flash_size=1M -d1_mini_lite.menu.eesz.1M144.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M144.build.flash_ld=eagle.flash.1m144.ld -d1_mini_lite.menu.eesz.1M144.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M144.upload.maximum_size=876528 -d1_mini_lite.menu.eesz.1M144.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.eesz.1M144.build.spiffs_start=0xD7000 -d1_mini_lite.menu.eesz.1M144.build.spiffs_end=0xFB000 -d1_mini_lite.menu.eesz.1M144.build.spiffs_blocksize=4096 -d1_mini_lite.menu.eesz.1M160=1MB (FS:160KB OTA:~422KB) -d1_mini_lite.menu.eesz.1M160.build.flash_size=1M -d1_mini_lite.menu.eesz.1M160.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M160.build.flash_ld=eagle.flash.1m160.ld -d1_mini_lite.menu.eesz.1M160.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M160.upload.maximum_size=860144 -d1_mini_lite.menu.eesz.1M160.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.eesz.1M160.build.spiffs_start=0xD3000 -d1_mini_lite.menu.eesz.1M160.build.spiffs_end=0xFB000 -d1_mini_lite.menu.eesz.1M160.build.spiffs_blocksize=4096 -d1_mini_lite.menu.eesz.1M192=1MB (FS:192KB OTA:~406KB) -d1_mini_lite.menu.eesz.1M192.build.flash_size=1M -d1_mini_lite.menu.eesz.1M192.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M192.build.flash_ld=eagle.flash.1m192.ld -d1_mini_lite.menu.eesz.1M192.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M192.upload.maximum_size=827376 -d1_mini_lite.menu.eesz.1M192.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.eesz.1M192.build.spiffs_start=0xCB000 -d1_mini_lite.menu.eesz.1M192.build.spiffs_end=0xFB000 -d1_mini_lite.menu.eesz.1M192.build.spiffs_blocksize=4096 -d1_mini_lite.menu.eesz.1M256=1MB (FS:256KB OTA:~374KB) -d1_mini_lite.menu.eesz.1M256.build.flash_size=1M -d1_mini_lite.menu.eesz.1M256.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M256.build.flash_ld=eagle.flash.1m256.ld -d1_mini_lite.menu.eesz.1M256.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M256.upload.maximum_size=761840 -d1_mini_lite.menu.eesz.1M256.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.eesz.1M256.build.spiffs_start=0xBB000 -d1_mini_lite.menu.eesz.1M256.build.spiffs_end=0xFB000 -d1_mini_lite.menu.eesz.1M256.build.spiffs_blocksize=4096 -d1_mini_lite.menu.eesz.1M512=1MB (FS:512KB OTA:~246KB) -d1_mini_lite.menu.eesz.1M512.build.flash_size=1M -d1_mini_lite.menu.eesz.1M512.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M512.build.flash_ld=eagle.flash.1m512.ld -d1_mini_lite.menu.eesz.1M512.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M512.upload.maximum_size=499696 -d1_mini_lite.menu.eesz.1M512.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.eesz.1M512.build.spiffs_start=0x7B000 -d1_mini_lite.menu.eesz.1M512.build.spiffs_end=0xFB000 -d1_mini_lite.menu.eesz.1M512.build.spiffs_blocksize=8192 -d1_mini_lite.menu.eesz.1M=1MB (FS:none OTA:~502KB) -d1_mini_lite.menu.eesz.1M.build.flash_size=1M -d1_mini_lite.menu.eesz.1M.build.flash_size_bytes=0x100000 -d1_mini_lite.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld -d1_mini_lite.menu.eesz.1M.build.spiffs_pagesize=256 -d1_mini_lite.menu.eesz.1M.upload.maximum_size=1023984 -d1_mini_lite.menu.eesz.1M.build.rfcal_addr=0xFC000 -d1_mini_lite.menu.ip.lm2f=v2 Lower Memory -d1_mini_lite.menu.ip.lm2f.build.lwip_include=lwip2/include -d1_mini_lite.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -d1_mini_lite.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1_mini_lite.menu.ip.hb2f=v2 Higher Bandwidth -d1_mini_lite.menu.ip.hb2f.build.lwip_include=lwip2/include -d1_mini_lite.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -d1_mini_lite.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1_mini_lite.menu.ip.lm2n=v2 Lower Memory (no features) -d1_mini_lite.menu.ip.lm2n.build.lwip_include=lwip2/include -d1_mini_lite.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -d1_mini_lite.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1_mini_lite.menu.ip.hb2n=v2 Higher Bandwidth (no features) -d1_mini_lite.menu.ip.hb2n.build.lwip_include=lwip2/include -d1_mini_lite.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -d1_mini_lite.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1_mini_lite.menu.ip.lm6f=v2 IPv6 Lower Memory -d1_mini_lite.menu.ip.lm6f.build.lwip_include=lwip2/include -d1_mini_lite.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -d1_mini_lite.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1_mini_lite.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -d1_mini_lite.menu.ip.hb6f.build.lwip_include=lwip2/include -d1_mini_lite.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -d1_mini_lite.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1_mini_lite.menu.dbg.Disabled=Disabled -d1_mini_lite.menu.dbg.Disabled.build.debug_port= -d1_mini_lite.menu.dbg.Serial=Serial -d1_mini_lite.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -d1_mini_lite.menu.dbg.Serial1=Serial1 -d1_mini_lite.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -d1_mini_lite.menu.lvl.None____=None -d1_mini_lite.menu.lvl.None____.build.debug_level= -d1_mini_lite.menu.lvl.SSL=SSL -d1_mini_lite.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -d1_mini_lite.menu.lvl.TLS_MEM=TLS_MEM -d1_mini_lite.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -d1_mini_lite.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -d1_mini_lite.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -d1_mini_lite.menu.lvl.HTTP_SERVER=HTTP_SERVER -d1_mini_lite.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -d1_mini_lite.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -d1_mini_lite.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -d1_mini_lite.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -d1_mini_lite.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -d1_mini_lite.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -d1_mini_lite.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1_mini_lite.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -d1_mini_lite.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1_mini_lite.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -d1_mini_lite.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1_mini_lite.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -d1_mini_lite.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1_mini_lite.menu.lvl.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.lvl.CORE=CORE -d1_mini_lite.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -d1_mini_lite.menu.lvl.WIFI=WIFI -d1_mini_lite.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -d1_mini_lite.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -d1_mini_lite.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -d1_mini_lite.menu.lvl.UPDATER=UPDATER -d1_mini_lite.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -d1_mini_lite.menu.lvl.OTA=OTA -d1_mini_lite.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -d1_mini_lite.menu.lvl.OOM=OOM -d1_mini_lite.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1_mini_lite.menu.lvl.MDNS=MDNS -d1_mini_lite.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -d1_mini_lite.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -d1_mini_lite.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -d1_mini_lite.menu.wipe.none=Only Sketch -d1_mini_lite.menu.wipe.none.upload.erase_cmd= -d1_mini_lite.menu.wipe.sdk=Sketch + WiFi Settings -d1_mini_lite.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -d1_mini_lite.menu.wipe.all=All Flash Contents -d1_mini_lite.menu.wipe.all.upload.erase_cmd=erase_flash -d1_mini_lite.menu.baud.921600=921600 -d1_mini_lite.menu.baud.921600.upload.speed=921600 -d1_mini_lite.menu.baud.57600=57600 -d1_mini_lite.menu.baud.57600.upload.speed=57600 -d1_mini_lite.menu.baud.115200=115200 -d1_mini_lite.menu.baud.115200.upload.speed=115200 -d1_mini_lite.menu.baud.230400.linux=230400 -d1_mini_lite.menu.baud.230400.macosx=230400 -d1_mini_lite.menu.baud.230400.upload.speed=230400 -d1_mini_lite.menu.baud.256000.windows=256000 -d1_mini_lite.menu.baud.256000.upload.speed=256000 -d1_mini_lite.menu.baud.460800.linux=460800 -d1_mini_lite.menu.baud.460800.macosx=460800 -d1_mini_lite.menu.baud.460800.upload.speed=460800 -d1_mini_lite.menu.baud.512000.windows=512000 -d1_mini_lite.menu.baud.512000.upload.speed=512000 -d1_mini_lite.menu.baud.3000000=3000000 -d1_mini_lite.menu.baud.3000000.upload.speed=3000000 - -############################################################## -d1.name=WeMos D1 R1 -d1.build.board=ESP8266_WEMOS_D1R1 -d1.build.variant=d1 -d1.upload.tool=esptool -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.core=esp8266 -d1.build.spiffs_pagesize=256 -d1.build.debug_port= -d1.build.debug_level= -d1.menu.xtal.80=80 MHz -d1.menu.xtal.80.build.f_cpu=80000000L -d1.menu.xtal.160=160 MHz -d1.menu.xtal.160.build.f_cpu=160000000L -d1.menu.vt.flash=Flash -d1.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -d1.menu.vt.heap=Heap -d1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -d1.menu.vt.iram=IRAM -d1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -d1.menu.exception.disabled=Disabled (new aborts on oom) -d1.menu.exception.disabled.build.exception_flags=-fno-exceptions -d1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -d1.menu.exception.enabled=Enabled -d1.menu.exception.enabled.build.exception_flags=-fexceptions -d1.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -d1.menu.stacksmash.disabled=Disabled -d1.menu.stacksmash.disabled.build.stacksmash_flags= -d1.menu.stacksmash.enabled=Enabled -d1.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -d1.menu.ssl.all=All SSL ciphers (most compatible) -d1.menu.ssl.all.build.sslflags= -d1.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -d1.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -d1.upload.resetmethod=--before default_reset --after hard_reset -d1.build.flash_mode=dio -d1.build.flash_flags=-DFLASHMODE_DIO -d1.build.flash_freq=40 -d1.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -d1.menu.eesz.4M2M.build.flash_size=4M -d1.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -d1.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -d1.menu.eesz.4M2M.build.spiffs_pagesize=256 -d1.menu.eesz.4M2M.upload.maximum_size=1044464 -d1.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -d1.menu.eesz.4M2M.build.spiffs_start=0x200000 -d1.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -d1.menu.eesz.4M2M.build.spiffs_blocksize=8192 -d1.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -d1.menu.eesz.4M3M.build.flash_size=4M -d1.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -d1.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -d1.menu.eesz.4M3M.build.spiffs_pagesize=256 -d1.menu.eesz.4M3M.upload.maximum_size=1044464 -d1.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -d1.menu.eesz.4M3M.build.spiffs_start=0x100000 -d1.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -d1.menu.eesz.4M3M.build.spiffs_blocksize=8192 -d1.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -d1.menu.eesz.4M1M.build.flash_size=4M -d1.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -d1.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -d1.menu.eesz.4M1M.build.spiffs_pagesize=256 -d1.menu.eesz.4M1M.upload.maximum_size=1044464 -d1.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -d1.menu.eesz.4M1M.build.spiffs_start=0x300000 -d1.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -d1.menu.eesz.4M1M.build.spiffs_blocksize=8192 -d1.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -d1.menu.eesz.4M.build.flash_size=4M -d1.menu.eesz.4M.build.flash_size_bytes=0x400000 -d1.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -d1.menu.eesz.4M.build.spiffs_pagesize=256 -d1.menu.eesz.4M.upload.maximum_size=1044464 -d1.menu.eesz.4M.build.rfcal_addr=0x3FC000 -d1.menu.ip.lm2f=v2 Lower Memory -d1.menu.ip.lm2f.build.lwip_include=lwip2/include -d1.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -d1.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1.menu.ip.hb2f=v2 Higher Bandwidth -d1.menu.ip.hb2f.build.lwip_include=lwip2/include -d1.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -d1.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -d1.menu.ip.lm2n=v2 Lower Memory (no features) -d1.menu.ip.lm2n.build.lwip_include=lwip2/include -d1.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -d1.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1.menu.ip.hb2n=v2 Higher Bandwidth (no features) -d1.menu.ip.hb2n.build.lwip_include=lwip2/include -d1.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -d1.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -d1.menu.ip.lm6f=v2 IPv6 Lower Memory -d1.menu.ip.lm6f.build.lwip_include=lwip2/include -d1.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -d1.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -d1.menu.ip.hb6f.build.lwip_include=lwip2/include -d1.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -d1.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -d1.menu.dbg.Disabled=Disabled -d1.menu.dbg.Disabled.build.debug_port= -d1.menu.dbg.Serial=Serial -d1.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -d1.menu.dbg.Serial1=Serial1 -d1.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -d1.menu.lvl.None____=None -d1.menu.lvl.None____.build.debug_level= -d1.menu.lvl.SSL=SSL -d1.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -d1.menu.lvl.TLS_MEM=TLS_MEM -d1.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -d1.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -d1.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -d1.menu.lvl.HTTP_SERVER=HTTP_SERVER -d1.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -d1.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -d1.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -d1.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -d1.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -d1.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -d1.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -d1.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -d1.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -d1.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -d1.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -d1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -d1.menu.lvl.CORE=CORE -d1.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -d1.menu.lvl.WIFI=WIFI -d1.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -d1.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -d1.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -d1.menu.lvl.UPDATER=UPDATER -d1.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -d1.menu.lvl.OTA=OTA -d1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -d1.menu.lvl.OOM=OOM -d1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -d1.menu.lvl.MDNS=MDNS -d1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -d1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -d1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -d1.menu.wipe.none=Only Sketch -d1.menu.wipe.none.upload.erase_cmd= -d1.menu.wipe.sdk=Sketch + WiFi Settings -d1.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -d1.menu.wipe.all=All Flash Contents -d1.menu.wipe.all.upload.erase_cmd=erase_flash -d1.menu.baud.921600=921600 -d1.menu.baud.921600.upload.speed=921600 -d1.menu.baud.57600=57600 -d1.menu.baud.57600.upload.speed=57600 -d1.menu.baud.115200=115200 -d1.menu.baud.115200.upload.speed=115200 -d1.menu.baud.230400.linux=230400 -d1.menu.baud.230400.macosx=230400 -d1.menu.baud.230400.upload.speed=230400 -d1.menu.baud.256000.windows=256000 -d1.menu.baud.256000.upload.speed=256000 -d1.menu.baud.460800.linux=460800 -d1.menu.baud.460800.macosx=460800 -d1.menu.baud.460800.upload.speed=460800 -d1.menu.baud.512000.windows=512000 -d1.menu.baud.512000.upload.speed=512000 -d1.menu.baud.3000000=3000000 -d1.menu.baud.3000000.upload.speed=3000000 - -############################################################## -espino.name=ESPino (ESP-12 Module) -espino.build.board=ESP8266_ESP12 -espino.build.variant=espino -espino.upload.tool=esptool -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.core=esp8266 -espino.build.spiffs_pagesize=256 -espino.build.debug_port= -espino.build.debug_level= -espino.menu.xtal.80=80 MHz -espino.menu.xtal.80.build.f_cpu=80000000L -espino.menu.xtal.160=160 MHz -espino.menu.xtal.160.build.f_cpu=160000000L -espino.menu.vt.flash=Flash -espino.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -espino.menu.vt.heap=Heap -espino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -espino.menu.vt.iram=IRAM -espino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espino.menu.exception.disabled=Disabled (new aborts on oom) -espino.menu.exception.disabled.build.exception_flags=-fno-exceptions -espino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -espino.menu.exception.enabled=Enabled -espino.menu.exception.enabled.build.exception_flags=-fexceptions -espino.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -espino.menu.stacksmash.disabled=Disabled -espino.menu.stacksmash.disabled.build.stacksmash_flags= -espino.menu.stacksmash.enabled=Enabled -espino.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -espino.menu.ssl.all=All SSL ciphers (most compatible) -espino.menu.ssl.all.build.sslflags= -espino.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -espino.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -espino.menu.ResetMethod.nodemcu=dtr (aka nodemcu) -espino.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset -espino.menu.ResetMethod.ck=no dtr (aka ck) -espino.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset -espino.build.flash_mode=qio -espino.build.flash_flags=-DFLASHMODE_QIO -espino.build.flash_freq=40 -espino.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -espino.menu.eesz.4M2M.build.flash_size=4M -espino.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -espino.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -espino.menu.eesz.4M2M.build.spiffs_pagesize=256 -espino.menu.eesz.4M2M.upload.maximum_size=1044464 -espino.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -espino.menu.eesz.4M2M.build.spiffs_start=0x200000 -espino.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -espino.menu.eesz.4M2M.build.spiffs_blocksize=8192 -espino.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -espino.menu.eesz.4M3M.build.flash_size=4M -espino.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -espino.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -espino.menu.eesz.4M3M.build.spiffs_pagesize=256 -espino.menu.eesz.4M3M.upload.maximum_size=1044464 -espino.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -espino.menu.eesz.4M3M.build.spiffs_start=0x100000 -espino.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -espino.menu.eesz.4M3M.build.spiffs_blocksize=8192 -espino.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -espino.menu.eesz.4M1M.build.flash_size=4M -espino.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -espino.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -espino.menu.eesz.4M1M.build.spiffs_pagesize=256 -espino.menu.eesz.4M1M.upload.maximum_size=1044464 -espino.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -espino.menu.eesz.4M1M.build.spiffs_start=0x300000 -espino.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -espino.menu.eesz.4M1M.build.spiffs_blocksize=8192 -espino.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -espino.menu.eesz.4M.build.flash_size=4M -espino.menu.eesz.4M.build.flash_size_bytes=0x400000 -espino.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -espino.menu.eesz.4M.build.spiffs_pagesize=256 -espino.menu.eesz.4M.upload.maximum_size=1044464 -espino.menu.eesz.4M.build.rfcal_addr=0x3FC000 -espino.menu.ip.lm2f=v2 Lower Memory -espino.menu.ip.lm2f.build.lwip_include=lwip2/include -espino.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -espino.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espino.menu.ip.hb2f=v2 Higher Bandwidth -espino.menu.ip.hb2f.build.lwip_include=lwip2/include -espino.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -espino.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espino.menu.ip.lm2n=v2 Lower Memory (no features) -espino.menu.ip.lm2n.build.lwip_include=lwip2/include -espino.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -espino.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espino.menu.ip.hb2n=v2 Higher Bandwidth (no features) -espino.menu.ip.hb2n.build.lwip_include=lwip2/include -espino.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -espino.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espino.menu.ip.lm6f=v2 IPv6 Lower Memory -espino.menu.ip.lm6f.build.lwip_include=lwip2/include -espino.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -espino.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espino.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -espino.menu.ip.hb6f.build.lwip_include=lwip2/include -espino.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -espino.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espino.menu.dbg.Disabled=Disabled -espino.menu.dbg.Disabled.build.debug_port= -espino.menu.dbg.Serial=Serial -espino.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -espino.menu.dbg.Serial1=Serial1 -espino.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -espino.menu.lvl.None____=None -espino.menu.lvl.None____.build.debug_level= -espino.menu.lvl.SSL=SSL -espino.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -espino.menu.lvl.TLS_MEM=TLS_MEM -espino.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -espino.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -espino.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -espino.menu.lvl.HTTP_SERVER=HTTP_SERVER -espino.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -espino.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -espino.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -espino.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -espino.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -espino.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -espino.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espino.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -espino.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -espino.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espino.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -espino.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -espino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espino.menu.lvl.CORE=CORE -espino.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -espino.menu.lvl.WIFI=WIFI -espino.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -espino.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -espino.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -espino.menu.lvl.UPDATER=UPDATER -espino.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -espino.menu.lvl.OTA=OTA -espino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -espino.menu.lvl.OOM=OOM -espino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espino.menu.lvl.MDNS=MDNS -espino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -espino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -espino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -espino.menu.wipe.none=Only Sketch -espino.menu.wipe.none.upload.erase_cmd= -espino.menu.wipe.sdk=Sketch + WiFi Settings -espino.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -espino.menu.wipe.all=All Flash Contents -espino.menu.wipe.all.upload.erase_cmd=erase_flash -espino.menu.baud.115200=115200 -espino.menu.baud.115200.upload.speed=115200 -espino.menu.baud.57600=57600 -espino.menu.baud.57600.upload.speed=57600 -espino.menu.baud.230400.linux=230400 -espino.menu.baud.230400.macosx=230400 -espino.menu.baud.230400.upload.speed=230400 -espino.menu.baud.256000.windows=256000 -espino.menu.baud.256000.upload.speed=256000 -espino.menu.baud.460800.linux=460800 -espino.menu.baud.460800.macosx=460800 -espino.menu.baud.460800.upload.speed=460800 -espino.menu.baud.512000.windows=512000 -espino.menu.baud.512000.upload.speed=512000 -espino.menu.baud.921600=921600 -espino.menu.baud.921600.upload.speed=921600 -espino.menu.baud.3000000=3000000 -espino.menu.baud.3000000.upload.speed=3000000 - -############################################################## -espinotee.name=ThaiEasyElec's ESPino -espinotee.build.board=ESP8266_ESP13 -espinotee.build.variant=espinotee -espinotee.upload.tool=esptool -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.core=esp8266 -espinotee.build.spiffs_pagesize=256 -espinotee.build.debug_port= -espinotee.build.debug_level= -espinotee.menu.xtal.80=80 MHz -espinotee.menu.xtal.80.build.f_cpu=80000000L -espinotee.menu.xtal.160=160 MHz -espinotee.menu.xtal.160.build.f_cpu=160000000L -espinotee.menu.vt.flash=Flash -espinotee.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -espinotee.menu.vt.heap=Heap -espinotee.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -espinotee.menu.vt.iram=IRAM -espinotee.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espinotee.menu.exception.disabled=Disabled (new aborts on oom) -espinotee.menu.exception.disabled.build.exception_flags=-fno-exceptions -espinotee.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -espinotee.menu.exception.enabled=Enabled -espinotee.menu.exception.enabled.build.exception_flags=-fexceptions -espinotee.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -espinotee.menu.stacksmash.disabled=Disabled -espinotee.menu.stacksmash.disabled.build.stacksmash_flags= -espinotee.menu.stacksmash.enabled=Enabled -espinotee.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -espinotee.menu.ssl.all=All SSL ciphers (most compatible) -espinotee.menu.ssl.all.build.sslflags= -espinotee.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -espinotee.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -espinotee.upload.resetmethod=--before default_reset --after hard_reset -espinotee.build.flash_mode=qio -espinotee.build.flash_flags=-DFLASHMODE_QIO -espinotee.build.flash_freq=40 -espinotee.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -espinotee.menu.eesz.4M2M.build.flash_size=4M -espinotee.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -espinotee.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -espinotee.menu.eesz.4M2M.build.spiffs_pagesize=256 -espinotee.menu.eesz.4M2M.upload.maximum_size=1044464 -espinotee.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -espinotee.menu.eesz.4M2M.build.spiffs_start=0x200000 -espinotee.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -espinotee.menu.eesz.4M2M.build.spiffs_blocksize=8192 -espinotee.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -espinotee.menu.eesz.4M3M.build.flash_size=4M -espinotee.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -espinotee.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -espinotee.menu.eesz.4M3M.build.spiffs_pagesize=256 -espinotee.menu.eesz.4M3M.upload.maximum_size=1044464 -espinotee.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -espinotee.menu.eesz.4M3M.build.spiffs_start=0x100000 -espinotee.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -espinotee.menu.eesz.4M3M.build.spiffs_blocksize=8192 -espinotee.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -espinotee.menu.eesz.4M1M.build.flash_size=4M -espinotee.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -espinotee.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -espinotee.menu.eesz.4M1M.build.spiffs_pagesize=256 -espinotee.menu.eesz.4M1M.upload.maximum_size=1044464 -espinotee.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -espinotee.menu.eesz.4M1M.build.spiffs_start=0x300000 -espinotee.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -espinotee.menu.eesz.4M1M.build.spiffs_blocksize=8192 -espinotee.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -espinotee.menu.eesz.4M.build.flash_size=4M -espinotee.menu.eesz.4M.build.flash_size_bytes=0x400000 -espinotee.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -espinotee.menu.eesz.4M.build.spiffs_pagesize=256 -espinotee.menu.eesz.4M.upload.maximum_size=1044464 -espinotee.menu.eesz.4M.build.rfcal_addr=0x3FC000 -espinotee.menu.ip.lm2f=v2 Lower Memory -espinotee.menu.ip.lm2f.build.lwip_include=lwip2/include -espinotee.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -espinotee.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espinotee.menu.ip.hb2f=v2 Higher Bandwidth -espinotee.menu.ip.hb2f.build.lwip_include=lwip2/include -espinotee.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -espinotee.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espinotee.menu.ip.lm2n=v2 Lower Memory (no features) -espinotee.menu.ip.lm2n.build.lwip_include=lwip2/include -espinotee.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -espinotee.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espinotee.menu.ip.hb2n=v2 Higher Bandwidth (no features) -espinotee.menu.ip.hb2n.build.lwip_include=lwip2/include -espinotee.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -espinotee.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espinotee.menu.ip.lm6f=v2 IPv6 Lower Memory -espinotee.menu.ip.lm6f.build.lwip_include=lwip2/include -espinotee.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -espinotee.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espinotee.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -espinotee.menu.ip.hb6f.build.lwip_include=lwip2/include -espinotee.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -espinotee.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espinotee.menu.dbg.Disabled=Disabled -espinotee.menu.dbg.Disabled.build.debug_port= -espinotee.menu.dbg.Serial=Serial -espinotee.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -espinotee.menu.dbg.Serial1=Serial1 -espinotee.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -espinotee.menu.lvl.None____=None -espinotee.menu.lvl.None____.build.debug_level= -espinotee.menu.lvl.SSL=SSL -espinotee.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -espinotee.menu.lvl.TLS_MEM=TLS_MEM -espinotee.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -espinotee.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -espinotee.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -espinotee.menu.lvl.HTTP_SERVER=HTTP_SERVER -espinotee.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -espinotee.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -espinotee.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -espinotee.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -espinotee.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -espinotee.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -espinotee.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espinotee.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -espinotee.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -espinotee.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espinotee.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -espinotee.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -espinotee.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espinotee.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espinotee.menu.lvl.CORE=CORE -espinotee.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -espinotee.menu.lvl.WIFI=WIFI -espinotee.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -espinotee.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -espinotee.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -espinotee.menu.lvl.UPDATER=UPDATER -espinotee.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -espinotee.menu.lvl.OTA=OTA -espinotee.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -espinotee.menu.lvl.OOM=OOM -espinotee.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espinotee.menu.lvl.MDNS=MDNS -espinotee.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -espinotee.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -espinotee.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -espinotee.menu.wipe.none=Only Sketch -espinotee.menu.wipe.none.upload.erase_cmd= -espinotee.menu.wipe.sdk=Sketch + WiFi Settings -espinotee.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -espinotee.menu.wipe.all=All Flash Contents -espinotee.menu.wipe.all.upload.erase_cmd=erase_flash -espinotee.menu.baud.115200=115200 -espinotee.menu.baud.115200.upload.speed=115200 -espinotee.menu.baud.57600=57600 -espinotee.menu.baud.57600.upload.speed=57600 -espinotee.menu.baud.230400.linux=230400 -espinotee.menu.baud.230400.macosx=230400 -espinotee.menu.baud.230400.upload.speed=230400 -espinotee.menu.baud.256000.windows=256000 -espinotee.menu.baud.256000.upload.speed=256000 -espinotee.menu.baud.460800.linux=460800 -espinotee.menu.baud.460800.macosx=460800 -espinotee.menu.baud.460800.upload.speed=460800 -espinotee.menu.baud.512000.windows=512000 -espinotee.menu.baud.512000.upload.speed=512000 -espinotee.menu.baud.921600=921600 -espinotee.menu.baud.921600.upload.speed=921600 -espinotee.menu.baud.3000000=3000000 -espinotee.menu.baud.3000000.upload.speed=3000000 - -############################################################## -wifinfo.name=WifInfo -wifinfo.build.board=WIFINFO -wifinfo.build.variant=wifinfo -wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K FS) -wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07 -wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld -wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M -wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096 -wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000 -wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000 -wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376 -wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M FS) -wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12 -wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld -wifinfo.menu.ESPModule.ESP12.build.flash_size=4M -wifinfo.menu.ESPModule.ESP12.build.spiffs_blocksize=8192 -wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000 -wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256 -wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000 -wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464 -wifinfo.upload.tool=esptool -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.spiffs_pagesize=256 -wifinfo.build.debug_port= -wifinfo.build.debug_level= -wifinfo.menu.xtal.80=80 MHz -wifinfo.menu.xtal.80.build.f_cpu=80000000L -wifinfo.menu.xtal.160=160 MHz -wifinfo.menu.xtal.160.build.f_cpu=160000000L -wifinfo.menu.vt.flash=Flash -wifinfo.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -wifinfo.menu.vt.heap=Heap -wifinfo.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -wifinfo.menu.vt.iram=IRAM -wifinfo.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifinfo.menu.exception.disabled=Disabled (new aborts on oom) -wifinfo.menu.exception.disabled.build.exception_flags=-fno-exceptions -wifinfo.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -wifinfo.menu.exception.enabled=Enabled -wifinfo.menu.exception.enabled.build.exception_flags=-fexceptions -wifinfo.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -wifinfo.menu.stacksmash.disabled=Disabled -wifinfo.menu.stacksmash.disabled.build.stacksmash_flags= -wifinfo.menu.stacksmash.enabled=Enabled -wifinfo.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -wifinfo.menu.ssl.all=All SSL ciphers (most compatible) -wifinfo.menu.ssl.all.build.sslflags= -wifinfo.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -wifinfo.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -wifinfo.upload.resetmethod=--before default_reset --after hard_reset -wifinfo.build.flash_mode=qio -wifinfo.build.flash_flags=-DFLASHMODE_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.FlashFreq.20=20MHz -wifinfo.menu.FlashFreq.20.build.flash_freq=20 -wifinfo.menu.FlashFreq.26=26MHz -wifinfo.menu.FlashFreq.26.build.flash_freq=26 -wifinfo.menu.eesz.1M64=1MB (FS:64KB OTA:~470KB) -wifinfo.menu.eesz.1M64.build.flash_size=1M -wifinfo.menu.eesz.1M64.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M64.build.flash_ld=eagle.flash.1m64.ld -wifinfo.menu.eesz.1M64.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M64.upload.maximum_size=958448 -wifinfo.menu.eesz.1M64.build.rfcal_addr=0xFC000 -wifinfo.menu.eesz.1M64.build.spiffs_start=0xEB000 -wifinfo.menu.eesz.1M64.build.spiffs_end=0xFB000 -wifinfo.menu.eesz.1M64.build.spiffs_blocksize=4096 -wifinfo.menu.eesz.1M128=1MB (FS:128KB OTA:~438KB) -wifinfo.menu.eesz.1M128.build.flash_size=1M -wifinfo.menu.eesz.1M128.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M128.build.flash_ld=eagle.flash.1m128.ld -wifinfo.menu.eesz.1M128.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M128.upload.maximum_size=892912 -wifinfo.menu.eesz.1M128.build.rfcal_addr=0xFC000 -wifinfo.menu.eesz.1M128.build.spiffs_start=0xDB000 -wifinfo.menu.eesz.1M128.build.spiffs_end=0xFB000 -wifinfo.menu.eesz.1M128.build.spiffs_blocksize=4096 -wifinfo.menu.eesz.1M144=1MB (FS:144KB OTA:~430KB) -wifinfo.menu.eesz.1M144.build.flash_size=1M -wifinfo.menu.eesz.1M144.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M144.build.flash_ld=eagle.flash.1m144.ld -wifinfo.menu.eesz.1M144.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M144.upload.maximum_size=876528 -wifinfo.menu.eesz.1M144.build.rfcal_addr=0xFC000 -wifinfo.menu.eesz.1M144.build.spiffs_start=0xD7000 -wifinfo.menu.eesz.1M144.build.spiffs_end=0xFB000 -wifinfo.menu.eesz.1M144.build.spiffs_blocksize=4096 -wifinfo.menu.eesz.1M160=1MB (FS:160KB OTA:~422KB) -wifinfo.menu.eesz.1M160.build.flash_size=1M -wifinfo.menu.eesz.1M160.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M160.build.flash_ld=eagle.flash.1m160.ld -wifinfo.menu.eesz.1M160.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M160.upload.maximum_size=860144 -wifinfo.menu.eesz.1M160.build.rfcal_addr=0xFC000 -wifinfo.menu.eesz.1M160.build.spiffs_start=0xD3000 -wifinfo.menu.eesz.1M160.build.spiffs_end=0xFB000 -wifinfo.menu.eesz.1M160.build.spiffs_blocksize=4096 -wifinfo.menu.eesz.1M192=1MB (FS:192KB OTA:~406KB) -wifinfo.menu.eesz.1M192.build.flash_size=1M -wifinfo.menu.eesz.1M192.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M192.build.flash_ld=eagle.flash.1m192.ld -wifinfo.menu.eesz.1M192.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M192.upload.maximum_size=827376 -wifinfo.menu.eesz.1M192.build.rfcal_addr=0xFC000 -wifinfo.menu.eesz.1M192.build.spiffs_start=0xCB000 -wifinfo.menu.eesz.1M192.build.spiffs_end=0xFB000 -wifinfo.menu.eesz.1M192.build.spiffs_blocksize=4096 -wifinfo.menu.eesz.1M256=1MB (FS:256KB OTA:~374KB) -wifinfo.menu.eesz.1M256.build.flash_size=1M -wifinfo.menu.eesz.1M256.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M256.build.flash_ld=eagle.flash.1m256.ld -wifinfo.menu.eesz.1M256.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M256.upload.maximum_size=761840 -wifinfo.menu.eesz.1M256.build.rfcal_addr=0xFC000 -wifinfo.menu.eesz.1M256.build.spiffs_start=0xBB000 -wifinfo.menu.eesz.1M256.build.spiffs_end=0xFB000 -wifinfo.menu.eesz.1M256.build.spiffs_blocksize=4096 -wifinfo.menu.eesz.1M512=1MB (FS:512KB OTA:~246KB) -wifinfo.menu.eesz.1M512.build.flash_size=1M -wifinfo.menu.eesz.1M512.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M512.build.flash_ld=eagle.flash.1m512.ld -wifinfo.menu.eesz.1M512.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M512.upload.maximum_size=499696 -wifinfo.menu.eesz.1M512.build.rfcal_addr=0xFC000 -wifinfo.menu.eesz.1M512.build.spiffs_start=0x7B000 -wifinfo.menu.eesz.1M512.build.spiffs_end=0xFB000 -wifinfo.menu.eesz.1M512.build.spiffs_blocksize=8192 -wifinfo.menu.eesz.1M=1MB (FS:none OTA:~502KB) -wifinfo.menu.eesz.1M.build.flash_size=1M -wifinfo.menu.eesz.1M.build.flash_size_bytes=0x100000 -wifinfo.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld -wifinfo.menu.eesz.1M.build.spiffs_pagesize=256 -wifinfo.menu.eesz.1M.upload.maximum_size=1023984 -wifinfo.menu.eesz.1M.build.rfcal_addr=0xFC000 -wifinfo.menu.ip.lm2f=v2 Lower Memory -wifinfo.menu.ip.lm2f.build.lwip_include=lwip2/include -wifinfo.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -wifinfo.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -wifinfo.menu.ip.hb2f=v2 Higher Bandwidth -wifinfo.menu.ip.hb2f.build.lwip_include=lwip2/include -wifinfo.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -wifinfo.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -wifinfo.menu.ip.lm2n=v2 Lower Memory (no features) -wifinfo.menu.ip.lm2n.build.lwip_include=lwip2/include -wifinfo.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -wifinfo.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -wifinfo.menu.ip.hb2n=v2 Higher Bandwidth (no features) -wifinfo.menu.ip.hb2n.build.lwip_include=lwip2/include -wifinfo.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -wifinfo.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -wifinfo.menu.ip.lm6f=v2 IPv6 Lower Memory -wifinfo.menu.ip.lm6f.build.lwip_include=lwip2/include -wifinfo.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -wifinfo.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -wifinfo.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -wifinfo.menu.ip.hb6f.build.lwip_include=lwip2/include -wifinfo.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -wifinfo.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -wifinfo.menu.dbg.Disabled=Disabled -wifinfo.menu.dbg.Disabled.build.debug_port= -wifinfo.menu.dbg.Serial=Serial -wifinfo.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -wifinfo.menu.dbg.Serial1=Serial1 -wifinfo.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -wifinfo.menu.lvl.None____=None -wifinfo.menu.lvl.None____.build.debug_level= -wifinfo.menu.lvl.SSL=SSL -wifinfo.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -wifinfo.menu.lvl.TLS_MEM=TLS_MEM -wifinfo.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -wifinfo.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -wifinfo.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -wifinfo.menu.lvl.HTTP_SERVER=HTTP_SERVER -wifinfo.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -wifinfo.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -wifinfo.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -wifinfo.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -wifinfo.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -wifinfo.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -wifinfo.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -wifinfo.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -wifinfo.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -wifinfo.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -wifinfo.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -wifinfo.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -wifinfo.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -wifinfo.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifinfo.menu.lvl.CORE=CORE -wifinfo.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -wifinfo.menu.lvl.WIFI=WIFI -wifinfo.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -wifinfo.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -wifinfo.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -wifinfo.menu.lvl.UPDATER=UPDATER -wifinfo.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -wifinfo.menu.lvl.OTA=OTA -wifinfo.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -wifinfo.menu.lvl.OOM=OOM -wifinfo.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -wifinfo.menu.lvl.MDNS=MDNS -wifinfo.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -wifinfo.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -wifinfo.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -wifinfo.menu.wipe.none=Only Sketch -wifinfo.menu.wipe.none.upload.erase_cmd= -wifinfo.menu.wipe.sdk=Sketch + WiFi Settings -wifinfo.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -wifinfo.menu.wipe.all=All Flash Contents -wifinfo.menu.wipe.all.upload.erase_cmd=erase_flash -wifinfo.menu.baud.115200=115200 -wifinfo.menu.baud.115200.upload.speed=115200 -wifinfo.menu.baud.57600=57600 -wifinfo.menu.baud.57600.upload.speed=57600 -wifinfo.menu.baud.230400.linux=230400 -wifinfo.menu.baud.230400.macosx=230400 -wifinfo.menu.baud.230400.upload.speed=230400 -wifinfo.menu.baud.256000.windows=256000 -wifinfo.menu.baud.256000.upload.speed=256000 -wifinfo.menu.baud.460800.linux=460800 -wifinfo.menu.baud.460800.macosx=460800 -wifinfo.menu.baud.460800.upload.speed=460800 -wifinfo.menu.baud.512000.windows=512000 -wifinfo.menu.baud.512000.upload.speed=512000 -wifinfo.menu.baud.921600=921600 -wifinfo.menu.baud.921600.upload.speed=921600 -wifinfo.menu.baud.3000000=3000000 -wifinfo.menu.baud.3000000.upload.speed=3000000 - -############################################################## -arduino-esp8266.name=Arduino -arduino-esp8266.build.board=ESP8266_ARDUINO -arduino-esp8266.menu.BoardModel.primo=Primo -arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO -arduino-esp8266.menu.BoardModel.primo.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 -arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi -arduino-esp8266.menu.BoardModel.starottodeved=Star OTTO -arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO -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=Uno WiFi -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.unowifideved.build.variant=arduino_uart -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.xtal.80=80 MHz -arduino-esp8266.menu.xtal.80.build.f_cpu=80000000L -arduino-esp8266.menu.xtal.160=160 MHz -arduino-esp8266.menu.xtal.160.build.f_cpu=160000000L -arduino-esp8266.menu.vt.flash=Flash -arduino-esp8266.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -arduino-esp8266.menu.vt.heap=Heap -arduino-esp8266.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -arduino-esp8266.menu.vt.iram=IRAM -arduino-esp8266.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -arduino-esp8266.menu.exception.disabled=Disabled (new aborts on oom) -arduino-esp8266.menu.exception.disabled.build.exception_flags=-fno-exceptions -arduino-esp8266.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -arduino-esp8266.menu.exception.enabled=Enabled -arduino-esp8266.menu.exception.enabled.build.exception_flags=-fexceptions -arduino-esp8266.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -arduino-esp8266.menu.stacksmash.disabled=Disabled -arduino-esp8266.menu.stacksmash.disabled.build.stacksmash_flags= -arduino-esp8266.menu.stacksmash.enabled=Enabled -arduino-esp8266.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -arduino-esp8266.menu.ssl.all=All SSL ciphers (most compatible) -arduino-esp8266.menu.ssl.all.build.sslflags= -arduino-esp8266.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -arduino-esp8266.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -arduino-esp8266.upload.resetmethod=--before no_reset --after soft_reset -arduino-esp8266.build.flash_mode=qio -arduino-esp8266.build.flash_flags=-DFLASHMODE_QIO -arduino-esp8266.build.flash_freq=40 -arduino-esp8266.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -arduino-esp8266.menu.eesz.4M2M.build.flash_size=4M -arduino-esp8266.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -arduino-esp8266.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -arduino-esp8266.menu.eesz.4M2M.build.spiffs_pagesize=256 -arduino-esp8266.menu.eesz.4M2M.upload.maximum_size=1044464 -arduino-esp8266.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -arduino-esp8266.menu.eesz.4M2M.build.spiffs_start=0x200000 -arduino-esp8266.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -arduino-esp8266.menu.eesz.4M2M.build.spiffs_blocksize=8192 -arduino-esp8266.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -arduino-esp8266.menu.eesz.4M3M.build.flash_size=4M -arduino-esp8266.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -arduino-esp8266.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -arduino-esp8266.menu.eesz.4M3M.build.spiffs_pagesize=256 -arduino-esp8266.menu.eesz.4M3M.upload.maximum_size=1044464 -arduino-esp8266.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -arduino-esp8266.menu.eesz.4M3M.build.spiffs_start=0x100000 -arduino-esp8266.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -arduino-esp8266.menu.eesz.4M3M.build.spiffs_blocksize=8192 -arduino-esp8266.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -arduino-esp8266.menu.eesz.4M1M.build.flash_size=4M -arduino-esp8266.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -arduino-esp8266.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -arduino-esp8266.menu.eesz.4M1M.build.spiffs_pagesize=256 -arduino-esp8266.menu.eesz.4M1M.upload.maximum_size=1044464 -arduino-esp8266.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -arduino-esp8266.menu.eesz.4M1M.build.spiffs_start=0x300000 -arduino-esp8266.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -arduino-esp8266.menu.eesz.4M1M.build.spiffs_blocksize=8192 -arduino-esp8266.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -arduino-esp8266.menu.eesz.4M.build.flash_size=4M -arduino-esp8266.menu.eesz.4M.build.flash_size_bytes=0x400000 -arduino-esp8266.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -arduino-esp8266.menu.eesz.4M.build.spiffs_pagesize=256 -arduino-esp8266.menu.eesz.4M.upload.maximum_size=1044464 -arduino-esp8266.menu.eesz.4M.build.rfcal_addr=0x3FC000 -arduino-esp8266.menu.ip.lm2f=v2 Lower Memory -arduino-esp8266.menu.ip.lm2f.build.lwip_include=lwip2/include -arduino-esp8266.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -arduino-esp8266.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -arduino-esp8266.menu.ip.hb2f=v2 Higher Bandwidth -arduino-esp8266.menu.ip.hb2f.build.lwip_include=lwip2/include -arduino-esp8266.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -arduino-esp8266.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -arduino-esp8266.menu.ip.lm2n=v2 Lower Memory (no features) -arduino-esp8266.menu.ip.lm2n.build.lwip_include=lwip2/include -arduino-esp8266.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -arduino-esp8266.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -arduino-esp8266.menu.ip.hb2n=v2 Higher Bandwidth (no features) -arduino-esp8266.menu.ip.hb2n.build.lwip_include=lwip2/include -arduino-esp8266.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -arduino-esp8266.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -arduino-esp8266.menu.ip.lm6f=v2 IPv6 Lower Memory -arduino-esp8266.menu.ip.lm6f.build.lwip_include=lwip2/include -arduino-esp8266.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -arduino-esp8266.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -arduino-esp8266.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -arduino-esp8266.menu.ip.hb6f.build.lwip_include=lwip2/include -arduino-esp8266.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -arduino-esp8266.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -arduino-esp8266.menu.dbg.Disabled=Disabled -arduino-esp8266.menu.dbg.Disabled.build.debug_port= -arduino-esp8266.menu.dbg.Serial=Serial -arduino-esp8266.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -arduino-esp8266.menu.dbg.Serial1=Serial1 -arduino-esp8266.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -arduino-esp8266.menu.lvl.None____=None -arduino-esp8266.menu.lvl.None____.build.debug_level= -arduino-esp8266.menu.lvl.SSL=SSL -arduino-esp8266.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -arduino-esp8266.menu.lvl.TLS_MEM=TLS_MEM -arduino-esp8266.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -arduino-esp8266.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -arduino-esp8266.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -arduino-esp8266.menu.lvl.HTTP_SERVER=HTTP_SERVER -arduino-esp8266.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -arduino-esp8266.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -arduino-esp8266.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -arduino-esp8266.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -arduino-esp8266.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -arduino-esp8266.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -arduino-esp8266.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -arduino-esp8266.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -arduino-esp8266.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -arduino-esp8266.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -arduino-esp8266.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -arduino-esp8266.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -arduino-esp8266.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -arduino-esp8266.menu.lvl.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.lvl.CORE=CORE -arduino-esp8266.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -arduino-esp8266.menu.lvl.WIFI=WIFI -arduino-esp8266.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -arduino-esp8266.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -arduino-esp8266.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -arduino-esp8266.menu.lvl.UPDATER=UPDATER -arduino-esp8266.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -arduino-esp8266.menu.lvl.OTA=OTA -arduino-esp8266.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -arduino-esp8266.menu.lvl.OOM=OOM -arduino-esp8266.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -arduino-esp8266.menu.lvl.MDNS=MDNS -arduino-esp8266.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -arduino-esp8266.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -arduino-esp8266.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -arduino-esp8266.menu.wipe.none=Only Sketch -arduino-esp8266.menu.wipe.none.upload.erase_cmd= -arduino-esp8266.menu.wipe.sdk=Sketch + WiFi Settings -arduino-esp8266.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -arduino-esp8266.menu.wipe.all=All Flash Contents -arduino-esp8266.menu.wipe.all.upload.erase_cmd=erase_flash -arduino-esp8266.menu.baud.115200=115200 -arduino-esp8266.menu.baud.115200.upload.speed=115200 -arduino-esp8266.menu.baud.57600=57600 -arduino-esp8266.menu.baud.57600.upload.speed=57600 -arduino-esp8266.menu.baud.230400.linux=230400 -arduino-esp8266.menu.baud.230400.macosx=230400 -arduino-esp8266.menu.baud.230400.upload.speed=230400 -arduino-esp8266.menu.baud.256000.windows=256000 -arduino-esp8266.menu.baud.256000.upload.speed=256000 -arduino-esp8266.menu.baud.460800.linux=460800 -arduino-esp8266.menu.baud.460800.macosx=460800 -arduino-esp8266.menu.baud.460800.upload.speed=460800 -arduino-esp8266.menu.baud.512000.windows=512000 -arduino-esp8266.menu.baud.512000.upload.speed=512000 -arduino-esp8266.menu.baud.921600=921600 -arduino-esp8266.menu.baud.921600.upload.speed=921600 -arduino-esp8266.menu.baud.3000000=3000000 -arduino-esp8266.menu.baud.3000000.upload.speed=3000000 - ############################################################## gen4iod.name=4D Systems gen4 IoD Range gen4iod.build.board=GEN4_IOD @@ -5321,6 +897,18 @@ gen4iod.menu.ssl.all=All SSL ciphers (most compatible) gen4iod.menu.ssl.all.build.sslflags= gen4iod.menu.ssl.basic=Basic SSL ciphers (lower ROM use) gen4iod.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +gen4iod.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +gen4iod.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +gen4iod.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +gen4iod.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +gen4iod.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +gen4iod.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +gen4iod.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +gen4iod.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +gen4iod.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +gen4iod.menu.non32xfer.fast.build.non32xferflags= +gen4iod.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +gen4iod.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER gen4iod.upload.resetmethod=--before default_reset --after hard_reset gen4iod.menu.FlashMode.dout=DOUT (compatible) gen4iod.menu.FlashMode.dout.build.flash_mode=dout @@ -5537,379 +1125,203 @@ gen4iod.menu.baud.3000000=3000000 gen4iod.menu.baud.3000000.upload.speed=3000000 ############################################################## -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.xtal.80=80 MHz -oak.menu.xtal.80.build.f_cpu=80000000L -oak.menu.xtal.160=160 MHz -oak.menu.xtal.160.build.f_cpu=160000000L -oak.menu.vt.flash=Flash -oak.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -oak.menu.vt.heap=Heap -oak.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -oak.menu.vt.iram=IRAM -oak.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -oak.menu.exception.disabled=Disabled (new aborts on oom) -oak.menu.exception.disabled.build.exception_flags=-fno-exceptions -oak.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -oak.menu.exception.enabled=Enabled -oak.menu.exception.enabled.build.exception_flags=-fexceptions -oak.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -oak.menu.stacksmash.disabled=Disabled -oak.menu.stacksmash.disabled.build.stacksmash_flags= -oak.menu.stacksmash.enabled=Enabled -oak.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -oak.menu.ssl.all=All SSL ciphers (most compatible) -oak.menu.ssl.all.build.sslflags= -oak.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -oak.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -oak.upload.resetmethod=--before no_reset --after soft_reset -oak.build.flash_mode=dio -oak.build.flash_flags=-DFLASHMODE_DIO -oak.build.flash_freq=40 -oak.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -oak.menu.eesz.4M2M.build.flash_size=4M -oak.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -oak.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -oak.menu.eesz.4M2M.build.spiffs_pagesize=256 -oak.menu.eesz.4M2M.upload.maximum_size=1044464 -oak.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -oak.menu.eesz.4M2M.build.spiffs_start=0x200000 -oak.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -oak.menu.eesz.4M2M.build.spiffs_blocksize=8192 -oak.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -oak.menu.eesz.4M3M.build.flash_size=4M -oak.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -oak.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -oak.menu.eesz.4M3M.build.spiffs_pagesize=256 -oak.menu.eesz.4M3M.upload.maximum_size=1044464 -oak.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -oak.menu.eesz.4M3M.build.spiffs_start=0x100000 -oak.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -oak.menu.eesz.4M3M.build.spiffs_blocksize=8192 -oak.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -oak.menu.eesz.4M1M.build.flash_size=4M -oak.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -oak.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -oak.menu.eesz.4M1M.build.spiffs_pagesize=256 -oak.menu.eesz.4M1M.upload.maximum_size=1044464 -oak.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -oak.menu.eesz.4M1M.build.spiffs_start=0x300000 -oak.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -oak.menu.eesz.4M1M.build.spiffs_blocksize=8192 -oak.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -oak.menu.eesz.4M.build.flash_size=4M -oak.menu.eesz.4M.build.flash_size_bytes=0x400000 -oak.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -oak.menu.eesz.4M.build.spiffs_pagesize=256 -oak.menu.eesz.4M.upload.maximum_size=1044464 -oak.menu.eesz.4M.build.rfcal_addr=0x3FC000 -oak.menu.ip.lm2f=v2 Lower Memory -oak.menu.ip.lm2f.build.lwip_include=lwip2/include -oak.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -oak.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -oak.menu.ip.hb2f=v2 Higher Bandwidth -oak.menu.ip.hb2f.build.lwip_include=lwip2/include -oak.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -oak.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -oak.menu.ip.lm2n=v2 Lower Memory (no features) -oak.menu.ip.lm2n.build.lwip_include=lwip2/include -oak.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -oak.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -oak.menu.ip.hb2n=v2 Higher Bandwidth (no features) -oak.menu.ip.hb2n.build.lwip_include=lwip2/include -oak.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -oak.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -oak.menu.ip.lm6f=v2 IPv6 Lower Memory -oak.menu.ip.lm6f.build.lwip_include=lwip2/include -oak.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -oak.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -oak.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -oak.menu.ip.hb6f.build.lwip_include=lwip2/include -oak.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -oak.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -oak.menu.dbg.Disabled=Disabled -oak.menu.dbg.Disabled.build.debug_port= -oak.menu.dbg.Serial=Serial -oak.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -oak.menu.dbg.Serial1=Serial1 -oak.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -oak.menu.lvl.None____=None -oak.menu.lvl.None____.build.debug_level= -oak.menu.lvl.SSL=SSL -oak.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -oak.menu.lvl.TLS_MEM=TLS_MEM -oak.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -oak.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -oak.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -oak.menu.lvl.HTTP_SERVER=HTTP_SERVER -oak.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -oak.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -oak.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -oak.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -oak.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -oak.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -oak.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -oak.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -oak.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -oak.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -oak.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -oak.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -oak.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -oak.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -oak.menu.lvl.CORE=CORE -oak.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -oak.menu.lvl.WIFI=WIFI -oak.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -oak.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -oak.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -oak.menu.lvl.UPDATER=UPDATER -oak.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -oak.menu.lvl.OTA=OTA -oak.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -oak.menu.lvl.OOM=OOM -oak.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -oak.menu.lvl.MDNS=MDNS -oak.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -oak.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -oak.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -oak.menu.wipe.none=Only Sketch -oak.menu.wipe.none.upload.erase_cmd= -oak.menu.wipe.sdk=Sketch + WiFi Settings -oak.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -oak.menu.wipe.all=All Flash Contents -oak.menu.wipe.all.upload.erase_cmd=erase_flash -oak.menu.baud.921600=921600 -oak.menu.baud.921600.upload.speed=921600 -oak.menu.baud.57600=57600 -oak.menu.baud.57600.upload.speed=57600 -oak.menu.baud.115200=115200 -oak.menu.baud.115200.upload.speed=115200 -oak.menu.baud.230400.linux=230400 -oak.menu.baud.230400.macosx=230400 -oak.menu.baud.230400.upload.speed=230400 -oak.menu.baud.256000.windows=256000 -oak.menu.baud.256000.upload.speed=256000 -oak.menu.baud.460800.linux=460800 -oak.menu.baud.460800.macosx=460800 -oak.menu.baud.460800.upload.speed=460800 -oak.menu.baud.512000.windows=512000 -oak.menu.baud.512000.upload.speed=512000 -oak.menu.baud.3000000=3000000 -oak.menu.baud.3000000.upload.speed=3000000 - -############################################################## -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.xtal.80=80 MHz -wifiduino.menu.xtal.80.build.f_cpu=80000000L -wifiduino.menu.xtal.160=160 MHz -wifiduino.menu.xtal.160.build.f_cpu=160000000L -wifiduino.menu.vt.flash=Flash -wifiduino.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -wifiduino.menu.vt.heap=Heap -wifiduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -wifiduino.menu.vt.iram=IRAM -wifiduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wifiduino.menu.exception.disabled=Disabled (new aborts on oom) -wifiduino.menu.exception.disabled.build.exception_flags=-fno-exceptions -wifiduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -wifiduino.menu.exception.enabled=Enabled -wifiduino.menu.exception.enabled.build.exception_flags=-fexceptions -wifiduino.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -wifiduino.menu.stacksmash.disabled=Disabled -wifiduino.menu.stacksmash.disabled.build.stacksmash_flags= -wifiduino.menu.stacksmash.enabled=Enabled -wifiduino.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -wifiduino.menu.ssl.all=All SSL ciphers (most compatible) -wifiduino.menu.ssl.all.build.sslflags= -wifiduino.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -wifiduino.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -wifiduino.upload.resetmethod=--before default_reset --after hard_reset -wifiduino.build.flash_mode=dio -wifiduino.build.flash_flags=-DFLASHMODE_DIO -wifiduino.build.flash_freq=40 -wifiduino.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -wifiduino.menu.eesz.4M2M.build.flash_size=4M -wifiduino.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -wifiduino.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -wifiduino.menu.eesz.4M2M.build.spiffs_pagesize=256 -wifiduino.menu.eesz.4M2M.upload.maximum_size=1044464 -wifiduino.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -wifiduino.menu.eesz.4M2M.build.spiffs_start=0x200000 -wifiduino.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -wifiduino.menu.eesz.4M2M.build.spiffs_blocksize=8192 -wifiduino.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -wifiduino.menu.eesz.4M3M.build.flash_size=4M -wifiduino.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -wifiduino.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -wifiduino.menu.eesz.4M3M.build.spiffs_pagesize=256 -wifiduino.menu.eesz.4M3M.upload.maximum_size=1044464 -wifiduino.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -wifiduino.menu.eesz.4M3M.build.spiffs_start=0x100000 -wifiduino.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -wifiduino.menu.eesz.4M3M.build.spiffs_blocksize=8192 -wifiduino.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -wifiduino.menu.eesz.4M1M.build.flash_size=4M -wifiduino.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -wifiduino.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -wifiduino.menu.eesz.4M1M.build.spiffs_pagesize=256 -wifiduino.menu.eesz.4M1M.upload.maximum_size=1044464 -wifiduino.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -wifiduino.menu.eesz.4M1M.build.spiffs_start=0x300000 -wifiduino.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -wifiduino.menu.eesz.4M1M.build.spiffs_blocksize=8192 -wifiduino.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -wifiduino.menu.eesz.4M.build.flash_size=4M -wifiduino.menu.eesz.4M.build.flash_size_bytes=0x400000 -wifiduino.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -wifiduino.menu.eesz.4M.build.spiffs_pagesize=256 -wifiduino.menu.eesz.4M.upload.maximum_size=1044464 -wifiduino.menu.eesz.4M.build.rfcal_addr=0x3FC000 -wifiduino.menu.ip.lm2f=v2 Lower Memory -wifiduino.menu.ip.lm2f.build.lwip_include=lwip2/include -wifiduino.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -wifiduino.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -wifiduino.menu.ip.hb2f=v2 Higher Bandwidth -wifiduino.menu.ip.hb2f.build.lwip_include=lwip2/include -wifiduino.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -wifiduino.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -wifiduino.menu.ip.lm2n=v2 Lower Memory (no features) -wifiduino.menu.ip.lm2n.build.lwip_include=lwip2/include -wifiduino.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -wifiduino.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -wifiduino.menu.ip.hb2n=v2 Higher Bandwidth (no features) -wifiduino.menu.ip.hb2n.build.lwip_include=lwip2/include -wifiduino.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -wifiduino.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -wifiduino.menu.ip.lm6f=v2 IPv6 Lower Memory -wifiduino.menu.ip.lm6f.build.lwip_include=lwip2/include -wifiduino.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -wifiduino.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -wifiduino.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -wifiduino.menu.ip.hb6f.build.lwip_include=lwip2/include -wifiduino.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -wifiduino.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -wifiduino.menu.dbg.Disabled=Disabled -wifiduino.menu.dbg.Disabled.build.debug_port= -wifiduino.menu.dbg.Serial=Serial -wifiduino.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -wifiduino.menu.dbg.Serial1=Serial1 -wifiduino.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -wifiduino.menu.lvl.None____=None -wifiduino.menu.lvl.None____.build.debug_level= -wifiduino.menu.lvl.SSL=SSL -wifiduino.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -wifiduino.menu.lvl.TLS_MEM=TLS_MEM -wifiduino.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -wifiduino.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -wifiduino.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -wifiduino.menu.lvl.HTTP_SERVER=HTTP_SERVER -wifiduino.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -wifiduino.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -wifiduino.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -wifiduino.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -wifiduino.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -wifiduino.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -wifiduino.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -wifiduino.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -wifiduino.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -wifiduino.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -wifiduino.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -wifiduino.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -wifiduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -wifiduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wifiduino.menu.lvl.CORE=CORE -wifiduino.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -wifiduino.menu.lvl.WIFI=WIFI -wifiduino.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -wifiduino.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -wifiduino.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -wifiduino.menu.lvl.UPDATER=UPDATER -wifiduino.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -wifiduino.menu.lvl.OTA=OTA -wifiduino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -wifiduino.menu.lvl.OOM=OOM -wifiduino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -wifiduino.menu.lvl.MDNS=MDNS -wifiduino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -wifiduino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -wifiduino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -wifiduino.menu.wipe.none=Only Sketch -wifiduino.menu.wipe.none.upload.erase_cmd= -wifiduino.menu.wipe.sdk=Sketch + WiFi Settings -wifiduino.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -wifiduino.menu.wipe.all=All Flash Contents -wifiduino.menu.wipe.all.upload.erase_cmd=erase_flash -wifiduino.menu.baud.921600=921600 -wifiduino.menu.baud.921600.upload.speed=921600 -wifiduino.menu.baud.57600=57600 -wifiduino.menu.baud.57600.upload.speed=57600 -wifiduino.menu.baud.115200=115200 -wifiduino.menu.baud.115200.upload.speed=115200 -wifiduino.menu.baud.230400.linux=230400 -wifiduino.menu.baud.230400.macosx=230400 -wifiduino.menu.baud.230400.upload.speed=230400 -wifiduino.menu.baud.256000.windows=256000 -wifiduino.menu.baud.256000.upload.speed=256000 -wifiduino.menu.baud.460800.linux=460800 -wifiduino.menu.baud.460800.macosx=460800 -wifiduino.menu.baud.460800.upload.speed=460800 -wifiduino.menu.baud.512000.windows=512000 -wifiduino.menu.baud.512000.upload.speed=512000 -wifiduino.menu.baud.3000000=3000000 -wifiduino.menu.baud.3000000.upload.speed=3000000 +huzzah.name=Adafruit Feather HUZZAH ESP8266 +huzzah.build.board=ESP8266_ESP12 +huzzah.build.variant=adafruit +huzzah.upload.tool=esptool +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.core=esp8266 +huzzah.build.spiffs_pagesize=256 +huzzah.build.debug_port= +huzzah.build.debug_level= +huzzah.menu.xtal.80=80 MHz +huzzah.menu.xtal.80.build.f_cpu=80000000L +huzzah.menu.xtal.160=160 MHz +huzzah.menu.xtal.160.build.f_cpu=160000000L +huzzah.menu.vt.flash=Flash +huzzah.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +huzzah.menu.vt.heap=Heap +huzzah.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +huzzah.menu.vt.iram=IRAM +huzzah.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +huzzah.menu.exception.disabled=Disabled (new aborts on oom) +huzzah.menu.exception.disabled.build.exception_flags=-fno-exceptions +huzzah.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +huzzah.menu.exception.enabled=Enabled +huzzah.menu.exception.enabled.build.exception_flags=-fexceptions +huzzah.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +huzzah.menu.stacksmash.disabled=Disabled +huzzah.menu.stacksmash.disabled.build.stacksmash_flags= +huzzah.menu.stacksmash.enabled=Enabled +huzzah.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +huzzah.menu.ssl.all=All SSL ciphers (most compatible) +huzzah.menu.ssl.all.build.sslflags= +huzzah.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +huzzah.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +huzzah.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +huzzah.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +huzzah.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +huzzah.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +huzzah.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +huzzah.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +huzzah.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +huzzah.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +huzzah.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +huzzah.menu.non32xfer.fast.build.non32xferflags= +huzzah.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +huzzah.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +huzzah.upload.resetmethod=--before default_reset --after hard_reset +huzzah.build.flash_mode=qio +huzzah.build.flash_flags=-DFLASHMODE_QIO +huzzah.build.flash_freq=40 +huzzah.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +huzzah.menu.eesz.4M2M.build.flash_size=4M +huzzah.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +huzzah.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +huzzah.menu.eesz.4M2M.build.spiffs_pagesize=256 +huzzah.menu.eesz.4M2M.upload.maximum_size=1044464 +huzzah.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +huzzah.menu.eesz.4M2M.build.spiffs_start=0x200000 +huzzah.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +huzzah.menu.eesz.4M2M.build.spiffs_blocksize=8192 +huzzah.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +huzzah.menu.eesz.4M3M.build.flash_size=4M +huzzah.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +huzzah.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +huzzah.menu.eesz.4M3M.build.spiffs_pagesize=256 +huzzah.menu.eesz.4M3M.upload.maximum_size=1044464 +huzzah.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +huzzah.menu.eesz.4M3M.build.spiffs_start=0x100000 +huzzah.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +huzzah.menu.eesz.4M3M.build.spiffs_blocksize=8192 +huzzah.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +huzzah.menu.eesz.4M1M.build.flash_size=4M +huzzah.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +huzzah.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +huzzah.menu.eesz.4M1M.build.spiffs_pagesize=256 +huzzah.menu.eesz.4M1M.upload.maximum_size=1044464 +huzzah.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +huzzah.menu.eesz.4M1M.build.spiffs_start=0x300000 +huzzah.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +huzzah.menu.eesz.4M1M.build.spiffs_blocksize=8192 +huzzah.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +huzzah.menu.eesz.4M.build.flash_size=4M +huzzah.menu.eesz.4M.build.flash_size_bytes=0x400000 +huzzah.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +huzzah.menu.eesz.4M.build.spiffs_pagesize=256 +huzzah.menu.eesz.4M.upload.maximum_size=1044464 +huzzah.menu.eesz.4M.build.rfcal_addr=0x3FC000 +huzzah.menu.ip.lm2f=v2 Lower Memory +huzzah.menu.ip.lm2f.build.lwip_include=lwip2/include +huzzah.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +huzzah.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +huzzah.menu.ip.hb2f=v2 Higher Bandwidth +huzzah.menu.ip.hb2f.build.lwip_include=lwip2/include +huzzah.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +huzzah.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +huzzah.menu.ip.lm2n=v2 Lower Memory (no features) +huzzah.menu.ip.lm2n.build.lwip_include=lwip2/include +huzzah.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +huzzah.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +huzzah.menu.ip.hb2n=v2 Higher Bandwidth (no features) +huzzah.menu.ip.hb2n.build.lwip_include=lwip2/include +huzzah.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +huzzah.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +huzzah.menu.ip.lm6f=v2 IPv6 Lower Memory +huzzah.menu.ip.lm6f.build.lwip_include=lwip2/include +huzzah.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +huzzah.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +huzzah.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +huzzah.menu.ip.hb6f.build.lwip_include=lwip2/include +huzzah.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +huzzah.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +huzzah.menu.dbg.Disabled=Disabled +huzzah.menu.dbg.Disabled.build.debug_port= +huzzah.menu.dbg.Serial=Serial +huzzah.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +huzzah.menu.dbg.Serial1=Serial1 +huzzah.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +huzzah.menu.lvl.None____=None +huzzah.menu.lvl.None____.build.debug_level= +huzzah.menu.lvl.SSL=SSL +huzzah.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +huzzah.menu.lvl.TLS_MEM=TLS_MEM +huzzah.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +huzzah.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +huzzah.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +huzzah.menu.lvl.HTTP_SERVER=HTTP_SERVER +huzzah.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +huzzah.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +huzzah.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +huzzah.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +huzzah.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +huzzah.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +huzzah.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +huzzah.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +huzzah.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +huzzah.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +huzzah.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +huzzah.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +huzzah.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +huzzah.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +huzzah.menu.lvl.CORE=CORE +huzzah.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +huzzah.menu.lvl.WIFI=WIFI +huzzah.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +huzzah.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +huzzah.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +huzzah.menu.lvl.UPDATER=UPDATER +huzzah.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +huzzah.menu.lvl.OTA=OTA +huzzah.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +huzzah.menu.lvl.OOM=OOM +huzzah.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +huzzah.menu.lvl.MDNS=MDNS +huzzah.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +huzzah.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +huzzah.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +huzzah.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +huzzah.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +huzzah.menu.wipe.none=Only Sketch +huzzah.menu.wipe.none.upload.erase_cmd= +huzzah.menu.wipe.sdk=Sketch + WiFi Settings +huzzah.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +huzzah.menu.wipe.all=All Flash Contents +huzzah.menu.wipe.all.upload.erase_cmd=erase_flash +huzzah.menu.baud.115200=115200 +huzzah.menu.baud.115200.upload.speed=115200 +huzzah.menu.baud.57600=57600 +huzzah.menu.baud.57600.upload.speed=57600 +huzzah.menu.baud.230400.linux=230400 +huzzah.menu.baud.230400.macosx=230400 +huzzah.menu.baud.230400.upload.speed=230400 +huzzah.menu.baud.256000.windows=256000 +huzzah.menu.baud.256000.upload.speed=256000 +huzzah.menu.baud.460800.linux=460800 +huzzah.menu.baud.460800.macosx=460800 +huzzah.menu.baud.460800.upload.speed=460800 +huzzah.menu.baud.512000.windows=512000 +huzzah.menu.baud.512000.upload.speed=512000 +huzzah.menu.baud.921600=921600 +huzzah.menu.baud.921600.upload.speed=921600 +huzzah.menu.baud.3000000=3000000 +huzzah.menu.baud.3000000.upload.speed=3000000 ############################################################## wifi_slot.name=Amperka WiFi Slot @@ -5950,6 +1362,18 @@ wifi_slot.menu.ssl.all=All SSL ciphers (most compatible) wifi_slot.menu.ssl.all.build.sslflags= wifi_slot.menu.ssl.basic=Basic SSL ciphers (lower ROM use) wifi_slot.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +wifi_slot.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +wifi_slot.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +wifi_slot.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +wifi_slot.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +wifi_slot.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +wifi_slot.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +wifi_slot.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +wifi_slot.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +wifi_slot.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +wifi_slot.menu.non32xfer.fast.build.non32xferflags= +wifi_slot.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +wifi_slot.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER wifi_slot.upload.resetmethod=--before default_reset --after hard_reset wifi_slot.menu.FlashFreq.40=40MHz wifi_slot.menu.FlashFreq.40.build.flash_freq=40 @@ -6213,191 +1637,862 @@ wifi_slot.menu.baud.3000000=3000000 wifi_slot.menu.baud.3000000.upload.speed=3000000 ############################################################## -wiolink.name=Seeed Wio Link -wiolink.build.board=ESP8266_WIO_LINK -wiolink.build.variant=wiolink -wiolink.upload.tool=esptool -wiolink.upload.maximum_data_size=81920 -wiolink.upload.wait_for_upload_port=true -wiolink.upload.erase_cmd= -wiolink.serial.disableDTR=true -wiolink.serial.disableRTS=true -wiolink.build.mcu=esp8266 -wiolink.build.core=esp8266 -wiolink.build.spiffs_pagesize=256 -wiolink.build.debug_port= -wiolink.build.debug_level= -wiolink.menu.xtal.80=80 MHz -wiolink.menu.xtal.80.build.f_cpu=80000000L -wiolink.menu.xtal.160=160 MHz -wiolink.menu.xtal.160.build.f_cpu=160000000L -wiolink.menu.vt.flash=Flash -wiolink.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -wiolink.menu.vt.heap=Heap -wiolink.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -wiolink.menu.vt.iram=IRAM -wiolink.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -wiolink.menu.exception.disabled=Disabled (new aborts on oom) -wiolink.menu.exception.disabled.build.exception_flags=-fno-exceptions -wiolink.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -wiolink.menu.exception.enabled=Enabled -wiolink.menu.exception.enabled.build.exception_flags=-fexceptions -wiolink.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -wiolink.menu.stacksmash.disabled=Disabled -wiolink.menu.stacksmash.disabled.build.stacksmash_flags= -wiolink.menu.stacksmash.enabled=Enabled -wiolink.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -wiolink.menu.ssl.all=All SSL ciphers (most compatible) -wiolink.menu.ssl.all.build.sslflags= -wiolink.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -wiolink.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -wiolink.upload.resetmethod=--before default_reset --after hard_reset -wiolink.build.flash_mode=qio -wiolink.build.flash_flags=-DFLASHMODE_QIO -wiolink.build.flash_freq=40 -wiolink.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -wiolink.menu.eesz.4M2M.build.flash_size=4M -wiolink.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -wiolink.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -wiolink.menu.eesz.4M2M.build.spiffs_pagesize=256 -wiolink.menu.eesz.4M2M.upload.maximum_size=1044464 -wiolink.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -wiolink.menu.eesz.4M2M.build.spiffs_start=0x200000 -wiolink.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -wiolink.menu.eesz.4M2M.build.spiffs_blocksize=8192 -wiolink.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -wiolink.menu.eesz.4M3M.build.flash_size=4M -wiolink.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -wiolink.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -wiolink.menu.eesz.4M3M.build.spiffs_pagesize=256 -wiolink.menu.eesz.4M3M.upload.maximum_size=1044464 -wiolink.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -wiolink.menu.eesz.4M3M.build.spiffs_start=0x100000 -wiolink.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -wiolink.menu.eesz.4M3M.build.spiffs_blocksize=8192 -wiolink.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -wiolink.menu.eesz.4M1M.build.flash_size=4M -wiolink.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -wiolink.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -wiolink.menu.eesz.4M1M.build.spiffs_pagesize=256 -wiolink.menu.eesz.4M1M.upload.maximum_size=1044464 -wiolink.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -wiolink.menu.eesz.4M1M.build.spiffs_start=0x300000 -wiolink.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -wiolink.menu.eesz.4M1M.build.spiffs_blocksize=8192 -wiolink.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -wiolink.menu.eesz.4M.build.flash_size=4M -wiolink.menu.eesz.4M.build.flash_size_bytes=0x400000 -wiolink.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -wiolink.menu.eesz.4M.build.spiffs_pagesize=256 -wiolink.menu.eesz.4M.upload.maximum_size=1044464 -wiolink.menu.eesz.4M.build.rfcal_addr=0x3FC000 -wiolink.menu.ip.lm2f=v2 Lower Memory -wiolink.menu.ip.lm2f.build.lwip_include=lwip2/include -wiolink.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -wiolink.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -wiolink.menu.ip.hb2f=v2 Higher Bandwidth -wiolink.menu.ip.hb2f.build.lwip_include=lwip2/include -wiolink.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -wiolink.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -wiolink.menu.ip.lm2n=v2 Lower Memory (no features) -wiolink.menu.ip.lm2n.build.lwip_include=lwip2/include -wiolink.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -wiolink.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -wiolink.menu.ip.hb2n=v2 Higher Bandwidth (no features) -wiolink.menu.ip.hb2n.build.lwip_include=lwip2/include -wiolink.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -wiolink.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -wiolink.menu.ip.lm6f=v2 IPv6 Lower Memory -wiolink.menu.ip.lm6f.build.lwip_include=lwip2/include -wiolink.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -wiolink.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -wiolink.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -wiolink.menu.ip.hb6f.build.lwip_include=lwip2/include -wiolink.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -wiolink.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -wiolink.menu.dbg.Disabled=Disabled -wiolink.menu.dbg.Disabled.build.debug_port= -wiolink.menu.dbg.Serial=Serial -wiolink.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -wiolink.menu.dbg.Serial1=Serial1 -wiolink.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -wiolink.menu.lvl.None____=None -wiolink.menu.lvl.None____.build.debug_level= -wiolink.menu.lvl.SSL=SSL -wiolink.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -wiolink.menu.lvl.TLS_MEM=TLS_MEM -wiolink.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -wiolink.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -wiolink.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -wiolink.menu.lvl.HTTP_SERVER=HTTP_SERVER -wiolink.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -wiolink.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -wiolink.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -wiolink.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -wiolink.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -wiolink.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -wiolink.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -wiolink.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -wiolink.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -wiolink.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -wiolink.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -wiolink.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -wiolink.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -wiolink.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -wiolink.menu.lvl.CORE=CORE -wiolink.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -wiolink.menu.lvl.WIFI=WIFI -wiolink.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -wiolink.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -wiolink.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -wiolink.menu.lvl.UPDATER=UPDATER -wiolink.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -wiolink.menu.lvl.OTA=OTA -wiolink.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -wiolink.menu.lvl.OOM=OOM -wiolink.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -wiolink.menu.lvl.MDNS=MDNS -wiolink.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -wiolink.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -wiolink.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -wiolink.menu.wipe.none=Only Sketch -wiolink.menu.wipe.none.upload.erase_cmd= -wiolink.menu.wipe.sdk=Sketch + WiFi Settings -wiolink.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -wiolink.menu.wipe.all=All Flash Contents -wiolink.menu.wipe.all.upload.erase_cmd=erase_flash -wiolink.menu.baud.115200=115200 -wiolink.menu.baud.115200.upload.speed=115200 -wiolink.menu.baud.57600=57600 -wiolink.menu.baud.57600.upload.speed=57600 -wiolink.menu.baud.230400.linux=230400 -wiolink.menu.baud.230400.macosx=230400 -wiolink.menu.baud.230400.upload.speed=230400 -wiolink.menu.baud.256000.windows=256000 -wiolink.menu.baud.256000.upload.speed=256000 -wiolink.menu.baud.460800.linux=460800 -wiolink.menu.baud.460800.macosx=460800 -wiolink.menu.baud.460800.upload.speed=460800 -wiolink.menu.baud.512000.windows=512000 -wiolink.menu.baud.512000.upload.speed=512000 -wiolink.menu.baud.921600=921600 -wiolink.menu.baud.921600.upload.speed=921600 -wiolink.menu.baud.3000000=3000000 -wiolink.menu.baud.3000000.upload.speed=3000000 +arduino-esp8266.name=Arduino +arduino-esp8266.build.board=ESP8266_ARDUINO +arduino-esp8266.menu.BoardModel.primo=Primo +arduino-esp8266.menu.BoardModel.primo.build.board=ESP8266_ARDUINO_PRIMO +arduino-esp8266.menu.BoardModel.primo.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 +arduino-esp8266.menu.BoardModel.primo.build.variant=arduino_spi +arduino-esp8266.menu.BoardModel.starottodeved=Star OTTO +arduino-esp8266.menu.BoardModel.starottodeved.build.board=ESP8266_ARDUINO_STAR_OTTO +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=Uno WiFi +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.unowifideved.build.variant=arduino_uart +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.xtal.80=80 MHz +arduino-esp8266.menu.xtal.80.build.f_cpu=80000000L +arduino-esp8266.menu.xtal.160=160 MHz +arduino-esp8266.menu.xtal.160.build.f_cpu=160000000L +arduino-esp8266.menu.vt.flash=Flash +arduino-esp8266.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +arduino-esp8266.menu.vt.heap=Heap +arduino-esp8266.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +arduino-esp8266.menu.vt.iram=IRAM +arduino-esp8266.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +arduino-esp8266.menu.exception.disabled=Disabled (new aborts on oom) +arduino-esp8266.menu.exception.disabled.build.exception_flags=-fno-exceptions +arduino-esp8266.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +arduino-esp8266.menu.exception.enabled=Enabled +arduino-esp8266.menu.exception.enabled.build.exception_flags=-fexceptions +arduino-esp8266.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +arduino-esp8266.menu.stacksmash.disabled=Disabled +arduino-esp8266.menu.stacksmash.disabled.build.stacksmash_flags= +arduino-esp8266.menu.stacksmash.enabled=Enabled +arduino-esp8266.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +arduino-esp8266.menu.ssl.all=All SSL ciphers (most compatible) +arduino-esp8266.menu.ssl.all.build.sslflags= +arduino-esp8266.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +arduino-esp8266.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +arduino-esp8266.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +arduino-esp8266.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +arduino-esp8266.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +arduino-esp8266.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +arduino-esp8266.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +arduino-esp8266.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +arduino-esp8266.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +arduino-esp8266.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +arduino-esp8266.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +arduino-esp8266.menu.non32xfer.fast.build.non32xferflags= +arduino-esp8266.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +arduino-esp8266.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +arduino-esp8266.upload.resetmethod=--before no_reset --after soft_reset +arduino-esp8266.build.flash_mode=qio +arduino-esp8266.build.flash_flags=-DFLASHMODE_QIO +arduino-esp8266.build.flash_freq=40 +arduino-esp8266.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +arduino-esp8266.menu.eesz.4M2M.build.flash_size=4M +arduino-esp8266.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +arduino-esp8266.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +arduino-esp8266.menu.eesz.4M2M.build.spiffs_pagesize=256 +arduino-esp8266.menu.eesz.4M2M.upload.maximum_size=1044464 +arduino-esp8266.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +arduino-esp8266.menu.eesz.4M2M.build.spiffs_start=0x200000 +arduino-esp8266.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +arduino-esp8266.menu.eesz.4M2M.build.spiffs_blocksize=8192 +arduino-esp8266.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +arduino-esp8266.menu.eesz.4M3M.build.flash_size=4M +arduino-esp8266.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +arduino-esp8266.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +arduino-esp8266.menu.eesz.4M3M.build.spiffs_pagesize=256 +arduino-esp8266.menu.eesz.4M3M.upload.maximum_size=1044464 +arduino-esp8266.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +arduino-esp8266.menu.eesz.4M3M.build.spiffs_start=0x100000 +arduino-esp8266.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +arduino-esp8266.menu.eesz.4M3M.build.spiffs_blocksize=8192 +arduino-esp8266.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +arduino-esp8266.menu.eesz.4M1M.build.flash_size=4M +arduino-esp8266.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +arduino-esp8266.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +arduino-esp8266.menu.eesz.4M1M.build.spiffs_pagesize=256 +arduino-esp8266.menu.eesz.4M1M.upload.maximum_size=1044464 +arduino-esp8266.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +arduino-esp8266.menu.eesz.4M1M.build.spiffs_start=0x300000 +arduino-esp8266.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +arduino-esp8266.menu.eesz.4M1M.build.spiffs_blocksize=8192 +arduino-esp8266.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +arduino-esp8266.menu.eesz.4M.build.flash_size=4M +arduino-esp8266.menu.eesz.4M.build.flash_size_bytes=0x400000 +arduino-esp8266.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +arduino-esp8266.menu.eesz.4M.build.spiffs_pagesize=256 +arduino-esp8266.menu.eesz.4M.upload.maximum_size=1044464 +arduino-esp8266.menu.eesz.4M.build.rfcal_addr=0x3FC000 +arduino-esp8266.menu.ip.lm2f=v2 Lower Memory +arduino-esp8266.menu.ip.lm2f.build.lwip_include=lwip2/include +arduino-esp8266.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +arduino-esp8266.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +arduino-esp8266.menu.ip.hb2f=v2 Higher Bandwidth +arduino-esp8266.menu.ip.hb2f.build.lwip_include=lwip2/include +arduino-esp8266.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +arduino-esp8266.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +arduino-esp8266.menu.ip.lm2n=v2 Lower Memory (no features) +arduino-esp8266.menu.ip.lm2n.build.lwip_include=lwip2/include +arduino-esp8266.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +arduino-esp8266.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +arduino-esp8266.menu.ip.hb2n=v2 Higher Bandwidth (no features) +arduino-esp8266.menu.ip.hb2n.build.lwip_include=lwip2/include +arduino-esp8266.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +arduino-esp8266.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +arduino-esp8266.menu.ip.lm6f=v2 IPv6 Lower Memory +arduino-esp8266.menu.ip.lm6f.build.lwip_include=lwip2/include +arduino-esp8266.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +arduino-esp8266.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +arduino-esp8266.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +arduino-esp8266.menu.ip.hb6f.build.lwip_include=lwip2/include +arduino-esp8266.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +arduino-esp8266.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +arduino-esp8266.menu.dbg.Disabled=Disabled +arduino-esp8266.menu.dbg.Disabled.build.debug_port= +arduino-esp8266.menu.dbg.Serial=Serial +arduino-esp8266.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +arduino-esp8266.menu.dbg.Serial1=Serial1 +arduino-esp8266.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +arduino-esp8266.menu.lvl.None____=None +arduino-esp8266.menu.lvl.None____.build.debug_level= +arduino-esp8266.menu.lvl.SSL=SSL +arduino-esp8266.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +arduino-esp8266.menu.lvl.TLS_MEM=TLS_MEM +arduino-esp8266.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +arduino-esp8266.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +arduino-esp8266.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +arduino-esp8266.menu.lvl.HTTP_SERVER=HTTP_SERVER +arduino-esp8266.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +arduino-esp8266.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +arduino-esp8266.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +arduino-esp8266.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +arduino-esp8266.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +arduino-esp8266.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +arduino-esp8266.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +arduino-esp8266.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +arduino-esp8266.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +arduino-esp8266.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +arduino-esp8266.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +arduino-esp8266.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +arduino-esp8266.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +arduino-esp8266.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +arduino-esp8266.menu.lvl.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.lvl.CORE=CORE +arduino-esp8266.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +arduino-esp8266.menu.lvl.WIFI=WIFI +arduino-esp8266.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +arduino-esp8266.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +arduino-esp8266.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +arduino-esp8266.menu.lvl.UPDATER=UPDATER +arduino-esp8266.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +arduino-esp8266.menu.lvl.OTA=OTA +arduino-esp8266.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +arduino-esp8266.menu.lvl.OOM=OOM +arduino-esp8266.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +arduino-esp8266.menu.lvl.MDNS=MDNS +arduino-esp8266.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +arduino-esp8266.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +arduino-esp8266.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +arduino-esp8266.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +arduino-esp8266.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +arduino-esp8266.menu.wipe.none=Only Sketch +arduino-esp8266.menu.wipe.none.upload.erase_cmd= +arduino-esp8266.menu.wipe.sdk=Sketch + WiFi Settings +arduino-esp8266.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +arduino-esp8266.menu.wipe.all=All Flash Contents +arduino-esp8266.menu.wipe.all.upload.erase_cmd=erase_flash +arduino-esp8266.menu.baud.115200=115200 +arduino-esp8266.menu.baud.115200.upload.speed=115200 +arduino-esp8266.menu.baud.57600=57600 +arduino-esp8266.menu.baud.57600.upload.speed=57600 +arduino-esp8266.menu.baud.230400.linux=230400 +arduino-esp8266.menu.baud.230400.macosx=230400 +arduino-esp8266.menu.baud.230400.upload.speed=230400 +arduino-esp8266.menu.baud.256000.windows=256000 +arduino-esp8266.menu.baud.256000.upload.speed=256000 +arduino-esp8266.menu.baud.460800.linux=460800 +arduino-esp8266.menu.baud.460800.macosx=460800 +arduino-esp8266.menu.baud.460800.upload.speed=460800 +arduino-esp8266.menu.baud.512000.windows=512000 +arduino-esp8266.menu.baud.512000.upload.speed=512000 +arduino-esp8266.menu.baud.921600=921600 +arduino-esp8266.menu.baud.921600.upload.speed=921600 +arduino-esp8266.menu.baud.3000000=3000000 +arduino-esp8266.menu.baud.3000000.upload.speed=3000000 + +############################################################## +espmxdevkit.name=DOIT ESP-Mx DevKit (ESP8285) +espmxdevkit.build.board=ESP8266_ESP01 +espmxdevkit.build.led=-DLED_BUILTIN=16 +espmxdevkit.build.variant=esp8285 +espmxdevkit.upload.tool=esptool +espmxdevkit.upload.maximum_data_size=81920 +espmxdevkit.upload.wait_for_upload_port=true +espmxdevkit.upload.erase_cmd= +espmxdevkit.serial.disableDTR=true +espmxdevkit.serial.disableRTS=true +espmxdevkit.build.mcu=esp8266 +espmxdevkit.build.core=esp8266 +espmxdevkit.build.spiffs_pagesize=256 +espmxdevkit.build.debug_port= +espmxdevkit.build.debug_level= +espmxdevkit.menu.xtal.80=80 MHz +espmxdevkit.menu.xtal.80.build.f_cpu=80000000L +espmxdevkit.menu.xtal.160=160 MHz +espmxdevkit.menu.xtal.160.build.f_cpu=160000000L +espmxdevkit.menu.vt.flash=Flash +espmxdevkit.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +espmxdevkit.menu.vt.heap=Heap +espmxdevkit.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +espmxdevkit.menu.vt.iram=IRAM +espmxdevkit.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +espmxdevkit.menu.exception.disabled=Disabled (new aborts on oom) +espmxdevkit.menu.exception.disabled.build.exception_flags=-fno-exceptions +espmxdevkit.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +espmxdevkit.menu.exception.enabled=Enabled +espmxdevkit.menu.exception.enabled.build.exception_flags=-fexceptions +espmxdevkit.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +espmxdevkit.menu.stacksmash.disabled=Disabled +espmxdevkit.menu.stacksmash.disabled.build.stacksmash_flags= +espmxdevkit.menu.stacksmash.enabled=Enabled +espmxdevkit.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +espmxdevkit.menu.ssl.all=All SSL ciphers (most compatible) +espmxdevkit.menu.ssl.all.build.sslflags= +espmxdevkit.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +espmxdevkit.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +espmxdevkit.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +espmxdevkit.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +espmxdevkit.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +espmxdevkit.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +espmxdevkit.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +espmxdevkit.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +espmxdevkit.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +espmxdevkit.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +espmxdevkit.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +espmxdevkit.menu.non32xfer.fast.build.non32xferflags= +espmxdevkit.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +espmxdevkit.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +espmxdevkit.upload.resetmethod=--before default_reset --after hard_reset +espmxdevkit.build.flash_mode=dout +espmxdevkit.build.flash_flags=-DFLASHMODE_DOUT +espmxdevkit.build.flash_freq=40 +espmxdevkit.menu.eesz.1M64=1MB (FS:64KB OTA:~470KB) +espmxdevkit.menu.eesz.1M64.build.flash_size=1M +espmxdevkit.menu.eesz.1M64.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M64.build.flash_ld=eagle.flash.1m64.ld +espmxdevkit.menu.eesz.1M64.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M64.upload.maximum_size=958448 +espmxdevkit.menu.eesz.1M64.build.rfcal_addr=0xFC000 +espmxdevkit.menu.eesz.1M64.build.spiffs_start=0xEB000 +espmxdevkit.menu.eesz.1M64.build.spiffs_end=0xFB000 +espmxdevkit.menu.eesz.1M64.build.spiffs_blocksize=4096 +espmxdevkit.menu.eesz.1M128=1MB (FS:128KB OTA:~438KB) +espmxdevkit.menu.eesz.1M128.build.flash_size=1M +espmxdevkit.menu.eesz.1M128.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M128.build.flash_ld=eagle.flash.1m128.ld +espmxdevkit.menu.eesz.1M128.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M128.upload.maximum_size=892912 +espmxdevkit.menu.eesz.1M128.build.rfcal_addr=0xFC000 +espmxdevkit.menu.eesz.1M128.build.spiffs_start=0xDB000 +espmxdevkit.menu.eesz.1M128.build.spiffs_end=0xFB000 +espmxdevkit.menu.eesz.1M128.build.spiffs_blocksize=4096 +espmxdevkit.menu.eesz.1M144=1MB (FS:144KB OTA:~430KB) +espmxdevkit.menu.eesz.1M144.build.flash_size=1M +espmxdevkit.menu.eesz.1M144.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M144.build.flash_ld=eagle.flash.1m144.ld +espmxdevkit.menu.eesz.1M144.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M144.upload.maximum_size=876528 +espmxdevkit.menu.eesz.1M144.build.rfcal_addr=0xFC000 +espmxdevkit.menu.eesz.1M144.build.spiffs_start=0xD7000 +espmxdevkit.menu.eesz.1M144.build.spiffs_end=0xFB000 +espmxdevkit.menu.eesz.1M144.build.spiffs_blocksize=4096 +espmxdevkit.menu.eesz.1M160=1MB (FS:160KB OTA:~422KB) +espmxdevkit.menu.eesz.1M160.build.flash_size=1M +espmxdevkit.menu.eesz.1M160.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M160.build.flash_ld=eagle.flash.1m160.ld +espmxdevkit.menu.eesz.1M160.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M160.upload.maximum_size=860144 +espmxdevkit.menu.eesz.1M160.build.rfcal_addr=0xFC000 +espmxdevkit.menu.eesz.1M160.build.spiffs_start=0xD3000 +espmxdevkit.menu.eesz.1M160.build.spiffs_end=0xFB000 +espmxdevkit.menu.eesz.1M160.build.spiffs_blocksize=4096 +espmxdevkit.menu.eesz.1M192=1MB (FS:192KB OTA:~406KB) +espmxdevkit.menu.eesz.1M192.build.flash_size=1M +espmxdevkit.menu.eesz.1M192.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M192.build.flash_ld=eagle.flash.1m192.ld +espmxdevkit.menu.eesz.1M192.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M192.upload.maximum_size=827376 +espmxdevkit.menu.eesz.1M192.build.rfcal_addr=0xFC000 +espmxdevkit.menu.eesz.1M192.build.spiffs_start=0xCB000 +espmxdevkit.menu.eesz.1M192.build.spiffs_end=0xFB000 +espmxdevkit.menu.eesz.1M192.build.spiffs_blocksize=4096 +espmxdevkit.menu.eesz.1M256=1MB (FS:256KB OTA:~374KB) +espmxdevkit.menu.eesz.1M256.build.flash_size=1M +espmxdevkit.menu.eesz.1M256.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M256.build.flash_ld=eagle.flash.1m256.ld +espmxdevkit.menu.eesz.1M256.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M256.upload.maximum_size=761840 +espmxdevkit.menu.eesz.1M256.build.rfcal_addr=0xFC000 +espmxdevkit.menu.eesz.1M256.build.spiffs_start=0xBB000 +espmxdevkit.menu.eesz.1M256.build.spiffs_end=0xFB000 +espmxdevkit.menu.eesz.1M256.build.spiffs_blocksize=4096 +espmxdevkit.menu.eesz.1M512=1MB (FS:512KB OTA:~246KB) +espmxdevkit.menu.eesz.1M512.build.flash_size=1M +espmxdevkit.menu.eesz.1M512.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M512.build.flash_ld=eagle.flash.1m512.ld +espmxdevkit.menu.eesz.1M512.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M512.upload.maximum_size=499696 +espmxdevkit.menu.eesz.1M512.build.rfcal_addr=0xFC000 +espmxdevkit.menu.eesz.1M512.build.spiffs_start=0x7B000 +espmxdevkit.menu.eesz.1M512.build.spiffs_end=0xFB000 +espmxdevkit.menu.eesz.1M512.build.spiffs_blocksize=8192 +espmxdevkit.menu.eesz.1M=1MB (FS:none OTA:~502KB) +espmxdevkit.menu.eesz.1M.build.flash_size=1M +espmxdevkit.menu.eesz.1M.build.flash_size_bytes=0x100000 +espmxdevkit.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld +espmxdevkit.menu.eesz.1M.build.spiffs_pagesize=256 +espmxdevkit.menu.eesz.1M.upload.maximum_size=1023984 +espmxdevkit.menu.eesz.1M.build.rfcal_addr=0xFC000 +espmxdevkit.menu.ip.lm2f=v2 Lower Memory +espmxdevkit.menu.ip.lm2f.build.lwip_include=lwip2/include +espmxdevkit.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +espmxdevkit.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espmxdevkit.menu.ip.hb2f=v2 Higher Bandwidth +espmxdevkit.menu.ip.hb2f.build.lwip_include=lwip2/include +espmxdevkit.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +espmxdevkit.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espmxdevkit.menu.ip.lm2n=v2 Lower Memory (no features) +espmxdevkit.menu.ip.lm2n.build.lwip_include=lwip2/include +espmxdevkit.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +espmxdevkit.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espmxdevkit.menu.ip.hb2n=v2 Higher Bandwidth (no features) +espmxdevkit.menu.ip.hb2n.build.lwip_include=lwip2/include +espmxdevkit.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +espmxdevkit.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espmxdevkit.menu.ip.lm6f=v2 IPv6 Lower Memory +espmxdevkit.menu.ip.lm6f.build.lwip_include=lwip2/include +espmxdevkit.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +espmxdevkit.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espmxdevkit.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +espmxdevkit.menu.ip.hb6f.build.lwip_include=lwip2/include +espmxdevkit.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +espmxdevkit.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espmxdevkit.menu.dbg.Disabled=Disabled +espmxdevkit.menu.dbg.Disabled.build.debug_port= +espmxdevkit.menu.dbg.Serial=Serial +espmxdevkit.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +espmxdevkit.menu.dbg.Serial1=Serial1 +espmxdevkit.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +espmxdevkit.menu.lvl.None____=None +espmxdevkit.menu.lvl.None____.build.debug_level= +espmxdevkit.menu.lvl.SSL=SSL +espmxdevkit.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +espmxdevkit.menu.lvl.TLS_MEM=TLS_MEM +espmxdevkit.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +espmxdevkit.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +espmxdevkit.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +espmxdevkit.menu.lvl.HTTP_SERVER=HTTP_SERVER +espmxdevkit.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +espmxdevkit.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +espmxdevkit.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +espmxdevkit.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +espmxdevkit.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +espmxdevkit.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espmxdevkit.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +espmxdevkit.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +espmxdevkit.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +espmxdevkit.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espmxdevkit.menu.lvl.CORE=CORE +espmxdevkit.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +espmxdevkit.menu.lvl.WIFI=WIFI +espmxdevkit.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +espmxdevkit.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +espmxdevkit.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +espmxdevkit.menu.lvl.UPDATER=UPDATER +espmxdevkit.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +espmxdevkit.menu.lvl.OTA=OTA +espmxdevkit.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +espmxdevkit.menu.lvl.OOM=OOM +espmxdevkit.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +espmxdevkit.menu.lvl.MDNS=MDNS +espmxdevkit.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espmxdevkit.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espmxdevkit.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +espmxdevkit.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +espmxdevkit.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +espmxdevkit.menu.wipe.none=Only Sketch +espmxdevkit.menu.wipe.none.upload.erase_cmd= +espmxdevkit.menu.wipe.sdk=Sketch + WiFi Settings +espmxdevkit.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +espmxdevkit.menu.wipe.all=All Flash Contents +espmxdevkit.menu.wipe.all.upload.erase_cmd=erase_flash +espmxdevkit.menu.baud.115200=115200 +espmxdevkit.menu.baud.115200.upload.speed=115200 +espmxdevkit.menu.baud.57600=57600 +espmxdevkit.menu.baud.57600.upload.speed=57600 +espmxdevkit.menu.baud.230400.linux=230400 +espmxdevkit.menu.baud.230400.macosx=230400 +espmxdevkit.menu.baud.230400.upload.speed=230400 +espmxdevkit.menu.baud.256000.windows=256000 +espmxdevkit.menu.baud.256000.upload.speed=256000 +espmxdevkit.menu.baud.460800.linux=460800 +espmxdevkit.menu.baud.460800.macosx=460800 +espmxdevkit.menu.baud.460800.upload.speed=460800 +espmxdevkit.menu.baud.512000.windows=512000 +espmxdevkit.menu.baud.512000.upload.speed=512000 +espmxdevkit.menu.baud.921600=921600 +espmxdevkit.menu.baud.921600.upload.speed=921600 +espmxdevkit.menu.baud.3000000=3000000 +espmxdevkit.menu.baud.3000000.upload.speed=3000000 + +############################################################## +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.xtal.80=80 MHz +oak.menu.xtal.80.build.f_cpu=80000000L +oak.menu.xtal.160=160 MHz +oak.menu.xtal.160.build.f_cpu=160000000L +oak.menu.vt.flash=Flash +oak.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +oak.menu.vt.heap=Heap +oak.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +oak.menu.vt.iram=IRAM +oak.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +oak.menu.exception.disabled=Disabled (new aborts on oom) +oak.menu.exception.disabled.build.exception_flags=-fno-exceptions +oak.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +oak.menu.exception.enabled=Enabled +oak.menu.exception.enabled.build.exception_flags=-fexceptions +oak.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +oak.menu.stacksmash.disabled=Disabled +oak.menu.stacksmash.disabled.build.stacksmash_flags= +oak.menu.stacksmash.enabled=Enabled +oak.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +oak.menu.ssl.all=All SSL ciphers (most compatible) +oak.menu.ssl.all.build.sslflags= +oak.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +oak.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +oak.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +oak.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +oak.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +oak.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +oak.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +oak.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +oak.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +oak.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +oak.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +oak.menu.non32xfer.fast.build.non32xferflags= +oak.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +oak.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +oak.upload.resetmethod=--before no_reset --after soft_reset +oak.build.flash_mode=dio +oak.build.flash_flags=-DFLASHMODE_DIO +oak.build.flash_freq=40 +oak.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +oak.menu.eesz.4M2M.build.flash_size=4M +oak.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +oak.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +oak.menu.eesz.4M2M.build.spiffs_pagesize=256 +oak.menu.eesz.4M2M.upload.maximum_size=1044464 +oak.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +oak.menu.eesz.4M2M.build.spiffs_start=0x200000 +oak.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +oak.menu.eesz.4M2M.build.spiffs_blocksize=8192 +oak.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +oak.menu.eesz.4M3M.build.flash_size=4M +oak.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +oak.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +oak.menu.eesz.4M3M.build.spiffs_pagesize=256 +oak.menu.eesz.4M3M.upload.maximum_size=1044464 +oak.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +oak.menu.eesz.4M3M.build.spiffs_start=0x100000 +oak.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +oak.menu.eesz.4M3M.build.spiffs_blocksize=8192 +oak.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +oak.menu.eesz.4M1M.build.flash_size=4M +oak.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +oak.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +oak.menu.eesz.4M1M.build.spiffs_pagesize=256 +oak.menu.eesz.4M1M.upload.maximum_size=1044464 +oak.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +oak.menu.eesz.4M1M.build.spiffs_start=0x300000 +oak.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +oak.menu.eesz.4M1M.build.spiffs_blocksize=8192 +oak.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +oak.menu.eesz.4M.build.flash_size=4M +oak.menu.eesz.4M.build.flash_size_bytes=0x400000 +oak.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +oak.menu.eesz.4M.build.spiffs_pagesize=256 +oak.menu.eesz.4M.upload.maximum_size=1044464 +oak.menu.eesz.4M.build.rfcal_addr=0x3FC000 +oak.menu.ip.lm2f=v2 Lower Memory +oak.menu.ip.lm2f.build.lwip_include=lwip2/include +oak.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +oak.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +oak.menu.ip.hb2f=v2 Higher Bandwidth +oak.menu.ip.hb2f.build.lwip_include=lwip2/include +oak.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +oak.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +oak.menu.ip.lm2n=v2 Lower Memory (no features) +oak.menu.ip.lm2n.build.lwip_include=lwip2/include +oak.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +oak.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +oak.menu.ip.hb2n=v2 Higher Bandwidth (no features) +oak.menu.ip.hb2n.build.lwip_include=lwip2/include +oak.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +oak.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +oak.menu.ip.lm6f=v2 IPv6 Lower Memory +oak.menu.ip.lm6f.build.lwip_include=lwip2/include +oak.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +oak.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +oak.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +oak.menu.ip.hb6f.build.lwip_include=lwip2/include +oak.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +oak.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +oak.menu.dbg.Disabled=Disabled +oak.menu.dbg.Disabled.build.debug_port= +oak.menu.dbg.Serial=Serial +oak.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +oak.menu.dbg.Serial1=Serial1 +oak.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +oak.menu.lvl.None____=None +oak.menu.lvl.None____.build.debug_level= +oak.menu.lvl.SSL=SSL +oak.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +oak.menu.lvl.TLS_MEM=TLS_MEM +oak.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +oak.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +oak.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +oak.menu.lvl.HTTP_SERVER=HTTP_SERVER +oak.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +oak.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +oak.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +oak.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +oak.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +oak.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +oak.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +oak.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +oak.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +oak.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +oak.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +oak.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +oak.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +oak.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +oak.menu.lvl.CORE=CORE +oak.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +oak.menu.lvl.WIFI=WIFI +oak.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +oak.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +oak.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +oak.menu.lvl.UPDATER=UPDATER +oak.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +oak.menu.lvl.OTA=OTA +oak.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +oak.menu.lvl.OOM=OOM +oak.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +oak.menu.lvl.MDNS=MDNS +oak.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +oak.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +oak.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +oak.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +oak.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +oak.menu.wipe.none=Only Sketch +oak.menu.wipe.none.upload.erase_cmd= +oak.menu.wipe.sdk=Sketch + WiFi Settings +oak.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +oak.menu.wipe.all=All Flash Contents +oak.menu.wipe.all.upload.erase_cmd=erase_flash +oak.menu.baud.921600=921600 +oak.menu.baud.921600.upload.speed=921600 +oak.menu.baud.57600=57600 +oak.menu.baud.57600.upload.speed=57600 +oak.menu.baud.115200=115200 +oak.menu.baud.115200.upload.speed=115200 +oak.menu.baud.230400.linux=230400 +oak.menu.baud.230400.macosx=230400 +oak.menu.baud.230400.upload.speed=230400 +oak.menu.baud.256000.windows=256000 +oak.menu.baud.256000.upload.speed=256000 +oak.menu.baud.460800.linux=460800 +oak.menu.baud.460800.macosx=460800 +oak.menu.baud.460800.upload.speed=460800 +oak.menu.baud.512000.windows=512000 +oak.menu.baud.512000.upload.speed=512000 +oak.menu.baud.3000000=3000000 +oak.menu.baud.3000000.upload.speed=3000000 + +############################################################## +espduino.name=ESPDuino (ESP-13 Module) +espduino.build.board=ESP8266_ESP13 +espduino.build.variant=ESPDuino +espduino.menu.ResetMethod.v1=ESPduino-V1 +espduino.menu.ResetMethod.v1.upload.resetmethod=--before no_reset --after soft_reset +espduino.menu.ResetMethod.v2=ESPduino-V2 +espduino.menu.ResetMethod.v2.upload.resetmethod=--before default_reset --after hard_reset +espduino.menu.UploadTool.espota=OTA +espduino.menu.UploadTool.espota.upload.tool=espota +espduino.menu.UploadTool.esptool=Serial +espduino.menu.UploadTool.esptool.upload.tool=esptool +espduino.menu.UploadTool.esptool.upload.verbose=--trace +espduino.upload.tool=esptool +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.core=esp8266 +espduino.build.spiffs_pagesize=256 +espduino.build.debug_port= +espduino.build.debug_level= +espduino.menu.xtal.80=80 MHz +espduino.menu.xtal.80.build.f_cpu=80000000L +espduino.menu.xtal.160=160 MHz +espduino.menu.xtal.160.build.f_cpu=160000000L +espduino.menu.vt.flash=Flash +espduino.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +espduino.menu.vt.heap=Heap +espduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +espduino.menu.vt.iram=IRAM +espduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +espduino.menu.exception.disabled=Disabled (new aborts on oom) +espduino.menu.exception.disabled.build.exception_flags=-fno-exceptions +espduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +espduino.menu.exception.enabled=Enabled +espduino.menu.exception.enabled.build.exception_flags=-fexceptions +espduino.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +espduino.menu.stacksmash.disabled=Disabled +espduino.menu.stacksmash.disabled.build.stacksmash_flags= +espduino.menu.stacksmash.enabled=Enabled +espduino.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +espduino.menu.ssl.all=All SSL ciphers (most compatible) +espduino.menu.ssl.all.build.sslflags= +espduino.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +espduino.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +espduino.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +espduino.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +espduino.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +espduino.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +espduino.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +espduino.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +espduino.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +espduino.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +espduino.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +espduino.menu.non32xfer.fast.build.non32xferflags= +espduino.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +espduino.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +espduino.build.flash_mode=dio +espduino.build.flash_flags=-DFLASHMODE_DIO +espduino.build.flash_freq=40 +espduino.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +espduino.menu.eesz.4M2M.build.flash_size=4M +espduino.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +espduino.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +espduino.menu.eesz.4M2M.build.spiffs_pagesize=256 +espduino.menu.eesz.4M2M.upload.maximum_size=1044464 +espduino.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +espduino.menu.eesz.4M2M.build.spiffs_start=0x200000 +espduino.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +espduino.menu.eesz.4M2M.build.spiffs_blocksize=8192 +espduino.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +espduino.menu.eesz.4M3M.build.flash_size=4M +espduino.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +espduino.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +espduino.menu.eesz.4M3M.build.spiffs_pagesize=256 +espduino.menu.eesz.4M3M.upload.maximum_size=1044464 +espduino.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +espduino.menu.eesz.4M3M.build.spiffs_start=0x100000 +espduino.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +espduino.menu.eesz.4M3M.build.spiffs_blocksize=8192 +espduino.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +espduino.menu.eesz.4M1M.build.flash_size=4M +espduino.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +espduino.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +espduino.menu.eesz.4M1M.build.spiffs_pagesize=256 +espduino.menu.eesz.4M1M.upload.maximum_size=1044464 +espduino.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +espduino.menu.eesz.4M1M.build.spiffs_start=0x300000 +espduino.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +espduino.menu.eesz.4M1M.build.spiffs_blocksize=8192 +espduino.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +espduino.menu.eesz.4M.build.flash_size=4M +espduino.menu.eesz.4M.build.flash_size_bytes=0x400000 +espduino.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +espduino.menu.eesz.4M.build.spiffs_pagesize=256 +espduino.menu.eesz.4M.upload.maximum_size=1044464 +espduino.menu.eesz.4M.build.rfcal_addr=0x3FC000 +espduino.menu.ip.lm2f=v2 Lower Memory +espduino.menu.ip.lm2f.build.lwip_include=lwip2/include +espduino.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +espduino.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espduino.menu.ip.hb2f=v2 Higher Bandwidth +espduino.menu.ip.hb2f.build.lwip_include=lwip2/include +espduino.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +espduino.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espduino.menu.ip.lm2n=v2 Lower Memory (no features) +espduino.menu.ip.lm2n.build.lwip_include=lwip2/include +espduino.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +espduino.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espduino.menu.ip.hb2n=v2 Higher Bandwidth (no features) +espduino.menu.ip.hb2n.build.lwip_include=lwip2/include +espduino.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +espduino.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espduino.menu.ip.lm6f=v2 IPv6 Lower Memory +espduino.menu.ip.lm6f.build.lwip_include=lwip2/include +espduino.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +espduino.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espduino.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +espduino.menu.ip.hb6f.build.lwip_include=lwip2/include +espduino.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +espduino.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espduino.menu.dbg.Disabled=Disabled +espduino.menu.dbg.Disabled.build.debug_port= +espduino.menu.dbg.Serial=Serial +espduino.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +espduino.menu.dbg.Serial1=Serial1 +espduino.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +espduino.menu.lvl.None____=None +espduino.menu.lvl.None____.build.debug_level= +espduino.menu.lvl.SSL=SSL +espduino.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +espduino.menu.lvl.TLS_MEM=TLS_MEM +espduino.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +espduino.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +espduino.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +espduino.menu.lvl.HTTP_SERVER=HTTP_SERVER +espduino.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +espduino.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +espduino.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +espduino.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +espduino.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +espduino.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +espduino.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espduino.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +espduino.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +espduino.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espduino.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +espduino.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +espduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espduino.menu.lvl.CORE=CORE +espduino.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +espduino.menu.lvl.WIFI=WIFI +espduino.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +espduino.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +espduino.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +espduino.menu.lvl.UPDATER=UPDATER +espduino.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +espduino.menu.lvl.OTA=OTA +espduino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +espduino.menu.lvl.OOM=OOM +espduino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +espduino.menu.lvl.MDNS=MDNS +espduino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +espduino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +espduino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +espduino.menu.wipe.none=Only Sketch +espduino.menu.wipe.none.upload.erase_cmd= +espduino.menu.wipe.sdk=Sketch + WiFi Settings +espduino.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +espduino.menu.wipe.all=All Flash Contents +espduino.menu.wipe.all.upload.erase_cmd=erase_flash +espduino.menu.baud.115200=115200 +espduino.menu.baud.115200.upload.speed=115200 +espduino.menu.baud.57600=57600 +espduino.menu.baud.57600.upload.speed=57600 +espduino.menu.baud.230400.linux=230400 +espduino.menu.baud.230400.macosx=230400 +espduino.menu.baud.230400.upload.speed=230400 +espduino.menu.baud.256000.windows=256000 +espduino.menu.baud.256000.upload.speed=256000 +espduino.menu.baud.460800.linux=460800 +espduino.menu.baud.460800.macosx=460800 +espduino.menu.baud.460800.upload.speed=460800 +espduino.menu.baud.512000.windows=512000 +espduino.menu.baud.512000.upload.speed=512000 +espduino.menu.baud.921600=921600 +espduino.menu.baud.921600.upload.speed=921600 +espduino.menu.baud.3000000=3000000 +espduino.menu.baud.3000000.upload.speed=3000000 ############################################################## espectro.name=ESPectro Core @@ -6438,6 +2533,18 @@ espectro.menu.ssl.all=All SSL ciphers (most compatible) espectro.menu.ssl.all.build.sslflags= espectro.menu.ssl.basic=Basic SSL ciphers (lower ROM use) espectro.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +espectro.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +espectro.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +espectro.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +espectro.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +espectro.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +espectro.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +espectro.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +espectro.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +espectro.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +espectro.menu.non32xfer.fast.build.non32xferflags= +espectro.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +espectro.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER espectro.upload.resetmethod=--before default_reset --after hard_reset espectro.build.flash_mode=dio espectro.build.flash_flags=-DFLASHMODE_DIO @@ -6587,191 +2694,610 @@ espectro.menu.baud.3000000=3000000 espectro.menu.baud.3000000.upload.speed=3000000 ############################################################## -eduinowifi.name=Schirmilabs Eduino WiFi -eduinowifi.build.board=ESP8266_SCHIRMILABS_EDUINO_WIFI -eduinowifi.build.variant=eduinowifi -eduinowifi.upload.tool=esptool -eduinowifi.upload.maximum_data_size=81920 -eduinowifi.upload.wait_for_upload_port=true -eduinowifi.upload.erase_cmd= -eduinowifi.serial.disableDTR=true -eduinowifi.serial.disableRTS=true -eduinowifi.build.mcu=esp8266 -eduinowifi.build.core=esp8266 -eduinowifi.build.spiffs_pagesize=256 -eduinowifi.build.debug_port= -eduinowifi.build.debug_level= -eduinowifi.menu.xtal.80=80 MHz -eduinowifi.menu.xtal.80.build.f_cpu=80000000L -eduinowifi.menu.xtal.160=160 MHz -eduinowifi.menu.xtal.160.build.f_cpu=160000000L -eduinowifi.menu.vt.flash=Flash -eduinowifi.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -eduinowifi.menu.vt.heap=Heap -eduinowifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -eduinowifi.menu.vt.iram=IRAM -eduinowifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -eduinowifi.menu.exception.disabled=Disabled (new aborts on oom) -eduinowifi.menu.exception.disabled.build.exception_flags=-fno-exceptions -eduinowifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -eduinowifi.menu.exception.enabled=Enabled -eduinowifi.menu.exception.enabled.build.exception_flags=-fexceptions -eduinowifi.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -eduinowifi.menu.stacksmash.disabled=Disabled -eduinowifi.menu.stacksmash.disabled.build.stacksmash_flags= -eduinowifi.menu.stacksmash.enabled=Enabled -eduinowifi.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -eduinowifi.menu.ssl.all=All SSL ciphers (most compatible) -eduinowifi.menu.ssl.all.build.sslflags= -eduinowifi.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -eduinowifi.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -eduinowifi.upload.resetmethod=--before default_reset --after hard_reset -eduinowifi.build.flash_mode=dio -eduinowifi.build.flash_flags=-DFLASHMODE_DIO -eduinowifi.build.flash_freq=40 -eduinowifi.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) -eduinowifi.menu.eesz.4M2M.build.flash_size=4M -eduinowifi.menu.eesz.4M2M.build.flash_size_bytes=0x400000 -eduinowifi.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld -eduinowifi.menu.eesz.4M2M.build.spiffs_pagesize=256 -eduinowifi.menu.eesz.4M2M.upload.maximum_size=1044464 -eduinowifi.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 -eduinowifi.menu.eesz.4M2M.build.spiffs_start=0x200000 -eduinowifi.menu.eesz.4M2M.build.spiffs_end=0x3FA000 -eduinowifi.menu.eesz.4M2M.build.spiffs_blocksize=8192 -eduinowifi.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) -eduinowifi.menu.eesz.4M3M.build.flash_size=4M -eduinowifi.menu.eesz.4M3M.build.flash_size_bytes=0x400000 -eduinowifi.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld -eduinowifi.menu.eesz.4M3M.build.spiffs_pagesize=256 -eduinowifi.menu.eesz.4M3M.upload.maximum_size=1044464 -eduinowifi.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 -eduinowifi.menu.eesz.4M3M.build.spiffs_start=0x100000 -eduinowifi.menu.eesz.4M3M.build.spiffs_end=0x3FA000 -eduinowifi.menu.eesz.4M3M.build.spiffs_blocksize=8192 -eduinowifi.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) -eduinowifi.menu.eesz.4M1M.build.flash_size=4M -eduinowifi.menu.eesz.4M1M.build.flash_size_bytes=0x400000 -eduinowifi.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld -eduinowifi.menu.eesz.4M1M.build.spiffs_pagesize=256 -eduinowifi.menu.eesz.4M1M.upload.maximum_size=1044464 -eduinowifi.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 -eduinowifi.menu.eesz.4M1M.build.spiffs_start=0x300000 -eduinowifi.menu.eesz.4M1M.build.spiffs_end=0x3FA000 -eduinowifi.menu.eesz.4M1M.build.spiffs_blocksize=8192 -eduinowifi.menu.eesz.4M=4MB (FS:none OTA:~1019KB) -eduinowifi.menu.eesz.4M.build.flash_size=4M -eduinowifi.menu.eesz.4M.build.flash_size_bytes=0x400000 -eduinowifi.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld -eduinowifi.menu.eesz.4M.build.spiffs_pagesize=256 -eduinowifi.menu.eesz.4M.upload.maximum_size=1044464 -eduinowifi.menu.eesz.4M.build.rfcal_addr=0x3FC000 -eduinowifi.menu.ip.lm2f=v2 Lower Memory -eduinowifi.menu.ip.lm2f.build.lwip_include=lwip2/include -eduinowifi.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -eduinowifi.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -eduinowifi.menu.ip.hb2f=v2 Higher Bandwidth -eduinowifi.menu.ip.hb2f.build.lwip_include=lwip2/include -eduinowifi.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -eduinowifi.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -eduinowifi.menu.ip.lm2n=v2 Lower Memory (no features) -eduinowifi.menu.ip.lm2n.build.lwip_include=lwip2/include -eduinowifi.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -eduinowifi.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -eduinowifi.menu.ip.hb2n=v2 Higher Bandwidth (no features) -eduinowifi.menu.ip.hb2n.build.lwip_include=lwip2/include -eduinowifi.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -eduinowifi.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -eduinowifi.menu.ip.lm6f=v2 IPv6 Lower Memory -eduinowifi.menu.ip.lm6f.build.lwip_include=lwip2/include -eduinowifi.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -eduinowifi.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -eduinowifi.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -eduinowifi.menu.ip.hb6f.build.lwip_include=lwip2/include -eduinowifi.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -eduinowifi.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -eduinowifi.menu.dbg.Disabled=Disabled -eduinowifi.menu.dbg.Disabled.build.debug_port= -eduinowifi.menu.dbg.Serial=Serial -eduinowifi.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -eduinowifi.menu.dbg.Serial1=Serial1 -eduinowifi.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -eduinowifi.menu.lvl.None____=None -eduinowifi.menu.lvl.None____.build.debug_level= -eduinowifi.menu.lvl.SSL=SSL -eduinowifi.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -eduinowifi.menu.lvl.TLS_MEM=TLS_MEM -eduinowifi.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -eduinowifi.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -eduinowifi.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -eduinowifi.menu.lvl.HTTP_SERVER=HTTP_SERVER -eduinowifi.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -eduinowifi.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -eduinowifi.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -eduinowifi.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -eduinowifi.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -eduinowifi.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -eduinowifi.menu.lvl.CORE=CORE -eduinowifi.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -eduinowifi.menu.lvl.WIFI=WIFI -eduinowifi.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -eduinowifi.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -eduinowifi.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -eduinowifi.menu.lvl.UPDATER=UPDATER -eduinowifi.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -eduinowifi.menu.lvl.OTA=OTA -eduinowifi.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -eduinowifi.menu.lvl.OOM=OOM -eduinowifi.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -eduinowifi.menu.lvl.MDNS=MDNS -eduinowifi.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -eduinowifi.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -eduinowifi.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -eduinowifi.menu.wipe.none=Only Sketch -eduinowifi.menu.wipe.none.upload.erase_cmd= -eduinowifi.menu.wipe.sdk=Sketch + WiFi Settings -eduinowifi.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -eduinowifi.menu.wipe.all=All Flash Contents -eduinowifi.menu.wipe.all.upload.erase_cmd=erase_flash -eduinowifi.menu.baud.512000.windows=512000 -eduinowifi.menu.baud.512000.upload.speed=512000 -eduinowifi.menu.baud.57600=57600 -eduinowifi.menu.baud.57600.upload.speed=57600 -eduinowifi.menu.baud.115200=115200 -eduinowifi.menu.baud.115200.upload.speed=115200 -eduinowifi.menu.baud.230400.linux=230400 -eduinowifi.menu.baud.230400.macosx=230400 -eduinowifi.menu.baud.230400.upload.speed=230400 -eduinowifi.menu.baud.256000.windows=256000 -eduinowifi.menu.baud.256000.upload.speed=256000 -eduinowifi.menu.baud.460800.linux=460800 -eduinowifi.menu.baud.460800.macosx=460800 -eduinowifi.menu.baud.460800.upload.speed=460800 -eduinowifi.menu.baud.921600=921600 -eduinowifi.menu.baud.921600.upload.speed=921600 -eduinowifi.menu.baud.3000000=3000000 -eduinowifi.menu.baud.3000000.upload.speed=3000000 +espino.name=ESPino (ESP-12 Module) +espino.build.board=ESP8266_ESP12 +espino.build.variant=espino +espino.upload.tool=esptool +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.core=esp8266 +espino.build.spiffs_pagesize=256 +espino.build.debug_port= +espino.build.debug_level= +espino.menu.xtal.80=80 MHz +espino.menu.xtal.80.build.f_cpu=80000000L +espino.menu.xtal.160=160 MHz +espino.menu.xtal.160.build.f_cpu=160000000L +espino.menu.vt.flash=Flash +espino.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +espino.menu.vt.heap=Heap +espino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +espino.menu.vt.iram=IRAM +espino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +espino.menu.exception.disabled=Disabled (new aborts on oom) +espino.menu.exception.disabled.build.exception_flags=-fno-exceptions +espino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +espino.menu.exception.enabled=Enabled +espino.menu.exception.enabled.build.exception_flags=-fexceptions +espino.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +espino.menu.stacksmash.disabled=Disabled +espino.menu.stacksmash.disabled.build.stacksmash_flags= +espino.menu.stacksmash.enabled=Enabled +espino.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +espino.menu.ssl.all=All SSL ciphers (most compatible) +espino.menu.ssl.all.build.sslflags= +espino.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +espino.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +espino.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +espino.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +espino.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +espino.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +espino.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +espino.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +espino.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +espino.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +espino.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +espino.menu.non32xfer.fast.build.non32xferflags= +espino.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +espino.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +espino.menu.ResetMethod.nodemcu=dtr (aka nodemcu) +espino.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset +espino.menu.ResetMethod.ck=no dtr (aka ck) +espino.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset +espino.build.flash_mode=qio +espino.build.flash_flags=-DFLASHMODE_QIO +espino.build.flash_freq=40 +espino.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +espino.menu.eesz.4M2M.build.flash_size=4M +espino.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +espino.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +espino.menu.eesz.4M2M.build.spiffs_pagesize=256 +espino.menu.eesz.4M2M.upload.maximum_size=1044464 +espino.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +espino.menu.eesz.4M2M.build.spiffs_start=0x200000 +espino.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +espino.menu.eesz.4M2M.build.spiffs_blocksize=8192 +espino.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +espino.menu.eesz.4M3M.build.flash_size=4M +espino.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +espino.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +espino.menu.eesz.4M3M.build.spiffs_pagesize=256 +espino.menu.eesz.4M3M.upload.maximum_size=1044464 +espino.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +espino.menu.eesz.4M3M.build.spiffs_start=0x100000 +espino.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +espino.menu.eesz.4M3M.build.spiffs_blocksize=8192 +espino.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +espino.menu.eesz.4M1M.build.flash_size=4M +espino.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +espino.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +espino.menu.eesz.4M1M.build.spiffs_pagesize=256 +espino.menu.eesz.4M1M.upload.maximum_size=1044464 +espino.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +espino.menu.eesz.4M1M.build.spiffs_start=0x300000 +espino.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +espino.menu.eesz.4M1M.build.spiffs_blocksize=8192 +espino.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +espino.menu.eesz.4M.build.flash_size=4M +espino.menu.eesz.4M.build.flash_size_bytes=0x400000 +espino.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +espino.menu.eesz.4M.build.spiffs_pagesize=256 +espino.menu.eesz.4M.upload.maximum_size=1044464 +espino.menu.eesz.4M.build.rfcal_addr=0x3FC000 +espino.menu.ip.lm2f=v2 Lower Memory +espino.menu.ip.lm2f.build.lwip_include=lwip2/include +espino.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +espino.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espino.menu.ip.hb2f=v2 Higher Bandwidth +espino.menu.ip.hb2f.build.lwip_include=lwip2/include +espino.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +espino.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espino.menu.ip.lm2n=v2 Lower Memory (no features) +espino.menu.ip.lm2n.build.lwip_include=lwip2/include +espino.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +espino.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espino.menu.ip.hb2n=v2 Higher Bandwidth (no features) +espino.menu.ip.hb2n.build.lwip_include=lwip2/include +espino.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +espino.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espino.menu.ip.lm6f=v2 IPv6 Lower Memory +espino.menu.ip.lm6f.build.lwip_include=lwip2/include +espino.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +espino.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espino.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +espino.menu.ip.hb6f.build.lwip_include=lwip2/include +espino.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +espino.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espino.menu.dbg.Disabled=Disabled +espino.menu.dbg.Disabled.build.debug_port= +espino.menu.dbg.Serial=Serial +espino.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +espino.menu.dbg.Serial1=Serial1 +espino.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +espino.menu.lvl.None____=None +espino.menu.lvl.None____.build.debug_level= +espino.menu.lvl.SSL=SSL +espino.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +espino.menu.lvl.TLS_MEM=TLS_MEM +espino.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +espino.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +espino.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +espino.menu.lvl.HTTP_SERVER=HTTP_SERVER +espino.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +espino.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +espino.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +espino.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +espino.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +espino.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +espino.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espino.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +espino.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +espino.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espino.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +espino.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +espino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espino.menu.lvl.CORE=CORE +espino.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +espino.menu.lvl.WIFI=WIFI +espino.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +espino.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +espino.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +espino.menu.lvl.UPDATER=UPDATER +espino.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +espino.menu.lvl.OTA=OTA +espino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +espino.menu.lvl.OOM=OOM +espino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +espino.menu.lvl.MDNS=MDNS +espino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +espino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +espino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +espino.menu.wipe.none=Only Sketch +espino.menu.wipe.none.upload.erase_cmd= +espino.menu.wipe.sdk=Sketch + WiFi Settings +espino.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +espino.menu.wipe.all=All Flash Contents +espino.menu.wipe.all.upload.erase_cmd=erase_flash +espino.menu.baud.115200=115200 +espino.menu.baud.115200.upload.speed=115200 +espino.menu.baud.57600=57600 +espino.menu.baud.57600.upload.speed=57600 +espino.menu.baud.230400.linux=230400 +espino.menu.baud.230400.macosx=230400 +espino.menu.baud.230400.upload.speed=230400 +espino.menu.baud.256000.windows=256000 +espino.menu.baud.256000.upload.speed=256000 +espino.menu.baud.460800.linux=460800 +espino.menu.baud.460800.macosx=460800 +espino.menu.baud.460800.upload.speed=460800 +espino.menu.baud.512000.windows=512000 +espino.menu.baud.512000.upload.speed=512000 +espino.menu.baud.921600=921600 +espino.menu.baud.921600.upload.speed=921600 +espino.menu.baud.3000000=3000000 +espino.menu.baud.3000000.upload.speed=3000000 + +############################################################## +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.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.core=esp8266 +espresso_lite_v1.build.spiffs_pagesize=256 +espresso_lite_v1.build.debug_port= +espresso_lite_v1.build.debug_level= +espresso_lite_v1.menu.xtal.80=80 MHz +espresso_lite_v1.menu.xtal.80.build.f_cpu=80000000L +espresso_lite_v1.menu.xtal.160=160 MHz +espresso_lite_v1.menu.xtal.160.build.f_cpu=160000000L +espresso_lite_v1.menu.vt.flash=Flash +espresso_lite_v1.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +espresso_lite_v1.menu.vt.heap=Heap +espresso_lite_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +espresso_lite_v1.menu.vt.iram=IRAM +espresso_lite_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +espresso_lite_v1.menu.exception.disabled=Disabled (new aborts on oom) +espresso_lite_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions +espresso_lite_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +espresso_lite_v1.menu.exception.enabled=Enabled +espresso_lite_v1.menu.exception.enabled.build.exception_flags=-fexceptions +espresso_lite_v1.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +espresso_lite_v1.menu.stacksmash.disabled=Disabled +espresso_lite_v1.menu.stacksmash.disabled.build.stacksmash_flags= +espresso_lite_v1.menu.stacksmash.enabled=Enabled +espresso_lite_v1.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +espresso_lite_v1.menu.ssl.all=All SSL ciphers (most compatible) +espresso_lite_v1.menu.ssl.all.build.sslflags= +espresso_lite_v1.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +espresso_lite_v1.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +espresso_lite_v1.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +espresso_lite_v1.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +espresso_lite_v1.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +espresso_lite_v1.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +espresso_lite_v1.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +espresso_lite_v1.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +espresso_lite_v1.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +espresso_lite_v1.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +espresso_lite_v1.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +espresso_lite_v1.menu.non32xfer.fast.build.non32xferflags= +espresso_lite_v1.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +espresso_lite_v1.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +espresso_lite_v1.build.flash_mode=dio +espresso_lite_v1.build.flash_flags=-DFLASHMODE_DIO +espresso_lite_v1.build.flash_freq=40 +espresso_lite_v1.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +espresso_lite_v1.menu.eesz.4M2M.build.flash_size=4M +espresso_lite_v1.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +espresso_lite_v1.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +espresso_lite_v1.menu.eesz.4M2M.build.spiffs_pagesize=256 +espresso_lite_v1.menu.eesz.4M2M.upload.maximum_size=1044464 +espresso_lite_v1.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +espresso_lite_v1.menu.eesz.4M2M.build.spiffs_start=0x200000 +espresso_lite_v1.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +espresso_lite_v1.menu.eesz.4M2M.build.spiffs_blocksize=8192 +espresso_lite_v1.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +espresso_lite_v1.menu.eesz.4M3M.build.flash_size=4M +espresso_lite_v1.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +espresso_lite_v1.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +espresso_lite_v1.menu.eesz.4M3M.build.spiffs_pagesize=256 +espresso_lite_v1.menu.eesz.4M3M.upload.maximum_size=1044464 +espresso_lite_v1.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +espresso_lite_v1.menu.eesz.4M3M.build.spiffs_start=0x100000 +espresso_lite_v1.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +espresso_lite_v1.menu.eesz.4M3M.build.spiffs_blocksize=8192 +espresso_lite_v1.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +espresso_lite_v1.menu.eesz.4M1M.build.flash_size=4M +espresso_lite_v1.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +espresso_lite_v1.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +espresso_lite_v1.menu.eesz.4M1M.build.spiffs_pagesize=256 +espresso_lite_v1.menu.eesz.4M1M.upload.maximum_size=1044464 +espresso_lite_v1.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +espresso_lite_v1.menu.eesz.4M1M.build.spiffs_start=0x300000 +espresso_lite_v1.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +espresso_lite_v1.menu.eesz.4M1M.build.spiffs_blocksize=8192 +espresso_lite_v1.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +espresso_lite_v1.menu.eesz.4M.build.flash_size=4M +espresso_lite_v1.menu.eesz.4M.build.flash_size_bytes=0x400000 +espresso_lite_v1.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +espresso_lite_v1.menu.eesz.4M.build.spiffs_pagesize=256 +espresso_lite_v1.menu.eesz.4M.upload.maximum_size=1044464 +espresso_lite_v1.menu.eesz.4M.build.rfcal_addr=0x3FC000 +espresso_lite_v1.menu.ResetMethod.nodemcu=dtr (aka nodemcu) +espresso_lite_v1.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset +espresso_lite_v1.menu.ResetMethod.ck=no dtr (aka ck) +espresso_lite_v1.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset +espresso_lite_v1.menu.ip.lm2f=v2 Lower Memory +espresso_lite_v1.menu.ip.lm2f.build.lwip_include=lwip2/include +espresso_lite_v1.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +espresso_lite_v1.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espresso_lite_v1.menu.ip.hb2f=v2 Higher Bandwidth +espresso_lite_v1.menu.ip.hb2f.build.lwip_include=lwip2/include +espresso_lite_v1.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +espresso_lite_v1.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espresso_lite_v1.menu.ip.lm2n=v2 Lower Memory (no features) +espresso_lite_v1.menu.ip.lm2n.build.lwip_include=lwip2/include +espresso_lite_v1.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +espresso_lite_v1.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espresso_lite_v1.menu.ip.hb2n=v2 Higher Bandwidth (no features) +espresso_lite_v1.menu.ip.hb2n.build.lwip_include=lwip2/include +espresso_lite_v1.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +espresso_lite_v1.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espresso_lite_v1.menu.ip.lm6f=v2 IPv6 Lower Memory +espresso_lite_v1.menu.ip.lm6f.build.lwip_include=lwip2/include +espresso_lite_v1.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +espresso_lite_v1.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espresso_lite_v1.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +espresso_lite_v1.menu.ip.hb6f.build.lwip_include=lwip2/include +espresso_lite_v1.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +espresso_lite_v1.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espresso_lite_v1.menu.dbg.Disabled=Disabled +espresso_lite_v1.menu.dbg.Disabled.build.debug_port= +espresso_lite_v1.menu.dbg.Serial=Serial +espresso_lite_v1.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +espresso_lite_v1.menu.dbg.Serial1=Serial1 +espresso_lite_v1.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +espresso_lite_v1.menu.lvl.None____=None +espresso_lite_v1.menu.lvl.None____.build.debug_level= +espresso_lite_v1.menu.lvl.SSL=SSL +espresso_lite_v1.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +espresso_lite_v1.menu.lvl.TLS_MEM=TLS_MEM +espresso_lite_v1.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +espresso_lite_v1.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +espresso_lite_v1.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v1.menu.lvl.HTTP_SERVER=HTTP_SERVER +espresso_lite_v1.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v1.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +espresso_lite_v1.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +espresso_lite_v1.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +espresso_lite_v1.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v1.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +espresso_lite_v1.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v1.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +espresso_lite_v1.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +espresso_lite_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +espresso_lite_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espresso_lite_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espresso_lite_v1.menu.lvl.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.lvl.CORE=CORE +espresso_lite_v1.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +espresso_lite_v1.menu.lvl.WIFI=WIFI +espresso_lite_v1.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +espresso_lite_v1.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +espresso_lite_v1.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +espresso_lite_v1.menu.lvl.UPDATER=UPDATER +espresso_lite_v1.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +espresso_lite_v1.menu.lvl.OTA=OTA +espresso_lite_v1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +espresso_lite_v1.menu.lvl.OOM=OOM +espresso_lite_v1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +espresso_lite_v1.menu.lvl.MDNS=MDNS +espresso_lite_v1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +espresso_lite_v1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +espresso_lite_v1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +espresso_lite_v1.menu.wipe.none=Only Sketch +espresso_lite_v1.menu.wipe.none.upload.erase_cmd= +espresso_lite_v1.menu.wipe.sdk=Sketch + WiFi Settings +espresso_lite_v1.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +espresso_lite_v1.menu.wipe.all=All Flash Contents +espresso_lite_v1.menu.wipe.all.upload.erase_cmd=erase_flash +espresso_lite_v1.menu.baud.115200=115200 +espresso_lite_v1.menu.baud.115200.upload.speed=115200 +espresso_lite_v1.menu.baud.57600=57600 +espresso_lite_v1.menu.baud.57600.upload.speed=57600 +espresso_lite_v1.menu.baud.230400.linux=230400 +espresso_lite_v1.menu.baud.230400.macosx=230400 +espresso_lite_v1.menu.baud.230400.upload.speed=230400 +espresso_lite_v1.menu.baud.256000.windows=256000 +espresso_lite_v1.menu.baud.256000.upload.speed=256000 +espresso_lite_v1.menu.baud.460800.linux=460800 +espresso_lite_v1.menu.baud.460800.macosx=460800 +espresso_lite_v1.menu.baud.460800.upload.speed=460800 +espresso_lite_v1.menu.baud.512000.windows=512000 +espresso_lite_v1.menu.baud.512000.upload.speed=512000 +espresso_lite_v1.menu.baud.921600=921600 +espresso_lite_v1.menu.baud.921600.upload.speed=921600 +espresso_lite_v1.menu.baud.3000000=3000000 +espresso_lite_v1.menu.baud.3000000.upload.speed=3000000 + +############################################################## +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.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.core=esp8266 +espresso_lite_v2.build.spiffs_pagesize=256 +espresso_lite_v2.build.debug_port= +espresso_lite_v2.build.debug_level= +espresso_lite_v2.menu.xtal.80=80 MHz +espresso_lite_v2.menu.xtal.80.build.f_cpu=80000000L +espresso_lite_v2.menu.xtal.160=160 MHz +espresso_lite_v2.menu.xtal.160.build.f_cpu=160000000L +espresso_lite_v2.menu.vt.flash=Flash +espresso_lite_v2.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +espresso_lite_v2.menu.vt.heap=Heap +espresso_lite_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +espresso_lite_v2.menu.vt.iram=IRAM +espresso_lite_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +espresso_lite_v2.menu.exception.disabled=Disabled (new aborts on oom) +espresso_lite_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions +espresso_lite_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +espresso_lite_v2.menu.exception.enabled=Enabled +espresso_lite_v2.menu.exception.enabled.build.exception_flags=-fexceptions +espresso_lite_v2.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +espresso_lite_v2.menu.stacksmash.disabled=Disabled +espresso_lite_v2.menu.stacksmash.disabled.build.stacksmash_flags= +espresso_lite_v2.menu.stacksmash.enabled=Enabled +espresso_lite_v2.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +espresso_lite_v2.menu.ssl.all=All SSL ciphers (most compatible) +espresso_lite_v2.menu.ssl.all.build.sslflags= +espresso_lite_v2.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +espresso_lite_v2.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +espresso_lite_v2.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +espresso_lite_v2.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +espresso_lite_v2.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +espresso_lite_v2.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +espresso_lite_v2.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +espresso_lite_v2.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +espresso_lite_v2.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +espresso_lite_v2.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +espresso_lite_v2.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +espresso_lite_v2.menu.non32xfer.fast.build.non32xferflags= +espresso_lite_v2.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +espresso_lite_v2.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +espresso_lite_v2.build.flash_mode=dio +espresso_lite_v2.build.flash_flags=-DFLASHMODE_DIO +espresso_lite_v2.build.flash_freq=40 +espresso_lite_v2.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +espresso_lite_v2.menu.eesz.4M2M.build.flash_size=4M +espresso_lite_v2.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +espresso_lite_v2.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +espresso_lite_v2.menu.eesz.4M2M.build.spiffs_pagesize=256 +espresso_lite_v2.menu.eesz.4M2M.upload.maximum_size=1044464 +espresso_lite_v2.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +espresso_lite_v2.menu.eesz.4M2M.build.spiffs_start=0x200000 +espresso_lite_v2.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +espresso_lite_v2.menu.eesz.4M2M.build.spiffs_blocksize=8192 +espresso_lite_v2.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +espresso_lite_v2.menu.eesz.4M3M.build.flash_size=4M +espresso_lite_v2.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +espresso_lite_v2.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +espresso_lite_v2.menu.eesz.4M3M.build.spiffs_pagesize=256 +espresso_lite_v2.menu.eesz.4M3M.upload.maximum_size=1044464 +espresso_lite_v2.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +espresso_lite_v2.menu.eesz.4M3M.build.spiffs_start=0x100000 +espresso_lite_v2.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +espresso_lite_v2.menu.eesz.4M3M.build.spiffs_blocksize=8192 +espresso_lite_v2.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +espresso_lite_v2.menu.eesz.4M1M.build.flash_size=4M +espresso_lite_v2.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +espresso_lite_v2.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +espresso_lite_v2.menu.eesz.4M1M.build.spiffs_pagesize=256 +espresso_lite_v2.menu.eesz.4M1M.upload.maximum_size=1044464 +espresso_lite_v2.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +espresso_lite_v2.menu.eesz.4M1M.build.spiffs_start=0x300000 +espresso_lite_v2.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +espresso_lite_v2.menu.eesz.4M1M.build.spiffs_blocksize=8192 +espresso_lite_v2.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +espresso_lite_v2.menu.eesz.4M.build.flash_size=4M +espresso_lite_v2.menu.eesz.4M.build.flash_size_bytes=0x400000 +espresso_lite_v2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +espresso_lite_v2.menu.eesz.4M.build.spiffs_pagesize=256 +espresso_lite_v2.menu.eesz.4M.upload.maximum_size=1044464 +espresso_lite_v2.menu.eesz.4M.build.rfcal_addr=0x3FC000 +espresso_lite_v2.menu.ResetMethod.nodemcu=dtr (aka nodemcu) +espresso_lite_v2.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset +espresso_lite_v2.menu.ResetMethod.ck=no dtr (aka ck) +espresso_lite_v2.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset +espresso_lite_v2.menu.ip.lm2f=v2 Lower Memory +espresso_lite_v2.menu.ip.lm2f.build.lwip_include=lwip2/include +espresso_lite_v2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +espresso_lite_v2.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espresso_lite_v2.menu.ip.hb2f=v2 Higher Bandwidth +espresso_lite_v2.menu.ip.hb2f.build.lwip_include=lwip2/include +espresso_lite_v2.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +espresso_lite_v2.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espresso_lite_v2.menu.ip.lm2n=v2 Lower Memory (no features) +espresso_lite_v2.menu.ip.lm2n.build.lwip_include=lwip2/include +espresso_lite_v2.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +espresso_lite_v2.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espresso_lite_v2.menu.ip.hb2n=v2 Higher Bandwidth (no features) +espresso_lite_v2.menu.ip.hb2n.build.lwip_include=lwip2/include +espresso_lite_v2.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +espresso_lite_v2.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espresso_lite_v2.menu.ip.lm6f=v2 IPv6 Lower Memory +espresso_lite_v2.menu.ip.lm6f.build.lwip_include=lwip2/include +espresso_lite_v2.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +espresso_lite_v2.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espresso_lite_v2.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +espresso_lite_v2.menu.ip.hb6f.build.lwip_include=lwip2/include +espresso_lite_v2.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +espresso_lite_v2.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espresso_lite_v2.menu.dbg.Disabled=Disabled +espresso_lite_v2.menu.dbg.Disabled.build.debug_port= +espresso_lite_v2.menu.dbg.Serial=Serial +espresso_lite_v2.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +espresso_lite_v2.menu.dbg.Serial1=Serial1 +espresso_lite_v2.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +espresso_lite_v2.menu.lvl.None____=None +espresso_lite_v2.menu.lvl.None____.build.debug_level= +espresso_lite_v2.menu.lvl.SSL=SSL +espresso_lite_v2.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +espresso_lite_v2.menu.lvl.TLS_MEM=TLS_MEM +espresso_lite_v2.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +espresso_lite_v2.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +espresso_lite_v2.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v2.menu.lvl.HTTP_SERVER=HTTP_SERVER +espresso_lite_v2.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v2.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +espresso_lite_v2.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +espresso_lite_v2.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +espresso_lite_v2.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v2.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +espresso_lite_v2.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v2.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +espresso_lite_v2.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +espresso_lite_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +espresso_lite_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espresso_lite_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espresso_lite_v2.menu.lvl.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.lvl.CORE=CORE +espresso_lite_v2.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +espresso_lite_v2.menu.lvl.WIFI=WIFI +espresso_lite_v2.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +espresso_lite_v2.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +espresso_lite_v2.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +espresso_lite_v2.menu.lvl.UPDATER=UPDATER +espresso_lite_v2.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +espresso_lite_v2.menu.lvl.OTA=OTA +espresso_lite_v2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +espresso_lite_v2.menu.lvl.OOM=OOM +espresso_lite_v2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +espresso_lite_v2.menu.lvl.MDNS=MDNS +espresso_lite_v2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espresso_lite_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +espresso_lite_v2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +espresso_lite_v2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +espresso_lite_v2.menu.wipe.none=Only Sketch +espresso_lite_v2.menu.wipe.none.upload.erase_cmd= +espresso_lite_v2.menu.wipe.sdk=Sketch + WiFi Settings +espresso_lite_v2.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +espresso_lite_v2.menu.wipe.all=All Flash Contents +espresso_lite_v2.menu.wipe.all.upload.erase_cmd=erase_flash +espresso_lite_v2.menu.baud.115200=115200 +espresso_lite_v2.menu.baud.115200.upload.speed=115200 +espresso_lite_v2.menu.baud.57600=57600 +espresso_lite_v2.menu.baud.57600.upload.speed=57600 +espresso_lite_v2.menu.baud.230400.linux=230400 +espresso_lite_v2.menu.baud.230400.macosx=230400 +espresso_lite_v2.menu.baud.230400.upload.speed=230400 +espresso_lite_v2.menu.baud.256000.windows=256000 +espresso_lite_v2.menu.baud.256000.upload.speed=256000 +espresso_lite_v2.menu.baud.460800.linux=460800 +espresso_lite_v2.menu.baud.460800.macosx=460800 +espresso_lite_v2.menu.baud.460800.upload.speed=460800 +espresso_lite_v2.menu.baud.512000.windows=512000 +espresso_lite_v2.menu.baud.512000.upload.speed=512000 +espresso_lite_v2.menu.baud.921600=921600 +espresso_lite_v2.menu.baud.921600.upload.speed=921600 +espresso_lite_v2.menu.baud.3000000=3000000 +espresso_lite_v2.menu.baud.3000000.upload.speed=3000000 ############################################################## sonoff.name=ITEAD Sonoff @@ -6822,6 +3348,18 @@ sonoff.menu.ssl.all=All SSL ciphers (most compatible) sonoff.menu.ssl.all.build.sslflags= sonoff.menu.ssl.basic=Basic SSL ciphers (lower ROM use) sonoff.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +sonoff.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +sonoff.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +sonoff.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +sonoff.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +sonoff.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +sonoff.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +sonoff.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +sonoff.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +sonoff.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +sonoff.menu.non32xfer.fast.build.non32xferflags= +sonoff.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +sonoff.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER sonoff.upload.resetmethod=--before no_reset --after soft_reset sonoff.build.flash_mode=dout sonoff.build.flash_flags=-DFLASHMODE_DOUT @@ -7011,230 +3549,4102 @@ sonoff.menu.baud.3000000=3000000 sonoff.menu.baud.3000000.upload.speed=3000000 ############################################################## -espmxdevkit.name=DOIT ESP-Mx DevKit (ESP8285) -espmxdevkit.build.board=ESP8266_ESP01 -espmxdevkit.build.led=-DLED_BUILTIN=16 -espmxdevkit.build.variant=esp8285 -espmxdevkit.upload.tool=esptool -espmxdevkit.upload.maximum_data_size=81920 -espmxdevkit.upload.wait_for_upload_port=true -espmxdevkit.upload.erase_cmd= -espmxdevkit.serial.disableDTR=true -espmxdevkit.serial.disableRTS=true -espmxdevkit.build.mcu=esp8266 -espmxdevkit.build.core=esp8266 -espmxdevkit.build.spiffs_pagesize=256 -espmxdevkit.build.debug_port= -espmxdevkit.build.debug_level= -espmxdevkit.menu.xtal.80=80 MHz -espmxdevkit.menu.xtal.80.build.f_cpu=80000000L -espmxdevkit.menu.xtal.160=160 MHz -espmxdevkit.menu.xtal.160.build.f_cpu=160000000L -espmxdevkit.menu.vt.flash=Flash -espmxdevkit.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH -espmxdevkit.menu.vt.heap=Heap -espmxdevkit.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM -espmxdevkit.menu.vt.iram=IRAM -espmxdevkit.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM -espmxdevkit.menu.exception.disabled=Disabled (new aborts on oom) -espmxdevkit.menu.exception.disabled.build.exception_flags=-fno-exceptions -espmxdevkit.menu.exception.disabled.build.stdcpp_lib=-lstdc++ -espmxdevkit.menu.exception.enabled=Enabled -espmxdevkit.menu.exception.enabled.build.exception_flags=-fexceptions -espmxdevkit.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc -espmxdevkit.menu.stacksmash.disabled=Disabled -espmxdevkit.menu.stacksmash.disabled.build.stacksmash_flags= -espmxdevkit.menu.stacksmash.enabled=Enabled -espmxdevkit.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector -espmxdevkit.menu.ssl.all=All SSL ciphers (most compatible) -espmxdevkit.menu.ssl.all.build.sslflags= -espmxdevkit.menu.ssl.basic=Basic SSL ciphers (lower ROM use) -espmxdevkit.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC -espmxdevkit.upload.resetmethod=--before default_reset --after hard_reset -espmxdevkit.build.flash_mode=dout -espmxdevkit.build.flash_flags=-DFLASHMODE_DOUT -espmxdevkit.build.flash_freq=40 -espmxdevkit.menu.eesz.1M64=1MB (FS:64KB OTA:~470KB) -espmxdevkit.menu.eesz.1M64.build.flash_size=1M -espmxdevkit.menu.eesz.1M64.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M64.build.flash_ld=eagle.flash.1m64.ld -espmxdevkit.menu.eesz.1M64.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M64.upload.maximum_size=958448 -espmxdevkit.menu.eesz.1M64.build.rfcal_addr=0xFC000 -espmxdevkit.menu.eesz.1M64.build.spiffs_start=0xEB000 -espmxdevkit.menu.eesz.1M64.build.spiffs_end=0xFB000 -espmxdevkit.menu.eesz.1M64.build.spiffs_blocksize=4096 -espmxdevkit.menu.eesz.1M128=1MB (FS:128KB OTA:~438KB) -espmxdevkit.menu.eesz.1M128.build.flash_size=1M -espmxdevkit.menu.eesz.1M128.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M128.build.flash_ld=eagle.flash.1m128.ld -espmxdevkit.menu.eesz.1M128.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M128.upload.maximum_size=892912 -espmxdevkit.menu.eesz.1M128.build.rfcal_addr=0xFC000 -espmxdevkit.menu.eesz.1M128.build.spiffs_start=0xDB000 -espmxdevkit.menu.eesz.1M128.build.spiffs_end=0xFB000 -espmxdevkit.menu.eesz.1M128.build.spiffs_blocksize=4096 -espmxdevkit.menu.eesz.1M144=1MB (FS:144KB OTA:~430KB) -espmxdevkit.menu.eesz.1M144.build.flash_size=1M -espmxdevkit.menu.eesz.1M144.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M144.build.flash_ld=eagle.flash.1m144.ld -espmxdevkit.menu.eesz.1M144.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M144.upload.maximum_size=876528 -espmxdevkit.menu.eesz.1M144.build.rfcal_addr=0xFC000 -espmxdevkit.menu.eesz.1M144.build.spiffs_start=0xD7000 -espmxdevkit.menu.eesz.1M144.build.spiffs_end=0xFB000 -espmxdevkit.menu.eesz.1M144.build.spiffs_blocksize=4096 -espmxdevkit.menu.eesz.1M160=1MB (FS:160KB OTA:~422KB) -espmxdevkit.menu.eesz.1M160.build.flash_size=1M -espmxdevkit.menu.eesz.1M160.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M160.build.flash_ld=eagle.flash.1m160.ld -espmxdevkit.menu.eesz.1M160.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M160.upload.maximum_size=860144 -espmxdevkit.menu.eesz.1M160.build.rfcal_addr=0xFC000 -espmxdevkit.menu.eesz.1M160.build.spiffs_start=0xD3000 -espmxdevkit.menu.eesz.1M160.build.spiffs_end=0xFB000 -espmxdevkit.menu.eesz.1M160.build.spiffs_blocksize=4096 -espmxdevkit.menu.eesz.1M192=1MB (FS:192KB OTA:~406KB) -espmxdevkit.menu.eesz.1M192.build.flash_size=1M -espmxdevkit.menu.eesz.1M192.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M192.build.flash_ld=eagle.flash.1m192.ld -espmxdevkit.menu.eesz.1M192.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M192.upload.maximum_size=827376 -espmxdevkit.menu.eesz.1M192.build.rfcal_addr=0xFC000 -espmxdevkit.menu.eesz.1M192.build.spiffs_start=0xCB000 -espmxdevkit.menu.eesz.1M192.build.spiffs_end=0xFB000 -espmxdevkit.menu.eesz.1M192.build.spiffs_blocksize=4096 -espmxdevkit.menu.eesz.1M256=1MB (FS:256KB OTA:~374KB) -espmxdevkit.menu.eesz.1M256.build.flash_size=1M -espmxdevkit.menu.eesz.1M256.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M256.build.flash_ld=eagle.flash.1m256.ld -espmxdevkit.menu.eesz.1M256.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M256.upload.maximum_size=761840 -espmxdevkit.menu.eesz.1M256.build.rfcal_addr=0xFC000 -espmxdevkit.menu.eesz.1M256.build.spiffs_start=0xBB000 -espmxdevkit.menu.eesz.1M256.build.spiffs_end=0xFB000 -espmxdevkit.menu.eesz.1M256.build.spiffs_blocksize=4096 -espmxdevkit.menu.eesz.1M512=1MB (FS:512KB OTA:~246KB) -espmxdevkit.menu.eesz.1M512.build.flash_size=1M -espmxdevkit.menu.eesz.1M512.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M512.build.flash_ld=eagle.flash.1m512.ld -espmxdevkit.menu.eesz.1M512.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M512.upload.maximum_size=499696 -espmxdevkit.menu.eesz.1M512.build.rfcal_addr=0xFC000 -espmxdevkit.menu.eesz.1M512.build.spiffs_start=0x7B000 -espmxdevkit.menu.eesz.1M512.build.spiffs_end=0xFB000 -espmxdevkit.menu.eesz.1M512.build.spiffs_blocksize=8192 -espmxdevkit.menu.eesz.1M=1MB (FS:none OTA:~502KB) -espmxdevkit.menu.eesz.1M.build.flash_size=1M -espmxdevkit.menu.eesz.1M.build.flash_size_bytes=0x100000 -espmxdevkit.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld -espmxdevkit.menu.eesz.1M.build.spiffs_pagesize=256 -espmxdevkit.menu.eesz.1M.upload.maximum_size=1023984 -espmxdevkit.menu.eesz.1M.build.rfcal_addr=0xFC000 -espmxdevkit.menu.ip.lm2f=v2 Lower Memory -espmxdevkit.menu.ip.lm2f.build.lwip_include=lwip2/include -espmxdevkit.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat -espmxdevkit.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espmxdevkit.menu.ip.hb2f=v2 Higher Bandwidth -espmxdevkit.menu.ip.hb2f.build.lwip_include=lwip2/include -espmxdevkit.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat -espmxdevkit.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 -espmxdevkit.menu.ip.lm2n=v2 Lower Memory (no features) -espmxdevkit.menu.ip.lm2n.build.lwip_include=lwip2/include -espmxdevkit.menu.ip.lm2n.build.lwip_lib=-llwip2-536 -espmxdevkit.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espmxdevkit.menu.ip.hb2n=v2 Higher Bandwidth (no features) -espmxdevkit.menu.ip.hb2n.build.lwip_include=lwip2/include -espmxdevkit.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 -espmxdevkit.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 -espmxdevkit.menu.ip.lm6f=v2 IPv6 Lower Memory -espmxdevkit.menu.ip.lm6f.build.lwip_include=lwip2/include -espmxdevkit.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat -espmxdevkit.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espmxdevkit.menu.ip.hb6f=v2 IPv6 Higher Bandwidth -espmxdevkit.menu.ip.hb6f.build.lwip_include=lwip2/include -espmxdevkit.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat -espmxdevkit.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 -espmxdevkit.menu.dbg.Disabled=Disabled -espmxdevkit.menu.dbg.Disabled.build.debug_port= -espmxdevkit.menu.dbg.Serial=Serial -espmxdevkit.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial -espmxdevkit.menu.dbg.Serial1=Serial1 -espmxdevkit.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 -espmxdevkit.menu.lvl.None____=None -espmxdevkit.menu.lvl.None____.build.debug_level= -espmxdevkit.menu.lvl.SSL=SSL -espmxdevkit.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL -espmxdevkit.menu.lvl.TLS_MEM=TLS_MEM -espmxdevkit.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM -espmxdevkit.menu.lvl.HTTP_CLIENT=HTTP_CLIENT -espmxdevkit.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -espmxdevkit.menu.lvl.HTTP_SERVER=HTTP_SERVER -espmxdevkit.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM -espmxdevkit.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -espmxdevkit.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT -espmxdevkit.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -espmxdevkit.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER -espmxdevkit.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT -espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espmxdevkit.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER -espmxdevkit.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER -espmxdevkit.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER -espmxdevkit.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espmxdevkit.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER -espmxdevkit.menu.lvl.CORE=CORE -espmxdevkit.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE -espmxdevkit.menu.lvl.WIFI=WIFI -espmxdevkit.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI -espmxdevkit.menu.lvl.HTTP_UPDATE=HTTP_UPDATE -espmxdevkit.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE -espmxdevkit.menu.lvl.UPDATER=UPDATER -espmxdevkit.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER -espmxdevkit.menu.lvl.OTA=OTA -espmxdevkit.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA -espmxdevkit.menu.lvl.OOM=OOM -espmxdevkit.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM -espmxdevkit.menu.lvl.MDNS=MDNS -espmxdevkit.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS -espmxdevkit.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espmxdevkit.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS -espmxdevkit.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS -espmxdevkit.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG -espmxdevkit.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG -espmxdevkit.menu.wipe.none=Only Sketch -espmxdevkit.menu.wipe.none.upload.erase_cmd= -espmxdevkit.menu.wipe.sdk=Sketch + WiFi Settings -espmxdevkit.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 -espmxdevkit.menu.wipe.all=All Flash Contents -espmxdevkit.menu.wipe.all.upload.erase_cmd=erase_flash -espmxdevkit.menu.baud.115200=115200 -espmxdevkit.menu.baud.115200.upload.speed=115200 -espmxdevkit.menu.baud.57600=57600 -espmxdevkit.menu.baud.57600.upload.speed=57600 -espmxdevkit.menu.baud.230400.linux=230400 -espmxdevkit.menu.baud.230400.macosx=230400 -espmxdevkit.menu.baud.230400.upload.speed=230400 -espmxdevkit.menu.baud.256000.windows=256000 -espmxdevkit.menu.baud.256000.upload.speed=256000 -espmxdevkit.menu.baud.460800.linux=460800 -espmxdevkit.menu.baud.460800.macosx=460800 -espmxdevkit.menu.baud.460800.upload.speed=460800 -espmxdevkit.menu.baud.512000.windows=512000 -espmxdevkit.menu.baud.512000.upload.speed=512000 -espmxdevkit.menu.baud.921600=921600 -espmxdevkit.menu.baud.921600.upload.speed=921600 -espmxdevkit.menu.baud.3000000=3000000 -espmxdevkit.menu.baud.3000000.upload.speed=3000000 +inventone.name=Invent One +inventone.build.board=ESP8266_GENERIC +inventone.build.variant=inventone +inventone.upload.tool=esptool +inventone.upload.maximum_data_size=81920 +inventone.upload.wait_for_upload_port=true +inventone.upload.erase_cmd= +inventone.serial.disableDTR=true +inventone.serial.disableRTS=true +inventone.build.mcu=esp8266 +inventone.build.core=esp8266 +inventone.build.spiffs_pagesize=256 +inventone.build.debug_port= +inventone.build.debug_level= +inventone.menu.xtal.80=80 MHz +inventone.menu.xtal.80.build.f_cpu=80000000L +inventone.menu.xtal.160=160 MHz +inventone.menu.xtal.160.build.f_cpu=160000000L +inventone.menu.vt.flash=Flash +inventone.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +inventone.menu.vt.heap=Heap +inventone.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +inventone.menu.vt.iram=IRAM +inventone.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +inventone.menu.exception.disabled=Disabled (new aborts on oom) +inventone.menu.exception.disabled.build.exception_flags=-fno-exceptions +inventone.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +inventone.menu.exception.enabled=Enabled +inventone.menu.exception.enabled.build.exception_flags=-fexceptions +inventone.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +inventone.menu.stacksmash.disabled=Disabled +inventone.menu.stacksmash.disabled.build.stacksmash_flags= +inventone.menu.stacksmash.enabled=Enabled +inventone.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +inventone.menu.ssl.all=All SSL ciphers (most compatible) +inventone.menu.ssl.all.build.sslflags= +inventone.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +inventone.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +inventone.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +inventone.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +inventone.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +inventone.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +inventone.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +inventone.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +inventone.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +inventone.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +inventone.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +inventone.menu.non32xfer.fast.build.non32xferflags= +inventone.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +inventone.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +inventone.upload.resetmethod=--before default_reset --after hard_reset +inventone.build.flash_mode=dio +inventone.build.flash_flags=-DFLASHMODE_DIO +inventone.build.flash_freq=40 +inventone.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +inventone.menu.eesz.4M2M.build.flash_size=4M +inventone.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +inventone.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +inventone.menu.eesz.4M2M.build.spiffs_pagesize=256 +inventone.menu.eesz.4M2M.upload.maximum_size=1044464 +inventone.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +inventone.menu.eesz.4M2M.build.spiffs_start=0x200000 +inventone.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +inventone.menu.eesz.4M2M.build.spiffs_blocksize=8192 +inventone.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +inventone.menu.eesz.4M3M.build.flash_size=4M +inventone.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +inventone.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +inventone.menu.eesz.4M3M.build.spiffs_pagesize=256 +inventone.menu.eesz.4M3M.upload.maximum_size=1044464 +inventone.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +inventone.menu.eesz.4M3M.build.spiffs_start=0x100000 +inventone.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +inventone.menu.eesz.4M3M.build.spiffs_blocksize=8192 +inventone.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +inventone.menu.eesz.4M1M.build.flash_size=4M +inventone.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +inventone.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +inventone.menu.eesz.4M1M.build.spiffs_pagesize=256 +inventone.menu.eesz.4M1M.upload.maximum_size=1044464 +inventone.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +inventone.menu.eesz.4M1M.build.spiffs_start=0x300000 +inventone.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +inventone.menu.eesz.4M1M.build.spiffs_blocksize=8192 +inventone.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +inventone.menu.eesz.4M.build.flash_size=4M +inventone.menu.eesz.4M.build.flash_size_bytes=0x400000 +inventone.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +inventone.menu.eesz.4M.build.spiffs_pagesize=256 +inventone.menu.eesz.4M.upload.maximum_size=1044464 +inventone.menu.eesz.4M.build.rfcal_addr=0x3FC000 +inventone.menu.ip.lm2f=v2 Lower Memory +inventone.menu.ip.lm2f.build.lwip_include=lwip2/include +inventone.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +inventone.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +inventone.menu.ip.hb2f=v2 Higher Bandwidth +inventone.menu.ip.hb2f.build.lwip_include=lwip2/include +inventone.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +inventone.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +inventone.menu.ip.lm2n=v2 Lower Memory (no features) +inventone.menu.ip.lm2n.build.lwip_include=lwip2/include +inventone.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +inventone.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +inventone.menu.ip.hb2n=v2 Higher Bandwidth (no features) +inventone.menu.ip.hb2n.build.lwip_include=lwip2/include +inventone.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +inventone.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +inventone.menu.ip.lm6f=v2 IPv6 Lower Memory +inventone.menu.ip.lm6f.build.lwip_include=lwip2/include +inventone.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +inventone.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +inventone.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +inventone.menu.ip.hb6f.build.lwip_include=lwip2/include +inventone.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +inventone.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +inventone.menu.dbg.Disabled=Disabled +inventone.menu.dbg.Disabled.build.debug_port= +inventone.menu.dbg.Serial=Serial +inventone.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +inventone.menu.dbg.Serial1=Serial1 +inventone.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +inventone.menu.lvl.None____=None +inventone.menu.lvl.None____.build.debug_level= +inventone.menu.lvl.SSL=SSL +inventone.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +inventone.menu.lvl.TLS_MEM=TLS_MEM +inventone.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +inventone.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +inventone.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +inventone.menu.lvl.HTTP_SERVER=HTTP_SERVER +inventone.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +inventone.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +inventone.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +inventone.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +inventone.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +inventone.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +inventone.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +inventone.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +inventone.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +inventone.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +inventone.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +inventone.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +inventone.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +inventone.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +inventone.menu.lvl.CORE=CORE +inventone.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +inventone.menu.lvl.WIFI=WIFI +inventone.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +inventone.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +inventone.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +inventone.menu.lvl.UPDATER=UPDATER +inventone.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +inventone.menu.lvl.OTA=OTA +inventone.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +inventone.menu.lvl.OOM=OOM +inventone.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +inventone.menu.lvl.MDNS=MDNS +inventone.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +inventone.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +inventone.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +inventone.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +inventone.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +inventone.menu.wipe.none=Only Sketch +inventone.menu.wipe.none.upload.erase_cmd= +inventone.menu.wipe.sdk=Sketch + WiFi Settings +inventone.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +inventone.menu.wipe.all=All Flash Contents +inventone.menu.wipe.all.upload.erase_cmd=erase_flash +inventone.menu.baud.115200=115200 +inventone.menu.baud.115200.upload.speed=115200 +inventone.menu.baud.57600=57600 +inventone.menu.baud.57600.upload.speed=57600 +inventone.menu.baud.230400.linux=230400 +inventone.menu.baud.230400.macosx=230400 +inventone.menu.baud.230400.upload.speed=230400 +inventone.menu.baud.256000.windows=256000 +inventone.menu.baud.256000.upload.speed=256000 +inventone.menu.baud.460800.linux=460800 +inventone.menu.baud.460800.macosx=460800 +inventone.menu.baud.460800.upload.speed=460800 +inventone.menu.baud.512000.windows=512000 +inventone.menu.baud.512000.upload.speed=512000 +inventone.menu.baud.921600=921600 +inventone.menu.baud.921600.upload.speed=921600 +inventone.menu.baud.3000000=3000000 +inventone.menu.baud.3000000.upload.speed=3000000 + +############################################################## +d1_mini.name=LOLIN(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.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.core=esp8266 +d1_mini.build.spiffs_pagesize=256 +d1_mini.build.debug_port= +d1_mini.build.debug_level= +d1_mini.menu.xtal.80=80 MHz +d1_mini.menu.xtal.80.build.f_cpu=80000000L +d1_mini.menu.xtal.160=160 MHz +d1_mini.menu.xtal.160.build.f_cpu=160000000L +d1_mini.menu.vt.flash=Flash +d1_mini.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +d1_mini.menu.vt.heap=Heap +d1_mini.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +d1_mini.menu.vt.iram=IRAM +d1_mini.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +d1_mini.menu.exception.disabled=Disabled (new aborts on oom) +d1_mini.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1_mini.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +d1_mini.menu.exception.enabled=Enabled +d1_mini.menu.exception.enabled.build.exception_flags=-fexceptions +d1_mini.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +d1_mini.menu.stacksmash.disabled=Disabled +d1_mini.menu.stacksmash.disabled.build.stacksmash_flags= +d1_mini.menu.stacksmash.enabled=Enabled +d1_mini.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +d1_mini.menu.ssl.all=All SSL ciphers (most compatible) +d1_mini.menu.ssl.all.build.sslflags= +d1_mini.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +d1_mini.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +d1_mini.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +d1_mini.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +d1_mini.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +d1_mini.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +d1_mini.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +d1_mini.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +d1_mini.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +d1_mini.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +d1_mini.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +d1_mini.menu.non32xfer.fast.build.non32xferflags= +d1_mini.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +d1_mini.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +d1_mini.upload.resetmethod=--before default_reset --after hard_reset +d1_mini.build.flash_mode=dio +d1_mini.build.flash_flags=-DFLASHMODE_DIO +d1_mini.build.flash_freq=40 +d1_mini.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +d1_mini.menu.eesz.4M2M.build.flash_size=4M +d1_mini.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +d1_mini.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +d1_mini.menu.eesz.4M2M.build.spiffs_pagesize=256 +d1_mini.menu.eesz.4M2M.upload.maximum_size=1044464 +d1_mini.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +d1_mini.menu.eesz.4M2M.build.spiffs_start=0x200000 +d1_mini.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +d1_mini.menu.eesz.4M2M.build.spiffs_blocksize=8192 +d1_mini.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +d1_mini.menu.eesz.4M3M.build.flash_size=4M +d1_mini.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +d1_mini.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +d1_mini.menu.eesz.4M3M.build.spiffs_pagesize=256 +d1_mini.menu.eesz.4M3M.upload.maximum_size=1044464 +d1_mini.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +d1_mini.menu.eesz.4M3M.build.spiffs_start=0x100000 +d1_mini.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +d1_mini.menu.eesz.4M3M.build.spiffs_blocksize=8192 +d1_mini.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +d1_mini.menu.eesz.4M1M.build.flash_size=4M +d1_mini.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +d1_mini.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +d1_mini.menu.eesz.4M1M.build.spiffs_pagesize=256 +d1_mini.menu.eesz.4M1M.upload.maximum_size=1044464 +d1_mini.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +d1_mini.menu.eesz.4M1M.build.spiffs_start=0x300000 +d1_mini.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +d1_mini.menu.eesz.4M1M.build.spiffs_blocksize=8192 +d1_mini.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +d1_mini.menu.eesz.4M.build.flash_size=4M +d1_mini.menu.eesz.4M.build.flash_size_bytes=0x400000 +d1_mini.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +d1_mini.menu.eesz.4M.build.spiffs_pagesize=256 +d1_mini.menu.eesz.4M.upload.maximum_size=1044464 +d1_mini.menu.eesz.4M.build.rfcal_addr=0x3FC000 +d1_mini.menu.ip.lm2f=v2 Lower Memory +d1_mini.menu.ip.lm2f.build.lwip_include=lwip2/include +d1_mini.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +d1_mini.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1_mini.menu.ip.hb2f=v2 Higher Bandwidth +d1_mini.menu.ip.hb2f.build.lwip_include=lwip2/include +d1_mini.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +d1_mini.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1_mini.menu.ip.lm2n=v2 Lower Memory (no features) +d1_mini.menu.ip.lm2n.build.lwip_include=lwip2/include +d1_mini.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +d1_mini.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1_mini.menu.ip.hb2n=v2 Higher Bandwidth (no features) +d1_mini.menu.ip.hb2n.build.lwip_include=lwip2/include +d1_mini.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +d1_mini.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1_mini.menu.ip.lm6f=v2 IPv6 Lower Memory +d1_mini.menu.ip.lm6f.build.lwip_include=lwip2/include +d1_mini.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +d1_mini.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1_mini.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +d1_mini.menu.ip.hb6f.build.lwip_include=lwip2/include +d1_mini.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +d1_mini.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1_mini.menu.dbg.Disabled=Disabled +d1_mini.menu.dbg.Disabled.build.debug_port= +d1_mini.menu.dbg.Serial=Serial +d1_mini.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +d1_mini.menu.dbg.Serial1=Serial1 +d1_mini.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +d1_mini.menu.lvl.None____=None +d1_mini.menu.lvl.None____.build.debug_level= +d1_mini.menu.lvl.SSL=SSL +d1_mini.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +d1_mini.menu.lvl.TLS_MEM=TLS_MEM +d1_mini.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +d1_mini.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +d1_mini.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +d1_mini.menu.lvl.HTTP_SERVER=HTTP_SERVER +d1_mini.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +d1_mini.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +d1_mini.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +d1_mini.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +d1_mini.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +d1_mini.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +d1_mini.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +d1_mini.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +d1_mini.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1_mini.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +d1_mini.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1_mini.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +d1_mini.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1_mini.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +d1_mini.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1_mini.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +d1_mini.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1_mini.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1_mini.menu.lvl.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.lvl.CORE=CORE +d1_mini.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +d1_mini.menu.lvl.WIFI=WIFI +d1_mini.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +d1_mini.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +d1_mini.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +d1_mini.menu.lvl.UPDATER=UPDATER +d1_mini.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +d1_mini.menu.lvl.OTA=OTA +d1_mini.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +d1_mini.menu.lvl.OOM=OOM +d1_mini.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +d1_mini.menu.lvl.MDNS=MDNS +d1_mini.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +d1_mini.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +d1_mini.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +d1_mini.menu.wipe.none=Only Sketch +d1_mini.menu.wipe.none.upload.erase_cmd= +d1_mini.menu.wipe.sdk=Sketch + WiFi Settings +d1_mini.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +d1_mini.menu.wipe.all=All Flash Contents +d1_mini.menu.wipe.all.upload.erase_cmd=erase_flash +d1_mini.menu.baud.921600=921600 +d1_mini.menu.baud.921600.upload.speed=921600 +d1_mini.menu.baud.57600=57600 +d1_mini.menu.baud.57600.upload.speed=57600 +d1_mini.menu.baud.115200=115200 +d1_mini.menu.baud.115200.upload.speed=115200 +d1_mini.menu.baud.230400.linux=230400 +d1_mini.menu.baud.230400.macosx=230400 +d1_mini.menu.baud.230400.upload.speed=230400 +d1_mini.menu.baud.256000.windows=256000 +d1_mini.menu.baud.256000.upload.speed=256000 +d1_mini.menu.baud.460800.linux=460800 +d1_mini.menu.baud.460800.macosx=460800 +d1_mini.menu.baud.460800.upload.speed=460800 +d1_mini.menu.baud.512000.windows=512000 +d1_mini.menu.baud.512000.upload.speed=512000 +d1_mini.menu.baud.3000000=3000000 +d1_mini.menu.baud.3000000.upload.speed=3000000 + +############################################################## +d1_mini_lite.name=LOLIN(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.xtal.80=80 MHz +d1_mini_lite.menu.xtal.80.build.f_cpu=80000000L +d1_mini_lite.menu.xtal.160=160 MHz +d1_mini_lite.menu.xtal.160.build.f_cpu=160000000L +d1_mini_lite.menu.vt.flash=Flash +d1_mini_lite.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +d1_mini_lite.menu.vt.heap=Heap +d1_mini_lite.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +d1_mini_lite.menu.vt.iram=IRAM +d1_mini_lite.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +d1_mini_lite.menu.exception.disabled=Disabled (new aborts on oom) +d1_mini_lite.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1_mini_lite.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +d1_mini_lite.menu.exception.enabled=Enabled +d1_mini_lite.menu.exception.enabled.build.exception_flags=-fexceptions +d1_mini_lite.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +d1_mini_lite.menu.stacksmash.disabled=Disabled +d1_mini_lite.menu.stacksmash.disabled.build.stacksmash_flags= +d1_mini_lite.menu.stacksmash.enabled=Enabled +d1_mini_lite.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +d1_mini_lite.menu.ssl.all=All SSL ciphers (most compatible) +d1_mini_lite.menu.ssl.all.build.sslflags= +d1_mini_lite.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +d1_mini_lite.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +d1_mini_lite.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +d1_mini_lite.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +d1_mini_lite.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +d1_mini_lite.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +d1_mini_lite.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +d1_mini_lite.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +d1_mini_lite.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +d1_mini_lite.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +d1_mini_lite.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +d1_mini_lite.menu.non32xfer.fast.build.non32xferflags= +d1_mini_lite.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +d1_mini_lite.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +d1_mini_lite.upload.resetmethod=--before default_reset --after hard_reset +d1_mini_lite.build.flash_mode=dout +d1_mini_lite.build.flash_flags=-DFLASHMODE_DOUT +d1_mini_lite.build.flash_freq=40 +d1_mini_lite.menu.eesz.1M64=1MB (FS:64KB OTA:~470KB) +d1_mini_lite.menu.eesz.1M64.build.flash_size=1M +d1_mini_lite.menu.eesz.1M64.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M64.build.flash_ld=eagle.flash.1m64.ld +d1_mini_lite.menu.eesz.1M64.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M64.upload.maximum_size=958448 +d1_mini_lite.menu.eesz.1M64.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.eesz.1M64.build.spiffs_start=0xEB000 +d1_mini_lite.menu.eesz.1M64.build.spiffs_end=0xFB000 +d1_mini_lite.menu.eesz.1M64.build.spiffs_blocksize=4096 +d1_mini_lite.menu.eesz.1M128=1MB (FS:128KB OTA:~438KB) +d1_mini_lite.menu.eesz.1M128.build.flash_size=1M +d1_mini_lite.menu.eesz.1M128.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M128.build.flash_ld=eagle.flash.1m128.ld +d1_mini_lite.menu.eesz.1M128.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M128.upload.maximum_size=892912 +d1_mini_lite.menu.eesz.1M128.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.eesz.1M128.build.spiffs_start=0xDB000 +d1_mini_lite.menu.eesz.1M128.build.spiffs_end=0xFB000 +d1_mini_lite.menu.eesz.1M128.build.spiffs_blocksize=4096 +d1_mini_lite.menu.eesz.1M144=1MB (FS:144KB OTA:~430KB) +d1_mini_lite.menu.eesz.1M144.build.flash_size=1M +d1_mini_lite.menu.eesz.1M144.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M144.build.flash_ld=eagle.flash.1m144.ld +d1_mini_lite.menu.eesz.1M144.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M144.upload.maximum_size=876528 +d1_mini_lite.menu.eesz.1M144.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.eesz.1M144.build.spiffs_start=0xD7000 +d1_mini_lite.menu.eesz.1M144.build.spiffs_end=0xFB000 +d1_mini_lite.menu.eesz.1M144.build.spiffs_blocksize=4096 +d1_mini_lite.menu.eesz.1M160=1MB (FS:160KB OTA:~422KB) +d1_mini_lite.menu.eesz.1M160.build.flash_size=1M +d1_mini_lite.menu.eesz.1M160.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M160.build.flash_ld=eagle.flash.1m160.ld +d1_mini_lite.menu.eesz.1M160.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M160.upload.maximum_size=860144 +d1_mini_lite.menu.eesz.1M160.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.eesz.1M160.build.spiffs_start=0xD3000 +d1_mini_lite.menu.eesz.1M160.build.spiffs_end=0xFB000 +d1_mini_lite.menu.eesz.1M160.build.spiffs_blocksize=4096 +d1_mini_lite.menu.eesz.1M192=1MB (FS:192KB OTA:~406KB) +d1_mini_lite.menu.eesz.1M192.build.flash_size=1M +d1_mini_lite.menu.eesz.1M192.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M192.build.flash_ld=eagle.flash.1m192.ld +d1_mini_lite.menu.eesz.1M192.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M192.upload.maximum_size=827376 +d1_mini_lite.menu.eesz.1M192.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.eesz.1M192.build.spiffs_start=0xCB000 +d1_mini_lite.menu.eesz.1M192.build.spiffs_end=0xFB000 +d1_mini_lite.menu.eesz.1M192.build.spiffs_blocksize=4096 +d1_mini_lite.menu.eesz.1M256=1MB (FS:256KB OTA:~374KB) +d1_mini_lite.menu.eesz.1M256.build.flash_size=1M +d1_mini_lite.menu.eesz.1M256.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M256.build.flash_ld=eagle.flash.1m256.ld +d1_mini_lite.menu.eesz.1M256.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M256.upload.maximum_size=761840 +d1_mini_lite.menu.eesz.1M256.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.eesz.1M256.build.spiffs_start=0xBB000 +d1_mini_lite.menu.eesz.1M256.build.spiffs_end=0xFB000 +d1_mini_lite.menu.eesz.1M256.build.spiffs_blocksize=4096 +d1_mini_lite.menu.eesz.1M512=1MB (FS:512KB OTA:~246KB) +d1_mini_lite.menu.eesz.1M512.build.flash_size=1M +d1_mini_lite.menu.eesz.1M512.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M512.build.flash_ld=eagle.flash.1m512.ld +d1_mini_lite.menu.eesz.1M512.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M512.upload.maximum_size=499696 +d1_mini_lite.menu.eesz.1M512.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.eesz.1M512.build.spiffs_start=0x7B000 +d1_mini_lite.menu.eesz.1M512.build.spiffs_end=0xFB000 +d1_mini_lite.menu.eesz.1M512.build.spiffs_blocksize=8192 +d1_mini_lite.menu.eesz.1M=1MB (FS:none OTA:~502KB) +d1_mini_lite.menu.eesz.1M.build.flash_size=1M +d1_mini_lite.menu.eesz.1M.build.flash_size_bytes=0x100000 +d1_mini_lite.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld +d1_mini_lite.menu.eesz.1M.build.spiffs_pagesize=256 +d1_mini_lite.menu.eesz.1M.upload.maximum_size=1023984 +d1_mini_lite.menu.eesz.1M.build.rfcal_addr=0xFC000 +d1_mini_lite.menu.ip.lm2f=v2 Lower Memory +d1_mini_lite.menu.ip.lm2f.build.lwip_include=lwip2/include +d1_mini_lite.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +d1_mini_lite.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1_mini_lite.menu.ip.hb2f=v2 Higher Bandwidth +d1_mini_lite.menu.ip.hb2f.build.lwip_include=lwip2/include +d1_mini_lite.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +d1_mini_lite.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1_mini_lite.menu.ip.lm2n=v2 Lower Memory (no features) +d1_mini_lite.menu.ip.lm2n.build.lwip_include=lwip2/include +d1_mini_lite.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +d1_mini_lite.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1_mini_lite.menu.ip.hb2n=v2 Higher Bandwidth (no features) +d1_mini_lite.menu.ip.hb2n.build.lwip_include=lwip2/include +d1_mini_lite.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +d1_mini_lite.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1_mini_lite.menu.ip.lm6f=v2 IPv6 Lower Memory +d1_mini_lite.menu.ip.lm6f.build.lwip_include=lwip2/include +d1_mini_lite.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +d1_mini_lite.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1_mini_lite.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +d1_mini_lite.menu.ip.hb6f.build.lwip_include=lwip2/include +d1_mini_lite.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +d1_mini_lite.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1_mini_lite.menu.dbg.Disabled=Disabled +d1_mini_lite.menu.dbg.Disabled.build.debug_port= +d1_mini_lite.menu.dbg.Serial=Serial +d1_mini_lite.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +d1_mini_lite.menu.dbg.Serial1=Serial1 +d1_mini_lite.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +d1_mini_lite.menu.lvl.None____=None +d1_mini_lite.menu.lvl.None____.build.debug_level= +d1_mini_lite.menu.lvl.SSL=SSL +d1_mini_lite.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +d1_mini_lite.menu.lvl.TLS_MEM=TLS_MEM +d1_mini_lite.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +d1_mini_lite.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +d1_mini_lite.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +d1_mini_lite.menu.lvl.HTTP_SERVER=HTTP_SERVER +d1_mini_lite.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +d1_mini_lite.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +d1_mini_lite.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +d1_mini_lite.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +d1_mini_lite.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +d1_mini_lite.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +d1_mini_lite.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1_mini_lite.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +d1_mini_lite.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1_mini_lite.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +d1_mini_lite.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1_mini_lite.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +d1_mini_lite.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1_mini_lite.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1_mini_lite.menu.lvl.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.lvl.CORE=CORE +d1_mini_lite.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +d1_mini_lite.menu.lvl.WIFI=WIFI +d1_mini_lite.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +d1_mini_lite.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +d1_mini_lite.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +d1_mini_lite.menu.lvl.UPDATER=UPDATER +d1_mini_lite.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +d1_mini_lite.menu.lvl.OTA=OTA +d1_mini_lite.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +d1_mini_lite.menu.lvl.OOM=OOM +d1_mini_lite.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +d1_mini_lite.menu.lvl.MDNS=MDNS +d1_mini_lite.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_lite.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_lite.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +d1_mini_lite.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +d1_mini_lite.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +d1_mini_lite.menu.wipe.none=Only Sketch +d1_mini_lite.menu.wipe.none.upload.erase_cmd= +d1_mini_lite.menu.wipe.sdk=Sketch + WiFi Settings +d1_mini_lite.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +d1_mini_lite.menu.wipe.all=All Flash Contents +d1_mini_lite.menu.wipe.all.upload.erase_cmd=erase_flash +d1_mini_lite.menu.baud.921600=921600 +d1_mini_lite.menu.baud.921600.upload.speed=921600 +d1_mini_lite.menu.baud.57600=57600 +d1_mini_lite.menu.baud.57600.upload.speed=57600 +d1_mini_lite.menu.baud.115200=115200 +d1_mini_lite.menu.baud.115200.upload.speed=115200 +d1_mini_lite.menu.baud.230400.linux=230400 +d1_mini_lite.menu.baud.230400.macosx=230400 +d1_mini_lite.menu.baud.230400.upload.speed=230400 +d1_mini_lite.menu.baud.256000.windows=256000 +d1_mini_lite.menu.baud.256000.upload.speed=256000 +d1_mini_lite.menu.baud.460800.linux=460800 +d1_mini_lite.menu.baud.460800.macosx=460800 +d1_mini_lite.menu.baud.460800.upload.speed=460800 +d1_mini_lite.menu.baud.512000.windows=512000 +d1_mini_lite.menu.baud.512000.upload.speed=512000 +d1_mini_lite.menu.baud.3000000=3000000 +d1_mini_lite.menu.baud.3000000.upload.speed=3000000 + +############################################################## +d1_mini_pro.name=LOLIN(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.xtal.80=80 MHz +d1_mini_pro.menu.xtal.80.build.f_cpu=80000000L +d1_mini_pro.menu.xtal.160=160 MHz +d1_mini_pro.menu.xtal.160.build.f_cpu=160000000L +d1_mini_pro.menu.vt.flash=Flash +d1_mini_pro.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +d1_mini_pro.menu.vt.heap=Heap +d1_mini_pro.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +d1_mini_pro.menu.vt.iram=IRAM +d1_mini_pro.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +d1_mini_pro.menu.exception.disabled=Disabled (new aborts on oom) +d1_mini_pro.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1_mini_pro.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +d1_mini_pro.menu.exception.enabled=Enabled +d1_mini_pro.menu.exception.enabled.build.exception_flags=-fexceptions +d1_mini_pro.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +d1_mini_pro.menu.stacksmash.disabled=Disabled +d1_mini_pro.menu.stacksmash.disabled.build.stacksmash_flags= +d1_mini_pro.menu.stacksmash.enabled=Enabled +d1_mini_pro.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +d1_mini_pro.menu.ssl.all=All SSL ciphers (most compatible) +d1_mini_pro.menu.ssl.all.build.sslflags= +d1_mini_pro.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +d1_mini_pro.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +d1_mini_pro.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +d1_mini_pro.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +d1_mini_pro.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +d1_mini_pro.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +d1_mini_pro.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +d1_mini_pro.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +d1_mini_pro.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +d1_mini_pro.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +d1_mini_pro.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +d1_mini_pro.menu.non32xfer.fast.build.non32xferflags= +d1_mini_pro.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +d1_mini_pro.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +d1_mini_pro.upload.resetmethod=--before default_reset --after hard_reset +d1_mini_pro.build.flash_mode=dio +d1_mini_pro.build.flash_flags=-DFLASHMODE_DIO +d1_mini_pro.build.flash_freq=40 +d1_mini_pro.menu.eesz.16M14M=16MB (FS:14MB OTA:~1019KB) +d1_mini_pro.menu.eesz.16M14M.build.flash_size=16M +d1_mini_pro.menu.eesz.16M14M.build.flash_size_bytes=0x1000000 +d1_mini_pro.menu.eesz.16M14M.build.flash_ld=eagle.flash.16m14m.ld +d1_mini_pro.menu.eesz.16M14M.build.spiffs_pagesize=256 +d1_mini_pro.menu.eesz.16M14M.upload.maximum_size=1044464 +d1_mini_pro.menu.eesz.16M14M.build.rfcal_addr=0xFFC000 +d1_mini_pro.menu.eesz.16M14M.build.spiffs_start=0x200000 +d1_mini_pro.menu.eesz.16M14M.build.spiffs_end=0xFFA000 +d1_mini_pro.menu.eesz.16M14M.build.spiffs_blocksize=8192 +d1_mini_pro.menu.eesz.16M15M=16MB (FS:15MB OTA:~512KB) +d1_mini_pro.menu.eesz.16M15M.build.flash_size=16M +d1_mini_pro.menu.eesz.16M15M.build.flash_size_bytes=0x1000000 +d1_mini_pro.menu.eesz.16M15M.build.flash_ld=eagle.flash.16m15m.ld +d1_mini_pro.menu.eesz.16M15M.build.spiffs_pagesize=256 +d1_mini_pro.menu.eesz.16M15M.upload.maximum_size=1044464 +d1_mini_pro.menu.eesz.16M15M.build.rfcal_addr=0xFFC000 +d1_mini_pro.menu.eesz.16M15M.build.spiffs_start=0x100000 +d1_mini_pro.menu.eesz.16M15M.build.spiffs_end=0xFFA000 +d1_mini_pro.menu.eesz.16M15M.build.spiffs_blocksize=8192 +d1_mini_pro.menu.ip.lm2f=v2 Lower Memory +d1_mini_pro.menu.ip.lm2f.build.lwip_include=lwip2/include +d1_mini_pro.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +d1_mini_pro.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1_mini_pro.menu.ip.hb2f=v2 Higher Bandwidth +d1_mini_pro.menu.ip.hb2f.build.lwip_include=lwip2/include +d1_mini_pro.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +d1_mini_pro.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1_mini_pro.menu.ip.lm2n=v2 Lower Memory (no features) +d1_mini_pro.menu.ip.lm2n.build.lwip_include=lwip2/include +d1_mini_pro.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +d1_mini_pro.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1_mini_pro.menu.ip.hb2n=v2 Higher Bandwidth (no features) +d1_mini_pro.menu.ip.hb2n.build.lwip_include=lwip2/include +d1_mini_pro.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +d1_mini_pro.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1_mini_pro.menu.ip.lm6f=v2 IPv6 Lower Memory +d1_mini_pro.menu.ip.lm6f.build.lwip_include=lwip2/include +d1_mini_pro.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +d1_mini_pro.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1_mini_pro.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +d1_mini_pro.menu.ip.hb6f.build.lwip_include=lwip2/include +d1_mini_pro.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +d1_mini_pro.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1_mini_pro.menu.dbg.Disabled=Disabled +d1_mini_pro.menu.dbg.Disabled.build.debug_port= +d1_mini_pro.menu.dbg.Serial=Serial +d1_mini_pro.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +d1_mini_pro.menu.dbg.Serial1=Serial1 +d1_mini_pro.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +d1_mini_pro.menu.lvl.None____=None +d1_mini_pro.menu.lvl.None____.build.debug_level= +d1_mini_pro.menu.lvl.SSL=SSL +d1_mini_pro.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +d1_mini_pro.menu.lvl.TLS_MEM=TLS_MEM +d1_mini_pro.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +d1_mini_pro.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +d1_mini_pro.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +d1_mini_pro.menu.lvl.HTTP_SERVER=HTTP_SERVER +d1_mini_pro.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +d1_mini_pro.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +d1_mini_pro.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +d1_mini_pro.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +d1_mini_pro.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +d1_mini_pro.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +d1_mini_pro.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1_mini_pro.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +d1_mini_pro.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1_mini_pro.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +d1_mini_pro.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1_mini_pro.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +d1_mini_pro.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1_mini_pro.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1_mini_pro.menu.lvl.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.lvl.CORE=CORE +d1_mini_pro.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +d1_mini_pro.menu.lvl.WIFI=WIFI +d1_mini_pro.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +d1_mini_pro.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +d1_mini_pro.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +d1_mini_pro.menu.lvl.UPDATER=UPDATER +d1_mini_pro.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +d1_mini_pro.menu.lvl.OTA=OTA +d1_mini_pro.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +d1_mini_pro.menu.lvl.OOM=OOM +d1_mini_pro.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +d1_mini_pro.menu.lvl.MDNS=MDNS +d1_mini_pro.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_pro.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1_mini_pro.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +d1_mini_pro.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +d1_mini_pro.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +d1_mini_pro.menu.wipe.none=Only Sketch +d1_mini_pro.menu.wipe.none.upload.erase_cmd= +d1_mini_pro.menu.wipe.sdk=Sketch + WiFi Settings +d1_mini_pro.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +d1_mini_pro.menu.wipe.all=All Flash Contents +d1_mini_pro.menu.wipe.all.upload.erase_cmd=erase_flash +d1_mini_pro.menu.baud.921600=921600 +d1_mini_pro.menu.baud.921600.upload.speed=921600 +d1_mini_pro.menu.baud.57600=57600 +d1_mini_pro.menu.baud.57600.upload.speed=57600 +d1_mini_pro.menu.baud.115200=115200 +d1_mini_pro.menu.baud.115200.upload.speed=115200 +d1_mini_pro.menu.baud.230400.linux=230400 +d1_mini_pro.menu.baud.230400.macosx=230400 +d1_mini_pro.menu.baud.230400.upload.speed=230400 +d1_mini_pro.menu.baud.256000.windows=256000 +d1_mini_pro.menu.baud.256000.upload.speed=256000 +d1_mini_pro.menu.baud.460800.linux=460800 +d1_mini_pro.menu.baud.460800.macosx=460800 +d1_mini_pro.menu.baud.460800.upload.speed=460800 +d1_mini_pro.menu.baud.512000.windows=512000 +d1_mini_pro.menu.baud.512000.upload.speed=512000 +d1_mini_pro.menu.baud.3000000=3000000 +d1_mini_pro.menu.baud.3000000.upload.speed=3000000 + +############################################################## +d1.name=LOLIN(WeMos) D1 R1 +d1.build.board=ESP8266_WEMOS_D1R1 +d1.build.variant=d1 +d1.upload.tool=esptool +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.core=esp8266 +d1.build.spiffs_pagesize=256 +d1.build.debug_port= +d1.build.debug_level= +d1.menu.xtal.80=80 MHz +d1.menu.xtal.80.build.f_cpu=80000000L +d1.menu.xtal.160=160 MHz +d1.menu.xtal.160.build.f_cpu=160000000L +d1.menu.vt.flash=Flash +d1.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +d1.menu.vt.heap=Heap +d1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +d1.menu.vt.iram=IRAM +d1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +d1.menu.exception.disabled=Disabled (new aborts on oom) +d1.menu.exception.disabled.build.exception_flags=-fno-exceptions +d1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +d1.menu.exception.enabled=Enabled +d1.menu.exception.enabled.build.exception_flags=-fexceptions +d1.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +d1.menu.stacksmash.disabled=Disabled +d1.menu.stacksmash.disabled.build.stacksmash_flags= +d1.menu.stacksmash.enabled=Enabled +d1.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +d1.menu.ssl.all=All SSL ciphers (most compatible) +d1.menu.ssl.all.build.sslflags= +d1.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +d1.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +d1.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +d1.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +d1.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +d1.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +d1.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +d1.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +d1.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +d1.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +d1.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +d1.menu.non32xfer.fast.build.non32xferflags= +d1.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +d1.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +d1.upload.resetmethod=--before default_reset --after hard_reset +d1.build.flash_mode=dio +d1.build.flash_flags=-DFLASHMODE_DIO +d1.build.flash_freq=40 +d1.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +d1.menu.eesz.4M2M.build.flash_size=4M +d1.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +d1.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +d1.menu.eesz.4M2M.build.spiffs_pagesize=256 +d1.menu.eesz.4M2M.upload.maximum_size=1044464 +d1.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +d1.menu.eesz.4M2M.build.spiffs_start=0x200000 +d1.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +d1.menu.eesz.4M2M.build.spiffs_blocksize=8192 +d1.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +d1.menu.eesz.4M3M.build.flash_size=4M +d1.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +d1.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +d1.menu.eesz.4M3M.build.spiffs_pagesize=256 +d1.menu.eesz.4M3M.upload.maximum_size=1044464 +d1.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +d1.menu.eesz.4M3M.build.spiffs_start=0x100000 +d1.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +d1.menu.eesz.4M3M.build.spiffs_blocksize=8192 +d1.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +d1.menu.eesz.4M1M.build.flash_size=4M +d1.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +d1.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +d1.menu.eesz.4M1M.build.spiffs_pagesize=256 +d1.menu.eesz.4M1M.upload.maximum_size=1044464 +d1.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +d1.menu.eesz.4M1M.build.spiffs_start=0x300000 +d1.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +d1.menu.eesz.4M1M.build.spiffs_blocksize=8192 +d1.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +d1.menu.eesz.4M.build.flash_size=4M +d1.menu.eesz.4M.build.flash_size_bytes=0x400000 +d1.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +d1.menu.eesz.4M.build.spiffs_pagesize=256 +d1.menu.eesz.4M.upload.maximum_size=1044464 +d1.menu.eesz.4M.build.rfcal_addr=0x3FC000 +d1.menu.ip.lm2f=v2 Lower Memory +d1.menu.ip.lm2f.build.lwip_include=lwip2/include +d1.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +d1.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1.menu.ip.hb2f=v2 Higher Bandwidth +d1.menu.ip.hb2f.build.lwip_include=lwip2/include +d1.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +d1.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +d1.menu.ip.lm2n=v2 Lower Memory (no features) +d1.menu.ip.lm2n.build.lwip_include=lwip2/include +d1.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +d1.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1.menu.ip.hb2n=v2 Higher Bandwidth (no features) +d1.menu.ip.hb2n.build.lwip_include=lwip2/include +d1.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +d1.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +d1.menu.ip.lm6f=v2 IPv6 Lower Memory +d1.menu.ip.lm6f.build.lwip_include=lwip2/include +d1.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +d1.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +d1.menu.ip.hb6f.build.lwip_include=lwip2/include +d1.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +d1.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +d1.menu.dbg.Disabled=Disabled +d1.menu.dbg.Disabled.build.debug_port= +d1.menu.dbg.Serial=Serial +d1.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +d1.menu.dbg.Serial1=Serial1 +d1.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +d1.menu.lvl.None____=None +d1.menu.lvl.None____.build.debug_level= +d1.menu.lvl.SSL=SSL +d1.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +d1.menu.lvl.TLS_MEM=TLS_MEM +d1.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +d1.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +d1.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +d1.menu.lvl.HTTP_SERVER=HTTP_SERVER +d1.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +d1.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +d1.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +d1.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +d1.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +d1.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +d1.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +d1.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +d1.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +d1.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +d1.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +d1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +d1.menu.lvl.CORE=CORE +d1.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +d1.menu.lvl.WIFI=WIFI +d1.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +d1.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +d1.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +d1.menu.lvl.UPDATER=UPDATER +d1.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +d1.menu.lvl.OTA=OTA +d1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +d1.menu.lvl.OOM=OOM +d1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +d1.menu.lvl.MDNS=MDNS +d1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +d1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +d1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +d1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +d1.menu.wipe.none=Only Sketch +d1.menu.wipe.none.upload.erase_cmd= +d1.menu.wipe.sdk=Sketch + WiFi Settings +d1.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +d1.menu.wipe.all=All Flash Contents +d1.menu.wipe.all.upload.erase_cmd=erase_flash +d1.menu.baud.921600=921600 +d1.menu.baud.921600.upload.speed=921600 +d1.menu.baud.57600=57600 +d1.menu.baud.57600.upload.speed=57600 +d1.menu.baud.115200=115200 +d1.menu.baud.115200.upload.speed=115200 +d1.menu.baud.230400.linux=230400 +d1.menu.baud.230400.macosx=230400 +d1.menu.baud.230400.upload.speed=230400 +d1.menu.baud.256000.windows=256000 +d1.menu.baud.256000.upload.speed=256000 +d1.menu.baud.460800.linux=460800 +d1.menu.baud.460800.macosx=460800 +d1.menu.baud.460800.upload.speed=460800 +d1.menu.baud.512000.windows=512000 +d1.menu.baud.512000.upload.speed=512000 +d1.menu.baud.3000000=3000000 +d1.menu.baud.3000000.upload.speed=3000000 + +############################################################## +nodemcu.name=NodeMCU 0.9 (ESP-12 Module) +nodemcu.build.board=ESP8266_NODEMCU +nodemcu.build.variant=nodemcu +nodemcu.upload.tool=esptool +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.core=esp8266 +nodemcu.build.spiffs_pagesize=256 +nodemcu.build.debug_port= +nodemcu.build.debug_level= +nodemcu.menu.xtal.80=80 MHz +nodemcu.menu.xtal.80.build.f_cpu=80000000L +nodemcu.menu.xtal.160=160 MHz +nodemcu.menu.xtal.160.build.f_cpu=160000000L +nodemcu.menu.vt.flash=Flash +nodemcu.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +nodemcu.menu.vt.heap=Heap +nodemcu.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +nodemcu.menu.vt.iram=IRAM +nodemcu.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +nodemcu.menu.exception.disabled=Disabled (new aborts on oom) +nodemcu.menu.exception.disabled.build.exception_flags=-fno-exceptions +nodemcu.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +nodemcu.menu.exception.enabled=Enabled +nodemcu.menu.exception.enabled.build.exception_flags=-fexceptions +nodemcu.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +nodemcu.menu.stacksmash.disabled=Disabled +nodemcu.menu.stacksmash.disabled.build.stacksmash_flags= +nodemcu.menu.stacksmash.enabled=Enabled +nodemcu.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +nodemcu.menu.ssl.all=All SSL ciphers (most compatible) +nodemcu.menu.ssl.all.build.sslflags= +nodemcu.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +nodemcu.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +nodemcu.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +nodemcu.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +nodemcu.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +nodemcu.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +nodemcu.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +nodemcu.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +nodemcu.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +nodemcu.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +nodemcu.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +nodemcu.menu.non32xfer.fast.build.non32xferflags= +nodemcu.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +nodemcu.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +nodemcu.upload.resetmethod=--before default_reset --after hard_reset +nodemcu.build.flash_mode=qio +nodemcu.build.flash_flags=-DFLASHMODE_QIO +nodemcu.build.flash_freq=40 +nodemcu.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +nodemcu.menu.eesz.4M2M.build.flash_size=4M +nodemcu.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +nodemcu.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +nodemcu.menu.eesz.4M2M.build.spiffs_pagesize=256 +nodemcu.menu.eesz.4M2M.upload.maximum_size=1044464 +nodemcu.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +nodemcu.menu.eesz.4M2M.build.spiffs_start=0x200000 +nodemcu.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +nodemcu.menu.eesz.4M2M.build.spiffs_blocksize=8192 +nodemcu.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +nodemcu.menu.eesz.4M3M.build.flash_size=4M +nodemcu.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +nodemcu.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +nodemcu.menu.eesz.4M3M.build.spiffs_pagesize=256 +nodemcu.menu.eesz.4M3M.upload.maximum_size=1044464 +nodemcu.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +nodemcu.menu.eesz.4M3M.build.spiffs_start=0x100000 +nodemcu.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +nodemcu.menu.eesz.4M3M.build.spiffs_blocksize=8192 +nodemcu.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +nodemcu.menu.eesz.4M1M.build.flash_size=4M +nodemcu.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +nodemcu.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +nodemcu.menu.eesz.4M1M.build.spiffs_pagesize=256 +nodemcu.menu.eesz.4M1M.upload.maximum_size=1044464 +nodemcu.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +nodemcu.menu.eesz.4M1M.build.spiffs_start=0x300000 +nodemcu.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +nodemcu.menu.eesz.4M1M.build.spiffs_blocksize=8192 +nodemcu.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +nodemcu.menu.eesz.4M.build.flash_size=4M +nodemcu.menu.eesz.4M.build.flash_size_bytes=0x400000 +nodemcu.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +nodemcu.menu.eesz.4M.build.spiffs_pagesize=256 +nodemcu.menu.eesz.4M.upload.maximum_size=1044464 +nodemcu.menu.eesz.4M.build.rfcal_addr=0x3FC000 +nodemcu.menu.ip.lm2f=v2 Lower Memory +nodemcu.menu.ip.lm2f.build.lwip_include=lwip2/include +nodemcu.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +nodemcu.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +nodemcu.menu.ip.hb2f=v2 Higher Bandwidth +nodemcu.menu.ip.hb2f.build.lwip_include=lwip2/include +nodemcu.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +nodemcu.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +nodemcu.menu.ip.lm2n=v2 Lower Memory (no features) +nodemcu.menu.ip.lm2n.build.lwip_include=lwip2/include +nodemcu.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +nodemcu.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +nodemcu.menu.ip.hb2n=v2 Higher Bandwidth (no features) +nodemcu.menu.ip.hb2n.build.lwip_include=lwip2/include +nodemcu.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +nodemcu.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +nodemcu.menu.ip.lm6f=v2 IPv6 Lower Memory +nodemcu.menu.ip.lm6f.build.lwip_include=lwip2/include +nodemcu.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +nodemcu.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +nodemcu.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +nodemcu.menu.ip.hb6f.build.lwip_include=lwip2/include +nodemcu.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +nodemcu.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +nodemcu.menu.dbg.Disabled=Disabled +nodemcu.menu.dbg.Disabled.build.debug_port= +nodemcu.menu.dbg.Serial=Serial +nodemcu.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +nodemcu.menu.dbg.Serial1=Serial1 +nodemcu.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +nodemcu.menu.lvl.None____=None +nodemcu.menu.lvl.None____.build.debug_level= +nodemcu.menu.lvl.SSL=SSL +nodemcu.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +nodemcu.menu.lvl.TLS_MEM=TLS_MEM +nodemcu.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +nodemcu.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +nodemcu.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +nodemcu.menu.lvl.HTTP_SERVER=HTTP_SERVER +nodemcu.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +nodemcu.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +nodemcu.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +nodemcu.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +nodemcu.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +nodemcu.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +nodemcu.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +nodemcu.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +nodemcu.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +nodemcu.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +nodemcu.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +nodemcu.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +nodemcu.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +nodemcu.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcu.menu.lvl.CORE=CORE +nodemcu.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +nodemcu.menu.lvl.WIFI=WIFI +nodemcu.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +nodemcu.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +nodemcu.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +nodemcu.menu.lvl.UPDATER=UPDATER +nodemcu.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +nodemcu.menu.lvl.OTA=OTA +nodemcu.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +nodemcu.menu.lvl.OOM=OOM +nodemcu.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +nodemcu.menu.lvl.MDNS=MDNS +nodemcu.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcu.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcu.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +nodemcu.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +nodemcu.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +nodemcu.menu.wipe.none=Only Sketch +nodemcu.menu.wipe.none.upload.erase_cmd= +nodemcu.menu.wipe.sdk=Sketch + WiFi Settings +nodemcu.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +nodemcu.menu.wipe.all=All Flash Contents +nodemcu.menu.wipe.all.upload.erase_cmd=erase_flash +nodemcu.menu.baud.115200=115200 +nodemcu.menu.baud.115200.upload.speed=115200 +nodemcu.menu.baud.57600=57600 +nodemcu.menu.baud.57600.upload.speed=57600 +nodemcu.menu.baud.230400.linux=230400 +nodemcu.menu.baud.230400.macosx=230400 +nodemcu.menu.baud.230400.upload.speed=230400 +nodemcu.menu.baud.256000.windows=256000 +nodemcu.menu.baud.256000.upload.speed=256000 +nodemcu.menu.baud.460800.linux=460800 +nodemcu.menu.baud.460800.macosx=460800 +nodemcu.menu.baud.460800.upload.speed=460800 +nodemcu.menu.baud.512000.windows=512000 +nodemcu.menu.baud.512000.upload.speed=512000 +nodemcu.menu.baud.921600=921600 +nodemcu.menu.baud.921600.upload.speed=921600 +nodemcu.menu.baud.3000000=3000000 +nodemcu.menu.baud.3000000.upload.speed=3000000 + +############################################################## +nodemcuv2.name=NodeMCU 1.0 (ESP-12E Module) +nodemcuv2.build.board=ESP8266_NODEMCU +nodemcuv2.build.variant=nodemcu +nodemcuv2.upload.tool=esptool +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.core=esp8266 +nodemcuv2.build.spiffs_pagesize=256 +nodemcuv2.build.debug_port= +nodemcuv2.build.debug_level= +nodemcuv2.menu.xtal.80=80 MHz +nodemcuv2.menu.xtal.80.build.f_cpu=80000000L +nodemcuv2.menu.xtal.160=160 MHz +nodemcuv2.menu.xtal.160.build.f_cpu=160000000L +nodemcuv2.menu.vt.flash=Flash +nodemcuv2.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +nodemcuv2.menu.vt.heap=Heap +nodemcuv2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +nodemcuv2.menu.vt.iram=IRAM +nodemcuv2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +nodemcuv2.menu.exception.disabled=Disabled (new aborts on oom) +nodemcuv2.menu.exception.disabled.build.exception_flags=-fno-exceptions +nodemcuv2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +nodemcuv2.menu.exception.enabled=Enabled +nodemcuv2.menu.exception.enabled.build.exception_flags=-fexceptions +nodemcuv2.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +nodemcuv2.menu.stacksmash.disabled=Disabled +nodemcuv2.menu.stacksmash.disabled.build.stacksmash_flags= +nodemcuv2.menu.stacksmash.enabled=Enabled +nodemcuv2.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +nodemcuv2.menu.ssl.all=All SSL ciphers (most compatible) +nodemcuv2.menu.ssl.all.build.sslflags= +nodemcuv2.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +nodemcuv2.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +nodemcuv2.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +nodemcuv2.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +nodemcuv2.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +nodemcuv2.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +nodemcuv2.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +nodemcuv2.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +nodemcuv2.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +nodemcuv2.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +nodemcuv2.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +nodemcuv2.menu.non32xfer.fast.build.non32xferflags= +nodemcuv2.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +nodemcuv2.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +nodemcuv2.upload.resetmethod=--before default_reset --after hard_reset +nodemcuv2.build.flash_mode=dio +nodemcuv2.build.flash_flags=-DFLASHMODE_DIO +nodemcuv2.build.flash_freq=40 +nodemcuv2.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +nodemcuv2.menu.eesz.4M2M.build.flash_size=4M +nodemcuv2.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +nodemcuv2.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +nodemcuv2.menu.eesz.4M2M.build.spiffs_pagesize=256 +nodemcuv2.menu.eesz.4M2M.upload.maximum_size=1044464 +nodemcuv2.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +nodemcuv2.menu.eesz.4M2M.build.spiffs_start=0x200000 +nodemcuv2.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +nodemcuv2.menu.eesz.4M2M.build.spiffs_blocksize=8192 +nodemcuv2.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +nodemcuv2.menu.eesz.4M3M.build.flash_size=4M +nodemcuv2.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +nodemcuv2.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +nodemcuv2.menu.eesz.4M3M.build.spiffs_pagesize=256 +nodemcuv2.menu.eesz.4M3M.upload.maximum_size=1044464 +nodemcuv2.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +nodemcuv2.menu.eesz.4M3M.build.spiffs_start=0x100000 +nodemcuv2.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +nodemcuv2.menu.eesz.4M3M.build.spiffs_blocksize=8192 +nodemcuv2.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +nodemcuv2.menu.eesz.4M1M.build.flash_size=4M +nodemcuv2.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +nodemcuv2.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +nodemcuv2.menu.eesz.4M1M.build.spiffs_pagesize=256 +nodemcuv2.menu.eesz.4M1M.upload.maximum_size=1044464 +nodemcuv2.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +nodemcuv2.menu.eesz.4M1M.build.spiffs_start=0x300000 +nodemcuv2.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +nodemcuv2.menu.eesz.4M1M.build.spiffs_blocksize=8192 +nodemcuv2.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +nodemcuv2.menu.eesz.4M.build.flash_size=4M +nodemcuv2.menu.eesz.4M.build.flash_size_bytes=0x400000 +nodemcuv2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +nodemcuv2.menu.eesz.4M.build.spiffs_pagesize=256 +nodemcuv2.menu.eesz.4M.upload.maximum_size=1044464 +nodemcuv2.menu.eesz.4M.build.rfcal_addr=0x3FC000 +nodemcuv2.menu.led.2=2 +nodemcuv2.menu.led.2.build.led=-DLED_BUILTIN=2 +nodemcuv2.menu.led.16=16 +nodemcuv2.menu.led.16.build.led=-DLED_BUILTIN=16 +nodemcuv2.menu.ip.lm2f=v2 Lower Memory +nodemcuv2.menu.ip.lm2f.build.lwip_include=lwip2/include +nodemcuv2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +nodemcuv2.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +nodemcuv2.menu.ip.hb2f=v2 Higher Bandwidth +nodemcuv2.menu.ip.hb2f.build.lwip_include=lwip2/include +nodemcuv2.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +nodemcuv2.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +nodemcuv2.menu.ip.lm2n=v2 Lower Memory (no features) +nodemcuv2.menu.ip.lm2n.build.lwip_include=lwip2/include +nodemcuv2.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +nodemcuv2.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +nodemcuv2.menu.ip.hb2n=v2 Higher Bandwidth (no features) +nodemcuv2.menu.ip.hb2n.build.lwip_include=lwip2/include +nodemcuv2.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +nodemcuv2.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +nodemcuv2.menu.ip.lm6f=v2 IPv6 Lower Memory +nodemcuv2.menu.ip.lm6f.build.lwip_include=lwip2/include +nodemcuv2.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +nodemcuv2.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +nodemcuv2.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +nodemcuv2.menu.ip.hb6f.build.lwip_include=lwip2/include +nodemcuv2.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +nodemcuv2.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +nodemcuv2.menu.dbg.Disabled=Disabled +nodemcuv2.menu.dbg.Disabled.build.debug_port= +nodemcuv2.menu.dbg.Serial=Serial +nodemcuv2.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +nodemcuv2.menu.dbg.Serial1=Serial1 +nodemcuv2.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +nodemcuv2.menu.lvl.None____=None +nodemcuv2.menu.lvl.None____.build.debug_level= +nodemcuv2.menu.lvl.SSL=SSL +nodemcuv2.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +nodemcuv2.menu.lvl.TLS_MEM=TLS_MEM +nodemcuv2.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +nodemcuv2.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +nodemcuv2.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +nodemcuv2.menu.lvl.HTTP_SERVER=HTTP_SERVER +nodemcuv2.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +nodemcuv2.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +nodemcuv2.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +nodemcuv2.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +nodemcuv2.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +nodemcuv2.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +nodemcuv2.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +nodemcuv2.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +nodemcuv2.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +nodemcuv2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +nodemcuv2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +nodemcuv2.menu.lvl.CORE=CORE +nodemcuv2.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +nodemcuv2.menu.lvl.WIFI=WIFI +nodemcuv2.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +nodemcuv2.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +nodemcuv2.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +nodemcuv2.menu.lvl.UPDATER=UPDATER +nodemcuv2.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +nodemcuv2.menu.lvl.OTA=OTA +nodemcuv2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +nodemcuv2.menu.lvl.OOM=OOM +nodemcuv2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +nodemcuv2.menu.lvl.MDNS=MDNS +nodemcuv2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcuv2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +nodemcuv2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +nodemcuv2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +nodemcuv2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +nodemcuv2.menu.wipe.none=Only Sketch +nodemcuv2.menu.wipe.none.upload.erase_cmd= +nodemcuv2.menu.wipe.sdk=Sketch + WiFi Settings +nodemcuv2.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +nodemcuv2.menu.wipe.all=All Flash Contents +nodemcuv2.menu.wipe.all.upload.erase_cmd=erase_flash +nodemcuv2.menu.baud.115200=115200 +nodemcuv2.menu.baud.115200.upload.speed=115200 +nodemcuv2.menu.baud.57600=57600 +nodemcuv2.menu.baud.57600.upload.speed=57600 +nodemcuv2.menu.baud.230400.linux=230400 +nodemcuv2.menu.baud.230400.macosx=230400 +nodemcuv2.menu.baud.230400.upload.speed=230400 +nodemcuv2.menu.baud.256000.windows=256000 +nodemcuv2.menu.baud.256000.upload.speed=256000 +nodemcuv2.menu.baud.460800.linux=460800 +nodemcuv2.menu.baud.460800.macosx=460800 +nodemcuv2.menu.baud.460800.upload.speed=460800 +nodemcuv2.menu.baud.512000.windows=512000 +nodemcuv2.menu.baud.512000.upload.speed=512000 +nodemcuv2.menu.baud.921600=921600 +nodemcuv2.menu.baud.921600.upload.speed=921600 +nodemcuv2.menu.baud.3000000=3000000 +nodemcuv2.menu.baud.3000000.upload.speed=3000000 + +############################################################## +modwifi.name=Olimex MOD-WIFI-ESP8266(-DEV) +modwifi.build.board=MOD_WIFI_ESP8266 +modwifi.build.variant=modwifi +modwifi.upload.tool=esptool +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.core=esp8266 +modwifi.build.spiffs_pagesize=256 +modwifi.build.debug_port= +modwifi.build.debug_level= +modwifi.menu.xtal.80=80 MHz +modwifi.menu.xtal.80.build.f_cpu=80000000L +modwifi.menu.xtal.160=160 MHz +modwifi.menu.xtal.160.build.f_cpu=160000000L +modwifi.menu.vt.flash=Flash +modwifi.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +modwifi.menu.vt.heap=Heap +modwifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +modwifi.menu.vt.iram=IRAM +modwifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +modwifi.menu.exception.disabled=Disabled (new aborts on oom) +modwifi.menu.exception.disabled.build.exception_flags=-fno-exceptions +modwifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +modwifi.menu.exception.enabled=Enabled +modwifi.menu.exception.enabled.build.exception_flags=-fexceptions +modwifi.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +modwifi.menu.stacksmash.disabled=Disabled +modwifi.menu.stacksmash.disabled.build.stacksmash_flags= +modwifi.menu.stacksmash.enabled=Enabled +modwifi.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +modwifi.menu.ssl.all=All SSL ciphers (most compatible) +modwifi.menu.ssl.all.build.sslflags= +modwifi.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +modwifi.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +modwifi.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +modwifi.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +modwifi.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +modwifi.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +modwifi.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +modwifi.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +modwifi.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +modwifi.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +modwifi.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +modwifi.menu.non32xfer.fast.build.non32xferflags= +modwifi.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +modwifi.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +modwifi.upload.resetmethod=--before no_reset --after soft_reset +modwifi.build.flash_mode=qio +modwifi.build.flash_flags=-DFLASHMODE_QIO +modwifi.build.flash_freq=40 +modwifi.menu.eesz.2M64=2MB (FS:64KB OTA:~992KB) +modwifi.menu.eesz.2M64.build.flash_size=2M +modwifi.menu.eesz.2M64.build.flash_size_bytes=0x200000 +modwifi.menu.eesz.2M64.build.flash_ld=eagle.flash.2m64.ld +modwifi.menu.eesz.2M64.build.spiffs_pagesize=256 +modwifi.menu.eesz.2M64.upload.maximum_size=1044464 +modwifi.menu.eesz.2M64.build.rfcal_addr=0x1FC000 +modwifi.menu.eesz.2M64.build.spiffs_start=0x1F0000 +modwifi.menu.eesz.2M64.build.spiffs_end=0x1FB000 +modwifi.menu.eesz.2M64.build.spiffs_blocksize=4096 +modwifi.menu.eesz.2M128=2MB (FS:128KB OTA:~960KB) +modwifi.menu.eesz.2M128.build.flash_size=2M +modwifi.menu.eesz.2M128.build.flash_size_bytes=0x200000 +modwifi.menu.eesz.2M128.build.flash_ld=eagle.flash.2m128.ld +modwifi.menu.eesz.2M128.build.spiffs_pagesize=256 +modwifi.menu.eesz.2M128.upload.maximum_size=1044464 +modwifi.menu.eesz.2M128.build.rfcal_addr=0x1FC000 +modwifi.menu.eesz.2M128.build.spiffs_start=0x1E0000 +modwifi.menu.eesz.2M128.build.spiffs_end=0x1FB000 +modwifi.menu.eesz.2M128.build.spiffs_blocksize=4096 +modwifi.menu.eesz.2M256=2MB (FS:256KB OTA:~896KB) +modwifi.menu.eesz.2M256.build.flash_size=2M +modwifi.menu.eesz.2M256.build.flash_size_bytes=0x200000 +modwifi.menu.eesz.2M256.build.flash_ld=eagle.flash.2m256.ld +modwifi.menu.eesz.2M256.build.spiffs_pagesize=256 +modwifi.menu.eesz.2M256.upload.maximum_size=1044464 +modwifi.menu.eesz.2M256.build.rfcal_addr=0x1FC000 +modwifi.menu.eesz.2M256.build.spiffs_start=0x1C0000 +modwifi.menu.eesz.2M256.build.spiffs_end=0x1FB000 +modwifi.menu.eesz.2M256.build.spiffs_blocksize=4096 +modwifi.menu.eesz.2M512=2MB (FS:512KB OTA:~768KB) +modwifi.menu.eesz.2M512.build.flash_size=2M +modwifi.menu.eesz.2M512.build.flash_size_bytes=0x200000 +modwifi.menu.eesz.2M512.build.flash_ld=eagle.flash.2m512.ld +modwifi.menu.eesz.2M512.build.spiffs_pagesize=256 +modwifi.menu.eesz.2M512.upload.maximum_size=1044464 +modwifi.menu.eesz.2M512.build.rfcal_addr=0x1FC000 +modwifi.menu.eesz.2M512.build.spiffs_start=0x180000 +modwifi.menu.eesz.2M512.build.spiffs_end=0x1FA000 +modwifi.menu.eesz.2M512.build.spiffs_blocksize=8192 +modwifi.menu.eesz.2M1M=2MB (FS:1MB OTA:~512KB) +modwifi.menu.eesz.2M1M.build.flash_size=2M +modwifi.menu.eesz.2M1M.build.flash_size_bytes=0x200000 +modwifi.menu.eesz.2M1M.build.flash_ld=eagle.flash.2m1m.ld +modwifi.menu.eesz.2M1M.build.spiffs_pagesize=256 +modwifi.menu.eesz.2M1M.upload.maximum_size=1044464 +modwifi.menu.eesz.2M1M.build.rfcal_addr=0x1FC000 +modwifi.menu.eesz.2M1M.build.spiffs_start=0x100000 +modwifi.menu.eesz.2M1M.build.spiffs_end=0x1FA000 +modwifi.menu.eesz.2M1M.build.spiffs_blocksize=8192 +modwifi.menu.eesz.2M=2MB (FS:none OTA:~1019KB) +modwifi.menu.eesz.2M.build.flash_size=2M +modwifi.menu.eesz.2M.build.flash_size_bytes=0x200000 +modwifi.menu.eesz.2M.build.flash_ld=eagle.flash.2m.ld +modwifi.menu.eesz.2M.build.spiffs_pagesize=256 +modwifi.menu.eesz.2M.upload.maximum_size=1044464 +modwifi.menu.eesz.2M.build.rfcal_addr=0x1FC000 +modwifi.menu.ip.lm2f=v2 Lower Memory +modwifi.menu.ip.lm2f.build.lwip_include=lwip2/include +modwifi.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +modwifi.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +modwifi.menu.ip.hb2f=v2 Higher Bandwidth +modwifi.menu.ip.hb2f.build.lwip_include=lwip2/include +modwifi.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +modwifi.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +modwifi.menu.ip.lm2n=v2 Lower Memory (no features) +modwifi.menu.ip.lm2n.build.lwip_include=lwip2/include +modwifi.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +modwifi.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +modwifi.menu.ip.hb2n=v2 Higher Bandwidth (no features) +modwifi.menu.ip.hb2n.build.lwip_include=lwip2/include +modwifi.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +modwifi.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +modwifi.menu.ip.lm6f=v2 IPv6 Lower Memory +modwifi.menu.ip.lm6f.build.lwip_include=lwip2/include +modwifi.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +modwifi.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +modwifi.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +modwifi.menu.ip.hb6f.build.lwip_include=lwip2/include +modwifi.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +modwifi.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +modwifi.menu.dbg.Disabled=Disabled +modwifi.menu.dbg.Disabled.build.debug_port= +modwifi.menu.dbg.Serial=Serial +modwifi.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +modwifi.menu.dbg.Serial1=Serial1 +modwifi.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +modwifi.menu.lvl.None____=None +modwifi.menu.lvl.None____.build.debug_level= +modwifi.menu.lvl.SSL=SSL +modwifi.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +modwifi.menu.lvl.TLS_MEM=TLS_MEM +modwifi.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +modwifi.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +modwifi.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +modwifi.menu.lvl.HTTP_SERVER=HTTP_SERVER +modwifi.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +modwifi.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +modwifi.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +modwifi.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +modwifi.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +modwifi.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +modwifi.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +modwifi.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +modwifi.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +modwifi.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +modwifi.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +modwifi.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +modwifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +modwifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +modwifi.menu.lvl.CORE=CORE +modwifi.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +modwifi.menu.lvl.WIFI=WIFI +modwifi.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +modwifi.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +modwifi.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +modwifi.menu.lvl.UPDATER=UPDATER +modwifi.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +modwifi.menu.lvl.OTA=OTA +modwifi.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +modwifi.menu.lvl.OOM=OOM +modwifi.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +modwifi.menu.lvl.MDNS=MDNS +modwifi.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +modwifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +modwifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +modwifi.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +modwifi.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +modwifi.menu.wipe.none=Only Sketch +modwifi.menu.wipe.none.upload.erase_cmd= +modwifi.menu.wipe.sdk=Sketch + WiFi Settings +modwifi.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +modwifi.menu.wipe.all=All Flash Contents +modwifi.menu.wipe.all.upload.erase_cmd=erase_flash +modwifi.menu.baud.115200=115200 +modwifi.menu.baud.115200.upload.speed=115200 +modwifi.menu.baud.57600=57600 +modwifi.menu.baud.57600.upload.speed=57600 +modwifi.menu.baud.230400.linux=230400 +modwifi.menu.baud.230400.macosx=230400 +modwifi.menu.baud.230400.upload.speed=230400 +modwifi.menu.baud.256000.windows=256000 +modwifi.menu.baud.256000.upload.speed=256000 +modwifi.menu.baud.460800.linux=460800 +modwifi.menu.baud.460800.macosx=460800 +modwifi.menu.baud.460800.upload.speed=460800 +modwifi.menu.baud.512000.windows=512000 +modwifi.menu.baud.512000.upload.speed=512000 +modwifi.menu.baud.921600=921600 +modwifi.menu.baud.921600.upload.speed=921600 +modwifi.menu.baud.3000000=3000000 +modwifi.menu.baud.3000000.upload.speed=3000000 + +############################################################## +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.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.core=esp8266 +phoenix_v1.build.spiffs_pagesize=256 +phoenix_v1.build.debug_port= +phoenix_v1.build.debug_level= +phoenix_v1.menu.xtal.80=80 MHz +phoenix_v1.menu.xtal.80.build.f_cpu=80000000L +phoenix_v1.menu.xtal.160=160 MHz +phoenix_v1.menu.xtal.160.build.f_cpu=160000000L +phoenix_v1.menu.vt.flash=Flash +phoenix_v1.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +phoenix_v1.menu.vt.heap=Heap +phoenix_v1.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +phoenix_v1.menu.vt.iram=IRAM +phoenix_v1.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +phoenix_v1.menu.exception.disabled=Disabled (new aborts on oom) +phoenix_v1.menu.exception.disabled.build.exception_flags=-fno-exceptions +phoenix_v1.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +phoenix_v1.menu.exception.enabled=Enabled +phoenix_v1.menu.exception.enabled.build.exception_flags=-fexceptions +phoenix_v1.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +phoenix_v1.menu.stacksmash.disabled=Disabled +phoenix_v1.menu.stacksmash.disabled.build.stacksmash_flags= +phoenix_v1.menu.stacksmash.enabled=Enabled +phoenix_v1.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +phoenix_v1.menu.ssl.all=All SSL ciphers (most compatible) +phoenix_v1.menu.ssl.all.build.sslflags= +phoenix_v1.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +phoenix_v1.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +phoenix_v1.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +phoenix_v1.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +phoenix_v1.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +phoenix_v1.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +phoenix_v1.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +phoenix_v1.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +phoenix_v1.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +phoenix_v1.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +phoenix_v1.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +phoenix_v1.menu.non32xfer.fast.build.non32xferflags= +phoenix_v1.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +phoenix_v1.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +phoenix_v1.build.flash_mode=dio +phoenix_v1.build.flash_flags=-DFLASHMODE_DIO +phoenix_v1.build.flash_freq=40 +phoenix_v1.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +phoenix_v1.menu.eesz.4M2M.build.flash_size=4M +phoenix_v1.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +phoenix_v1.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +phoenix_v1.menu.eesz.4M2M.build.spiffs_pagesize=256 +phoenix_v1.menu.eesz.4M2M.upload.maximum_size=1044464 +phoenix_v1.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +phoenix_v1.menu.eesz.4M2M.build.spiffs_start=0x200000 +phoenix_v1.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +phoenix_v1.menu.eesz.4M2M.build.spiffs_blocksize=8192 +phoenix_v1.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +phoenix_v1.menu.eesz.4M3M.build.flash_size=4M +phoenix_v1.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +phoenix_v1.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +phoenix_v1.menu.eesz.4M3M.build.spiffs_pagesize=256 +phoenix_v1.menu.eesz.4M3M.upload.maximum_size=1044464 +phoenix_v1.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +phoenix_v1.menu.eesz.4M3M.build.spiffs_start=0x100000 +phoenix_v1.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +phoenix_v1.menu.eesz.4M3M.build.spiffs_blocksize=8192 +phoenix_v1.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +phoenix_v1.menu.eesz.4M1M.build.flash_size=4M +phoenix_v1.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +phoenix_v1.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +phoenix_v1.menu.eesz.4M1M.build.spiffs_pagesize=256 +phoenix_v1.menu.eesz.4M1M.upload.maximum_size=1044464 +phoenix_v1.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +phoenix_v1.menu.eesz.4M1M.build.spiffs_start=0x300000 +phoenix_v1.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +phoenix_v1.menu.eesz.4M1M.build.spiffs_blocksize=8192 +phoenix_v1.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +phoenix_v1.menu.eesz.4M.build.flash_size=4M +phoenix_v1.menu.eesz.4M.build.flash_size_bytes=0x400000 +phoenix_v1.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +phoenix_v1.menu.eesz.4M.build.spiffs_pagesize=256 +phoenix_v1.menu.eesz.4M.upload.maximum_size=1044464 +phoenix_v1.menu.eesz.4M.build.rfcal_addr=0x3FC000 +phoenix_v1.menu.ResetMethod.nodemcu=dtr (aka nodemcu) +phoenix_v1.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset +phoenix_v1.menu.ResetMethod.ck=no dtr (aka ck) +phoenix_v1.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset +phoenix_v1.menu.ip.lm2f=v2 Lower Memory +phoenix_v1.menu.ip.lm2f.build.lwip_include=lwip2/include +phoenix_v1.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +phoenix_v1.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +phoenix_v1.menu.ip.hb2f=v2 Higher Bandwidth +phoenix_v1.menu.ip.hb2f.build.lwip_include=lwip2/include +phoenix_v1.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +phoenix_v1.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +phoenix_v1.menu.ip.lm2n=v2 Lower Memory (no features) +phoenix_v1.menu.ip.lm2n.build.lwip_include=lwip2/include +phoenix_v1.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +phoenix_v1.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +phoenix_v1.menu.ip.hb2n=v2 Higher Bandwidth (no features) +phoenix_v1.menu.ip.hb2n.build.lwip_include=lwip2/include +phoenix_v1.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +phoenix_v1.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +phoenix_v1.menu.ip.lm6f=v2 IPv6 Lower Memory +phoenix_v1.menu.ip.lm6f.build.lwip_include=lwip2/include +phoenix_v1.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +phoenix_v1.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +phoenix_v1.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +phoenix_v1.menu.ip.hb6f.build.lwip_include=lwip2/include +phoenix_v1.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +phoenix_v1.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +phoenix_v1.menu.dbg.Disabled=Disabled +phoenix_v1.menu.dbg.Disabled.build.debug_port= +phoenix_v1.menu.dbg.Serial=Serial +phoenix_v1.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +phoenix_v1.menu.dbg.Serial1=Serial1 +phoenix_v1.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +phoenix_v1.menu.lvl.None____=None +phoenix_v1.menu.lvl.None____.build.debug_level= +phoenix_v1.menu.lvl.SSL=SSL +phoenix_v1.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +phoenix_v1.menu.lvl.TLS_MEM=TLS_MEM +phoenix_v1.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +phoenix_v1.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +phoenix_v1.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +phoenix_v1.menu.lvl.HTTP_SERVER=HTTP_SERVER +phoenix_v1.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +phoenix_v1.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +phoenix_v1.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +phoenix_v1.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +phoenix_v1.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +phoenix_v1.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +phoenix_v1.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +phoenix_v1.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +phoenix_v1.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +phoenix_v1.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +phoenix_v1.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +phoenix_v1.menu.lvl.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.lvl.CORE=CORE +phoenix_v1.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +phoenix_v1.menu.lvl.WIFI=WIFI +phoenix_v1.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +phoenix_v1.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +phoenix_v1.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +phoenix_v1.menu.lvl.UPDATER=UPDATER +phoenix_v1.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +phoenix_v1.menu.lvl.OTA=OTA +phoenix_v1.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +phoenix_v1.menu.lvl.OOM=OOM +phoenix_v1.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +phoenix_v1.menu.lvl.MDNS=MDNS +phoenix_v1.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v1.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v1.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +phoenix_v1.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +phoenix_v1.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +phoenix_v1.menu.wipe.none=Only Sketch +phoenix_v1.menu.wipe.none.upload.erase_cmd= +phoenix_v1.menu.wipe.sdk=Sketch + WiFi Settings +phoenix_v1.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +phoenix_v1.menu.wipe.all=All Flash Contents +phoenix_v1.menu.wipe.all.upload.erase_cmd=erase_flash +phoenix_v1.menu.baud.115200=115200 +phoenix_v1.menu.baud.115200.upload.speed=115200 +phoenix_v1.menu.baud.57600=57600 +phoenix_v1.menu.baud.57600.upload.speed=57600 +phoenix_v1.menu.baud.230400.linux=230400 +phoenix_v1.menu.baud.230400.macosx=230400 +phoenix_v1.menu.baud.230400.upload.speed=230400 +phoenix_v1.menu.baud.256000.windows=256000 +phoenix_v1.menu.baud.256000.upload.speed=256000 +phoenix_v1.menu.baud.460800.linux=460800 +phoenix_v1.menu.baud.460800.macosx=460800 +phoenix_v1.menu.baud.460800.upload.speed=460800 +phoenix_v1.menu.baud.512000.windows=512000 +phoenix_v1.menu.baud.512000.upload.speed=512000 +phoenix_v1.menu.baud.921600=921600 +phoenix_v1.menu.baud.921600.upload.speed=921600 +phoenix_v1.menu.baud.3000000=3000000 +phoenix_v1.menu.baud.3000000.upload.speed=3000000 + +############################################################## +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.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.core=esp8266 +phoenix_v2.build.spiffs_pagesize=256 +phoenix_v2.build.debug_port= +phoenix_v2.build.debug_level= +phoenix_v2.menu.xtal.80=80 MHz +phoenix_v2.menu.xtal.80.build.f_cpu=80000000L +phoenix_v2.menu.xtal.160=160 MHz +phoenix_v2.menu.xtal.160.build.f_cpu=160000000L +phoenix_v2.menu.vt.flash=Flash +phoenix_v2.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +phoenix_v2.menu.vt.heap=Heap +phoenix_v2.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +phoenix_v2.menu.vt.iram=IRAM +phoenix_v2.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +phoenix_v2.menu.exception.disabled=Disabled (new aborts on oom) +phoenix_v2.menu.exception.disabled.build.exception_flags=-fno-exceptions +phoenix_v2.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +phoenix_v2.menu.exception.enabled=Enabled +phoenix_v2.menu.exception.enabled.build.exception_flags=-fexceptions +phoenix_v2.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +phoenix_v2.menu.stacksmash.disabled=Disabled +phoenix_v2.menu.stacksmash.disabled.build.stacksmash_flags= +phoenix_v2.menu.stacksmash.enabled=Enabled +phoenix_v2.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +phoenix_v2.menu.ssl.all=All SSL ciphers (most compatible) +phoenix_v2.menu.ssl.all.build.sslflags= +phoenix_v2.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +phoenix_v2.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +phoenix_v2.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +phoenix_v2.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +phoenix_v2.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +phoenix_v2.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +phoenix_v2.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +phoenix_v2.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +phoenix_v2.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +phoenix_v2.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +phoenix_v2.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +phoenix_v2.menu.non32xfer.fast.build.non32xferflags= +phoenix_v2.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +phoenix_v2.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +phoenix_v2.build.flash_mode=dio +phoenix_v2.build.flash_flags=-DFLASHMODE_DIO +phoenix_v2.build.flash_freq=40 +phoenix_v2.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +phoenix_v2.menu.eesz.4M2M.build.flash_size=4M +phoenix_v2.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +phoenix_v2.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +phoenix_v2.menu.eesz.4M2M.build.spiffs_pagesize=256 +phoenix_v2.menu.eesz.4M2M.upload.maximum_size=1044464 +phoenix_v2.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +phoenix_v2.menu.eesz.4M2M.build.spiffs_start=0x200000 +phoenix_v2.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +phoenix_v2.menu.eesz.4M2M.build.spiffs_blocksize=8192 +phoenix_v2.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +phoenix_v2.menu.eesz.4M3M.build.flash_size=4M +phoenix_v2.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +phoenix_v2.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +phoenix_v2.menu.eesz.4M3M.build.spiffs_pagesize=256 +phoenix_v2.menu.eesz.4M3M.upload.maximum_size=1044464 +phoenix_v2.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +phoenix_v2.menu.eesz.4M3M.build.spiffs_start=0x100000 +phoenix_v2.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +phoenix_v2.menu.eesz.4M3M.build.spiffs_blocksize=8192 +phoenix_v2.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +phoenix_v2.menu.eesz.4M1M.build.flash_size=4M +phoenix_v2.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +phoenix_v2.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +phoenix_v2.menu.eesz.4M1M.build.spiffs_pagesize=256 +phoenix_v2.menu.eesz.4M1M.upload.maximum_size=1044464 +phoenix_v2.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +phoenix_v2.menu.eesz.4M1M.build.spiffs_start=0x300000 +phoenix_v2.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +phoenix_v2.menu.eesz.4M1M.build.spiffs_blocksize=8192 +phoenix_v2.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +phoenix_v2.menu.eesz.4M.build.flash_size=4M +phoenix_v2.menu.eesz.4M.build.flash_size_bytes=0x400000 +phoenix_v2.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +phoenix_v2.menu.eesz.4M.build.spiffs_pagesize=256 +phoenix_v2.menu.eesz.4M.upload.maximum_size=1044464 +phoenix_v2.menu.eesz.4M.build.rfcal_addr=0x3FC000 +phoenix_v2.menu.ResetMethod.nodemcu=dtr (aka nodemcu) +phoenix_v2.menu.ResetMethod.nodemcu.upload.resetmethod=--before default_reset --after hard_reset +phoenix_v2.menu.ResetMethod.ck=no dtr (aka ck) +phoenix_v2.menu.ResetMethod.ck.upload.resetmethod=--before no_reset --after soft_reset +phoenix_v2.menu.ip.lm2f=v2 Lower Memory +phoenix_v2.menu.ip.lm2f.build.lwip_include=lwip2/include +phoenix_v2.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +phoenix_v2.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +phoenix_v2.menu.ip.hb2f=v2 Higher Bandwidth +phoenix_v2.menu.ip.hb2f.build.lwip_include=lwip2/include +phoenix_v2.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +phoenix_v2.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +phoenix_v2.menu.ip.lm2n=v2 Lower Memory (no features) +phoenix_v2.menu.ip.lm2n.build.lwip_include=lwip2/include +phoenix_v2.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +phoenix_v2.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +phoenix_v2.menu.ip.hb2n=v2 Higher Bandwidth (no features) +phoenix_v2.menu.ip.hb2n.build.lwip_include=lwip2/include +phoenix_v2.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +phoenix_v2.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +phoenix_v2.menu.ip.lm6f=v2 IPv6 Lower Memory +phoenix_v2.menu.ip.lm6f.build.lwip_include=lwip2/include +phoenix_v2.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +phoenix_v2.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +phoenix_v2.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +phoenix_v2.menu.ip.hb6f.build.lwip_include=lwip2/include +phoenix_v2.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +phoenix_v2.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +phoenix_v2.menu.dbg.Disabled=Disabled +phoenix_v2.menu.dbg.Disabled.build.debug_port= +phoenix_v2.menu.dbg.Serial=Serial +phoenix_v2.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +phoenix_v2.menu.dbg.Serial1=Serial1 +phoenix_v2.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +phoenix_v2.menu.lvl.None____=None +phoenix_v2.menu.lvl.None____.build.debug_level= +phoenix_v2.menu.lvl.SSL=SSL +phoenix_v2.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +phoenix_v2.menu.lvl.TLS_MEM=TLS_MEM +phoenix_v2.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +phoenix_v2.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +phoenix_v2.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +phoenix_v2.menu.lvl.HTTP_SERVER=HTTP_SERVER +phoenix_v2.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +phoenix_v2.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +phoenix_v2.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +phoenix_v2.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +phoenix_v2.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +phoenix_v2.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +phoenix_v2.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +phoenix_v2.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +phoenix_v2.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +phoenix_v2.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +phoenix_v2.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +phoenix_v2.menu.lvl.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.lvl.CORE=CORE +phoenix_v2.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +phoenix_v2.menu.lvl.WIFI=WIFI +phoenix_v2.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +phoenix_v2.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +phoenix_v2.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +phoenix_v2.menu.lvl.UPDATER=UPDATER +phoenix_v2.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +phoenix_v2.menu.lvl.OTA=OTA +phoenix_v2.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +phoenix_v2.menu.lvl.OOM=OOM +phoenix_v2.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +phoenix_v2.menu.lvl.MDNS=MDNS +phoenix_v2.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v2.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +phoenix_v2.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +phoenix_v2.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +phoenix_v2.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +phoenix_v2.menu.wipe.none=Only Sketch +phoenix_v2.menu.wipe.none.upload.erase_cmd= +phoenix_v2.menu.wipe.sdk=Sketch + WiFi Settings +phoenix_v2.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +phoenix_v2.menu.wipe.all=All Flash Contents +phoenix_v2.menu.wipe.all.upload.erase_cmd=erase_flash +phoenix_v2.menu.baud.115200=115200 +phoenix_v2.menu.baud.115200.upload.speed=115200 +phoenix_v2.menu.baud.57600=57600 +phoenix_v2.menu.baud.57600.upload.speed=57600 +phoenix_v2.menu.baud.230400.linux=230400 +phoenix_v2.menu.baud.230400.macosx=230400 +phoenix_v2.menu.baud.230400.upload.speed=230400 +phoenix_v2.menu.baud.256000.windows=256000 +phoenix_v2.menu.baud.256000.upload.speed=256000 +phoenix_v2.menu.baud.460800.linux=460800 +phoenix_v2.menu.baud.460800.macosx=460800 +phoenix_v2.menu.baud.460800.upload.speed=460800 +phoenix_v2.menu.baud.512000.windows=512000 +phoenix_v2.menu.baud.512000.upload.speed=512000 +phoenix_v2.menu.baud.921600=921600 +phoenix_v2.menu.baud.921600.upload.speed=921600 +phoenix_v2.menu.baud.3000000=3000000 +phoenix_v2.menu.baud.3000000.upload.speed=3000000 + +############################################################## +eduinowifi.name=Schirmilabs Eduino WiFi +eduinowifi.build.board=ESP8266_SCHIRMILABS_EDUINO_WIFI +eduinowifi.build.variant=eduinowifi +eduinowifi.upload.tool=esptool +eduinowifi.upload.maximum_data_size=81920 +eduinowifi.upload.wait_for_upload_port=true +eduinowifi.upload.erase_cmd= +eduinowifi.serial.disableDTR=true +eduinowifi.serial.disableRTS=true +eduinowifi.build.mcu=esp8266 +eduinowifi.build.core=esp8266 +eduinowifi.build.spiffs_pagesize=256 +eduinowifi.build.debug_port= +eduinowifi.build.debug_level= +eduinowifi.menu.xtal.80=80 MHz +eduinowifi.menu.xtal.80.build.f_cpu=80000000L +eduinowifi.menu.xtal.160=160 MHz +eduinowifi.menu.xtal.160.build.f_cpu=160000000L +eduinowifi.menu.vt.flash=Flash +eduinowifi.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +eduinowifi.menu.vt.heap=Heap +eduinowifi.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +eduinowifi.menu.vt.iram=IRAM +eduinowifi.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +eduinowifi.menu.exception.disabled=Disabled (new aborts on oom) +eduinowifi.menu.exception.disabled.build.exception_flags=-fno-exceptions +eduinowifi.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +eduinowifi.menu.exception.enabled=Enabled +eduinowifi.menu.exception.enabled.build.exception_flags=-fexceptions +eduinowifi.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +eduinowifi.menu.stacksmash.disabled=Disabled +eduinowifi.menu.stacksmash.disabled.build.stacksmash_flags= +eduinowifi.menu.stacksmash.enabled=Enabled +eduinowifi.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +eduinowifi.menu.ssl.all=All SSL ciphers (most compatible) +eduinowifi.menu.ssl.all.build.sslflags= +eduinowifi.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +eduinowifi.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +eduinowifi.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +eduinowifi.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +eduinowifi.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +eduinowifi.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +eduinowifi.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +eduinowifi.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +eduinowifi.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +eduinowifi.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +eduinowifi.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +eduinowifi.menu.non32xfer.fast.build.non32xferflags= +eduinowifi.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +eduinowifi.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +eduinowifi.upload.resetmethod=--before default_reset --after hard_reset +eduinowifi.build.flash_mode=dio +eduinowifi.build.flash_flags=-DFLASHMODE_DIO +eduinowifi.build.flash_freq=40 +eduinowifi.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +eduinowifi.menu.eesz.4M2M.build.flash_size=4M +eduinowifi.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +eduinowifi.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +eduinowifi.menu.eesz.4M2M.build.spiffs_pagesize=256 +eduinowifi.menu.eesz.4M2M.upload.maximum_size=1044464 +eduinowifi.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +eduinowifi.menu.eesz.4M2M.build.spiffs_start=0x200000 +eduinowifi.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +eduinowifi.menu.eesz.4M2M.build.spiffs_blocksize=8192 +eduinowifi.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +eduinowifi.menu.eesz.4M3M.build.flash_size=4M +eduinowifi.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +eduinowifi.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +eduinowifi.menu.eesz.4M3M.build.spiffs_pagesize=256 +eduinowifi.menu.eesz.4M3M.upload.maximum_size=1044464 +eduinowifi.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +eduinowifi.menu.eesz.4M3M.build.spiffs_start=0x100000 +eduinowifi.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +eduinowifi.menu.eesz.4M3M.build.spiffs_blocksize=8192 +eduinowifi.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +eduinowifi.menu.eesz.4M1M.build.flash_size=4M +eduinowifi.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +eduinowifi.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +eduinowifi.menu.eesz.4M1M.build.spiffs_pagesize=256 +eduinowifi.menu.eesz.4M1M.upload.maximum_size=1044464 +eduinowifi.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +eduinowifi.menu.eesz.4M1M.build.spiffs_start=0x300000 +eduinowifi.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +eduinowifi.menu.eesz.4M1M.build.spiffs_blocksize=8192 +eduinowifi.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +eduinowifi.menu.eesz.4M.build.flash_size=4M +eduinowifi.menu.eesz.4M.build.flash_size_bytes=0x400000 +eduinowifi.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +eduinowifi.menu.eesz.4M.build.spiffs_pagesize=256 +eduinowifi.menu.eesz.4M.upload.maximum_size=1044464 +eduinowifi.menu.eesz.4M.build.rfcal_addr=0x3FC000 +eduinowifi.menu.ip.lm2f=v2 Lower Memory +eduinowifi.menu.ip.lm2f.build.lwip_include=lwip2/include +eduinowifi.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +eduinowifi.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +eduinowifi.menu.ip.hb2f=v2 Higher Bandwidth +eduinowifi.menu.ip.hb2f.build.lwip_include=lwip2/include +eduinowifi.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +eduinowifi.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +eduinowifi.menu.ip.lm2n=v2 Lower Memory (no features) +eduinowifi.menu.ip.lm2n.build.lwip_include=lwip2/include +eduinowifi.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +eduinowifi.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +eduinowifi.menu.ip.hb2n=v2 Higher Bandwidth (no features) +eduinowifi.menu.ip.hb2n.build.lwip_include=lwip2/include +eduinowifi.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +eduinowifi.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +eduinowifi.menu.ip.lm6f=v2 IPv6 Lower Memory +eduinowifi.menu.ip.lm6f.build.lwip_include=lwip2/include +eduinowifi.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +eduinowifi.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +eduinowifi.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +eduinowifi.menu.ip.hb6f.build.lwip_include=lwip2/include +eduinowifi.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +eduinowifi.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +eduinowifi.menu.dbg.Disabled=Disabled +eduinowifi.menu.dbg.Disabled.build.debug_port= +eduinowifi.menu.dbg.Serial=Serial +eduinowifi.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +eduinowifi.menu.dbg.Serial1=Serial1 +eduinowifi.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +eduinowifi.menu.lvl.None____=None +eduinowifi.menu.lvl.None____.build.debug_level= +eduinowifi.menu.lvl.SSL=SSL +eduinowifi.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +eduinowifi.menu.lvl.TLS_MEM=TLS_MEM +eduinowifi.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +eduinowifi.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +eduinowifi.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +eduinowifi.menu.lvl.HTTP_SERVER=HTTP_SERVER +eduinowifi.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +eduinowifi.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +eduinowifi.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +eduinowifi.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +eduinowifi.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +eduinowifi.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +eduinowifi.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +eduinowifi.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +eduinowifi.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +eduinowifi.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +eduinowifi.menu.lvl.CORE=CORE +eduinowifi.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +eduinowifi.menu.lvl.WIFI=WIFI +eduinowifi.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +eduinowifi.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +eduinowifi.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +eduinowifi.menu.lvl.UPDATER=UPDATER +eduinowifi.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +eduinowifi.menu.lvl.OTA=OTA +eduinowifi.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +eduinowifi.menu.lvl.OOM=OOM +eduinowifi.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +eduinowifi.menu.lvl.MDNS=MDNS +eduinowifi.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +eduinowifi.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +eduinowifi.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +eduinowifi.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +eduinowifi.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +eduinowifi.menu.wipe.none=Only Sketch +eduinowifi.menu.wipe.none.upload.erase_cmd= +eduinowifi.menu.wipe.sdk=Sketch + WiFi Settings +eduinowifi.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +eduinowifi.menu.wipe.all=All Flash Contents +eduinowifi.menu.wipe.all.upload.erase_cmd=erase_flash +eduinowifi.menu.baud.512000.windows=512000 +eduinowifi.menu.baud.512000.upload.speed=512000 +eduinowifi.menu.baud.57600=57600 +eduinowifi.menu.baud.57600.upload.speed=57600 +eduinowifi.menu.baud.115200=115200 +eduinowifi.menu.baud.115200.upload.speed=115200 +eduinowifi.menu.baud.230400.linux=230400 +eduinowifi.menu.baud.230400.macosx=230400 +eduinowifi.menu.baud.230400.upload.speed=230400 +eduinowifi.menu.baud.256000.windows=256000 +eduinowifi.menu.baud.256000.upload.speed=256000 +eduinowifi.menu.baud.460800.linux=460800 +eduinowifi.menu.baud.460800.macosx=460800 +eduinowifi.menu.baud.460800.upload.speed=460800 +eduinowifi.menu.baud.921600=921600 +eduinowifi.menu.baud.921600.upload.speed=921600 +eduinowifi.menu.baud.3000000=3000000 +eduinowifi.menu.baud.3000000.upload.speed=3000000 + +############################################################## +wiolink.name=Seeed Wio Link +wiolink.build.board=ESP8266_WIO_LINK +wiolink.build.variant=wiolink +wiolink.upload.tool=esptool +wiolink.upload.maximum_data_size=81920 +wiolink.upload.wait_for_upload_port=true +wiolink.upload.erase_cmd= +wiolink.serial.disableDTR=true +wiolink.serial.disableRTS=true +wiolink.build.mcu=esp8266 +wiolink.build.core=esp8266 +wiolink.build.spiffs_pagesize=256 +wiolink.build.debug_port= +wiolink.build.debug_level= +wiolink.menu.xtal.80=80 MHz +wiolink.menu.xtal.80.build.f_cpu=80000000L +wiolink.menu.xtal.160=160 MHz +wiolink.menu.xtal.160.build.f_cpu=160000000L +wiolink.menu.vt.flash=Flash +wiolink.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +wiolink.menu.vt.heap=Heap +wiolink.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +wiolink.menu.vt.iram=IRAM +wiolink.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +wiolink.menu.exception.disabled=Disabled (new aborts on oom) +wiolink.menu.exception.disabled.build.exception_flags=-fno-exceptions +wiolink.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +wiolink.menu.exception.enabled=Enabled +wiolink.menu.exception.enabled.build.exception_flags=-fexceptions +wiolink.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +wiolink.menu.stacksmash.disabled=Disabled +wiolink.menu.stacksmash.disabled.build.stacksmash_flags= +wiolink.menu.stacksmash.enabled=Enabled +wiolink.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +wiolink.menu.ssl.all=All SSL ciphers (most compatible) +wiolink.menu.ssl.all.build.sslflags= +wiolink.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +wiolink.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +wiolink.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +wiolink.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +wiolink.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +wiolink.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +wiolink.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +wiolink.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +wiolink.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +wiolink.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +wiolink.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +wiolink.menu.non32xfer.fast.build.non32xferflags= +wiolink.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +wiolink.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +wiolink.upload.resetmethod=--before default_reset --after hard_reset +wiolink.build.flash_mode=qio +wiolink.build.flash_flags=-DFLASHMODE_QIO +wiolink.build.flash_freq=40 +wiolink.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +wiolink.menu.eesz.4M2M.build.flash_size=4M +wiolink.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +wiolink.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +wiolink.menu.eesz.4M2M.build.spiffs_pagesize=256 +wiolink.menu.eesz.4M2M.upload.maximum_size=1044464 +wiolink.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +wiolink.menu.eesz.4M2M.build.spiffs_start=0x200000 +wiolink.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +wiolink.menu.eesz.4M2M.build.spiffs_blocksize=8192 +wiolink.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +wiolink.menu.eesz.4M3M.build.flash_size=4M +wiolink.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +wiolink.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +wiolink.menu.eesz.4M3M.build.spiffs_pagesize=256 +wiolink.menu.eesz.4M3M.upload.maximum_size=1044464 +wiolink.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +wiolink.menu.eesz.4M3M.build.spiffs_start=0x100000 +wiolink.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +wiolink.menu.eesz.4M3M.build.spiffs_blocksize=8192 +wiolink.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +wiolink.menu.eesz.4M1M.build.flash_size=4M +wiolink.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +wiolink.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +wiolink.menu.eesz.4M1M.build.spiffs_pagesize=256 +wiolink.menu.eesz.4M1M.upload.maximum_size=1044464 +wiolink.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +wiolink.menu.eesz.4M1M.build.spiffs_start=0x300000 +wiolink.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +wiolink.menu.eesz.4M1M.build.spiffs_blocksize=8192 +wiolink.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +wiolink.menu.eesz.4M.build.flash_size=4M +wiolink.menu.eesz.4M.build.flash_size_bytes=0x400000 +wiolink.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +wiolink.menu.eesz.4M.build.spiffs_pagesize=256 +wiolink.menu.eesz.4M.upload.maximum_size=1044464 +wiolink.menu.eesz.4M.build.rfcal_addr=0x3FC000 +wiolink.menu.ip.lm2f=v2 Lower Memory +wiolink.menu.ip.lm2f.build.lwip_include=lwip2/include +wiolink.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +wiolink.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +wiolink.menu.ip.hb2f=v2 Higher Bandwidth +wiolink.menu.ip.hb2f.build.lwip_include=lwip2/include +wiolink.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +wiolink.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +wiolink.menu.ip.lm2n=v2 Lower Memory (no features) +wiolink.menu.ip.lm2n.build.lwip_include=lwip2/include +wiolink.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +wiolink.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +wiolink.menu.ip.hb2n=v2 Higher Bandwidth (no features) +wiolink.menu.ip.hb2n.build.lwip_include=lwip2/include +wiolink.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +wiolink.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +wiolink.menu.ip.lm6f=v2 IPv6 Lower Memory +wiolink.menu.ip.lm6f.build.lwip_include=lwip2/include +wiolink.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +wiolink.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +wiolink.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +wiolink.menu.ip.hb6f.build.lwip_include=lwip2/include +wiolink.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +wiolink.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +wiolink.menu.dbg.Disabled=Disabled +wiolink.menu.dbg.Disabled.build.debug_port= +wiolink.menu.dbg.Serial=Serial +wiolink.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +wiolink.menu.dbg.Serial1=Serial1 +wiolink.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +wiolink.menu.lvl.None____=None +wiolink.menu.lvl.None____.build.debug_level= +wiolink.menu.lvl.SSL=SSL +wiolink.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +wiolink.menu.lvl.TLS_MEM=TLS_MEM +wiolink.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +wiolink.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +wiolink.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +wiolink.menu.lvl.HTTP_SERVER=HTTP_SERVER +wiolink.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +wiolink.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +wiolink.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +wiolink.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +wiolink.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +wiolink.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +wiolink.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +wiolink.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +wiolink.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +wiolink.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +wiolink.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +wiolink.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +wiolink.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +wiolink.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wiolink.menu.lvl.CORE=CORE +wiolink.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +wiolink.menu.lvl.WIFI=WIFI +wiolink.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +wiolink.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +wiolink.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +wiolink.menu.lvl.UPDATER=UPDATER +wiolink.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +wiolink.menu.lvl.OTA=OTA +wiolink.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +wiolink.menu.lvl.OOM=OOM +wiolink.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +wiolink.menu.lvl.MDNS=MDNS +wiolink.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wiolink.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wiolink.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +wiolink.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +wiolink.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +wiolink.menu.wipe.none=Only Sketch +wiolink.menu.wipe.none.upload.erase_cmd= +wiolink.menu.wipe.sdk=Sketch + WiFi Settings +wiolink.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +wiolink.menu.wipe.all=All Flash Contents +wiolink.menu.wipe.all.upload.erase_cmd=erase_flash +wiolink.menu.baud.115200=115200 +wiolink.menu.baud.115200.upload.speed=115200 +wiolink.menu.baud.57600=57600 +wiolink.menu.baud.57600.upload.speed=57600 +wiolink.menu.baud.230400.linux=230400 +wiolink.menu.baud.230400.macosx=230400 +wiolink.menu.baud.230400.upload.speed=230400 +wiolink.menu.baud.256000.windows=256000 +wiolink.menu.baud.256000.upload.speed=256000 +wiolink.menu.baud.460800.linux=460800 +wiolink.menu.baud.460800.macosx=460800 +wiolink.menu.baud.460800.upload.speed=460800 +wiolink.menu.baud.512000.windows=512000 +wiolink.menu.baud.512000.upload.speed=512000 +wiolink.menu.baud.921600=921600 +wiolink.menu.baud.921600.upload.speed=921600 +wiolink.menu.baud.3000000=3000000 +wiolink.menu.baud.3000000.upload.speed=3000000 + +############################################################## +blynk.name=SparkFun Blynk Board +blynk.build.board=ESP8266_THING +blynk.build.variant=thing +blynk.upload.tool=esptool +blynk.upload.maximum_data_size=81920 +blynk.upload.wait_for_upload_port=true +blynk.upload.erase_cmd= +blynk.serial.disableDTR=true +blynk.serial.disableRTS=true +blynk.build.mcu=esp8266 +blynk.build.core=esp8266 +blynk.build.spiffs_pagesize=256 +blynk.build.debug_port= +blynk.build.debug_level= +blynk.menu.xtal.80=80 MHz +blynk.menu.xtal.80.build.f_cpu=80000000L +blynk.menu.xtal.160=160 MHz +blynk.menu.xtal.160.build.f_cpu=160000000L +blynk.menu.vt.flash=Flash +blynk.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +blynk.menu.vt.heap=Heap +blynk.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +blynk.menu.vt.iram=IRAM +blynk.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +blynk.menu.exception.disabled=Disabled (new aborts on oom) +blynk.menu.exception.disabled.build.exception_flags=-fno-exceptions +blynk.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +blynk.menu.exception.enabled=Enabled +blynk.menu.exception.enabled.build.exception_flags=-fexceptions +blynk.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +blynk.menu.stacksmash.disabled=Disabled +blynk.menu.stacksmash.disabled.build.stacksmash_flags= +blynk.menu.stacksmash.enabled=Enabled +blynk.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +blynk.menu.ssl.all=All SSL ciphers (most compatible) +blynk.menu.ssl.all.build.sslflags= +blynk.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +blynk.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +blynk.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +blynk.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +blynk.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +blynk.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +blynk.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +blynk.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +blynk.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +blynk.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +blynk.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +blynk.menu.non32xfer.fast.build.non32xferflags= +blynk.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +blynk.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +blynk.upload.resetmethod=--before default_reset --after hard_reset +blynk.build.flash_mode=qio +blynk.build.flash_flags=-DFLASHMODE_QIO +blynk.build.flash_freq=40 +blynk.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +blynk.menu.eesz.4M2M.build.flash_size=4M +blynk.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +blynk.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +blynk.menu.eesz.4M2M.build.spiffs_pagesize=256 +blynk.menu.eesz.4M2M.upload.maximum_size=1044464 +blynk.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +blynk.menu.eesz.4M2M.build.spiffs_start=0x200000 +blynk.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +blynk.menu.eesz.4M2M.build.spiffs_blocksize=8192 +blynk.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +blynk.menu.eesz.4M3M.build.flash_size=4M +blynk.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +blynk.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +blynk.menu.eesz.4M3M.build.spiffs_pagesize=256 +blynk.menu.eesz.4M3M.upload.maximum_size=1044464 +blynk.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +blynk.menu.eesz.4M3M.build.spiffs_start=0x100000 +blynk.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +blynk.menu.eesz.4M3M.build.spiffs_blocksize=8192 +blynk.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +blynk.menu.eesz.4M1M.build.flash_size=4M +blynk.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +blynk.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +blynk.menu.eesz.4M1M.build.spiffs_pagesize=256 +blynk.menu.eesz.4M1M.upload.maximum_size=1044464 +blynk.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +blynk.menu.eesz.4M1M.build.spiffs_start=0x300000 +blynk.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +blynk.menu.eesz.4M1M.build.spiffs_blocksize=8192 +blynk.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +blynk.menu.eesz.4M.build.flash_size=4M +blynk.menu.eesz.4M.build.flash_size_bytes=0x400000 +blynk.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +blynk.menu.eesz.4M.build.spiffs_pagesize=256 +blynk.menu.eesz.4M.upload.maximum_size=1044464 +blynk.menu.eesz.4M.build.rfcal_addr=0x3FC000 +blynk.menu.ip.lm2f=v2 Lower Memory +blynk.menu.ip.lm2f.build.lwip_include=lwip2/include +blynk.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +blynk.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +blynk.menu.ip.hb2f=v2 Higher Bandwidth +blynk.menu.ip.hb2f.build.lwip_include=lwip2/include +blynk.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +blynk.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +blynk.menu.ip.lm2n=v2 Lower Memory (no features) +blynk.menu.ip.lm2n.build.lwip_include=lwip2/include +blynk.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +blynk.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +blynk.menu.ip.hb2n=v2 Higher Bandwidth (no features) +blynk.menu.ip.hb2n.build.lwip_include=lwip2/include +blynk.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +blynk.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +blynk.menu.ip.lm6f=v2 IPv6 Lower Memory +blynk.menu.ip.lm6f.build.lwip_include=lwip2/include +blynk.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +blynk.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +blynk.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +blynk.menu.ip.hb6f.build.lwip_include=lwip2/include +blynk.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +blynk.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +blynk.menu.dbg.Disabled=Disabled +blynk.menu.dbg.Disabled.build.debug_port= +blynk.menu.dbg.Serial=Serial +blynk.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +blynk.menu.dbg.Serial1=Serial1 +blynk.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +blynk.menu.lvl.None____=None +blynk.menu.lvl.None____.build.debug_level= +blynk.menu.lvl.SSL=SSL +blynk.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +blynk.menu.lvl.TLS_MEM=TLS_MEM +blynk.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +blynk.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +blynk.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +blynk.menu.lvl.HTTP_SERVER=HTTP_SERVER +blynk.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +blynk.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +blynk.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +blynk.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +blynk.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +blynk.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +blynk.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +blynk.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +blynk.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +blynk.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +blynk.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +blynk.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +blynk.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +blynk.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +blynk.menu.lvl.CORE=CORE +blynk.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +blynk.menu.lvl.WIFI=WIFI +blynk.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +blynk.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +blynk.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +blynk.menu.lvl.UPDATER=UPDATER +blynk.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +blynk.menu.lvl.OTA=OTA +blynk.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +blynk.menu.lvl.OOM=OOM +blynk.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +blynk.menu.lvl.MDNS=MDNS +blynk.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +blynk.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +blynk.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +blynk.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +blynk.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +blynk.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +blynk.menu.wipe.none=Only Sketch +blynk.menu.wipe.none.upload.erase_cmd= +blynk.menu.wipe.sdk=Sketch + WiFi Settings +blynk.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +blynk.menu.wipe.all=All Flash Contents +blynk.menu.wipe.all.upload.erase_cmd=erase_flash +blynk.menu.baud.115200=115200 +blynk.menu.baud.115200.upload.speed=115200 +blynk.menu.baud.57600=57600 +blynk.menu.baud.57600.upload.speed=57600 +blynk.menu.baud.230400.linux=230400 +blynk.menu.baud.230400.macosx=230400 +blynk.menu.baud.230400.upload.speed=230400 +blynk.menu.baud.256000.windows=256000 +blynk.menu.baud.256000.upload.speed=256000 +blynk.menu.baud.460800.linux=460800 +blynk.menu.baud.460800.macosx=460800 +blynk.menu.baud.460800.upload.speed=460800 +blynk.menu.baud.512000.windows=512000 +blynk.menu.baud.512000.upload.speed=512000 +blynk.menu.baud.921600=921600 +blynk.menu.baud.921600.upload.speed=921600 +blynk.menu.baud.3000000=3000000 +blynk.menu.baud.3000000.upload.speed=3000000 + +############################################################## +thing.name=SparkFun ESP8266 Thing +thing.build.board=ESP8266_THING +thing.build.variant=thing +thing.upload.tool=esptool +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.core=esp8266 +thing.build.spiffs_pagesize=256 +thing.build.debug_port= +thing.build.debug_level= +thing.menu.xtal.80=80 MHz +thing.menu.xtal.80.build.f_cpu=80000000L +thing.menu.xtal.160=160 MHz +thing.menu.xtal.160.build.f_cpu=160000000L +thing.menu.vt.flash=Flash +thing.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +thing.menu.vt.heap=Heap +thing.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +thing.menu.vt.iram=IRAM +thing.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +thing.menu.exception.disabled=Disabled (new aborts on oom) +thing.menu.exception.disabled.build.exception_flags=-fno-exceptions +thing.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +thing.menu.exception.enabled=Enabled +thing.menu.exception.enabled.build.exception_flags=-fexceptions +thing.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +thing.menu.stacksmash.disabled=Disabled +thing.menu.stacksmash.disabled.build.stacksmash_flags= +thing.menu.stacksmash.enabled=Enabled +thing.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +thing.menu.ssl.all=All SSL ciphers (most compatible) +thing.menu.ssl.all.build.sslflags= +thing.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +thing.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +thing.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +thing.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +thing.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +thing.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +thing.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +thing.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +thing.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +thing.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +thing.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +thing.menu.non32xfer.fast.build.non32xferflags= +thing.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +thing.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +thing.upload.resetmethod=--before no_reset --after soft_reset +thing.build.flash_mode=qio +thing.build.flash_flags=-DFLASHMODE_QIO +thing.build.flash_freq=40 +thing.menu.eesz.512K32=512KB (FS:32KB OTA:~230KB) +thing.menu.eesz.512K32.build.flash_size=512K +thing.menu.eesz.512K32.build.flash_size_bytes=0x80000 +thing.menu.eesz.512K32.build.flash_ld=eagle.flash.512k32.ld +thing.menu.eesz.512K32.build.spiffs_pagesize=256 +thing.menu.eesz.512K32.upload.maximum_size=466928 +thing.menu.eesz.512K32.build.rfcal_addr=0x7C000 +thing.menu.eesz.512K32.build.spiffs_start=0x73000 +thing.menu.eesz.512K32.build.spiffs_end=0x7B000 +thing.menu.eesz.512K32.build.spiffs_blocksize=4096 +thing.menu.eesz.512K64=512KB (FS:64KB OTA:~214KB) +thing.menu.eesz.512K64.build.flash_size=512K +thing.menu.eesz.512K64.build.flash_size_bytes=0x80000 +thing.menu.eesz.512K64.build.flash_ld=eagle.flash.512k64.ld +thing.menu.eesz.512K64.build.spiffs_pagesize=256 +thing.menu.eesz.512K64.upload.maximum_size=434160 +thing.menu.eesz.512K64.build.rfcal_addr=0x7C000 +thing.menu.eesz.512K64.build.spiffs_start=0x6B000 +thing.menu.eesz.512K64.build.spiffs_end=0x7B000 +thing.menu.eesz.512K64.build.spiffs_blocksize=4096 +thing.menu.eesz.512K128=512KB (FS:128KB OTA:~182KB) +thing.menu.eesz.512K128.build.flash_size=512K +thing.menu.eesz.512K128.build.flash_size_bytes=0x80000 +thing.menu.eesz.512K128.build.flash_ld=eagle.flash.512k128.ld +thing.menu.eesz.512K128.build.spiffs_pagesize=256 +thing.menu.eesz.512K128.upload.maximum_size=368624 +thing.menu.eesz.512K128.build.rfcal_addr=0x7C000 +thing.menu.eesz.512K128.build.spiffs_start=0x5B000 +thing.menu.eesz.512K128.build.spiffs_end=0x7B000 +thing.menu.eesz.512K128.build.spiffs_blocksize=4096 +thing.menu.eesz.512K=512KB (FS:none OTA:~246KB) +thing.menu.eesz.512K.build.flash_size=512K +thing.menu.eesz.512K.build.flash_size_bytes=0x80000 +thing.menu.eesz.512K.build.flash_ld=eagle.flash.512k.ld +thing.menu.eesz.512K.build.spiffs_pagesize=256 +thing.menu.eesz.512K.upload.maximum_size=499696 +thing.menu.eesz.512K.build.rfcal_addr=0x7C000 +thing.menu.ip.lm2f=v2 Lower Memory +thing.menu.ip.lm2f.build.lwip_include=lwip2/include +thing.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +thing.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +thing.menu.ip.hb2f=v2 Higher Bandwidth +thing.menu.ip.hb2f.build.lwip_include=lwip2/include +thing.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +thing.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +thing.menu.ip.lm2n=v2 Lower Memory (no features) +thing.menu.ip.lm2n.build.lwip_include=lwip2/include +thing.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +thing.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +thing.menu.ip.hb2n=v2 Higher Bandwidth (no features) +thing.menu.ip.hb2n.build.lwip_include=lwip2/include +thing.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +thing.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +thing.menu.ip.lm6f=v2 IPv6 Lower Memory +thing.menu.ip.lm6f.build.lwip_include=lwip2/include +thing.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +thing.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +thing.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +thing.menu.ip.hb6f.build.lwip_include=lwip2/include +thing.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +thing.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +thing.menu.dbg.Disabled=Disabled +thing.menu.dbg.Disabled.build.debug_port= +thing.menu.dbg.Serial=Serial +thing.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +thing.menu.dbg.Serial1=Serial1 +thing.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +thing.menu.lvl.None____=None +thing.menu.lvl.None____.build.debug_level= +thing.menu.lvl.SSL=SSL +thing.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +thing.menu.lvl.TLS_MEM=TLS_MEM +thing.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +thing.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +thing.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +thing.menu.lvl.HTTP_SERVER=HTTP_SERVER +thing.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +thing.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +thing.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +thing.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +thing.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +thing.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +thing.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +thing.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +thing.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +thing.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +thing.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +thing.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +thing.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +thing.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thing.menu.lvl.CORE=CORE +thing.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +thing.menu.lvl.WIFI=WIFI +thing.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +thing.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +thing.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +thing.menu.lvl.UPDATER=UPDATER +thing.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +thing.menu.lvl.OTA=OTA +thing.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +thing.menu.lvl.OOM=OOM +thing.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +thing.menu.lvl.MDNS=MDNS +thing.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thing.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thing.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +thing.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +thing.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +thing.menu.wipe.none=Only Sketch +thing.menu.wipe.none.upload.erase_cmd= +thing.menu.wipe.sdk=Sketch + WiFi Settings +thing.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +thing.menu.wipe.all=All Flash Contents +thing.menu.wipe.all.upload.erase_cmd=erase_flash +thing.menu.baud.115200=115200 +thing.menu.baud.115200.upload.speed=115200 +thing.menu.baud.57600=57600 +thing.menu.baud.57600.upload.speed=57600 +thing.menu.baud.230400.linux=230400 +thing.menu.baud.230400.macosx=230400 +thing.menu.baud.230400.upload.speed=230400 +thing.menu.baud.256000.windows=256000 +thing.menu.baud.256000.upload.speed=256000 +thing.menu.baud.460800.linux=460800 +thing.menu.baud.460800.macosx=460800 +thing.menu.baud.460800.upload.speed=460800 +thing.menu.baud.512000.windows=512000 +thing.menu.baud.512000.upload.speed=512000 +thing.menu.baud.921600=921600 +thing.menu.baud.921600.upload.speed=921600 +thing.menu.baud.3000000=3000000 +thing.menu.baud.3000000.upload.speed=3000000 + +############################################################## +thingdev.name=SparkFun ESP8266 Thing Dev +thingdev.build.board=ESP8266_THING_DEV +thingdev.build.variant=thing +thingdev.upload.tool=esptool +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.core=esp8266 +thingdev.build.spiffs_pagesize=256 +thingdev.build.debug_port= +thingdev.build.debug_level= +thingdev.menu.xtal.80=80 MHz +thingdev.menu.xtal.80.build.f_cpu=80000000L +thingdev.menu.xtal.160=160 MHz +thingdev.menu.xtal.160.build.f_cpu=160000000L +thingdev.menu.vt.flash=Flash +thingdev.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +thingdev.menu.vt.heap=Heap +thingdev.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +thingdev.menu.vt.iram=IRAM +thingdev.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +thingdev.menu.exception.disabled=Disabled (new aborts on oom) +thingdev.menu.exception.disabled.build.exception_flags=-fno-exceptions +thingdev.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +thingdev.menu.exception.enabled=Enabled +thingdev.menu.exception.enabled.build.exception_flags=-fexceptions +thingdev.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +thingdev.menu.stacksmash.disabled=Disabled +thingdev.menu.stacksmash.disabled.build.stacksmash_flags= +thingdev.menu.stacksmash.enabled=Enabled +thingdev.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +thingdev.menu.ssl.all=All SSL ciphers (most compatible) +thingdev.menu.ssl.all.build.sslflags= +thingdev.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +thingdev.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +thingdev.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +thingdev.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +thingdev.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +thingdev.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +thingdev.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +thingdev.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +thingdev.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +thingdev.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +thingdev.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +thingdev.menu.non32xfer.fast.build.non32xferflags= +thingdev.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +thingdev.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +thingdev.upload.resetmethod=--before default_reset --after hard_reset +thingdev.build.flash_mode=dio +thingdev.build.flash_flags=-DFLASHMODE_DIO +thingdev.build.flash_freq=40 +thingdev.menu.eesz.512K32=512KB (FS:32KB OTA:~230KB) +thingdev.menu.eesz.512K32.build.flash_size=512K +thingdev.menu.eesz.512K32.build.flash_size_bytes=0x80000 +thingdev.menu.eesz.512K32.build.flash_ld=eagle.flash.512k32.ld +thingdev.menu.eesz.512K32.build.spiffs_pagesize=256 +thingdev.menu.eesz.512K32.upload.maximum_size=466928 +thingdev.menu.eesz.512K32.build.rfcal_addr=0x7C000 +thingdev.menu.eesz.512K32.build.spiffs_start=0x73000 +thingdev.menu.eesz.512K32.build.spiffs_end=0x7B000 +thingdev.menu.eesz.512K32.build.spiffs_blocksize=4096 +thingdev.menu.eesz.512K64=512KB (FS:64KB OTA:~214KB) +thingdev.menu.eesz.512K64.build.flash_size=512K +thingdev.menu.eesz.512K64.build.flash_size_bytes=0x80000 +thingdev.menu.eesz.512K64.build.flash_ld=eagle.flash.512k64.ld +thingdev.menu.eesz.512K64.build.spiffs_pagesize=256 +thingdev.menu.eesz.512K64.upload.maximum_size=434160 +thingdev.menu.eesz.512K64.build.rfcal_addr=0x7C000 +thingdev.menu.eesz.512K64.build.spiffs_start=0x6B000 +thingdev.menu.eesz.512K64.build.spiffs_end=0x7B000 +thingdev.menu.eesz.512K64.build.spiffs_blocksize=4096 +thingdev.menu.eesz.512K128=512KB (FS:128KB OTA:~182KB) +thingdev.menu.eesz.512K128.build.flash_size=512K +thingdev.menu.eesz.512K128.build.flash_size_bytes=0x80000 +thingdev.menu.eesz.512K128.build.flash_ld=eagle.flash.512k128.ld +thingdev.menu.eesz.512K128.build.spiffs_pagesize=256 +thingdev.menu.eesz.512K128.upload.maximum_size=368624 +thingdev.menu.eesz.512K128.build.rfcal_addr=0x7C000 +thingdev.menu.eesz.512K128.build.spiffs_start=0x5B000 +thingdev.menu.eesz.512K128.build.spiffs_end=0x7B000 +thingdev.menu.eesz.512K128.build.spiffs_blocksize=4096 +thingdev.menu.eesz.512K=512KB (FS:none OTA:~246KB) +thingdev.menu.eesz.512K.build.flash_size=512K +thingdev.menu.eesz.512K.build.flash_size_bytes=0x80000 +thingdev.menu.eesz.512K.build.flash_ld=eagle.flash.512k.ld +thingdev.menu.eesz.512K.build.spiffs_pagesize=256 +thingdev.menu.eesz.512K.upload.maximum_size=499696 +thingdev.menu.eesz.512K.build.rfcal_addr=0x7C000 +thingdev.menu.ip.lm2f=v2 Lower Memory +thingdev.menu.ip.lm2f.build.lwip_include=lwip2/include +thingdev.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +thingdev.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +thingdev.menu.ip.hb2f=v2 Higher Bandwidth +thingdev.menu.ip.hb2f.build.lwip_include=lwip2/include +thingdev.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +thingdev.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +thingdev.menu.ip.lm2n=v2 Lower Memory (no features) +thingdev.menu.ip.lm2n.build.lwip_include=lwip2/include +thingdev.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +thingdev.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +thingdev.menu.ip.hb2n=v2 Higher Bandwidth (no features) +thingdev.menu.ip.hb2n.build.lwip_include=lwip2/include +thingdev.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +thingdev.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +thingdev.menu.ip.lm6f=v2 IPv6 Lower Memory +thingdev.menu.ip.lm6f.build.lwip_include=lwip2/include +thingdev.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +thingdev.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +thingdev.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +thingdev.menu.ip.hb6f.build.lwip_include=lwip2/include +thingdev.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +thingdev.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +thingdev.menu.dbg.Disabled=Disabled +thingdev.menu.dbg.Disabled.build.debug_port= +thingdev.menu.dbg.Serial=Serial +thingdev.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +thingdev.menu.dbg.Serial1=Serial1 +thingdev.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +thingdev.menu.lvl.None____=None +thingdev.menu.lvl.None____.build.debug_level= +thingdev.menu.lvl.SSL=SSL +thingdev.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +thingdev.menu.lvl.TLS_MEM=TLS_MEM +thingdev.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +thingdev.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +thingdev.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +thingdev.menu.lvl.HTTP_SERVER=HTTP_SERVER +thingdev.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +thingdev.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +thingdev.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +thingdev.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +thingdev.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +thingdev.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +thingdev.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +thingdev.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +thingdev.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +thingdev.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +thingdev.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +thingdev.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +thingdev.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +thingdev.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +thingdev.menu.lvl.CORE=CORE +thingdev.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +thingdev.menu.lvl.WIFI=WIFI +thingdev.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +thingdev.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +thingdev.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +thingdev.menu.lvl.UPDATER=UPDATER +thingdev.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +thingdev.menu.lvl.OTA=OTA +thingdev.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +thingdev.menu.lvl.OOM=OOM +thingdev.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +thingdev.menu.lvl.MDNS=MDNS +thingdev.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thingdev.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +thingdev.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +thingdev.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +thingdev.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +thingdev.menu.wipe.none=Only Sketch +thingdev.menu.wipe.none.upload.erase_cmd= +thingdev.menu.wipe.sdk=Sketch + WiFi Settings +thingdev.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +thingdev.menu.wipe.all=All Flash Contents +thingdev.menu.wipe.all.upload.erase_cmd=erase_flash +thingdev.menu.baud.115200=115200 +thingdev.menu.baud.115200.upload.speed=115200 +thingdev.menu.baud.57600=57600 +thingdev.menu.baud.57600.upload.speed=57600 +thingdev.menu.baud.230400.linux=230400 +thingdev.menu.baud.230400.macosx=230400 +thingdev.menu.baud.230400.upload.speed=230400 +thingdev.menu.baud.256000.windows=256000 +thingdev.menu.baud.256000.upload.speed=256000 +thingdev.menu.baud.460800.linux=460800 +thingdev.menu.baud.460800.macosx=460800 +thingdev.menu.baud.460800.upload.speed=460800 +thingdev.menu.baud.512000.windows=512000 +thingdev.menu.baud.512000.upload.speed=512000 +thingdev.menu.baud.921600=921600 +thingdev.menu.baud.921600.upload.speed=921600 +thingdev.menu.baud.3000000=3000000 +thingdev.menu.baud.3000000.upload.speed=3000000 + +############################################################## +esp210.name=SweetPea ESP-210 +esp210.build.board=ESP8266_ESP210 +esp210.upload.tool=esptool +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.core=esp8266 +esp210.build.variant=generic +esp210.build.spiffs_pagesize=256 +esp210.build.debug_port= +esp210.build.debug_level= +esp210.menu.xtal.80=80 MHz +esp210.menu.xtal.80.build.f_cpu=80000000L +esp210.menu.xtal.160=160 MHz +esp210.menu.xtal.160.build.f_cpu=160000000L +esp210.menu.vt.flash=Flash +esp210.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +esp210.menu.vt.heap=Heap +esp210.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +esp210.menu.vt.iram=IRAM +esp210.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +esp210.menu.exception.disabled=Disabled (new aborts on oom) +esp210.menu.exception.disabled.build.exception_flags=-fno-exceptions +esp210.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +esp210.menu.exception.enabled=Enabled +esp210.menu.exception.enabled.build.exception_flags=-fexceptions +esp210.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +esp210.menu.stacksmash.disabled=Disabled +esp210.menu.stacksmash.disabled.build.stacksmash_flags= +esp210.menu.stacksmash.enabled=Enabled +esp210.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +esp210.menu.ssl.all=All SSL ciphers (most compatible) +esp210.menu.ssl.all.build.sslflags= +esp210.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +esp210.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +esp210.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +esp210.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +esp210.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +esp210.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +esp210.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +esp210.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +esp210.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +esp210.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +esp210.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +esp210.menu.non32xfer.fast.build.non32xferflags= +esp210.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +esp210.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +esp210.upload.resetmethod=--before no_reset --after soft_reset +esp210.build.flash_mode=qio +esp210.build.flash_flags=-DFLASHMODE_QIO +esp210.build.flash_freq=40 +esp210.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +esp210.menu.eesz.4M2M.build.flash_size=4M +esp210.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +esp210.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +esp210.menu.eesz.4M2M.build.spiffs_pagesize=256 +esp210.menu.eesz.4M2M.upload.maximum_size=1044464 +esp210.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +esp210.menu.eesz.4M2M.build.spiffs_start=0x200000 +esp210.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +esp210.menu.eesz.4M2M.build.spiffs_blocksize=8192 +esp210.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +esp210.menu.eesz.4M3M.build.flash_size=4M +esp210.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +esp210.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +esp210.menu.eesz.4M3M.build.spiffs_pagesize=256 +esp210.menu.eesz.4M3M.upload.maximum_size=1044464 +esp210.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +esp210.menu.eesz.4M3M.build.spiffs_start=0x100000 +esp210.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +esp210.menu.eesz.4M3M.build.spiffs_blocksize=8192 +esp210.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +esp210.menu.eesz.4M1M.build.flash_size=4M +esp210.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +esp210.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +esp210.menu.eesz.4M1M.build.spiffs_pagesize=256 +esp210.menu.eesz.4M1M.upload.maximum_size=1044464 +esp210.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +esp210.menu.eesz.4M1M.build.spiffs_start=0x300000 +esp210.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +esp210.menu.eesz.4M1M.build.spiffs_blocksize=8192 +esp210.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +esp210.menu.eesz.4M.build.flash_size=4M +esp210.menu.eesz.4M.build.flash_size_bytes=0x400000 +esp210.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +esp210.menu.eesz.4M.build.spiffs_pagesize=256 +esp210.menu.eesz.4M.upload.maximum_size=1044464 +esp210.menu.eesz.4M.build.rfcal_addr=0x3FC000 +esp210.menu.ip.lm2f=v2 Lower Memory +esp210.menu.ip.lm2f.build.lwip_include=lwip2/include +esp210.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +esp210.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +esp210.menu.ip.hb2f=v2 Higher Bandwidth +esp210.menu.ip.hb2f.build.lwip_include=lwip2/include +esp210.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +esp210.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +esp210.menu.ip.lm2n=v2 Lower Memory (no features) +esp210.menu.ip.lm2n.build.lwip_include=lwip2/include +esp210.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +esp210.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +esp210.menu.ip.hb2n=v2 Higher Bandwidth (no features) +esp210.menu.ip.hb2n.build.lwip_include=lwip2/include +esp210.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +esp210.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +esp210.menu.ip.lm6f=v2 IPv6 Lower Memory +esp210.menu.ip.lm6f.build.lwip_include=lwip2/include +esp210.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +esp210.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +esp210.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +esp210.menu.ip.hb6f.build.lwip_include=lwip2/include +esp210.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +esp210.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +esp210.menu.dbg.Disabled=Disabled +esp210.menu.dbg.Disabled.build.debug_port= +esp210.menu.dbg.Serial=Serial +esp210.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +esp210.menu.dbg.Serial1=Serial1 +esp210.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +esp210.menu.lvl.None____=None +esp210.menu.lvl.None____.build.debug_level= +esp210.menu.lvl.SSL=SSL +esp210.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +esp210.menu.lvl.TLS_MEM=TLS_MEM +esp210.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +esp210.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +esp210.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +esp210.menu.lvl.HTTP_SERVER=HTTP_SERVER +esp210.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +esp210.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +esp210.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +esp210.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +esp210.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +esp210.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +esp210.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +esp210.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +esp210.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +esp210.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +esp210.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +esp210.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +esp210.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +esp210.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +esp210.menu.lvl.CORE=CORE +esp210.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +esp210.menu.lvl.WIFI=WIFI +esp210.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +esp210.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +esp210.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +esp210.menu.lvl.UPDATER=UPDATER +esp210.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +esp210.menu.lvl.OTA=OTA +esp210.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +esp210.menu.lvl.OOM=OOM +esp210.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +esp210.menu.lvl.MDNS=MDNS +esp210.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +esp210.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +esp210.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +esp210.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +esp210.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +esp210.menu.wipe.none=Only Sketch +esp210.menu.wipe.none.upload.erase_cmd= +esp210.menu.wipe.sdk=Sketch + WiFi Settings +esp210.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +esp210.menu.wipe.all=All Flash Contents +esp210.menu.wipe.all.upload.erase_cmd=erase_flash +esp210.menu.baud.57600=57600 +esp210.menu.baud.57600.upload.speed=57600 +esp210.menu.baud.115200=115200 +esp210.menu.baud.115200.upload.speed=115200 +esp210.menu.baud.230400.linux=230400 +esp210.menu.baud.230400.macosx=230400 +esp210.menu.baud.230400.upload.speed=230400 +esp210.menu.baud.256000.windows=256000 +esp210.menu.baud.256000.upload.speed=256000 +esp210.menu.baud.460800.linux=460800 +esp210.menu.baud.460800.macosx=460800 +esp210.menu.baud.460800.upload.speed=460800 +esp210.menu.baud.512000.windows=512000 +esp210.menu.baud.512000.upload.speed=512000 +esp210.menu.baud.921600=921600 +esp210.menu.baud.921600.upload.speed=921600 +esp210.menu.baud.3000000=3000000 +esp210.menu.baud.3000000.upload.speed=3000000 + +############################################################## +espinotee.name=ThaiEasyElec's ESPino +espinotee.build.board=ESP8266_ESP13 +espinotee.build.variant=espinotee +espinotee.upload.tool=esptool +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.core=esp8266 +espinotee.build.spiffs_pagesize=256 +espinotee.build.debug_port= +espinotee.build.debug_level= +espinotee.menu.xtal.80=80 MHz +espinotee.menu.xtal.80.build.f_cpu=80000000L +espinotee.menu.xtal.160=160 MHz +espinotee.menu.xtal.160.build.f_cpu=160000000L +espinotee.menu.vt.flash=Flash +espinotee.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +espinotee.menu.vt.heap=Heap +espinotee.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +espinotee.menu.vt.iram=IRAM +espinotee.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +espinotee.menu.exception.disabled=Disabled (new aborts on oom) +espinotee.menu.exception.disabled.build.exception_flags=-fno-exceptions +espinotee.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +espinotee.menu.exception.enabled=Enabled +espinotee.menu.exception.enabled.build.exception_flags=-fexceptions +espinotee.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +espinotee.menu.stacksmash.disabled=Disabled +espinotee.menu.stacksmash.disabled.build.stacksmash_flags= +espinotee.menu.stacksmash.enabled=Enabled +espinotee.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +espinotee.menu.ssl.all=All SSL ciphers (most compatible) +espinotee.menu.ssl.all.build.sslflags= +espinotee.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +espinotee.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +espinotee.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +espinotee.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +espinotee.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +espinotee.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +espinotee.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +espinotee.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +espinotee.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +espinotee.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +espinotee.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +espinotee.menu.non32xfer.fast.build.non32xferflags= +espinotee.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +espinotee.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +espinotee.upload.resetmethod=--before default_reset --after hard_reset +espinotee.build.flash_mode=qio +espinotee.build.flash_flags=-DFLASHMODE_QIO +espinotee.build.flash_freq=40 +espinotee.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +espinotee.menu.eesz.4M2M.build.flash_size=4M +espinotee.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +espinotee.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +espinotee.menu.eesz.4M2M.build.spiffs_pagesize=256 +espinotee.menu.eesz.4M2M.upload.maximum_size=1044464 +espinotee.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +espinotee.menu.eesz.4M2M.build.spiffs_start=0x200000 +espinotee.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +espinotee.menu.eesz.4M2M.build.spiffs_blocksize=8192 +espinotee.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +espinotee.menu.eesz.4M3M.build.flash_size=4M +espinotee.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +espinotee.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +espinotee.menu.eesz.4M3M.build.spiffs_pagesize=256 +espinotee.menu.eesz.4M3M.upload.maximum_size=1044464 +espinotee.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +espinotee.menu.eesz.4M3M.build.spiffs_start=0x100000 +espinotee.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +espinotee.menu.eesz.4M3M.build.spiffs_blocksize=8192 +espinotee.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +espinotee.menu.eesz.4M1M.build.flash_size=4M +espinotee.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +espinotee.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +espinotee.menu.eesz.4M1M.build.spiffs_pagesize=256 +espinotee.menu.eesz.4M1M.upload.maximum_size=1044464 +espinotee.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +espinotee.menu.eesz.4M1M.build.spiffs_start=0x300000 +espinotee.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +espinotee.menu.eesz.4M1M.build.spiffs_blocksize=8192 +espinotee.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +espinotee.menu.eesz.4M.build.flash_size=4M +espinotee.menu.eesz.4M.build.flash_size_bytes=0x400000 +espinotee.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +espinotee.menu.eesz.4M.build.spiffs_pagesize=256 +espinotee.menu.eesz.4M.upload.maximum_size=1044464 +espinotee.menu.eesz.4M.build.rfcal_addr=0x3FC000 +espinotee.menu.ip.lm2f=v2 Lower Memory +espinotee.menu.ip.lm2f.build.lwip_include=lwip2/include +espinotee.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +espinotee.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espinotee.menu.ip.hb2f=v2 Higher Bandwidth +espinotee.menu.ip.hb2f.build.lwip_include=lwip2/include +espinotee.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +espinotee.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +espinotee.menu.ip.lm2n=v2 Lower Memory (no features) +espinotee.menu.ip.lm2n.build.lwip_include=lwip2/include +espinotee.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +espinotee.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espinotee.menu.ip.hb2n=v2 Higher Bandwidth (no features) +espinotee.menu.ip.hb2n.build.lwip_include=lwip2/include +espinotee.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +espinotee.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +espinotee.menu.ip.lm6f=v2 IPv6 Lower Memory +espinotee.menu.ip.lm6f.build.lwip_include=lwip2/include +espinotee.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +espinotee.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espinotee.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +espinotee.menu.ip.hb6f.build.lwip_include=lwip2/include +espinotee.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +espinotee.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +espinotee.menu.dbg.Disabled=Disabled +espinotee.menu.dbg.Disabled.build.debug_port= +espinotee.menu.dbg.Serial=Serial +espinotee.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +espinotee.menu.dbg.Serial1=Serial1 +espinotee.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +espinotee.menu.lvl.None____=None +espinotee.menu.lvl.None____.build.debug_level= +espinotee.menu.lvl.SSL=SSL +espinotee.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +espinotee.menu.lvl.TLS_MEM=TLS_MEM +espinotee.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +espinotee.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +espinotee.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +espinotee.menu.lvl.HTTP_SERVER=HTTP_SERVER +espinotee.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +espinotee.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +espinotee.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +espinotee.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +espinotee.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +espinotee.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +espinotee.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espinotee.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +espinotee.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +espinotee.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +espinotee.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +espinotee.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +espinotee.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espinotee.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +espinotee.menu.lvl.CORE=CORE +espinotee.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +espinotee.menu.lvl.WIFI=WIFI +espinotee.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +espinotee.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +espinotee.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +espinotee.menu.lvl.UPDATER=UPDATER +espinotee.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +espinotee.menu.lvl.OTA=OTA +espinotee.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +espinotee.menu.lvl.OOM=OOM +espinotee.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +espinotee.menu.lvl.MDNS=MDNS +espinotee.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espinotee.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +espinotee.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +espinotee.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +espinotee.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +espinotee.menu.wipe.none=Only Sketch +espinotee.menu.wipe.none.upload.erase_cmd= +espinotee.menu.wipe.sdk=Sketch + WiFi Settings +espinotee.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +espinotee.menu.wipe.all=All Flash Contents +espinotee.menu.wipe.all.upload.erase_cmd=erase_flash +espinotee.menu.baud.115200=115200 +espinotee.menu.baud.115200.upload.speed=115200 +espinotee.menu.baud.57600=57600 +espinotee.menu.baud.57600.upload.speed=57600 +espinotee.menu.baud.230400.linux=230400 +espinotee.menu.baud.230400.macosx=230400 +espinotee.menu.baud.230400.upload.speed=230400 +espinotee.menu.baud.256000.windows=256000 +espinotee.menu.baud.256000.upload.speed=256000 +espinotee.menu.baud.460800.linux=460800 +espinotee.menu.baud.460800.macosx=460800 +espinotee.menu.baud.460800.upload.speed=460800 +espinotee.menu.baud.512000.windows=512000 +espinotee.menu.baud.512000.upload.speed=512000 +espinotee.menu.baud.921600=921600 +espinotee.menu.baud.921600.upload.speed=921600 +espinotee.menu.baud.3000000=3000000 +espinotee.menu.baud.3000000.upload.speed=3000000 + +############################################################## +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.xtal.80=80 MHz +wifiduino.menu.xtal.80.build.f_cpu=80000000L +wifiduino.menu.xtal.160=160 MHz +wifiduino.menu.xtal.160.build.f_cpu=160000000L +wifiduino.menu.vt.flash=Flash +wifiduino.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +wifiduino.menu.vt.heap=Heap +wifiduino.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +wifiduino.menu.vt.iram=IRAM +wifiduino.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +wifiduino.menu.exception.disabled=Disabled (new aborts on oom) +wifiduino.menu.exception.disabled.build.exception_flags=-fno-exceptions +wifiduino.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +wifiduino.menu.exception.enabled=Enabled +wifiduino.menu.exception.enabled.build.exception_flags=-fexceptions +wifiduino.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +wifiduino.menu.stacksmash.disabled=Disabled +wifiduino.menu.stacksmash.disabled.build.stacksmash_flags= +wifiduino.menu.stacksmash.enabled=Enabled +wifiduino.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +wifiduino.menu.ssl.all=All SSL ciphers (most compatible) +wifiduino.menu.ssl.all.build.sslflags= +wifiduino.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +wifiduino.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +wifiduino.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +wifiduino.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +wifiduino.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +wifiduino.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +wifiduino.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +wifiduino.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +wifiduino.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +wifiduino.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +wifiduino.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +wifiduino.menu.non32xfer.fast.build.non32xferflags= +wifiduino.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +wifiduino.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +wifiduino.upload.resetmethod=--before default_reset --after hard_reset +wifiduino.build.flash_mode=dio +wifiduino.build.flash_flags=-DFLASHMODE_DIO +wifiduino.build.flash_freq=40 +wifiduino.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +wifiduino.menu.eesz.4M2M.build.flash_size=4M +wifiduino.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +wifiduino.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +wifiduino.menu.eesz.4M2M.build.spiffs_pagesize=256 +wifiduino.menu.eesz.4M2M.upload.maximum_size=1044464 +wifiduino.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +wifiduino.menu.eesz.4M2M.build.spiffs_start=0x200000 +wifiduino.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +wifiduino.menu.eesz.4M2M.build.spiffs_blocksize=8192 +wifiduino.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +wifiduino.menu.eesz.4M3M.build.flash_size=4M +wifiduino.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +wifiduino.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +wifiduino.menu.eesz.4M3M.build.spiffs_pagesize=256 +wifiduino.menu.eesz.4M3M.upload.maximum_size=1044464 +wifiduino.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +wifiduino.menu.eesz.4M3M.build.spiffs_start=0x100000 +wifiduino.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +wifiduino.menu.eesz.4M3M.build.spiffs_blocksize=8192 +wifiduino.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +wifiduino.menu.eesz.4M1M.build.flash_size=4M +wifiduino.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +wifiduino.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +wifiduino.menu.eesz.4M1M.build.spiffs_pagesize=256 +wifiduino.menu.eesz.4M1M.upload.maximum_size=1044464 +wifiduino.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +wifiduino.menu.eesz.4M1M.build.spiffs_start=0x300000 +wifiduino.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +wifiduino.menu.eesz.4M1M.build.spiffs_blocksize=8192 +wifiduino.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +wifiduino.menu.eesz.4M.build.flash_size=4M +wifiduino.menu.eesz.4M.build.flash_size_bytes=0x400000 +wifiduino.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +wifiduino.menu.eesz.4M.build.spiffs_pagesize=256 +wifiduino.menu.eesz.4M.upload.maximum_size=1044464 +wifiduino.menu.eesz.4M.build.rfcal_addr=0x3FC000 +wifiduino.menu.ip.lm2f=v2 Lower Memory +wifiduino.menu.ip.lm2f.build.lwip_include=lwip2/include +wifiduino.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +wifiduino.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +wifiduino.menu.ip.hb2f=v2 Higher Bandwidth +wifiduino.menu.ip.hb2f.build.lwip_include=lwip2/include +wifiduino.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +wifiduino.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +wifiduino.menu.ip.lm2n=v2 Lower Memory (no features) +wifiduino.menu.ip.lm2n.build.lwip_include=lwip2/include +wifiduino.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +wifiduino.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +wifiduino.menu.ip.hb2n=v2 Higher Bandwidth (no features) +wifiduino.menu.ip.hb2n.build.lwip_include=lwip2/include +wifiduino.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +wifiduino.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +wifiduino.menu.ip.lm6f=v2 IPv6 Lower Memory +wifiduino.menu.ip.lm6f.build.lwip_include=lwip2/include +wifiduino.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +wifiduino.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +wifiduino.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +wifiduino.menu.ip.hb6f.build.lwip_include=lwip2/include +wifiduino.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +wifiduino.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +wifiduino.menu.dbg.Disabled=Disabled +wifiduino.menu.dbg.Disabled.build.debug_port= +wifiduino.menu.dbg.Serial=Serial +wifiduino.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +wifiduino.menu.dbg.Serial1=Serial1 +wifiduino.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +wifiduino.menu.lvl.None____=None +wifiduino.menu.lvl.None____.build.debug_level= +wifiduino.menu.lvl.SSL=SSL +wifiduino.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +wifiduino.menu.lvl.TLS_MEM=TLS_MEM +wifiduino.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +wifiduino.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +wifiduino.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +wifiduino.menu.lvl.HTTP_SERVER=HTTP_SERVER +wifiduino.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +wifiduino.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +wifiduino.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +wifiduino.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +wifiduino.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +wifiduino.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +wifiduino.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +wifiduino.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +wifiduino.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +wifiduino.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +wifiduino.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +wifiduino.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +wifiduino.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +wifiduino.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifiduino.menu.lvl.CORE=CORE +wifiduino.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +wifiduino.menu.lvl.WIFI=WIFI +wifiduino.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +wifiduino.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +wifiduino.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +wifiduino.menu.lvl.UPDATER=UPDATER +wifiduino.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +wifiduino.menu.lvl.OTA=OTA +wifiduino.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +wifiduino.menu.lvl.OOM=OOM +wifiduino.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +wifiduino.menu.lvl.MDNS=MDNS +wifiduino.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifiduino.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifiduino.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +wifiduino.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +wifiduino.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +wifiduino.menu.wipe.none=Only Sketch +wifiduino.menu.wipe.none.upload.erase_cmd= +wifiduino.menu.wipe.sdk=Sketch + WiFi Settings +wifiduino.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +wifiduino.menu.wipe.all=All Flash Contents +wifiduino.menu.wipe.all.upload.erase_cmd=erase_flash +wifiduino.menu.baud.921600=921600 +wifiduino.menu.baud.921600.upload.speed=921600 +wifiduino.menu.baud.57600=57600 +wifiduino.menu.baud.57600.upload.speed=57600 +wifiduino.menu.baud.115200=115200 +wifiduino.menu.baud.115200.upload.speed=115200 +wifiduino.menu.baud.230400.linux=230400 +wifiduino.menu.baud.230400.macosx=230400 +wifiduino.menu.baud.230400.upload.speed=230400 +wifiduino.menu.baud.256000.windows=256000 +wifiduino.menu.baud.256000.upload.speed=256000 +wifiduino.menu.baud.460800.linux=460800 +wifiduino.menu.baud.460800.macosx=460800 +wifiduino.menu.baud.460800.upload.speed=460800 +wifiduino.menu.baud.512000.windows=512000 +wifiduino.menu.baud.512000.upload.speed=512000 +wifiduino.menu.baud.3000000=3000000 +wifiduino.menu.baud.3000000.upload.speed=3000000 + +############################################################## +wifinfo.name=WifInfo +wifinfo.build.board=WIFINFO +wifinfo.build.variant=wifinfo +wifinfo.menu.ESPModule.ESP07192=ESP07 (1M/192K FS) +wifinfo.menu.ESPModule.ESP07192.build.board=ESP8266_ESP07 +wifinfo.menu.ESPModule.ESP07192.build.flash_ld=eagle.flash.1m192.ld +wifinfo.menu.ESPModule.ESP07192.build.flash_size=1M +wifinfo.menu.ESPModule.ESP07192.build.spiffs_blocksize=4096 +wifinfo.menu.ESPModule.ESP07192.build.spiffs_end=0xFB000 +wifinfo.menu.ESPModule.ESP07192.build.spiffs_start=0xCB000 +wifinfo.menu.ESPModule.ESP07192.upload.maximum_size=827376 +wifinfo.menu.ESPModule.ESP12=ESP12 (4M/1M FS) +wifinfo.menu.ESPModule.ESP12.build.board=ESP8266_ESP12 +wifinfo.menu.ESPModule.ESP12.build.flash_ld=eagle.flash.4m1m.ld +wifinfo.menu.ESPModule.ESP12.build.flash_size=4M +wifinfo.menu.ESPModule.ESP12.build.spiffs_blocksize=8192 +wifinfo.menu.ESPModule.ESP12.build.spiffs_end=0x3FB000 +wifinfo.menu.ESPModule.ESP12.build.spiffs_pagesize=256 +wifinfo.menu.ESPModule.ESP12.build.spiffs_start=0x300000 +wifinfo.menu.ESPModule.ESP12.upload.maximum_size=1044464 +wifinfo.upload.tool=esptool +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.spiffs_pagesize=256 +wifinfo.build.debug_port= +wifinfo.build.debug_level= +wifinfo.menu.xtal.80=80 MHz +wifinfo.menu.xtal.80.build.f_cpu=80000000L +wifinfo.menu.xtal.160=160 MHz +wifinfo.menu.xtal.160.build.f_cpu=160000000L +wifinfo.menu.vt.flash=Flash +wifinfo.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +wifinfo.menu.vt.heap=Heap +wifinfo.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +wifinfo.menu.vt.iram=IRAM +wifinfo.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +wifinfo.menu.exception.disabled=Disabled (new aborts on oom) +wifinfo.menu.exception.disabled.build.exception_flags=-fno-exceptions +wifinfo.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +wifinfo.menu.exception.enabled=Enabled +wifinfo.menu.exception.enabled.build.exception_flags=-fexceptions +wifinfo.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +wifinfo.menu.stacksmash.disabled=Disabled +wifinfo.menu.stacksmash.disabled.build.stacksmash_flags= +wifinfo.menu.stacksmash.enabled=Enabled +wifinfo.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +wifinfo.menu.ssl.all=All SSL ciphers (most compatible) +wifinfo.menu.ssl.all.build.sslflags= +wifinfo.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +wifinfo.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +wifinfo.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +wifinfo.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +wifinfo.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +wifinfo.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +wifinfo.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +wifinfo.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +wifinfo.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +wifinfo.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +wifinfo.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +wifinfo.menu.non32xfer.fast.build.non32xferflags= +wifinfo.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +wifinfo.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +wifinfo.upload.resetmethod=--before default_reset --after hard_reset +wifinfo.build.flash_mode=qio +wifinfo.build.flash_flags=-DFLASHMODE_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.FlashFreq.20=20MHz +wifinfo.menu.FlashFreq.20.build.flash_freq=20 +wifinfo.menu.FlashFreq.26=26MHz +wifinfo.menu.FlashFreq.26.build.flash_freq=26 +wifinfo.menu.eesz.1M64=1MB (FS:64KB OTA:~470KB) +wifinfo.menu.eesz.1M64.build.flash_size=1M +wifinfo.menu.eesz.1M64.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M64.build.flash_ld=eagle.flash.1m64.ld +wifinfo.menu.eesz.1M64.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M64.upload.maximum_size=958448 +wifinfo.menu.eesz.1M64.build.rfcal_addr=0xFC000 +wifinfo.menu.eesz.1M64.build.spiffs_start=0xEB000 +wifinfo.menu.eesz.1M64.build.spiffs_end=0xFB000 +wifinfo.menu.eesz.1M64.build.spiffs_blocksize=4096 +wifinfo.menu.eesz.1M128=1MB (FS:128KB OTA:~438KB) +wifinfo.menu.eesz.1M128.build.flash_size=1M +wifinfo.menu.eesz.1M128.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M128.build.flash_ld=eagle.flash.1m128.ld +wifinfo.menu.eesz.1M128.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M128.upload.maximum_size=892912 +wifinfo.menu.eesz.1M128.build.rfcal_addr=0xFC000 +wifinfo.menu.eesz.1M128.build.spiffs_start=0xDB000 +wifinfo.menu.eesz.1M128.build.spiffs_end=0xFB000 +wifinfo.menu.eesz.1M128.build.spiffs_blocksize=4096 +wifinfo.menu.eesz.1M144=1MB (FS:144KB OTA:~430KB) +wifinfo.menu.eesz.1M144.build.flash_size=1M +wifinfo.menu.eesz.1M144.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M144.build.flash_ld=eagle.flash.1m144.ld +wifinfo.menu.eesz.1M144.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M144.upload.maximum_size=876528 +wifinfo.menu.eesz.1M144.build.rfcal_addr=0xFC000 +wifinfo.menu.eesz.1M144.build.spiffs_start=0xD7000 +wifinfo.menu.eesz.1M144.build.spiffs_end=0xFB000 +wifinfo.menu.eesz.1M144.build.spiffs_blocksize=4096 +wifinfo.menu.eesz.1M160=1MB (FS:160KB OTA:~422KB) +wifinfo.menu.eesz.1M160.build.flash_size=1M +wifinfo.menu.eesz.1M160.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M160.build.flash_ld=eagle.flash.1m160.ld +wifinfo.menu.eesz.1M160.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M160.upload.maximum_size=860144 +wifinfo.menu.eesz.1M160.build.rfcal_addr=0xFC000 +wifinfo.menu.eesz.1M160.build.spiffs_start=0xD3000 +wifinfo.menu.eesz.1M160.build.spiffs_end=0xFB000 +wifinfo.menu.eesz.1M160.build.spiffs_blocksize=4096 +wifinfo.menu.eesz.1M192=1MB (FS:192KB OTA:~406KB) +wifinfo.menu.eesz.1M192.build.flash_size=1M +wifinfo.menu.eesz.1M192.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M192.build.flash_ld=eagle.flash.1m192.ld +wifinfo.menu.eesz.1M192.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M192.upload.maximum_size=827376 +wifinfo.menu.eesz.1M192.build.rfcal_addr=0xFC000 +wifinfo.menu.eesz.1M192.build.spiffs_start=0xCB000 +wifinfo.menu.eesz.1M192.build.spiffs_end=0xFB000 +wifinfo.menu.eesz.1M192.build.spiffs_blocksize=4096 +wifinfo.menu.eesz.1M256=1MB (FS:256KB OTA:~374KB) +wifinfo.menu.eesz.1M256.build.flash_size=1M +wifinfo.menu.eesz.1M256.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M256.build.flash_ld=eagle.flash.1m256.ld +wifinfo.menu.eesz.1M256.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M256.upload.maximum_size=761840 +wifinfo.menu.eesz.1M256.build.rfcal_addr=0xFC000 +wifinfo.menu.eesz.1M256.build.spiffs_start=0xBB000 +wifinfo.menu.eesz.1M256.build.spiffs_end=0xFB000 +wifinfo.menu.eesz.1M256.build.spiffs_blocksize=4096 +wifinfo.menu.eesz.1M512=1MB (FS:512KB OTA:~246KB) +wifinfo.menu.eesz.1M512.build.flash_size=1M +wifinfo.menu.eesz.1M512.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M512.build.flash_ld=eagle.flash.1m512.ld +wifinfo.menu.eesz.1M512.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M512.upload.maximum_size=499696 +wifinfo.menu.eesz.1M512.build.rfcal_addr=0xFC000 +wifinfo.menu.eesz.1M512.build.spiffs_start=0x7B000 +wifinfo.menu.eesz.1M512.build.spiffs_end=0xFB000 +wifinfo.menu.eesz.1M512.build.spiffs_blocksize=8192 +wifinfo.menu.eesz.1M=1MB (FS:none OTA:~502KB) +wifinfo.menu.eesz.1M.build.flash_size=1M +wifinfo.menu.eesz.1M.build.flash_size_bytes=0x100000 +wifinfo.menu.eesz.1M.build.flash_ld=eagle.flash.1m.ld +wifinfo.menu.eesz.1M.build.spiffs_pagesize=256 +wifinfo.menu.eesz.1M.upload.maximum_size=1023984 +wifinfo.menu.eesz.1M.build.rfcal_addr=0xFC000 +wifinfo.menu.ip.lm2f=v2 Lower Memory +wifinfo.menu.ip.lm2f.build.lwip_include=lwip2/include +wifinfo.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +wifinfo.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +wifinfo.menu.ip.hb2f=v2 Higher Bandwidth +wifinfo.menu.ip.hb2f.build.lwip_include=lwip2/include +wifinfo.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +wifinfo.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +wifinfo.menu.ip.lm2n=v2 Lower Memory (no features) +wifinfo.menu.ip.lm2n.build.lwip_include=lwip2/include +wifinfo.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +wifinfo.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +wifinfo.menu.ip.hb2n=v2 Higher Bandwidth (no features) +wifinfo.menu.ip.hb2n.build.lwip_include=lwip2/include +wifinfo.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +wifinfo.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +wifinfo.menu.ip.lm6f=v2 IPv6 Lower Memory +wifinfo.menu.ip.lm6f.build.lwip_include=lwip2/include +wifinfo.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +wifinfo.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +wifinfo.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +wifinfo.menu.ip.hb6f.build.lwip_include=lwip2/include +wifinfo.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +wifinfo.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +wifinfo.menu.dbg.Disabled=Disabled +wifinfo.menu.dbg.Disabled.build.debug_port= +wifinfo.menu.dbg.Serial=Serial +wifinfo.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +wifinfo.menu.dbg.Serial1=Serial1 +wifinfo.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +wifinfo.menu.lvl.None____=None +wifinfo.menu.lvl.None____.build.debug_level= +wifinfo.menu.lvl.SSL=SSL +wifinfo.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +wifinfo.menu.lvl.TLS_MEM=TLS_MEM +wifinfo.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +wifinfo.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +wifinfo.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +wifinfo.menu.lvl.HTTP_SERVER=HTTP_SERVER +wifinfo.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +wifinfo.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +wifinfo.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +wifinfo.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +wifinfo.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +wifinfo.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +wifinfo.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +wifinfo.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +wifinfo.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +wifinfo.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +wifinfo.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +wifinfo.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +wifinfo.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +wifinfo.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +wifinfo.menu.lvl.CORE=CORE +wifinfo.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +wifinfo.menu.lvl.WIFI=WIFI +wifinfo.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +wifinfo.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +wifinfo.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +wifinfo.menu.lvl.UPDATER=UPDATER +wifinfo.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +wifinfo.menu.lvl.OTA=OTA +wifinfo.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +wifinfo.menu.lvl.OOM=OOM +wifinfo.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +wifinfo.menu.lvl.MDNS=MDNS +wifinfo.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifinfo.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +wifinfo.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +wifinfo.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +wifinfo.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +wifinfo.menu.wipe.none=Only Sketch +wifinfo.menu.wipe.none.upload.erase_cmd= +wifinfo.menu.wipe.sdk=Sketch + WiFi Settings +wifinfo.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +wifinfo.menu.wipe.all=All Flash Contents +wifinfo.menu.wipe.all.upload.erase_cmd=erase_flash +wifinfo.menu.baud.115200=115200 +wifinfo.menu.baud.115200.upload.speed=115200 +wifinfo.menu.baud.57600=57600 +wifinfo.menu.baud.57600.upload.speed=57600 +wifinfo.menu.baud.230400.linux=230400 +wifinfo.menu.baud.230400.macosx=230400 +wifinfo.menu.baud.230400.upload.speed=230400 +wifinfo.menu.baud.256000.windows=256000 +wifinfo.menu.baud.256000.upload.speed=256000 +wifinfo.menu.baud.460800.linux=460800 +wifinfo.menu.baud.460800.macosx=460800 +wifinfo.menu.baud.460800.upload.speed=460800 +wifinfo.menu.baud.512000.windows=512000 +wifinfo.menu.baud.512000.upload.speed=512000 +wifinfo.menu.baud.921600=921600 +wifinfo.menu.baud.921600.upload.speed=921600 +wifinfo.menu.baud.3000000=3000000 +wifinfo.menu.baud.3000000.upload.speed=3000000 + +############################################################## +cw01.name=XinaBox CW01 +cw01.build.board=ESP8266_GENERIC +cw01.build.variant=xinabox +cw01.upload.tool=esptool +cw01.upload.maximum_data_size=81920 +cw01.upload.wait_for_upload_port=true +cw01.upload.erase_cmd= +cw01.serial.disableDTR=true +cw01.serial.disableRTS=true +cw01.build.mcu=esp8266 +cw01.build.core=esp8266 +cw01.build.spiffs_pagesize=256 +cw01.build.debug_port= +cw01.build.debug_level= +cw01.menu.xtal.80=80 MHz +cw01.menu.xtal.80.build.f_cpu=80000000L +cw01.menu.xtal.160=160 MHz +cw01.menu.xtal.160.build.f_cpu=160000000L +cw01.menu.vt.flash=Flash +cw01.menu.vt.flash.build.vtable_flags=-DVTABLES_IN_FLASH +cw01.menu.vt.heap=Heap +cw01.menu.vt.heap.build.vtable_flags=-DVTABLES_IN_DRAM +cw01.menu.vt.iram=IRAM +cw01.menu.vt.iram.build.vtable_flags=-DVTABLES_IN_IRAM +cw01.menu.exception.disabled=Disabled (new aborts on oom) +cw01.menu.exception.disabled.build.exception_flags=-fno-exceptions +cw01.menu.exception.disabled.build.stdcpp_lib=-lstdc++ +cw01.menu.exception.enabled=Enabled +cw01.menu.exception.enabled.build.exception_flags=-fexceptions +cw01.menu.exception.enabled.build.stdcpp_lib=-lstdc++-exc +cw01.menu.stacksmash.disabled=Disabled +cw01.menu.stacksmash.disabled.build.stacksmash_flags= +cw01.menu.stacksmash.enabled=Enabled +cw01.menu.stacksmash.enabled.build.stacksmash_flags=-fstack-protector +cw01.menu.ssl.all=All SSL ciphers (most compatible) +cw01.menu.ssl.all.build.sslflags= +cw01.menu.ssl.basic=Basic SSL ciphers (lower ROM use) +cw01.menu.ssl.basic.build.sslflags=-DBEARSSL_SSL_BASIC +cw01.menu.mmu.3232=32KB cache + 32KB IRAM (balanced) +cw01.menu.mmu.3232.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000 +cw01.menu.mmu.4816=16KB cache + 48KB IRAM (IRAM) +cw01.menu.mmu.4816.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 +cw01.menu.mmu.4816H=16KB cache + 48KB IRAM and 2nd Heap (shared) +cw01.menu.mmu.4816H.build.mmuflags=-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP +cw01.menu.mmu.3216=16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared) +cw01.menu.mmu.3216.build.mmuflags=-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000 +cw01.menu.non32xfer.fast=Use pgm_read macros for IRAM/PROGMEM +cw01.menu.non32xfer.fast.build.non32xferflags= +cw01.menu.non32xfer.safe=Byte/Word access to IRAM/PROGMEM (very slow) +cw01.menu.non32xfer.safe.build.non32xferflags=-DNON32XFER_HANDLER +cw01.upload.resetmethod=--before default_reset --after hard_reset +cw01.menu.CrystalFreq.26=26 MHz +cw01.menu.CrystalFreq.40=40 MHz +cw01.menu.CrystalFreq.40.build.extra_flags=-DF_CRYSTAL=40000000 -DESP8266 +cw01.build.flash_mode=dio +cw01.build.flash_flags=-DFLASHMODE_DIO +cw01.build.flash_freq=40 +cw01.menu.eesz.4M2M=4MB (FS:2MB OTA:~1019KB) +cw01.menu.eesz.4M2M.build.flash_size=4M +cw01.menu.eesz.4M2M.build.flash_size_bytes=0x400000 +cw01.menu.eesz.4M2M.build.flash_ld=eagle.flash.4m2m.ld +cw01.menu.eesz.4M2M.build.spiffs_pagesize=256 +cw01.menu.eesz.4M2M.upload.maximum_size=1044464 +cw01.menu.eesz.4M2M.build.rfcal_addr=0x3FC000 +cw01.menu.eesz.4M2M.build.spiffs_start=0x200000 +cw01.menu.eesz.4M2M.build.spiffs_end=0x3FA000 +cw01.menu.eesz.4M2M.build.spiffs_blocksize=8192 +cw01.menu.eesz.4M3M=4MB (FS:3MB OTA:~512KB) +cw01.menu.eesz.4M3M.build.flash_size=4M +cw01.menu.eesz.4M3M.build.flash_size_bytes=0x400000 +cw01.menu.eesz.4M3M.build.flash_ld=eagle.flash.4m3m.ld +cw01.menu.eesz.4M3M.build.spiffs_pagesize=256 +cw01.menu.eesz.4M3M.upload.maximum_size=1044464 +cw01.menu.eesz.4M3M.build.rfcal_addr=0x3FC000 +cw01.menu.eesz.4M3M.build.spiffs_start=0x100000 +cw01.menu.eesz.4M3M.build.spiffs_end=0x3FA000 +cw01.menu.eesz.4M3M.build.spiffs_blocksize=8192 +cw01.menu.eesz.4M1M=4MB (FS:1MB OTA:~1019KB) +cw01.menu.eesz.4M1M.build.flash_size=4M +cw01.menu.eesz.4M1M.build.flash_size_bytes=0x400000 +cw01.menu.eesz.4M1M.build.flash_ld=eagle.flash.4m1m.ld +cw01.menu.eesz.4M1M.build.spiffs_pagesize=256 +cw01.menu.eesz.4M1M.upload.maximum_size=1044464 +cw01.menu.eesz.4M1M.build.rfcal_addr=0x3FC000 +cw01.menu.eesz.4M1M.build.spiffs_start=0x300000 +cw01.menu.eesz.4M1M.build.spiffs_end=0x3FA000 +cw01.menu.eesz.4M1M.build.spiffs_blocksize=8192 +cw01.menu.eesz.4M=4MB (FS:none OTA:~1019KB) +cw01.menu.eesz.4M.build.flash_size=4M +cw01.menu.eesz.4M.build.flash_size_bytes=0x400000 +cw01.menu.eesz.4M.build.flash_ld=eagle.flash.4m.ld +cw01.menu.eesz.4M.build.spiffs_pagesize=256 +cw01.menu.eesz.4M.upload.maximum_size=1044464 +cw01.menu.eesz.4M.build.rfcal_addr=0x3FC000 +cw01.menu.ip.lm2f=v2 Lower Memory +cw01.menu.ip.lm2f.build.lwip_include=lwip2/include +cw01.menu.ip.lm2f.build.lwip_lib=-llwip2-536-feat +cw01.menu.ip.lm2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +cw01.menu.ip.hb2f=v2 Higher Bandwidth +cw01.menu.ip.hb2f.build.lwip_include=lwip2/include +cw01.menu.ip.hb2f.build.lwip_lib=-llwip2-1460-feat +cw01.menu.ip.hb2f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=0 +cw01.menu.ip.lm2n=v2 Lower Memory (no features) +cw01.menu.ip.lm2n.build.lwip_include=lwip2/include +cw01.menu.ip.lm2n.build.lwip_lib=-llwip2-536 +cw01.menu.ip.lm2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +cw01.menu.ip.hb2n=v2 Higher Bandwidth (no features) +cw01.menu.ip.hb2n.build.lwip_include=lwip2/include +cw01.menu.ip.hb2n.build.lwip_lib=-llwip2-1460 +cw01.menu.ip.hb2n.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=0 -DLWIP_IPV6=0 +cw01.menu.ip.lm6f=v2 IPv6 Lower Memory +cw01.menu.ip.lm6f.build.lwip_include=lwip2/include +cw01.menu.ip.lm6f.build.lwip_lib=-llwip6-536-feat +cw01.menu.ip.lm6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=536 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +cw01.menu.ip.hb6f=v2 IPv6 Higher Bandwidth +cw01.menu.ip.hb6f.build.lwip_include=lwip2/include +cw01.menu.ip.hb6f.build.lwip_lib=-llwip6-1460-feat +cw01.menu.ip.hb6f.build.lwip_flags=-DLWIP_OPEN_SRC -DTCP_MSS=1460 -DLWIP_FEATURES=1 -DLWIP_IPV6=1 +cw01.menu.dbg.Disabled=Disabled +cw01.menu.dbg.Disabled.build.debug_port= +cw01.menu.dbg.Serial=Serial +cw01.menu.dbg.Serial.build.debug_port=-DDEBUG_ESP_PORT=Serial +cw01.menu.dbg.Serial1=Serial1 +cw01.menu.dbg.Serial1.build.debug_port=-DDEBUG_ESP_PORT=Serial1 +cw01.menu.lvl.None____=None +cw01.menu.lvl.None____.build.debug_level= +cw01.menu.lvl.SSL=SSL +cw01.menu.lvl.SSL.build.debug_level= -DDEBUG_ESP_SSL +cw01.menu.lvl.TLS_MEM=TLS_MEM +cw01.menu.lvl.TLS_MEM.build.debug_level= -DDEBUG_ESP_TLS_MEM +cw01.menu.lvl.HTTP_CLIENT=HTTP_CLIENT +cw01.menu.lvl.HTTP_CLIENT.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT +cw01.menu.lvl.HTTP_SERVER=HTTP_SERVER +cw01.menu.lvl.HTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.SSLTLS_MEM=SSL+TLS_MEM +cw01.menu.lvl.SSLTLS_MEM.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM +cw01.menu.lvl.SSLHTTP_CLIENT=SSL+HTTP_CLIENT +cw01.menu.lvl.SSLHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT +cw01.menu.lvl.SSLHTTP_SERVER=SSL+HTTP_SERVER +cw01.menu.lvl.SSLHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.TLS_MEMHTTP_CLIENT=TLS_MEM+HTTP_CLIENT +cw01.menu.lvl.TLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +cw01.menu.lvl.TLS_MEMHTTP_SERVER=TLS_MEM+HTTP_SERVER +cw01.menu.lvl.TLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.HTTP_CLIENTHTTP_SERVER=HTTP_CLIENT+HTTP_SERVER +cw01.menu.lvl.HTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENT=SSL+TLS_MEM+HTTP_CLIENT +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENT.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT +cw01.menu.lvl.SSLTLS_MEMHTTP_SERVER=SSL+TLS_MEM+HTTP_SERVER +cw01.menu.lvl.SSLTLS_MEMHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER=SSL+HTTP_CLIENT+HTTP_SERVER +cw01.menu.lvl.SSLHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER=TLS_MEM+HTTP_CLIENT+HTTP_SERVER +cw01.menu.lvl.TLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVER.build.debug_level= -DDEBUG_ESP_SSL -DDEBUG_ESP_TLS_MEM -DDEBUG_ESP_HTTP_CLIENT -DDEBUG_ESP_HTTP_SERVER +cw01.menu.lvl.CORE=CORE +cw01.menu.lvl.CORE.build.debug_level= -DDEBUG_ESP_CORE +cw01.menu.lvl.WIFI=WIFI +cw01.menu.lvl.WIFI.build.debug_level= -DDEBUG_ESP_WIFI +cw01.menu.lvl.HTTP_UPDATE=HTTP_UPDATE +cw01.menu.lvl.HTTP_UPDATE.build.debug_level= -DDEBUG_ESP_HTTP_UPDATE +cw01.menu.lvl.UPDATER=UPDATER +cw01.menu.lvl.UPDATER.build.debug_level= -DDEBUG_ESP_UPDATER +cw01.menu.lvl.OTA=OTA +cw01.menu.lvl.OTA.build.debug_level= -DDEBUG_ESP_OTA +cw01.menu.lvl.OOM=OOM +cw01.menu.lvl.OOM.build.debug_level= -DDEBUG_ESP_OOM +cw01.menu.lvl.MDNS=MDNS +cw01.menu.lvl.MDNS.build.debug_level= -DDEBUG_ESP_MDNS +cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +cw01.menu.lvl.COREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.build.debug_level= -DDEBUG_ESP_CORE -DDEBUG_ESP_WIFI -DDEBUG_ESP_HTTP_UPDATE -DDEBUG_ESP_UPDATER -DDEBUG_ESP_OTA -DDEBUG_ESP_OOM -DDEBUG_ESP_MDNS +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS=SSL+TLS_MEM+HTTP_CLIENT+HTTP_SERVER+CORE+WIFI+HTTP_UPDATE+UPDATER+OTA+OOM+MDNS +cw01.menu.lvl.SSLTLS_MEMHTTP_CLIENTHTTP_SERVERCOREWIFIHTTP_UPDATEUPDATEROTAOOMMDNS.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 -DDEBUG_ESP_MDNS +cw01.menu.lvl.NoAssert-NDEBUG=NoAssert-NDEBUG +cw01.menu.lvl.NoAssert-NDEBUG.build.debug_level= -DNDEBUG +cw01.menu.wipe.none=Only Sketch +cw01.menu.wipe.none.upload.erase_cmd= +cw01.menu.wipe.sdk=Sketch + WiFi Settings +cw01.menu.wipe.sdk.upload.erase_cmd=erase_region "{build.rfcal_addr}" 0x4000 +cw01.menu.wipe.all=All Flash Contents +cw01.menu.wipe.all.upload.erase_cmd=erase_flash +cw01.menu.baud.115200=115200 +cw01.menu.baud.115200.upload.speed=115200 +cw01.menu.baud.57600=57600 +cw01.menu.baud.57600.upload.speed=57600 +cw01.menu.baud.230400.linux=230400 +cw01.menu.baud.230400.macosx=230400 +cw01.menu.baud.230400.upload.speed=230400 +cw01.menu.baud.256000.windows=256000 +cw01.menu.baud.256000.upload.speed=256000 +cw01.menu.baud.460800.linux=460800 +cw01.menu.baud.460800.macosx=460800 +cw01.menu.baud.460800.upload.speed=460800 +cw01.menu.baud.512000.windows=512000 +cw01.menu.baud.512000.upload.speed=512000 +cw01.menu.baud.921600=921600 +cw01.menu.baud.921600.upload.speed=921600 +cw01.menu.baud.3000000=3000000 +cw01.menu.baud.3000000.upload.speed=3000000 diff --git a/bootloaders/eboot/Makefile b/bootloaders/eboot/Makefile index 17c535146..7f035dd1e 100644 --- a/bootloaders/eboot/Makefile +++ b/bootloaders/eboot/Makefile @@ -23,7 +23,7 @@ INC += -I../../tools/sdk/include -I../../tools/sdk/uzlib/src CFLAGS += -std=gnu99 -CFLAGS += -Os -fcommon -g -Wall -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -ffunction-sections -fdata-sections +CFLAGS += -Os -fcommon -g -Wall -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mno-text-section-literals -ffunction-sections -fdata-sections -free -fipa-pta CFLAGS += $(INC) diff --git a/bootloaders/eboot/eboot.c b/bootloaders/eboot/eboot.c index 1ca64a16a..6e188d806 100644 --- a/bootloaders/eboot/eboot.c +++ b/bootloaders/eboot/eboot.c @@ -68,7 +68,9 @@ int load_app_from_flash_raw(const uint32_t flash_addr) load = true; } - if (address >= 0x40100000 && address < 0x40108000) { + // The final IRAM size, once boot has completed, can be either 32K or 48K. + // Allow for the higher in range testing. + if (address >= 0x40100000 && address < 0x4010C000) { load = true; } @@ -235,14 +237,14 @@ int main() if (cmd.action == ACTION_COPY_RAW) { uint32_t cp = S('c', 'p', ':', 0); - ets_printf((const char *)cp); + ets_printf((const char *)&cp); ets_wdt_disable(); res = copy_raw(cmd.args[0], cmd.args[1], cmd.args[2], false); ets_wdt_enable(); cp = S('0' + res, '\n', 0, 0 ); - ets_printf((const char *)cp); + ets_printf((const char *)&cp); #if 0 //devyte: this verify step below (cmp:) only works when the end of copy operation above does not overwrite the //beginning of the image in the empty area, see #7458. Disabling for now. @@ -259,7 +261,7 @@ int main() } cp = S('0' + res, '\n', 0, 0 ); - ets_printf((const char *)cp); + ets_printf((const char *)&cp); #endif if (res == 0) { cmd.action = ACTION_LOAD_APP; diff --git a/bootloaders/eboot/eboot.elf b/bootloaders/eboot/eboot.elf index e7e1fc543..7155fd88e 100755 Binary files a/bootloaders/eboot/eboot.elf and b/bootloaders/eboot/eboot.elf differ diff --git a/cores/esp8266/Arduino.h b/cores/esp8266/Arduino.h index ec0d460d8..b484a3765 100644 --- a/cores/esp8266/Arduino.h +++ b/cores/esp8266/Arduino.h @@ -225,6 +225,10 @@ void optimistic_yield(uint32_t interval_us); #include #include + +#include "mmu_iram.h" + + using std::min; using std::max; using std::round; diff --git a/cores/esp8266/Esp-frag.cpp b/cores/esp8266/Esp-frag.cpp index dc5970e85..30332aca6 100644 --- a/cores/esp8266/Esp-frag.cpp +++ b/cores/esp8266/Esp-frag.cpp @@ -30,14 +30,15 @@ void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag) // 100 * (1 - sqrt(sum(hole-size²)) / sum(hole-size)) umm_info(NULL, false); - uint8_t block_size = umm_block_size(); + + uint32_t free_size = umm_free_heap_size_core(umm_get_current_heap()); if (hfree) - *hfree = ummHeapInfo.freeBlocks * block_size; + *hfree = free_size; if (hmax) - *hmax = (uint16_t)ummHeapInfo.maxFreeContiguousBlocks * block_size; + *hmax = (uint16_t)umm_max_block_size_core(umm_get_current_heap()); if (hfrag) { - if (ummHeapInfo.freeBlocks) { - *hfrag = 100 - (sqrt32(ummHeapInfo.freeBlocksSquared) * 100) / ummHeapInfo.freeBlocks; + if (free_size) { + *hfrag = umm_fragmentation_metric_core(umm_get_current_heap()); } else { *hfrag = 0; } @@ -46,11 +47,5 @@ void EspClass::getHeapStats(uint32_t* hfree, uint16_t* hmax, uint8_t* hfrag) uint8_t EspClass::getHeapFragmentation() { -#ifdef UMM_INLINE_METRICS - return (uint8_t)umm_fragmentation_metric(); -#else - uint8_t hfrag; - getHeapStats(nullptr, nullptr, &hfrag); - return hfrag; -#endif + return (uint8_t)umm_fragmentation_metric(); } diff --git a/cores/esp8266/Esp.cpp b/cores/esp8266/Esp.cpp index 60990103f..51bdfe8e1 100644 --- a/cores/esp8266/Esp.cpp +++ b/cores/esp8266/Esp.cpp @@ -28,6 +28,8 @@ #include "cont.h" #include "coredecls.h" +#include "umm_malloc/umm_malloc.h" +// #include "core_esp8266_vm.h" #include extern "C" { @@ -516,45 +518,45 @@ uint8_t *EspClass::random(uint8_t *resultArray, const size_t outputSizeBytes) co { /** * The ESP32 Technical Reference Manual v4.1 chapter 24 has the following to say about random number generation (no information found for ESP8266): - * + * * "When used correctly, every 32-bit value the system reads from the RNG_DATA_REG register of the random number generator is a true random number. * These true random numbers are generated based on the noise in the Wi-Fi/BT RF system. * When Wi-Fi and BT are disabled, the random number generator will give out pseudo-random numbers. - * + * * When Wi-Fi or BT is enabled, the random number generator is fed two bits of entropy every APB clock cycle (normally 80 MHz). * Thus, for the maximum amount of entropy, it is advisable to read the random register at a maximum rate of 5 MHz. * A data sample of 2 GB, read from the random number generator with Wi-Fi enabled and the random register read at 5 MHz, * has been tested using the Dieharder Random Number Testsuite (version 3.31.1). * The sample passed all tests." - * + * * Since ESP32 is the sequal to ESP8266 it is unlikely that the ESP8266 is able to generate random numbers more quickly than 5 MHz when run at a 80 MHz frequency. * A maximum random number frequency of 0.5 MHz is used here to leave some margin for possibly inferior components in the ESP8266. * It should be noted that the ESP8266 has no Bluetooth functionality, so turning the WiFi off is likely to cause RANDOM_REG32 to use pseudo-random numbers. - * - * It is possible that yield() must be called on the ESP8266 to properly feed the hardware random number generator new bits, since there is only one processor core available. + * + * It is possible that yield() must be called on the ESP8266 to properly feed the hardware random number generator new bits, since there is only one processor core available. * However, no feeding requirements are mentioned in the ESP32 documentation, and using yield() could possibly cause extended delays during number generation. * Thus only delayMicroseconds() is used below. - */ + */ constexpr uint8_t cooldownMicros = 2; static uint32_t lastCalledMicros = micros() - cooldownMicros; uint32_t randomNumber = 0; - + for(size_t byteIndex = 0; byteIndex < outputSizeBytes; ++byteIndex) { if(byteIndex % 4 == 0) { // Old random number has been used up (random number could be exactly 0, so we can't check for that) - + uint32_t timeSinceLastCall = micros() - lastCalledMicros; if(timeSinceLastCall < cooldownMicros) delayMicroseconds(cooldownMicros - timeSinceLastCall); - + randomNumber = RANDOM_REG32; lastCalledMicros = micros(); } - + resultArray[byteIndex] = randomNumber; randomNumber >>= 8; } @@ -969,3 +971,62 @@ String EspClass::getSketchMD5() result = md5.toString(); return result; } + +void EspClass::enableVM() +{ +#ifdef UMM_HEAP_EXTERNAL + if (!vmEnabled) + install_vm_exception_handler(); + vmEnabled = true; +#endif +} + +void EspClass::setExternalHeap() +{ +#ifdef UMM_HEAP_EXTERNAL + if (vmEnabled) { + if (!umm_push_heap(UMM_HEAP_EXTERNAL)) { + panic(); + } + } +#endif +} + +void EspClass::setIramHeap() +{ +#ifdef UMM_HEAP_IRAM + if (!umm_push_heap(UMM_HEAP_IRAM)) { + panic(); + } +#endif +} + +void EspClass::setDramHeap() +{ +#if defined(UMM_HEAP_EXTERNAL) && !defined(UMM_HEAP_IRAM) + if (vmEnabled) { + if (!umm_push_heap(UMM_HEAP_DRAM)) { + panic(); + } + } +#elif defined(UMM_HEAP_IRAM) + if (!umm_push_heap(UMM_HEAP_DRAM)) { + panic(); + } +#endif +} + +void EspClass::resetHeap() +{ +#if defined(UMM_HEAP_EXTERNAL) && !defined(UMM_HEAP_IRAM) + if (vmEnabled) { + if (!umm_pop_heap()) { + panic(); + } + } +#elif defined(UMM_HEAP_IRAM) + if (!umm_pop_heap()) { + panic(); + } +#endif +} diff --git a/cores/esp8266/Esp.h b/cores/esp8266/Esp.h index 54f8d2175..6d990e876 100644 --- a/cores/esp8266/Esp.h +++ b/cores/esp8266/Esp.h @@ -123,7 +123,7 @@ class EspClass { uint8_t getBootMode(); #if defined(F_CPU) || defined(CORE_MOCK) - constexpr + constexpr #endif inline uint8_t getCpuFreqMHz() const __attribute__((always_inline)) { @@ -215,7 +215,46 @@ class EspClass { #else uint32_t getCycleCount(); #endif // !defined(CORE_MOCK) + /** + * @brief Installs VM exception handler to support External memory (Experimental) + * + * @param none + * @return none + */ + void enableVM(); + /** + * @brief Push current Heap selection and set Heap selection to DRAM. + * + * @param none + * @return none + */ + void setDramHeap(); + /** + * @brief Push current Heap selection and set Heap selection to IRAM. + * + * @param none + * @return none + */ + void setIramHeap(); + /** + * @brief Push current Heap selection and set Heap selection to External. (Experimental) + * + * @param none + * @return none + */ + void setExternalHeap(); + /** + * @brief Restores Heap selection back to value present when + * setDramHeap, setIramHeap, or setExternalHeap was called. + * + * @param none + * @return none + */ + void resetHeap(); private: +#ifdef UMM_HEAP_EXTERNAL + bool vmEnabled = false; +#endif /** * @brief Replaces @a byteCount bytes of a 4 byte block on flash * diff --git a/cores/esp8266/FS.cpp b/cores/esp8266/FS.cpp index 392955d49..a6199bb11 100644 --- a/cores/esp8266/FS.cpp +++ b/cores/esp8266/FS.cpp @@ -46,6 +46,14 @@ int File::available() { return _p->size() - _p->position(); } +int File::availableForWrite() { + if (!_p) + return false; + + return _p->availableForWrite(); +} + + int File::read() { if (!_p) return -1; @@ -60,7 +68,7 @@ int File::read() { size_t File::read(uint8_t* buf, size_t size) { if (!_p) - return -1; + return 0; return _p->read(buf, size); } @@ -198,6 +206,7 @@ void File::setTimeCallback(time_t (*cb)(void)) { if (!_p) return; _p->setTimeCallback(cb); + _timeCallback = cb; } File Dir::openFile(const char* mode) { @@ -213,7 +222,7 @@ File Dir::openFile(const char* mode) { } File f(_impl->openFile(om, am), _baseFS); - f.setTimeCallback(timeCallback); + f.setTimeCallback(_timeCallback); return f; } @@ -279,7 +288,7 @@ void Dir::setTimeCallback(time_t (*cb)(void)) { if (!_impl) return; _impl->setTimeCallback(cb); - timeCallback = cb; + _timeCallback = cb; } @@ -296,7 +305,7 @@ bool FS::begin() { DEBUGV("#error: FS: no implementation"); return false; } - _impl->setTimeCallback(timeCallback); + _impl->setTimeCallback(_timeCallback); bool ret = _impl->begin(); DEBUGV("%s\n", ret? "": "#error: FS could not start"); return ret; @@ -359,7 +368,7 @@ File FS::open(const char* path, const char* mode) { return File(); } File f(_impl->open(path, om, am), this); - f.setTimeCallback(timeCallback); + f.setTimeCallback(_timeCallback); return f; } @@ -380,7 +389,7 @@ Dir FS::openDir(const char* path) { } DirImplPtr p = _impl->openDir(path); Dir d(p, this); - d.setTimeCallback(timeCallback); + d.setTimeCallback(_timeCallback); return d; } @@ -436,6 +445,7 @@ void FS::setTimeCallback(time_t (*cb)(void)) { if (!_impl) return; _impl->setTimeCallback(cb); + _timeCallback = cb; } diff --git a/cores/esp8266/FS.h b/cores/esp8266/FS.h index 93ef68ed5..99c71cdce 100644 --- a/cores/esp8266/FS.h +++ b/cores/esp8266/FS.h @@ -57,6 +57,7 @@ public: // Print methods: size_t write(uint8_t) override; size_t write(const uint8_t *buf, size_t size) override; + int availableForWrite() override; // Stream methods: int available() override; @@ -117,6 +118,7 @@ public: protected: FileImplPtr _p; + time_t (*_timeCallback)(void) = nullptr; // Arduino SD class emulation std::shared_ptr _fakeDir; @@ -144,7 +146,7 @@ public: protected: DirImplPtr _impl; FS *_baseFS; - time_t (*timeCallback)(void) = nullptr; + time_t (*_timeCallback)(void) = nullptr; }; // Backwards compatible, <4GB filesystem usage @@ -197,7 +199,7 @@ public: class FS { public: - FS(FSImplPtr impl) : _impl(impl) { timeCallback = _defaultTimeCB; } + FS(FSImplPtr impl) : _impl(impl) { _timeCallback = _defaultTimeCB; } bool setConfig(const FSConfig &cfg); @@ -239,7 +241,7 @@ public: protected: FSImplPtr _impl; FSImplPtr getImpl() { return _impl; } - time_t (*timeCallback)(void); + time_t (*_timeCallback)(void) = nullptr; static time_t _defaultTimeCB(void) { return time(NULL); } }; diff --git a/cores/esp8266/FSImpl.h b/cores/esp8266/FSImpl.h index 1a3566f2c..801a8d9c0 100644 --- a/cores/esp8266/FSImpl.h +++ b/cores/esp8266/FSImpl.h @@ -35,6 +35,7 @@ public: virtual bool seek(uint32_t pos, SeekMode mode) = 0; virtual size_t position() const = 0; virtual size_t size() const = 0; + virtual int availableForWrite() { return 0; } virtual bool truncate(uint32_t size) = 0; virtual void close() = 0; virtual const char* name() const = 0; @@ -44,8 +45,8 @@ public: // Filesystems *may* support a timestamp per-file, so allow the user to override with // their own callback for *this specific* file (as opposed to the FSImpl call of the - // same name. The default implementation simply returns time(&null) - virtual void setTimeCallback(time_t (*cb)(void)) { timeCallback = cb; } + // same name. The default implementation simply returns time(null) + virtual void setTimeCallback(time_t (*cb)(void)) { _timeCallback = cb; } // Return the last written time for a file. Undefined when called on a writable file // as the FS is allowed to return either the time of the last write() operation or the @@ -55,7 +56,7 @@ public: virtual time_t getCreationTime() { return 0; } // Default is to not support timestamps protected: - time_t (*timeCallback)(void) = nullptr; + time_t (*_timeCallback)(void) = nullptr; }; enum OpenMode { @@ -89,11 +90,11 @@ public: // Filesystems *may* support a timestamp per-file, so allow the user to override with // their own callback for *this specific* file (as opposed to the FSImpl call of the - // same name. The default implementation simply returns time(&null) - virtual void setTimeCallback(time_t (*cb)(void)) { timeCallback = cb; } + // same name. The default implementation simply returns time(null) + virtual void setTimeCallback(time_t (*cb)(void)) { _timeCallback = cb; } protected: - time_t (*timeCallback)(void) = nullptr; + time_t (*_timeCallback)(void) = nullptr; }; class FSImpl { @@ -117,11 +118,11 @@ public: // Filesystems *may* support a timestamp per-file, so allow the user to override with // their own callback for all files on this FS. The default implementation simply - // returns the present time as reported by time(&null) - virtual void setTimeCallback(time_t (*cb)(void)) { timeCallback = cb; } + // returns the present time as reported by time(null) + virtual void setTimeCallback(time_t (*cb)(void)) { _timeCallback = cb; } protected: - time_t (*timeCallback)(void) = nullptr; + time_t (*_timeCallback)(void) = nullptr; }; } // namespace fs diff --git a/cores/esp8266/HardwareSerial.h b/cores/esp8266/HardwareSerial.h index 6b89f6800..940bde173 100644 --- a/cores/esp8266/HardwareSerial.h +++ b/cores/esp8266/HardwareSerial.h @@ -150,7 +150,7 @@ public: { return readBytes((char*)buffer, size); } - int availableForWrite(void) + int availableForWrite(void) override { return static_cast(uart_tx_free(_uart)); } diff --git a/cores/esp8266/LwipDhcpServer-NonOS.cpp b/cores/esp8266/LwipDhcpServer-NonOS.cpp new file mode 100644 index 000000000..0a0f0b77b --- /dev/null +++ b/cores/esp8266/LwipDhcpServer-NonOS.cpp @@ -0,0 +1,64 @@ +/* + lwIPDhcpServer-NonOS.cpp - DHCP server wrapper + + Copyright (c) 2020 esp8266 arduino. 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 +*/ + +// STARTS/STOPS DHCP SERVER ON WIFI AP INTERFACE +// these functions must exists as-is with "C" interface, +// nonos-sdk calls them at boot time and later + +#include // LWIP_VERSION + +#include +#include "LwipDhcpServer.h" + +extern netif netif_git[2]; + +// global DHCP instance for softAP interface +DhcpServer dhcpSoftAP(&netif_git[SOFTAP_IF]); + +extern "C" +{ + + void dhcps_start(struct ip_info *info, netif* apnetif) + { + // apnetif is esp interface, replaced by lwip2's + // netif_git[SOFTAP_IF] interface in constructor + (void)apnetif; + +#if 0 + // can't use C++ now, global ctors are not initialized yet + dhcpSoftAP.begin(info); +#else + (void)info; + // initial version: emulate nonos-sdk in DhcpServer class before + // trying to change legacy behavor + // `fw_has_started_softap_dhcps` will be read in DhcpServer::DhcpServer + // which is called when c++ ctors are initialized, specifically + // dhcpSoftAP intialized with AP interface number above. + fw_has_started_softap_dhcps = 1; +#endif + } + + void dhcps_stop() + { + dhcpSoftAP.end(); + } + +} // extern "C" diff --git a/cores/esp8266/LwipDhcpServer.cpp b/cores/esp8266/LwipDhcpServer.cpp new file mode 100644 index 000000000..2fa0b12d8 --- /dev/null +++ b/cores/esp8266/LwipDhcpServer.cpp @@ -0,0 +1,1613 @@ +/* + lwIPDhcpServer.c - DHCP server + + Copyright (c) 2016 Espressif. All rights reserved. + Copyright (c) 2020 esp8266 arduino. 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 + + // original sources (no license provided) + // ESP8266_NONOS_SDK/third_party/lwip/app/dhcpserver.c + // ESP8266_NONOS_SDK/third_party/include/lwip/app/dhcpserver.h +*/ + +// lwIPDhcpServer.{cc,h} encapsulate original nonos-sdk dhcp server +// nearly as-is. This is an initial version to guaranty legacy behavior +// with same default values. + +// vv this comment is supposed to be removed after the first commit +// Logic and coding style in this file can be wrong but left to the closest +// of the initial version for easier issue tracking. +// (better is enemy of [good = already working]) +// ^^ this comment is supposed to be removed after the first commit + +#include // LWIP_VERSION + +#define DHCPS_LEASE_TIME_DEF (120) + +#define USE_DNS + +#include "lwip/inet.h" +#include "lwip/err.h" +#include "lwip/pbuf.h" +#include "lwip/udp.h" +#include "lwip/mem.h" +#include "osapi.h" + +#include "LwipDhcpServer.h" + +#include "user_interface.h" +#include "mem.h" + +typedef struct dhcps_state +{ + sint16_t state; +} dhcps_state; + +typedef struct dhcps_msg +{ + uint8_t op, htype, hlen, hops; + uint8_t xid[4]; + uint16_t secs, flags; + uint8_t ciaddr[4]; + uint8_t yiaddr[4]; + uint8_t siaddr[4]; + uint8_t giaddr[4]; + uint8_t chaddr[16]; + uint8_t sname[64]; + uint8_t file[128]; + uint8_t options[312]; +} dhcps_msg; + +#ifndef LWIP_OPEN_SRC +struct dhcps_lease +{ + bool enable; + struct ipv4_addr start_ip; + struct ipv4_addr end_ip; +}; + +enum dhcps_offer_option +{ + OFFER_START = 0x00, + OFFER_ROUTER = 0x01, + OFFER_END +}; +#endif + +typedef enum +{ + DHCPS_TYPE_DYNAMIC, + DHCPS_TYPE_STATIC +} dhcps_type_t; + +typedef enum +{ + DHCPS_STATE_ONLINE, + DHCPS_STATE_OFFLINE +} dhcps_state_t; + +struct dhcps_pool +{ + struct ipv4_addr ip; + uint8 mac[6]; + uint32 lease_timer; + dhcps_type_t type; + dhcps_state_t state; + +}; + +#define DHCPS_LEASE_TIMER dhcps_lease_time //0x05A0 +#define DHCPS_MAX_LEASE 0x64 +#define BOOTP_BROADCAST 0x8000 + +#define DHCP_REQUEST 1 +#define DHCP_REPLY 2 +#define DHCP_HTYPE_ETHERNET 1 +#define DHCP_HLEN_ETHERNET 6 +#define DHCP_MSG_LEN 236 + +#define DHCPS_SERVER_PORT 67 +#define DHCPS_CLIENT_PORT 68 + +#define DHCPDISCOVER 1 +#define DHCPOFFER 2 +#define DHCPREQUEST 3 +#define DHCPDECLINE 4 +#define DHCPACK 5 +#define DHCPNAK 6 +#define DHCPRELEASE 7 + +#define DHCP_OPTION_SUBNET_MASK 1 +#define DHCP_OPTION_ROUTER 3 +#define DHCP_OPTION_DNS_SERVER 6 +#define DHCP_OPTION_REQ_IPADDR 50 +#define DHCP_OPTION_LEASE_TIME 51 +#define DHCP_OPTION_MSG_TYPE 53 +#define DHCP_OPTION_SERVER_ID 54 +#define DHCP_OPTION_INTERFACE_MTU 26 +#define DHCP_OPTION_PERFORM_ROUTER_DISCOVERY 31 +#define DHCP_OPTION_BROADCAST_ADDRESS 28 +#define DHCP_OPTION_REQ_LIST 55 +#define DHCP_OPTION_END 255 + +//#define USE_CLASS_B_NET 1 +#define DHCPS_DEBUG 0 +#define MAX_STATION_NUM 8 + +#define DHCPS_STATE_OFFER 1 +#define DHCPS_STATE_DECLINE 2 +#define DHCPS_STATE_ACK 3 +#define DHCPS_STATE_NAK 4 +#define DHCPS_STATE_IDLE 5 +#define DHCPS_STATE_RELEASE 6 + +#define dhcps_router_enabled(offer) ((offer & OFFER_ROUTER) != 0) + +#ifdef MEMLEAK_DEBUG +const char mem_debug_file[] ICACHE_RODATA_ATTR = __FILE__; +#endif + +#if DHCPS_DEBUG +#define LWIP_IS_OK(what,err) ({ int ret = 1, errval = (err); if (errval != ERR_OK) { os_printf("DHCPS ERROR: %s (lwip:%d)\n", what, errval); ret = 0; } ret; }) +#else +#define LWIP_IS_OK(what,err) ((err) == ERR_OK) +#endif + +const uint32 DhcpServer::magic_cookie = 0x63538263; // https://tools.ietf.org/html/rfc1497 + +int fw_has_started_softap_dhcps = 0; + +//////////////////////////////////////////////////////////////////////////////////// + +DhcpServer::DhcpServer(netif* netif): _netif(netif) +{ + pcb_dhcps = nullptr; + dns_address.addr = 0; + plist = nullptr; + offer = 0xFF; + renew = false; + dhcps_lease_time = DHCPS_LEASE_TIME_DEF; //minute + + if (netif->num == SOFTAP_IF && fw_has_started_softap_dhcps == 1) + { + // When nonos-sdk starts DHCPS at boot: + // 1. `fw_has_started_softap_dhcps` is already initialized to 1 + // 2. global ctor DhcpServer's `dhcpSoftAP(&netif_git[SOFTAP_IF])` is called + // 3. (that's here) => begin(legacy-values) is called + ip_info ip = + { + { 0x0104a8c0 }, // IP 192.168.4.1 + { 0x00ffffff }, // netmask 255.255.255.0 + { 0 } // gateway 0.0.0.0 + }; + begin(&ip); + fw_has_started_softap_dhcps = 2; // not 1, ending intial boot sequence + } +}; + +// wifi_softap_set_station_info is missing in user_interface.h: +extern "C" void wifi_softap_set_station_info(uint8_t* mac, struct ipv4_addr*); + +void DhcpServer::dhcps_set_dns(int num, const ipv4_addr_t* dns) +{ + (void)num; + if (!ip4_addr_isany(dns)) + { + ip4_addr_copy(dns_address, *dns); + } +} + +/****************************************************************************** + FunctionName : node_insert_to_list + Description : insert the node to the list + Parameters : arg -- Additional argument to pass to the callback function + Returns : none +*******************************************************************************/ +void DhcpServer::node_insert_to_list(list_node **phead, list_node* pinsert) +{ + list_node *plist = nullptr; + struct dhcps_pool *pdhcps_pool = nullptr; + struct dhcps_pool *pdhcps_node = nullptr; + if (*phead == nullptr) + { + *phead = pinsert; + } + else + { + plist = *phead; + pdhcps_node = (struct dhcps_pool*)pinsert->pnode; + pdhcps_pool = (struct dhcps_pool*)plist->pnode; + + if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr) + { + pinsert->pnext = plist; + *phead = pinsert; + } + else + { + while (plist->pnext != nullptr) + { + pdhcps_pool = (struct dhcps_pool*)plist->pnext->pnode; + if (pdhcps_node->ip.addr < pdhcps_pool->ip.addr) + { + pinsert->pnext = plist->pnext; + plist->pnext = pinsert; + break; + } + plist = plist->pnext; + } + + if (plist->pnext == nullptr) + { + plist->pnext = pinsert; + } + } + } + // pinsert->pnext = nullptr; +} + +/****************************************************************************** + FunctionName : node_delete_from_list + Description : remove the node from list + Parameters : arg -- Additional argument to pass to the callback function + Returns : none +*******************************************************************************/ +void DhcpServer::node_remove_from_list(list_node **phead, list_node* pdelete) +{ + list_node *plist = nullptr; + + plist = *phead; + if (plist == nullptr) + { + *phead = nullptr; + } + else + { + if (plist == pdelete) + { + *phead = plist->pnext; + pdelete->pnext = nullptr; + } + else + { + while (plist != nullptr) + { + if (plist->pnext == pdelete) + { + plist->pnext = pdelete->pnext; + pdelete->pnext = nullptr; + } + plist = plist->pnext; + } + } + } +} + +/****************************************************************************** + FunctionName : add_dhcps_lease + Description : add static lease on the list, this will be the next available @ + Parameters : mac address + Returns : true if ok and false if this mac already exist or if all ip are already reserved +*******************************************************************************/ +bool DhcpServer::add_dhcps_lease(uint8 *macaddr) +{ + struct dhcps_pool *pdhcps_pool = nullptr; + list_node *pback_node = nullptr; + + uint32 start_ip = dhcps_lease.start_ip.addr; + uint32 end_ip = dhcps_lease.end_ip.addr; + + for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext) + { + pdhcps_pool = (dhcps_pool*)pback_node->pnode; + if (memcmp(pdhcps_pool->mac, macaddr, sizeof(pdhcps_pool->mac)) == 0) + { +#if DHCPS_DEBUG + os_printf("this mac already exist"); +#endif + return false; + } + else + { + start_ip = htonl((ntohl(start_ip) + 1)); + } + } + + if (start_ip > end_ip) + { +#if DHCPS_DEBUG + os_printf("no more ip available"); +#endif + return false; + } + + pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool)); + pdhcps_pool->ip.addr = start_ip; + memcpy(pdhcps_pool->mac, macaddr, sizeof(pdhcps_pool->mac)); + pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER; + pdhcps_pool->type = DHCPS_TYPE_STATIC; + pdhcps_pool->state = DHCPS_STATE_ONLINE; + pback_node = (list_node *)zalloc(sizeof(list_node)); + pback_node->pnode = pdhcps_pool; + pback_node->pnext = nullptr; + node_insert_to_list(&plist, pback_node); + + return true; +} + +/////////////////////////////////////////////////////////////////////////////////// +/* + DHCP msg + + @param optptr -- DHCP msg + @param type -- option + + @return uint8_t* DHCP msg +*/ +/////////////////////////////////////////////////////////////////////////////////// +uint8_t* DhcpServer::add_msg_type(uint8_t *optptr, uint8_t type) +{ + + *optptr++ = DHCP_OPTION_MSG_TYPE; + *optptr++ = 1; + *optptr++ = type; + return optptr; +} +/////////////////////////////////////////////////////////////////////////////////// +/* + DHCP msg offer + + @param optptr -- DHCP msg + + @return uint8_t* DHCP msg +*/ +/////////////////////////////////////////////////////////////////////////////////// +uint8_t* DhcpServer::add_offer_options(uint8_t *optptr) +{ + //struct ipv4_addr ipadd; + //ipadd.addr = server_address.addr; +#define ipadd (_netif->ip_addr) + + //struct ip_info if_ip; + //bzero(&if_ip, sizeof(struct ip_info)); + //wifi_get_ip_info(SOFTAP_IF, &if_ip); +#define if_ip (*_netif) + + *optptr++ = DHCP_OPTION_SUBNET_MASK; + *optptr++ = 4; + *optptr++ = ip4_addr1(ip_2_ip4(&if_ip.netmask)); + *optptr++ = ip4_addr2(ip_2_ip4(&if_ip.netmask)); + *optptr++ = ip4_addr3(ip_2_ip4(&if_ip.netmask)); + *optptr++ = ip4_addr4(ip_2_ip4(&if_ip.netmask)); + + *optptr++ = DHCP_OPTION_LEASE_TIME; + *optptr++ = 4; + *optptr++ = ((DHCPS_LEASE_TIMER * 60) >> 24) & 0xFF; + *optptr++ = ((DHCPS_LEASE_TIMER * 60) >> 16) & 0xFF; + *optptr++ = ((DHCPS_LEASE_TIMER * 60) >> 8) & 0xFF; + *optptr++ = ((DHCPS_LEASE_TIMER * 60) >> 0) & 0xFF; + + *optptr++ = DHCP_OPTION_SERVER_ID; + *optptr++ = 4; + *optptr++ = ip4_addr1(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr2(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr3(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr4(ip_2_ip4(&ipadd)); + + if (dhcps_router_enabled(offer) && ip_2_ip4(&if_ip.gw)->addr) + { + *optptr++ = DHCP_OPTION_ROUTER; + *optptr++ = 4; + *optptr++ = ip4_addr1(ip_2_ip4(&if_ip.gw)); + *optptr++ = ip4_addr2(ip_2_ip4(&if_ip.gw)); + *optptr++ = ip4_addr3(ip_2_ip4(&if_ip.gw)); + *optptr++ = ip4_addr4(ip_2_ip4(&if_ip.gw)); + } + +#ifdef USE_DNS + *optptr++ = DHCP_OPTION_DNS_SERVER; + *optptr++ = 4; + if (dns_address.addr == 0) + { + *optptr++ = ip4_addr1(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr2(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr3(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr4(ip_2_ip4(&ipadd)); + } + else + { + *optptr++ = ip4_addr1(&dns_address); + *optptr++ = ip4_addr2(&dns_address); + *optptr++ = ip4_addr3(&dns_address); + *optptr++ = ip4_addr4(&dns_address); + } +#endif + + *optptr++ = DHCP_OPTION_BROADCAST_ADDRESS; + *optptr++ = 4; + // XXXFIXME do better than that, we have netmask + *optptr++ = ip4_addr1(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr2(ip_2_ip4(&ipadd)); + *optptr++ = ip4_addr3(ip_2_ip4(&ipadd)); + *optptr++ = 255; + + *optptr++ = DHCP_OPTION_INTERFACE_MTU; + *optptr++ = 2; + *optptr++ = 0x05; + *optptr++ = 0xdc; // 1500 + + *optptr++ = DHCP_OPTION_PERFORM_ROUTER_DISCOVERY; + *optptr++ = 1; + *optptr++ = 0x00; + +#if 0 // vendor specific unititialized (??) + *optptr++ = 43; // vendor specific + *optptr++ = 6; + // unitialized ? +#endif + +#if 0 // already set (DHCP_OPTION_SUBNET_MASK==1) (??) + *optptr++ = 0x01; + *optptr++ = 4; + *optptr++ = 0; + *optptr++ = 0; + *optptr++ = 0; + *optptr++ = 2; +#endif + + return optptr; + +#undef ipadd +#undef if_ip +} +/////////////////////////////////////////////////////////////////////////////////// +/* + DHCP msg + + @param optptr -- DHCP msg + + @return uint8_t* DHCP msg +*/ +/////////////////////////////////////////////////////////////////////////////////// +uint8_t* DhcpServer::add_end(uint8_t *optptr) +{ + + *optptr++ = DHCP_OPTION_END; + return optptr; +} +/////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////// +void DhcpServer::create_msg(struct dhcps_msg *m) +{ + struct ipv4_addr client; + + client.addr = client_address.addr; + + m->op = DHCP_REPLY; + m->htype = DHCP_HTYPE_ETHERNET; + m->hlen = 6; + m->hops = 0; + m->secs = 0; + m->flags = htons(BOOTP_BROADCAST); + + memcpy((char *) m->yiaddr, (char *) &client.addr, sizeof(m->yiaddr)); + memset((char *) m->ciaddr, 0, sizeof(m->ciaddr)); + memset((char *) m->siaddr, 0, sizeof(m->siaddr)); + memset((char *) m->giaddr, 0, sizeof(m->giaddr)); + memset((char *) m->sname, 0, sizeof(m->sname)); + memset((char *) m->file, 0, sizeof(m->file)); + memset((char *) m->options, 0, sizeof(m->options)); + memcpy((char *) m->options, &magic_cookie, sizeof(magic_cookie)); +} +/////////////////////////////////////////////////////////////////////////////////// +/* + OFFER + + @param -- m DHCP msg +*/ +/////////////////////////////////////////////////////////////////////////////////// +void DhcpServer::send_offer(struct dhcps_msg *m) +{ + uint8_t *end; + struct pbuf *p, *q; + u8_t *data; + u16_t cnt = 0; + u16_t i; + create_msg(m); + + end = add_msg_type(&m->options[4], DHCPOFFER); + end = add_offer_options(end); + end = add_end(end); + + p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM); +#if DHCPS_DEBUG + os_printf("udhcp: send_offer>>p->ref = %d\n", p->ref); +#endif + if (p != nullptr) + { + +#if DHCPS_DEBUG + os_printf("dhcps: send_offer>>pbuf_alloc succeed\n"); + os_printf("dhcps: send_offer>>p->tot_len = %d\n", p->tot_len); + os_printf("dhcps: send_offer>>p->len = %d\n", p->len); +#endif + q = p; + while (q != nullptr) + { + data = (u8_t *)q->payload; + for (i = 0; i < q->len; i++) + { + data[i] = ((u8_t *) m)[cnt++]; + } + + q = q->next; + } + } + else + { + +#if DHCPS_DEBUG + os_printf("dhcps: send_offer>>pbuf_alloc failed\n"); +#endif + return; + } + if (!LWIP_IS_OK("send_offer", udp_sendto(pcb_dhcps, p, &broadcast_dhcps, DHCPS_CLIENT_PORT))) + { +#if DHCPS_DEBUG + os_printf("dhcps: send_offer>>udp_sendto\n"); +#endif + } + if (p->ref != 0) + { +#if DHCPS_DEBUG + os_printf("udhcp: send_offer>>free pbuf\n"); +#endif + pbuf_free(p); + } +} +/////////////////////////////////////////////////////////////////////////////////// +/* + NAK + + @param m DHCP msg +*/ +/////////////////////////////////////////////////////////////////////////////////// +void DhcpServer::send_nak(struct dhcps_msg *m) +{ + + u8_t *end; + struct pbuf *p, *q; + u8_t *data; + u16_t cnt = 0; + u16_t i; + create_msg(m); + + end = add_msg_type(&m->options[4], DHCPNAK); + end = add_end(end); + + p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM); +#if DHCPS_DEBUG + os_printf("udhcp: send_nak>>p->ref = %d\n", p->ref); +#endif + if (p != nullptr) + { + +#if DHCPS_DEBUG + os_printf("dhcps: send_nak>>pbuf_alloc succeed\n"); + os_printf("dhcps: send_nak>>p->tot_len = %d\n", p->tot_len); + os_printf("dhcps: send_nak>>p->len = %d\n", p->len); +#endif + q = p; + while (q != nullptr) + { + data = (u8_t *)q->payload; + for (i = 0; i < q->len; i++) + { + data[i] = ((u8_t *) m)[cnt++]; + } + + q = q->next; + } + } + else + { + +#if DHCPS_DEBUG + os_printf("dhcps: send_nak>>pbuf_alloc failed\n"); +#endif + return; + } + LWIP_IS_OK("dhcps send nak", udp_sendto(pcb_dhcps, p, &broadcast_dhcps, DHCPS_CLIENT_PORT)); + if (p->ref != 0) + { +#if DHCPS_DEBUG + os_printf("udhcp: send_nak>>free pbuf\n"); +#endif + pbuf_free(p); + } +} +/////////////////////////////////////////////////////////////////////////////////// +/* + ACK DHCP + + @param m DHCP msg +*/ +/////////////////////////////////////////////////////////////////////////////////// +void DhcpServer::send_ack(struct dhcps_msg *m) +{ + + u8_t *end; + struct pbuf *p, *q; + u8_t *data; + u16_t cnt = 0; + u16_t i; + create_msg(m); + + end = add_msg_type(&m->options[4], DHCPACK); + end = add_offer_options(end); + end = add_end(end); + + p = pbuf_alloc(PBUF_TRANSPORT, sizeof(struct dhcps_msg), PBUF_RAM); +#if DHCPS_DEBUG + os_printf("udhcp: send_ack>>p->ref = %d\n", p->ref); +#endif + if (p != nullptr) + { + +#if DHCPS_DEBUG + os_printf("dhcps: send_ack>>pbuf_alloc succeed\n"); + os_printf("dhcps: send_ack>>p->tot_len = %d\n", p->tot_len); + os_printf("dhcps: send_ack>>p->len = %d\n", p->len); +#endif + q = p; + while (q != nullptr) + { + data = (u8_t *)q->payload; + for (i = 0; i < q->len; i++) + { + data[i] = ((u8_t *) m)[cnt++]; + } + + q = q->next; + } + } + else + { + +#if DHCPS_DEBUG + os_printf("dhcps: send_ack>>pbuf_alloc failed\n"); +#endif + return; + } + if (!LWIP_IS_OK("dhcps send ack", udp_sendto(pcb_dhcps, p, &broadcast_dhcps, DHCPS_CLIENT_PORT))) + { +#if DHCPS_DEBUG + os_printf("dhcps: send_ack>>udp_sendto\n"); +#endif + } + + if (p->ref != 0) + { +#if DHCPS_DEBUG + os_printf("udhcp: send_ack>>free pbuf\n"); +#endif + pbuf_free(p); + } +} +/////////////////////////////////////////////////////////////////////////////////// +/* + DHCP + + @param optptr DHCP msg е + @param len + + @return uint8_t* DHCP Server +*/ +/////////////////////////////////////////////////////////////////////////////////// +uint8_t DhcpServer::parse_options(uint8_t *optptr, sint16_t len) +{ + struct ipv4_addr client; + bool is_dhcp_parse_end = false; + struct dhcps_state s; + + client.addr = client_address.addr; + + u8_t *end = optptr + len; + u16_t type = 0; + + s.state = DHCPS_STATE_IDLE; + + while (optptr < end) + { +#if DHCPS_DEBUG + os_printf("dhcps: (sint16_t)*optptr = %d\n", (sint16_t)*optptr); +#endif + switch ((sint16_t) *optptr) + { + + case DHCP_OPTION_MSG_TYPE: //53 + type = *(optptr + 2); + break; + + case DHCP_OPTION_REQ_IPADDR://50 + //os_printf("dhcps:0x%08x,0x%08x\n",client.addr,*(uint32*)(optptr+2)); + if (memcmp((char *) &client.addr, (char *) optptr + 2, 4) == 0) + { +#if DHCPS_DEBUG + os_printf("dhcps: DHCP_OPTION_REQ_IPADDR = 0 ok\n"); +#endif + s.state = DHCPS_STATE_ACK; + } + else + { +#if DHCPS_DEBUG + os_printf("dhcps: DHCP_OPTION_REQ_IPADDR != 0 err\n"); +#endif + s.state = DHCPS_STATE_NAK; + } + break; + case DHCP_OPTION_END: + { + is_dhcp_parse_end = true; + } + break; + } + + if (is_dhcp_parse_end) + { + break; + } + + optptr += optptr[1] + 2; + } + + switch (type) + { + case DHCPDISCOVER://1 + s.state = DHCPS_STATE_OFFER; +#if DHCPS_DEBUG + os_printf("dhcps: DHCPD_STATE_OFFER\n"); +#endif + break; + + case DHCPREQUEST://3 + if (!(s.state == DHCPS_STATE_ACK || s.state == DHCPS_STATE_NAK)) + { + if (renew == true) + { + s.state = DHCPS_STATE_ACK; + } + else + { + s.state = DHCPS_STATE_NAK; + } +#if DHCPS_DEBUG + os_printf("dhcps: DHCPD_STATE_NAK\n"); +#endif + } + break; + + case DHCPDECLINE://4 + s.state = DHCPS_STATE_IDLE; +#if DHCPS_DEBUG + os_printf("dhcps: DHCPD_STATE_IDLE\n"); +#endif + break; + + case DHCPRELEASE://7 + s.state = DHCPS_STATE_RELEASE; +#if DHCPS_DEBUG + os_printf("dhcps: DHCPD_STATE_IDLE\n"); +#endif + break; + } +#if DHCPS_DEBUG + os_printf("dhcps: return s.state = %d\n", s.state); +#endif + return s.state; +} +/////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////// +sint16_t DhcpServer::parse_msg(struct dhcps_msg *m, u16_t len) +{ + if (memcmp((char *)m->options, + &magic_cookie, + sizeof(magic_cookie)) == 0) + { + struct ipv4_addr ip; + memcpy(&ip.addr, m->ciaddr, sizeof(ip.addr)); + client_address.addr = dhcps_client_update(m->chaddr, &ip); + + sint16_t ret = parse_options(&m->options[4], len); + + if (ret == DHCPS_STATE_RELEASE) + { + dhcps_client_leave(m->chaddr, &ip, true); // force to delete + client_address.addr = ip.addr; + } + + return ret; + } + return 0; +} +/////////////////////////////////////////////////////////////////////////////////// +/* + DHCP + udp_recv() callback + + @param arg + @param pcb + @param p + @param addr + @param port +*/ +/////////////////////////////////////////////////////////////////////////////////// + +void DhcpServer::S_handle_dhcp(void *arg, + struct udp_pcb *pcb, + struct pbuf *p, + const ip_addr_t *addr, + uint16_t port) +{ + DhcpServer* instance = reinterpret_cast(arg); + instance->handle_dhcp(pcb, p, addr, port); +} + +void DhcpServer::handle_dhcp( + struct udp_pcb *pcb, + struct pbuf *p, + const ip_addr_t *addr, + uint16_t port) +{ + (void)pcb; + (void)addr; + (void)port; + + struct dhcps_msg *pmsg_dhcps = nullptr; + sint16_t tlen = 0; + u16_t i = 0; + u16_t dhcps_msg_cnt = 0; + u8_t *p_dhcps_msg = nullptr; + u8_t *data = nullptr; + +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> receive a packet\n"); +#endif + if (p == nullptr) + { + return; + } + + pmsg_dhcps = (struct dhcps_msg *)zalloc(sizeof(struct dhcps_msg)); + if (nullptr == pmsg_dhcps) + { + pbuf_free(p); + return; + } + p_dhcps_msg = (u8_t *)pmsg_dhcps; + tlen = p->tot_len; + data = (u8_t*)p->payload; + +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> p->tot_len = %d\n", tlen); + os_printf("dhcps: handle_dhcp-> p->len = %d\n", p->len); +#endif + + for (i = 0; i < p->len; i++) + { + p_dhcps_msg[dhcps_msg_cnt++] = data[i]; + } + + if (p->next != nullptr) + { +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> p->next != nullptr\n"); + os_printf("dhcps: handle_dhcp-> p->next->tot_len = %d\n", p->next->tot_len); + os_printf("dhcps: handle_dhcp-> p->next->len = %d\n", p->next->len); +#endif + + data = (u8_t*)p->next->payload; + for (i = 0; i < p->next->len; i++) + { + p_dhcps_msg[dhcps_msg_cnt++] = data[i]; + } + } + +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> parse_msg(p)\n"); +#endif + + switch (parse_msg(pmsg_dhcps, tlen - 240)) + { + + case DHCPS_STATE_OFFER://1 +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> DHCPD_STATE_OFFER\n"); +#endif + send_offer(pmsg_dhcps); + break; + case DHCPS_STATE_ACK://3 +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> DHCPD_STATE_ACK\n"); +#endif + send_ack(pmsg_dhcps); + if (_netif->num == SOFTAP_IF) + { + wifi_softap_set_station_info(pmsg_dhcps->chaddr, &client_address); + } + break; + case DHCPS_STATE_NAK://4 +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> DHCPD_STATE_NAK\n"); +#endif + send_nak(pmsg_dhcps); + break; + default : + break; + } +#if DHCPS_DEBUG + os_printf("dhcps: handle_dhcp-> pbuf_free(p)\n"); +#endif + pbuf_free(p); + free(pmsg_dhcps); + pmsg_dhcps = nullptr; +} +/////////////////////////////////////////////////////////////////////////////////// +void DhcpServer::init_dhcps_lease(uint32 ip) +{ + uint32 softap_ip = 0, local_ip = 0; + uint32 start_ip = 0; + uint32 end_ip = 0; + if (dhcps_lease.enable == true) + { + softap_ip = htonl(ip); + start_ip = htonl(dhcps_lease.start_ip.addr); + end_ip = htonl(dhcps_lease.end_ip.addr); + /*config ip information can't contain local ip*/ + if ((start_ip <= softap_ip) && (softap_ip <= end_ip)) + { + dhcps_lease.enable = false; + } + else + { + /*config ip information must be in the same segment as the local ip*/ + softap_ip >>= 8; + if (((start_ip >> 8 != softap_ip) || (end_ip >> 8 != softap_ip)) + || (end_ip - start_ip > DHCPS_MAX_LEASE)) + { + dhcps_lease.enable = false; + } + } + } + + if (dhcps_lease.enable == false) + { + local_ip = softap_ip = htonl(ip); + softap_ip &= 0xFFFFFF00; + local_ip &= 0xFF; + if (local_ip >= 0x80) + { + local_ip -= DHCPS_MAX_LEASE; + } + else + { + local_ip ++; + } + + bzero(&dhcps_lease, sizeof(dhcps_lease)); + dhcps_lease.start_ip.addr = softap_ip | local_ip; + dhcps_lease.end_ip.addr = softap_ip | (local_ip + DHCPS_MAX_LEASE - 1); + dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr); + dhcps_lease.end_ip.addr = htonl(dhcps_lease.end_ip.addr); + } + // dhcps_lease.start_ip.addr = htonl(dhcps_lease.start_ip.addr); + // dhcps_lease.end_ip.addr= htonl(dhcps_lease.end_ip.addr); + // os_printf("start_ip = 0x%x, end_ip = 0x%x\n",dhcps_lease.start_ip, dhcps_lease.end_ip); +} +/////////////////////////////////////////////////////////////////////////////////// + +bool DhcpServer::begin(struct ip_info *info) +{ + if (pcb_dhcps != nullptr) + { + udp_remove(pcb_dhcps); + } + + pcb_dhcps = udp_new(); + if (pcb_dhcps == nullptr || info == nullptr) + { + os_printf("dhcps_start(): could not obtain pcb\n"); + return false; + } + + // wrong: answer will go to sta IP4_ADDR(&broadcast_dhcps, 255, 255, 255, 255); + // good: going to ap IP4_ADDR(&broadcast_dhcps, 192, 168, 4, 255); + // semi proper way: + broadcast_dhcps = _netif->ip_addr; + ip_2_ip4(&broadcast_dhcps)->addr &= ip_2_ip4(&_netif->netmask)->addr; + ip_2_ip4(&broadcast_dhcps)->addr |= ~ip_2_ip4(&_netif->netmask)->addr; + //XXXFIXMEIPV6 broadcast address? + + server_address = info->ip; + init_dhcps_lease(server_address.addr); + + udp_bind(pcb_dhcps, IP_ADDR_ANY, DHCPS_SERVER_PORT); + udp_recv(pcb_dhcps, S_handle_dhcp, this); +#if DHCPS_DEBUG + os_printf("dhcps:dhcps_start->udp_recv function Set a receive callback handle_dhcp for UDP_PCB pcb_dhcps\n"); +#endif + + if (_netif->num == SOFTAP_IF) + { + wifi_set_ip_info(SOFTAP_IF, info); // added for lwip-git, not sure whether useful + } + _netif->flags |= NETIF_FLAG_UP | NETIF_FLAG_LINK_UP; // added for lwip-git + + return true; +} + +DhcpServer::~DhcpServer() +{ + end(); +} + +void DhcpServer::end() +{ + if (!pcb_dhcps) + { + return; + } + + udp_disconnect(pcb_dhcps); + udp_remove(pcb_dhcps); + pcb_dhcps = nullptr; + + //udp_remove(pcb_dhcps); + list_node *pnode = nullptr; + list_node *pback_node = nullptr; + struct dhcps_pool* dhcp_node = nullptr; + struct ipv4_addr ip_zero; + + memset(&ip_zero, 0x0, sizeof(ip_zero)); + pnode = plist; + while (pnode != nullptr) + { + pback_node = pnode; + pnode = pback_node->pnext; + node_remove_from_list(&plist, pback_node); + dhcp_node = (struct dhcps_pool*)pback_node->pnode; + //dhcps_client_leave(dhcp_node->mac,&dhcp_node->ip,true); // force to delete + if (_netif->num == SOFTAP_IF) + { + wifi_softap_set_station_info(dhcp_node->mac, &ip_zero); + } + free(pback_node->pnode); + pback_node->pnode = nullptr; + free(pback_node); + pback_node = nullptr; + } +} + +bool DhcpServer::isRunning() +{ + return !!_netif->state; +} + + +/****************************************************************************** + FunctionName : set_dhcps_lease + Description : set the lease information of DHCP server + Parameters : please -- Additional argument to set the lease information, + Little-Endian. + Returns : true or false +*******************************************************************************/ +bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please) +{ + uint32 softap_ip = 0; + uint32 start_ip = 0; + uint32 end_ip = 0; + + if (_netif->num == SOFTAP_IF || _netif->num == STATION_IF) + { + uint8 opmode = wifi_get_opmode(); + if (opmode == STATION_MODE || opmode == NULL_MODE) + { + return false; + } + } + + if (please == nullptr || isRunning()) + { + return false; + } + + if (please->enable) + { + // logic below is subject for improvement + // - is wrong + // - limited to /24 address plans +#if 1 + softap_ip = ip_2_ip4(&_netif->ip_addr)->addr; +#else + struct ip_info info; + bzero(&info, sizeof(struct ip_info)); + wifi_get_ip_info(SOFTAP_IF, &info); + softap_ip = htonl(info.ip.addr); + start_ip = htonl(please->start_ip.addr); + end_ip = htonl(please->end_ip.addr); +#endif + /*config ip information can't contain local ip*/ + if ((start_ip <= softap_ip) && (softap_ip <= end_ip)) + { + return false; + } + + /*config ip information must be in the same segment as the local ip*/ + softap_ip >>= 8; + if ((start_ip >> 8 != softap_ip) + || (end_ip >> 8 != softap_ip)) + { + return false; + } + + if (end_ip - start_ip > DHCPS_MAX_LEASE) + { + return false; + } + + bzero(&dhcps_lease, sizeof(dhcps_lease)); + // dhcps_lease.start_ip.addr = start_ip; + // dhcps_lease.end_ip.addr = end_ip; + dhcps_lease.start_ip.addr = please->start_ip.addr; + dhcps_lease.end_ip.addr = please->end_ip.addr; + } + dhcps_lease.enable = please->enable; + // dhcps_lease_flag = false; + return true; +} + +/****************************************************************************** + FunctionName : get_dhcps_lease + Description : get the lease information of DHCP server + Parameters : please -- Additional argument to get the lease information, + Little-Endian. + Returns : true or false +*******************************************************************************/ +bool DhcpServer::get_dhcps_lease(struct dhcps_lease *please) +{ + if (_netif->num == SOFTAP_IF) + { + uint8 opmode = wifi_get_opmode(); + if (opmode == STATION_MODE || opmode == NULL_MODE) + { + return false; + } + } + + if (nullptr == please) + { + return false; + } + + // if (dhcps_lease_flag){ + if (dhcps_lease.enable == false) + { + if (isRunning()) + { + return false; + } + } + else + { + // bzero(please, sizeof(dhcps_lease)); + // if (!isRunning()){ + // please->start_ip.addr = htonl(dhcps_lease.start_ip.addr); + // please->end_ip.addr = htonl(dhcps_lease.end_ip.addr); + // } + } + + // if (isRunning()){ + // bzero(please, sizeof(dhcps_lease)); + // please->start_ip.addr = dhcps_lease.start_ip.addr; + // please->end_ip.addr = dhcps_lease.end_ip.addr; + // } + please->start_ip.addr = dhcps_lease.start_ip.addr; + please->end_ip.addr = dhcps_lease.end_ip.addr; + return true; +} + +void DhcpServer::kill_oldest_dhcps_pool(void) +{ + list_node *pre = nullptr, *p = nullptr; + list_node *minpre = nullptr, *minp = nullptr; + struct dhcps_pool *pdhcps_pool = nullptr, *pmin_pool = nullptr; + pre = plist; + p = pre->pnext; + minpre = pre; + minp = p; + while (p != nullptr) + { + pdhcps_pool = (struct dhcps_pool*)p->pnode; + pmin_pool = (struct dhcps_pool*)minp->pnode; + if (pdhcps_pool->lease_timer < pmin_pool->lease_timer) + { + minp = p; + minpre = pre; + } + pre = p; + p = p->pnext; + } + minpre->pnext = minp->pnext; pdhcps_pool->state = DHCPS_STATE_OFFLINE; + free(minp->pnode); + minp->pnode = nullptr; + free(minp); + minp = nullptr; +} + +void DhcpServer::dhcps_coarse_tmr(void) +{ + uint8 num_dhcps_pool = 0; + list_node *pback_node = nullptr; + list_node *pnode = nullptr; + struct dhcps_pool *pdhcps_pool = nullptr; + pnode = plist; + while (pnode != nullptr) + { + pdhcps_pool = (struct dhcps_pool*)pnode->pnode; + if (pdhcps_pool->type == DHCPS_TYPE_DYNAMIC) + { + pdhcps_pool->lease_timer --; + } + if (pdhcps_pool->lease_timer == 0) + { + pback_node = pnode; + pnode = pback_node->pnext; + node_remove_from_list(&plist, pback_node); + free(pback_node->pnode); + pback_node->pnode = nullptr; + free(pback_node); + pback_node = nullptr; + } + else + { + pnode = pnode ->pnext; + num_dhcps_pool ++; + } + } + + if (num_dhcps_pool >= MAX_STATION_NUM) + { + kill_oldest_dhcps_pool(); + } +} + +bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg) +{ + bool offer_flag = true; + //uint8 option = 0; + if (optarg == nullptr && !isRunning()) + { + return false; + } + + if (level <= OFFER_START || level >= OFFER_END) + { + return false; + } + + switch (level) + { + case OFFER_ROUTER: + offer = (*(uint8 *)optarg) & 0x01; + offer_flag = true; + break; + default : + offer_flag = false; + break; + } + return offer_flag; +} + +bool DhcpServer::set_dhcps_lease_time(uint32 minute) +{ + if (_netif->num == SOFTAP_IF) + { + uint8 opmode = wifi_get_opmode(); + if (opmode == STATION_MODE || opmode == NULL_MODE) + { + return false; + } + } + + if (isRunning()) + { + return false; + } + + if (minute == 0) + { + return false; + } + dhcps_lease_time = minute; + return true; +} + +bool DhcpServer::reset_dhcps_lease_time(void) +{ + if (_netif->num == SOFTAP_IF) + { + uint8 opmode = wifi_get_opmode(); + if (opmode == STATION_MODE || opmode == NULL_MODE) + { + return false; + } + } + + if (isRunning()) + { + return false; + } + dhcps_lease_time = DHCPS_LEASE_TIME_DEF; + return true; +} + +uint32 DhcpServer::get_dhcps_lease_time(void) // minute +{ + return dhcps_lease_time; +} + +void DhcpServer::dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force) +{ + struct dhcps_pool *pdhcps_pool = nullptr; + list_node *pback_node = nullptr; + + if ((bssid == nullptr) || (ip == nullptr)) + { + return; + } + + for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext) + { + pdhcps_pool = (struct dhcps_pool*)pback_node->pnode; + if (memcmp(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac)) == 0) + { + if (memcmp(&pdhcps_pool->ip.addr, &ip->addr, sizeof(pdhcps_pool->ip.addr)) == 0) + { + if ((pdhcps_pool->type == DHCPS_TYPE_STATIC) || (force)) + { + if (pback_node != nullptr) + { + node_remove_from_list(&plist, pback_node); + free(pback_node); + pback_node = nullptr; + } + + if (pdhcps_pool != nullptr) + { + free(pdhcps_pool); + pdhcps_pool = nullptr; + } + } + else + { + pdhcps_pool->state = DHCPS_STATE_OFFLINE; + } + + struct ipv4_addr ip_zero; + memset(&ip_zero, 0x0, sizeof(ip_zero)); + if (_netif->num == SOFTAP_IF) + { + wifi_softap_set_station_info(bssid, &ip_zero); + } + break; + } + } + } +} + +uint32 DhcpServer::dhcps_client_update(u8 *bssid, struct ipv4_addr *ip) +{ + struct dhcps_pool *pdhcps_pool = nullptr; + list_node *pback_node = nullptr; + list_node *pmac_node = nullptr; + list_node *pip_node = nullptr; + bool flag = false; + uint32 start_ip = dhcps_lease.start_ip.addr; + uint32 end_ip = dhcps_lease.end_ip.addr; + dhcps_type_t type = DHCPS_TYPE_DYNAMIC; + if (bssid == nullptr) + { + return IPADDR_ANY; + } + + if (ip) + { + if (IPADDR_BROADCAST == ip->addr) + { + return IPADDR_ANY; + } + else if (IPADDR_ANY == ip->addr) + { + ip = nullptr; + } + else + { + type = DHCPS_TYPE_STATIC; + } + } + + renew = false; + for (pback_node = plist; pback_node != nullptr; pback_node = pback_node->pnext) + { + pdhcps_pool = (struct dhcps_pool*)pback_node->pnode; + //os_printf("mac:"MACSTR"bssid:"MACSTR"\r\n",MAC2STR(pdhcps_pool->mac),MAC2STR(bssid)); + if (memcmp(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac)) == 0) + { + pmac_node = pback_node; + if (ip == nullptr) + { + flag = true; + break; + } + } + if (ip != nullptr) + { + if (memcmp(&pdhcps_pool->ip.addr, &ip->addr, sizeof(pdhcps_pool->ip.addr)) == 0) + { + pip_node = pback_node; + } + } + else if (flag == false) + { + if (memcmp(&pdhcps_pool->ip.addr, &start_ip, sizeof(pdhcps_pool->ip.addr)) != 0) + { + flag = true; + } + else + { + start_ip = htonl((ntohl(start_ip) + 1)); + } + } + } + + if ((ip == nullptr) && (flag == false)) + { + if (plist == nullptr) + { + if (start_ip <= end_ip) + { + flag = true; + } + else + { + return IPADDR_ANY; + } + } + else + { + if (start_ip > end_ip) + { + return IPADDR_ANY; + } + //start_ip = htonl((ntohl(start_ip) + 1)); + flag = true; + } + } + + if (pmac_node != nullptr) // update new ip + { + if (pip_node != nullptr) + { + pdhcps_pool = (struct dhcps_pool*)pip_node->pnode; + + if (pip_node != pmac_node) + { + if (pdhcps_pool->state != DHCPS_STATE_OFFLINE) // ip is used + { + return IPADDR_ANY; + } + + // mac exists and ip exists in other node,delete mac + node_remove_from_list(&plist, pmac_node); + free(pmac_node->pnode); + pmac_node->pnode = nullptr; + free(pmac_node); + pmac_node = pip_node; + memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac)); + } + else + { + renew = true; + type = DHCPS_TYPE_DYNAMIC; + } + + pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER; + pdhcps_pool->type = type; + pdhcps_pool->state = DHCPS_STATE_ONLINE; + + } + else + { + pdhcps_pool = (struct dhcps_pool*)pmac_node->pnode; + if (ip != nullptr) + { + pdhcps_pool->ip.addr = ip->addr; + } + else if (flag == true) + { + pdhcps_pool->ip.addr = start_ip; + } + else // no ip to distribute + { + return IPADDR_ANY; + } + + node_remove_from_list(&plist, pmac_node); + pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER; + pdhcps_pool->type = type; + pdhcps_pool->state = DHCPS_STATE_ONLINE; + node_insert_to_list(&plist, pmac_node); + } + } + else // new station + { + if (pip_node != nullptr) // maybe ip has used + { + pdhcps_pool = (struct dhcps_pool*)pip_node->pnode; + if (pdhcps_pool->state != DHCPS_STATE_OFFLINE) + { + return IPADDR_ANY; + } + memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac)); + pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER; + pdhcps_pool->type = type; + pdhcps_pool->state = DHCPS_STATE_ONLINE; + } + else + { + pdhcps_pool = (struct dhcps_pool *)zalloc(sizeof(struct dhcps_pool)); + if (ip != nullptr) + { + pdhcps_pool->ip.addr = ip->addr; + } + else if (flag == true) + { + pdhcps_pool->ip.addr = start_ip; + } + else // no ip to distribute + { + free(pdhcps_pool); + return IPADDR_ANY; + } + if (pdhcps_pool->ip.addr > end_ip) + { + free(pdhcps_pool); + return IPADDR_ANY; + } + memcpy(pdhcps_pool->mac, bssid, sizeof(pdhcps_pool->mac)); + pdhcps_pool->lease_timer = DHCPS_LEASE_TIMER; + pdhcps_pool->type = type; + pdhcps_pool->state = DHCPS_STATE_ONLINE; + pback_node = (list_node *)zalloc(sizeof(list_node)); + pback_node->pnode = pdhcps_pool; + pback_node->pnext = nullptr; + node_insert_to_list(&plist, pback_node); + } + } + + return pdhcps_pool->ip.addr; +} diff --git a/cores/esp8266/LwipDhcpServer.h b/cores/esp8266/LwipDhcpServer.h new file mode 100644 index 000000000..e93166981 --- /dev/null +++ b/cores/esp8266/LwipDhcpServer.h @@ -0,0 +1,124 @@ +/* + lwIPDhcpServer.h - DHCP server + + Copyright (c) 2016 Espressif. All rights reserved. + Copyright (c) 2020 esp8266 arduino. 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 + + // original sources (no license provided) + // ESP8266_NONOS_SDK/third_party/lwip/app/dhcpserver.c + // ESP8266_NONOS_SDK/third_party/include/lwip/app/dhcpserver.h +*/ + +// lwIPDhcpServer.{cc,h} encapsulate original nonos-sdk dhcp server +// nearly as-is. This is an initial version to guaranty legacy behavior +// with same default values. + +#ifndef __DHCPS_H__ +#define __DHCPS_H__ + +#include // LWIP_VERSION + +class DhcpServer +{ +public: + + DhcpServer(netif* netif); + ~DhcpServer(); + + void setDns(int num, const ipv4_addr_t* dns); + + bool begin(ip_info* info); + void end(); + bool isRunning(); + + // this is the C interface encapsulated in a class + // (originally dhcpserver.c in lwIP-v1.4 in NonOS-SDK) + // (not changing everything at once) + // the API below is subject to change + + // legacy public C structure and API to eventually turn into C++ + + void init_dhcps_lease(uint32 ip); + bool set_dhcps_lease(struct dhcps_lease *please); + bool get_dhcps_lease(struct dhcps_lease *please); + bool set_dhcps_offer_option(uint8 level, void* optarg); + bool set_dhcps_lease_time(uint32 minute); + bool reset_dhcps_lease_time(void); + uint32 get_dhcps_lease_time(void); + bool add_dhcps_lease(uint8 *macaddr); + + void dhcps_set_dns(int num, const ipv4_addr_t* dns); + +protected: + + // legacy C structure and API to eventually turn into C++ + + typedef struct _list_node + { + void *pnode; + struct _list_node *pnext; + } list_node; + + void node_insert_to_list(list_node **phead, list_node* pinsert); + void node_remove_from_list(list_node **phead, list_node* pdelete); + uint8_t* add_msg_type(uint8_t *optptr, uint8_t type); + uint8_t* add_offer_options(uint8_t *optptr); + uint8_t* add_end(uint8_t *optptr); + void create_msg(struct dhcps_msg *m); + void send_offer(struct dhcps_msg *m); + void send_nak(struct dhcps_msg *m); + void send_ack(struct dhcps_msg *m); + uint8_t parse_options(uint8_t *optptr, sint16_t len); + sint16_t parse_msg(struct dhcps_msg *m, u16_t len); + static void S_handle_dhcp(void *arg, + struct udp_pcb *pcb, + struct pbuf *p, + const ip_addr_t *addr, + uint16_t port); + void handle_dhcp( + struct udp_pcb *pcb, + struct pbuf *p, + const ip_addr_t *addr, + uint16_t port); + void kill_oldest_dhcps_pool(void); + void dhcps_coarse_tmr(void); // CURRENTLY NOT CALLED + void dhcps_client_leave(u8 *bssid, struct ipv4_addr *ip, bool force); + uint32 dhcps_client_update(u8 *bssid, struct ipv4_addr *ip); + + netif* _netif; + + struct udp_pcb *pcb_dhcps; + ip_addr_t broadcast_dhcps; + struct ipv4_addr server_address; + struct ipv4_addr client_address; + struct ipv4_addr dns_address; + uint32 dhcps_lease_time; + + struct dhcps_lease dhcps_lease; + list_node *plist; + uint8 offer; + bool renew; + + static const uint32 magic_cookie; +}; + +// SoftAP DHCP server always exists and is started on boot +extern DhcpServer dhcpSoftAP; +extern "C" int fw_has_started_softap_dhcps; + +#endif // __DHCPS_H__ diff --git a/cores/esp8266/LwipIntf.cpp b/cores/esp8266/LwipIntf.cpp new file mode 100644 index 000000000..d2746745c --- /dev/null +++ b/cores/esp8266/LwipIntf.cpp @@ -0,0 +1,156 @@ + +extern "C" { +#include "lwip/err.h" +#include "lwip/ip_addr.h" +#include "lwip/dns.h" +#include "lwip/dhcp.h" +#include "lwip/init.h" // LWIP_VERSION_ +#if LWIP_IPV6 +#include "lwip/netif.h" // struct netif +#endif + +#include +} + +#include "debug.h" +#include "LwipIntf.h" + +// args | esp order arduino order +// ---- + --------- ------------- +// local_ip | local_ip local_ip +// arg1 | gateway dns1 +// arg2 | netmask gateway +// arg3 | dns1 netmask +// +// result stored into gateway/netmask/dns1 + +bool LwipIntf::ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3, + IPAddress& gateway, IPAddress& netmask, IPAddress& dns1) +{ + //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order. + gateway = arg1; + netmask = arg2; + dns1 = arg3; + + if (netmask[0] != 255) + { + //octet is not 255 => interpret as Arduino order + gateway = arg2; + netmask = arg3[0] == 0 ? IPAddress(255, 255, 255, 0) : arg3; //arg order is arduino and 4th arg not given => assign it arduino default + dns1 = arg1; + } + + // check whether all is IPv4 (or gateway not set) + if (!(local_ip.isV4() && netmask.isV4() && (!gateway.isSet() || gateway.isV4()))) + { + return false; + } + + //ip and gateway must be in the same netmask + if (gateway.isSet() && (local_ip.v4() & netmask.v4()) != (gateway.v4() & netmask.v4())) + { + return false; + } + + return true; +} + +/** + Get ESP8266 station DHCP hostname + @return hostname +*/ +String LwipIntf::hostname(void) +{ + return wifi_station_get_hostname(); +} + +/** + Set ESP8266 station DHCP hostname + @param aHostname max length:24 + @return ok +*/ +bool LwipIntf::hostname(const char* aHostname) +{ + /* + vvvv RFC952 vvvv + ASSUMPTIONS + 1. A "name" (Net, Host, Gateway, or Domain name) is a text string up + to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus + sign (-), and period (.). Note that periods are only allowed when + they serve to delimit components of "domain style names". (See + RFC-921, "Domain Name System Implementation Schedule", for + background). No blank or space characters are permitted as part of a + name. No distinction is made between upper and lower case. The first + character must be an alpha character. The last character must not be + a minus sign or period. A host which serves as a GATEWAY should have + "-GATEWAY" or "-GW" as part of its name. Hosts which do not serve as + Internet gateways should not use "-GATEWAY" and "-GW" as part of + their names. A host which is a TAC should have "-TAC" as the last + part of its host name, if it is a DoD host. Single character names + or nicknames are not allowed. + ^^^^ RFC952 ^^^^ + + - 24 chars max + - only a..z A..Z 0..9 '-' + - no '-' as last char + */ + + size_t len = strlen(aHostname); + + if (len == 0 || len > 32) + { + // nonos-sdk limit is 32 + // (dhcp hostname option minimum size is ~60) + DEBUGV("WiFi.(set)hostname(): empty or large(>32) name\n"); + return false; + } + + // check RFC compliance + bool compliant = (len <= 24); + for (size_t i = 0; compliant && i < len; i++) + if (!isalnum(aHostname[i]) && aHostname[i] != '-') + { + compliant = false; + } + if (aHostname[len - 1] == '-') + { + compliant = false; + } + + if (!compliant) + { + DEBUGV("hostname '%s' is not compliant with RFC952\n", aHostname); + } + + bool ret = wifi_station_set_hostname(aHostname); + if (!ret) + { + DEBUGV("WiFi.hostname(%s): wifi_station_set_hostname() failed\n", aHostname); + return false; + } + + // now we should inform dhcp server for this change, using lwip_renew() + // looping through all existing interface + // harmless for AP, also compatible with ethernet adapters (to come) + for (netif* intf = netif_list; intf; intf = intf->next) + { + + // unconditionally update all known interfaces + intf->hostname = wifi_station_get_hostname(); + + if (netif_dhcp_data(intf) != nullptr) + { + // renew already started DHCP leases + err_t lwipret = dhcp_renew(intf); + if (lwipret != ERR_OK) + { + DEBUGV("WiFi.hostname(%s): lwIP error %d on interface %c%c (index %d)\n", + intf->hostname, (int)lwipret, intf->name[0], intf->name[1], intf->num); + ret = false; + } + } + } + + return ret && compliant; +} + diff --git a/cores/esp8266/LwipIntf.h b/cores/esp8266/LwipIntf.h index cb8bb92dc..972a7c800 100644 --- a/cores/esp8266/LwipIntf.h +++ b/cores/esp8266/LwipIntf.h @@ -3,6 +3,7 @@ #define _LWIPINTF_H #include +#include #include @@ -12,15 +13,31 @@ public: using CBType = std::function ; - static bool stateUpCB (LwipIntf::CBType&& cb); + static bool stateUpCB(LwipIntf::CBType&& cb); -private: + // reorder WiFi.config() parameters for a esp8266/official Arduino dual-compatibility API + // args | esp order arduino order + // ---- + --------- ------------- + // local_ip | local_ip local_ip + // arg1 | gateway dns1 + // arg2 | netmask [Agateway + // arg3 | dns1 netmask + // + // result stored into gateway/netmask/dns1 + static + bool ipAddressReorder(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3, + IPAddress& gateway, IPAddress& netmask, IPAddress& dns1); - LwipIntf () { } // private, cannot be directly allocated + String hostname(); + bool hostname(const String& aHostname) + { + return hostname(aHostname.c_str()); + } + bool hostname(const char* aHostname); protected: - static bool stateChangeSysCB (LwipIntf::CBType&& cb); + static bool stateChangeSysCB(LwipIntf::CBType&& cb); }; #endif // _LWIPINTF_H diff --git a/cores/esp8266/LwipIntfCB.cpp b/cores/esp8266/LwipIntfCB.cpp index b978918a7..1e495c5fd 100644 --- a/cores/esp8266/LwipIntfCB.cpp +++ b/cores/esp8266/LwipIntfCB.cpp @@ -8,14 +8,16 @@ static int netifStatusChangeListLength = 0; LwipIntf::CBType netifStatusChangeList [NETIF_STATUS_CB_SIZE]; -extern "C" void netif_status_changed (struct netif* netif) +extern "C" void netif_status_changed(struct netif* netif) { // override the default empty weak function for (int i = 0; i < netifStatusChangeListLength; i++) + { netifStatusChangeList[i](netif); + } } -bool LwipIntf::stateChangeSysCB (LwipIntf::CBType&& cb) +bool LwipIntf::stateChangeSysCB(LwipIntf::CBType&& cb) { if (netifStatusChangeListLength >= NETIF_STATUS_CB_SIZE) { @@ -29,14 +31,14 @@ bool LwipIntf::stateChangeSysCB (LwipIntf::CBType&& cb) return true; } -bool LwipIntf::stateUpCB (LwipIntf::CBType&& cb) +bool LwipIntf::stateUpCB(LwipIntf::CBType&& cb) { - return stateChangeSysCB([cb](netif* nif) + return stateChangeSysCB([cb](netif * nif) { if (netif_is_up(nif)) schedule_function([cb, nif]() - { - cb(nif); - }); + { + cb(nif); + }); }); } diff --git a/cores/esp8266/LwipIntfDev.h b/cores/esp8266/LwipIntfDev.h new file mode 100644 index 000000000..dded93499 --- /dev/null +++ b/cores/esp8266/LwipIntfDev.h @@ -0,0 +1,386 @@ + +#ifndef _LWIPINTFDEV_H +#define _LWIPINTFDEV_H + +// TODO: +// remove all Serial.print +// unchain pbufs + +#include +#include +#include +#include +#include +#include + +#include // wifi_get_macaddr() + +#include "SPI.h" +#include "Schedule.h" +#include "LwipIntf.h" +#include "wl_definitions.h" + +#ifndef DEFAULT_MTU +#define DEFAULT_MTU 1500 +#endif + +template +class LwipIntfDev: public LwipIntf, public RawDev +{ + +public: + + LwipIntfDev(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1): + RawDev(cs, spi, intr), + _mtu(DEFAULT_MTU), + _intrPin(intr), + _started(false), + _default(false) + { + memset(&_netif, 0, sizeof(_netif)); + } + + boolean config(const IPAddress& local_ip, const IPAddress& arg1, const IPAddress& arg2, const IPAddress& arg3, const IPAddress& dns2); + + // default mac-address is inferred from esp8266's STA interface + boolean begin(const uint8_t *macAddress = nullptr, const uint16_t mtu = DEFAULT_MTU); + + const netif* getNetIf() const + { + return &_netif; + } + + IPAddress localIP() const + { + return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr))); + } + IPAddress subnetMask() const + { + return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.netmask))); + } + IPAddress gatewayIP() const + { + return IPAddress(ip4_addr_get_u32(ip_2_ip4(&_netif.gw))); + } + + void setDefault(); + + bool connected() + { + return !!ip4_addr_get_u32(ip_2_ip4(&_netif.ip_addr)); + } + + // ESP8266WiFi API compatibility + + wl_status_t status(); + +protected: + + err_t netif_init(); + void netif_status_callback(); + + static err_t netif_init_s(netif* netif); + static err_t linkoutput_s(netif *netif, struct pbuf *p); + static void netif_status_callback_s(netif* netif); + + // called on a regular basis or on interrupt + err_t handlePackets(); + + // members + + netif _netif; + + uint16_t _mtu; + int8_t _intrPin; + uint8_t _macAddress[6]; + bool _started; + bool _default; + +}; + +template +boolean LwipIntfDev::config(const IPAddress& localIP, const IPAddress& gateway, const IPAddress& netmask, const IPAddress& dns1, const IPAddress& dns2) +{ + if (_started) + { + DEBUGV("LwipIntfDev: use config() then begin()\n"); + return false; + } + + IPAddress realGateway, realNetmask, realDns1; + if (!ipAddressReorder(localIP, gateway, netmask, dns1, realGateway, realNetmask, realDns1)) + { + return false; + } + ip4_addr_set_u32(ip_2_ip4(&_netif.ip_addr), localIP.v4()); + ip4_addr_set_u32(ip_2_ip4(&_netif.gw), realGateway.v4()); + ip4_addr_set_u32(ip_2_ip4(&_netif.netmask), realNetmask.v4()); + + return true; +} + +template +boolean LwipIntfDev::begin(const uint8_t* macAddress, const uint16_t mtu) +{ + if (mtu) + { + _mtu = mtu; + } + + if (macAddress) + { + memcpy(_macAddress, macAddress, 6); + } + else + { + _netif.num = 2; + for (auto n = netif_list; n; n = n->next) + if (n->num >= _netif.num) + { + _netif.num = n->num + 1; + } + +#if 1 + // forge a new mac-address from the esp's wifi sta one + // I understand this is cheating with an official mac-address + wifi_get_macaddr(STATION_IF, (uint8*)_macAddress); +#else + // https://serverfault.com/questions/40712/what-range-of-mac-addresses-can-i-safely-use-for-my-virtual-machines + memset(_macAddress, 0, 6); + _macAddress[0] = 0xEE; +#endif + _macAddress[3] += _netif.num; // alter base mac address + _macAddress[0] &= 0xfe; // set as locally administered, unicast, per + _macAddress[0] |= 0x02; // https://en.wikipedia.org/wiki/MAC_address#Universal_vs._local + } + + if (!RawDev::begin(_macAddress)) + { + return false; + } + + // setup lwIP netif + + _netif.hwaddr_len = sizeof _macAddress; + memcpy(_netif.hwaddr, _macAddress, sizeof _macAddress); + + // due to netif_add() api: ... + ip_addr_t ip_addr, netmask, gw; + ip_addr_copy(ip_addr, _netif.ip_addr); + ip_addr_copy(netmask, _netif.netmask); + ip_addr_copy(gw, _netif.gw); + + if (!netif_add(&_netif, ip_2_ip4(&ip_addr), ip_2_ip4(&netmask), ip_2_ip4(&gw), this, netif_init_s, ethernet_input)) + { + return false; + } + + _netif.flags |= NETIF_FLAG_UP; + + if (localIP().v4() == 0) + { + switch (dhcp_start(&_netif)) + { + case ERR_OK: + break; + + case ERR_IF: + return false; + + default: + netif_remove(&_netif); + return false; + } + } + + _started = true; + + if (_intrPin >= 0) + { + if (RawDev::interruptIsPossible()) + { + //attachInterrupt(_intrPin, [&]() { this->handlePackets(); }, FALLING); + } + else + { + ::printf((PGM_P)F("lwIP_Intf: Interrupt not implemented yet, enabling transparent polling\r\n")); + _intrPin = -1; + } + } + + if (_intrPin < 0 && !schedule_recurrent_function_us([&]() +{ + this->handlePackets(); + return true; + }, 100)) + { + netif_remove(&_netif); + return false; + } + + return true; +} + +template +wl_status_t LwipIntfDev::status() +{ + return _started ? (connected() ? WL_CONNECTED : WL_DISCONNECTED) : WL_NO_SHIELD; +} + +template +err_t LwipIntfDev::linkoutput_s(netif *netif, struct pbuf *pbuf) +{ + LwipIntfDev* ths = (LwipIntfDev*)netif->state; + + if (pbuf->len != pbuf->tot_len || pbuf->next) + { + Serial.println("ERRTOT\r\n"); + } + + uint16_t len = ths->sendFrame((const uint8_t*)pbuf->payload, pbuf->len); + +#if PHY_HAS_CAPTURE + if (phy_capture) + { + phy_capture(ths->_netif.num, (const char*)pbuf->payload, pbuf->len, /*out*/1, /*success*/len == pbuf->len); + } +#endif + + return len == pbuf->len ? ERR_OK : ERR_MEM; +} + +template +err_t LwipIntfDev::netif_init_s(struct netif* netif) +{ + return ((LwipIntfDev*)netif->state)->netif_init(); +} + +template +void LwipIntfDev::netif_status_callback_s(struct netif* netif) +{ + ((LwipIntfDev*)netif->state)->netif_status_callback(); +} + +template +err_t LwipIntfDev::netif_init() +{ + _netif.name[0] = 'e'; + _netif.name[1] = '0' + _netif.num; + _netif.mtu = _mtu; + _netif.chksum_flags = NETIF_CHECKSUM_ENABLE_ALL; + _netif.flags = + NETIF_FLAG_ETHARP + | NETIF_FLAG_IGMP + | NETIF_FLAG_BROADCAST + | NETIF_FLAG_LINK_UP; + + // lwIP's doc: This function typically first resolves the hardware + // address, then sends the packet. For ethernet physical layer, this is + // usually lwIP's etharp_output() + _netif.output = etharp_output; + + // lwIP's doc: This function outputs the pbuf as-is on the link medium + // (this must points to the raw ethernet driver, meaning: us) + _netif.linkoutput = linkoutput_s; + + _netif.status_callback = netif_status_callback_s; + + return ERR_OK; +} + +template +void LwipIntfDev::netif_status_callback() +{ + if (connected()) + { + if (_default) + { + netif_set_default(&_netif); + } + sntp_stop(); + sntp_init(); + } + else if (netif_default == &_netif) + { + netif_set_default(nullptr); + } +} + +template +err_t LwipIntfDev::handlePackets() +{ + int pkt = 0; + while (1) + { + if (++pkt == 10) + // prevent starvation + { + return ERR_OK; + } + + uint16_t tot_len = RawDev::readFrameSize(); + if (!tot_len) + { + return ERR_OK; + } + + // from doc: use PBUF_RAM for TX, PBUF_POOL from RX + // however: + // PBUF_POOL can return chained pbuf (not in one piece) + // and WiznetDriver does not have the proper API to deal with that + // so in the meantime, we use PBUF_RAM instead which is currently + // guarantying to deliver a continuous chunk of memory. + // TODO: tweak the wiznet driver to allow copying partial chunk + // of received data and use PBUF_POOL. + pbuf* pbuf = pbuf_alloc(PBUF_RAW, tot_len, PBUF_RAM); + if (!pbuf || pbuf->len < tot_len) + { + if (pbuf) + { + pbuf_free(pbuf); + } + RawDev::discardFrame(tot_len); + return ERR_BUF; + } + + uint16_t len = RawDev::readFrameData((uint8_t*)pbuf->payload, tot_len); + if (len != tot_len) + { + // tot_len is given by readFrameSize() + // and is supposed to be honoured by readFrameData() + // todo: ensure this test is unneeded, remove the print + Serial.println("read error?\r\n"); + pbuf_free(pbuf); + return ERR_BUF; + } + + err_t err = _netif.input(pbuf, &_netif); + +#if PHY_HAS_CAPTURE + if (phy_capture) + { + phy_capture(_netif.num, (const char*)pbuf->payload, tot_len, /*out*/0, /*success*/err == ERR_OK); + } +#endif + + if (err != ERR_OK) + { + pbuf_free(pbuf); + return err; + } + // (else) allocated pbuf is now lwIP's responsibility + + } +} + +template +void LwipIntfDev::setDefault() +{ + _default = true; + if (connected()) + { + netif_set_default(&_netif); + } +} + +#endif // _LWIPINTFDEV_H diff --git a/cores/esp8266/Print.h b/cores/esp8266/Print.h index 551755399..6b2faed6e 100644 --- a/cores/esp8266/Print.h +++ b/cores/esp8266/Print.h @@ -75,6 +75,10 @@ class Print { inline size_t write(char c) { return write((uint8_t) c); } inline size_t write(int8_t c) { return write((uint8_t) c); } + // default to zero, meaning "a single write may block" + // should be overriden by subclasses with buffering + virtual int availableForWrite() { return 0; } + size_t printf(const char * format, ...) __attribute__ ((format (printf, 2, 3))); size_t printf_P(PGM_P format, ...) __attribute__((format(printf, 2, 3))); size_t print(const __FlashStringHelper *); diff --git a/cores/esp8266/Schedule.cpp b/cores/esp8266/Schedule.cpp index 5ac887ce1..b1230ed67 100644 --- a/cores/esp8266/Schedule.cpp +++ b/cores/esp8266/Schedule.cpp @@ -102,6 +102,7 @@ bool schedule_function(const std::function& fn) return true; } +IRAM_ATTR // (not only) called from ISR bool schedule_recurrent_function_us(const std::function& fn, uint32_t repeat_us, const std::function& alarm) { diff --git a/cores/esp8266/StackThunk.cpp b/cores/esp8266/StackThunk.cpp index 4b708bcc6..7456fcaee 100644 --- a/cores/esp8266/StackThunk.cpp +++ b/cores/esp8266/StackThunk.cpp @@ -31,6 +31,8 @@ #include "debug.h" #include "StackThunk.h" #include +#include +#include extern "C" { @@ -48,7 +50,14 @@ void stack_thunk_add_ref() { stack_thunk_refcnt++; if (stack_thunk_refcnt == 1) { + DBG_MMU_PRINTF("\nStackThunk malloc(%u)\n", _stackSize * sizeof(uint32_t)); + // The stack must be in DRAM, or an Soft WDT will follow. Not sure why, + // maybe too much time is consumed with the non32-bit exception handler. + // Also, interrupt handling on an IRAM stack would be very slow. + // Strings on the stack would be very slow to access as well. + HeapSelectDram ephemeral; stack_thunk_ptr = (uint32_t *)malloc(_stackSize * sizeof(uint32_t)); + DBG_MMU_PRINTF("StackThunk stack_thunk_ptr: %p\n", stack_thunk_ptr); if (!stack_thunk_ptr) { // This is a fatal error, stop the sketch DEBUGV("Unable to allocate BearSSL stack\n"); diff --git a/cores/esp8266/TZ.h b/cores/esp8266/TZ.h index 61e247e27..cd083e7fd 100644 --- a/cores/esp8266/TZ.h +++ b/cores/esp8266/TZ.h @@ -1,10 +1,11 @@ // autogenerated from https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv // by script /tools/TZupdate.sh -// Tue Jul 7 07:38:29 UTC 2020 +// Thu Nov 12 04:07:03 UTC 2020 // // This database is autogenerated from IANA timezone database -// https://www.iana.org/time-zones +// https://raw.githubusercontent.com/nayarsystems/posix_tz_db/master/zones.csv +// (using https://www.iana.org/time-zones) // and can be updated on demand in this repository // or by yourself using the above script @@ -211,10 +212,10 @@ #define TZ_America_Winnipeg PSTR("CST6CDT,M3.2.0,M11.1.0") #define TZ_America_Yakutat PSTR("AKST9AKDT,M3.2.0,M11.1.0") #define TZ_America_Yellowknife PSTR("MST7MDT,M3.2.0,M11.1.0") -#define TZ_Antarctica_Casey PSTR("<+08>-8") +#define TZ_Antarctica_Casey PSTR("<+11>-11") #define TZ_Antarctica_Davis PSTR("<+07>-7") #define TZ_Antarctica_DumontDUrville PSTR("<+10>-10") -#define TZ_Antarctica_Macquarie PSTR("<+11>-11") +#define TZ_Antarctica_Macquarie PSTR("AEST-10AEDT,M10.1.0,M4.1.0/3") #define TZ_Antarctica_Mawson PSTR("<+05>-5") #define TZ_Antarctica_McMurdo PSTR("NZST-12NZDT,M9.5.0,M4.1.0/3") #define TZ_Antarctica_Palmer PSTR("<-03>3") @@ -248,8 +249,8 @@ #define TZ_Asia_Dubai PSTR("<+04>-4") #define TZ_Asia_Dushanbe PSTR("<+05>-5") #define TZ_Asia_Famagusta PSTR("EET-2EEST,M3.5.0/3,M10.5.0/4") -#define TZ_Asia_Gaza PSTR("EET-2EEST,M3.5.5/0,M10.5.6/1") -#define TZ_Asia_Hebron PSTR("EET-2EEST,M3.5.5/0,M10.5.6/1") +#define TZ_Asia_Gaza PSTR("EET-2EEST,M3.4.4/48,M10.4.4/49") +#define TZ_Asia_Hebron PSTR("EET-2EEST,M3.4.4/48,M10.4.4/49") #define TZ_Asia_Ho_Chi_Minh PSTR("<+07>-7") #define TZ_Asia_Hong_Kong PSTR("HKT-8") #define TZ_Asia_Hovd PSTR("<+07>-7") diff --git a/cores/esp8266/Tone.cpp b/cores/esp8266/Tone.cpp index 064fdad5d..b4dc93c64 100644 --- a/cores/esp8266/Tone.cpp +++ b/cores/esp8266/Tone.cpp @@ -25,15 +25,16 @@ #include "core_esp8266_waveform.h" #include "user_interface.h" -// Which pins have a tone running on them? -static uint32_t _toneMap = 0; - - static void _startTone(uint8_t _pin, uint32_t high, uint32_t low, uint32_t duration) { if (_pin > 16) { return; } + // Stop any analogWrites (PWM) because they are a different generator + _stopPWM(_pin); + // If there's another Tone or startWaveform on this pin + // it will be changed on-the-fly (no need to stop it) + pinMode(_pin, OUTPUT); high = std::max(high, (uint32_t)microsecondsToClockCycles(25)); // new 20KHz maximum tone frequency, @@ -42,9 +43,7 @@ static void _startTone(uint8_t _pin, uint32_t high, uint32_t low, uint32_t durat duration = microsecondsToClockCycles(duration * 1000UL); duration += high + low - 1; duration -= duration % (high + low); - if (startWaveformClockCycles(_pin, high, low, duration)) { - _toneMap |= 1 << _pin; - } + startWaveformClockCycles(_pin, high, low, duration); } @@ -86,6 +85,5 @@ void noTone(uint8_t _pin) { return; } stopWaveform(_pin); - _toneMap &= ~(1 << _pin); digitalWrite(_pin, 0); } diff --git a/cores/esp8266/Updater.cpp b/cores/esp8266/Updater.cpp index b2e92978e..d9d468765 100644 --- a/cores/esp8266/Updater.cpp +++ b/cores/esp8266/Updater.cpp @@ -203,6 +203,11 @@ bool UpdaterClass::end(bool evenIfRemaining){ return false; } + // Updating w/o any data is an error we detect here + if (!progress()) { + _setError(UPDATE_ERROR_NO_DATA); + } + if(hasError() || (!isFinished() && !evenIfRemaining)){ #ifdef DEBUG_UPDATER DEBUG_UPDATER.printf_P(PSTR("premature end: res:%u, pos:%zu/%zu\n"), getError(), progress(), _size); @@ -551,6 +556,8 @@ void UpdaterClass::printError(Print &out){ out.println(F("Bad Size Given")); } else if(_error == UPDATE_ERROR_STREAM){ out.println(F("Stream Read Timeout")); + } else if(_error == UPDATE_ERROR_NO_DATA){ + out.println(F("No data supplied")); } else if(_error == UPDATE_ERROR_MD5){ out.printf_P(PSTR("MD5 Failed: expected:%s, calculated:%s\n"), _target_md5.c_str(), _md5.toString().c_str()); } else if(_error == UPDATE_ERROR_SIGN){ diff --git a/cores/esp8266/Updater.h b/cores/esp8266/Updater.h index 30c4a0071..14a4a3baa 100644 --- a/cores/esp8266/Updater.h +++ b/cores/esp8266/Updater.h @@ -19,6 +19,7 @@ #define UPDATE_ERROR_MAGIC_BYTE (10) #define UPDATE_ERROR_BOOTSTRAP (11) #define UPDATE_ERROR_SIGN (12) +#define UPDATE_ERROR_NO_DATA (13) #define U_FLASH 0 #define U_FS 100 diff --git a/cores/esp8266/WString.cpp b/cores/esp8266/WString.cpp index 056bbeb98..07ab99b2c 100644 --- a/cores/esp8266/WString.cpp +++ b/cores/esp8266/WString.cpp @@ -32,7 +32,7 @@ String::String(const char *cstr) { init(); if (cstr) - copy(cstr, strlen(cstr)); + copy(cstr, strlen_P(cstr)); } String::String(const String &value) { @@ -55,14 +55,6 @@ String::String(StringSumHelper &&rval) noexcept { move(rval); } -String::String(char c) { - init(); - char buf[2]; - buf[0] = c; - buf[1] = 0; - *this = buf; -} - String::String(unsigned char value, unsigned char base) { init(); char buf[1 + 8 * sizeof(unsigned char)]; @@ -91,7 +83,7 @@ String::String(unsigned int value, unsigned char base) { String::String(long value, unsigned char base) { init(); char buf[2 + 8 * sizeof(long)]; - if (base==10) { + if (base == 10) { sprintf(buf, "%ld", value); } else { ltoa(value, buf, base); @@ -118,31 +110,21 @@ String::String(double value, unsigned char decimalPlaces) { *this = dtostrf(value, (decimalPlaces + 2), decimalPlaces, buf); } -String::~String() { - invalidate(); -} - /*********************************************/ /* Memory Management */ /*********************************************/ -inline void String::init(void) { - setSSO(true); - setLen(0); - wbuffer()[0] = 0; -} - void String::invalidate(void) { - if(!isSSO() && wbuffer()) + if (!isSSO() && wbuffer()) free(wbuffer()); init(); } unsigned char String::reserve(unsigned int size) { - if(buffer() && capacity() >= size) + if (buffer() && capacity() >= size) return 1; - if(changeBuffer(size)) { - if(len() == 0) + if (changeBuffer(size)) { + if (len() == 0) wbuffer()[0] = 0; return 1; } @@ -157,35 +139,32 @@ unsigned char String::changeBuffer(unsigned int maxStrLen) { uint16_t oldLen = len(); setSSO(true); setLen(oldLen); - return 1; } else { // if bufptr && !isSSO() // Using bufptr, need to shrink into sso.buff - char temp[sizeof(sso.buff)]; - memcpy(temp, buffer(), maxStrLen); - free(wbuffer()); + const char *temp = buffer(); uint16_t oldLen = len(); setSSO(true); setLen(oldLen); memcpy(wbuffer(), temp, maxStrLen); - return 1; + free((void *)temp); } + return 1; } // Fallthrough to normal allocator size_t newSize = (maxStrLen + 16) & (~0xf); // Make sure we can fit newsize in the buffer if (newSize > CAPACITY_MAX) { - return false; + return 0; } uint16_t oldLen = len(); - char *newbuffer = (char *) realloc(isSSO() ? nullptr : wbuffer(), newSize); + char *newbuffer = (char *)realloc(isSSO() ? nullptr : wbuffer(), newSize); if (newbuffer) { size_t oldSize = capacity() + 1; // include NULL. if (isSSO()) { // Copy the SSO buffer into allocated space memmove_P(newbuffer, sso.buff, sizeof(sso.buff)); } - if (newSize > oldSize) - { + if (newSize > oldSize) { memset(newbuffer + oldSize, 0, newSize - oldSize); } setSSO(false); @@ -201,7 +180,7 @@ unsigned char String::changeBuffer(unsigned int maxStrLen) { /* Copy and Move */ /*********************************************/ -String & String::copy(const char *cstr, unsigned int length) { +String &String::copy(const char *cstr, unsigned int length) { if (!reserve(length)) { invalidate(); return *this; @@ -211,7 +190,7 @@ String & String::copy(const char *cstr, unsigned int length) { return *this; } -String & String::copy(const __FlashStringHelper *pstr, unsigned int length) { +String &String::copy(const __FlashStringHelper *pstr, unsigned int length) { if (!reserve(length)) { invalidate(); return *this; @@ -227,44 +206,35 @@ void String::move(String &rhs) noexcept { rhs.init(); } -String & String::operator =(const String &rhs) { +String &String::operator =(const String &rhs) { if (this == &rhs) return *this; - if (rhs.buffer()) copy(rhs.buffer(), rhs.len()); else invalidate(); - return *this; } -String & String::operator =(String &&rval) noexcept { +String &String::operator =(String &&rval) noexcept { if (this != &rval) move(rval); return *this; } -String & String::operator =(StringSumHelper &&rval) noexcept { - if (this != &rval) - move(rval); - return *this; -} - -String & String::operator =(const char *cstr) { +String &String::operator =(const char *cstr) { if (cstr) copy(cstr, strlen(cstr)); else invalidate(); - return *this; } -String & String::operator = (const __FlashStringHelper *pstr) -{ - if (pstr) copy(pstr, strlen_P((PGM_P)pstr)); - else invalidate(); - +String &String::operator =(const __FlashStringHelper *pstr) { + if (pstr) + copy(pstr, strlen_P((PGM_P)pstr)); + else + invalidate(); return *this; } @@ -285,7 +255,7 @@ unsigned char String::concat(const String &s) { return 0; memmove_P(wbuffer() + len(), buffer(), len()); setLen(newlen); - wbuffer()[len()] = 0; + wbuffer()[newlen] = 0; return 1; } else { return concat(s.buffer(), s.len()); @@ -313,22 +283,17 @@ unsigned char String::concat(const char *cstr) { } unsigned char String::concat(char c) { - char buf[2]; - buf[0] = c; - buf[1] = 0; - return concat(buf, 1); + return concat(&c, 1); } unsigned char String::concat(unsigned char num) { char buf[1 + 3 * sizeof(unsigned char)]; - sprintf(buf, "%d", num); - return concat(buf, strlen(buf)); + return concat(buf, sprintf(buf, "%d", num)); } unsigned char String::concat(int num) { char buf[2 + 3 * sizeof(int)]; - sprintf(buf, "%d", num); - return concat(buf, strlen(buf)); + return concat(buf, sprintf(buf, "%d", num)); } unsigned char String::concat(unsigned int num) { @@ -339,8 +304,7 @@ unsigned char String::concat(unsigned int num) { unsigned char String::concat(long num) { char buf[2 + 3 * sizeof(long)]; - sprintf(buf, "%ld", num); - return concat(buf, strlen(buf)); + return concat(buf, sprintf(buf, "%ld", num)); } unsigned char String::concat(unsigned long num) { @@ -351,22 +315,25 @@ unsigned char String::concat(unsigned long num) { unsigned char String::concat(float num) { char buf[20]; - char* string = dtostrf(num, 4, 2, buf); + char *string = dtostrf(num, 4, 2, buf); return concat(string, strlen(string)); } unsigned char String::concat(double num) { char buf[20]; - char* string = dtostrf(num, 4, 2, buf); + char *string = dtostrf(num, 4, 2, buf); return concat(string, strlen(string)); } -unsigned char String::concat(const __FlashStringHelper * str) { - if (!str) return 0; +unsigned char String::concat(const __FlashStringHelper *str) { + if (!str) + return 0; int length = strlen_P((PGM_P)str); - if (length == 0) return 1; + if (length == 0) + return 1; unsigned int newlen = len() + length; - if (!reserve(newlen)) return 0; + if (!reserve(newlen)) + return 0; memcpy_P(wbuffer() + len(), (PGM_P)str, length + 1); setLen(newlen); return 1; @@ -376,79 +343,78 @@ unsigned char String::concat(const __FlashStringHelper * str) { /* Concatenate */ /*********************************************/ -StringSumHelper & operator +(const StringSumHelper &lhs, const String &rhs) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, const String &rhs) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(rhs.buffer(), rhs.len())) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, const char *cstr) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, const char *cstr) { + StringSumHelper &a = const_cast(lhs); if (!cstr || !a.concat(cstr, strlen(cstr))) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, char c) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, char c) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(c)) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned char num) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, unsigned char num) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(num)) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, int num) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, int num) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(num)) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned int num) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, unsigned int num) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(num)) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, long num) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, long num) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(num)) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long num) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, unsigned long num) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(num)) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, float num) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, float num) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(num)) a.invalidate(); return a; } -StringSumHelper & operator +(const StringSumHelper &lhs, double num) { - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, double num) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(num)) a.invalidate(); return a; } -StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHelper *rhs) -{ - StringSumHelper &a = const_cast(lhs); +StringSumHelper &operator +(const StringSumHelper &lhs, const __FlashStringHelper *rhs) { + StringSumHelper &a = const_cast(lhs); if (!a.concat(rhs)) a.invalidate(); return a; @@ -459,11 +425,11 @@ StringSumHelper & operator + (const StringSumHelper &lhs, const __FlashStringHel /*********************************************/ int String::compareTo(const String &s) const { - if(!buffer() || !s.buffer()) { - if(s.buffer() && s.len() > 0) - return 0 - *(unsigned char *) s.buffer(); - if(buffer() && len() > 0) - return *(unsigned char *) buffer(); + if (!buffer() || !s.buffer()) { + if (s.buffer() && s.len() > 0) + return 0 - *(unsigned char *)s.buffer(); + if (buffer() && len() > 0) + return *(unsigned char *)buffer(); return 0; } return strcmp(buffer(), s.buffer()); @@ -521,7 +487,7 @@ unsigned char String::equalsConstantTime(const String &s2) const { //at this point lengths are the same if (len() == 0) return 1; - //at this point lenghts are the same and non-zero + //at this point lengths are the same and non-zero const char *p1 = buffer(); const char *p2 = s2.buffer(); unsigned int equalchars = 0; @@ -541,19 +507,19 @@ unsigned char String::equalsConstantTime(const String &s2) const { } unsigned char String::startsWith(const String &s2) const { - if(len() < s2.len()) + if (len() < s2.len()) return 0; return startsWith(s2, 0); } unsigned char String::startsWith(const String &s2, unsigned int offset) const { - if(offset > (unsigned)(len() - s2.len()) || !buffer() || !s2.buffer()) + if (offset > (unsigned)(len() - s2.len()) || !buffer() || !s2.buffer()) return 0; return strncmp(&buffer()[offset], s2.buffer(), s2.len()) == 0; } unsigned char String::endsWith(const String &s2) const { - if(len() < s2.len() || !buffer() || !s2.buffer()) + if (len() < s2.len() || !buffer() || !s2.buffer()) return 0; return strcmp(&buffer()[len() - s2.len()], s2.buffer()) == 0; } @@ -562,16 +528,12 @@ unsigned char String::endsWith(const String &s2) const { /* Character Access */ /*********************************************/ -char String::charAt(unsigned int loc) const { - return operator[](loc); -} - void String::setCharAt(unsigned int loc, char c) { if (loc < len()) wbuffer()[loc] = c; } -char & String::operator[](unsigned int index) { +char &String::operator[](unsigned int index) { static char dummy_writable_char; if (index >= len() || !buffer()) { dummy_writable_char = 0; @@ -596,7 +558,7 @@ void String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int ind unsigned int n = bufsize - 1; if (n > len() - index) n = len() - index; - strncpy((char *) buf, buffer() + index, n); + strncpy((char *)buf, buffer() + index, n); buf[n] = 0; } @@ -604,46 +566,43 @@ void String::getBytes(unsigned char *buf, unsigned int bufsize, unsigned int ind /* Search */ /*********************************************/ -int String::indexOf(char c) const { - return indexOf(c, 0); -} - int String::indexOf(char ch, unsigned int fromIndex) const { if (fromIndex >= len()) return -1; - const char* temp = strchr(buffer() + fromIndex, ch); + const char *temp = strchr(buffer() + fromIndex, ch); if (temp == NULL) return -1; return temp - buffer(); } -int String::indexOf(const String &s2) const { - return indexOf(s2, 0); -} - -int String::indexOf(const String &s2, unsigned int fromIndex) const { +int String::indexOf(const char *s2, unsigned int fromIndex) const { if (fromIndex >= len()) return -1; - const char *found = strstr(buffer() + fromIndex, s2.buffer()); + const char *found = strstr_P(buffer() + fromIndex, s2); if (found == NULL) return -1; return found - buffer(); } -int String::lastIndexOf(char theChar) const { - return lastIndexOf(theChar, len() - 1); +int String::indexOf(const String &s2, unsigned int fromIndex) const { + return indexOf(s2.c_str(), fromIndex); +} + +int String::lastIndexOf(char ch) const { + return lastIndexOf(ch, len() - 1); } int String::lastIndexOf(char ch, unsigned int fromIndex) const { if (fromIndex >= len()) return -1; - char tempchar = buffer()[fromIndex + 1]; - wbuffer()[fromIndex + 1] = '\0'; - char* temp = strrchr(wbuffer(), ch); - wbuffer()[fromIndex + 1] = tempchar; + char *writeTo = wbuffer(); + char tempchar = writeTo[fromIndex + 1]; // save the replaced character + writeTo[fromIndex + 1] = '\0'; + char *temp = strrchr(writeTo, ch); + writeTo[fromIndex + 1] = tempchar; // restore character if (temp == NULL) return -1; - return temp - buffer(); + return temp - writeTo; } int String::lastIndexOf(const String &s2) const { @@ -656,11 +615,11 @@ int String::lastIndexOf(const String &s2, unsigned int fromIndex) const { if (fromIndex >= len()) fromIndex = len() - 1; int found = -1; - for (char *p = wbuffer(); p <= wbuffer() + fromIndex; p++) { + for (const char *p = buffer(); p <= buffer() + fromIndex; p++) { p = strstr(p, s2.buffer()); if (!p) break; - if ((unsigned int) (p - wbuffer()) <= fromIndex) + if ((unsigned int)(p - buffer()) <= fromIndex) found = p - buffer(); } return found; @@ -677,10 +636,11 @@ String String::substring(unsigned int left, unsigned int right) const { return out; if (right > len()) right = len(); - char temp = buffer()[right]; // save the replaced character - wbuffer()[right] = '\0'; - out = wbuffer() + left; // pointer arithmetic - wbuffer()[right] = temp; //restore character + char *writeTo = wbuffer(); + char tempchar = writeTo[right]; // save the replaced character + writeTo[right] = '\0'; + out = writeTo + left; // pointer arithmetic + writeTo[right] = tempchar; // restore character return out; } @@ -697,7 +657,7 @@ void String::replace(char find, char replace) { } } -void String::replace(const String& find, const String& replace) { +void String::replace(const String &find, const String &replace) { if (len() == 0 || find.len() == 0) return; int diff = replace.len() - find.len(); @@ -719,7 +679,7 @@ void String::replace(const String& find, const String& replace) { readFrom = foundAt + find.len(); setLen(len() + diff); } - memmove_P(writeTo, readFrom, strlen(readFrom)+1); + memmove_P(writeTo, readFrom, strlen(readFrom) + 1); } else { unsigned int size = len(); // compute size needed for result while ((foundAt = strstr(readFrom, find.buffer())) != NULL) { @@ -743,13 +703,6 @@ void String::replace(const String& find, const String& replace) { } } -void String::remove(unsigned int index) { - // Pass the biggest integer as the count. The remove method - // below will take care of truncating it at the end of the - // string. - remove(index, (unsigned int) -1); -} - void String::remove(unsigned int index, unsigned int count) { if (index >= len()) { return; @@ -812,11 +765,10 @@ long String::toInt(void) const { float String::toFloat(void) const { if (buffer()) return atof(buffer()); - return 0; + return 0.0F; } -double String::toDouble(void) const -{ +double String::toDouble(void) const { if (buffer()) return atof(buffer()); return 0.0; diff --git a/cores/esp8266/WString.h b/cores/esp8266/WString.h index c9b79f21c..dcb098238 100644 --- a/cores/esp8266/WString.h +++ b/cores/esp8266/WString.h @@ -53,7 +53,7 @@ class String { // if the initial value is null or invalid, or if memory allocation // fails, the string will be marked as invalid (i.e. "if (s)" will // be false). - String() { + String() __attribute__((always_inline)) { // See init() init(); } String(const char *cstr); @@ -61,7 +61,12 @@ class String { String(const __FlashStringHelper *str); String(String &&rval) noexcept; String(StringSumHelper &&rval) noexcept; - explicit String(char c); + explicit String(char c) { + sso.buff[0] = c; + sso.buff[1] = 0; + sso.len = 1; + sso.isHeap = 0; + } explicit String(unsigned char, unsigned char base = 10); explicit String(int, unsigned char base = 10); explicit String(unsigned int, unsigned char base = 10); @@ -69,35 +74,35 @@ class String { explicit String(unsigned long, unsigned char base = 10); explicit String(float, unsigned char decimalPlaces = 2); explicit String(double, unsigned char decimalPlaces = 2); - ~String(void); + ~String() { + invalidate(); + } // memory management // return true on success, false on failure (in which case, the string // is left unchanged). reserve(0), if successful, will validate an // invalid string (i.e., "if (s)" will be true afterwards) unsigned char reserve(unsigned int size); - inline unsigned int length(void) const { - if(buffer()) { - return len(); - } else { - return 0; - } + unsigned int length(void) const { + return buffer() ? len() : 0; } - inline void clear(void) { + void clear(void) { setLen(0); } - inline bool isEmpty(void) const { + bool isEmpty(void) const { return length() == 0; } // creates a copy of the assigned value. if the value is null or // invalid, or if the memory allocation fails, the string will be // marked as invalid ("if (s)" will be false). - String & operator =(const String &rhs); - String & operator =(const char *cstr); - String & operator = (const __FlashStringHelper *str); - String & operator =(String &&rval) noexcept; - String & operator =(StringSumHelper &&rval) noexcept; + String &operator =(const String &rhs); + String &operator =(const char *cstr); + String &operator =(const __FlashStringHelper *str); + String &operator =(String &&rval) noexcept; + String &operator =(StringSumHelper &&rval) noexcept { + return operator =((String &&)rval); + } // concatenate (works w/ built-in types) @@ -114,67 +119,67 @@ class String { unsigned char concat(unsigned long num); unsigned char concat(float num); unsigned char concat(double num); - unsigned char concat(const __FlashStringHelper * str); + unsigned char concat(const __FlashStringHelper *str); unsigned char concat(const char *cstr, unsigned int length); // if there's not enough memory for the concatenated value, the string // will be left unchanged (but this isn't signalled in any way) - String & operator +=(const String &rhs) { + String &operator +=(const String &rhs) { concat(rhs); - return (*this); + return *this; } - String & operator +=(const char *cstr) { + String &operator +=(const char *cstr) { concat(cstr); - return (*this); + return *this; } - String & operator +=(char c) { + String &operator +=(char c) { concat(c); - return (*this); + return *this; } - String & operator +=(unsigned char num) { + String &operator +=(unsigned char num) { concat(num); - return (*this); + return *this; } - String & operator +=(int num) { + String &operator +=(int num) { concat(num); - return (*this); + return *this; } - String & operator +=(unsigned int num) { + String &operator +=(unsigned int num) { concat(num); - return (*this); + return *this; } - String & operator +=(long num) { + String &operator +=(long num) { concat(num); - return (*this); + return *this; } - String & operator +=(unsigned long num) { + String &operator +=(unsigned long num) { concat(num); - return (*this); + return *this; } - String & operator +=(float num) { + String &operator +=(float num) { concat(num); - return (*this); + return *this; } - String & operator +=(double num) { + String &operator +=(double num) { concat(num); - return (*this); + return *this; } - String & operator += (const __FlashStringHelper *str){ + String &operator +=(const __FlashStringHelper *str) { concat(str); - return (*this); + return *this; } - friend StringSumHelper & operator +(const StringSumHelper &lhs, const String &rhs); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const char *cstr); - friend StringSumHelper & operator +(const StringSumHelper &lhs, char c); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned char num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned int num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, unsigned long num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, float num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, double num); - friend StringSumHelper & operator +(const StringSumHelper &lhs, const __FlashStringHelper *rhs); + friend StringSumHelper &operator +(const StringSumHelper &lhs, const String &rhs); + friend StringSumHelper &operator +(const StringSumHelper &lhs, const char *cstr); + friend StringSumHelper &operator +(const StringSumHelper &lhs, char c); + friend StringSumHelper &operator +(const StringSumHelper &lhs, unsigned char num); + friend StringSumHelper &operator +(const StringSumHelper &lhs, int num); + friend StringSumHelper &operator +(const StringSumHelper &lhs, unsigned int num); + friend StringSumHelper &operator +(const StringSumHelper &lhs, long num); + friend StringSumHelper &operator +(const StringSumHelper &lhs, unsigned long num); + friend StringSumHelper &operator +(const StringSumHelper &lhs, float num); + friend StringSumHelper &operator +(const StringSumHelper &lhs, double num); + friend StringSumHelper &operator +(const StringSumHelper &lhs, const __FlashStringHelper *rhs); // comparison (only works w/ Strings and "strings") operator StringIfHelperType() const { @@ -202,41 +207,45 @@ class String { unsigned char equalsIgnoreCase(const String &s) const; unsigned char equalsConstantTime(const String &s) const; unsigned char startsWith(const String &prefix) const; - unsigned char startsWith(const char * prefix) const { + unsigned char startsWith(const char *prefix) const { return this->startsWith(String(prefix)); } - unsigned char startsWith(const __FlashStringHelper * prefix) const { + unsigned char startsWith(const __FlashStringHelper *prefix) const { return this->startsWith(String(prefix)); } unsigned char startsWith(const String &prefix, unsigned int offset) const; unsigned char endsWith(const String &suffix) const; - unsigned char endsWith(const char * suffix) const { + unsigned char endsWith(const char *suffix) const { return this->endsWith(String(suffix)); } - unsigned char endsWith(const __FlashStringHelper * suffix) const { + unsigned char endsWith(const __FlashStringHelper *suffix) const { return this->endsWith(String(suffix)); } // character access - char charAt(unsigned int index) const; + char charAt(unsigned int index) const { + return operator [](index); + } void setCharAt(unsigned int index, char c); char operator [](unsigned int index) const; - char& operator [](unsigned int index); + char &operator [](unsigned int index); void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index = 0) const; void toCharArray(char *buf, unsigned int bufsize, unsigned int index = 0) const { getBytes((unsigned char *) buf, bufsize, index); } - const char* c_str() const { return buffer(); } - char* begin() { return wbuffer(); } - char* end() { return wbuffer() + length(); } - const char* begin() const { return c_str(); } - const char* end() const { return c_str() + length(); } + const char *c_str() const { return buffer(); } + char *begin() { return wbuffer(); } + char *end() { return wbuffer() + length(); } + const char *begin() const { return c_str(); } + const char *end() const { return c_str() + length(); } // search - int indexOf(char ch) const; - int indexOf(char ch, unsigned int fromIndex) const; - int indexOf(const String &str) const; - int indexOf(const String &str, unsigned int fromIndex) const; + int indexOf(char ch, unsigned int fromIndex = 0) const; + int indexOf(const char *str, unsigned int fromIndex = 0) const; + int indexOf(const __FlashStringHelper *str, unsigned int fromIndex = 0) const { + return indexOf((const char*)str, fromIndex); + } + int indexOf(const String &str, unsigned int fromIndex = 0) const; int lastIndexOf(char ch) const; int lastIndexOf(char ch, unsigned int fromIndex) const; int lastIndexOf(const String &str) const; @@ -244,29 +253,29 @@ class String { String substring(unsigned int beginIndex) const { return substring(beginIndex, len()); } - ; String substring(unsigned int beginIndex, unsigned int endIndex) const; // modification void replace(char find, char replace); - void replace(const String& find, const String& replace); - void replace(const char * find, const String& replace) { + void replace(const String &find, const String &replace); + void replace(const char *find, const String &replace) { this->replace(String(find), replace); } - void replace(const __FlashStringHelper * find, const String& replace) { + void replace(const __FlashStringHelper *find, const String &replace) { this->replace(String(find), replace); } - void replace(const char * find, const char * replace) { + void replace(const char *find, const char *replace) { this->replace(String(find), String(replace)); } - void replace(const __FlashStringHelper * find, const char * replace) { + void replace(const __FlashStringHelper *find, const char *replace) { this->replace(String(find), String(replace)); } - void replace(const __FlashStringHelper * find, const __FlashStringHelper * replace) { + void replace(const __FlashStringHelper *find, const __FlashStringHelper *replace) { this->replace(String(find), String(replace)); } - void remove(unsigned int index); - void remove(unsigned int index, unsigned int count); + // Pass the biggest integer if the count is not specified. + // The remove method below will take care of truncating it at the end of the string. + void remove(unsigned int index, unsigned int count = (unsigned int)-1); void toLowerCase(void); void toUpperCase(void); void trim(void); @@ -274,11 +283,11 @@ class String { // parsing/conversion long toInt(void) const; float toFloat(void) const; - double toDouble(void) const; + double toDouble(void) const; protected: // Contains the string info when we're not in SSO mode - struct _ptr { + struct _ptr { char * buff; uint16_t cap; uint16_t len; @@ -287,8 +296,8 @@ class String { enum { SSOSIZE = sizeof(struct _ptr) + 4 - 1 }; // Characters to allocate space for SSO, must be 12 or more struct _sso { char buff[SSOSIZE]; - unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields - unsigned char isSSO : 1; + unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields + unsigned char isHeap : 1; } __attribute__((packed)); // Ensure that GCC doesn't expand the flag byte to a 32-bit word for alignment issues enum { CAPACITY_MAX = 65535 }; // If typeof(cap) changed from uint16_t, be sure to update this enum to the max value storable in the type union { @@ -296,25 +305,47 @@ class String { struct _sso sso; }; // Accessor functions - inline bool isSSO() const { return sso.isSSO; } - inline unsigned int len() const { return isSSO() ? sso.len : ptr.len; } - inline unsigned int capacity() const { return isSSO() ? (unsigned int)SSOSIZE - 1 : ptr.cap; } // Size of max string not including terminal NUL - inline void setSSO(bool set) { sso.isSSO = set; } - inline void setLen(int len) { if (isSSO()) sso.len = len; else ptr.len = len; } - inline void setCapacity(int cap) { if (!isSSO()) ptr.cap = cap; } - inline void setBuffer(char *buff) { if (!isSSO()) ptr.buff = buff; } + bool isSSO() const { return !sso.isHeap; } + unsigned int len() const { return isSSO() ? sso.len : ptr.len; } + unsigned int capacity() const { return isSSO() ? (unsigned int)SSOSIZE - 1 : ptr.cap; } // Size of max string not including terminal NUL + void setSSO(bool set) { sso.isHeap = !set; } + void setLen(int len) { + if (isSSO()) { + setSSO(true); // Avoid emitting of bitwise EXTRACT-AND-OR ops (store-merging optimization) + sso.len = len; + } else + ptr.len = len; + } + void setCapacity(int cap) { if (!isSSO()) ptr.cap = cap; } + void setBuffer(char *buff) { if (!isSSO()) ptr.buff = buff; } // Buffer accessor functions - inline const char *buffer() const { return (const char *)(isSSO() ? sso.buff : ptr.buff); } - inline char *wbuffer() const { return isSSO() ? const_cast(sso.buff) : ptr.buff; } // Writable version of buffer + const char *buffer() const { return wbuffer(); } + char *wbuffer() const { return isSSO() ? const_cast(sso.buff) : ptr.buff; } // Writable version of buffer protected: - void init(void); + void init(void) __attribute__((always_inline)) { + sso.buff[0] = 0; + sso.len = 0; + sso.isHeap = 0; + // Without the 6 statements shown below, GCC simply emits such as: "MOVI.N aX,0", "S8I aX,a2,0" and "S8I aX,a2,11" (8 bytes in total) + sso.buff[1] = 0; + sso.buff[2] = 0; + sso.buff[3] = 0; + sso.buff[8] = 0; + sso.buff[9] = 0; + sso.buff[10] = 0; + // With the above, thanks to store-merging, GCC can use the narrow form of 32-bit store insn ("S32I.N") and emits: + // "MOVI.N aX,0", "S32I.N aX,a2,0" and "S32I.N aX,a2,8" (6 bytes in total) + // (Literature: Xtensa(R) Instruction Set Reference Manual, "S8I - Store 8-bit" [p.504] and "S32I.N - Narrow Store 32-bit" [p.512]) + // Unfortunately, GCC seems not to re-evaluate the cost of inlining after the store-merging optimizer stage, + // `always_inline` attribute is necessary in order to keep inlining. + } void invalidate(void); unsigned char changeBuffer(unsigned int maxStrLen); // copy and move - String & copy(const char *cstr, unsigned int length); - String & copy(const __FlashStringHelper *pstr, unsigned int length); + String ©(const char *cstr, unsigned int length); + String ©(const __FlashStringHelper *pstr, unsigned int length); void move(String &rhs) noexcept; }; @@ -350,6 +381,9 @@ class StringSumHelper: public String { StringSumHelper(double num) : String(num) { } + StringSumHelper(const __FlashStringHelper *s) : + String(s) { + } }; extern const String emptyString; diff --git a/cores/esp8266/aes_unwrap.cpp b/cores/esp8266/aes_unwrap.cpp new file mode 100644 index 000000000..b3bf2066b --- /dev/null +++ b/cores/esp8266/aes_unwrap.cpp @@ -0,0 +1,163 @@ +/* + * Replacement for the ROM aes_unwrap() function. It uses the heap instead of + * the static DRAM address at 0x3FFFEA80, which may step on the SYS stack in + * special circumstances such as HWDT Stack Dump. + * + * When not using WPS, the address space 0x3FFFE000 up to 0x40000000 is mostly + * available for the stacks. The one known exception is the ROM AES APIs. When + * `aes_decrypt_init` is called, it uses memory at 0x3FFFEA80 up to 0x3FFFEB30 + * for a buffer. At the finish, `aes_decrypt_deinit` zeros out the buffer. + * + * The NONOS SDK appears to have replacements for most of the ROM's AES APIs. + * However, the SDK still calls on the ROM's aes_unwrap function, which uses + * the ROM's AES APIs to operate. These calls can overwrite some of the stack + * space. To resolve the problem, this module replaces `aes_unwrap`. + * + * Final note, so far, I have not seen a problem when using the extra 4K heap + * option without the "debug HWDT". It is when combined with the HWDT Stack + * Dump that a problem shows. This combination adds a Boot ROM stack, which + * pushes up the SYS and CONT stacks into the AES Buffer space. Then the + * problem shows. + * + * While debugging with painted stack space, during WiFi Connect, Reconnect, + * and about every hour, a block of memory 0x3FFFEA80 - 0x3FFFEB30 (176 bytes) + * was zeroed by the Boot ROM function aes_decrypt_init. All other painted + * memory in the area was untouched after starting WiFi. + */ + +#if defined(KEEP_ROM_AES_UNWRAP) +// Using the ROM version of aes_unwrap should be fine for the no extra 4K case +// which is usually used in conjunction with WPS. + +#else +// This is required for DEBUG_ESP_HWDT. +// The need is unconfirmed for the extra 4K heap case. +#include "umm_malloc/umm_malloc.h" + +extern "C" { + +// Uses this function from the Boot ROM +void rijndaelKeySetupDec(u32 rk[], const u8 cipherKey[]); + +// This replaces the Boot ROM version just for this module +// Uses a malloc-ed buffer instead of the static buffer in stack address space. +static void *aes_decrypt_init(const u8 *key, size_t len) { + if (16u != len) { + return 0; + } + u32 *rk = (u32 *)malloc(16*11); + // u32 *rk = (u32 *)0x3FFFEA80u; // This is what the ROM would have used. + if (rk) { + rijndaelKeySetupDec(rk, key); + } + return (void *)rk; +} + +// This replaces the Boot ROM version just for this module +static void aes_decrypt_deinit(void *ctx) { + if (ctx) { + ets_memset(ctx, 0, 16*11); + free(ctx); + } + return; +} + +/* + * The NONOS SDK has an override on this function. To replace the aes_unwrap + * without changing its behavior too much. We need access to the ROM version of + * the AES APIs to make our aes_unwrap functionally equal to the current + * environment except for the AES Buffer. + */ +#ifndef ROM_aes_decrypt +#define ROM_aes_decrypt 0x400092d4 +#endif + +typedef void (*fp_aes_decrypt_t)(void *ctx, const u8 *crypt, u8 *plain); +#define AES_DECRYPT (reinterpret_cast(ROM_aes_decrypt)) + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +/* + * This aes_unwrap() function overrides/replaces the Boot ROM version. + * + * It was adapted from aes_unwrap() found in the ESP8266 RTOS SDK + * .../components/wap_supplicant/src/crypto/aes-unwrap.c + * + */ +/////////////////////////////////////////////////////////////////////////////// +/* + * AES key unwrap (128-bit KEK, RFC3394) + * + * Copyright (c) 2003-2007, Jouni Malinen + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * Alternatively, this software may be distributed under the terms of BSD + * license. + * + * See README and COPYING for more details. + */ + +/** based on RTOS SDK + * aes_unwrap - Unwrap key with AES Key Wrap Algorithm (128-bit KEK) (RFC3394) + * @kek: Key encryption key (KEK) + * @n: Length of the plaintext key in 64-bit units; e.g., 2 = 128-bit = 16 + * bytes + * @cipher: Wrapped key to be unwrapped, (n + 1) * 64 bits + * @plain: Plaintext key, n * 64 bits + * Returns: 0 on success, -1 on failure (e.g., integrity verification failed) + */ +int aes_unwrap(const u8 *kek, int n, const u8 *cipher, u8 *plain) +{ + u8 a[8], *r, b[16]; + int i, j; + void *ctx; + + /* 1) Initialize variables. */ + ets_memcpy(a, cipher, 8); + r = plain; + ets_memcpy(r, cipher + 8, 8 * n); + + ctx = aes_decrypt_init(kek, 16); + if (ctx == NULL) + return -1; + + /* 2) Compute intermediate values. + * For j = 5 to 0 + * For i = n to 1 + * B = AES-1(K, (A ^ t) | R[i]) where t = n*j+i + * A = MSB(64, B) + * R[i] = LSB(64, B) + */ + for (j = 5; j >= 0; j--) { + r = plain + (n - 1) * 8; + for (i = n; i >= 1; i--) { + ets_memcpy(b, a, 8); + b[7] ^= n * j + i; + + ets_memcpy(b + 8, r, 8); + AES_DECRYPT(ctx, b, b); + ets_memcpy(a, b, 8); + ets_memcpy(r, b + 8, 8); + r -= 8; + } + } + aes_decrypt_deinit(ctx); + + /* 3) Output results. + * + * These are already in @plain due to the location of temporary + * variables. Just verify that the IV matches with the expected value. + */ + for (i = 0; i < 8; i++) { + if (a[i] != 0xa6) + return -1; + } + + return 0; +} +}; +#endif diff --git a/cores/esp8266/core_esp8266_i2s.cpp b/cores/esp8266/core_esp8266_i2s.cpp index d783d1afc..dccd7c1df 100644 --- a/cores/esp8266/core_esp8266_i2s.cpp +++ b/cores/esp8266/core_esp8266_i2s.cpp @@ -64,6 +64,7 @@ typedef struct i2s_state { // 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. + bool driveClocks; } i2s_state_t; // RX = I2S receive (i.e. microphone), TX = I2S transmit (i.e. DAC) @@ -493,6 +494,10 @@ float i2s_get_real_rate(){ } bool i2s_rxtx_begin(bool enableRx, bool enableTx) { + return i2s_rxtxdrive_begin(enableRx, enableTx, true, true); +} + +bool i2s_rxtxdrive_begin(bool enableRx, bool enableTx, bool driveRxClocks, bool driveTxClocks) { if (tx || rx) { i2s_end(); // Stop and free any ongoing stuff } @@ -503,9 +508,12 @@ bool i2s_rxtx_begin(bool enableRx, bool enableTx) { // Nothing to clean up yet return false; // OOM Error! } - pinMode(I2SO_WS, FUNCTION_1); + tx->driveClocks = driveTxClocks; pinMode(I2SO_DATA, FUNCTION_1); - pinMode(I2SO_BCK, FUNCTION_1); + if (driveTxClocks) { + pinMode(I2SO_WS, FUNCTION_1); + pinMode(I2SO_BCK, FUNCTION_1); + } } if (enableRx) { rx = (i2s_state_t*)calloc(1, sizeof(*rx)); @@ -513,12 +521,15 @@ bool i2s_rxtx_begin(bool enableRx, bool enableTx) { i2s_end(); // Clean up any TX or pin changes return false; // OOM error! } - pinMode(I2SI_WS, OUTPUT); - pinMode(I2SI_BCK, OUTPUT); + rx->driveClocks = driveRxClocks; pinMode(I2SI_DATA, INPUT); + if (driveRxClocks) { + pinMode(I2SI_WS, OUTPUT); + pinMode(I2SI_BCK, OUTPUT); + PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, FUNC_I2SI_BCK); + PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTMS_U, FUNC_I2SI_WS); + } 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); } if (!i2s_slc_begin()) { @@ -579,15 +590,19 @@ void i2s_end() { if (tx) { pinMode(I2SO_DATA, INPUT); - pinMode(I2SO_BCK, INPUT); - pinMode(I2SO_WS, INPUT); + if (tx->driveClocks) { + 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); + if (rx->driveClocks) { + 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 21724e2eb..417c3f26e 100644 --- a/cores/esp8266/core_esp8266_main.cpp +++ b/cores/esp8266/core_esp8266_main.cpp @@ -35,6 +35,9 @@ extern "C" { #include #include "gdb_hooks.h" #include "flash_quirks.h" +#include +#include + #define LOOP_TASK_PRIORITY 1 #define LOOP_QUEUE_SIZE 1 @@ -204,7 +207,9 @@ static void loop_wrapper() { static void loop_task(os_event_t *events) { (void) events; s_cycles_at_yield_start = ESP.getCycleCount(); + ESP.resetHeap(); cont_run(g_pcont, &loop_wrapper); + ESP.setDramHeap(); if (cont_check(g_pcont) != 0) { panic(); } @@ -256,6 +261,7 @@ void init_done() { std::set_terminate(__unhandled_exception_cpp); do_global_ctors(); esp_schedule(); + ESP.setDramHeap(); } /* This is the entry point of the application. @@ -314,11 +320,11 @@ extern "C" void app_entry_redefinable(void) /* Call the entry point of the SDK code. */ call_user_start(); } - static void app_entry_custom (void) __attribute__((weakref("app_entry_redefinable"))); extern "C" void app_entry (void) { + umm_init(); return app_entry_custom(); } @@ -342,6 +348,12 @@ extern "C" void user_init(void) { cont_init(g_pcont); +#if defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP) + install_non32xfer_exception_handler(); +#endif +#if defined(MMU_IRAM_HEAP) + umm_init_iram(); +#endif preinit(); // Prior to C++ Dynamic Init (not related to above init() ). Meant to be user redefinable. ets_task(loop_task, diff --git a/cores/esp8266/core_esp8266_non32xfer.cpp b/cores/esp8266/core_esp8266_non32xfer.cpp new file mode 100644 index 000000000..4eb0e3a50 --- /dev/null +++ b/cores/esp8266/core_esp8266_non32xfer.cpp @@ -0,0 +1,219 @@ +/* 020819 + Based on PR https://github.com/esp8266/Arduino/pull/6978 + Enhanced to also handle store operations to iRAM and optional range + validation. Also improved failed path to generate crash report. + And, partially refactored. + + Apologies if this is being pedantic, I was getting confused over these so + I tried to understand what makes them different. + + EXCCAUSE_LOAD_STORE_ERROR 3 is a non-32-bit load or store to an address that + only supports a full 32-bit aligned transfer like IRAM or ICACHE. i.e., No + 8-bit char or 16-bit short transfers allowed. + + EXCCAUSE_UNALIGNED 9 is an exception cause when load or store is not on an + aligned boundary that matches the element's width. + eg. *(short *)0x3FFF8001 = 1; or *(long *)0x3FFF8002 = 1; + + */ + +/* + * This exception handler handles EXCCAUSE_LOAD_STORE_ERROR. It allows for a + * byte or short access to iRAM or PROGMEM to succeed without causing a crash. + * When reading, it is still preferred to use the xxx_P macros when possible + * since they are probably 30x faster than this exception handler method. + * + * Code taken directly from @pvvx's public domain code in + * https://github.com/pvvx/esp8266web/blob/master/app/sdklib/system/app_main.c + * + * + */ + +#include +#define VERIFY_C_ASM_EXCEPTION_FRAME_STRUCTURE +#include +#include +#include +#include +#include + +// All of these optimization were tried and now work +// These results were from irammem.ino using GCC 10.2 +// DRAM reference uint16 9 AVG cycles/transfer +// #pragma GCC optimize("O0") // uint16, 289 AVG cycles/transfer, IRAM: +180 +// #pragma GCC optimize("O1") // uint16, 241 AVG cycles/transfer, IRAM: +16 +#pragma GCC optimize("O2") // uint16, 230 AVG cycles/transfer, IRAM: +4 +// #pragma GCC optimize("O3") // uint16, 230 AVG cycles/transfer, IRAM: +4 +// #pragma GCC optimize("Ofast") // uint16, 230 AVG cycles/transfer, IRAM: +4 +// #pragma GCC optimize("Os") // uint16, 233 AVG cycles/transfer, IRAM: 27556 +0 + +extern "C" { + +#define LOAD_MASK 0x00f00fu +#define L8UI_MATCH 0x000002u +#define L16UI_MATCH 0x001002u +#define L16SI_MATCH 0x009002u +#define S8I_MATCH 0x004002u +#define S16I_MATCH 0x005002u + +#define EXCCAUSE_LOAD_STORE_ERROR 3 /* Non 32-bit read/write error */ + +static fn_c_exception_handler_t old_c_handler = NULL; + +static +IRAM_ATTR void non32xfer_exception_handler(struct __exception_frame *ef, int cause) +{ + do { + /* + In adapting the public domain version, a crash would come or go away with + the slightest unrelated changes elsewhere in the function. Observed that + register a15 was used for epc1, then clobbered by `rsr.` I now believe a + "&" on the output register would have resolved the problem. + + However, I have refactored the Extended ASM to reduce and consolidate + register usage and corrected the issue. + + The positioning of the Extended ASM block (as early as possible in the + compiled function) is in part controlled by the immediate need for + output variable `insn`. This placement aids in getting excvaddr read as + early as possible. + */ + uint32_t insn, excvaddr; +#if 1 + { + uint32_t tmp; + __asm__ ( + "rsr.excvaddr %[vaddr]\n\t" /* Read faulting address as early as possible */ + "movi.n %[tmp], ~3\n\t" /* prepare a mask for the EPC */ + "and %[tmp], %[tmp], %[epc]\n\t" /* apply mask for 32-bit aligned base */ + "ssa8l %[epc]\n\t" /* set up shift register for src op */ + "l32i %[insn], %[tmp], 0\n\t" /* load part 1 */ + "l32i %[tmp], %[tmp], 4\n\t" /* load part 2 */ + "src %[insn], %[tmp], %[insn]\n\t" /* right shift to get faulting instruction */ + : [vaddr]"=&r"(excvaddr), [insn]"=&r"(insn), [tmp]"=&r"(tmp) + : [epc]"r"(ef->epc) :); + } + +#else + { + __asm__ __volatile__ ("rsr.excvaddr %0;" : "=r"(excvaddr):: "memory"); + /* + "C" reference code for the ASM to document intent. + May also prove useful when issolating possible issues with Extended ASM, + optimizations, new compilers, etc. + */ + uint32_t epc = ef->epc; + uint32_t *pWord = (uint32_t *)(epc & ~3); + uint64_t big_word = ((uint64_t)pWord[1] << 32) | pWord[0]; + uint32_t pos = (epc & 3) * 8; + insn = (uint32_t)(big_word >>= pos); + } +#endif + + uint32_t what = insn & LOAD_MASK; + uint32_t valmask = 0; + + uint32_t is_read = 1; + if (L8UI_MATCH == what || S8I_MATCH == what) { + valmask = 0xffu; + if (S8I_MATCH == what) { + is_read = 0; + } + } else if (L16UI_MATCH == what || L16SI_MATCH == what || S16I_MATCH == what) { + valmask = 0xffffu; + if (S16I_MATCH == what) { + is_read = 0; + } + } else { + continue; /* fail */ + } + + int regno = (insn & 0x0000f0u) >> 4; + if (regno == 1) { + continue; /* we can't support storing into a1, just die */ + } else if (regno != 0) { + --regno; /* account for skipped a1 in exception_frame */ + } + +#ifdef DEBUG_ESP_MMU + /* debug option to validate address so we don't hide memory access bugs in APP */ + if (mmu_is_iram((void *)excvaddr) || (is_read && mmu_is_icache((void *)excvaddr))) { + /* all is good */ + } else { + continue; /* fail */ + } +#endif + { + uint32_t *pWord = (uint32_t *)(excvaddr & ~0x3); + uint32_t pos = (excvaddr & 0x3) * 8; + uint32_t mem_val = *pWord; + + if (is_read) { + /* shift and mask down to correct size */ + mem_val >>= pos; + mem_val &= valmask; + + /* Sign-extend for L16SI, if applicable */ + if (what == L16SI_MATCH && (mem_val & 0x8000)) { + mem_val |= 0xffff0000; + } + + ef->a_reg[regno] = mem_val; /* carry out the load */ + + } else { /* is write */ + uint32_t val = ef->a_reg[regno]; /* get value to store from register */ + val <<= pos; + valmask <<= pos; + val &= valmask; + + /* mask out field, and merge */ + mem_val &= (~valmask); + mem_val |= val; + *pWord = mem_val; /* carry out the store */ + } + } + + ef->epc += 3; /* resume at following instruction */ + return; + + } while(false); + +/* Fail request, die */ + /* + The old handler points to the SDK. Be alert for HWDT when Calling with + INTLEVEL != 0. I cannot create it any more. I thought I saw this as a + problem; however, my test case shows no problem ?? Maybe I was confused. + */ + if (old_c_handler) { // if (0 == (ef->ps & 0x0F)) { + DBG_MMU_PRINTF("\ncalling previous load/store handler(%p)\n", old_c_handler); + old_c_handler(ef, cause); + return; + } + + /* + Calling _xtos_unhandled_exception(ef, cause) in the Boot ROM, gets us a + hardware wdt. + + Use panic instead as a fall back. It will produce a stack trace. + */ + panic(); +} + +/* + To operate reliably, this module requires the new + `_xtos_set_exception_handler` from `exc-sethandler.cpp` and + `_xtos_c_wrapper_handler` from `exc-c-wrapper-handler.S`. See comment block in + `exc-sethandler.cpp` for details on issues with interrupts being enabled by + "C" wrapper. + */ +void install_non32xfer_exception_handler(void) __attribute__((weak)); +void install_non32xfer_exception_handler(void) { + if (NULL == old_c_handler) { + // Set the "C" exception handler the wrapper will call + old_c_handler = + _xtos_set_exception_handler(EXCCAUSE_LOAD_STORE_ERROR, + non32xfer_exception_handler); + } +} + +}; diff --git a/cores/esp8266/core_esp8266_non32xfer.h b/cores/esp8266/core_esp8266_non32xfer.h new file mode 100644 index 000000000..93151239c --- /dev/null +++ b/cores/esp8266/core_esp8266_non32xfer.h @@ -0,0 +1,14 @@ +#ifndef __CORE_ESP8266_NON32XFER_H +#define __CORE_ESP8266_NON32XFER_H + +#ifdef __cplusplus +extern "C" { +#endif + +extern void install_non32xfer_exception_handler(); + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/cores/esp8266/core_esp8266_waveform.cpp b/cores/esp8266/core_esp8266_waveform.cpp deleted file mode 100644 index 597a8e88a..000000000 --- a/cores/esp8266/core_esp8266_waveform.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* - esp8266_waveform - General purpose waveform generation and control, - supporting outputs on all pins in parallel. - - Copyright (c) 2018 Earle F. Philhower, III. All rights reserved. - - The core idea is to have a programmable waveform generator with a unique - high and low period (defined in microseconds or CPU clock cycles). TIMER1 is - set to 1-shot mode and is always loaded with the time until the next edge - of any live waveforms. - - Up to one waveform generator per pin supported. - - Each waveform generator is synchronized to the ESP clock cycle counter, not the - timer. This allows for removing interrupt jitter and delay as the counter - always increments once per 80MHz clock. Changes to a waveform are - contiguous and only take effect on the next waveform transition, - allowing for smooth transitions. - - This replaces older tone(), analogWrite(), and the Servo classes. - - Everywhere in the code where "cycles" is used, it means ESP.getCycleCount() - clock cycle count, or an interval measured in CPU clock cycles, but not TIMER1 - cycles (which may be 2 CPU clock cycles @ 160MHz). - - 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 "ets_sys.h" -#include "core_esp8266_waveform.h" - -extern "C" { - -// Maximum delay between IRQs -#define MAXIRQUS (10000) - -// Set/clear GPIO 0-15 by bitmask -#define SetGPIO(a) do { GPOS = a; } while (0) -#define ClearGPIO(a) do { GPOC = a; } while (0) - -// Waveform generator can create tones, PWM, and servos -typedef struct { - uint32_t nextServiceCycle; // ESP cycle timer when a transition required - uint32_t expiryCycle; // For time-limited waveform, the cycle when this waveform must stop - uint32_t nextTimeHighCycles; // Copy over low->high to keep smooth waveform - uint32_t nextTimeLowCycles; // Copy over high->low to keep smooth waveform -} Waveform; - -static Waveform waveform[17]; // State of all possible pins -static volatile uint32_t waveformState = 0; // Is the pin high or low, updated in NMI so no access outside the NMI code -static volatile uint32_t waveformEnabled = 0; // Is it actively running, updated in NMI so no access outside the NMI code - -// Enable lock-free by only allowing updates to waveformState and waveformEnabled from IRQ service routine -static volatile uint32_t waveformToEnable = 0; // Message to the NMI handler to start a waveform on a inactive pin -static volatile uint32_t waveformToDisable = 0; // Message to the NMI handler to disable a pin from waveform generation - -static uint32_t (*timer1CB)() = NULL; - - -// Non-speed critical bits -#pragma GCC optimize ("Os") - -static inline ICACHE_RAM_ATTR uint32_t GetCycleCount() { - uint32_t ccount; - __asm__ __volatile__("esync; rsr %0,ccount":"=a"(ccount)); - return ccount; -} - -// Interrupt on/off control -static ICACHE_RAM_ATTR void timer1Interrupt(); -static bool timerRunning = false; - -static void initTimer() { - timer1_disable(); - ETS_FRC_TIMER1_INTR_ATTACH(NULL, NULL); - ETS_FRC_TIMER1_NMI_INTR_ATTACH(timer1Interrupt); - timer1_enable(TIM_DIV1, TIM_EDGE, TIM_SINGLE); - timerRunning = true; -} - -static void ICACHE_RAM_ATTR deinitTimer() { - ETS_FRC_TIMER1_NMI_INTR_ATTACH(NULL); - timer1_disable(); - timer1_isr_init(); - timerRunning = false; -} - -// Set a callback. Pass in NULL to stop it -void setTimer1Callback(uint32_t (*fn)()) { - timer1CB = fn; - if (!timerRunning && fn) { - initTimer(); - timer1_write(microsecondsToClockCycles(1)); // Cause an interrupt post-haste - } else if (timerRunning && !fn && !waveformEnabled) { - deinitTimer(); - } -} - -// Start up a waveform on a pin, or change the current one. Will change to the new -// waveform smoothly on next low->high transition. For immediate change, stopWaveform() -// first, then it will immediately begin. -int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t runTimeUS) { - return startWaveformClockCycles(pin, microsecondsToClockCycles(timeHighUS), microsecondsToClockCycles(timeLowUS), microsecondsToClockCycles(runTimeUS)); -} - -int startWaveformClockCycles(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles) { - if ((pin > 16) || isFlashInterfacePin(pin)) { - return false; - } - Waveform *wave = &waveform[pin]; - // Adjust to shave off some of the IRQ time, approximately - wave->nextTimeHighCycles = timeHighCycles; - wave->nextTimeLowCycles = timeLowCycles; - wave->expiryCycle = runTimeCycles ? GetCycleCount() + runTimeCycles : 0; - if (runTimeCycles && !wave->expiryCycle) { - wave->expiryCycle = 1; // expiryCycle==0 means no timeout, so avoid setting it - } - - uint32_t mask = 1<nextServiceCycle = GetCycleCount() + microsecondsToClockCycles(1); - waveformToEnable |= mask; - if (!timerRunning) { - initTimer(); - timer1_write(microsecondsToClockCycles(10)); - } else { - // Ensure timely service.... - if (T1L > microsecondsToClockCycles(10)) { - timer1_write(microsecondsToClockCycles(10)); - } - } - while (waveformToEnable) { - delay(0); // Wait for waveform to update - } - } - - return true; -} - -// Speed critical bits -#pragma GCC optimize ("O2") -// Normally would not want two copies like this, but due to different -// optimization levels the inline attribute gets lost if we try the -// other version. - -static inline ICACHE_RAM_ATTR uint32_t GetCycleCountIRQ() { - uint32_t ccount; - __asm__ __volatile__("rsr %0,ccount":"=a"(ccount)); - return ccount; -} - -static inline ICACHE_RAM_ATTR uint32_t min_u32(uint32_t a, uint32_t b) { - if (a < b) { - return a; - } - return b; -} - -// Stops a waveform on a pin -int ICACHE_RAM_ATTR stopWaveform(uint8_t pin) { - // Can't possibly need to stop anything if there is no timer active - if (!timerRunning) { - return false; - } - // If user sends in a pin >16 but <32, this will always point to a 0 bit - // If they send >=32, then the shift will result in 0 and it will also return false - if (waveformEnabled & (1UL << pin)) { - waveformToDisable = 1UL << pin; - // Must not interfere if Timer is due shortly - if (T1L > microsecondsToClockCycles(10)) { - timer1_write(microsecondsToClockCycles(10)); - } - while (waveformToDisable) { - /* no-op */ // Can't delay() since stopWaveform may be called from an IRQ - } - } - if (!waveformEnabled && !timer1CB) { - deinitTimer(); - } - return true; -} - -// The SDK and hardware take some time to actually get to our NMI code, so -// decrement the next IRQ's timer value by a bit so we can actually catch the -// real CPU cycle counter we want for the waveforms. -#if F_CPU == 80000000 - #define DELTAIRQ (microsecondsToClockCycles(3)) -#else - #define DELTAIRQ (microsecondsToClockCycles(2)) -#endif - - -static ICACHE_RAM_ATTR void timer1Interrupt() { - // Optimize the NMI inner loop by keeping track of the min and max GPIO that we - // are generating. In the common case (1 PWM) these may be the same pin and - // we can avoid looking at the other pins. - static int startPin = 0; - static int endPin = 0; - - uint32_t nextEventCycles = microsecondsToClockCycles(MAXIRQUS); - uint32_t timeoutCycle = GetCycleCountIRQ() + microsecondsToClockCycles(14); - - if (waveformToEnable || waveformToDisable) { - // Handle enable/disable requests from main app. - waveformEnabled = (waveformEnabled & ~waveformToDisable) | waveformToEnable; // Set the requested waveforms on/off - waveformState &= ~waveformToEnable; // And clear the state of any just started - waveformToEnable = 0; - waveformToDisable = 0; - // Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t) - startPin = __builtin_ffs(waveformEnabled) - 1; - // Find the last bit by subtracting off GCC's count-leading-zeros (no offset in this one) - endPin = 32 - __builtin_clz(waveformEnabled); - } - - bool done = false; - if (waveformEnabled) { - do { - nextEventCycles = microsecondsToClockCycles(MAXIRQUS); - for (int i = startPin; i <= endPin; i++) { - uint32_t mask = 1<expiryCycle) { - int32_t expiryToGo = wave->expiryCycle - now; - if (expiryToGo < 0) { - // Done, remove! - waveformEnabled &= ~mask; - if (i == 16) { - GP16O &= ~1; - } else { - ClearGPIO(mask); - } - continue; - } - } - - // Check for toggles - int32_t cyclesToGo = wave->nextServiceCycle - now; - if (cyclesToGo < 0) { - waveformState ^= mask; - if (waveformState & mask) { - if (i == 16) { - GP16O |= 1; // GPIO16 write slow as it's RMW - } else { - SetGPIO(mask); - } - wave->nextServiceCycle = now + wave->nextTimeHighCycles; - nextEventCycles = min_u32(nextEventCycles, wave->nextTimeHighCycles); - } else { - if (i == 16) { - GP16O &= ~1; // GPIO16 write slow as it's RMW - } else { - ClearGPIO(mask); - } - wave->nextServiceCycle = now + wave->nextTimeLowCycles; - nextEventCycles = min_u32(nextEventCycles, wave->nextTimeLowCycles); - } - } else { - uint32_t deltaCycles = wave->nextServiceCycle - now; - nextEventCycles = min_u32(nextEventCycles, deltaCycles); - } - } - - // Exit the loop if we've hit the fixed runtime limit or the next event is known to be after that timeout would occur - uint32_t now = GetCycleCountIRQ(); - int32_t cycleDeltaNextEvent = timeoutCycle - (now + nextEventCycles); - int32_t cyclesLeftTimeout = timeoutCycle - now; - done = (cycleDeltaNextEvent < 0) || (cyclesLeftTimeout < 0); - } while (!done); - } // if (waveformEnabled) - - if (timer1CB) { - nextEventCycles = min_u32(nextEventCycles, timer1CB()); - } - - if (nextEventCycles < microsecondsToClockCycles(10)) { - nextEventCycles = microsecondsToClockCycles(10); - } - nextEventCycles -= DELTAIRQ; - - // Do it here instead of global function to save time and because we know it's edge-IRQ -#if F_CPU == 160000000 - T1L = nextEventCycles >> 1; // Already know we're in range by MAXIRQUS -#else - T1L = nextEventCycles; // Already know we're in range by MAXIRQUS -#endif - TEIE |= TEIE1; // Edge int enable -} - -}; diff --git a/cores/esp8266/core_esp8266_waveform.h b/cores/esp8266/core_esp8266_waveform.h index e42a17f89..119af4181 100644 --- a/cores/esp8266/core_esp8266_waveform.h +++ b/cores/esp8266/core_esp8266_waveform.h @@ -2,6 +2,7 @@ esp8266_waveform - General purpose waveform generation and control, supporting outputs on all pins in parallel. + -- Default, PWM locked version -- Copyright (c) 2018 Earle F. Philhower, III. All rights reserved. The core idea is to have a programmable waveform generator with a unique @@ -22,6 +23,30 @@ Everywhere in the code where "cycles" is used, it means ESP.getCycleCount() clock cycle count, or an interval measured in CPU clock cycles, but not TIMER1 cycles (which may be 2 CPU clock cycles @ 160MHz). + ---------- + + -- Phase locked version -- + Copyright (c) 2020 Dirk O. Kaar. + + The core idea is to have a programmable waveform generator with a unique + high and low period (defined in microseconds or CPU clock cycles). TIMER1 is + set to 1-shot mode and is always loaded with the time until the next edge + of any live waveforms. + + Up to one waveform generator per pin supported. + + Each waveform generator is synchronized to the ESP clock cycle counter, not the + timer. This allows for removing interrupt jitter and delay as the counter + always increments once per 80MHz clock. Changes to a waveform are + contiguous and only take effect on the next waveform transition, + allowing for smooth transitions. + + This replaces older tone(), analogWrite(), and the Servo classes. + + Everywhere in the code where "ccy" or "ccys" is used, it means ESP.getCycleCount() + clock cycle count, or an interval measured in CPU clock cycles, but not TIMER1 + cycles (which may be 2 CPU clock cycles @ 160MHz). + ---------- This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -47,20 +72,41 @@ extern "C" { #endif +// Call this function in your setup() to cause the phase locked version of the generator to +// be linked in automatically. Otherwise, the default PWM locked version will be used. +void enablePhaseLockedWaveform(void); + + // Start or change a waveform of the specified high and low times on specific pin. -// If runtimeUS > 0 then automatically stop it after that many usecs. +// If runtimeUS > 0 then automatically stop it after that many usecs, relative to the next +// full period. +// If waveform is not yet started on pin, and on pin == alignPhase a waveform is running, +// the new waveform is started at phaseOffsetUS phase offset, in microseconds, to that. +// Setting autoPwm to true allows the wave generator to maintain PWM duty to idle cycle ratio +// under load, for applications where frequency or duty cycle must not change, leave false. // Returns true or false on success or failure. -int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t runTimeUS); +int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t runTimeUS = 0, + // Following parameters are ignored unless in PhaseLocked mode + int8_t alignPhase = -1, uint32_t phaseOffsetUS = 0, bool autoPwm = false); + // Start or change a waveform of the specified high and low CPU clock cycles on specific pin. -// If runtimeCycles > 0 then automatically stop it after that many CPU clock cycles. +// If runtimeCycles > 0 then automatically stop it after that many CPU clock cycles, relative to the next +// full period. +// If waveform is not yet started on pin, and on pin == alignPhase a waveform is running, +// the new waveform is started at phaseOffsetCcys phase offset, in CPU clock cycles, to that. +// Setting autoPwm to true allows the wave generator to maintain PWM duty to idle cycle ratio +// under load, for applications where frequency or duty cycle must not change, leave false. // Returns true or false on success or failure. -int startWaveformClockCycles(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles); +int startWaveformClockCycles(uint8_t pin, uint32_t timeHighCcys, uint32_t timeLowCcys, uint32_t runTimeCcys = 0, + // Following parameters are ignored unless in PhaseLocked mode + int8_t alignPhase = -1, uint32_t phaseOffsetCcys = 0, bool autoPwm = false); + // Stop a waveform, if any, on the specified pin. // Returns true or false on success or failure. int stopWaveform(uint8_t pin); // Add a callback function to be called on *EVERY* timer1 trigger. The -// callback returns the number of microseconds until the next desired call. +// callback must return the number of CPU clock cycles until the next desired call. // However, since it is called every timer1 interrupt, it may be called // again before this period. It should therefore use the ESP Cycle Counter // to determine whether or not to perform an operation. @@ -69,6 +115,12 @@ int stopWaveform(uint8_t pin); // Make sure the CB function has the ICACHE_RAM_ATTR decorator. void setTimer1Callback(uint32_t (*fn)()); + +// Internal-only calls, not for applications +extern void _setPWMFreq(uint32_t freq); +extern bool _stopPWM(uint8_t pin); +extern bool _setPWM(int pin, uint32_t val, uint32_t range); + #ifdef __cplusplus } #endif diff --git a/cores/esp8266/core_esp8266_waveform_phase.cpp b/cores/esp8266/core_esp8266_waveform_phase.cpp new file mode 100644 index 000000000..f15d3c959 --- /dev/null +++ b/cores/esp8266/core_esp8266_waveform_phase.cpp @@ -0,0 +1,444 @@ +/* + esp8266_waveform - General purpose waveform generation and control, + supporting outputs on all pins in parallel. + + Copyright (c) 2018 Earle F. Philhower, III. All rights reserved. + Copyright (c) 2020 Dirk O. Kaar. + + The core idea is to have a programmable waveform generator with a unique + high and low period (defined in microseconds or CPU clock cycles). TIMER1 is + set to 1-shot mode and is always loaded with the time until the next edge + of any live waveforms. + + Up to one waveform generator per pin supported. + + Each waveform generator is synchronized to the ESP clock cycle counter, not the + timer. This allows for removing interrupt jitter and delay as the counter + always increments once per 80MHz clock. Changes to a waveform are + contiguous and only take effect on the next waveform transition, + allowing for smooth transitions. + + This replaces older tone(), analogWrite(), and the Servo classes. + + Everywhere in the code where "ccy" or "ccys" is used, it means ESP.getCycleCount() + clock cycle time, or an interval measured in clock cycles, but not TIMER1 + cycles (which may be 2 CPU clock cycles @ 160MHz). + + 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 "core_esp8266_waveform.h" +#include +#include "debug.h" +#include "ets_sys.h" +#include + + +extern "C" void enablePhaseLockedWaveform (void) +{ + // Does nothing, added to app to enable linking these versions + // of the waveform functions instead of the default. + DEBUGV("Enabling phase locked waveform generator\n"); +} + +// No-op calls to override the PWM implementation +extern "C" void _setPWMFreq_weak(uint32_t freq) { (void) freq; } +extern "C" bool _stopPWM_weak(int pin) { (void) pin; return false; } +extern "C" bool _setPWM_weak(int pin, uint32_t val, uint32_t range) { (void) pin; (void) val; (void) range; return false; } + + +// Timer is 80MHz fixed. 160MHz CPU frequency need scaling. +constexpr bool ISCPUFREQ160MHZ = clockCyclesPerMicrosecond() == 160; +// Maximum delay between IRQs, Timer1, <= 2^23 / 80MHz +constexpr int32_t MAXIRQTICKSCCYS = microsecondsToClockCycles(10000); +// Maximum servicing time for any single IRQ +constexpr uint32_t ISRTIMEOUTCCYS = microsecondsToClockCycles(18); +// The latency between in-ISR rearming of the timer and the earliest firing +constexpr int32_t IRQLATENCYCCYS = microsecondsToClockCycles(2); +// The SDK and hardware take some time to actually get to our NMI code +constexpr int32_t DELTAIRQCCYS = ISCPUFREQ160MHZ ? + microsecondsToClockCycles(2) >> 1 : microsecondsToClockCycles(2); + +// for INFINITE, the NMI proceeds on the waveform without expiry deadline. +// for EXPIRES, the NMI expires the waveform automatically on the expiry ccy. +// for UPDATEEXPIRY, the NMI recomputes the exact expiry ccy and transitions to EXPIRES. +// for INIT, the NMI initializes nextPeriodCcy, and if expiryCcy != 0 includes UPDATEEXPIRY. +enum class WaveformMode : uint8_t {INFINITE = 0, EXPIRES = 1, UPDATEEXPIRY = 2, INIT = 3}; + +// Waveform generator can create tones, PWM, and servos +typedef struct { + uint32_t nextPeriodCcy; // ESP clock cycle when a period begins. If WaveformMode::INIT, temporarily holds positive phase offset ccy count + uint32_t endDutyCcy; // ESP clock cycle when going from duty to off + int32_t dutyCcys; // Set next off cycle at low->high to maintain phase + int32_t adjDutyCcys; // Temporary correction for next period + int32_t periodCcys; // Set next phase cycle at low->high to maintain phase + uint32_t expiryCcy; // For time-limited waveform, the CPU clock cycle when this waveform must stop. If WaveformMode::UPDATE, temporarily holds relative ccy count + WaveformMode mode; + int8_t alignPhase; // < 0 no phase alignment, otherwise starts waveform in relative phase offset to given pin + bool autoPwm; // perform PWM duty to idle cycle ratio correction under high load at the expense of precise timings +} Waveform; + +namespace { + + static struct { + Waveform pins[17]; // State of all possible pins + uint32_t states = 0; // Is the pin high or low, updated in NMI so no access outside the NMI code + uint32_t enabled = 0; // Is it actively running, updated in NMI so no access outside the NMI code + + // Enable lock-free by only allowing updates to waveform.states and waveform.enabled from IRQ service routine + int32_t toSetBits = 0; // Message to the NMI handler to start/modify exactly one waveform + int32_t toDisableBits = 0; // Message to the NMI handler to disable exactly one pin from waveform generation + + uint32_t(*timer1CB)() = nullptr; + + bool timer1Running = false; + + uint32_t nextEventCcy; + } waveform; + +} + +// Interrupt on/off control +static ICACHE_RAM_ATTR void timer1Interrupt(); + +// Non-speed critical bits +#pragma GCC optimize ("Os") + +static void initTimer() { + timer1_disable(); + ETS_FRC_TIMER1_INTR_ATTACH(NULL, NULL); + ETS_FRC_TIMER1_NMI_INTR_ATTACH(timer1Interrupt); + timer1_enable(TIM_DIV1, TIM_EDGE, TIM_SINGLE); + waveform.timer1Running = true; + timer1_write(IRQLATENCYCCYS); // Cause an interrupt post-haste +} + +static void ICACHE_RAM_ATTR deinitTimer() { + ETS_FRC_TIMER1_NMI_INTR_ATTACH(NULL); + timer1_disable(); + timer1_isr_init(); + waveform.timer1Running = false; +} + +extern "C" { + +// Set a callback. Pass in NULL to stop it +void setTimer1Callback_weak(uint32_t (*fn)()) { + waveform.timer1CB = fn; + std::atomic_thread_fence(std::memory_order_acq_rel); + if (!waveform.timer1Running && fn) { + initTimer(); + } else if (waveform.timer1Running && !fn && !waveform.enabled) { + deinitTimer(); + } +} + +// Start up a waveform on a pin, or change the current one. Will change to the new +// waveform smoothly on next low->high transition. For immediate change, stopWaveform() +// first, then it will immediately begin. +int startWaveformClockCycles_weak(uint8_t pin, uint32_t highCcys, uint32_t lowCcys, + uint32_t runTimeCcys, int8_t alignPhase, uint32_t phaseOffsetCcys, bool autoPwm) { + uint32_t periodCcys = highCcys + lowCcys; + if (periodCcys < MAXIRQTICKSCCYS) { + if (!highCcys) { + periodCcys = (MAXIRQTICKSCCYS / periodCcys) * periodCcys; + } + else if (!lowCcys) { + highCcys = periodCcys = (MAXIRQTICKSCCYS / periodCcys) * periodCcys; + } + } + // sanity checks, including mixed signed/unsigned arithmetic safety + if ((pin > 16) || isFlashInterfacePin(pin) || (alignPhase > 16) || + static_cast(periodCcys) <= 0 || + static_cast(highCcys) < 0 || static_cast(lowCcys) < 0) { + return false; + } + Waveform& wave = waveform.pins[pin]; + wave.dutyCcys = highCcys; + wave.adjDutyCcys = 0; + wave.periodCcys = periodCcys; + wave.autoPwm = autoPwm; + + std::atomic_thread_fence(std::memory_order_acquire); + const uint32_t pinBit = 1UL << pin; + if (!(waveform.enabled & pinBit)) { + // wave.nextPeriodCcy and wave.endDutyCcy are initialized by the ISR + wave.nextPeriodCcy = phaseOffsetCcys; + wave.expiryCcy = runTimeCcys; // in WaveformMode::INIT, temporarily hold relative cycle count + wave.mode = WaveformMode::INIT; + wave.alignPhase = (alignPhase < 0) ? -1 : alignPhase; + if (!wave.dutyCcys) { + // If initially at zero duty cycle, force GPIO off + if (pin == 16) { + GP16O = 0; + } + else { + GPOC = pinBit; + } + } + std::atomic_thread_fence(std::memory_order_release); + waveform.toSetBits = 1UL << pin; + std::atomic_thread_fence(std::memory_order_release); + if (!waveform.timer1Running) { + initTimer(); + } + else if (T1V > IRQLATENCYCCYS) { + // Must not interfere if Timer is due shortly + timer1_write(IRQLATENCYCCYS); + } + } + else { + wave.mode = WaveformMode::INFINITE; // turn off possible expiry to make update atomic from NMI + std::atomic_thread_fence(std::memory_order_release); + wave.expiryCcy = runTimeCcys; // in WaveformMode::UPDATEEXPIRY, temporarily hold relative cycle count + if (runTimeCcys) { + wave.mode = WaveformMode::UPDATEEXPIRY; + std::atomic_thread_fence(std::memory_order_release); + waveform.toSetBits = 1UL << pin; + } + } + std::atomic_thread_fence(std::memory_order_acq_rel); + while (waveform.toSetBits) { + delay(0); // Wait for waveform to update + std::atomic_thread_fence(std::memory_order_acquire); + } + return true; +} + +// Stops a waveform on a pin +ICACHE_RAM_ATTR int stopWaveform_weak(uint8_t pin) { + // Can't possibly need to stop anything if there is no timer active + if (!waveform.timer1Running) { + return false; + } + // If user sends in a pin >16 but <32, this will always point to a 0 bit + // If they send >=32, then the shift will result in 0 and it will also return false + std::atomic_thread_fence(std::memory_order_acquire); + const uint32_t pinBit = 1UL << pin; + if (waveform.enabled & pinBit) { + waveform.toDisableBits = 1UL << pin; + std::atomic_thread_fence(std::memory_order_release); + // Must not interfere if Timer is due shortly + if (T1V > IRQLATENCYCCYS) { + timer1_write(IRQLATENCYCCYS); + } + while (waveform.toDisableBits) { + /* no-op */ // Can't delay() since stopWaveform may be called from an IRQ + std::atomic_thread_fence(std::memory_order_acquire); + } + } + if (!waveform.enabled && !waveform.timer1CB) { + deinitTimer(); + } + return true; +} + +}; + +// Speed critical bits +#pragma GCC optimize ("O2") + +// For dynamic CPU clock frequency switch in loop the scaling logic would have to be adapted. +// Using constexpr makes sure that the CPU clock frequency is compile-time fixed. +static inline ICACHE_RAM_ATTR int32_t scaleCcys(const int32_t ccys, const bool isCPU2X) { + if (ISCPUFREQ160MHZ) { + return isCPU2X ? ccys : (ccys >> 1); + } + else { + return isCPU2X ? (ccys << 1) : ccys; + } +} + +static ICACHE_RAM_ATTR void timer1Interrupt() { + const uint32_t isrStartCcy = ESP.getCycleCount(); + int32_t clockDrift = isrStartCcy - waveform.nextEventCcy; + const bool isCPU2X = CPU2X & 1; + if ((waveform.toSetBits && !(waveform.enabled & waveform.toSetBits)) || waveform.toDisableBits) { + // Handle enable/disable requests from main app. + waveform.enabled = (waveform.enabled & ~waveform.toDisableBits) | waveform.toSetBits; // Set the requested waveforms on/off + // Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t) + waveform.toDisableBits = 0; + } + + if (waveform.toSetBits) { + const int toSetPin = __builtin_ffs(waveform.toSetBits) - 1; + Waveform& wave = waveform.pins[toSetPin]; + switch (wave.mode) { + case WaveformMode::INIT: + waveform.states &= ~waveform.toSetBits; // Clear the state of any just started + if (wave.alignPhase >= 0 && waveform.enabled & (1UL << wave.alignPhase)) { + wave.nextPeriodCcy = waveform.pins[wave.alignPhase].nextPeriodCcy + wave.nextPeriodCcy; + } + else { + wave.nextPeriodCcy = waveform.nextEventCcy; + } + if (!wave.expiryCcy) { + wave.mode = WaveformMode::INFINITE; + break; + } + // fall through + case WaveformMode::UPDATEEXPIRY: + // in WaveformMode::UPDATEEXPIRY, expiryCcy temporarily holds relative CPU cycle count + wave.expiryCcy = wave.nextPeriodCcy + scaleCcys(wave.expiryCcy, isCPU2X); + wave.mode = WaveformMode::EXPIRES; + break; + default: + break; + } + waveform.toSetBits = 0; + } + + // Exit the loop if the next event, if any, is sufficiently distant. + const uint32_t isrTimeoutCcy = isrStartCcy + ISRTIMEOUTCCYS; + uint32_t busyPins = waveform.enabled; + waveform.nextEventCcy = isrStartCcy + MAXIRQTICKSCCYS; + + uint32_t now = ESP.getCycleCount(); + uint32_t isrNextEventCcy = now; + while (busyPins) { + if (static_cast(isrNextEventCcy - now) > IRQLATENCYCCYS) { + waveform.nextEventCcy = isrNextEventCcy; + break; + } + isrNextEventCcy = waveform.nextEventCcy; + uint32_t loopPins = busyPins; + while (loopPins) { + const int pin = __builtin_ffsl(loopPins) - 1; + const uint32_t pinBit = 1UL << pin; + loopPins ^= pinBit; + + Waveform& wave = waveform.pins[pin]; + + if (clockDrift) { + wave.endDutyCcy += clockDrift; + wave.nextPeriodCcy += clockDrift; + wave.expiryCcy += clockDrift; + } + + uint32_t waveNextEventCcy = (waveform.states & pinBit) ? wave.endDutyCcy : wave.nextPeriodCcy; + if (WaveformMode::EXPIRES == wave.mode && + static_cast(waveNextEventCcy - wave.expiryCcy) >= 0 && + static_cast(now - wave.expiryCcy) >= 0) { + // Disable any waveforms that are done + waveform.enabled ^= pinBit; + busyPins ^= pinBit; + } + else { + const int32_t overshootCcys = now - waveNextEventCcy; + if (overshootCcys >= 0) { + const int32_t periodCcys = scaleCcys(wave.periodCcys, isCPU2X); + if (waveform.states & pinBit) { + // active configuration and forward are 100% duty + if (wave.periodCcys == wave.dutyCcys) { + wave.nextPeriodCcy += periodCcys; + wave.endDutyCcy = wave.nextPeriodCcy; + } + else { + if (wave.autoPwm) { + wave.adjDutyCcys += overshootCcys; + } + waveform.states ^= pinBit; + if (16 == pin) { + GP16O = 0; + } + else { + GPOC = pinBit; + } + } + waveNextEventCcy = wave.nextPeriodCcy; + } + else { + wave.nextPeriodCcy += periodCcys; + if (!wave.dutyCcys) { + wave.endDutyCcy = wave.nextPeriodCcy; + } + else { + int32_t dutyCcys = scaleCcys(wave.dutyCcys, isCPU2X); + if (dutyCcys <= wave.adjDutyCcys) { + dutyCcys >>= 1; + wave.adjDutyCcys -= dutyCcys; + } + else if (wave.adjDutyCcys) { + dutyCcys -= wave.adjDutyCcys; + wave.adjDutyCcys = 0; + } + wave.endDutyCcy = now + dutyCcys; + if (static_cast(wave.endDutyCcy - wave.nextPeriodCcy) > 0) { + wave.endDutyCcy = wave.nextPeriodCcy; + } + waveform.states |= pinBit; + if (16 == pin) { + GP16O = 1; + } + else { + GPOS = pinBit; + } + } + waveNextEventCcy = wave.endDutyCcy; + } + + if (WaveformMode::EXPIRES == wave.mode && static_cast(waveNextEventCcy - wave.expiryCcy) > 0) { + waveNextEventCcy = wave.expiryCcy; + } + } + + if (static_cast(waveNextEventCcy - isrTimeoutCcy) >= 0) { + busyPins ^= pinBit; + if (static_cast(waveform.nextEventCcy - waveNextEventCcy) > 0) { + waveform.nextEventCcy = waveNextEventCcy; + } + } + else if (static_cast(isrNextEventCcy - waveNextEventCcy) > 0) { + isrNextEventCcy = waveNextEventCcy; + } + } + now = ESP.getCycleCount(); + } + clockDrift = 0; + } + + int32_t callbackCcys = 0; + if (waveform.timer1CB) { + callbackCcys = scaleCcys(waveform.timer1CB(), isCPU2X); + } + now = ESP.getCycleCount(); + int32_t nextEventCcys = waveform.nextEventCcy - now; + // Account for unknown duration of timer1CB(). + if (waveform.timer1CB && nextEventCcys > callbackCcys) { + waveform.nextEventCcy = now + callbackCcys; + nextEventCcys = callbackCcys; + } + + // Timer is 80MHz fixed. 160MHz CPU frequency need scaling. + int32_t deltaIrqCcys = DELTAIRQCCYS; + int32_t irqLatencyCcys = IRQLATENCYCCYS; + if (isCPU2X) { + nextEventCcys >>= 1; + deltaIrqCcys >>= 1; + irqLatencyCcys >>= 1; + } + + // Firing timer too soon, the NMI occurs before ISR has returned. + if (nextEventCcys < irqLatencyCcys + deltaIrqCcys) { + waveform.nextEventCcy = now + IRQLATENCYCCYS + DELTAIRQCCYS; + nextEventCcys = irqLatencyCcys; + } + else { + nextEventCcys -= deltaIrqCcys; + } + + // Register access is fast and edge IRQ was configured before. + T1L = nextEventCcys; +} diff --git a/cores/esp8266/core_esp8266_waveform_pwm.cpp b/cores/esp8266/core_esp8266_waveform_pwm.cpp new file mode 100644 index 000000000..7cbdabd89 --- /dev/null +++ b/cores/esp8266/core_esp8266_waveform_pwm.cpp @@ -0,0 +1,666 @@ +/* + esp8266_waveform - General purpose waveform generation and control, + supporting outputs on all pins in parallel. + + Copyright (c) 2018 Earle F. Philhower, III. All rights reserved. + + The core idea is to have a programmable waveform generator with a unique + high and low period (defined in microseconds or CPU clock cycles). TIMER1 + is set to 1-shot mode and is always loaded with the time until the next + edge of any live waveforms. + + Up to one waveform generator per pin supported. + + Each waveform generator is synchronized to the ESP clock cycle counter, not + the timer. This allows for removing interrupt jitter and delay as the + counter always increments once per 80MHz clock. Changes to a waveform are + contiguous and only take effect on the next waveform transition, + allowing for smooth transitions. + + This replaces older tone(), analogWrite(), and the Servo classes. + + Everywhere in the code where "cycles" is used, it means ESP.getCycleCount() + clock cycle count, or an interval measured in CPU clock cycles, but not + TIMER1 cycles (which may be 2 CPU clock cycles @ 160MHz). + + 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 "ets_sys.h" +#include "core_esp8266_waveform.h" +#include "user_interface.h" + + +extern "C" { + +// Maximum delay between IRQs +#define MAXIRQUS (10000) + +// Waveform generator can create tones, PWM, and servos +typedef struct { + uint32_t nextServiceCycle; // ESP cycle timer when a transition required + uint32_t expiryCycle; // For time-limited waveform, the cycle when this waveform must stop + uint32_t timeHighCycles; // Actual running waveform period (adjusted using desiredCycles) + uint32_t timeLowCycles; // + uint32_t desiredHighCycles; // Ideal waveform period to drive the error signal + uint32_t desiredLowCycles; // + uint32_t lastEdge; // Cycle when this generator last changed +} Waveform; + +class WVFState { +public: + Waveform waveform[17]; // State of all possible pins + uint32_t waveformState = 0; // Is the pin high or low, updated in NMI so no access outside the NMI code + uint32_t waveformEnabled = 0; // Is it actively running, updated in NMI so no access outside the NMI code + + // Enable lock-free by only allowing updates to waveformState and waveformEnabled from IRQ service routine + uint32_t waveformToEnable = 0; // Message to the NMI handler to start a waveform on a inactive pin + uint32_t waveformToDisable = 0; // Message to the NMI handler to disable a pin from waveform generation + + uint32_t waveformToChange = 0; // Mask of pin to change. One bit set in main app, cleared when effected in the NMI + uint32_t waveformNewHigh = 0; + uint32_t waveformNewLow = 0; + + uint32_t (*timer1CB)() = NULL; + + // Optimize the NMI inner loop by keeping track of the min and max GPIO that we + // are generating. In the common case (1 PWM) these may be the same pin and + // we can avoid looking at the other pins. + uint16_t startPin = 0; + uint16_t endPin = 0; +}; +static WVFState wvfState; + + +// Ensure everything is read/written to RAM +#define MEMBARRIER() { __asm__ volatile("" ::: "memory"); } + +// Non-speed critical bits +#pragma GCC optimize ("Os") + +// Interrupt on/off control +static ICACHE_RAM_ATTR void timer1Interrupt(); +static bool timerRunning = false; + +static __attribute__((noinline)) void initTimer() { + if (!timerRunning) { + timer1_disable(); + ETS_FRC_TIMER1_INTR_ATTACH(NULL, NULL); + ETS_FRC_TIMER1_NMI_INTR_ATTACH(timer1Interrupt); + timer1_enable(TIM_DIV1, TIM_EDGE, TIM_SINGLE); + timerRunning = true; + timer1_write(microsecondsToClockCycles(10)); + } +} + +static ICACHE_RAM_ATTR void forceTimerInterrupt() { + if (T1L > microsecondsToClockCycles(10)) { + T1L = microsecondsToClockCycles(10); + } +} + +// PWM implementation using special purpose state machine +// +// Keep an ordered list of pins with the delta in cycles between each +// element, with a terminal entry making up the remainder of the PWM +// period. With this method sum(all deltas) == PWM period clock cycles. +// +// At t=0 set all pins high and set the timeout for the 1st edge. +// On interrupt, if we're at the last element reset to t=0 state +// Otherwise, clear that pin down and set delay for next element +// and so forth. + +constexpr int maxPWMs = 8; + +// PWM machine state +typedef struct PWMState { + uint32_t mask; // Bitmask of active pins + uint32_t cnt; // How many entries + uint32_t idx; // Where the state machine is along the list + uint8_t pin[maxPWMs + 1]; + uint32_t delta[maxPWMs + 1]; + uint32_t nextServiceCycle; // Clock cycle for next step + struct PWMState *pwmUpdate; // Set by main code, cleared by ISR +} PWMState; + +static PWMState pwmState; +static uint32_t _pwmFreq = 1000; +static uint32_t _pwmPeriod = microsecondsToClockCycles(1000000UL) / _pwmFreq; + + +// If there are no more scheduled activities, shut down Timer 1. +// Otherwise, do nothing. +static ICACHE_RAM_ATTR void disableIdleTimer() { + if (timerRunning && !wvfState.waveformEnabled && !pwmState.cnt && !wvfState.timer1CB) { + ETS_FRC_TIMER1_NMI_INTR_ATTACH(NULL); + timer1_disable(); + timer1_isr_init(); + timerRunning = false; + } +} + +// Notify the NMI that a new PWM state is available through the mailbox. +// Wait for mailbox to be emptied (either busy or delay() as needed) +static ICACHE_RAM_ATTR void _notifyPWM(PWMState *p, bool idle) { + p->pwmUpdate = nullptr; + pwmState.pwmUpdate = p; + MEMBARRIER(); + forceTimerInterrupt(); + while (pwmState.pwmUpdate) { + if (idle) { + delay(0); + } + MEMBARRIER(); + } +} + +static void _addPWMtoList(PWMState &p, int pin, uint32_t val, uint32_t range); + + +// Called when analogWriteFreq() changed to update the PWM total period +extern void _setPWMFreq_weak(uint32_t freq) __attribute__((weak)); +void _setPWMFreq_weak(uint32_t freq) { + _pwmFreq = freq; + + // Convert frequency into clock cycles + uint32_t cc = microsecondsToClockCycles(1000000UL) / freq; + + // Simple static adjustment to bring period closer to requested due to overhead + // Empirically determined as a constant PWM delay and a function of the number of PWMs +#if F_CPU == 80000000 + cc -= ((microsecondsToClockCycles(pwmState.cnt) * 13) >> 4) + 110; +#else + cc -= ((microsecondsToClockCycles(pwmState.cnt) * 10) >> 4) + 75; +#endif + + if (cc == _pwmPeriod) { + return; // No change + } + + _pwmPeriod = cc; + + if (pwmState.cnt) { + PWMState p; // The working copy since we can't edit the one in use + p.mask = 0; + p.cnt = 0; + for (uint32_t i = 0; i < pwmState.cnt; i++) { + auto pin = pwmState.pin[i]; + _addPWMtoList(p, pin, wvfState.waveform[pin].desiredHighCycles, wvfState.waveform[pin].desiredLowCycles); + } + // Update and wait for mailbox to be emptied + initTimer(); + _notifyPWM(&p, true); + disableIdleTimer(); + } +} +static void _setPWMFreq_bound(uint32_t freq) __attribute__((weakref("_setPWMFreq_weak"))); +void _setPWMFreq(uint32_t freq) { + _setPWMFreq_bound(freq); +} + + +// Helper routine to remove an entry from the state machine +// and clean up any marked-off entries +static void _cleanAndRemovePWM(PWMState *p, int pin) { + uint32_t leftover = 0; + uint32_t in, out; + for (in = 0, out = 0; in < p->cnt; in++) { + if ((p->pin[in] != pin) && (p->mask & (1<pin[in]))) { + p->pin[out] = p->pin[in]; + p->delta[out] = p->delta[in] + leftover; + leftover = 0; + out++; + } else { + leftover += p->delta[in]; + p->mask &= ~(1<pin[in]); + } + } + p->cnt = out; + // Final pin is never used: p->pin[out] = 0xff; + p->delta[out] = p->delta[in] + leftover; +} + + +// Disable PWM on a specific pin (i.e. when a digitalWrite or analogWrite(0%/100%)) +extern bool _stopPWM_weak(uint8_t pin) __attribute__((weak)); +ICACHE_RAM_ATTR bool _stopPWM_weak(uint8_t pin) { + if (!((1<= _pwmPeriod) { + cc = _pwmPeriod - 1; + } + + if (p.cnt == 0) { + // Starting up from scratch, special case 1st element and PWM period + p.pin[0] = pin; + p.delta[0] = cc; + // Final pin is never used: p.pin[1] = 0xff; + p.delta[1] = _pwmPeriod - cc; + } else { + uint32_t ttl = 0; + uint32_t i; + // Skip along until we're at the spot to insert + for (i=0; (i <= p.cnt) && (ttl + p.delta[i] < cc); i++) { + ttl += p.delta[i]; + } + // Shift everything out by one to make space for new edge + for (int32_t j = p.cnt; j >= (int)i; j--) { + p.pin[j + 1] = p.pin[j]; + p.delta[j + 1] = p.delta[j]; + } + int off = cc - ttl; // The delta from the last edge to the one we're inserting + p.pin[i] = pin; + p.delta[i] = off; // Add the delta to this new pin + p.delta[i + 1] -= off; // And subtract it from the follower to keep sum(deltas) constant + } + p.cnt++; + p.mask |= 1<= maxPWMs) { + return false; // No space left + } + + // Sanity check for all-on/off + uint32_t cc = (_pwmPeriod * val) / range; + if ((cc == 0) || (cc >= _pwmPeriod)) { + digitalWrite(pin, cc ? HIGH : LOW); + return true; + } + + _addPWMtoList(p, pin, val, range); + + // Set mailbox and wait for ISR to copy it over + initTimer(); + _notifyPWM(&p, true); + disableIdleTimer(); + + // Potentially recalculate the PWM period if we've added another pin + _setPWMFreq(_pwmFreq); + + return true; +} +static bool _setPWM_bound(int pin, uint32_t val, uint32_t range) __attribute__((weakref("_setPWM_weak"))); +bool _setPWM(int pin, uint32_t val, uint32_t range) { + return _setPWM_bound(pin, val, range); +} + +// Start up a waveform on a pin, or change the current one. Will change to the new +// waveform smoothly on next low->high transition. For immediate change, stopWaveform() +// first, then it will immediately begin. +extern int startWaveformClockCycles_weak(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles, int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) __attribute__((weak)); +int startWaveformClockCycles_weak(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles, + int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) { + (void) alignPhase; + (void) phaseOffsetUS; + (void) autoPwm; + + if ((pin > 16) || isFlashInterfacePin(pin)) { + return false; + } + Waveform *wave = &wvfState.waveform[pin]; + wave->expiryCycle = runTimeCycles ? ESP.getCycleCount() + runTimeCycles : 0; + if (runTimeCycles && !wave->expiryCycle) { + wave->expiryCycle = 1; // expiryCycle==0 means no timeout, so avoid setting it + } + + _stopPWM(pin); // Make sure there's no PWM live here + + uint32_t mask = 1<timeHighCycles = timeHighCycles; + wave->desiredHighCycles = timeHighCycles; + wave->timeLowCycles = timeLowCycles; + wave->desiredLowCycles = timeLowCycles; + wave->lastEdge = 0; + wave->nextServiceCycle = ESP.getCycleCount() + microsecondsToClockCycles(1); + wvfState.waveformToEnable |= mask; + MEMBARRIER(); + initTimer(); + forceTimerInterrupt(); + while (wvfState.waveformToEnable) { + delay(0); // Wait for waveform to update + // No mem barrier here, the call to a global function implies global state updated + } + } + + return true; +} +static int startWaveformClockCycles_bound(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles, int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) __attribute__((weakref("startWaveformClockCycles_weak"))); +int startWaveformClockCycles(uint8_t pin, uint32_t timeHighCycles, uint32_t timeLowCycles, uint32_t runTimeCycles, int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) { + return startWaveformClockCycles_bound(pin, timeHighCycles, timeLowCycles, runTimeCycles, alignPhase, phaseOffsetUS, autoPwm); +} + + +// This version falls-thru to the proper startWaveformClockCycles call and is invariant across waveform generators +int startWaveform(uint8_t pin, uint32_t timeHighUS, uint32_t timeLowUS, uint32_t runTimeUS, + int8_t alignPhase, uint32_t phaseOffsetUS, bool autoPwm) { + return startWaveformClockCycles_bound(pin, + microsecondsToClockCycles(timeHighUS), microsecondsToClockCycles(timeLowUS), + microsecondsToClockCycles(runTimeUS), alignPhase, microsecondsToClockCycles(phaseOffsetUS), autoPwm); +} + +// Set a callback. Pass in NULL to stop it +extern void setTimer1Callback_weak(uint32_t (*fn)()) __attribute__((weak)); +void setTimer1Callback_weak(uint32_t (*fn)()) { + wvfState.timer1CB = fn; + if (fn) { + initTimer(); + forceTimerInterrupt(); + } + disableIdleTimer(); +} +static void setTimer1Callback_bound(uint32_t (*fn)()) __attribute__((weakref("setTimer1Callback_weak"))); +void setTimer1Callback(uint32_t (*fn)()) { + setTimer1Callback_bound(fn); +} + +// Stops a waveform on a pin +extern int stopWaveform_weak(uint8_t pin) __attribute__((weak)); +ICACHE_RAM_ATTR int stopWaveform_weak(uint8_t pin) { + // Can't possibly need to stop anything if there is no timer active + if (!timerRunning) { + return false; + } + // If user sends in a pin >16 but <32, this will always point to a 0 bit + // If they send >=32, then the shift will result in 0 and it will also return false + uint32_t mask = 1<> 0) +#endif + +// When the time to the next edge is greater than this, RTI and set another IRQ to minimize CPU usage +#define MINIRQTIME microsecondsToClockCycles(4) + +static ICACHE_RAM_ATTR void timer1Interrupt() { + // Flag if the core is at 160 MHz, for use by adjust() + bool turbo = (*(uint32_t*)0x3FF00014) & 1 ? true : false; + + uint32_t nextEventCycle = GetCycleCountIRQ() + microsecondsToClockCycles(MAXIRQUS); + uint32_t timeoutCycle = GetCycleCountIRQ() + microsecondsToClockCycles(14); + + if (wvfState.waveformToEnable || wvfState.waveformToDisable) { + // Handle enable/disable requests from main app + wvfState.waveformEnabled = (wvfState.waveformEnabled & ~wvfState.waveformToDisable) | wvfState.waveformToEnable; // Set the requested waveforms on/off + wvfState.waveformState &= ~wvfState.waveformToEnable; // And clear the state of any just started + wvfState.waveformToEnable = 0; + wvfState.waveformToDisable = 0; + // No mem barrier. Globals must be written to RAM on ISR exit. + // Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t) + wvfState.startPin = __builtin_ffs(wvfState.waveformEnabled) - 1; + // Find the last bit by subtracting off GCC's count-leading-zeros (no offset in this one) + wvfState.endPin = 32 - __builtin_clz(wvfState.waveformEnabled); + } else if (!pwmState.cnt && pwmState.pwmUpdate) { + // Start up the PWM generator by copying from the mailbox + pwmState.cnt = 1; + pwmState.idx = 1; // Ensure copy this cycle, cause it to start at t=0 + pwmState.nextServiceCycle = GetCycleCountIRQ(); // Do it this loop! + // No need for mem barrier here. Global must be written by IRQ exit + } + + bool done = false; + if (wvfState.waveformEnabled || pwmState.cnt) { + do { + nextEventCycle = GetCycleCountIRQ() + microsecondsToClockCycles(MAXIRQUS); + + // PWM state machine implementation + if (pwmState.cnt) { + int32_t cyclesToGo; + do { + cyclesToGo = pwmState.nextServiceCycle - GetCycleCountIRQ(); + if (cyclesToGo < 0) { + if (pwmState.idx == pwmState.cnt) { // Start of pulses, possibly copy new + if (pwmState.pwmUpdate) { + // Do the memory copy from temp to global and clear mailbox + pwmState = *(PWMState*)pwmState.pwmUpdate; + } + GPOS = pwmState.mask; // Set all active pins high + if (pwmState.mask & (1<<16)) { + GP16O = 1; + } + pwmState.idx = 0; + } else { + do { + // Drop the pin at this edge + if (pwmState.mask & (1<expiryCycle) { + int32_t expiryToGo = wave->expiryCycle - now; + if (expiryToGo < 0) { + // Done, remove! + if (i == 16) { + GP16O = 0; + } + GPOC = mask; + wvfState.waveformEnabled &= ~mask; + continue; + } + } + + // Check for toggles + int32_t cyclesToGo = wave->nextServiceCycle - now; + if (cyclesToGo < 0) { + uint32_t nextEdgeCycles; + uint32_t desired = 0; + uint32_t *timeToUpdate; + wvfState.waveformState ^= mask; + if (wvfState.waveformState & mask) { + if (i == 16) { + GP16O = 1; + } + GPOS = mask; + + if (wvfState.waveformToChange & mask) { + // Copy over next full-cycle timings + wave->timeHighCycles = wvfState.waveformNewHigh; + wave->desiredHighCycles = wvfState.waveformNewHigh; + wave->timeLowCycles = wvfState.waveformNewLow; + wave->desiredLowCycles = wvfState.waveformNewLow; + wave->lastEdge = 0; + wvfState.waveformToChange = 0; + } + if (wave->lastEdge) { + desired = wave->desiredLowCycles; + timeToUpdate = &wave->timeLowCycles; + } + nextEdgeCycles = wave->timeHighCycles; + } else { + if (i == 16) { + GP16O = 0; + } + GPOC = mask; + desired = wave->desiredHighCycles; + timeToUpdate = &wave->timeHighCycles; + nextEdgeCycles = wave->timeLowCycles; + } + if (desired) { + desired = adjust(desired); + int32_t err = desired - (now - wave->lastEdge); + if (abs(err) < desired) { // If we've lost > the entire phase, ignore this error signal + err /= 2; + *timeToUpdate += err; + } + } + nextEdgeCycles = adjust(nextEdgeCycles); + wave->nextServiceCycle = now + nextEdgeCycles; + wave->lastEdge = now; + } + nextEventCycle = earliest(nextEventCycle, wave->nextServiceCycle); + } + + // Exit the loop if we've hit the fixed runtime limit or the next event is known to be after that timeout would occur + uint32_t now = GetCycleCountIRQ(); + int32_t cycleDeltaNextEvent = nextEventCycle - now; + int32_t cyclesLeftTimeout = timeoutCycle - now; + done = (cycleDeltaNextEvent > MINIRQTIME) || (cyclesLeftTimeout < 0); + } while (!done); + } // if (wvfState.waveformEnabled) + + if (wvfState.timer1CB) { + nextEventCycle = earliest(nextEventCycle, GetCycleCountIRQ() + wvfState.timer1CB()); + } + + int32_t nextEventCycles = nextEventCycle - GetCycleCountIRQ(); + + if (nextEventCycles < MINIRQTIME) { + nextEventCycles = MINIRQTIME; + } + nextEventCycles -= DELTAIRQ; + + // Do it here instead of global function to save time and because we know it's edge-IRQ + T1L = nextEventCycles >> (turbo ? 1 : 0); +} + +}; diff --git a/cores/esp8266/core_esp8266_wiring_analog.cpp b/cores/esp8266/core_esp8266_wiring_analog.cpp index 27c98ff3f..fe8d67e66 100644 --- a/cores/esp8266/core_esp8266_wiring_analog.cpp +++ b/cores/esp8266/core_esp8266_wiring_analog.cpp @@ -39,4 +39,16 @@ extern int __analogRead(uint8_t pin) extern int analogRead(uint8_t pin) __attribute__ ((weak, alias("__analogRead"))); + +void __analogReference(uint8_t mode) +{ + // Only DEFAULT is supported on the ESP8266 + if (mode != DEFAULT) { + DEBUGV("analogReference called with illegal mode"); + } +} + + +extern void analogReference(uint8_t mode) __attribute__ ((weak, alias("__analogReference"))); + }; diff --git a/cores/esp8266/core_esp8266_wiring_digital.cpp b/cores/esp8266/core_esp8266_wiring_digital.cpp index 9c15703e0..c43f778a9 100644 --- a/cores/esp8266/core_esp8266_wiring_digital.cpp +++ b/cores/esp8266/core_esp8266_wiring_digital.cpp @@ -82,7 +82,8 @@ extern void __pinMode(uint8_t pin, uint8_t mode) { } extern void ICACHE_RAM_ATTR __digitalWrite(uint8_t pin, uint8_t val) { - stopWaveform(pin); + stopWaveform(pin); // Disable any Tone or startWaveform on this pin + _stopPWM(pin); // and any analogWrites (PWM) if(pin < 16){ if(val) GPOS = (1 << pin); else GPOC = (1 << pin); diff --git a/cores/esp8266/core_esp8266_wiring_pwm.cpp b/cores/esp8266/core_esp8266_wiring_pwm.cpp index b4991310d..f730f649e 100644 --- a/cores/esp8266/core_esp8266_wiring_pwm.cpp +++ b/cores/esp8266/core_esp8266_wiring_pwm.cpp @@ -26,30 +26,21 @@ extern "C" { -static uint32_t analogMap = 0; static int32_t analogScale = 255; // Match upstream default, breaking change from 2.x.x + + +static uint32_t analogMap = 0; static uint16_t analogFreq = 1000; -extern void __analogWriteRange(uint32_t range) { - if ((range >= 15) && (range <= 65535)) { - analogScale = range; - } -} - -extern void __analogWriteResolution(int res) { - if ((res >= 4) && (res <= 16)) { - analogScale = (1 << res) - 1; - } -} - extern void __analogWriteFreq(uint32_t freq) { if (freq < 100) { analogFreq = 100; - } else if (freq > 40000) { - analogFreq = 40000; + } else if (freq > 60000) { + analogFreq = 60000; } else { analogFreq = freq; } + _setPWMFreq(freq); } extern void __analogWrite(uint8_t pin, int val) { @@ -63,22 +54,36 @@ extern void __analogWrite(uint8_t pin, int val) { val = analogScale; } + if (analogMap & 1UL << pin) { // Per the Arduino docs at https://www.arduino.cc/reference/en/language/functions/analog-io/analogwrite/ // val: the duty cycle: between 0 (always off) and 255 (always on). // So if val = 0 we have digitalWrite(LOW), if we have val==range we have digitalWrite(HIGH) - analogMap &= ~(1 << pin); + analogMap &= ~(1 << pin); + } + else { + pinMode(pin, OUTPUT); + } uint32_t high = (analogPeriod * val) / analogScale; uint32_t low = analogPeriod - high; - pinMode(pin, OUTPUT); - if (low == 0) { - digitalWrite(pin, HIGH); - } else if (high == 0) { - digitalWrite(pin, LOW); - } else { - if (startWaveformClockCycles(pin, high, low, 0)) { - analogMap |= (1 << pin); - } + // Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t) + int phaseReference = __builtin_ffs(analogMap) - 1; + if (_setPWM(pin, val, analogScale)) { + analogMap |= (1 << pin); + } else if (startWaveformClockCycles(pin, high, low, 0, phaseReference, 0, true)) { + analogMap |= (1 << pin); + } +} + +extern void __analogWriteRange(uint32_t range) { + if ((range >= 15) && (range <= 65535)) { + analogScale = range; + } +} + +extern void __analogWriteResolution(int res) { + if ((res >= 4) && (res <= 16)) { + analogScale = (1 << res) - 1; } } diff --git a/cores/esp8266/coredecls.h b/cores/esp8266/coredecls.h index 6cd8e73b9..7186662f0 100644 --- a/cores/esp8266/coredecls.h +++ b/cores/esp8266/coredecls.h @@ -28,9 +28,10 @@ uint32_t crc32 (const void* data, size_t length, uint32_t crc = 0xffffffff); #include +using BoolCB = std::function; using TrivialCB = std::function; -void settimeofday_cb (TrivialCB&& cb); +void settimeofday_cb (const BoolCB& cb); void settimeofday_cb (const TrivialCB& cb); #endif diff --git a/cores/esp8266/debug.cpp b/cores/esp8266/debug.cpp index 0d0bde2df..afaf5553e 100644 --- a/cores/esp8266/debug.cpp +++ b/cores/esp8266/debug.cpp @@ -20,6 +20,7 @@ #include "Arduino.h" #include "debug.h" +#include "osapi.h" void ICACHE_RAM_ATTR hexdump(const void *mem, uint32_t len, uint8_t cols) { const uint8_t* src = (const uint8_t*) mem; diff --git a/cores/esp8266/esp8266_undocumented.h b/cores/esp8266/esp8266_undocumented.h index 22216d962..a19835218 100644 --- a/cores/esp8266/esp8266_undocumented.h +++ b/cores/esp8266/esp8266_undocumented.h @@ -1,9 +1,17 @@ // ROM and blob calls without official headers available +#if !defined(__ESP8266_UNDOCUMENTED_H) && !(defined(_ASMLANGUAGE) || defined(__ASSEMBLER__)) +#define __ESP8266_UNDOCUMENTED_H + #ifdef __cplusplus extern "C" { #endif +#ifndef XCHAL_EXCCAUSE_NUM +// from tools/xtensa-lx106-elf/include/xtensa/config/core.h:629:#define XCHAL_EXCCAUSE_NUM 64 +#define XCHAL_EXCCAUSE_NUM 64 +#endif + // ROM extern void rom_i2c_writeReg_Mask(int, int, int, int, int, int); @@ -34,6 +42,238 @@ extern int ets_uart_printf(const char *format, ...) __attribute__ ((format (prin extern void ets_delay_us(uint32_t us); +#ifndef GDBSTUB_H +/* + GDBSTUB duplicates these with some variances that are not compatible with our + references (offsets), which are synced with those used by the BootROM. + Specifically, the BootROM does not have register "a1" in the structure where + GDBSTUB does. +*/ + +/* + This structure is used in the argument list of "C" callable exception handlers. + See `_xtos_set_exception_handler` details below. +*/ +struct __exception_frame +{ + uint32_t epc; + uint32_t ps; + uint32_t sar; + uint32_t unused; + union { + struct { + uint32_t a0; + // note: no a1 here! + uint32_t a2; + uint32_t a3; + uint32_t a4; + uint32_t a5; + uint32_t a6; + uint32_t a7; + uint32_t a8; + uint32_t a9; + uint32_t a10; + uint32_t a11; + uint32_t a12; + uint32_t a13; + uint32_t a14; + uint32_t a15; + }; + uint32_t a_reg[15]; + }; + uint32_t cause; +}; +#endif + +/* + Most of the comments here are gleamed from the xtensa files found at the site + listed below and are mostly unverified: + https://github.com/qca/open-ath9k-htc-firmware/tree/master/sboot/magpie_1_1/sboot/athos/src/xtos + * exc-c-wrapper-handler.S + * exc-sethandler.c +*/ + +/* + The Boot ROM sets up a table of dispatch handlers at 0x3FFFC000. This table + has an entry for each of the EXCCAUSE values, 0 through 63. The exception + handler at the `User Exception Vector` uses EXCCAUSE with the base address + 0x3FFFC000 to build a jump address to the respective cause handler. Of the + cause handle functions, `_xtos_c_wrapper_handler` and `_xtos_unhandled_exception` + are of interest. + + Exception handler entries that do not have a specific handler are set to + `_xtos_unhandled_exception`. This handler will execute a `break 1, 1` + (0x4000DC4Bu) before doing a `rfe` (return from exception). Since the PC has + not changed, the event that caused the 1st exception will likely keep + repeating until the HWDT kicks in. + + These exception handling functions are in assembly, and do not conform to the + typical "C" function conventions. However, some form of prototype/typedef is + needed to reference these function addresses in "C" code. In + `RTOS_SDK/components/esp8266/include/xtensa/xtruntime.h`, it uses a compounded + definition that equates to `void (*)(...)` for .cpp modules to use. I have + noticed this creates sufficient confusion at compilation to get your attention + when used in the wrong place. I have copied that definition here. + + Added to eagle.rom.addr.v6.ld: + PROVIDE ( _xtos_exc_handler_table = 0x3fffc000 ); + PROVIDE ( _xtos_c_handler_table = 0x3fffc100 ); +*/ +#ifndef XTRUNTIME_H +// This is copy/paste from RTOS_SDK/components/esp8266/include/xtensa/xtruntime.h +#ifdef __cplusplus +typedef void (_xtos_handler_func)(...); +#else +typedef void (_xtos_handler_func)(); +#endif +typedef _xtos_handler_func *_xtos_handler; + +extern _xtos_handler _xtos_exc_handler_table[XCHAL_EXCCAUSE_NUM]; + +/* + Assembly-level handler, used in the _xtos_exc_handler_table[]. It is a wrapper + for calling registered "C" exception handlers. +*/ +_xtos_handler_func _xtos_c_wrapper_handler; + +/* + Assembly-level handler, used in the _xtos_exc_handler_table[]. It is the + default handler, for exceptions without a registered handler. +*/ +_xtos_handler_func _xtos_unhandled_exception; +#endif + + +#ifdef __cplusplus +// For these definitions, try to be more precise for .cpp module usage. + +/* + A detailed typdef for the "C" callable functions found in + `_xtos_c_handler_table[]` More details in `_xtos_set_exception_handler` + comments below. +*/ +typedef void (*fn_c_exception_handler_t)(struct __exception_frame *ef, int cause); + +/* + TMI maybe? However, it may be useful for a deep debugging session. + `_xtos_p_none` is the default "C" exception handler that fills the + _xtos_c_handler_table[]. It is present when an exception handler has not been + registered. It simply consist of a single instruction, `ret`. + It is also internally used by `_xtos_set_exception_handler(cause, NULL)` to + reset a "C" exception handler back to the unhandled state. The coresponding + `_xtos_exc_handler_table` entry will be set to `_xtos_unhandled_exception`. + Note, if nesting handlers is desired this must be implemented in the new "C" + exception handler(s) being registered. +*/ +extern void _xtos_p_none(struct __exception_frame *ef, int cause); + +/* + TMI maybe? + For `extern _xtos_handler _xtos_c_handler_table[XCHAL_EXCCAUSE_NUM];`, defined + in in `xtensa/xtos/exc-sethandler.c`. _xtos_handler is a generalized + definition that doesn't match the actual function definition of those + assigned to `_xtos_c_handler_table` entries. + + At this time we do not require direct access to this table. We perform updates + by calling the ROM function `_xtos_set_exception_handler`. + + A corrected version for .cpp would look like this: +*/ +extern fn_c_exception_handler_t _xtos_c_handler_table[XCHAL_EXCCAUSE_NUM]; + +/* + ROM API function `_xtos_set_exception_handler` registers a "C" callable + exception handler for a specified general exception, (EXCCAUSE value). (source + in xtensa/xtos/exc-sethandler.c) + * If `cause`/reason (EXCCAUSE) is out of range, >=64, it returns NULL. + * If the new exception handler is installed, it returns the previous handler. + * If the previous handler was `_xtos_unhandled_exception`/`_xtos_p_none`, it + returns NULL. + + Note, the installed "C" exception handler is noramlly called from the ROM + function _xtos_c_wrapper_handler with IRQs enabled. This build now includes a + replacement wrapper that is used with the "C" exception handler for + EXCCAUSE_LOAD_STORE_ERROR (3), Non 32-bit read/write error. + + This prototype has been corrected (changed from a generalized to specific + argument list) for the .cpp files in this projects; however, it does not match + the over generalized version in some Xtensa .h files (not currently part of + this project) + + To aid against future conflicts, keep these new defines limited to .cpp with + `#ifdef __cplusplus`. +*/ +extern fn_c_exception_handler_t _xtos_set_exception_handler(int cause, fn_c_exception_handler_t fn); +#endif + #ifdef __cplusplus }; #endif + +#endif + +#if defined(VERIFY_C_ASM_EXCEPTION_FRAME_STRUCTURE) || defined(_ASMLANGUAGE) || defined(__ASSEMBLER__) +/* + Extracted from information at + From https://github.com/fdivitto/ESPWebFramework/blob/master/SDK/xtensa-lx106-elf/xtensa-lx106-elf/lib/libhandlers-null.txt + + The UEXC_... values are create by the macro STRUCT_FIELD in `xtruntime-frames.h` + + These VERIFY_... values are used to confirm that the "C" structure offsets + match those generated in exc-c-wrapper-handler.S. +*/ +#define VERIFY_UEXC_pc 0x0000 +#define VERIFY_UEXC_ps 0x0004 +#define VERIFY_UEXC_sar 0x0008 +#define VERIFY_UEXC_vpri 0x000c +#define VERIFY_UEXC_a0 0x0010 +#define VERIFY_UEXC_a2 0x0014 +#define VERIFY_UEXC_a3 0x0018 +#define VERIFY_UEXC_a4 0x001c +#define VERIFY_UEXC_a5 0x0020 +#define VERIFY_UEXC_a6 0x0024 +#define VERIFY_UEXC_a7 0x0028 +#define VERIFY_UEXC_a8 0x002c +#define VERIFY_UEXC_a9 0x0030 +#define VERIFY_UEXC_a10 0x0034 +#define VERIFY_UEXC_a11 0x0038 +#define VERIFY_UEXC_a12 0x003c +#define VERIFY_UEXC_a13 0x0040 +#define VERIFY_UEXC_a14 0x0044 +#define VERIFY_UEXC_a15 0x0048 +#define VERIFY_UEXC_exccause 0x004c +#define VERIFY_UserFrameSize 0x0050 +#define VERIFY_UserFrameTotalSize 0x0100 +#endif + +#if defined(VERIFY_C_ASM_EXCEPTION_FRAME_STRUCTURE) && !(defined(_ASMLANGUAGE) || defined(__ASSEMBLER__)) +/* + A set of static_asserts test to confirm both "C" and ASM structures match. + + This only needs to be verified once. + We use `#define VERIFY_C_ASM_EXCEPTION_FRAME_STRUCTURE` to limit number of + times tested in a build. Testing is done from core_esp8266_non32xfer.cpp. + + ASM structure defines are verified in exc-c-wrapper-handler.S +*/ +static_assert(offsetof(struct __exception_frame, epc) == VERIFY_UEXC_pc, "offsetof(struct __exception_frame, epc) != VERIFY_UEXC_pc, expected 0x0000"); +static_assert(offsetof(struct __exception_frame, ps) == VERIFY_UEXC_ps, "offsetof(struct __exception_frame, ps) != VERIFY_UEXC_ps, expected 0x0004"); +static_assert(offsetof(struct __exception_frame, sar) == VERIFY_UEXC_sar, "offsetof(struct __exception_frame, sar) != VERIFY_UEXC_sar, expected 0x0008"); +static_assert(offsetof(struct __exception_frame, unused) == VERIFY_UEXC_vpri, "offsetof(struct __exception_frame, unused) != VERIFY_UEXC_vpri, expected 0x000c"); +static_assert(offsetof(struct __exception_frame, a0) == VERIFY_UEXC_a0, "offsetof(struct __exception_frame, a0) != VERIFY_UEXC_a0, expected 0x0010"); +static_assert(offsetof(struct __exception_frame, a2) == VERIFY_UEXC_a2, "offsetof(struct __exception_frame, a2) != VERIFY_UEXC_a2, expected 0x0014"); +static_assert(offsetof(struct __exception_frame, a3) == VERIFY_UEXC_a3, "offsetof(struct __exception_frame, a3) != VERIFY_UEXC_a3, expected 0x0018"); +static_assert(offsetof(struct __exception_frame, a4) == VERIFY_UEXC_a4, "offsetof(struct __exception_frame, a4) != VERIFY_UEXC_a4, expected 0x001c"); +static_assert(offsetof(struct __exception_frame, a5) == VERIFY_UEXC_a5, "offsetof(struct __exception_frame, a5) != VERIFY_UEXC_a5, expected 0x0020"); +static_assert(offsetof(struct __exception_frame, a6) == VERIFY_UEXC_a6, "offsetof(struct __exception_frame, a6) != VERIFY_UEXC_a6, expected 0x0024"); +static_assert(offsetof(struct __exception_frame, a7) == VERIFY_UEXC_a7, "offsetof(struct __exception_frame, a7) != VERIFY_UEXC_a7, expected 0x0028"); +static_assert(offsetof(struct __exception_frame, a8) == VERIFY_UEXC_a8, "offsetof(struct __exception_frame, a8) != VERIFY_UEXC_a8, expected 0x002c"); +static_assert(offsetof(struct __exception_frame, a9) == VERIFY_UEXC_a9, "offsetof(struct __exception_frame, a9) != VERIFY_UEXC_a9, expected 0x0030"); +static_assert(offsetof(struct __exception_frame, a10) == VERIFY_UEXC_a10, "offsetof(struct __exception_frame, a10) != VERIFY_UEXC_a10, expected 0x0034"); +static_assert(offsetof(struct __exception_frame, a11) == VERIFY_UEXC_a11, "offsetof(struct __exception_frame, a11) != VERIFY_UEXC_a11, expected 0x0038"); +static_assert(offsetof(struct __exception_frame, a12) == VERIFY_UEXC_a12, "offsetof(struct __exception_frame, a12) != VERIFY_UEXC_a12, expected 0x003c"); +static_assert(offsetof(struct __exception_frame, a13) == VERIFY_UEXC_a13, "offsetof(struct __exception_frame, a13) != VERIFY_UEXC_a13, expected 0x0040"); +static_assert(offsetof(struct __exception_frame, a14) == VERIFY_UEXC_a14, "offsetof(struct __exception_frame, a14) != VERIFY_UEXC_a14, expected 0x0044"); +static_assert(offsetof(struct __exception_frame, a15) == VERIFY_UEXC_a15, "offsetof(struct __exception_frame, a15) != VERIFY_UEXC_a15, expected 0x0048"); +static_assert(offsetof(struct __exception_frame, cause) == VERIFY_UEXC_exccause, "offsetof(struct __exception_frame, cause) != VERIFY_UEXC_exccause, expected 0x004c"); +#endif diff --git a/cores/esp8266/exc-c-wrapper-handler.S b/cores/esp8266/exc-c-wrapper-handler.S new file mode 100644 index 000000000..e1c3f1e15 --- /dev/null +++ b/cores/esp8266/exc-c-wrapper-handler.S @@ -0,0 +1,213 @@ +// exc-c-wrapper-handler.S, this is a reduced version of the original file at +// https://github.com/qca/open-ath9k-htc-firmware/blob/master/sboot/magpie_1_1/sboot/athos/src/xtos/exc-c-wrapper-handler.S#L62-L67 +// + +// exc-c-wrapper-handler.S - General Exception Handler that Dispatches C Handlers + +// Copyright (c) 2002-2004, 2006-2007, 2010 Tensilica Inc. +// +// 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 the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to +// permit persons to whom the Software is furnished to do so, subject to +// the following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +#include +#include +#include +// #include "xtos-internal.h" +// #ifdef SIMULATOR +// #include +// #endif + +#include "xtruntime-frames.h" +///////////////////////////////////////////////////////////////////////////// +// +// Verified that the ASM generated UEXC_xxx values match, the corresponding +// values in `struct __exception_frame` used in the "C" code. +// +#include "esp8266_undocumented.h" +.if (UEXC_pc != VERIFY_UEXC_pc) +.err +.endif +.if (UEXC_ps != VERIFY_UEXC_ps) +.err +.endif +.if (UEXC_sar != VERIFY_UEXC_sar) +.err +.endif +.if (UEXC_vpri != VERIFY_UEXC_vpri) +.err +.endif +.if (UEXC_a0 != VERIFY_UEXC_a0) +.err +.endif +.if (UEXC_a2 != VERIFY_UEXC_a2) +.err +.endif +.if (UEXC_a3 != VERIFY_UEXC_a3) +.err +.endif +.if (UEXC_a4 != VERIFY_UEXC_a4) +.err +.endif +.if (UEXC_a5 != VERIFY_UEXC_a5) +.err +.endif +.if (UEXC_a6 != VERIFY_UEXC_a6) +.err +.endif +.if (UEXC_a7 != VERIFY_UEXC_a7) +.err +.endif +.if (UEXC_a8 != VERIFY_UEXC_a8) +.err +.endif +.if (UEXC_a9 != VERIFY_UEXC_a9) +.err +.endif +.if (UEXC_a10 != VERIFY_UEXC_a10) +.err +.endif +.if (UEXC_a11 != VERIFY_UEXC_a11) +.err +.endif +.if (UEXC_a12 != VERIFY_UEXC_a12) +.err +.endif +.if (UEXC_a13 != VERIFY_UEXC_a13) +.err +.endif +.if (UEXC_a14 != VERIFY_UEXC_a14) +.err +.endif +.if (UEXC_a15 != VERIFY_UEXC_a15) +.err +.endif +.if (UEXC_exccause != VERIFY_UEXC_exccause) +.err +.endif +.if (UserFrameSize != VERIFY_UserFrameSize) +.err +.endif +.if (UserFrameTotalSize != VERIFY_UserFrameTotalSize) +.err +.endif +/////////////////////////////////////////////////////////////////////////////// + +/* + * This is the general exception assembly-level handler that dispatches C handlers. + */ + .section .iram.text + .align 4 + .literal_position + .global _xtos_c_wrapper_handler +_xtos_c_wrapper_handler: + + // HERE: a2, a3, a4 have been saved to exception stack frame allocated with a1 (sp). + // a2 contains EXCCAUSE. + s32i a5, a1, UEXC_a5 // a5 will get clobbered by ENTRY after the pseudo-CALL4 + // (a4..a15 spilled as needed; save if modified) + + //NOTA: Possible future improvement: + // keep interrupts disabled until we get into the handler, such that + // we don't have to save other critical state such as EXCVADDR here. +// @mhightower83 - This promise was broken by an "rsil a13, 0" below. + //rsr a3, EXCVADDR + s32i a2, a1, UEXC_exccause + //s32i a3, a1, UEXC_excvaddr + + // Set PS fields: + // EXCM = 0 + // WOE = __XTENSA_CALL0_ABI__ ? 0 : 1 + // UM = 1 + // INTLEVEL = EXCM_LEVEL = 1 + // CALLINC = __XTENSA_CALL0_ABI__ ? 0 : 1 + // OWB = 0 (really, a dont care if !__XTENSA_CALL0_ABI__) + +// movi a2, 0x23 // 0x21, PS_UM|PS_INTLEVEL(XCHAL_EXCM_LEVEL) +// @mhightower83 - use INTLEVEL 15 instead of 3 for Arduino like interrupt support?? + movi a2, 0x2F // 0x21, PS_UM|PS_INTLEVEL(15) + rsr a3, EPC_1 +// @mhightower83 - I assume PS.EXCM was set and now is being cleared, thus +// allowing new exceptions and interrupts within PS_INTLEVEL to be possible. +// We have set INTLEVEL to 15 to block any possible interrupts. + xsr a2, PS + + // HERE: window overflows enabled, but NOT SAFE because we're not quite + // in a valid windowed context (haven't restored a1 yet...); + // so don't cause any (keep to a0..a3) until we've saved critical state and restored a1: + + // NOTE: MUST SAVE EPC1 before causing any overflows, because overflows corrupt EPC1. + s32i a3, a1, UEXC_pc + s32i a2, a1, UEXC_ps + s32i a0, a1, UEXC_a0 // save the rest of the registers + s32i a6, a1, UEXC_a6 + s32i a7, a1, UEXC_a7 + s32i a8, a1, UEXC_a8 + s32i a9, a1, UEXC_a9 + s32i a10, a1, UEXC_a10 + s32i a11, a1, UEXC_a11 + s32i a12, a1, UEXC_a12 + s32i a13, a1, UEXC_a13 + s32i a14, a1, UEXC_a14 + s32i a15, a1, UEXC_a15 + rsync // wait for WSR to PS to complete + rsr a12, SAR + +// @mhightower83 - I think, after the next instruction, we have the potential of +// losing UEXC_excvaddr. Which the earlier comment said we need to preserve for +// the exception handler. We keep interrupts off when calling the "C" exception +// handler. For the use cases that I am looking at, this is a must. If there are +// future use cases that need interrupts enabled, those "C" exception handlers +// can turn them on. +// +// rsil a13, 0 + + movi a13, _xtos_c_handler_table // &table + l32i a15, a1, UEXC_exccause // arg2: exccause + s32i a12, a1, UEXC_sar + addx4 a12, a15, a13 // a12 = table[exccause] + l32i a12, a12, 0 // ... + mov a2, a1 // arg1: exception parameters + mov a3, a15 // arg2: exccause + beqz a12, 1f // null handler => skip call + callx0 a12 // call C exception handler for this exception +1: + // Now exit the handler. + + // Restore special registers + l32i a14, a1, UEXC_sar + + // load early - saves two cycles - @mhightower83 + movi a0, _xtos_return_from_exc + +// @mhightower83 - For compatibility with Arduino interrupt architecture, we +// keep interrupts 100% disabled. +// /* +// * Disable interrupts while returning from the pseudo-CALL setup above, +// * for the same reason they were disabled while doing the pseudo-CALL: +// * this sequence restores SP such that it doesn't reflect the allocation +// * of the exception stack frame, which we still need to return from +// * the exception. +// */ +// rsil a12, 1 // XCHAL_EXCM_LEVEL + rsil a12, 15 // All levels blocked. + wsr a14, SAR + jx a0 + + /* FIXME: what about _GeneralException ? */ + .size _xtos_c_wrapper_handler, . - _xtos_c_wrapper_handler diff --git a/cores/esp8266/exc-sethandler.cpp b/cores/esp8266/exc-sethandler.cpp new file mode 100644 index 000000000..82f829394 --- /dev/null +++ b/cores/esp8266/exc-sethandler.cpp @@ -0,0 +1,113 @@ +/* + * Adaptation of _xtos_set_exception_handler for Arduino ESP8266 core + * + * This replacement for the Boot ROM `_xtos_set_exception_handler` is used to + * install our replacement `_xtos_c_wrapper_handler`. This change protects the + * value of `excvaddr` from corruption. + * + * + * Details + * + * The issue, the Boot ROM "C" wrapper for exception handlers, + * `_xtos_c_wrapper_handler`, turns interrupts back on. This leaves `excvaddr` + * exposed to possible overwrite before it is read. For example, if an interrupt + * is taken during the exception handler processing and the ISR handler + * generates a new exception, the original value of `excvaddr` is lost. To + * address this issue we have a replacement `_xtos_c_wrapper_handler` in file + * `exc-c-wrapper-handler.S`. + * + * An overview, of an exception at entry: New interrupts are blocked by EXCM + * being set. Once cleared, interrupts above the current INTLEVEL and exceptions + * (w/o creating a DoubleException) can occur. + * + * Using our replacement for `_xtos_c_wrapper_handler`, INTLEVEL is raised to 15 + * with EXCM cleared. + * + * The original Boot ROM `_xtos_c_wrapper_handler` at entry would set INTLEVEL + * to 3 with EXCM cleared, save registers, then do a `rsil 0` (interrupts fully + * enabled!) just before calling the registered "C" Exception handler. Our + * replacement keeps INTLEVEL at 15. This is needed to support the Arduino model + * of interrupts disabled while an ISR runs. + * + * And we also need it for umm_malloc to work safely with an IRAM heap from an + * ISR call. While malloc() will supply DRAM for all allocation from an ISR, we + * want free() to safely operate from an ISR to avoid a leak potential. + * + * If an exception handler needs interrupts enabled, it would be done after it + * has consumed the value of `excvaddr`. Whether such action is safe is left to + * the exception handler writer to determine. However, with our current + * architecture, I am not convinced it can be done safely. + * +*/ + +#if defined(NON32XFER_HANDLER) || defined(MMU_IRAM_HEAP) || defined(NEW_EXC_C_WRAPPER) + +/* + * The original module source code came from: + * https://github.com/qca/open-ath9k-htc-firmware/blob/master/sboot/magpie_1_1/sboot/athos/src/xtos/exc-sethandler.c + * + * It has been revised to use Arduino ESP8266 core includes, types, and + * formating. +*/ + +/* exc-sethandler.c - register an exception handler in XTOS */ + +/* + * Copyright (c) 1999-2006 Tensilica Inc. + * + * 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 the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#include +#include "esp8266_undocumented.h" + +extern "C" { + +/* + * Register a C handler for the specified general exception + * (specified EXCCAUSE value). + */ +fn_c_exception_handler_t _xtos_set_exception_handler(int cause, fn_c_exception_handler_t fn) +{ + fn_c_exception_handler_t ret; + + if( (unsigned) cause >= XCHAL_EXCCAUSE_NUM ) + return 0; + + if( fn == 0 ) + fn = &_xtos_p_none; + + ret = _xtos_c_handler_table[cause]; + + _xtos_exc_handler_table[cause] = ( (fn == &_xtos_p_none) + ? &_xtos_unhandled_exception + : &_xtos_c_wrapper_handler ); + + _xtos_c_handler_table[cause] = fn; + + if( ret == &_xtos_p_none ) + ret = 0; + + return ret; +} + +}; + +#endif diff --git a/cores/esp8266/heap.cpp b/cores/esp8266/heap.cpp index 3f549716f..4821f9b77 100644 --- a/cores/esp8266/heap.cpp +++ b/cores/esp8266/heap.cpp @@ -5,6 +5,11 @@ #include #include "umm_malloc/umm_malloc.h" + +// Need FORCE_ALWAYS_INLINE to put HeapSelect class constructor/deconstructor in IRAM +#define FORCE_ALWAYS_INLINE_HEAP_SELECT +#include "umm_malloc/umm_heap_select.h" + #include #include #include @@ -16,6 +21,7 @@ extern "C" { #define UMM_CALLOC(n,s) umm_poison_calloc(n,s) #define UMM_REALLOC_FL(p,s,f,l) umm_poison_realloc_fl(p,s,f,l) #define UMM_FREE_FL(p,f,l) umm_poison_free_fl(p,f,l) +#define STATIC_ALWAYS_INLINE #undef realloc #undef free @@ -25,6 +31,7 @@ extern "C" { #define UMM_CALLOC(n,s) umm_calloc(n,s) #define UMM_REALLOC_FL(p,s,f,l) umm_realloc(p,s) #define UMM_FREE_FL(p,f,l) umm_free(p) +#define STATIC_ALWAYS_INLINE #undef realloc #undef free @@ -34,6 +41,10 @@ extern "C" { #define UMM_CALLOC(n,s) calloc(n,s) #define UMM_REALLOC_FL(p,s,f,l) realloc(p,s) #define UMM_FREE_FL(p,f,l) free(p) + +// STATIC_ALWAYS_INLINE only applys to the non-debug build path, +// it must not be enabled on the debug build path. +#define STATIC_ALWAYS_INLINE static ALWAYS_INLINE #endif @@ -259,8 +270,8 @@ void ICACHE_RAM_ATTR free(void* p) } #endif - -void* ICACHE_RAM_ATTR pvPortMalloc(size_t size, const char* file, int line) +STATIC_ALWAYS_INLINE +void* ICACHE_RAM_ATTR heap_pvPortMalloc(size_t size, const char* file, int line) { INTEGRITY_CHECK__PANIC_FL(file, line); POISON_CHECK__PANIC_FL(file, line); @@ -270,7 +281,8 @@ void* ICACHE_RAM_ATTR pvPortMalloc(size_t size, const char* file, int line) return ret; } -void* ICACHE_RAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, int line) +STATIC_ALWAYS_INLINE +void* ICACHE_RAM_ATTR heap_pvPortCalloc(size_t count, size_t size, const char* file, int line) { INTEGRITY_CHECK__PANIC_FL(file, line); POISON_CHECK__PANIC_FL(file, line); @@ -280,7 +292,8 @@ void* ICACHE_RAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, return ret; } -void* ICACHE_RAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line) +STATIC_ALWAYS_INLINE +void* ICACHE_RAM_ATTR heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line) { INTEGRITY_CHECK__PANIC_FL(file, line); void* ret = UMM_REALLOC_FL(ptr, size, file, line); @@ -290,7 +303,8 @@ void* ICACHE_RAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, in return ret; } -void* ICACHE_RAM_ATTR pvPortZalloc(size_t size, const char* file, int line) +STATIC_ALWAYS_INLINE +void* ICACHE_RAM_ATTR heap_pvPortZalloc(size_t size, const char* file, int line) { INTEGRITY_CHECK__PANIC_FL(file, line); POISON_CHECK__PANIC_FL(file, line); @@ -300,7 +314,8 @@ void* ICACHE_RAM_ATTR pvPortZalloc(size_t size, const char* file, int line) return ret; } -void ICACHE_RAM_ATTR vPortFree(void *ptr, const char* file, int line) +STATIC_ALWAYS_INLINE +void ICACHE_RAM_ATTR heap_vPortFree(void *ptr, const char* file, int line) { INTEGRITY_CHECK__PANIC_FL(file, line); UMM_FREE_FL(ptr, file, line); @@ -314,7 +329,47 @@ size_t ICACHE_RAM_ATTR xPortWantedSizeAlign(size_t size) void system_show_malloc(void) { + HeapSelectDram ephemeral; umm_info(NULL, true); } +/* + NONOS SDK and lwIP do not handle IRAM heap well. Since they also use portable + malloc calls pvPortMalloc, ... we can leverage that for this solution. + Force pvPortMalloc, ... APIs to serve DRAM only. +*/ +void* ICACHE_RAM_ATTR pvPortMalloc(size_t size, const char* file, int line) +{ + HeapSelectDram ephemeral; + return heap_pvPortMalloc(size, file, line);; +} + +void* ICACHE_RAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, int line) +{ + HeapSelectDram ephemeral; + return heap_pvPortCalloc(count, size, file, line); +} + +void* ICACHE_RAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line) +{ + HeapSelectDram ephemeral; + return heap_pvPortRealloc(ptr, size, file, line); +} + +void* ICACHE_RAM_ATTR pvPortZalloc(size_t size, const char* file, int line) +{ + HeapSelectDram ephemeral; + return heap_pvPortZalloc(size, file, line); +} + +void ICACHE_RAM_ATTR vPortFree(void *ptr, const char* file, int line) +{ +#if defined(DEBUG_ESP_OOM) || defined(UMM_POISON_CHECK) || defined(UMM_POISON_CHECK_LITE) || defined(UMM_INTEGRITY_CHECK) + // This is only needed for debug checks to ensure they are performed in + // correct context. umm_malloc free internally determines the correct heap. + HeapSelectDram ephemeral; +#endif + return heap_vPortFree(ptr, file, line); +} + }; diff --git a/cores/esp8266/i2s.h b/cores/esp8266/i2s.h index 70587fd2f..f2978286a 100644 --- a/cores/esp8266/i2s.h +++ b/cores/esp8266/i2s.h @@ -21,6 +21,8 @@ #ifndef I2S_h #define I2S_h +#define I2S_HAS_BEGIN_RXTX_DRIVE_CLOCKS 1 + /* How does this work? Basically, to get sound, you need to: - Connect an I2S codec to the I2S pins on the ESP. @@ -42,6 +44,7 @@ extern "C" { 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 +bool i2s_rxtxdrive_begin(bool enableRx, bool enableTx, bool driveRxClocks, bool driveTxClocks); 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 diff --git a/cores/esp8266/mmu_iram.cpp b/cores/esp8266/mmu_iram.cpp new file mode 100644 index 000000000..488e596cc --- /dev/null +++ b/cores/esp8266/mmu_iram.cpp @@ -0,0 +1,192 @@ +/* + * Copyright 2020 M Hightower + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + + +#include "Arduino.h" +#include "mmu_iram.h" +#include + +extern "C" { + +#if (MMU_ICACHE_SIZE == 0x4000) +#define SOC_CACHE_SIZE 0 // 16KB +#pragma message("ICACHE size 16K") +#else +#define SOC_CACHE_SIZE 1 // 32KB +#endif + +#if (MMU_ICACHE_SIZE == 0x4000) +/* + * "Cache_Read_Enable" as in Instruction Read Cache enable, ICACHE. + * + * The Boot ROM "Cache_Read_Enable" API enables virtual execution of code in + * flash memory via an instruction cache, ICACHE. The cache size can be set to + * 16K or 32K, and the NONOS SDK 2.x will always set ICACHE to 32K during + * initialization. + * + * When you select a 16K vs. a 32K ICACHE size, you get 48K contiguous IRAM to + * work with. The NONOS SDK 2.x does not have an option to select 16K/32K. This + * is where this Boot ROM wrapper for Cache_Read_Enable comes in. + * Note, there is support for 16K/32K cache size in NONOS SDK 3.0; however, I + * do not see an option to have it has part of your general IRAM. That SDK adds + * it to the heap. + * + * With this wrapper function, we override the SDK's ICACHE size. + * A build-time define MMU_ICACHE_SIZE selects 16K or 32K ICACHE size. + * + * mmu_status is used to help understand calling behavior. At some point, it + * should be trimmed down to the essentials. + * + * During NONOS SDK init, it will call to enable. Then call later, to process a + * spi_flash_get_id request, it will disable/enable around the Boot ROM SPI calls. + * + * + * + * Arguments for Cache_Read_Enable + * + * The first two arguments appear to specify which 1MB block of the flash to + * access with the ICACHE. + * + * The first argument, map, is partly understood. It has three values 0, 1, + * and 2+. The value 0 selects the even 1MB block, and 1 selects the odd 1MB + * block, in other words, bit20 of the flash address. No guesses for a value + * of 2 or greater. + * + * The second argument, p, bit 21 of the flash address. Or, it may be bits 23, + * 22, 21 of the flash address. A three-bit field is cleared in the register + * for this argument; however, I have not seen any examples of it being used + * that way. + * + * The third argument, v, holds our center of attention. A value of 0 selects + * 16K, and a value of 1 selects a 32K ICACHE. This is the only parameter we + * need to modify on Cache_Read_Enable calls. + * + * + * + * Clues and Information sources + * + * "Cache_Read_Enable" is underdocumented. Main sources of information were from + * rboot, zboot, https://richard.burtons.org/2015/06/12/esp8266-cache_read_enable/, + * and other places. And some additional expermentation. + * + * Searching through the NONOS SDK shows nothing on this API; however, some + * clues on what the NONOS SDK might be doing with ICACHE related calls can be + * found in the RTOS SDK. + * eg. ESP8266_RTOS_SDK/blob/master/components/spi_flash/src/spi_flash_raw.c + * also calls to it in the bootloader. + * + */ + +#ifndef ROM_Cache_Read_Enable +#define ROM_Cache_Read_Enable 0x40004678U +#endif + +typedef void (*fp_Cache_Read_Enable_t)(uint8_t map, uint8_t p, uint8_t v); +#define real_Cache_Read_Enable (reinterpret_cast(ROM_Cache_Read_Enable)) + +void IRAM_ATTR Cache_Read_Enable(uint8_t map, uint8_t p, uint8_t v) { + (void)v; + real_Cache_Read_Enable(map, p, SOC_CACHE_SIZE); +} + +#ifdef DEV_DEBUG_PRINT + +#if 0 +#ifndef ROM_Cache_Read_Disable +#define ROM_Cache_Read_Disable 0x400047f0 +#endif + +typedef void (*fp_Cache_Read_Disable_t)(void); +#define real_Cache_Read_Disable (reinterpret_cast(ROM_Cache_Read_Disable)) +/* + * + */ +void IRAM_ATTR Cache_Read_Disable(void) { + real_Cache_Read_Disable(); +} +#endif + +/* + * Early adjustment for CPU crystal frequency, so debug printing will work. + * This should not be left enabled all the time in Cashe_Read..., I am concerned + * that there may be unknown interference with the NONOS SDK startup. + * + * Inspired by: + * https://github.com/pvvx/esp8266web/blob/2e25559bc489487747205db2ef171d48326b32d4/app/sdklib/system/app_main.c#L581-L591 + */ +extern "C" uint8_t rom_i2c_readReg(uint8_t block, uint8_t host_id, uint8_t reg_add); +extern "C" void rom_i2c_writeReg(uint8_t block, uint8_t host_id, uint8_t reg_add, uint8_t data); + +extern "C" void IRAM_ATTR set_pll(void) +{ +#if !defined(F_CRYSTAL) +#define F_CRYSTAL 26000000 +#endif + if (F_CRYSTAL != 40000000) { + // At Boot ROM(-BIOS) start, it assumes a 40MHz crystal. + // If it is not, we assume a 26MHz crystal. + // There is no support for 24MHz crustal at this time. + if(rom_i2c_readReg(103,4,1) != 136) { // 8: 40MHz, 136: 26MHz + // Assume 26MHz crystal + // soc_param0: 0: 40MHz, 1: 26MHz, 2: 24MHz + // set 80MHz PLL CPU + rom_i2c_writeReg(103,4,1,136); + rom_i2c_writeReg(103,4,2,145); + } + } +} + +//C This was used to probe at different stages of boot the state of the PLL +//C register. I think we can get rid of this one. +extern "C" void IRAM_ATTR dbg_set_pll(void) +{ + char r103_4_1 = rom_i2c_readReg(103,4,1); + char r103_4_2 = rom_i2c_readReg(103,4,2); + set_pll(); + ets_uart_printf("\nrom_i2c_readReg(103,4,1) == %u\n", r103_4_1); + ets_uart_printf( "rom_i2c_readReg(103,4,2) == %u\n", r103_4_2); +} + +/* + This helps keep the UART enabled at user_init() so we can get a few more + messages printed. +*/ +extern struct rst_info resetInfo; +extern "C" void __pinMode( uint8_t pin, uint8_t mode ); + +inline bool is_gpio_persistent(void) { + return REASON_EXCEPTION_RST <= resetInfo.reason && + REASON_SOFT_RESTART >= resetInfo.reason; +} + +extern "C" void pinMode( uint8_t pin, uint8_t mode ) { + static bool in_initPins = true; + if (in_initPins && (1 == pin)) { + if (!is_gpio_persistent()) { + /* Restore pin to TX after Power-on and EXT_RST */ + __pinMode(pin, FUNCTION_0); + } + in_initPins = false; + return; + } + + __pinMode( pin, mode ); +} +#endif // #ifdef DEV_DEBUG_PRINT + +#endif // #if (MMU_ICACHE_SIZE == 0x4000) + +}; diff --git a/cores/esp8266/mmu_iram.h b/cores/esp8266/mmu_iram.h new file mode 100644 index 000000000..e372fa104 --- /dev/null +++ b/cores/esp8266/mmu_iram.h @@ -0,0 +1,221 @@ +/* + * Copyright 2020 M Hightower + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef __MMU_IRAM_H +#define __MMU_IRAM_H + +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + +//C This turns on range checking. Is this the value you want to trigger it? +#ifdef DEBUG_ESP_CORE +#define DEBUG_ESP_MMU +#endif + +#if defined(CORE_MOCK) +#define ets_uart_printf(...) do {} while(false) +#endif + +/* + * DEV_DEBUG_PRINT: + * Debug printing macros for printing before before, during, and after + * NONOS SDK initializes. May or maynot be safe during NONOS SDK + * initialization. As in printing from functions called on by the SDK + * during the SDK initialization. + * + #define DEV_DEBUG_PRINT + */ + +#if defined(DEV_DEBUG_PRINT) || defined(DEBUG_ESP_MMU) +#include + +#define DBG_MMU_FLUSH(a) while((USS(a) >> USTXC) & 0xff) {} + +#if defined(DEV_DEBUG_PRINT) +extern void set_pll(void); +extern void dbg_set_pll(void); + +#define DBG_MMU_PRINTF(fmt, ...) \ +set_pll(); \ +uart_buff_switch(0); \ +ets_uart_printf(fmt, ##__VA_ARGS__); \ +DBG_MMU_FLUSH(0) + +#else // ! defined(DEV_DEBUG_PRINT) +#define DBG_MMU_PRINTF(fmt, ...) ets_uart_printf(fmt, ##__VA_ARGS__) +#endif + +#else // ! defined(DEV_DEBUG_PRINT) || defined(DEBUG_ESP_MMU) +#define DBG_MMU_FLUSH(...) do {} while(false) +#define DBG_MMU_PRINTF(...) do {} while(false) +#endif // defined(DEV_DEBUG_PRINT) || defined(DEBUG_ESP_MMU) + +static inline __attribute__((always_inline)) +bool mmu_is_iram(const void *addr) { + #define IRAM_START 0x40100000UL +#ifndef MMU_IRAM_SIZE +#if defined(__GNUC__) && !defined(CORE_MOCK) + #warning "MMU_IRAM_SIZE was undefined, setting to 0x8000UL!" +#endif + #define MMU_IRAM_SIZE 0x8000UL +#endif + #define IRAM_END (IRAM_START + MMU_IRAM_SIZE) + + return (IRAM_START <= (uintptr_t)addr && IRAM_END > (uintptr_t)addr); +} + +static inline __attribute__((always_inline)) +bool mmu_is_dram(const void *addr) { + #define DRAM_START 0x3FF80000UL + #define DRAM_END 0x40000000UL + + return (DRAM_START <= (uintptr_t)addr && DRAM_END > (uintptr_t)addr); +} + +static inline __attribute__((always_inline)) +bool mmu_is_icache(const void *addr) { + #define ICACHE_START 0x40200000UL + #define ICACHE_END (ICACHE_START + 0x100000UL) + + return (ICACHE_START <= (uintptr_t)addr && ICACHE_END > (uintptr_t)addr); +} + +#ifdef DEBUG_ESP_MMU +#define ASSERT_RANGE_TEST_WRITE(a) \ + if (mmu_is_iram(a) || mmu_is_dram(a)) { \ + } else { \ + DBG_MMU_PRINTF("\nexcvaddr: %p\n", a); \ + assert(("Outside of Range - Write" && false)); \ + } + +#define ASSERT_RANGE_TEST_READ(a) \ + if (mmu_is_iram(a) || mmu_is_dram(a) || mmu_is_icache(a)) { \ + } else { \ + DBG_MMU_PRINTF("\nexcvaddr: %p\n", a); \ + assert(("Outside of Range - Read" && false)); \ + } + +#else +#define ASSERT_RANGE_TEST_WRITE(a) do {} while(false) +#define ASSERT_RANGE_TEST_READ(a) do {} while(false) +#endif + +/* + * Some inlines to allow faster random access to non32bit access of iRAM or + * iCACHE data elements. These remove the extra time and stack space that would + * have occured by relying on exception processing. + */ +static inline __attribute__((always_inline)) +uint8_t mmu_get_uint8(const void *p8) { + ASSERT_RANGE_TEST_READ(p8); + uint32_t val = (*(uint32_t *)((uintptr_t)p8 & ~0x3)); + uint32_t pos = ((uintptr_t)p8 & 0x3) * 8; + val >>= pos; + return (uint8_t)val; +} + +static inline __attribute__((always_inline)) +uint16_t mmu_get_uint16(const uint16_t *p16) { + ASSERT_RANGE_TEST_READ(p16); + uint32_t val = (*(uint32_t *)((uintptr_t)p16 & ~0x3)); + uint32_t pos = ((uintptr_t)p16 & 0x3) * 8; + val >>= pos; + return (uint16_t)val; +} + +static inline __attribute__((always_inline)) +int16_t mmu_get_int16(const int16_t *p16) { + ASSERT_RANGE_TEST_READ(p16); + uint32_t val = (*(uint32_t *)((uintptr_t)p16 & ~0x3)); + uint32_t pos = ((uintptr_t)p16 & 0x3) * 8; + val >>= pos; + return (int16_t)val; +} + +static inline __attribute__((always_inline)) +uint8_t mmu_set_uint8(void *p8, const uint8_t val) { + ASSERT_RANGE_TEST_WRITE(p8); + uint32_t pos = ((uintptr_t)p8 & 0x3) * 8; + uint32_t sval = val << pos; + uint32_t valmask = 0x0FF << pos; + + uint32_t *p32 = (uint32_t *)((uintptr_t)p8 & ~0x3); + uint32_t ival = *p32; + ival &= (~valmask); + ival |= sval; + *p32 = ival; + return val; +} + +static inline __attribute__((always_inline)) +uint16_t mmu_set_uint16(uint16_t *p16, const uint16_t val) { + ASSERT_RANGE_TEST_WRITE(p16); + uint32_t pos = ((uintptr_t)p16 & 0x3) * 8; + uint32_t sval = val << pos; + uint32_t valmask = 0x0FFFF << pos; + + uint32_t *p32 = (uint32_t *)((uintptr_t)p16 & ~0x3); + uint32_t ival = *p32; + ival &= (~valmask); + ival |= sval; + *p32 = ival; + return val; +} + +static inline __attribute__((always_inline)) +int16_t mmu_set_int16(int16_t *p16, const int16_t val) { + ASSERT_RANGE_TEST_WRITE(p16); + uint32_t sval = (uint16_t)val; + uint32_t pos = ((uintptr_t)p16 & 0x3) * 8; + sval <<= pos; + uint32_t valmask = 0x0FFFF << pos; + + uint32_t *p32 = (uint32_t *)((uintptr_t)p16 & ~0x3); + uint32_t ival = *p32; + ival &= (~valmask); + ival |= sval; + *p32 = ival; + return val; +} + +#if (MMU_IRAM_SIZE > 32*1024) && !defined(MMU_SEC_HEAP) +extern void _text_end(void); +#define MMU_SEC_HEAP mmu_sec_heap() +#define MMU_SEC_HEAP_SIZE mmu_sec_heap_size() + +static inline __attribute__((always_inline)) +void *mmu_sec_heap(void) { + uint32_t sec_heap = (uint32_t)_text_end + 32; + return (void *)(sec_heap &= ~7); +} + +static inline __attribute__((always_inline)) +size_t mmu_sec_heap_size(void) { + return (size_t)0xC000UL - ((size_t)mmu_sec_heap() - 0x40100000UL); +} +#endif + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/cores/esp8266/spiffs_api.h b/cores/esp8266/spiffs_api.h index 1ea04849e..26da25130 100644 --- a/cores/esp8266/spiffs_api.h +++ b/cores/esp8266/spiffs_api.h @@ -26,8 +26,6 @@ */ #include #include "FS.h" -#undef max -#undef min #include "FSImpl.h" extern "C" { #include "spiffs/spiffs.h" diff --git a/cores/esp8266/time.cpp b/cores/esp8266/time.cpp index a4656d811..b9489c330 100644 --- a/cores/esp8266/time.cpp +++ b/cores/esp8266/time.cpp @@ -23,6 +23,9 @@ #include #include <../include/time.h> // See issue #6714 #include +extern "C" { + #include +}; #include #include @@ -204,14 +207,14 @@ void configTime(const char* tz, const char* server1, const char* server2, const sntp_init(); } -static TrivialCB _settimeofday_cb; - -void settimeofday_cb (TrivialCB&& cb) -{ - _settimeofday_cb = std::move(cb); -} +static BoolCB _settimeofday_cb; void settimeofday_cb (const TrivialCB& cb) +{ + _settimeofday_cb = [cb](bool sntp) { (void)sntp; cb(); }; +} + +void settimeofday_cb (const BoolCB& cb) { _settimeofday_cb = cb; } @@ -222,6 +225,20 @@ extern "C" { int settimeofday(const struct timeval* tv, const struct timezone* tz) { + bool from_sntp; + if (tz == (struct timezone*)0xFeedC0de) + { + // This special constant is used by lwip2/SNTP calling + // settimeofday(sntp-time, 0xfeedc0de), secretly using the + // obsolete-but-yet-still-there `tz` field. + // It allows to avoid duplicating this function and inform user + // about the source time change. + tz = nullptr; + from_sntp = true; + } + else + from_sntp = false; + if (tz || !tv) // tz is obsolete (cf. man settimeofday) return EINVAL; @@ -230,7 +247,7 @@ int settimeofday(const struct timeval* tv, const struct timezone* tz) tune_timeshift64(tv->tv_sec * 1000000ULL + tv->tv_usec); if (_settimeofday_cb) - schedule_recurrent_function_us([](){ _settimeofday_cb(); return false; }, 0); + schedule_recurrent_function_us([from_sntp](){ _settimeofday_cb(from_sntp); return false; }, 0); return 0; } diff --git a/cores/esp8266/uart.cpp b/cores/esp8266/uart.cpp index a21300e51..47e7243ab 100644 --- a/cores/esp8266/uart.cpp +++ b/cores/esp8266/uart.cpp @@ -506,8 +506,10 @@ uart_write(uart_t* uart, const char* buf, size_t size) size_t ret = size; const int uart_nr = uart->uart_nr; - while (size--) + while (size--) { uart_do_write_char(uart_nr, pgm_read_byte(buf++)); + optimistic_yield(10000UL); + } return ret; } diff --git a/cores/esp8266/umm_malloc/umm_heap_select.h b/cores/esp8266/umm_malloc/umm_heap_select.h new file mode 100644 index 000000000..1a3728d7a --- /dev/null +++ b/cores/esp8266/umm_malloc/umm_heap_select.h @@ -0,0 +1,102 @@ +#ifndef UMM_MALLOC_SELECT_H +#define UMM_MALLOC_SELECT_H + +#include + +#ifndef ALWAYS_INLINE +#define ALWAYS_INLINE inline __attribute__ ((always_inline)) +#endif + +// Use FORCE_ALWAYS_INLINE to ensure HeapSelect... construtor/deconstructor +// are placed in IRAM +#ifdef FORCE_ALWAYS_INLINE_HEAP_SELECT +#define MAYBE_ALWAYS_INLINE ALWAYS_INLINE +#else +#define MAYBE_ALWAYS_INLINE +#endif + +/* + This class is modeled after interrupts.h + + HeapSelectIram is used to temporarily select an alternate Heap. + + { + { + HeapSelectIram lock; + // allocate memory here + } + allocations here are from the old Heap selection + } + */ + +class HeapSelect { +public: +#if (UMM_NUM_HEAPS == 1) + MAYBE_ALWAYS_INLINE + HeapSelect(size_t id) { (void)id; } + MAYBE_ALWAYS_INLINE + ~HeapSelect() {} +#else + MAYBE_ALWAYS_INLINE + HeapSelect(size_t id) : _heap_id(umm_get_current_heap_id()) { + umm_set_heap_by_id(id); + } + + MAYBE_ALWAYS_INLINE + ~HeapSelect() { + umm_set_heap_by_id(_heap_id); + } + +protected: + size_t _heap_id; +#endif +}; + +class HeapSelectIram { +public: +#ifdef UMM_HEAP_IRAM + MAYBE_ALWAYS_INLINE + HeapSelectIram() : _heap_id(umm_get_current_heap_id()) { + umm_set_heap_by_id(UMM_HEAP_IRAM); + } + + MAYBE_ALWAYS_INLINE + ~HeapSelectIram() { + umm_set_heap_by_id(_heap_id); + } + +protected: + size_t _heap_id; + +#else + MAYBE_ALWAYS_INLINE + HeapSelectIram() {} + MAYBE_ALWAYS_INLINE + ~HeapSelectIram() {} +#endif +}; + +class HeapSelectDram { +public: +#if (UMM_NUM_HEAPS == 1) + MAYBE_ALWAYS_INLINE + HeapSelectDram() {} + MAYBE_ALWAYS_INLINE + ~HeapSelectDram() {} +#else + MAYBE_ALWAYS_INLINE + HeapSelectDram() : _heap_id(umm_get_current_heap_id()) { + umm_set_heap_by_id(UMM_HEAP_DRAM); + } + + MAYBE_ALWAYS_INLINE + ~HeapSelectDram() { + umm_set_heap_by_id(_heap_id); + } + +protected: + size_t _heap_id; +#endif +}; + +#endif // UMM_MALLOC_SELECT_H diff --git a/cores/esp8266/umm_malloc/umm_info.c b/cores/esp8266/umm_malloc/umm_info.c index 1c78ef3f6..0860fe79e 100644 --- a/cores/esp8266/umm_malloc/umm_info.c +++ b/cores/esp8266/umm_malloc/umm_info.c @@ -23,25 +23,25 @@ * ---------------------------------------------------------------------------- */ -UMM_HEAP_INFO ummHeapInfo; +// UMM_HEAP_INFO ummHeapInfo; void *umm_info( void *ptr, bool force ) { UMM_CRITICAL_DECL(id_info); - if(umm_heap == NULL) { - umm_init(); - } + UMM_INIT_HEAP; uint16_t blockNo = 0; /* Protect the critical section... */ UMM_CRITICAL_ENTRY(id_info); + umm_heap_context_t *_context = umm_get_current_heap(); + /* * Clear out all of the entries in the ummHeapInfo structure before doing * any calculations.. */ - memset( &ummHeapInfo, 0, sizeof( ummHeapInfo ) ); + memset( &_context->info, 0, sizeof( _context->info ) ); DBGLOG_FORCE( force, "\n" ); DBGLOG_FORCE( force, "+----------+-------+--------+--------+-------+--------+--------+\n" ); @@ -65,18 +65,18 @@ void *umm_info( void *ptr, bool force ) { while( UMM_NBLOCK(blockNo) & UMM_BLOCKNO_MASK ) { size_t curBlocks = (UMM_NBLOCK(blockNo) & UMM_BLOCKNO_MASK )-blockNo; - ++ummHeapInfo.totalEntries; - ummHeapInfo.totalBlocks += curBlocks; + ++_context->info.totalEntries; + _context->info.totalBlocks += curBlocks; /* Is this a free block? */ if( UMM_NBLOCK(blockNo) & UMM_FREELIST_MASK ) { - ++ummHeapInfo.freeEntries; - ummHeapInfo.freeBlocks += curBlocks; - ummHeapInfo.freeBlocksSquared += (curBlocks * curBlocks); + ++_context->info.freeEntries; + _context->info.freeBlocks += curBlocks; + _context->info.freeBlocksSquared += (curBlocks * curBlocks); - if (ummHeapInfo.maxFreeContiguousBlocks < curBlocks) { - ummHeapInfo.maxFreeContiguousBlocks = curBlocks; + if (_context->info.maxFreeContiguousBlocks < curBlocks) { + _context->info.maxFreeContiguousBlocks = curBlocks; } DBGLOG_FORCE( force, "|0x%08lx|B %5d|NB %5d|PB %5d|Z %5u|NF %5d|PF %5d|\n", @@ -98,8 +98,8 @@ void *umm_info( void *ptr, bool force ) { return( ptr ); } } else { - ++ummHeapInfo.usedEntries; - ummHeapInfo.usedBlocks += curBlocks; + ++_context->info.usedEntries; + _context->info.usedBlocks += curBlocks; DBGLOG_FORCE( force, "|0x%08lx|B %5d|NB %5d|PB %5d|Z %5u|\n", DBGLOG_32_BIT_PTR(&UMM_BLOCK(blockNo)), @@ -131,35 +131,35 @@ void *umm_info( void *ptr, bool force ) { DBGLOG_FORCE( force, "+----------+-------+--------+--------+-------+--------+--------+\n" ); DBGLOG_FORCE( force, "Total Entries %5d Used Entries %5d Free Entries %5d\n", - ummHeapInfo.totalEntries, - ummHeapInfo.usedEntries, - ummHeapInfo.freeEntries ); + _context->info.totalEntries, + _context->info.usedEntries, + _context->info.freeEntries ); DBGLOG_FORCE( force, "Total Blocks %5d Used Blocks %5d Free Blocks %5d\n", - ummHeapInfo.totalBlocks, - ummHeapInfo.usedBlocks, - ummHeapInfo.freeBlocks ); + _context->info.totalBlocks, + _context->info.usedBlocks, + _context->info.freeBlocks ); DBGLOG_FORCE( force, "+--------------------------------------------------------------+\n" ); - DBGLOG_FORCE( force, "Usage Metric: %5d\n", umm_usage_metric()); - DBGLOG_FORCE( force, "Fragmentation Metric: %5d\n", umm_fragmentation_metric()); + DBGLOG_FORCE( force, "Usage Metric: %5d\n", umm_usage_metric_core(_context)); + DBGLOG_FORCE( force, "Fragmentation Metric: %5d\n", umm_fragmentation_metric_core(_context)); DBGLOG_FORCE( force, "+--------------------------------------------------------------+\n" ); #if defined(UMM_STATS) || defined(UMM_STATS_FULL) #if !defined(UMM_INLINE_METRICS) - if (ummHeapInfo.freeBlocks == ummStats.free_blocks) { + if (_context->info.freeBlocks == _context->stats.free_blocks) { DBGLOG_FORCE( force, "heap info Free blocks and heap statistics Free blocks match.\n"); } else { DBGLOG_FORCE( force, "\nheap info Free blocks %5d != heap statistics Free Blocks %5d\n\n", - ummHeapInfo.freeBlocks, - ummStats.free_blocks ); + _context->info.freeBlocks, + _context->stats.free_blocks ); } DBGLOG_FORCE( force, "+--------------------------------------------------------------+\n" ); #endif - print_stats(force); + umm_print_stats(force); #endif /* Release the critical section... */ @@ -170,20 +170,29 @@ void *umm_info( void *ptr, bool force ) { /* ------------------------------------------------------------------------ */ +size_t umm_free_heap_size_core( umm_heap_context_t *_context ) { + return (size_t)_context->info.freeBlocks * sizeof(umm_block); +} + size_t umm_free_heap_size( void ) { #ifndef UMM_INLINE_METRICS umm_info(NULL, false); #endif - return (size_t)ummHeapInfo.freeBlocks * sizeof(umm_block); + + return umm_free_heap_size_core(umm_get_current_heap()); } //C Breaking change in upstream umm_max_block_size() was changed to //C umm_max_free_block_size() keeping old function name for (dot) releases. //C TODO: update at next major release. //C size_t umm_max_free_block_size( void ) { +size_t umm_max_block_size_core( umm_heap_context_t *_context ) { + return _context->info.maxFreeContiguousBlocks * sizeof(umm_block); +} + size_t umm_max_block_size( void ) { umm_info(NULL, false); - return ummHeapInfo.maxFreeContiguousBlocks * sizeof(umm_block); + return umm_max_block_size_core(umm_get_current_heap()); } /* @@ -191,50 +200,62 @@ size_t umm_max_block_size( void ) { umm_fragmentation_metric() must to be preceeded by a call to umm_info(NULL, false) for updated results. */ -int umm_usage_metric( void ) { -#ifndef UMM_INLINE_METRICS - umm_info(NULL, false); -#endif - DBGLOG_DEBUG( "usedBlocks %d totalBlocks %d\n", umm_metrics.usedBlocks, ummHeapInfo.totalBlocks); - if (ummHeapInfo.freeBlocks) - return (int)((ummHeapInfo.usedBlocks * 100)/(ummHeapInfo.freeBlocks)); +int umm_usage_metric_core( umm_heap_context_t *_context ) { +//C Note, umm_metrics also appears in the upstrean w/o definition. I suspect it is suppose to be ummHeapInfo. + // DBGLOG_DEBUG( "usedBlocks %d totalBlocks %d\n", umm_metrics.usedBlocks, ummHeapInfo.totalBlocks); + DBGLOG_DEBUG( "usedBlocks %d totalBlocks %d\n", _context->info.usedBlocks, _context->info.totalBlocks); + if (_context->info.freeBlocks) + return (int)((_context->info.usedBlocks * 100)/(_context->info.freeBlocks)); return -1; // no freeBlocks } +int umm_usage_metric( void ) { +#ifndef UMM_INLINE_METRICS + umm_info(NULL, false); +#endif + + return umm_usage_metric_core(umm_get_current_heap()); +} uint32_t sqrt32 (uint32_t n); +int umm_fragmentation_metric_core( umm_heap_context_t *_context ) { + // DBGLOG_DEBUG( "freeBlocks %d freeBlocksSquared %d\n", umm_metrics.freeBlocks, ummHeapInfo.freeBlocksSquared); + DBGLOG_DEBUG( "freeBlocks %d freeBlocksSquared %d\n", _context->info.freeBlocks, _context->info.freeBlocksSquared); + if (0 == _context->info.freeBlocks) { + return 0; + } else { + //upstream version: return (100 - (((uint32_t)(sqrtf(ummHeapInfo.freeBlocksSquared)) * 100)/(ummHeapInfo.freeBlocks))); + return (100 - (((uint32_t)(sqrt32(_context->info.freeBlocksSquared)) * 100)/(_context->info.freeBlocks))); + } +} + int umm_fragmentation_metric( void ) { #ifndef UMM_INLINE_METRICS umm_info(NULL, false); #endif - DBGLOG_DEBUG( "freeBlocks %d freeBlocksSquared %d\n", umm_metrics.freeBlocks, ummHeapInfo.freeBlocksSquared); - if (0 == ummHeapInfo.freeBlocks) { - return 0; - } else { - //upstream version: return (100 - (((uint32_t)(sqrtf(ummHeapInfo.freeBlocksSquared)) * 100)/(ummHeapInfo.freeBlocks))); - return (100 - (((uint32_t)(sqrt32(ummHeapInfo.freeBlocksSquared)) * 100)/(ummHeapInfo.freeBlocks))); - } + + return umm_fragmentation_metric_core(umm_get_current_heap()); } #ifdef UMM_INLINE_METRICS -static void umm_fragmentation_metric_init( void ) { - ummHeapInfo.freeBlocks = UMM_NUMBLOCKS - 2; - ummHeapInfo.freeBlocksSquared = ummHeapInfo.freeBlocks * ummHeapInfo.freeBlocks; +static void umm_fragmentation_metric_init( umm_heap_context_t *_context ) { + _context->info.freeBlocks = UMM_NUMBLOCKS - 2; + _context->info.freeBlocksSquared = _context->info.freeBlocks * _context->info.freeBlocks; } -static void umm_fragmentation_metric_add( uint16_t c ) { +static void umm_fragmentation_metric_add( umm_heap_context_t *_context, uint16_t c ) { uint16_t blocks = (UMM_NBLOCK(c) & UMM_BLOCKNO_MASK) - c; DBGLOG_DEBUG( "Add block %d size %d to free metric\n", c, blocks); - ummHeapInfo.freeBlocks += blocks; - ummHeapInfo.freeBlocksSquared += (blocks * blocks); + _context->info.freeBlocks += blocks; + _context->info.freeBlocksSquared += (blocks * blocks); } -static void umm_fragmentation_metric_remove( uint16_t c ) { +static void umm_fragmentation_metric_remove( umm_heap_context_t *_context, uint16_t c ) { uint16_t blocks = (UMM_NBLOCK(c) & UMM_BLOCKNO_MASK) - c; DBGLOG_DEBUG( "Remove block %d size %d from free metric\n", c, blocks); - ummHeapInfo.freeBlocks -= blocks; - ummHeapInfo.freeBlocksSquared -= (blocks * blocks); + _context->info.freeBlocks -= blocks; + _context->info.freeBlocksSquared -= (blocks * blocks); } #endif // UMM_INLINE_METRICS diff --git a/cores/esp8266/umm_malloc/umm_integrity.c b/cores/esp8266/umm_malloc/umm_integrity.c index 6c3c4c2f1..bb68c52f4 100644 --- a/cores/esp8266/umm_malloc/umm_integrity.c +++ b/cores/esp8266/umm_malloc/umm_integrity.c @@ -33,13 +33,14 @@ bool umm_integrity_check(void) { uint16_t prev; uint16_t cur; - if (umm_heap == NULL) { - umm_init(); - } + UMM_INIT_HEAP; /* Iterate through all free blocks */ prev = 0; UMM_CRITICAL_ENTRY(id_integrity); + + umm_heap_context_t *_context = umm_get_current_heap(); + while(1) { cur = UMM_NFREE(prev); diff --git a/cores/esp8266/umm_malloc/umm_local.c b/cores/esp8266/umm_malloc/umm_local.c index 392ef13c8..3eca39c6d 100644 --- a/cores/esp8266/umm_malloc/umm_local.c +++ b/cores/esp8266/umm_malloc/umm_local.c @@ -42,7 +42,7 @@ bool ICACHE_FLASH_ATTR get_umm_get_perf_data(UMM_TIME_STATS *p, size_t size) #if defined(UMM_POISON_CHECK_LITE) // We skip this when doing the full poison check. -static bool check_poison_neighbors( uint16_t cur ) { +static bool check_poison_neighbors( umm_heap_context_t *_context, uint16_t cur ) { uint16_t c; if ( 0 == cur ) @@ -96,12 +96,16 @@ static void *get_unpoisoned_check_neighbors( void *vptr, const char* file, int l UMM_CRITICAL_DECL(id_poison); uint16_t c; bool poison = false; - + umm_heap_context_t *_context = umm_get_ptr_context( vptr ); + if (NULL == _context) { + panic(); + return NULL; + } /* Figure out which block we're in. Note the use of truncated division... */ - c = (ptr - (uintptr_t)(&(umm_heap[0])))/sizeof(umm_block); + c = (ptr - (uintptr_t)(&(_context->heap[0])))/sizeof(umm_block); UMM_CRITICAL_ENTRY(id_poison); - poison = check_poison_block(&UMM_BLOCK(c)) && check_poison_neighbors(c); + poison = check_poison_block(&UMM_BLOCK(c)) && check_poison_neighbors(_context, c); UMM_CRITICAL_EXIT(id_poison); if (!poison) { @@ -157,17 +161,13 @@ size_t umm_block_size( void ) { } #endif -#if (!defined(UMM_INLINE_METRICS) && defined(UMM_STATS)) || defined(UMM_STATS_FULL) -UMM_STATISTICS ummStats; -#endif - #if defined(UMM_STATS) || defined(UMM_STATS_FULL) // Keep complete call path in IRAM size_t umm_free_heap_size_lw( void ) { - if (umm_heap == NULL) { - umm_init(); - } - return (size_t)UMM_FREE_BLOCKS * sizeof(umm_block); + UMM_INIT_HEAP; + + umm_heap_context_t *_context = umm_get_current_heap(); + return (size_t)_context->UMM_FREE_BLOCKS * sizeof(umm_block); } #endif @@ -186,14 +186,17 @@ size_t xPortGetFreeHeapSize(void) __attribute__ ((alias("umm_free_heap_size"))); #endif #if defined(UMM_STATS) || defined(UMM_STATS_FULL) -void print_stats(int force) { +void umm_print_stats(int force) { + umm_heap_context_t *_context = umm_get_current_heap(); + DBGLOG_FORCE( force, "umm heap statistics:\n"); - DBGLOG_FORCE( force, " Raw Free Space %5u\n", UMM_FREE_BLOCKS * sizeof(umm_block)); - DBGLOG_FORCE( force, " OOM Count %5u\n", UMM_OOM_COUNT); + DBGLOG_FORCE( force, " Heap ID %5u\n", _context->id); + DBGLOG_FORCE( force, " Free Space %5u\n", _context->UMM_FREE_BLOCKS * sizeof(umm_block)); + DBGLOG_FORCE( force, " OOM Count %5u\n", _context->UMM_OOM_COUNT); #if defined(UMM_STATS_FULL) - DBGLOG_FORCE( force, " Low Watermark %5u\n", ummStats.free_blocks_min * sizeof(umm_block)); - DBGLOG_FORCE( force, " Low Watermark ISR %5u\n", ummStats.free_blocks_isr_min * sizeof(umm_block)); - DBGLOG_FORCE( force, " MAX Alloc Request %5u\n", ummStats.alloc_max_size); + DBGLOG_FORCE( force, " Low Watermark %5u\n", _context->stats.free_blocks_min * sizeof(umm_block)); + DBGLOG_FORCE( force, " Low Watermark ISR %5u\n", _context->stats.free_blocks_isr_min * sizeof(umm_block)); + DBGLOG_FORCE( force, " MAX Alloc Request %5u\n", _context->stats.alloc_max_size); #endif DBGLOG_FORCE( force, " Size of umm_block %5u\n", sizeof(umm_block)); DBGLOG_FORCE( force, "+--------------------------------------------------------------+\n" ); @@ -215,4 +218,85 @@ int ICACHE_FLASH_ATTR umm_info_safe_printf_P(const char *fmt, ...) { return result; } +#if defined(UMM_STATS) || defined(UMM_STATS_FULL) +size_t ICACHE_FLASH_ATTR umm_get_oom_count( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->UMM_OOM_COUNT; +} +#endif + +#ifdef UMM_STATS_FULL +// TODO - Did I mix something up +// +// umm_free_heap_size_min is the same code as +// umm_free_heap_size_lw_min +// +// If this is correct use alias. +// +size_t ICACHE_FLASH_ATTR umm_free_heap_size_lw_min( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.free_blocks_min * umm_block_size(); +} + +size_t ICACHE_FLASH_ATTR umm_free_heap_size_min_reset( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + _context->stats.free_blocks_min = _context->UMM_FREE_BLOCKS; + return _context->stats.free_blocks_min * umm_block_size(); +} + +#if 0 // TODO - Don't understand this why do both umm_free_heap_size_(lw_)min exist +size_t umm_free_heap_size_min(void) __attribute__ ((alias("umm_free_heap_size_lw_min"))); +#else +size_t ICACHE_FLASH_ATTR umm_free_heap_size_min( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.free_blocks_min * umm_block_size(); +} +#endif + +size_t ICACHE_FLASH_ATTR umm_free_heap_size_isr_min( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.free_blocks_isr_min * umm_block_size(); +} + +size_t ICACHE_FLASH_ATTR umm_get_max_alloc_size( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.alloc_max_size; +} + +size_t ICACHE_FLASH_ATTR umm_get_last_alloc_size( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.last_alloc_size; +} + +size_t ICACHE_FLASH_ATTR umm_get_malloc_count( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.id_malloc_count; +} + +size_t ICACHE_FLASH_ATTR umm_get_malloc_zero_count( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.id_malloc_zero_count; +} + +size_t ICACHE_FLASH_ATTR umm_get_realloc_count( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.id_realloc_count; +} + +size_t ICACHE_FLASH_ATTR umm_get_realloc_zero_count( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.id_realloc_zero_count; +} + +size_t ICACHE_FLASH_ATTR umm_get_free_count( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.id_free_count; +} + +size_t ICACHE_FLASH_ATTR umm_get_free_null_count( void ) { + umm_heap_context_t *_context = umm_get_current_heap(); + return _context->stats.id_free_null_count; +} +#endif // UMM_STATS_FULL + #endif // BUILD_UMM_MALLOC_C diff --git a/cores/esp8266/umm_malloc/umm_local.h b/cores/esp8266/umm_malloc/umm_local.h index bb9f0bd4e..cb72d669c 100644 --- a/cores/esp8266/umm_malloc/umm_local.h +++ b/cores/esp8266/umm_malloc/umm_local.h @@ -37,12 +37,12 @@ #if defined(UMM_POISON_CHECK_LITE) -static bool check_poison_neighbors( uint16_t cur ); +static bool check_poison_neighbors( umm_heap_context_t *_context, uint16_t cur ); #endif #if defined(UMM_STATS) || defined(UMM_STATS_FULL) -void ICACHE_FLASH_ATTR print_stats(int force); +void ICACHE_FLASH_ATTR umm_print_stats(int force); #endif @@ -51,4 +51,21 @@ int ICACHE_FLASH_ATTR umm_info_safe_printf_P(const char *fmt, ...) __attribute__ #define UMM_INFO_PRINTF(fmt, ...) umm_info_safe_printf_P(PSTR4(fmt), ##__VA_ARGS__) // use PSTR4() instead of PSTR() to ensure 4-bytes alignment in Flash, whatever the default alignment of PSTR_ALIGN + +typedef struct umm_block_t umm_block; + +struct UMM_HEAP_CONTEXT { + umm_block *heap; + void *heap_end; +#if (!defined(UMM_INLINE_METRICS) && defined(UMM_STATS)) || defined(UMM_STATS_FULL) + UMM_STATISTICS stats; +#endif +#ifdef UMM_INFO + UMM_HEAP_INFO info; +#endif + unsigned short int numblocks; + unsigned char id; +}; + + #endif diff --git a/cores/esp8266/umm_malloc/umm_malloc.cpp b/cores/esp8266/umm_malloc/umm_malloc.cpp index 7f14ed942..11b67d0fb 100644 --- a/cores/esp8266/umm_malloc/umm_malloc.cpp +++ b/cores/esp8266/umm_malloc/umm_malloc.cpp @@ -63,6 +63,11 @@ extern "C" { #define DBGLOG_LEVEL 0 #endif +// Save 104 bytes by calling umm_init() early once from app_entry() +// Some minor UMM_CRITICAL_METRICS counts will be lost through CRT0 init. +// #define UMM_INIT_HEAP if (!umm_heap) { umm_init(); } +#define UMM_INIT_HEAP (void)0 + #include "dbglog/dbglog.h" //C This change is new in upstream umm_malloc.I think this would have created a @@ -101,24 +106,146 @@ UMM_H_ATTPACKPRE typedef struct umm_block_t { #define UMM_BLOCKNO_MASK ((uint16_t)(0x7FFF)) /* ------------------------------------------------------------------------- */ +umm_heap_context_t heap_context[UMM_NUM_HEAPS] __attribute__((section(".noinit"))); +// void *umm_heap = NULL; -umm_block *umm_heap = NULL; -uint16_t umm_numblocks = 0; +/* A stack allowing push/popping of heaps for library use */ +#if (UMM_NUM_HEAPS == 1) -#define UMM_NUMBLOCKS (umm_numblocks) +#else +static size_t umm_heap_cur = UMM_HEAP_DRAM; +static int umm_heap_stack_ptr = 0; +static unsigned char umm_heap_stack[UMM_HEAP_STACK_DEPTH]; +#endif +/* ------------------------------------------------------------------------ */ +/* + * Methods to get heap id or context + * + */ + +#if (UMM_NUM_HEAPS == 1) +size_t umm_get_current_heap_id(void) { + return 0; +} + +umm_heap_context_t *umm_get_current_heap(void) { + return &heap_context[0]; +} + +static umm_heap_context_t *umm_get_heap_by_id( size_t which ) { + (void)which; + return &heap_context[0]; +} + +umm_heap_context_t *umm_set_heap_by_id( size_t which ) { + (void)which; + return &heap_context[0]; +} + +#else +size_t umm_get_current_heap_id(void) { + return umm_heap_cur; +} + +umm_heap_context_t *umm_get_current_heap(void) { + return &heap_context[umm_heap_cur]; +} + +static umm_heap_context_t *umm_get_heap_by_id( size_t which ) { + if (which < UMM_NUM_HEAPS) { + return &heap_context[which]; + } + return NULL; +} + +umm_heap_context_t *umm_set_heap_by_id( size_t which ) { + umm_heap_context_t *_context = umm_get_heap_by_id(which); + if (_context && _context->heap) { + umm_heap_cur = which; + return _context; + } + return NULL; +} +#endif + +#if (UMM_NUM_HEAPS == 1) +umm_heap_context_t *umm_push_heap( size_t which ) { + (void)which; + return &heap_context[0]; +} + +umm_heap_context_t *umm_pop_heap( void ) { + return &heap_context[0]; +} + +int umm_get_heap_stack_index( void ) { + return 0; +} +#else +/* ------------------------------------------------------------------------ */ + +umm_heap_context_t *umm_push_heap( size_t which ) { + if (umm_heap_stack_ptr < UMM_HEAP_STACK_DEPTH) { + umm_heap_stack[umm_heap_stack_ptr++] = umm_heap_cur; + return umm_set_heap_by_id( which ); + } + return NULL; +} + +/* ------------------------------------------------------------------------ */ + +umm_heap_context_t *umm_pop_heap( void ) { + if (umm_heap_stack_ptr > 0 ) { + return umm_set_heap_by_id(umm_heap_stack[--umm_heap_stack_ptr]); + } + return NULL; +} + +// Intended for diagnosic use +int umm_get_heap_stack_index( void ) { + return umm_heap_stack_ptr; +} +#endif +/* ------------------------------------------------------------------------ */ +/* + * Returns the correct heap context for a given pointer. Useful for + * realloc or free since you may not be in the right heap to handle it. + * + */ +static bool test_ptr_context( size_t which, void *ptr ) { + return + heap_context[which].heap && + ptr >= (void *)heap_context[which].heap && + ptr < heap_context[which].heap_end; +} + +static umm_heap_context_t *umm_get_ptr_context(void *ptr) { + for (size_t i = 0; i < UMM_NUM_HEAPS; i++) { + if (test_ptr_context( i, ptr ) ) { + return umm_get_heap_by_id( i ); + } + } + + panic(); + return NULL; +} + +#define UMM_NUMBLOCKS (_context->numblocks) #define UMM_BLOCK_LAST (UMM_NUMBLOCKS - 1) /* ------------------------------------------------------------------------- * These macros evaluate to the address of the block and data respectively */ -#define UMM_BLOCK(b) (umm_heap[b]) +#define UMM_BLOCK(b) (_context->heap[b]) #define UMM_DATA(b) (UMM_BLOCK(b).body.data) /* ------------------------------------------------------------------------- * These macros evaluate to the index of the block - NOT the address!!! */ +/* ------------------------------------------------------------------------ */ + #define UMM_NBLOCK(b) (UMM_BLOCK(b).header.used.next) #define UMM_PBLOCK(b) (UMM_BLOCK(b).header.used.prev) #define UMM_NFREE(b) (UMM_BLOCK(b).body.free.next) @@ -172,7 +299,9 @@ static uint16_t umm_blocks( size_t size ) { * * Note that free pointers are NOT modified by this function. */ -static void umm_split_block( uint16_t c, +static void umm_split_block( + umm_heap_context_t *_context, + uint16_t c, uint16_t blocks, uint16_t new_freemask ) { @@ -185,7 +314,7 @@ static void umm_split_block( uint16_t c, /* ------------------------------------------------------------------------ */ -static void umm_disconnect_from_free_list( uint16_t c ) { +static void umm_disconnect_from_free_list( umm_heap_context_t *_context, uint16_t c ) { /* Disconnect this block from the FREE list */ UMM_NFREE(UMM_PFREE(c)) = UMM_NFREE(c); @@ -202,7 +331,7 @@ static void umm_disconnect_from_free_list( uint16_t c ) { * next block is free. */ -static void umm_assimilate_up( uint16_t c ) { +static void umm_assimilate_up( umm_heap_context_t *_context, uint16_t c ) { if( UMM_NBLOCK(UMM_NBLOCK(c)) & UMM_FREELIST_MASK ) { @@ -217,7 +346,7 @@ static void umm_assimilate_up( uint16_t c ) { /* Disconnect the next block from the FREE list */ - umm_disconnect_from_free_list( UMM_NBLOCK(c) ); + umm_disconnect_from_free_list( _context, UMM_NBLOCK(c) ); /* Assimilate the next block with this one */ @@ -232,7 +361,7 @@ static void umm_assimilate_up( uint16_t c ) { * up before assimilating down. */ -static uint16_t umm_assimilate_down( uint16_t c, uint16_t freemask ) { +static uint16_t umm_assimilate_down( umm_heap_context_t *_context, uint16_t c, uint16_t freemask ) { // We are going to assimilate down to the previous block because // it was free, so remove it from the fragmentation metric @@ -257,23 +386,18 @@ static uint16_t umm_assimilate_down( uint16_t c, uint16_t freemask ) { /* ------------------------------------------------------------------------- */ -void umm_init( void ) { - /* init heap pointer and size, and memset it to 0 */ - umm_heap = (umm_block *)UMM_MALLOC_CFG_HEAP_ADDR; - umm_numblocks = (UMM_MALLOC_CFG_HEAP_SIZE / sizeof(umm_block)); - memset(umm_heap, 0x00, UMM_MALLOC_CFG_HEAP_SIZE); - +static void umm_init_stage_2( umm_heap_context_t *_context ) { /* setup initial blank heap structure */ UMM_FRAGMENTATION_METRIC_INIT(); - /* init ummStats.free_blocks */ + /* init stats.free_blocks */ #if defined(UMM_STATS) || defined(UMM_STATS_FULL) #if defined(UMM_STATS_FULL) - ummStats.free_blocks_min = - ummStats.free_blocks_isr_min = UMM_NUMBLOCKS - 2; + _context->stats.free_blocks_min = + _context->stats.free_blocks_isr_min = UMM_NUMBLOCKS - 2; #endif #ifndef UMM_INLINE_METRICS - ummStats.free_blocks = UMM_NUMBLOCKS - 2; + _context->stats.free_blocks = UMM_NUMBLOCKS - 2; #endif #endif @@ -314,15 +438,89 @@ void umm_init( void ) { UMM_PBLOCK(UMM_BLOCK_LAST) = 1; } + +void umm_init_common( size_t id, void *start_addr, size_t size, bool zero ) { + /* Preserve internal setup */ + umm_heap_context_t *_context = umm_get_heap_by_id(id); + if (NULL == start_addr || NULL == _context || _context->heap) { + return; + } + + /* init heap pointer and size, and memset it to 0 */ + _context->id = id; + _context->heap = (umm_block *)start_addr; + _context->heap_end = (void *)((uintptr_t)start_addr + size); + _context->numblocks = (size / sizeof(umm_block)); + + // An option for blocking the zeroing of extra heaps allows for performing + // post-crash discovery. + if (zero) { + memset(_context->heap, 0x00, size); +#if (!defined(UMM_INLINE_METRICS) && defined(UMM_STATS)) || defined(UMM_STATS_FULL) + memset(&_context->stats, 0x00, sizeof(_context->stats)); +#endif + + /* Set up internal data structures */ + umm_init_stage_2(_context); + } +} + +void umm_init( void ) { + // if (umm_heap) { + // return; + // } + for (size_t i = 0; i < UMM_NUM_HEAPS; i++) { + heap_context[i].heap = NULL; + } + memset(&heap_context[0], 0, sizeof(heap_context)); + umm_init_common( UMM_HEAP_DRAM, (void *)UMM_MALLOC_CFG_HEAP_ADDR, UMM_MALLOC_CFG_HEAP_SIZE, true ); + // umm_heap = (void *)&heap_context; +} + +#ifdef UMM_HEAP_IRAM +void umm_init_iram_ex( void *addr, unsigned int size, bool zero ) { + /* We need the main, internal heap set up first */ + UMM_INIT_HEAP; + + umm_init_common(UMM_HEAP_IRAM, addr, size, zero); +} + +void _text_end(void); +void umm_init_iram(void) __attribute__((weak)); + +/* + By using a weak link, it is possible to reduce the IRAM heap size with a + user-supplied init function. This would allow the creation of a block of IRAM + dedicated to a sketch and possibly used/preserved across reboots. + */ +void umm_init_iram(void) { + umm_init_iram_ex(mmu_sec_heap(), mmu_sec_heap_size(), true); +} +#endif // #ifdef UMM_HEAP_IRAM + +#ifdef UMM_HEAP_EXTERNAL +void umm_init_vm( void *vmaddr, unsigned int vmsize ) { + /* We need the main, internal (DRAM) heap set up first */ + UMM_INIT_HEAP; + + umm_init_common(UMM_HEAP_EXTERNAL, vmaddr, vmsize, true); +} +#endif + /* ------------------------------------------------------------------------ * Must be called only from within critical sections guarded by * UMM_CRITICAL_ENTRY() and UMM_CRITICAL_EXIT(). */ -static void umm_free_core( void *ptr ) { +static void umm_free_core( umm_heap_context_t *_context, void *ptr ) { uint16_t c; + if (NULL == _context) { + panic(); + return; + } + STATS__FREE_REQUEST(id_free); /* * FIXME: At some point it might be a good idea to add a check to make sure @@ -335,7 +533,7 @@ static void umm_free_core( void *ptr ) { /* Figure out which block we're in. Note the use of truncated division... */ - c = (((uintptr_t)ptr)-(uintptr_t)(&(umm_heap[0])))/sizeof(umm_block); + c = (((uintptr_t)ptr)-(uintptr_t)(&(_context->heap[0])))/sizeof(umm_block); DBGLOG_DEBUG( "Freeing block %6d\n", c ); @@ -344,7 +542,7 @@ static void umm_free_core( void *ptr ) { /* Now let's assimilate this block with the next one if possible. */ - umm_assimilate_up( c ); + umm_assimilate_up( _context, c ); /* Then assimilate with the previous block if possible */ @@ -352,7 +550,7 @@ static void umm_free_core( void *ptr ) { DBGLOG_DEBUG( "Assimilate down to previous block, which is FREE\n" ); - c = umm_assimilate_down(c, UMM_FREELIST_MASK); + c = umm_assimilate_down(_context, c, UMM_FREELIST_MASK); } else { /* * The previous block is not a free block, so add this one to the head @@ -376,9 +574,7 @@ static void umm_free_core( void *ptr ) { void umm_free( void *ptr ) { UMM_CRITICAL_DECL(id_free); - if (umm_heap == NULL) { - umm_init(); - } + UMM_INIT_HEAP; /* If we're being asked to free a NULL pointer, well that's just silly! */ @@ -393,7 +589,8 @@ void umm_free( void *ptr ) { UMM_CRITICAL_ENTRY(id_free); - umm_free_core( ptr ); + /* Need to be in the heap in which this block lives */ + umm_free_core( umm_get_ptr_context( ptr ), ptr ); UMM_CRITICAL_EXIT(id_free); } @@ -403,7 +600,7 @@ void umm_free( void *ptr ) { * UMM_CRITICAL_ENTRY() and UMM_CRITICAL_EXIT(). */ -static void *umm_malloc_core( size_t size ) { +static void *umm_malloc_core( umm_heap_context_t *_context, size_t size ) { uint16_t blocks; uint16_t blockSize = 0; @@ -414,6 +611,11 @@ static void *umm_malloc_core( size_t size ) { STATS__ALLOC_REQUEST(id_malloc, size); + if (NULL == _context) { + panic(); + return NULL; + } + blocks = umm_blocks( size ); /* @@ -474,7 +676,8 @@ static void *umm_malloc_core( size_t size ) { /* Disconnect this block from the FREE list */ - umm_disconnect_from_free_list( cf ); + umm_disconnect_from_free_list( _context, cf ); + } else { /* It's not an exact fit and we need to split off a block. */ @@ -484,7 +687,7 @@ static void *umm_malloc_core( size_t size ) { * split current free block `cf` into two blocks. The first one will be * returned to user, so it's not free, and the second one will be free. */ - umm_split_block( cf, blocks, UMM_FREELIST_MASK /*new block is free*/ ); + umm_split_block( _context, cf, blocks, UMM_FREELIST_MASK /*new block is free*/ ); UMM_FRAGMENTATION_METRIC_ADD(UMM_NBLOCK(cf)); @@ -525,9 +728,61 @@ void *umm_malloc( size_t size ) { void *ptr = NULL; - if (umm_heap == NULL) { - umm_init(); - } + UMM_INIT_HEAP; + + /* + * "Is it safe" + * + * Is it safe to call from an ISR? Is there a point during a malloc that a + * an interrupt and subsequent call to malloc result in undesired results? + * + * Heap selection in managed by the functions umm_push_heap, umm_pop_heap, + * umm_get_current_heap_id, and umm_set_heap_by_id. These functions are + * responsible for getting/setting the module static variable umm_heap_cur. + * The umm_heap_cur variable is an index that is used to select the current + * heap context. Depending on the situation this selection can be overriddened. + * + * All variables for a specific Heap are in a single structure. `heap_context` + * is an array of these structures. Each heap API function uses a function + * local variable `_context` to hold a pointer to the selected heap structure. + * This local pointer is referenced for all the "selected heap" operations. + * Coupled with critical sections around global data should allow the API + * functions to be reentrant. + * + * Using the `_context` name throughout made it easy to incorporate the + * context into existing macros. + * + * For allocating APIs `umm_heap_cur` is used to index and select a value for + * `_context`. If an allocation is made from an ISR, this value is ignored and + * the heap context for DRAM is loaded. For APIs that require operating on an + * existing allcation such as realloc and free, the heap context selected is + * done by matching the allocation's address with that of one of the heap + * address ranges. + * + * I think we are safe with multiple heaps when the non32-bit exception + * handler is used, as long as interrupts don't get enabled. There was a + * window in the Boot ROM "C" Exception Wrapper that would enable interrupts + * when running our non32-exception handler; however, that should be resolved + * by our replacement wrapper. For more information on exception handling + * issues for IRAM see comments above `_set_exception_handler_wrapper()` in + * `core_esp8266_non32xfer.cpp`. + * + * ISRs should not try and change heaps. umm_malloc will ignore the change. + * All should be fine as long as the caller puts the heap back the way it was. + * On return, everything must be the same. The foreground thread will continue + * with the same information that was there before the interrupt. All malloc() + * requests made from an ISR are fulfilled with DRAM. + * + * For umm_malloc, heap selection involves changing a single variable that is + * on the calling context stack. From the umm_mallac side, that variable is + * used to load a context pointer by index, heap ID. While an umm_malloc API + * function is running, all heap related variables are in the context variable + * pointer, registers, or the current stack as the request is processed. With + * a single variable to reference for heap selection, I think it is unlikely + * that umm_malloc can be called, with things in an unusable transition state. + */ + + umm_heap_context_t *_context = umm_get_current_heap(); /* * the very first thing we do is figure out if we're being asked to allocate @@ -547,7 +802,21 @@ void *umm_malloc( size_t size ) { UMM_CRITICAL_ENTRY(id_malloc); - ptr = umm_malloc_core( size ); + /* + * We handle the realloc of an existing IRAM allocation from an ISR with IRAM, + * while a new malloc from an ISR will always supply DRAM. That said, realloc + * from an ISR is not generally safe without special locking mechanisms and is + * not formally supported. + * + * Additionally, to avoid extending the IRQs disabled period, it is best to + * use DRAM for an ISR. Each 16-bit access to IRAM that umm_malloc has to make + * requires a pass through the exception handling logic. + */ + if (UMM_CRITICAL_WITHINISR(id_malloc)) { + _context = umm_get_heap_by_id(UMM_HEAP_DRAM); + } + + ptr = umm_malloc_core( _context, size ); UMM_CRITICAL_EXIT(id_malloc); @@ -568,9 +837,7 @@ void *umm_realloc( void *ptr, size_t size ) { size_t curSize; - if (umm_heap == NULL) { - umm_init(); - } + UMM_INIT_HEAP; /* * This code looks after the case of a NULL value for ptr. The ANSI C @@ -592,6 +859,13 @@ void *umm_realloc( void *ptr, size_t size ) { * we should operate the same as free. */ + /* Need to be in the heap in which this block lives */ + umm_heap_context_t *_context = umm_get_ptr_context( ptr ); + if (NULL == _context) { + panic(); + return NULL; + } + if( 0 == size ) { DBGLOG_DEBUG( "realloc to 0 size, just free the block\n" ); STATS__ZERO_ALLOC_REQUEST(id_realloc, size); @@ -616,7 +890,7 @@ void *umm_realloc( void *ptr, size_t size ) { /* Figure out which block we're in. Note the use of truncated division... */ - c = (((uintptr_t)ptr)-(uintptr_t)(&(umm_heap[0])))/sizeof(umm_block); + c = (((uintptr_t)ptr)-(uintptr_t)(&(_context->heap[0])))/sizeof(umm_block); /* Figure out how big this block is ... the free bit is not set :-) */ @@ -713,15 +987,15 @@ void *umm_realloc( void *ptr, size_t size ) { // Case 3 - prev block NOT free and block + next block fits } else if ((0 == prevBlockSize) && (blockSize + nextBlockSize) >= blocks) { DBGLOG_DEBUG( "realloc using next block - %i\n", blocks ); - umm_assimilate_up( c ); + umm_assimilate_up( _context, c ); STATS__FREE_BLOCKS_UPDATE( - nextBlockSize ); blockSize += nextBlockSize; // Case 4 - prev block + block fits } else if ((prevBlockSize + blockSize) >= blocks) { DBGLOG_DEBUG( "realloc using prev block - %i\n", blocks ); - umm_disconnect_from_free_list( UMM_PBLOCK(c) ); - c = umm_assimilate_down(c, 0); + umm_disconnect_from_free_list( _context, UMM_PBLOCK(c) ); + c = umm_assimilate_down(_context, c, 0); STATS__FREE_BLOCKS_UPDATE( - prevBlockSize ); STATS__FREE_BLOCKS_ISR_MIN(); blockSize += prevBlockSize; @@ -732,14 +1006,14 @@ void *umm_realloc( void *ptr, size_t size ) { // Case 5 - prev block + block + next block fits } else if ((prevBlockSize + blockSize + nextBlockSize) >= blocks) { DBGLOG_DEBUG( "realloc using prev and next block - %d\n", blocks ); - umm_assimilate_up( c ); - umm_disconnect_from_free_list( UMM_PBLOCK(c) ); - c = umm_assimilate_down(c, 0); + umm_assimilate_up( _context, c ); + umm_disconnect_from_free_list( _context, UMM_PBLOCK(c) ); + c = umm_assimilate_down(_context, c, 0); STATS__FREE_BLOCKS_UPDATE( - prevBlockSize - nextBlockSize ); #ifdef UMM_LIGHTWEIGHT_CPU if ((prevBlockSize + blockSize + nextBlockSize) > blocks) { - umm_split_block( c, blocks, 0 ); - umm_free_core( (void *)&UMM_DATA(c+blocks) ); + umm_split_block( _context, c, blocks, 0 ); + umm_free_core( _context, (void *)&UMM_DATA(c+blocks) ); } STATS__FREE_BLOCKS_ISR_MIN(); blockSize = blocks; @@ -755,16 +1029,16 @@ void *umm_realloc( void *ptr, size_t size ) { } else { DBGLOG_DEBUG( "realloc a completely new block %i\n", blocks ); void *oldptr = ptr; - if( (ptr = umm_malloc_core( size )) ) { + if( (ptr = umm_malloc_core( _context, size )) ) { DBGLOG_DEBUG( "realloc %i to a bigger block %i, copy, and free the old\n", blockSize, blocks ); UMM_CRITICAL_SUSPEND(id_realloc); memcpy( ptr, oldptr, curSize ); UMM_CRITICAL_RESUME(id_realloc); - umm_free_core( oldptr ); + umm_free_core( _context, oldptr ); } else { DBGLOG_DEBUG( "realloc %i to a bigger block %i failed - return NULL and leave the old block!\n", blockSize, blocks ); /* This space intentionally left blnk */ - STATS__OOM_UPDATE(); + /* STATS__OOM_UPDATE() has already been called by umm_malloc_core - don't duplicate count */ } /* This is not accurate for OOM case; however, it will work for * stopping a call to free before return. @@ -798,8 +1072,8 @@ void *umm_realloc( void *ptr, size_t size ) { * requested number of blocks and add what's left to the free list. */ if (prevBlockSize && (prevBlockSize + blockSize + nextBlockSize) >= blocks) { // 1 - umm_disconnect_from_free_list( UMM_PBLOCK(c) ); - c = umm_assimilate_down(c, 0); + umm_disconnect_from_free_list( _context, UMM_PBLOCK(c) ); + c = umm_assimilate_down( _context, c, 0 ); STATS__FREE_BLOCKS_UPDATE( - prevBlockSize ); blockSize += prevBlockSize; if (blockSize >= blocks) { @@ -807,13 +1081,13 @@ void *umm_realloc( void *ptr, size_t size ) { STATS__FREE_BLOCKS_ISR_MIN(); } else { DBGLOG_DEBUG( "realloc using prev and next block - %d\n", blocks ); - umm_assimilate_up( c ); + umm_assimilate_up( _context, c ); STATS__FREE_BLOCKS_UPDATE( - nextBlockSize ); blockSize += nextBlockSize; #ifdef UMM_LIGHTWEIGHT_CPU if (blockSize > blocks) { - umm_split_block( c, blocks, 0 ); - umm_free_core( (void *)&UMM_DATA(c+blocks) ); + umm_split_block( _context, c, blocks, 0 ); + umm_free_core( _context, (void *)&UMM_DATA(c+blocks) ); } STATS__FREE_BLOCKS_ISR_MIN(); blockSize = blocks; @@ -828,22 +1102,22 @@ void *umm_realloc( void *ptr, size_t size ) { /* This space intentionally left blank */ } else if ((blockSize + nextBlockSize) >= blocks) { // 3 DBGLOG_DEBUG( "realloc using next block - %d\n", blocks ); - umm_assimilate_up( c ); + umm_assimilate_up( _context, c ); STATS__FREE_BLOCKS_UPDATE( - nextBlockSize ); blockSize += nextBlockSize; } else { // 4 DBGLOG_DEBUG( "realloc a completely new block %d\n", blocks ); void *oldptr = ptr; - if( (ptr = umm_malloc_core( size )) ) { + if( (ptr = umm_malloc_core( _context, size )) ) { DBGLOG_DEBUG( "realloc %d to a bigger block %d, copy, and free the old\n", blockSize, blocks ); UMM_CRITICAL_SUSPEND(id_realloc); memcpy( ptr, oldptr, curSize ); UMM_CRITICAL_RESUME(id_realloc); - umm_free_core( oldptr); + umm_free_core( _context, oldptr); } else { DBGLOG_DEBUG( "realloc %d to a bigger block %d failed - return NULL and leave the old block!\n", blockSize, blocks ); /* This space intentionally left blnk */ - STATS__OOM_UPDATE(); + /* STATS__OOM_UPDATE() has already been called by umm_malloc_core - don't duplicate count */ } /* This is not accurate for OOM case; however, it will work for * stopping a call to free before return. @@ -859,16 +1133,16 @@ void *umm_realloc( void *ptr, size_t size ) { } else { DBGLOG_DEBUG( "realloc a completely new block %d\n", blocks ); void *oldptr = ptr; - if( (ptr = umm_malloc_core( size )) ) { + if( (ptr = umm_malloc_core( _context, size )) ) { DBGLOG_DEBUG( "realloc %d to a bigger block %d, copy, and free the old\n", blockSize, blocks ); UMM_CRITICAL_SUSPEND(id_realloc); memcpy( ptr, oldptr, curSize ); UMM_CRITICAL_RESUME(id_realloc); - umm_free_core( oldptr ); + umm_free_core( _context, oldptr ); } else { DBGLOG_DEBUG( "realloc %d to a bigger block %d failed - return NULL and leave the old block!\n", blockSize, blocks ); /* This space intentionally left blnk */ - STATS__OOM_UPDATE(); + /* STATS__OOM_UPDATE() has already been called by umm_malloc_core - don't duplicate count */ } /* This is not accurate for OOM case; however, it will work for * stopping a call to free before return. @@ -882,8 +1156,8 @@ void *umm_realloc( void *ptr, size_t size ) { if (blockSize > blocks ) { DBGLOG_DEBUG( "split and free %d blocks from %d\n", blocks, blockSize ); - umm_split_block( c, blocks, 0 ); - umm_free_core( (void *)&UMM_DATA(c+blocks) ); + umm_split_block( _context, c, blocks, 0 ); + umm_free_core( _context, (void *)&UMM_DATA(c+blocks) ); } STATS__FREE_BLOCKS_MIN(); diff --git a/cores/esp8266/umm_malloc/umm_malloc.h b/cores/esp8266/umm_malloc/umm_malloc.h index 82cfd9143..f7dcc72c1 100644 --- a/cores/esp8266/umm_malloc/umm_malloc.h +++ b/cores/esp8266/umm_malloc/umm_malloc.h @@ -17,6 +17,14 @@ extern "C" { #endif + +#ifdef UMM_HEAP_EXTERNAL +extern void umm_init_vm( void *vmaddr, unsigned int vmsize ); +#endif +#ifdef UMM_HEAP_IRAM +extern void umm_init_iram(void); +extern void umm_init_iram_ex( void *addr, unsigned int size, bool zero ); +#endif /* ------------------------------------------------------------------------ */ extern void umm_init( void ); @@ -27,6 +35,13 @@ extern void umm_free( void *ptr ); /* ------------------------------------------------------------------------ */ +extern umm_heap_context_t *umm_push_heap( size_t heap_number ); +extern umm_heap_context_t *umm_pop_heap( void ); +extern int umm_get_heap_stack_index( void ); +extern umm_heap_context_t *umm_set_heap_by_id( size_t which ); +extern size_t umm_get_current_heap_id( void ); +extern umm_heap_context_t *umm_get_current_heap( void ); + #ifdef __cplusplus } #endif diff --git a/cores/esp8266/umm_malloc/umm_malloc_cfg.h b/cores/esp8266/umm_malloc/umm_malloc_cfg.h index 2db244475..4fc059a49 100644 --- a/cores/esp8266/umm_malloc/umm_malloc_cfg.h +++ b/cores/esp8266/umm_malloc/umm_malloc_cfg.h @@ -19,6 +19,7 @@ #include #include +#include #include "../debug.h" #include "../esp8266_undocumented.h" @@ -32,6 +33,46 @@ extern "C" { #include "c_types.h" +/* + * Define active Heaps + */ +#if defined(MMU_IRAM_HEAP) +#define UMM_HEAP_IRAM +#else +#undef UMM_HEAP_IRAM +#endif + +// #define UMM_HEAP_EXTERNAL + +/* + * Assign IDs to active Heaps and tally. DRAM is always active. + */ +#define UMM_HEAP_DRAM 0 +#define UMM_HEAP_DRAM_DEFINED 1 + +#ifdef UMM_HEAP_IRAM +#undef UMM_HEAP_IRAM +#define UMM_HEAP_IRAM_DEFINED 1 +#define UMM_HEAP_IRAM UMM_HEAP_DRAM_DEFINED +#else +#define UMM_HEAP_IRAM_DEFINED 0 +#endif + +#ifdef UMM_HEAP_EXTERNAL +#undef UMM_HEAP_EXTERNAL +#define UMM_HEAP_EXTERNAL_DEFINED 1 +#define UMM_HEAP_EXTERNAL (UMM_HEAP_DRAM_DEFINED + UMM_HEAP_IRAM_DEFINED) +#else +#define UMM_HEAP_EXTERNAL_DEFINED 0 +#endif + +#define UMM_NUM_HEAPS (UMM_HEAP_DRAM_DEFINED + UMM_HEAP_IRAM_DEFINED + UMM_HEAP_EXTERNAL_DEFINED) + +#if (UMM_NUM_HEAPS == 1) +#else +#define UMM_HEAP_STACK_DEPTH 32 +#endif + /* * There are a number of defines you can set at compile time that affect how * the memory allocator will operate. @@ -134,8 +175,9 @@ extern char test_umm_heap[]; #else /* Start addresses and the size of the heap */ extern char _heap_start[]; +#define UMM_HEAP_END_ADDR 0x3FFFC000UL #define UMM_MALLOC_CFG_HEAP_ADDR ((uint32_t)&_heap_start[0]) -#define UMM_MALLOC_CFG_HEAP_SIZE ((size_t)(0x3fffc000 - UMM_MALLOC_CFG_HEAP_ADDR)) +#define UMM_MALLOC_CFG_HEAP_SIZE ((size_t)(UMM_HEAP_END_ADDR - UMM_MALLOC_CFG_HEAP_ADDR)) #endif /* A couple of macros to make packing structures less compiler dependent */ @@ -158,9 +200,9 @@ extern char _heap_start[]; /* -------------------------------------------------------------------------- */ #ifdef UMM_INLINE_METRICS - #define UMM_FRAGMENTATION_METRIC_INIT() umm_fragmentation_metric_init() - #define UMM_FRAGMENTATION_METRIC_ADD(c) umm_fragmentation_metric_add(c) - #define UMM_FRAGMENTATION_METRIC_REMOVE(c) umm_fragmentation_metric_remove(c) + #define UMM_FRAGMENTATION_METRIC_INIT() umm_fragmentation_metric_init(_context) + #define UMM_FRAGMENTATION_METRIC_ADD(c) umm_fragmentation_metric_add(_context, c) + #define UMM_FRAGMENTATION_METRIC_REMOVE(c) umm_fragmentation_metric_remove(_context, c) #ifndef UMM_INFO #define UMM_INFO #endif @@ -194,14 +236,16 @@ extern char _heap_start[]; unsigned int freeBlocksSquared; #ifdef UMM_INLINE_METRICS size_t oom_count; - #define UMM_OOM_COUNT ummHeapInfo.oom_count - #define UMM_FREE_BLOCKS ummHeapInfo.freeBlocks + #define UMM_OOM_COUNT info.oom_count + #define UMM_FREE_BLOCKS info.freeBlocks #endif unsigned int maxFreeContiguousBlocks; } UMM_HEAP_INFO; - extern UMM_HEAP_INFO ummHeapInfo; + // extern UMM_HEAP_INFO ummHeapInfo; +struct UMM_HEAP_CONTEXT; +typedef struct UMM_HEAP_CONTEXT umm_heap_context_t; extern ICACHE_FLASH_ATTR void *umm_info( void *ptr, bool force ); #ifdef UMM_INLINE_METRICS @@ -213,12 +257,19 @@ extern char _heap_start[]; extern ICACHE_FLASH_ATTR size_t umm_max_block_size( void ); extern ICACHE_FLASH_ATTR int umm_usage_metric( void ); extern ICACHE_FLASH_ATTR int umm_fragmentation_metric( void ); + extern ICACHE_FLASH_ATTR size_t umm_free_heap_size_core( umm_heap_context_t *_context ); + extern ICACHE_FLASH_ATTR size_t umm_max_block_size_core( umm_heap_context_t *_context ); + extern ICACHE_FLASH_ATTR int umm_usage_metric_core( umm_heap_context_t *_context ); + extern ICACHE_FLASH_ATTR int umm_fragmentation_metric_core( umm_heap_context_t *_context ); #else #define umm_info(p,b) #define umm_free_heap_size() (0) #define umm_max_block_size() (0) #define umm_fragmentation_metric() (0) #define umm_usage_metric() (0) + #define umm_free_heap_size_core() (0) + #define umm_max_block_size_core() (0) + #define umm_fragmentation_metric_core() (0) #endif /* @@ -263,8 +314,8 @@ typedef struct UMM_STATISTICS_t { // Otherwise it is defined here. size_t free_blocks; size_t oom_count; - #define UMM_OOM_COUNT ummStats.oom_count - #define UMM_FREE_BLOCKS ummStats.free_blocks + #define UMM_OOM_COUNT stats.oom_count + #define UMM_FREE_BLOCKS stats.free_blocks #endif #ifdef UMM_STATS_FULL size_t free_blocks_min; @@ -280,21 +331,17 @@ typedef struct UMM_STATISTICS_t { #endif } UMM_STATISTICS; -extern UMM_STATISTICS ummStats; #ifdef UMM_INLINE_METRICS #define STATS__FREE_BLOCKS_UPDATE(s) (void)(s) #else -#define STATS__FREE_BLOCKS_UPDATE(s) ummStats.free_blocks += (s) +#define STATS__FREE_BLOCKS_UPDATE(s) _context->stats.free_blocks += (s) #endif -#define STATS__OOM_UPDATE() UMM_OOM_COUNT += 1 +#define STATS__OOM_UPDATE() _context->UMM_OOM_COUNT += 1 extern size_t umm_free_heap_size_lw( void ); - -static inline size_t ICACHE_FLASH_ATTR umm_get_oom_count( void ) { - return UMM_OOM_COUNT; -} +extern size_t umm_get_oom_count( void ); #else // not UMM_STATS or UMM_STATS_FULL #define STATS__FREE_BLOCKS_UPDATE(s) (void)(s) @@ -308,87 +355,53 @@ size_t ICACHE_FLASH_ATTR umm_block_size( void ); #ifdef UMM_STATS_FULL #define STATS__FREE_BLOCKS_MIN() \ do { \ - if (UMM_FREE_BLOCKS < ummStats.free_blocks_min) \ - ummStats.free_blocks_min = UMM_FREE_BLOCKS; \ + if (_context->UMM_FREE_BLOCKS < _context->stats.free_blocks_min) \ + _context->stats.free_blocks_min = _context->UMM_FREE_BLOCKS; \ } while(false) #define STATS__FREE_BLOCKS_ISR_MIN() \ do { \ - if (UMM_FREE_BLOCKS < ummStats.free_blocks_isr_min) \ - ummStats.free_blocks_isr_min = UMM_FREE_BLOCKS; \ + if (_context->UMM_FREE_BLOCKS < _context->stats.free_blocks_isr_min) \ + _context->stats.free_blocks_isr_min = _context->UMM_FREE_BLOCKS; \ } while(false) #define STATS__ALLOC_REQUEST(tag, s) \ do { \ - ummStats.tag##_count += 1; \ - ummStats.last_alloc_size = s; \ - if (ummStats.alloc_max_size < s) \ - ummStats.alloc_max_size = s; \ + _context->stats.tag##_count += 1; \ + _context->stats.last_alloc_size = s; \ + if (_context->stats.alloc_max_size < s) \ + _context->stats.alloc_max_size = s; \ } while(false) #define STATS__ZERO_ALLOC_REQUEST(tag, s) \ do { \ - ummStats.tag##_zero_count += 1; \ + _context->stats.tag##_zero_count += 1; \ } while(false) #define STATS__NULL_FREE_REQUEST(tag) \ do { \ - ummStats.tag##_null_count += 1; \ + umm_heap_context_t *_context = umm_get_current_heap(); \ + _context->stats.tag##_null_count += 1; \ } while(false) #define STATS__FREE_REQUEST(tag) \ do { \ - ummStats.tag##_count += 1; \ + _context->stats.tag##_count += 1; \ } while(false) -static inline size_t ICACHE_FLASH_ATTR umm_free_heap_size_lw_min( void ) { - return (size_t)ummStats.free_blocks_min * umm_block_size(); -} -static inline size_t ICACHE_FLASH_ATTR umm_free_heap_size_min_reset( void ) { - ummStats.free_blocks_min = UMM_FREE_BLOCKS; - return (size_t)ummStats.free_blocks_min * umm_block_size(); -} - -static inline size_t ICACHE_FLASH_ATTR umm_free_heap_size_min( void ) { - return ummStats.free_blocks_min * umm_block_size(); -} - -static inline size_t ICACHE_FLASH_ATTR umm_free_heap_size_isr_min( void ) { - return ummStats.free_blocks_isr_min * umm_block_size(); -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_max_alloc_size( void ) { - return ummStats.alloc_max_size; -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_last_alloc_size( void ) { - return ummStats.last_alloc_size; -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_malloc_count( void ) { - return ummStats.id_malloc_count; -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_malloc_zero_count( void ) { - return ummStats.id_malloc_zero_count; -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_realloc_count( void ) { - return ummStats.id_realloc_count; -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_realloc_zero_count( void ) { - return ummStats.id_realloc_zero_count; -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_free_count( void ) { - return ummStats.id_free_count; -} - -static inline size_t ICACHE_FLASH_ATTR umm_get_free_null_count( void ) { - return ummStats.id_free_null_count; -} +size_t umm_free_heap_size_lw_min( void ); +size_t umm_free_heap_size_min_reset( void ); +size_t umm_free_heap_size_min( void ); +size_t umm_free_heap_size_isr_min( void ); +size_t umm_get_max_alloc_size( void ); +size_t umm_get_last_alloc_size( void ); +size_t umm_get_malloc_count( void ); +size_t umm_get_malloc_zero_count( void ); +size_t umm_get_realloc_count( void ); +size_t umm_get_realloc_zero_count( void ); +size_t umm_get_free_count( void ); +size_t umm_get_free_null_count( void ); #else // Not UMM_STATS_FULL #define STATS__FREE_BLOCKS_MIN() (void)0 @@ -492,6 +505,7 @@ static inline void _critical_exit(UMM_TIME_STAT *p, uint32_t *saved_ps) { #define UMM_CRITICAL_DECL(tag) uint32_t _saved_ps_##tag #define UMM_CRITICAL_ENTRY(tag)_critical_entry(&time_stats.tag, &_saved_ps_##tag) #define UMM_CRITICAL_EXIT(tag) _critical_exit(&time_stats.tag, &_saved_ps_##tag) + #define UMM_CRITICAL_WITHINISR(tag) (0 != (_saved_ps_##tag & 0x0F)) #else // ! UMM_CRITICAL_METRICS // This method preserves the intlevel on entry and restores the @@ -499,6 +513,7 @@ static inline void _critical_exit(UMM_TIME_STAT *p, uint32_t *saved_ps) { #define UMM_CRITICAL_DECL(tag) uint32_t _saved_ps_##tag #define UMM_CRITICAL_ENTRY(tag) _saved_ps_##tag = xt_rsil(DEFAULT_CRITICAL_SECTION_INTLEVEL) #define UMM_CRITICAL_EXIT(tag) xt_wsr_ps(_saved_ps_##tag) + #define UMM_CRITICAL_WITHINISR(tag) (0 != (_saved_ps_##tag & 0x0F)) #endif #endif @@ -666,7 +681,7 @@ static inline void _critical_exit(UMM_TIME_STAT *p, uint32_t *saved_ps) { # define POISON_CHECK() 1 # define POISON_CHECK_NEIGHBORS(c) \ do {\ - if(!check_poison_neighbors(c)) \ + if(!check_poison_neighbors(_context, c)) \ panic();\ } while(false) #else @@ -759,6 +774,9 @@ void free_loc (void* p, const char* file, int line); #else // !defined(ESP_DEBUG_OOM) #endif + + + #ifdef __cplusplus } #endif @@ -774,28 +792,29 @@ extern "C" { // Arduino.h recall us to redefine them #include // Reuse pvPort* calls, since they already support passing location information. -void* ICACHE_RAM_ATTR pvPortMalloc(size_t size, const char* file, int line); -void* ICACHE_RAM_ATTR pvPortCalloc(size_t count, size_t size, const char* file, int line); -void* ICACHE_RAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line); -void* ICACHE_RAM_ATTR pvPortZalloc(size_t size, const char* file, int line); -void ICACHE_RAM_ATTR vPortFree(void *ptr, const char* file, int line); +// Specificly the debug version (heap_...) that does not force DRAM heap. +void* ICACHE_RAM_ATTR heap_pvPortMalloc(size_t size, const char* file, int line); +void* ICACHE_RAM_ATTR heap_pvPortCalloc(size_t count, size_t size, const char* file, int line); +void* ICACHE_RAM_ATTR heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line); +void* ICACHE_RAM_ATTR heap_pvPortZalloc(size_t size, const char* file, int line); +void ICACHE_RAM_ATTR heap_vPortFree(void *ptr, const char* file, int line); -#define malloc(s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; pvPortMalloc(s, mem_debug_file, __LINE__); }) -#define calloc(n,s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; pvPortCalloc(n, s, mem_debug_file, __LINE__); }) -#define realloc(p,s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; pvPortRealloc(p, s, mem_debug_file, __LINE__); }) +#define malloc(s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; heap_pvPortMalloc(s, mem_debug_file, __LINE__); }) +#define calloc(n,s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; heap_pvPortCalloc(n, s, mem_debug_file, __LINE__); }) +#define realloc(p,s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; heap_pvPortRealloc(p, s, mem_debug_file, __LINE__); }) #if defined(UMM_POISON_CHECK) || defined(UMM_POISON_CHECK_LITE) -#define dbg_heap_free(p) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; vPortFree(p, mem_debug_file, __LINE__); }) +#define dbg_heap_free(p) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; heap_vPortFree(p, mem_debug_file, __LINE__); }) #else #define dbg_heap_free(p) free(p) #endif #elif defined(UMM_POISON_CHECK) || defined(UMM_POISON_CHECK_LITE) #include -void* ICACHE_RAM_ATTR pvPortRealloc(void *ptr, size_t size, const char* file, int line); -#define realloc(p,s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; pvPortRealloc(p, s, mem_debug_file, __LINE__); }) +void* ICACHE_RAM_ATTR heap_pvPortRealloc(void *ptr, size_t size, const char* file, int line); +#define realloc(p,s) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; heap_pvPortRealloc(p, s, mem_debug_file, __LINE__); }) -void ICACHE_RAM_ATTR vPortFree(void *ptr, const char* file, int line); +void ICACHE_RAM_ATTR heap_vPortFree(void *ptr, const char* file, int line); //C - to be discussed /* Problem, I would like to report the file and line number with the umm poison @@ -810,7 +829,7 @@ void ICACHE_RAM_ATTR vPortFree(void *ptr, const char* file, int line); Create dbg_heap_free() as an alternative for free() when you need a little more help in debugging the more challenging problems. */ -#define dbg_heap_free(p) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; vPortFree(p, mem_debug_file, __LINE__); }) +#define dbg_heap_free(p) ({ static const char mem_debug_file[] PROGMEM STORE_ATTR = __FILE__; heap_vPortFree(p, mem_debug_file, __LINE__); }) #else #define dbg_heap_free(p) free(p) diff --git a/cores/esp8266/umm_malloc/umm_poison.c b/cores/esp8266/umm_malloc/umm_poison.c index 5bfb5ce0a..01122c1a7 100644 --- a/cores/esp8266/umm_malloc/umm_poison.c +++ b/cores/esp8266/umm_malloc/umm_poison.c @@ -137,8 +137,13 @@ static void *get_unpoisoned( void *vptr ) { ptr -= (sizeof(UMM_POISONED_BLOCK_LEN_TYPE) + UMM_POISON_SIZE_BEFORE); + umm_heap_context_t *_context = umm_get_ptr_context( vptr ); + if (NULL == _context) { + panic(); + return NULL; + } /* Figure out which block we're in. Note the use of truncated division... */ - c = (ptr - (uintptr_t)(&(umm_heap[0])))/sizeof(umm_block); + c = (ptr - (uintptr_t)(&(_context->heap[0])))/sizeof(umm_block); check_poison_block(&UMM_BLOCK(c)); } @@ -214,11 +219,10 @@ bool umm_poison_check(void) { bool ok = true; uint16_t cur; - if (umm_heap == NULL) { - umm_init(); - } + UMM_INIT_HEAP; UMM_CRITICAL_ENTRY(id_poison); + umm_heap_context_t *_context = umm_get_current_heap(); /* Now iterate through the blocks list */ cur = UMM_NBLOCK(0) & UMM_BLOCKNO_MASK; diff --git a/libraries/ESP8266WiFi/src/include/wl_definitions.h b/cores/esp8266/wl_definitions.h similarity index 96% rename from libraries/ESP8266WiFi/src/include/wl_definitions.h rename to cores/esp8266/wl_definitions.h index e20ee928c..b58085ac5 100644 --- a/libraries/ESP8266WiFi/src/include/wl_definitions.h +++ b/cores/esp8266/wl_definitions.h @@ -69,7 +69,7 @@ enum wl_enc_type { /* Values map to 802.11 encryption suites... */ ENC_TYPE_AUTO = 8 }; -#if !defined(LWIP_INTERNAL) && !defined(__LWIP_TCP_H__) +#if !defined(LWIP_INTERNAL) && !defined(__LWIP_TCP_H__) && !defined(LWIP_HDR_TCPBASE_H) enum wl_tcp_state { CLOSED = 0, LISTEN = 1, diff --git a/cores/esp8266/xtruntime-frames.h b/cores/esp8266/xtruntime-frames.h new file mode 100644 index 000000000..8b5a7463a --- /dev/null +++ b/cores/esp8266/xtruntime-frames.h @@ -0,0 +1,162 @@ +/* xtruntime-frames.h - exception stack frames for single-threaded run-time */ +/* $Id: //depot/rel/Eaglenest/Xtensa/OS/include/xtensa/xtruntime-frames.h#1 $ */ + +/* + * Copyright (c) 2002-2012 Tensilica Inc. + * + * 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 the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef _XTRUNTIME_FRAMES_H_ +#define _XTRUNTIME_FRAMES_H_ + +#include + +/* Macros that help define structures for both C and assembler: */ +#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__) +#define STRUCT_BEGIN .pushsection .text; .struct 0 +#define STRUCT_FIELD(ctype,size,pre,name) pre##name: .space size +#define STRUCT_AFIELD(ctype,size,pre,name,n) pre##name: .if n ; .space (size)*(n) ; .endif +#define STRUCT_AFIELD_A(ctype,size,align,pre,name,n) .balign align ; pre##name: .if n ; .space (size)*(n) ; .endif +#define STRUCT_END(sname) sname##Size:; .popsection +#else /*_ASMLANGUAGE||__ASSEMBLER__*/ +#define STRUCT_BEGIN typedef struct { +#define STRUCT_FIELD(ctype,size,pre,name) ctype name; +#define STRUCT_AFIELD(ctype,size,pre,name,n) ctype name[n]; +#define STRUCT_AFIELD_A(ctype,size,align,pre,name,n) ctype name[n] __attribute__((aligned(align))); +#define STRUCT_END(sname) } sname; +#endif /*_ASMLANGUAGE||__ASSEMBLER__*/ + + +/* + * Kernel vector mode exception stack frame. + * + * NOTE: due to the limited range of addi used in the current + * kernel exception vector, and the fact that historically + * the vector is limited to 12 bytes, the size of this + * stack frame is limited to 128 bytes (currently at 64). + */ +STRUCT_BEGIN +STRUCT_FIELD (long,4,KEXC_,pc) /* "parm" */ +STRUCT_FIELD (long,4,KEXC_,ps) +STRUCT_AFIELD(long,4,KEXC_,areg, 4) /* a12 .. a15 */ +STRUCT_FIELD (long,4,KEXC_,sar) /* "save" */ +#if XCHAL_HAVE_LOOPS +STRUCT_FIELD (long,4,KEXC_,lcount) +STRUCT_FIELD (long,4,KEXC_,lbeg) +STRUCT_FIELD (long,4,KEXC_,lend) +#endif +#if XCHAL_HAVE_MAC16 +STRUCT_FIELD (long,4,KEXC_,acclo) +STRUCT_FIELD (long,4,KEXC_,acchi) +STRUCT_AFIELD(long,4,KEXC_,mr, 4) +#endif +STRUCT_END(KernelFrame) + + +/* + * User vector mode exception stack frame: + * + * WARNING: if you modify this structure, you MUST modify the + * computation of the pad size (ALIGNPAD) accordingly. + */ +STRUCT_BEGIN +STRUCT_FIELD (long,4,UEXC_,pc) +STRUCT_FIELD (long,4,UEXC_,ps) +STRUCT_FIELD (long,4,UEXC_,sar) +STRUCT_FIELD (long,4,UEXC_,vpri) +#ifdef __XTENSA_CALL0_ABI__ +STRUCT_FIELD (long,4,UEXC_,a0) +#endif +STRUCT_FIELD (long,4,UEXC_,a2) +STRUCT_FIELD (long,4,UEXC_,a3) +STRUCT_FIELD (long,4,UEXC_,a4) +STRUCT_FIELD (long,4,UEXC_,a5) +#ifdef __XTENSA_CALL0_ABI__ +STRUCT_FIELD (long,4,UEXC_,a6) +STRUCT_FIELD (long,4,UEXC_,a7) +STRUCT_FIELD (long,4,UEXC_,a8) +STRUCT_FIELD (long,4,UEXC_,a9) +STRUCT_FIELD (long,4,UEXC_,a10) +STRUCT_FIELD (long,4,UEXC_,a11) +STRUCT_FIELD (long,4,UEXC_,a12) +STRUCT_FIELD (long,4,UEXC_,a13) +STRUCT_FIELD (long,4,UEXC_,a14) +STRUCT_FIELD (long,4,UEXC_,a15) +#endif +STRUCT_FIELD (long,4,UEXC_,exccause) /* NOTE: can probably rid of this one (pass direct) */ +#if XCHAL_HAVE_LOOPS +STRUCT_FIELD (long,4,UEXC_,lcount) +STRUCT_FIELD (long,4,UEXC_,lbeg) +STRUCT_FIELD (long,4,UEXC_,lend) +#endif +#if XCHAL_HAVE_MAC16 +STRUCT_FIELD (long,4,UEXC_,acclo) +STRUCT_FIELD (long,4,UEXC_,acchi) +STRUCT_AFIELD(long,4,UEXC_,mr, 4) +#endif +/* ALIGNPAD is the 16-byte alignment padding. */ +#ifdef __XTENSA_CALL0_ABI__ +# define CALL0_ABI 1 +#else +# define CALL0_ABI 0 +#endif +#define ALIGNPAD ((3 + XCHAL_HAVE_LOOPS*1 + XCHAL_HAVE_MAC16*2 + CALL0_ABI*1) & 3) +#if ALIGNPAD +STRUCT_AFIELD(long,4,UEXC_,pad, ALIGNPAD) /* 16-byte alignment padding */ +#endif +/*STRUCT_AFIELD_A(char,1,XCHAL_CPEXTRA_SA_ALIGN,UEXC_,ureg, (XCHAL_CPEXTRA_SA_SIZE+3)&-4)*/ /* not used */ +STRUCT_END(UserFrame) + + +#if defined(_ASMLANGUAGE) || defined(__ASSEMBLER__) + + +/* Check for UserFrameSize small enough not to require rounding...: */ + /* Skip 16-byte save area, then 32-byte space for 8 regs of call12 + * (which overlaps with 16-byte GCC nested func chaining area), + * then exception stack frame: */ + .set UserFrameTotalSize, 16+32+UserFrameSize + /* Greater than 112 bytes? (max range of ADDI, both signs, when aligned to 16 bytes): */ + .ifgt UserFrameTotalSize-112 + /* Round up to 256-byte multiple to accelerate immediate adds: */ + .set UserFrameTotalSize, ((UserFrameTotalSize+255) & 0xFFFFFF00) + .endif +# define ESF_TOTALSIZE UserFrameTotalSize + +#endif /* _ASMLANGUAGE || __ASSEMBLER__ */ + + +#if XCHAL_NUM_CONTEXTS > 1 +/* Structure of info stored on new context's stack for setup: */ +STRUCT_BEGIN +STRUCT_FIELD (long,4,INFO_,sp) +STRUCT_FIELD (long,4,INFO_,arg1) +STRUCT_FIELD (long,4,INFO_,funcpc) +STRUCT_FIELD (long,4,INFO_,prevps) +STRUCT_END(SetupInfo) +#endif + + +#define KERNELSTACKSIZE 1024 + + +#endif /* _XTRUNTIME_FRAMES_H_ */ + diff --git a/doc/boards.rst b/doc/boards.rst index 73cc64f15..1b8ac2614 100644 --- a/doc/boards.rst +++ b/doc/boards.rst @@ -362,8 +362,8 @@ links: - ESP8285 datasheet: https://www.espressif.com/sites/default/files/0a-esp8285_datasheet_en_v1.0_20160422.pdf - Voltage regulator datasheet: http://pdf-datasheet.datasheet.netdna-cdn.com/pdf-down/M/E/6/ME6211-Microne.pdf -WeMos D1 R1 ------------ +LOLIN(WeMos) D1 R1 +------------------ Product page: https://www.wemos.cc/ diff --git a/doc/esp8266wifi/bearssl-server-secure-class.rst b/doc/esp8266wifi/bearssl-server-secure-class.rst index dffefc0de..f25ce384e 100644 --- a/doc/esp8266wifi/bearssl-server-secure-class.rst +++ b/doc/esp8266wifi/bearssl-server-secure-class.rst @@ -8,7 +8,7 @@ Implements a TLS encrypted server with optional client certificate validation. setBufferSizes(int recv, int xmit) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -Similar to the `BearSSL::WiFiClientSecure` method, sets the receive and transmit buffer sizes. Note that servers cannot request a buffer size from the client, so if these are shrunk and the client tries to send a chunk larger than the receive buffer, it will always fail. This must be called before the server is +Similar to the `BearSSL::WiFiClientSecure` method, sets the receive and transmit buffer sizes. Note that servers cannot request a buffer size from the client, so if these are shrunk and the client tries to send a chunk larger than the receive buffer, it will always fail. Needs to be called before `begin()` Setting Server Certificates ~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -33,6 +33,26 @@ setECCert(const BearSSL::X509List \*chain, unsigned cert_issuer_key_type, const Sets an elliptic curve certificate and key for the server. Needs to be called before `begin()`. +Client sessions (Resuming connections fast) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The TLS handshake process takes a long time because of all the back and forth between the client and the server. You can shorten it by caching the clients' sessions which will skip a few steps in the TLS handshake. In order for this to work, your client also needs to cache the session. `BearSSL::WiFiClientSecure `__ can do that as well as modern web browers. + +Here are the kind of performance improvements that you'll be able to see for TLS handshakes with an ESP8266 with it's clock set at 160MHz on a network with fairly low latency: + +* With an EC key of 256 bits, a request taking ~360ms without caching takes ~60ms with caching. +* With an RSA key of 2048 bits, a request taking ~1850ms without caching takes ~70ms with caching. + +setCache(BearSSL::ServerSessions \*cache) +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Sets the cache for the server's sessions. When choosing the size of the cache, remember that each client session takes 100 bytes. If you setup a cache for 10 sessions, it will take 1000 bytes. Needs to be called before `begin()` + +When creating the cache, you can use any of the 2 available constructors: + +* `BearSSL::ServerSessions(ServerSession *sessions, uint32_t size)`: Creates a cache with the given buffer and number of sessions. +* `BearSSL::ServerSessions(uint32_t size)`: Dynamically allocates a cache for the given number of sessions. + Requiring Client Certificates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/esp8266wifi/server-examples.rst b/doc/esp8266wifi/server-examples.rst index fd8ad7d9c..cdd18fe81 100644 --- a/doc/esp8266wifi/server-examples.rst +++ b/doc/esp8266wifi/server-examples.rst @@ -39,17 +39,19 @@ Then let's write a short function ``prepareHtmlPage()``, that will return a ``St String prepareHtmlPage() { - String htmlPage = - String("HTTP/1.1 200 OK\r\n") + - "Content-Type: text/html\r\n" + - "Connection: close\r\n" + // the connection will be closed after completion of the response - "Refresh: 5\r\n" + // refresh the page automatically every 5 sec - "\r\n" + - "" + - "" + - "Analog input: " + String(analogRead(A0)) + - "" + - "\r\n"; + String htmlPage; + htmlPage.reserve(1024); // prevent ram fragmentation + htmlPage = F("HTTP/1.1 200 OK\r\n" + "Content-Type: text/html\r\n" + "Connection: close\r\n" // the connection will be closed after completion of the response + "Refresh: 5\r\n" // refresh the page automatically every 5 sec + "\r\n" + "" + "" + "Analog input: "); + htmlPage += analogRead(A0); + htmlPage += F("" + "\r\n"); return htmlPage; } @@ -79,7 +81,7 @@ The content contains two basic `HTML `__ tags, .. code:: cpp - String(analogRead(A0)) + analogRead(A0) The Page is Served ~~~~~~~~~~~~~~~~~~ @@ -90,7 +92,7 @@ Serving of this web page will be done in the ``loop()`` where server is waiting void loop() { - WiFiClient client = server.available(); + WiFiClient client = server.available(); if (client) { // we have a new client sending some request @@ -126,6 +128,18 @@ The whole process is concluded by stopping the connection with client: client.stop(); +But before that, we must not interrupt client's request: + +.. code:: cpp + + while (client.available()) { + // but first, let client finish its request + // that's diplomatic compliance to protocols + // (and otherwise some clients may complain, like curl) + // (that is an example, prefer using a proper webserver library) + client.read(); + } + Put it Together ~~~~~~~~~~~~~~~ @@ -163,24 +177,26 @@ Complete sketch is presented below. // prepare a web page to be send to a client (web browser) String prepareHtmlPage() { - String htmlPage = - String("HTTP/1.1 200 OK\r\n") + - "Content-Type: text/html\r\n" + - "Connection: close\r\n" + // the connection will be closed after completion of the response - "Refresh: 5\r\n" + // refresh the page automatically every 5 sec - "\r\n" + - "" + - "" + - "Analog input: " + String(analogRead(A0)) + - "" + - "\r\n"; + String htmlPage; + htmlPage.reserve(1024); // prevent ram fragmentation + htmlPage = F("HTTP/1.1 200 OK\r\n" + "Content-Type: text/html\r\n" + "Connection: close\r\n" // the connection will be closed after completion of the response + "Refresh: 5\r\n" // refresh the page automatically every 5 sec + "\r\n" + "" + "" + "Analog input: "); + htmlPage += analogRead(A0); + htmlPage += F("" + "\r\n"); return htmlPage; } void loop() { - WiFiClient client = server.available(); + WiFiClient client = server.available(); // wait for a client (web browser) to connect if (client) { @@ -200,7 +216,14 @@ Complete sketch is presented below. } } } - delay(1); // give the web browser time to receive the data + + while (client.available()) { + // but first, let client finish its request + // that's diplomatic compliance to protocols + // (and otherwise some clients may complain, like curl) + // (that is an example, prefer using a proper webserver library) + client.read(); + } // close the connection: client.stop(); @@ -243,6 +266,6 @@ Conclusion The above example shows that a web server on ESP8266 can be set up in almost no time. Such server can easily stand up requests from much more powerful hardware and software like a PC with a web browser. Check out other classes like `ESP8266WebServer `__ that let you program more advanced applications. -If you like to try another server example, check out `WiFiWebServer.ino `__, that provides functionality of toggling the GPIO pin on and off out of a web browser. +If you like to try another server example, check out `WiFiManualWebServer.ino `__, that provides functionality of toggling the GPIO pin on and off out of a web browser. For the list of functions provided to implement and manage servers, please refer to the `Server Class `__ documentation. diff --git a/doc/faq/a02-my-esp-crashes.rst b/doc/faq/a02-my-esp-crashes.rst index aeedc8d5e..c2433b593 100644 --- a/doc/faq/a02-my-esp-crashes.rst +++ b/doc/faq/a02-my-esp-crashes.rst @@ -65,12 +65,12 @@ If you are using generic ESP modules, please follow `recommendations `__ on power supply and boot strapping resistors. -For boards with integrated USB to serial converter and power supply, +For boards with integrated USB-to-serial converter and power supply, usually it is enough to connect it to an USB hub that provides standard 0.5A and is not shared with other USB devices. -In any case make sure that your module is able to stable run standard -example sketches that establish Wi-Fi connection like e.g. +In any case, make sure that your module is able to stably run standard +example sketches that establish Wi-Fi connection like, e.g., `HelloServer.ino `__. What is the Cause of Restart? @@ -82,13 +82,13 @@ is wrong, it restarts itself to tell you about it. There are two typical scenarios that trigger ESP restarts: -- **Exception** - when code is performing `illegal +- **Exception** - when the code attempts an `illegal operation <../exception_causes.rst>`__, like trying to write to non-existent memory location. -- **Watchdog** - if code is `locked - up `__ staying too long - in a loop or processing some task, so vital processes like Wi-Fi - communication are not able to run. +- **Watchdog** - if the code `locks + up `__, staying too long + in a loop or processing any other task without any pauses, which would + prevent vital processes like Wi-Fi communication from running. Please check below how to recognize `exception <#exception>`__ and `watchdog <#watchdog>`__ scenarios and what to do about it. @@ -127,7 +127,7 @@ up. `SDK `__, that is part of `esp8266 / arduino `__ core loaded to module together with your application. -- **Hardware Watchdog** - build in ESP8266 hardware and acting if +- **Hardware Watchdog** - built-in ESP8266 hardware, acting if the software watchdog is disabled for too long, in case it fails, or if it is not provided at all. @@ -312,9 +312,10 @@ Memory, memory, memory Stack   The amount of stack in the ESP is tiny at only 4KB. For normal development in large systems, it is good practice to use and abuse the stack, because it is faster for allocation/deallocation, the scope of the object is well defined, and deallocation automatically happens in reverse order as allocation, which means no mem fragmentation. However, with the tiny amount of stack available in the ESP, that practice is not really viable, at least not for big objects. + * Large objects that have internally managed memory, such as String, std::string, std::vector, etc, are ok on the stack, because they internally allocate their buffers on the heap. - * Large arrays on the stack, such as uint8_t buffer[2048] should be avoided on the stack and be dynamically allocated (consider smart pointers). - * Objects that have large data members, such as large arrays, should be avoided on the stack, and be dynamically allocated (consider smart pointers). + * Large arrays on the stack, such as uint8_t buffer[2048] should be avoided on the stack and should be dynamically allocated instead (consider smart pointers). + * Objects that have large data members, such as large arrays, should also be avoided on the stack, and should be dynamically allocated (consider smart pointers). If at the Wall, Enter an Issue Report @@ -330,37 +331,38 @@ author of code in his / her repository. If there are no guidelines, include in your report the following: -- [ ] Exact steps by step instructions to reproduce the issue +- [ ] Exact step-by-step instructions to reproduce the issue - [ ] Your exact hardware configuration including the schematic -- [ ] If the issue concerns standard, commercially available ESP board +- [ ] If the issue concerns a standard, commercially available ESP board with power supply and USB interface, without extra h/w attached, then - provide just the board type or link to description + provide just the board type or a link to its description - [ ] Configuration settings in Arduino IDE used to upload the application - [ ] Error log & messages produced by the application (enable debugging for more details) - [ ] Decoded stack trace - [ ] Copy of your sketch -- [ ] Copy of all the libraries used by the sketch -- [ ] If you are using standard libraries available in Library Manager, - then provide just version numbers +- [ ] Copy of all the libraries used by the sketch (if you are using + standard libraries available in the Arduino Library Manager, + then provide just version numbers) - [ ] Version of `esp8266 / Arduino `__ core - [ ] Name and version of your programming IDE and O/S With plenty of ESP module types available, several versions of libraries or `esp8266 / Arduino `__ core, -types and versions of O/S, you need to provide exact information what -your application is about. Only then people willing to look into your -issue may be able to refer it to configuration they have. If you are -lucky, they may even attempt to reproduce your issue on their equipment. -This will be far more difficult if you are providing only vague details, +types and versions of O/S, you need to provide exact information on what +your application is about. Only then, people willing to look into your +issue may be able to compare it to a configuration they are familiar with. +If you are lucky, they may even attempt to reproduce your issue on their +own equipment! +This will be far more difficult if you provide only vague details, so somebody would need to ask you to find out what is really happening. -On the other hand if you flood your issue report with hundreds lines of -code, you may also have difficulty to find somebody willing to analyze -it. Therefore reduce your code to the bare minimum that is still causing -the issue. It will help you as well to isolate the issue and pin done +On the other hand, if you flood your issue report with hundreds lines of +code, you may also have difficulty finding somebody willing to analyze +it. Therefore, reduce your code to the bare minimum that is still causing +the issue. This will also help to isolate the issue and pin down the root cause. Conclusion @@ -371,8 +373,8 @@ Do not be afraid to troubleshoot ESP exception and watchdog restarts. detailed diagnostics that will help you pin down the issue. Before checking the s/w, get your h/w right. Use `ESP Exception Decoder `__ to find -out where the code fails. If you do you homework and still unable to -identify the root cause, enter the issue report. Provide enough details. +out where the code fails. If you do you homework and are still unable to +identify the root cause, submit an issue report. Provide enough details. Be specific and isolate the issue. Then ask community for support. There are plenty of people that like to work with ESP and willing to help with your problem. diff --git a/doc/index.rst b/doc/index.rst index 9fdba0f1d..dcc5f6962 100644 --- a/doc/index.rst +++ b/doc/index.rst @@ -13,10 +13,11 @@ Welcome to ESP8266 Arduino Core's documentation! OTA Updates PROGMEM Using GDB to debug + MMU Boards FAQ - + Exception causes Debugging Stack Dump diff --git a/doc/mmu.rst b/doc/mmu.rst new file mode 100644 index 000000000..41446cf76 --- /dev/null +++ b/doc/mmu.rst @@ -0,0 +1,237 @@ +MMU - Adjust the Ratio of ICACHE to IRAM +======================================== + +Overview +-------- + +The ESP8266 has a total of 64K of instruction memory, IRAM. This 64K of +IRAM is composed of one dedicated 32K block of IRAM and two 16K blocks +of IRAM. The last two 16K blocks of IRAM are flexible in the sense that +it can be used as a transparent cache for external flash memory. These +blocks can either be used for IRAM or an instruction cache for executing +code out of flash, ICACHE. + +The code generated for a sketch is divided up into two groups, ICACHE +and IRAM. IRAM offers faster execution. It is used for interrupt service +routines, exception handling, and time-critical code. The ICACHE allows +for the execution of up to 1MB of code stored in flash. On a cache miss, +a delay occurs as the instructions are read from flash via the SPI bus. + +There is 98KB of DRAM space. This memory can be accessed as byte, short, +or a 32-bit word. Access must be aligned according to the data type +size. A 16bit short must be on a multiple of 2-byte address boundary. +Likewise, a 32-bit word must be on a multiple of 4-byte address +boundary. In contrast, data access in IRAM or ICACHE must always be a +full 32-bit word and aligned. We will discuss a non32-bit exception +handler for this later. + +Option Summary +-------------- + +The Arduino IDE Tools menu option, ``MMU`` has the following selections: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +1. ``32KB cache + 32KB IRAM (balanced)`` + + - This is the legacy ratio. + - Try this option 1st. + +2. ``16KB cache + 48KB IRAM (IRAM)`` + + - With just 16KB cache, execution of code out of flash may be slowed + by more cache misses when compared to 32KB. The slowness will vary + with the sketch. + - Use this if you need a little more IRAM space, and you have enough + DRAM space. + +3. ``16KB cache + 48KB IRAM and 2nd Heap (shared)`` + + - This option builds on the previous option and creates a 2nd Heap + made with IRAM. + - The 2nd Heap size will vary with free IRAM. + - This option is flexible. IRAM usage for code can overflow into the + additional 16KB IRAM region, shrinking the 2nd Heap below 16KB. Or + IRAM can be under 32KB, allowing the 2nd Heap to be larger than + 16KB. + - Installs a Non-32-Bit Access handler for IRAM. This allows for + byte and 16-bit aligned short access. + - This 2nd Heap is supported by the standard ``malloc`` APIs. + - Heap selection is handled through a ``HeapSelect`` class. This + allows a specific heap selection for the duration of a scope. + - Use this option, if you are still running out of DRAM space after + you have moved as many of your constant strings/data elements that + you can to PROGMEM. + +4. ``16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared)`` + + - Not managed by the ``umm_malloc`` heap library + - If required, non-32-Bit Access for IRAM must be enabled + separately. + - Enables a 16KB block of unmanaged IRAM memory + - Data persist across reboots, but not deep sleep. + - Works well for when you need a simple large chunk of memory. This + option will reduce the resources required to support a shared 2nd + Heap. + +MMU related build defines and possible values. These values change as +indicated with the menu options above: + ++-------------------------+--------------+--------------+------------------------------------+------------------------------+ +| ``#define`` | balanced | IRAM | shared (IRAM and Heap) | not shared (IRAM and Heap) | ++=========================+==============+==============+====================================+==============================+ +| ``MMU_IRAM_SIZE`` | ``0x8000`` | ``0xC000`` | ``0xC000`` | ``0x8000`` | ++-------------------------+--------------+--------------+------------------------------------+------------------------------+ +| ``MMU_ICACHE_SIZE`` | ``0x8000`` | ``0x4000`` | ``0x4000`` | ``0x4000`` | ++-------------------------+--------------+--------------+------------------------------------+------------------------------+ +| ``MMU_IRAM_HEAP`` | -- | -- | defined, enables\ ``umm_malloc`` | -- | ++-------------------------+--------------+--------------+------------------------------------+------------------------------+ +| ``MMU_SEC_HEAP`` | -- | \*\* | \*\* | ``0x40108000`` | ++-------------------------+--------------+--------------+------------------------------------+------------------------------+ +| ``MMU_SEC_HEAP_SIZE`` | -- | \*\* | \*\* | ``0x4000`` | ++-------------------------+--------------+--------------+------------------------------------+------------------------------+ + +\*\* This define is to an inline function that calculates the value, +based on unused code space, requires ``#include ``. + +The Arduino IDE Tools menu option, ``Non-32-Bit Access`` has the following selections: +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``Use pgm_read macros for IRAM/PROGMEM`` +- ``Byte/Word access to IRAM/PROGMEM (very slow)`` + + - This option adds a non32-bit exception handler to your build. + - Handles read/writes to IRAM and reads to ICACHE. + - Supports short and byte access to IRAM + - Not recommended for high-frequency access data, use DRAM if you + can. + - Expect it to be slower than DRAM, each character access, will + require a complete save and restore of all 16+ registers. + - Processing an exception uses 256 bytes of stack space just to get + started. The actual handler will add a little more. + - This option is implicitly enabled and required when you select MMU + option ``16KB cache + 48KB IRAM and 2nd Heap (shared)``. + +IRAM, unlike DRAM, must be accessed as aligned full 32-bit words, no +byte or short access. The pgm\_read macros are an option; however, the +store operation remains an issue. For a block copy, ets\_memcpy appears +to work well as long as the byte count is rounded up to be evenly +divided by 4, and source and destination addresses are 4 bytes aligned. + +A word of caution, I have seen one case with the new toolchain 10.1 +where code that reads a 32-bit word to extract a byte was optimized away +to be a byte read. Using ``volatile`` on the pointer stopped the +over-optimization. + +To get a sense of how memory access time is effected, see examples +``MMU48K`` and ``irammem`` in ``ESP8266``. + +Miscellaneous +------------- + +For calls to ``umm_malloc`` with interrupts disabled. +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +- ``malloc`` will always allocate from the ``DRAM`` heap when called + with interrupts disabled. +- ``realloc`` with a NULL pointer will use ``malloc`` and return a + ``DRAM`` heap allocation. Note, calling ``realloc`` with interrupts + disabled is **not** officially supported. You are on your own if you + do this. +- If you must use IRAM memory in your ISR, allocate the memory in your + init code. To reduce the time spent in the ISR, avoid non32-bit + access that would trigger the exception handler. For short or byte + access, consider using the inline functions described in section + "Performance Functions" below. + +How to Select Heap +~~~~~~~~~~~~~~~~~~ + +The ``MMU`` selection ``16KB cache + 48KB IRAM and 2nd Heap (shared)`` +allows you to use the standard heap API function calls (``malloc``, +``calloc``, ``free``, ... ). to allocate memory from DRAM or IRAM. This +selection can be made by instantiating the class ``HeapSelectIram`` or +``HeapSelectDram``. The usage is similar to that of the +``InterruptLock`` class. The default/initial heap source is DRAM. The +class is in ``umm_malloc/umm_heap_select.h``. + +:: + + ... + char *bufferDram; + bufferDram = (char *)malloc(33); + char *bufferIram; + { + HeapSelectIram ephemeral; + bufferIram = (char *)malloc(33); + } + ... + free(bufferIram); + free(bufferDram); + ... + +``free`` will always return memory to the correct heap. There is no need +for tracking and selecting before freeing. + +``realloc`` with a non-NULL pointer will always resize the allocation +from the original heap it was allocated from. When the supplied pointer +is NULL, then the current heap selection is used. + +Low-level primitives for selecting a heap. These are used by the above +Classes: + +- ``umm_get_current_heap_id()`` +- ``umm_set_heap_by_id( ID value )`` +- Possible ID values +- ``UMM_HEAP_DRAM`` +- ``UMM_HEAP_IRAM`` + +Also, an alternate stack select method API is available. This is not as +easy as the class method; however, for some small set of cases, it may +provide some additional control: + +- ``ESP.setIramHeap()`` Pushes current heap ID onto a stack and sets + Heap API for an IRAM selection. +- ``ESP.setDramHeap()`` Pushes current heap ID onto a stack and sets + Heap API for a DRAM selection. +- ``ESP.resetHeap()`` Restores previously pushed heap. ### Identify + Memory + +These always inlined functions can be used to determine the resource of +a pointer: + +.. code:: cpp + + bool mmu_is_iram(const void *addr); + bool mmu_is_dram(const void *addr); + bool mmu_is_icache(const void *addr); + +Performance Functions +~~~~~~~~~~~~~~~~~~~~~ + +While these always inlined functions, will bypass the need for the +exception handler reducing execution time and stack use, it comes at the +cost of increased code size. + +These are an alternative to the ``pgm_read`` macros for reading from +IRAM. When compiled with 'Debug Level: core' range checks are performed +on the pointer value to make sure you are reading from the address range +of IRAM, DRAM, or ICACHE. + +.. code:: cpp + + uint8_t mmu_get_uint8(const void *p8); + uint16_t mmu_get_uint16(const uint16_t *p16); + int16_t mmu_get_int16(const int16_t *p16); + +While these functions are intended for writing to IRAM, they will work +with DRAM. When compiled with 'Debug Level: core', range checks are +performed on the pointer value to make sure you are writing to the +address range of IRAM or DRAM. + +.. code:: cpp + + uint8_t mmu_set_uint8(void *p8, const uint8_t val); + uint16_t mmu_set_uint16(uint16_t *p16, const uint16_t val); + int16_t mmu_set_int16(int16_t *p16, const int16_t val); + +:: diff --git a/doc/ota_updates/readme.rst b/doc/ota_updates/readme.rst index 12238c54c..5575d45f2 100755 --- a/doc/ota_updates/readme.rst +++ b/doc/ota_updates/readme.rst @@ -44,9 +44,9 @@ Make your own risk analysis and, depending on the application, decide what libra Advanced Security - Signed Updates ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -While the above password-based security will dissuade casual hacking attempts, it is not highly secure. For applications where a higher level of security is needed, cryptographically signed OTA updates can be required. This uses SHA256 hashing in place of MD5 (which is known to be cryptographically broken) and RSA-2048 bit level encryption to guarantee that only the holder of a cryptographic private key can generate code accepted by the OTA update mechanisms. +While the above password-based security will dissuade casual hacking attempts, it is not highly secure. For applications where a higher level of security is needed, cryptographically signed OTA updates can be required. This uses SHA256 hashing in place of MD5 (which is known to be cryptographically broken) and RSA-2048 bit level public-key encryption to guarantee that only the holder of a cryptographic private key can produce signed updates accepted by the OTA update mechanisms. -Signed updates are updates whose compiled binaries are signed with a private key (held by the developer) and verified with a public key (stored in the application and available for all to see). The signing process computes a hash of the binary code, encrypts the hash with the developer's private key, and appends this encrypted hash to the binary that is uploaded (via OTA, web, or HTTP server). If the code is modified or replaced in any way by anyone except the holder of the developer's private key, the hash will not match and the ESP8266 will reject the upload. +Signed updates are updates whose compiled binaries are signed with a private key (held by the developer) and verified with a public key (stored in the application and available for all to see). The signing process computes a hash of the binary code, encrypts the hash with the developer's private key, and appends this encrypted hash (also called a signature) to the binary that is uploaded (via OTA, web, or HTTP server). If the code is modified or replaced in any way by anyone except the holder of the developer's private key, the signature will not match and the ESP8266 will reject the upload. Cryptographic signing only protects against tampering with binaries delivered via OTA. If someone has physical access, they will always be able to flash the device over the serial port. Signing also does not encrypt anything but the hash (so that it can't be modified), so this does not protect code inside the device: if a user has physical access they can read out your program. @@ -57,11 +57,11 @@ Signed Binary Format The format of a signed binary is compatible with the standard binary format, and can be uploaded to a non-signed ESP8266 via serial or OTA without any conditions. Note, however, that once an unsigned OTA app is overwritten by this signed version, further updates will require signing. -As shown below, the signed hash is appended to the unsigned binary, followed by the total length of the signed hash (i.e., if the signed hash was 64 bytes, then this uint32 data segment will contain 64). This format allows for extensibility (such as adding a CA-based validation scheme allowing multiple signing keys all based on a trust anchor). Pull requests are always welcome. +As shown below, the signed hash is appended to the unsigned binary, followed by the total length of the signed hash (i.e., if the signed hash was 64 bytes, then this uint32 data segment will contain 64). This format allows for extensibility (such as adding a CA-based validation scheme allowing multiple signing keys all based on a trust anchor). Pull requests are always welcome. (currently it uses SHA256 with RSASSA-PKCS1-V1_5-SIGN signature scheme from RSA PKCS #1 v1.5) .. code:: bash - NORMAL-BINARY + NORMAL-BINARY Signed Binary Prerequisites ^^^^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/keywords.txt b/keywords.txt index 3272304b9..bad947b0d 100644 --- a/keywords.txt +++ b/keywords.txt @@ -13,6 +13,7 @@ analogWriteFreq KEYWORD2 analogWriteRange KEYWORD2 baudrate KEYWORD2 swap KEYWORD2 +enablePhaseLockedWaveform KEYWORD2 ###################################### # Constants (LITERAL1) diff --git a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp index 0c8aa8451..e03ab072e 100644 --- a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp +++ b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.cpp @@ -359,8 +359,12 @@ uint8_t ESP8266AVRISP::flash_read(uint8_t hilo, int addr) { 0); } -void ESP8266AVRISP::flash_read_page(int length) { +bool ESP8266AVRISP::flash_read_page(int length) { uint8_t *data = (uint8_t *) malloc(length + 1); + if (!data) + { + return false; + } for (int x = 0; x < length; x += 2) { *(data + x) = flash_read(LOW, here); *(data + x + 1) = flash_read(HIGH, here); @@ -369,12 +373,16 @@ void ESP8266AVRISP::flash_read_page(int length) { *(data + length) = Resp_STK_OK; _client.write((const uint8_t *)data, (size_t)(length + 1)); free(data); - return; + return true; } -void ESP8266AVRISP::eeprom_read_page(int length) { +bool ESP8266AVRISP::eeprom_read_page(int length) { // here again we have a word address uint8_t *data = (uint8_t *) malloc(length + 1); + if (!data) + { + return false; + } int start = here * 2; for (int x = 0; x < length; x++) { int addr = start + x; @@ -384,7 +392,7 @@ void ESP8266AVRISP::eeprom_read_page(int length) { *(data + length) = Resp_STK_OK; _client.write((const uint8_t *)data, (size_t)(length + 1)); free(data); - return; + return true; } void ESP8266AVRISP::read_page() { diff --git a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.h b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.h index 492831d3d..469f29b02 100644 --- a/libraries/ESP8266AVRISP/src/ESP8266AVRISP.h +++ b/libraries/ESP8266AVRISP/src/ESP8266AVRISP.h @@ -89,8 +89,8 @@ protected: void commit(int addr); void program_page(); uint8_t flash_read(uint8_t hilo, int addr); - void flash_read_page(int length); - void eeprom_read_page(int length); + bool flash_read_page(int length); + bool eeprom_read_page(int length); void read_page(); void read_signature(); diff --git a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp index 7ec3ab86f..e41621289 100644 --- a/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp +++ b/libraries/ESP8266HTTPClient/src/ESP8266HTTPClient.cpp @@ -725,7 +725,7 @@ int HTTPClient::writeToStream(Stream * stream) int ret = 0; if(_transferEncoding == HTTPC_TE_IDENTITY) { - if(len > 0) { + if(len > 0 || len == -1) { ret = writeToStreamDataBlock(stream, len); // have we an error? @@ -1125,18 +1125,18 @@ int HTTPClient::handleHeaderResponse() if(transferEncoding.equalsIgnoreCase(F("chunked"))) { _transferEncoding = HTTPC_TE_CHUNKED; } else { - return HTTPC_ERROR_ENCODING; + _returnCode = HTTPC_ERROR_ENCODING; + return _returnCode; } } else { _transferEncoding = HTTPC_TE_IDENTITY; } - if(_returnCode) { - return _returnCode; - } else { + if(_returnCode <= 0) { DEBUG_HTTPCLIENT("[HTTP-Client][handleHeaderResponse] Remote host is not an HTTP Server!"); - return HTTPC_ERROR_NO_HTTP_SERVER; + _returnCode = HTTPC_ERROR_NO_HTTP_SERVER; } + return _returnCode; } } else { @@ -1184,6 +1184,12 @@ int HTTPClient::writeToStreamDataBlock(Stream * stream, int size) if(readBytes > buff_size) { readBytes = buff_size; } + + // len == -1 or len > what is available, read only what is available + int av = _client->available(); + if (readBytes < 0 || readBytes > av) { + readBytes = av; + } // read data int bytesRead = _client->readBytes(buff, readBytes); diff --git a/libraries/ESP8266SdFat b/libraries/ESP8266SdFat index b240d2231..0a46e4ebb 160000 --- a/libraries/ESP8266SdFat +++ b/libraries/ESP8266SdFat @@ -1 +1 @@ -Subproject commit b240d2231a117bbd89b79902eb54cae948ee2f42 +Subproject commit 0a46e4ebb2de585c5a64f981dbc2b2223a438984 diff --git a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino index 4b786dc1a..8e9f4cd5b 100644 --- a/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino +++ b/libraries/ESP8266WebServer/examples/HelloServerBearSSL/HelloServerBearSSL.ino @@ -13,6 +13,8 @@ #include #include #include +#include +#include #ifndef STASSID #define STASSID "your-ssid" @@ -23,6 +25,7 @@ const char* ssid = STASSID; const char* password = STAPSK; BearSSL::ESP8266WebServerSecure server(443); +BearSSL::ServerSessions serverCache(5); static const char serverCert[] PROGMEM = R"EOF( -----BEGIN CERTIFICATE----- @@ -130,6 +133,9 @@ void setup(void){ server.getServer().setRSACert(new BearSSL::X509List(serverCert), new BearSSL::PrivateKey(serverKey)); + // Cache SSL sessions to accelerate the TLS handshake. + server.getServer().setCache(&serverCache); + server.on("/", handleRoot); server.on("/inline", [](){ @@ -142,7 +148,68 @@ void setup(void){ Serial.println("HTTPS server started"); } +extern "C" void stack_thunk_dump_stack(); + +void processKey(Print& out, int hotKey) { + switch (hotKey) { + case 'd': { + HeapSelectDram ephemeral; + umm_info(NULL, true); + break; + } + case 'i': { + HeapSelectIram ephemeral; + umm_info(NULL, true); + break; + } + case 'h': { + { + HeapSelectIram ephemeral; + Serial.printf(PSTR("IRAM ESP.getFreeHeap: %u\n"), ESP.getFreeHeap()); + } + { + HeapSelectDram ephemeral; + Serial.printf(PSTR("DRAM ESP.getFreeHeap: %u\n"), ESP.getFreeHeap()); + } + break; + } + case 'P': + out.println(F("Calling stack_thunk_dump_stack();")); + stack_thunk_dump_stack(); + break; + case 'R': + out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n")); + ESP.restart(); + break; + case '\r': + out.println(); + case '\n': + break; + case '?': + out.println(); + out.println(F("Press a key + ")); + out.println(F(" h - Free Heap Report;")); + out.println(F(" i - iRAM umm_info(null, true);")); + out.println(F(" d - dRAM umm_info(null, true);")); + out.println(F(" p - call stack_thunk_dump_stack();")); + out.println(F(" R - Restart, ESP.restart();")); + out.println(F(" ? - Print Help")); + out.println(); + break; + default: + out.printf_P(PSTR("\"%c\" - Not an option? / ? - help"), hotKey); + out.println(); + processKey(out, '?'); + break; + } +} + + void loop(void){ server.handleClient(); MDNS.update(); + if (Serial.available() > 0) { + int hotKey = Serial.read(); + processKey(Serial, hotKey); + } } diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h index eed9cb945..9ea77718f 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h @@ -26,6 +26,7 @@ #include "WiFiClient.h" #include "ESP8266WebServer.h" #include "FS.h" +#include "base64.h" #include "detail/RequestHandlersImpl.h" static const char AUTHORIZATION_HEADER[] PROGMEM = "Authorization"; @@ -33,6 +34,7 @@ static const char qop_auth[] PROGMEM = "qop=auth"; static const char qop_auth_quoted[] PROGMEM = "qop=\"auth\""; static const char WWW_Authenticate[] PROGMEM = "WWW-Authenticate"; static const char Content_Length[] PROGMEM = "Content-Length"; +static const char ETAG_HEADER[] PROGMEM = "If-None-Match"; namespace esp8266webserver { @@ -98,21 +100,19 @@ bool ESP8266WebServerTemplate::authenticate(const char * username, c authReq = ""; return false; } - char *encoded = new (std::nothrow) char[base64_encode_expected_len(toencodeLen)+1]; - if(encoded == NULL){ + sprintf(toencode, "%s:%s", username, password); + String encoded = base64::encode((uint8_t *)toencode, toencodeLen, false); + if(!encoded){ authReq = ""; delete[] toencode; return false; } - sprintf(toencode, "%s:%s", username, password); - if(base64_encode_chars(toencode, toencodeLen, encoded) > 0 && authReq.equalsConstantTime(encoded)) { + if(authReq.equalsConstantTime(encoded)) { authReq = ""; delete[] toencode; - delete[] encoded; return true; } delete[] toencode; - delete[] encoded; } else if(authReq.startsWith(F("Digest"))) { String _realm = _extractParam(authReq, F("realm=\"")); String _H1 = credentialHash((String)username,_realm,(String)password); @@ -255,7 +255,18 @@ void ESP8266WebServerTemplate::_addRequestHandler(RequestHandlerType template void ESP8266WebServerTemplate::serveStatic(const char* uri, FS& fs, const char* path, const char* cache_header) { - _addRequestHandler(new StaticRequestHandler(fs, path, uri, cache_header)); + bool is_file = false; + + if (fs.exists(path)) { + File file = fs.open(path, "r"); + is_file = file && file.isFile(); + file.close(); + } + + if(is_file) + _addRequestHandler(new StaticFileRequestHandler(fs, path, uri, cache_header)); + else + _addRequestHandler(new StaticDirectoryRequestHandler(fs, path, uri, cache_header)); } template @@ -607,15 +618,18 @@ const String& ESP8266WebServerTemplate::header(const String& name) c return emptyString; } -template + +template void ESP8266WebServerTemplate::collectHeaders(const char* headerKeys[], const size_t headerKeysCount) { - _headerKeysCount = headerKeysCount + 1; - if (_currentHeaders) - delete[]_currentHeaders; + _headerKeysCount = headerKeysCount + 2; + if (_currentHeaders){ + delete[] _currentHeaders; + } _currentHeaders = new RequestArgument[_headerKeysCount]; _currentHeaders[0].key = FPSTR(AUTHORIZATION_HEADER); - for (int i = 1; i < _headerKeysCount; i++){ - _currentHeaders[i].key = headerKeys[i-1]; + _currentHeaders[1].key = FPSTR(ETAG_HEADER); + for (int i = 2; i < _headerKeysCount; i++){ + _currentHeaders[i].key = headerKeys[i-2]; } } diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer.h b/libraries/ESP8266WebServer/src/ESP8266WebServer.h index 23b5b328a..a8453b42a 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer.h @@ -246,7 +246,7 @@ protected: bool _parseForm(ClientType& client, const String& boundary, uint32_t len); bool _parseFormUploadAborted(); void _uploadWriteByte(uint8_t b); - uint8_t _uploadReadByte(ClientType& client); + int _uploadReadByte(ClientType& client); void _prepareHeader(String& response, int code, const char* content_type, size_t contentLength); bool _collectHeader(const char* headerName, const char* headerValue); @@ -308,5 +308,4 @@ protected: using ESP8266WebServer = esp8266webserver::ESP8266WebServerTemplate; using RequestHandler = esp8266webserver::RequestHandler; - -#endif //ESP8266WEBSERVER_H +#endif //ESP8266WEBSERVER_H \ No newline at end of file diff --git a/libraries/ESP8266WebServer/src/Parsing-impl.h b/libraries/ESP8266WebServer/src/Parsing-impl.h index 4f7068c0c..e50ea727c 100644 --- a/libraries/ESP8266WebServer/src/Parsing-impl.h +++ b/libraries/ESP8266WebServer/src/Parsing-impl.h @@ -347,16 +347,17 @@ void ESP8266WebServerTemplate::_uploadWriteByte(uint8_t b){ } template -uint8_t ESP8266WebServerTemplate::_uploadReadByte(ClientType& client){ +int ESP8266WebServerTemplate::_uploadReadByte(ClientType& client){ int res = client.read(); if(res == -1){ while(!client.available() && client.connected()) yield(); res = client.read(); } - return (uint8_t)res; + return res; } + template bool ESP8266WebServerTemplate::_parseForm(ClientType& client, const String& boundary, uint32_t len){ (void) len; @@ -442,74 +443,59 @@ bool ESP8266WebServerTemplate::_parseForm(ClientType& client, const if(_currentHandler && _currentHandler->canUpload(_currentUri)) _currentHandler->upload(*this, _currentUri, *_currentUpload); _currentUpload->status = UPLOAD_FILE_WRITE; - uint8_t argByte = _uploadReadByte(client); -readfile: - while(argByte != 0x0D){ - if (!client.connected()) return _parseFormUploadAborted(); - _uploadWriteByte(argByte); - argByte = _uploadReadByte(client); - } - argByte = _uploadReadByte(client); + int fastBoundaryLen = 4 /* \r\n-- */ + boundary.length() + 1 /* \0 */; + char fastBoundary[ fastBoundaryLen ]; + snprintf(fastBoundary, fastBoundaryLen, "\r\n--%s", boundary.c_str()); + int boundaryPtr = 0; + while ( true ) { + int ret = _uploadReadByte(client); + if (ret < 0) { + // Unexpected, we should have had data available per above + return _parseFormUploadAborted(); + } + char in = (char) ret; + if (in == fastBoundary[ boundaryPtr ]) { + // The input matched the current expected character, advance and possibly exit this file + boundaryPtr++; + if (boundaryPtr == fastBoundaryLen - 1) { + // We read the whole boundary line, we're done here! + break; + } + } else { + // The char doesn't match what we want, so dump whatever matches we had, the read in char, and reset ptr to start + for (int i = 0; i < boundaryPtr; i++) { + _uploadWriteByte( fastBoundary[ i ] ); + } + if (in == fastBoundary[ 0 ]) { + // This could be the start of the real end, mark it so and don't emit/skip it + boundaryPtr = 1; + } else { + // Not the 1st char of our pattern, so emit and ignore + _uploadWriteByte( in ); + boundaryPtr = 0; + } + } + } + // Found the boundary string, finish processing this file upload + if (_currentHandler && _currentHandler->canUpload(_currentUri)) + _currentHandler->upload(*this, _currentUri, *_currentUpload); + _currentUpload->totalSize += _currentUpload->currentSize; + _currentUpload->status = UPLOAD_FILE_END; + if (_currentHandler && _currentHandler->canUpload(_currentUri)) + _currentHandler->upload(*this, _currentUri, *_currentUpload); + DBGWS("End File: %s Type: %s Size: %d\n", + _currentUpload->filename.c_str(), + _currentUpload->type.c_str(), + (int)_currentUpload->totalSize); if (!client.connected()) return _parseFormUploadAborted(); - if (argByte == 0x0A){ - argByte = _uploadReadByte(client); - if (!client.connected()) return _parseFormUploadAborted(); - if ((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - goto readfile; - } else { - argByte = _uploadReadByte(client); - if (!client.connected()) return _parseFormUploadAborted(); - if ((char)argByte != '-'){ - //continue reading the file - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - _uploadWriteByte((uint8_t)('-')); - goto readfile; - } - } - - uint8_t endBuf[boundary.length()]; - client.readBytes(endBuf, boundary.length()); - - if (strstr((const char*)endBuf, boundary.c_str()) != NULL){ - if(_currentHandler && _currentHandler->canUpload(_currentUri)) - _currentHandler->upload(*this, _currentUri, *_currentUpload); - _currentUpload->totalSize += _currentUpload->currentSize; - _currentUpload->status = UPLOAD_FILE_END; - if(_currentHandler && _currentHandler->canUpload(_currentUri)) - _currentHandler->upload(*this, _currentUri, *_currentUpload); - DBGWS("End File: %s Type: %s Size: %d\n", - _currentUpload->filename.c_str(), - _currentUpload->type.c_str(), - (int)_currentUpload->totalSize); - line = client.readStringUntil(0x0D); - client.readStringUntil(0x0A); - if (line == "--"){ - DBGWS("Done Parsing POST\n"); - break; - } - continue; - } else { - _uploadWriteByte(0x0D); - _uploadWriteByte(0x0A); - _uploadWriteByte((uint8_t)('-')); - _uploadWriteByte((uint8_t)('-')); - uint32_t i = 0; - while(i < boundary.length()){ - _uploadWriteByte(endBuf[i++]); - } - argByte = _uploadReadByte(client); - goto readfile; - } - } else { - _uploadWriteByte(0x0D); - goto readfile; + line = client.readStringUntil('\r'); + client.readStringUntil('\n'); + if (line == "--") { // extra two dashes mean we reached the end of all form fields + DBGWS("Done Parsing POST\n"); + break; } - break; + continue; } } } diff --git a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h index 56ef000e4..c88c83032 100644 --- a/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h +++ b/libraries/ESP8266WebServer/src/detail/RequestHandlersImpl.h @@ -72,83 +72,11 @@ public: , _path(path) , _cache_header(cache_header) { - if (fs.exists(path)) { - File file = fs.open(path, "r"); - _isFile = file && file.isFile(); - file.close(); - } - else { - _isFile = false; - } - - DEBUGV("StaticRequestHandler: path=%s uri=%s isFile=%d, cache_header=%s\r\n", path, uri, _isFile, cache_header == __null ? "" : cache_header); - _baseUriLength = _uri.length(); + DEBUGV("StaticRequestHandler: path=%s uri=%s, cache_header=%s\r\n", path, uri, cache_header == __null ? "" : cache_header); } - bool canHandle(HTTPMethod requestMethod, const String& requestUri) override { - if ((requestMethod != HTTP_GET) && (requestMethod != HTTP_HEAD)) - return false; - - if ((_isFile && requestUri != _uri) || !requestUri.startsWith(_uri)) - return false; - - return true; - } - - bool handle(WebServerType& server, HTTPMethod requestMethod, const String& requestUri) override { - - if (!canHandle(requestMethod, requestUri)) - return false; - - DEBUGV("StaticRequestHandler::handle: request=%s _uri=%s\r\n", requestUri.c_str(), _uri.c_str()); - - String path; - path.reserve(_path.length() + requestUri.length() + 32); - path = _path; - - if (!_isFile) { - - // Append whatever follows this URI in request to get the file path. - path += requestUri.substring(_baseUriLength); - - // Base URI doesn't point to a file. - // If a directory is requested, look for index file. - if (path.endsWith("/")) - path += F("index.htm"); - - // If neither nor .gz exist, and is a file.htm, try it with file.html instead - // For the normal case this will give a search order of index.htm, index.htm.gz, index.html, index.html.gz - if (!_fs.exists(path) && !_fs.exists(path + ".gz") && path.endsWith(".htm")) { - path += 'l'; - } - } - DEBUGV("StaticRequestHandler::handle: path=%s, isFile=%d\r\n", path.c_str(), _isFile); - - String contentType = mime::getContentType(path); - - using namespace mime; - // look for gz file, only if the original specified path is not a gz. So part only works to send gzip via content encoding when a non compressed is asked for - // if you point the the path to gzip you will serve the gzip as content type "application/x-gzip", not text or javascript etc... - if (!path.endsWith(FPSTR(mimeTable[gz].endsWith)) && !_fs.exists(path)) { - String pathWithGz = path + FPSTR(mimeTable[gz].endsWith); - if(_fs.exists(pathWithGz)) - path += FPSTR(mimeTable[gz].endsWith); - } - - File f = _fs.open(path, "r"); - if (!f) - return false; - - if (!f.isFile()) { - f.close(); - return false; - } - - if (_cache_header.length() != 0) - server.sendHeader("Cache-Control", _cache_header); - - server.streamFile(f, contentType, requestMethod); - return true; + bool validMethod(HTTPMethod requestMethod){ + return (requestMethod == HTTP_GET) || (requestMethod == HTTP_HEAD); } /* Deprecated version. Please use mime::getContentType instead */ @@ -161,10 +89,144 @@ protected: String _uri; String _path; String _cache_header; - bool _isFile; +}; + + +template +class StaticDirectoryRequestHandler : public StaticRequestHandler { + + using SRH = StaticRequestHandler; + using WebServerType = ESP8266WebServerTemplate; + +public: + StaticDirectoryRequestHandler(FS& fs, const char* path, const char* uri, const char* cache_header) + : + SRH(fs, path, uri, cache_header), + _baseUriLength{SRH::_uri.length()} + {} + + bool canHandle(HTTPMethod requestMethod, const String& requestUri) override { + return SRH::validMethod(requestMethod) && requestUri.startsWith(SRH::_uri); + } + + bool handle(WebServerType& server, HTTPMethod requestMethod, const String& requestUri) override { + + if (!canHandle(requestMethod, requestUri)) + return false; + + DEBUGV("DirectoryRequestHandler::handle: request=%s _uri=%s\r\n", requestUri.c_str(), SRH::_uri.c_str()); + + String path; + path.reserve(SRH::_path.length() + requestUri.length() + 32); + path = SRH::_path; + + // Append whatever follows this URI in request to get the file path. + path += requestUri.substring(_baseUriLength); + + // Base URI doesn't point to a file. + // If a directory is requested, look for index file. + if (path.endsWith("/")) + path += F("index.htm"); + + // If neither nor .gz exist, and is a file.htm, try it with file.html instead + // For the normal case this will give a search order of index.htm, index.htm.gz, index.html, index.html.gz + if (!SRH::_fs.exists(path) && !SRH::_fs.exists(path + ".gz") && path.endsWith(".htm")) { + path += 'l'; + } + + DEBUGV("DirectoryRequestHandler::handle: path=%s\r\n", path.c_str()); + + String contentType = mime::getContentType(path); + + using namespace mime; + // look for gz file, only if the original specified path is not a gz. So part only works to send gzip via content encoding when a non compressed is asked for + // if you point the the path to gzip you will serve the gzip as content type "application/x-gzip", not text or javascript etc... + if (!path.endsWith(FPSTR(mimeTable[gz].endsWith)) && !SRH::_fs.exists(path)) { + String pathWithGz = path + FPSTR(mimeTable[gz].endsWith); + if(SRH::_fs.exists(pathWithGz)) + path += FPSTR(mimeTable[gz].endsWith); + } + + File f = SRH::_fs.open(path, "r"); + if (!f) + return false; + + if (!f.isFile()) { + f.close(); + return false; + } + + if (SRH::_cache_header.length() != 0) + server.sendHeader("Cache-Control", SRH::_cache_header); + + server.streamFile(f, contentType, requestMethod); + return true; + } + +protected: size_t _baseUriLength; }; +template +class StaticFileRequestHandler + : +public StaticRequestHandler { + + using SRH = StaticRequestHandler; + using WebServerType = ESP8266WebServerTemplate; + +public: + StaticFileRequestHandler(FS& fs, const char* path, const char* uri, const char* cache_header) + : + StaticRequestHandler{fs, path, uri, cache_header} + { + File f = SRH::_fs.open(path, "r"); + MD5Builder calcMD5; + calcMD5.begin(); + calcMD5.addStream(f, f.size()); + calcMD5.calculate(); + calcMD5.getBytes(_ETag_md5); + f.close(); + } + + bool canHandle(HTTPMethod requestMethod, const String& requestUri) override { + return SRH::validMethod(requestMethod) && requestUri == SRH::_uri; + } + + bool handle(WebServerType& server, HTTPMethod requestMethod, const String & requestUri) override { + if (!canHandle(requestMethod, requestUri)) + return false; + + const String etag = "\"" + base64::encode(_ETag_md5, 16, false) + "\""; + + if(server.header("If-None-Match") == etag){ + server.send(304); + return true; + } + + File f = SRH::_fs.open(SRH::_path, "r"); + + if (!f) + return false; + + if (!f.isFile()) { + f.close(); + return false; + } + + if (SRH::_cache_header.length() != 0) + server.sendHeader("Cache-Control", SRH::_cache_header); + + server.sendHeader("ETag", etag); + + server.streamFile(f, mime::getContentType(SRH::_path), requestMethod); + return true; + } + +protected: + uint8_t _ETag_md5[16]; +}; + } // namespace -#endif //REQUESTHANDLERSIMPL_H +#endif //REQUESTHANDLERSIMPL_H \ No newline at end of file diff --git a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino index d27382284..972f0ebab 100644 --- a/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino +++ b/libraries/ESP8266WiFi/examples/BearSSL_Server/BearSSL_Server.ino @@ -138,6 +138,21 @@ GBEnkz4KpKv7TkHoW+j7F5EMcLcSrUIpyw== #endif +#define CACHE_SIZE 5 // Number of sessions to cache. +#define USE_CACHE // Enable SSL session caching. + // Caching SSL sessions shortens the length of the SSL handshake. + // You can see the performance improvement by looking at the + // Network tab of the developper tools of your browser. +//#define DYNAMIC_CACHE // Whether to dynamically allocate the cache. + +#if defined(USE_CACHE) && defined(DYNAMIC_CACHE) +// Dynamically allocated cache. +BearSSL::ServerSessions serverCache(CACHE_SIZE); +#elif defined(USE_CACHE) +// Statically allocated cache. +ServerSession store[CACHE_SIZE]; +BearSSL::ServerSessions serverCache(store, CACHE_SIZE); +#endif void setup() { Serial.begin(115200); @@ -169,6 +184,11 @@ void setup() { server.setECCert(serverCertList, BR_KEYTYPE_KEYX|BR_KEYTYPE_SIGN, serverPrivKey); #endif + // Set the server's cache +#if defined(USE_CACHE) + server.setCache(&serverCache); +#endif + // Actually start accepting connections server.begin(); } diff --git a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino index 9676857b1..a98e89487 100644 --- a/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino +++ b/libraries/ESP8266WiFi/examples/RangeExtender-NAPT/RangeExtender-NAPT.ino @@ -13,7 +13,7 @@ #include #include #include -#include +#include #define NAPT 1000 #define NAPT_PORT 10 @@ -57,8 +57,8 @@ void setup() { WiFi.dnsIP(1).toString().c_str()); // give DNS servers to AP side - dhcps_set_dns(0, WiFi.dnsIP(0)); - dhcps_set_dns(1, WiFi.dnsIP(1)); + dhcpSoftAP.dhcps_set_dns(0, WiFi.dnsIP(0)); + dhcpSoftAP.dhcps_set_dns(1, WiFi.dnsIP(1)); WiFi.softAPConfig( // enable AP, with android-compatible google domain IPAddress(172, 217, 28, 254), diff --git a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino index 4beaabe2b..e4520c472 100644 --- a/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino +++ b/libraries/ESP8266WiFi/examples/StaticLease/StaticLease.ino @@ -4,6 +4,7 @@ #include #include #include +#include /* Set these to your desired credentials. */ const char *ssid = "ESPap"; @@ -75,8 +76,8 @@ void setup() { ... any client not listed will use next IP address available from the range (here 192.168.0.102 and more) */ - wifi_softap_add_dhcps_lease(mac_CAM); // always 192.168.0.100 - wifi_softap_add_dhcps_lease(mac_PC); // always 192.168.0.101 + dhcpSoftAP.add_dhcps_lease(mac_CAM); // always 192.168.0.100 + dhcpSoftAP.add_dhcps_lease(mac_PC); // always 192.168.0.101 /* Start Access Point. You can remove the password parameter if you want the AP to be open. */ WiFi.softAP(ssid, password); Serial.print("AP IP address: "); diff --git a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino index 69614c0de..84a9befcf 100644 --- a/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino +++ b/libraries/ESP8266WiFi/examples/WiFiScan/WiFiScan.ino @@ -3,43 +3,57 @@ The API is almost the same as with the WiFi Shield library, the most obvious difference being the different file you need to include: */ -#include "ESP8266WiFi.h" + +#include void setup() { Serial.begin(115200); + Serial.println(F("\nESP8266 WiFi scan example")); - // Set WiFi to station mode and disconnect from an AP if it was previously connected + // Set WiFi to station mode WiFi.mode(WIFI_STA); + + // Disconnect from an AP if it was previously connected WiFi.disconnect(); delay(100); - - Serial.println("Setup done"); } void loop() { - Serial.println("scan start"); + String ssid; + int32_t rssi; + uint8_t encryptionType; + uint8_t* bssid; + int32_t channel; + bool hidden; + int scanResult; - // WiFi.scanNetworks will return the number of networks found - int n = WiFi.scanNetworks(); - Serial.println("scan done"); - if (n == 0) { - Serial.println("no networks found"); - } else { - Serial.print(n); - Serial.println(" networks found"); - for (int i = 0; i < n; ++i) { - // Print SSID and RSSI for each network found - Serial.print(i + 1); - Serial.print(": "); - Serial.print(WiFi.SSID(i)); - Serial.print(" ("); - Serial.print(WiFi.RSSI(i)); - Serial.print(")"); - Serial.println((WiFi.encryptionType(i) == ENC_TYPE_NONE) ? " " : "*"); - delay(10); + Serial.println(F("Starting WiFi scan...")); + + scanResult = WiFi.scanNetworks(/*async=*/false, /*hidden=*/true); + + if (scanResult == 0) { + Serial.println(F("No networks found")); + } else if (scanResult > 0) { + Serial.printf(PSTR("%d networks found:\n"), scanResult); + + // Print unsorted scan results + for (int8_t i = 0; i < scanResult; i++) { + WiFi.getNetworkInfo(i, ssid, encryptionType, rssi, bssid, channel, hidden); + + Serial.printf(PSTR(" %02d: [CH %02d] [%02X:%02X:%02X:%02X:%02X:%02X] %ddBm %c %c %s\n"), + i, + channel, + bssid[0], bssid[1], bssid[2], + bssid[3], bssid[4], bssid[5], + rssi, + (encryptionType == ENC_TYPE_NONE) ? ' ' : '*', + hidden ? 'H' : 'V', + ssid.c_str()); + delay(0); } + } else { + Serial.printf(PSTR("WiFi scan error %d"), scanResult); } - Serial.println(""); // Wait a bit before scanning again delay(5000); diff --git a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino index 9102af12d..46a4f277d 100644 --- a/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino +++ b/libraries/ESP8266WiFi/examples/WiFiTelnetToSerial/WiFiTelnetToSerial.ino @@ -173,10 +173,10 @@ void loop() { // determine maximum output size "fair TCP use" // client.availableForWrite() returns 0 when !client.connected() - size_t maxToTcp = 0; + int maxToTcp = 0; for (int i = 0; i < MAX_SRV_CLIENTS; i++) if (serverClients[i]) { - size_t afw = serverClients[i].availableForWrite(); + int afw = serverClients[i].availableForWrite(); if (afw) { if (!maxToTcp) { maxToTcp = afw; @@ -190,11 +190,11 @@ void loop() { } //check UART for data - size_t len = std::min((size_t)Serial.available(), maxToTcp); + size_t len = std::min(Serial.available(), maxToTcp); len = std::min(len, (size_t)STACK_PROTECTOR); if (len) { uint8_t sbuf[len]; - size_t serial_got = Serial.readBytes(sbuf, len); + int serial_got = Serial.readBytes(sbuf, len); // push UART data to all connected telnet clients for (int i = 0; i < MAX_SRV_CLIENTS; i++) // if client.availableForWrite() was 0 (congested) diff --git a/libraries/ESP8266WiFi/keywords.txt b/libraries/ESP8266WiFi/keywords.txt index ec3c0228b..d3c1bfa38 100644 --- a/libraries/ESP8266WiFi/keywords.txt +++ b/libraries/ESP8266WiFi/keywords.txt @@ -24,6 +24,8 @@ X509List KEYWORD1 PrivateKey KEYWORD1 PublicKey KEYWORD1 Session KEYWORD1 +ServerSession KEYWORD1 +ServerSessions KEYWORD1 ESP8266WiFiGratuitous KEYWORD1 @@ -191,10 +193,14 @@ getMFLNStatus KEYWORD2 setRSACert KEYWORD2 setECCert KEYWORD2 setClientTrustAnchor KEYWORD2 +setCache KEYWORD2 #CertStoreBearSSL initCertStore KEYWORD2 +#ServerSessions +size KEYWORD2 + ####################################### # Constants (LITERAL1) ####################################### diff --git a/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp b/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp index b3d1b60c2..331ee5fd7 100644 --- a/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp +++ b/libraries/ESP8266WiFi/src/BearSSLHelpers.cpp @@ -526,6 +526,10 @@ namespace brssl { case BR_KEYTYPE_EC: ek = br_skey_decoder_get_ec(dc.get()); sk = (private_key*)malloc(sizeof * sk); + if (!sk) + { + return nullptr; + } sk->key_type = BR_KEYTYPE_EC; sk->key.ec.curve = ek->curve; sk->key.ec.x = (uint8_t*)malloc(ek->xlen); @@ -626,6 +630,17 @@ namespace brssl { return pk; } + static uint8_t *loadStream(Stream& stream, size_t size) { + uint8_t *dest = (uint8_t *)malloc(size); + if (!dest) { + return nullptr; // OOM error + } + if (size != stream.readBytes(dest, size)) { + free(dest); // Error during read + return nullptr; + } + return dest; + } }; @@ -648,6 +663,15 @@ PublicKey::PublicKey(const uint8_t *derKey, size_t derLen) { parse(derKey, derLen); } +PublicKey::PublicKey(Stream &stream, size_t size) { + _key = nullptr; + auto buff = brssl::loadStream(stream, size); + if (buff) { + parse(buff, size); + free(buff); + } +} + PublicKey::~PublicKey() { if (_key) { brssl::free_public_key(_key); @@ -711,6 +735,15 @@ PrivateKey::PrivateKey(const uint8_t *derKey, size_t derLen) { parse(derKey, derLen); } +PrivateKey::PrivateKey(Stream &stream, size_t size) { + _key = nullptr; + auto buff = brssl::loadStream(stream, size); + if (buff) { + parse(buff, size); + free(buff); + } +} + PrivateKey::~PrivateKey() { if (_key) { brssl::free_private_key(_key); @@ -781,6 +814,17 @@ X509List::X509List(const uint8_t *derCert, size_t derLen) { append(derCert, derLen); } +X509List::X509List(Stream &stream, size_t size) { + _count = 0; + _cert = nullptr; + _ta = nullptr; + auto buff = brssl::loadStream(stream, size); + if (buff) { + append(buff, size); + free(buff); + } +} + X509List::~X509List() { brssl::free_certificates(_cert, _count); // also frees cert for (size_t i = 0; i < _count; i++) { @@ -832,6 +876,22 @@ bool X509List::append(const uint8_t *derCert, size_t derLen) { return true; } +ServerSessions::~ServerSessions() { + if (_isDynamic && _store != nullptr) + delete _store; +} + +ServerSessions::ServerSessions(ServerSession *sessions, uint32_t size, bool isDynamic) : + _size(sessions != nullptr ? size : 0), + _store(sessions), _isDynamic(isDynamic) { + if (_size > 0) + br_ssl_session_cache_lru_init(&_cache, (uint8_t*)_store, size * sizeof(ServerSession)); +} + +const br_ssl_session_cache_class **ServerSessions::getCache() { + return _size > 0 ? &_cache.vtable : nullptr; +} + // SHA256 hash for updater void HashSHA256::begin() { br_sha256_init( &_cc ); diff --git a/libraries/ESP8266WiFi/src/BearSSLHelpers.h b/libraries/ESP8266WiFi/src/BearSSLHelpers.h index 5c1b67546..d91c8211d 100644 --- a/libraries/ESP8266WiFi/src/BearSSLHelpers.h +++ b/libraries/ESP8266WiFi/src/BearSSLHelpers.h @@ -43,6 +43,8 @@ class PublicKey { PublicKey(); PublicKey(const char *pemKey); PublicKey(const uint8_t *derKey, size_t derLen); + PublicKey(Stream& stream, size_t size); + PublicKey(Stream& stream) : PublicKey(stream, stream.available()) { }; ~PublicKey(); bool parse(const char *pemKey); @@ -69,6 +71,8 @@ class PrivateKey { PrivateKey(); PrivateKey(const char *pemKey); PrivateKey(const uint8_t *derKey, size_t derLen); + PrivateKey(Stream& stream, size_t size); + PrivateKey(Stream& stream) : PrivateKey(stream, stream.available()) { }; ~PrivateKey(); bool parse(const char *pemKey); @@ -98,6 +102,8 @@ class X509List { X509List(); X509List(const char *pemCert); X509List(const uint8_t *derCert, size_t derLen); + X509List(Stream& stream, size_t size); + X509List(Stream& stream) : X509List(stream, stream.available()) { }; ~X509List(); bool append(const char *pemCert); @@ -127,17 +133,61 @@ class X509List { // significantly faster. Completely optional. class WiFiClientSecure; +// Cache for a TLS session with a server +// Use with BearSSL::WiFiClientSecure::setSession +// to accelerate the TLS handshake class Session { - friend class WiFiClientSecure; + friend class WiFiClientSecureCtx; public: Session() { memset(&_session, 0, sizeof(_session)); } private: br_ssl_session_parameters *getSession() { return &_session; } - // The actual BearSSL ession information + // The actual BearSSL session information br_ssl_session_parameters _session; }; +// Represents a single server session. +// Use with BearSSL::ServerSessions. +typedef uint8_t ServerSession[100]; + +// Cache for the TLS sessions of multiple clients. +// Use with BearSSL::WiFiServerSecure::setCache +class ServerSessions { + friend class WiFiClientSecureCtx; + + public: + // Uses the given buffer to cache the given number of sessions and initializes it. + ServerSessions(ServerSession *sessions, uint32_t size) : ServerSessions(sessions, size, false) {} + + // Dynamically allocates a cache for the given number of sessions and initializes it. + // If the allocation of the buffer wasn't successfull, the value + // returned by size() will be 0. + ServerSessions(uint32_t size) : ServerSessions(size > 0 ? new ServerSession[size] : nullptr, size, true) {} + + ~ServerSessions(); + + // Returns the number of sessions the cache can hold. + uint32_t size() { return _size; } + + private: + ServerSessions(ServerSession *sessions, uint32_t size, bool isDynamic); + + // Returns the cache's vtable or null if the cache has no capacity. + const br_ssl_session_cache_class **getCache(); + + // Size of the store in sessions. + uint32_t _size; + // Store where the informations for the sessions are stored. + ServerSession *_store; + // Whether the store is dynamically allocated. + // If this is true, the store needs to be freed in the destructor. + bool _isDynamic; + + // Cache of the server using the _store. + br_ssl_session_cache_lru _cache; +}; + // Updater SHA256 hash and signature verification class HashSHA256 : public UpdaterHashClass { public: @@ -164,7 +214,7 @@ class SigningVerifier : public UpdaterVerifyClass { private: PublicKey *_pubKey; }; - + // Stack thunked versions of calls extern "C" { extern unsigned char *thunk_br_ssl_engine_recvapp_buf( const br_ssl_engine_context *cc, size_t *len); diff --git a/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp b/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp index faa34e7a3..8af9cb8bd 100644 --- a/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/CertStoreBearSSL.cpp @@ -80,7 +80,7 @@ CertStore::CertInfo CertStore::_preprocessCert(uint32_t length, uint32_t offset, // The certs.ar file is a UNIX ar format file, concatenating all the // individual certificates into a single blob in a space-efficient way. -int CertStore::initCertStore(FS &fs, const char *indexFileName, const char *dataFileName) { +int CertStore::initCertStore(fs::FS &fs, const char *indexFileName, const char *dataFileName) { int count = 0; uint32_t offset = 0; @@ -101,12 +101,12 @@ int CertStore::initCertStore(FS &fs, const char *indexFileName, const char *data memcpy_P(_indexName, indexFileName, strlen_P(indexFileName) + 1); memcpy_P(_dataName, dataFileName, strlen_P(dataFileName) + 1); - File index = _fs->open(_indexName, "w"); + fs::File index = _fs->open(_indexName, "w"); if (!index) { return 0; } - File data = _fs->open(_dataName, "r"); + fs::File data = _fs->open(_dataName, "r"); if (!data) { index.close(); return 0; @@ -179,7 +179,7 @@ const br_x509_trust_anchor *CertStore::findHashedTA(void *ctx, void *hashed_dn, return nullptr; } - File index = cs->_fs->open(cs->_indexName, "r"); + fs::File index = cs->_fs->open(cs->_indexName, "r"); if (!index) { return nullptr; } @@ -191,12 +191,12 @@ const br_x509_trust_anchor *CertStore::findHashedTA(void *ctx, void *hashed_dn, if (!der) { return nullptr; } - File data = cs->_fs->open(cs->_dataName, "r"); + fs::File data = cs->_fs->open(cs->_dataName, "r"); if (!data) { free(der); return nullptr; } - if (!data.seek(ci.offset, SeekSet)) { + if (!data.seek(ci.offset, fs::SeekSet)) { data.close(); free(der); return nullptr; diff --git a/libraries/ESP8266WiFi/src/CertStoreBearSSL.h b/libraries/ESP8266WiFi/src/CertStoreBearSSL.h index dcfcb3465..51dcb0755 100644 --- a/libraries/ESP8266WiFi/src/CertStoreBearSSL.h +++ b/libraries/ESP8266WiFi/src/CertStoreBearSSL.h @@ -31,7 +31,15 @@ namespace BearSSL { -class CertStore { +class CertStoreBase { + public: + virtual ~CertStoreBase() {} + + // Installs the cert store into the X509 decoder (normally via static function callbacks) + virtual void installCertStore(br_x509_minimal_context *ctx) = 0; +}; + +class CertStore: public CertStoreBase { public: CertStore() { }; ~CertStore(); diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFi.h b/libraries/ESP8266WiFi/src/ESP8266WiFi.h index d26e1db6b..819739eae 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFi.h +++ b/libraries/ESP8266WiFi/src/ESP8266WiFi.h @@ -25,7 +25,7 @@ #include extern "C" { -#include "include/wl_definitions.h" +#include } #include "IPAddress.h" diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp index 418a48b5c..202042c78 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiAP.cpp @@ -33,11 +33,11 @@ extern "C" { #include "osapi.h" #include "mem.h" #include "user_interface.h" +#include // LWIP_VERSION_* } #include "debug.h" - - +#include "LwipDhcpServer.h" // ----------------------------------------------------------------------------------------------------------------------- // ---------------------------------------------------- Private functions ------------------------------------------------ @@ -156,13 +156,7 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch DEBUG_WIFI("[AP] softap config unchanged\n"); } - if(wifi_softap_dhcps_status() != DHCP_STARTED) { - DEBUG_WIFI("[AP] DHCP not started, starting...\n"); - if(!wifi_softap_dhcps_start()) { - DEBUG_WIFI("[AP] wifi_softap_dhcps_start failed!\n"); - ret = false; - } - } + dhcpSoftAP.end(); // check IP config struct ip_info ip; @@ -182,6 +176,8 @@ bool ESP8266WiFiAPClass::softAP(const char* ssid, const char* passphrase, int ch ret = false; } + dhcpSoftAP.begin(&ip); + return ret; } @@ -237,19 +233,22 @@ bool ESP8266WiFiAPClass::softAPConfig(IPAddress local_ip, IPAddress gateway, IPA dhcp_lease.end_ip.addr = ip.v4(); DEBUG_WIFI("[APConfig] DHCP IP end: %s\n", ip.toString().c_str()); - if(!wifi_softap_set_dhcps_lease(&dhcp_lease)) { + if(!dhcpSoftAP.set_dhcps_lease(&dhcp_lease)) + { DEBUG_WIFI("[APConfig] wifi_set_ip_info failed!\n"); ret = false; } // set lease time to 720min --> 12h - if(!wifi_softap_set_dhcps_lease_time(720)) { + if(!dhcpSoftAP.set_dhcps_lease_time(720)) + { DEBUG_WIFI("[APConfig] wifi_softap_set_dhcps_lease_time failed!\n"); ret = false; } uint8 mode = info.gw.addr ? 1 : 0; - if(!wifi_softap_set_dhcps_offer_option(OFFER_ROUTER, &mode)) { + if(!dhcpSoftAP.set_dhcps_offer_option(OFFER_ROUTER, &mode)) + { DEBUG_WIFI("[APConfig] wifi_softap_set_dhcps_offer_option failed!\n"); ret = false; } diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h index 815c26b6d..6a9100194 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiGeneric.h @@ -1,6 +1,6 @@ /* ESP8266WiFiGeneric.h - esp8266 Wifi support. - Based on WiFi.h from Ardiono WiFi shield library. + Based on WiFi.h from Arduino WiFi shield library. Copyright (c) 2011-2014 Arduino. All right reserved. Modified by Ivan Grokhotkov, December 2014 Reworked by Markus Sattler, December 2015 diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp index 0959bba7c..a75c115c2 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.cpp @@ -26,6 +26,7 @@ #include "ESP8266WiFiGeneric.h" #include "ESP8266WiFiSTA.h" #include "PolledTimeout.h" +#include "LwipIntf.h" #include "c_types.h" #include "ets_sys.h" @@ -281,28 +282,9 @@ bool ESP8266WiFiSTAClass::config(IPAddress local_ip, IPAddress arg1, IPAddress a return true; } - //To allow compatibility, check first octet of 3rd arg. If 255, interpret as ESP order, otherwise Arduino order. - IPAddress gateway = arg1; - IPAddress subnet = arg2; - IPAddress dns1 = arg3; - - if(subnet[0] != 255) - { - //octet is not 255 => interpret as Arduino order - gateway = arg2; - subnet = arg3[0] == 0 ? IPAddress(255,255,255,0) : arg3; //arg order is arduino and 4th arg not given => assign it arduino default - dns1 = arg1; - } - - // check whether all is IPv4 (or gateway not set) - if (!(local_ip.isV4() && subnet.isV4() && (!gateway.isSet() || gateway.isV4()))) { + IPAddress gateway, subnet, dns1; + if (!ipAddressReorder(local_ip, arg1, arg2, arg3, gateway, subnet, dns1)) return false; - } - - //ip and gateway must be in the same subnet - if((local_ip.v4() & subnet.v4()) != (gateway.v4() & subnet.v4())) { - return false; - } #if !CORE_MOCK // get current->previous IP address @@ -522,94 +504,6 @@ IPAddress ESP8266WiFiSTAClass::dnsIP(uint8_t dns_no) { return IPAddress(dns_getserver(dns_no)); } - -/** - * Get ESP8266 station DHCP hostname - * @return hostname - */ -String ESP8266WiFiSTAClass::hostname(void) { - return wifi_station_get_hostname(); -} - -/** - * Set ESP8266 station DHCP hostname - * @param aHostname max length:24 - * @return ok - */ -bool ESP8266WiFiSTAClass::hostname(const char* aHostname) { - /* - vvvv RFC952 vvvv - ASSUMPTIONS - 1. A "name" (Net, Host, Gateway, or Domain name) is a text string up - to 24 characters drawn from the alphabet (A-Z), digits (0-9), minus - sign (-), and period (.). Note that periods are only allowed when - they serve to delimit components of "domain style names". (See - RFC-921, "Domain Name System Implementation Schedule", for - background). No blank or space characters are permitted as part of a - name. No distinction is made between upper and lower case. The first - character must be an alpha character. The last character must not be - a minus sign or period. A host which serves as a GATEWAY should have - "-GATEWAY" or "-GW" as part of its name. Hosts which do not serve as - Internet gateways should not use "-GATEWAY" and "-GW" as part of - their names. A host which is a TAC should have "-TAC" as the last - part of its host name, if it is a DoD host. Single character names - or nicknames are not allowed. - ^^^^ RFC952 ^^^^ - - - 24 chars max - - only a..z A..Z 0..9 '-' - - no '-' as last char - */ - - size_t len = strlen(aHostname); - - if (len == 0 || len > 32) { - // nonos-sdk limit is 32 - // (dhcp hostname option minimum size is ~60) - DEBUG_WIFI_GENERIC("WiFi.(set)hostname(): empty or large(>32) name\n"); - return false; - } - - // check RFC compliance - bool compliant = (len <= 24); - for (size_t i = 0; compliant && i < len; i++) - if (!isalnum(aHostname[i]) && aHostname[i] != '-') - compliant = false; - if (aHostname[len - 1] == '-') - compliant = false; - - if (!compliant) { - DEBUG_WIFI_GENERIC("hostname '%s' is not compliant with RFC952\n", aHostname); - } - - bool ret = wifi_station_set_hostname(aHostname); - if (!ret) { - DEBUG_WIFI_GENERIC("WiFi.hostname(%s): wifi_station_set_hostname() failed\n", aHostname); - return false; - } - - // now we should inform dhcp server for this change, using lwip_renew() - // looping through all existing interface - // harmless for AP, also compatible with ethernet adapters (to come) - for (netif* intf = netif_list; intf; intf = intf->next) { - - // unconditionally update all known interfaces - intf->hostname = wifi_station_get_hostname(); - - if (netif_dhcp_data(intf) != nullptr) { - // renew already started DHCP leases - err_t lwipret = dhcp_renew(intf); - if (lwipret != ERR_OK) { - DEBUG_WIFI_GENERIC("WiFi.hostname(%s): lwIP error %d on interface %c%c (index %d)\n", - intf->hostname, (int)lwipret, intf->name[0], intf->name[1], intf->num); - ret = false; - } - } - } - - return ret && compliant; -} - /** * Return Connection status. * @return one of the value defined in wl_status_t diff --git a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h index d845b290c..6dbb6406c 100644 --- a/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h +++ b/libraries/ESP8266WiFi/src/ESP8266WiFiSTA.h @@ -27,9 +27,10 @@ #include "ESP8266WiFiType.h" #include "ESP8266WiFiGeneric.h" #include "user_interface.h" +#include "LwipIntf.h" -class ESP8266WiFiSTAClass { +class ESP8266WiFiSTAClass: public LwipIntf { // ---------------------------------------------------------------------------------------------- // ---------------------------------------- STA function ---------------------------------------- // ---------------------------------------------------------------------------------------------- @@ -69,10 +70,6 @@ class ESP8266WiFiSTAClass { IPAddress gatewayIP(); IPAddress dnsIP(uint8_t dns_no = 0); - String hostname(); - bool hostname(const String& aHostname) { return hostname(aHostname.c_str()); } - bool hostname(const char* aHostname); - // STA WiFi info wl_status_t status(); String SSID() const; diff --git a/libraries/ESP8266WiFi/src/WiFiClient.cpp b/libraries/ESP8266WiFi/src/WiFiClient.cpp index 1663a29ec..5aa09b887 100644 --- a/libraries/ESP8266WiFi/src/WiFiClient.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClient.cpp @@ -24,7 +24,7 @@ extern "C" { - #include "include/wl_definitions.h" + #include "wl_definitions.h" #include "osapi.h" #include "ets_sys.h" } @@ -195,7 +195,7 @@ bool WiFiClient::getSync() const return _client->getSync(); } -size_t WiFiClient::availableForWrite () +int WiFiClient::availableForWrite () { return _client? _client->availableForWrite(): 0; } diff --git a/libraries/ESP8266WiFi/src/WiFiClient.h b/libraries/ESP8266WiFi/src/WiFiClient.h index 31f6d105a..41c099bfc 100644 --- a/libraries/ESP8266WiFi/src/WiFiClient.h +++ b/libraries/ESP8266WiFi/src/WiFiClient.h @@ -52,7 +52,7 @@ public: WiFiClient(const WiFiClient&); WiFiClient& operator=(const WiFiClient&); - uint8_t status(); + virtual uint8_t status(); virtual int connect(IPAddress ip, uint16_t port) override; virtual int connect(const char *host, uint16_t port) override; virtual int connect(const String& host, uint16_t port); @@ -86,7 +86,7 @@ public: static void setLocalPortStart(uint16_t port) { _localPort = port; } - size_t availableForWrite(); + int availableForWrite() override; friend class WiFiServer; diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp index a38909cc0..48dc531a5 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.cpp @@ -25,6 +25,7 @@ #include #include #include +#include extern "C" { #include "osapi.h" @@ -44,6 +45,9 @@ extern "C" { #include #include "c_types.h" #include "coredecls.h" +#include +#include +#include #if !CORE_MOCK @@ -67,7 +71,7 @@ extern "C" { namespace BearSSL { -void WiFiClientSecure::_clear() { +void WiFiClientSecureCtx::_clear() { // TLS handshake may take more than the 5 second default timeout _timeout = 15000; @@ -91,7 +95,7 @@ void WiFiClientSecure::_clear() { _cipher_cnt = 0; } -void WiFiClientSecure::_clearAuthenticationSettings() { +void WiFiClientSecureCtx::_clearAuthenticationSettings() { _use_insecure = false; _use_fingerprint = false; _use_self_signed = false; @@ -100,7 +104,7 @@ void WiFiClientSecure::_clearAuthenticationSettings() { } -WiFiClientSecure::WiFiClientSecure() : WiFiClient() { +WiFiClientSecureCtx::WiFiClientSecureCtx() : WiFiClient() { _clear(); _clearAuthenticationSettings(); _certStore = nullptr; // Don't want to remove cert store on a clear, should be long lived @@ -108,12 +112,7 @@ WiFiClientSecure::WiFiClientSecure() : WiFiClient() { stack_thunk_add_ref(); } -WiFiClientSecure::WiFiClientSecure(const WiFiClientSecure &rhs) : WiFiClient(rhs) { - *this = rhs; - stack_thunk_add_ref(); -} - -WiFiClientSecure::~WiFiClientSecure() { +WiFiClientSecureCtx::~WiFiClientSecureCtx() { if (_client) { _client->unref(); _client = nullptr; @@ -123,9 +122,10 @@ WiFiClientSecure::~WiFiClientSecure() { stack_thunk_del_ref(); } -WiFiClientSecure::WiFiClientSecure(ClientContext* client, +WiFiClientSecureCtx::WiFiClientSecureCtx(ClientContext* client, const X509List *chain, const PrivateKey *sk, - int iobuf_in_size, int iobuf_out_size, const X509List *client_CA_ta) { + int iobuf_in_size, int iobuf_out_size, ServerSessions *cache, + const X509List *client_CA_ta) { _clear(); _clearAuthenticationSettings(); stack_thunk_add_ref(); @@ -133,17 +133,18 @@ WiFiClientSecure::WiFiClientSecure(ClientContext* client, _iobuf_out_size = iobuf_out_size; _client = client; _client->ref(); - if (!_connectSSLServerRSA(chain, sk, client_CA_ta)) { + if (!_connectSSLServerRSA(chain, sk, cache, client_CA_ta)) { _client->unref(); _client = nullptr; _clear(); } } -WiFiClientSecure::WiFiClientSecure(ClientContext *client, +WiFiClientSecureCtx::WiFiClientSecureCtx(ClientContext *client, const X509List *chain, unsigned cert_issuer_key_type, const PrivateKey *sk, - int iobuf_in_size, int iobuf_out_size, const X509List *client_CA_ta) { + int iobuf_in_size, int iobuf_out_size, ServerSessions *cache, + const X509List *client_CA_ta) { _clear(); _clearAuthenticationSettings(); stack_thunk_add_ref(); @@ -151,19 +152,19 @@ WiFiClientSecure::WiFiClientSecure(ClientContext *client, _iobuf_out_size = iobuf_out_size; _client = client; _client->ref(); - if (!_connectSSLServerEC(chain, cert_issuer_key_type, sk, client_CA_ta)) { + if (!_connectSSLServerEC(chain, cert_issuer_key_type, sk, cache, client_CA_ta)) { _client->unref(); _client = nullptr; _clear(); } } -void WiFiClientSecure::setClientRSACert(const X509List *chain, const PrivateKey *sk) { +void WiFiClientSecureCtx::setClientRSACert(const X509List *chain, const PrivateKey *sk) { _chain = chain; _sk = sk; } -void WiFiClientSecure::setClientECCert(const X509List *chain, +void WiFiClientSecureCtx::setClientECCert(const X509List *chain, const PrivateKey *sk, unsigned allowed_usages, unsigned cert_issuer_key_type) { _chain = chain; _sk = sk; @@ -171,7 +172,7 @@ void WiFiClientSecure::setClientECCert(const X509List *chain, _cert_issuer_key_type = cert_issuer_key_type; } -void WiFiClientSecure::setBufferSizes(int recv, int xmit) { +void WiFiClientSecureCtx::setBufferSizes(int recv, int xmit) { // Following constants taken from bearssl/src/ssl/ssl_engine.c (not exported unfortunately) const int MAX_OUT_OVERHEAD = 85; const int MAX_IN_OVERHEAD = 325; @@ -187,7 +188,7 @@ void WiFiClientSecure::setBufferSizes(int recv, int xmit) { _iobuf_out_size = xmit; } -bool WiFiClientSecure::stop(unsigned int maxWaitMs) { +bool WiFiClientSecureCtx::stop(unsigned int maxWaitMs) { bool ret = WiFiClient::stop(maxWaitMs); // calls our virtual flush() // Only if we've already connected, store session params and clear the connection options if (_handshake_done) { @@ -199,19 +200,19 @@ bool WiFiClientSecure::stop(unsigned int maxWaitMs) { return ret; } -bool WiFiClientSecure::flush(unsigned int maxWaitMs) { +bool WiFiClientSecureCtx::flush(unsigned int maxWaitMs) { (void) _run_until(BR_SSL_SENDAPP); return WiFiClient::flush(maxWaitMs); } -int WiFiClientSecure::connect(IPAddress ip, uint16_t port) { +int WiFiClientSecureCtx::connect(IPAddress ip, uint16_t port) { if (!WiFiClient::connect(ip, port)) { return 0; } return _connectSSL(nullptr); } -int WiFiClientSecure::connect(const char* name, uint16_t port) { +int WiFiClientSecureCtx::connect(const char* name, uint16_t port) { IPAddress remote_addr; if (!WiFi.hostByName(name, remote_addr)) { DEBUG_BSSL("connect: Name lookup failure\n"); @@ -224,11 +225,11 @@ int WiFiClientSecure::connect(const char* name, uint16_t port) { return _connectSSL(name); } -int WiFiClientSecure::connect(const String& host, uint16_t port) { +int WiFiClientSecureCtx::connect(const String& host, uint16_t port) { return connect(host.c_str(), port); } -void WiFiClientSecure::_freeSSL() { +void WiFiClientSecureCtx::_freeSSL() { // These are smart pointers and will free if refcnt==0 _sc = nullptr; _sc_svr = nullptr; @@ -245,18 +246,18 @@ void WiFiClientSecure::_freeSSL() { _timeout = 15000; } -bool WiFiClientSecure::_clientConnected() { +bool WiFiClientSecureCtx::_clientConnected() { return (_client && _client->state() == ESTABLISHED); } -uint8_t WiFiClientSecure::connected() { +uint8_t WiFiClientSecureCtx::connected() { if (available() || (_clientConnected() && _handshake_done && (br_ssl_engine_current_state(_eng) != BR_SSL_CLOSED))) { return true; } return false; } -size_t WiFiClientSecure::_write(const uint8_t *buf, size_t size, bool pmem) { +size_t WiFiClientSecureCtx::_write(const uint8_t *buf, size_t size, bool pmem) { size_t sent_bytes = 0; if (!connected() || !size || !_handshake_done) { @@ -297,16 +298,16 @@ size_t WiFiClientSecure::_write(const uint8_t *buf, size_t size, bool pmem) { return sent_bytes; } -size_t WiFiClientSecure::write(const uint8_t *buf, size_t size) { +size_t WiFiClientSecureCtx::write(const uint8_t *buf, size_t size) { return _write(buf, size, false); } -size_t WiFiClientSecure::write_P(PGM_P buf, size_t size) { +size_t WiFiClientSecureCtx::write_P(PGM_P buf, size_t size) { return _write((const uint8_t *)buf, size, true); } // We have to manually read and send individual chunks. -size_t WiFiClientSecure::write(Stream& stream) { +size_t WiFiClientSecureCtx::write(Stream& stream) { size_t totalSent = 0; size_t countRead; size_t countSent; @@ -329,7 +330,7 @@ size_t WiFiClientSecure::write(Stream& stream) { return totalSent; } -int WiFiClientSecure::read(uint8_t *buf, size_t size) { +int WiFiClientSecureCtx::read(uint8_t *buf, size_t size) { if (!ctx_present() || !_handshake_done) { return -1; } @@ -361,7 +362,7 @@ int WiFiClientSecure::read(uint8_t *buf, size_t size) { return 0; // If we're connected, no error but no read. } -int WiFiClientSecure::read() { +int WiFiClientSecureCtx::read() { uint8_t c; if (1 == read(&c, 1)) { return c; @@ -370,7 +371,7 @@ int WiFiClientSecure::read() { return -1; } -int WiFiClientSecure::available() { +int WiFiClientSecureCtx::available() { if (_recvapp_buf) { return _recvapp_len; // Anything from last call? } @@ -391,7 +392,7 @@ int WiFiClientSecure::available() { return 0; } -int WiFiClientSecure::peek() { +int WiFiClientSecureCtx::peek() { if (!ctx_present() || !available()) { DEBUG_BSSL("peek: Not connected, none left available\n"); return -1; @@ -403,7 +404,7 @@ int WiFiClientSecure::peek() { return -1; } -size_t WiFiClientSecure::peekBytes(uint8_t *buffer, size_t length) { +size_t WiFiClientSecureCtx::peekBytes(uint8_t *buffer, size_t length) { size_t to_copy = 0; if (!ctx_present()) { DEBUG_BSSL("peekBytes: Not connected\n"); @@ -426,22 +427,22 @@ size_t WiFiClientSecure::peekBytes(uint8_t *buffer, size_t length) { combination of both (the combination matches either). When a match is achieved, this function returns 0. On error, it returns -1. */ -int WiFiClientSecure::_run_until(unsigned target, bool blocking) { +int WiFiClientSecureCtx::_run_until(unsigned target, bool blocking) { if (!ctx_present()) { DEBUG_BSSL("_run_until: Not connected\n"); return -1; } - + esp8266::polledTimeout::oneShotMs loopTimeout(_timeout); - - for (int no_work = 0; blocking || no_work < 2;) { + + for (int no_work = 0; blocking || no_work < 2;) { optimistic_yield(100); - + if (loopTimeout) { DEBUG_BSSL("_run_until: Timeout\n"); return -1; } - + int state; state = br_ssl_engine_current_state(_eng); if (state & BR_SSL_CLOSED) { @@ -464,15 +465,15 @@ int WiFiClientSecure::_run_until(unsigned target, bool blocking) { buf = br_ssl_engine_sendrec_buf(_eng, &len); availForWrite = WiFiClient::availableForWrite(); - + if (!blocking && len > availForWrite) { - /* + /* writes on WiFiClient will block if len > availableForWrite() this is needed to prevent available() calls from blocking - on dropped connections + on dropped connections */ len = availForWrite; - } + } wlen = WiFiClient::write(buf, len); if (wlen <= 0) { /* @@ -550,7 +551,7 @@ int WiFiClientSecure::_run_until(unsigned target, bool blocking) { return -1; } -bool WiFiClientSecure::_wait_for_handshake() { +bool WiFiClientSecureCtx::_wait_for_handshake() { _handshake_done = false; while (!_handshake_done && _clientConnected()) { int ret = _run_until(BR_SSL_SENDAPP); @@ -575,7 +576,7 @@ static uint8_t htoi (unsigned char c) } // Set a fingerprint by parsing an ASCII string -bool WiFiClientSecure::setFingerprint(const char *fpStr) { +bool WiFiClientSecureCtx::setFingerprint(const char *fpStr) { int idx = 0; uint8_t c, d; uint8_t fp[20]; @@ -968,7 +969,7 @@ extern "C" { } // Set custom list of ciphers -bool WiFiClientSecure::setCiphers(const uint16_t *cipherAry, int cipherCount) { +bool WiFiClientSecureCtx::setCiphers(const uint16_t *cipherAry, int cipherCount) { _cipher_list = nullptr; _cipher_list = std::shared_ptr(new (std::nothrow) uint16_t[cipherCount], std::default_delete()); if (!_cipher_list.get()) { @@ -980,16 +981,16 @@ bool WiFiClientSecure::setCiphers(const uint16_t *cipherAry, int cipherCount) { return true; } -bool WiFiClientSecure::setCiphersLessSecure() { +bool WiFiClientSecureCtx::setCiphersLessSecure() { return setCiphers(faster_suites_P, sizeof(faster_suites_P)/sizeof(faster_suites_P[0])); } -bool WiFiClientSecure::setCiphers(std::vector list) { +bool WiFiClientSecureCtx::setCiphers(const std::vector& list) { return setCiphers(&list[0], list.size()); } // Installs the appropriate X509 cert validation method for a client connection -bool WiFiClientSecure::_installClientX509Validator() { +bool WiFiClientSecureCtx::_installClientX509Validator() { if (_use_insecure || _use_fingerprint || _use_self_signed) { // Use common insecure x509 authenticator _x509_insecure = std::make_shared(); @@ -1046,7 +1047,7 @@ bool WiFiClientSecure::_installClientX509Validator() { // Called by connect() to do the actual SSL setup and handshake. // Returns if the SSL handshake succeeded. -bool WiFiClientSecure::_connectSSL(const char* hostName) { +bool WiFiClientSecureCtx::_connectSSL(const char* hostName) { DEBUG_BSSL("_connectSSL: start connection\n"); _freeSSL(); _oom_err = false; @@ -1060,8 +1061,17 @@ bool WiFiClientSecure::_connectSSL(const char* hostName) { _sc = std::make_shared(); _eng = &_sc->eng; // Allocation/deallocation taken care of by the _sc shared_ptr - _iobuf_in = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_in_size], std::default_delete()); - _iobuf_out = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_out_size], std::default_delete()); + //C This was borrowed from @earlephilhower PoC, to exemplify the use of IRAM. + //C Is this something we want to keep in the final release? + { // ESP.setIramHeap(); would be an alternative to using a class to set a scope for IRAM usage. + HeapSelectIram ephemeral; + _iobuf_in = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_in_size], std::default_delete()); + _iobuf_out = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_out_size], std::default_delete()); + DBG_MMU_PRINTF("\n_iobuf_in: %p\n", _iobuf_in.get()); + DBG_MMU_PRINTF( "_iobuf_out: %p\n", _iobuf_out.get()); + DBG_MMU_PRINTF( "_iobuf_in_size: %u\n", _iobuf_in_size); + DBG_MMU_PRINTF( "_iobuf_out_size: %u\n", _iobuf_out_size); + } // ESP.resetHeap(); if (!_sc || !_iobuf_in || !_iobuf_out) { _freeSSL(); // Frees _sc, _iobuf* @@ -1136,7 +1146,7 @@ bool WiFiClientSecure::_connectSSL(const char* hostName) { // Slightly different X509 setup for servers who want to validate client // certificates, so factor it out as it's used in RSA and EC servers. -bool WiFiClientSecure::_installServerX509Validator(const X509List *client_CA_ta) { +bool WiFiClientSecureCtx::_installServerX509Validator(const X509List *client_CA_ta) { if (client_CA_ta) { _ta = client_CA_ta; // X509 minimal validator. Checks dates, cert chain for trusted CA, etc. @@ -1169,15 +1179,22 @@ bool WiFiClientSecure::_installServerX509Validator(const X509List *client_CA_ta) // Called by WiFiServerBearSSL when an RSA cert/key is specified. -bool WiFiClientSecure::_connectSSLServerRSA(const X509List *chain, - const PrivateKey *sk, +bool WiFiClientSecureCtx::_connectSSLServerRSA(const X509List *chain, + const PrivateKey *sk, ServerSessions *cache, const X509List *client_CA_ta) { _freeSSL(); _oom_err = false; _sc_svr = std::make_shared(); _eng = &_sc_svr->eng; // Allocation/deallocation taken care of by the _sc shared_ptr - _iobuf_in = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_in_size], std::default_delete()); - _iobuf_out = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_out_size], std::default_delete()); + { // ESP.setIramHeap(); + HeapSelectIram ephemeral; + _iobuf_in = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_in_size], std::default_delete()); + _iobuf_out = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_out_size], std::default_delete()); + DBG_MMU_PRINTF("\n_iobuf_in: %p\n", _iobuf_in.get()); + DBG_MMU_PRINTF( "_iobuf_out: %p\n", _iobuf_out.get()); + DBG_MMU_PRINTF( "_iobuf_in_size: %u\n", _iobuf_in_size); + DBG_MMU_PRINTF( "_iobuf_out_size: %u\n", _iobuf_out_size); + } // ESP.resetHeap(); if (!_sc_svr || !_iobuf_in || !_iobuf_out) { _freeSSL(); @@ -1189,8 +1206,10 @@ bool WiFiClientSecure::_connectSSLServerRSA(const X509List *chain, br_ssl_server_base_init(_sc_svr.get(), suites_server_rsa_P, sizeof(suites_server_rsa_P) / sizeof(suites_server_rsa_P[0])); br_ssl_server_set_single_rsa(_sc_svr.get(), chain ? chain->getX509Certs() : nullptr, chain ? chain->getCount() : 0, sk ? sk->getRSA() : nullptr, BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN, - br_rsa_private_get_default(), br_rsa_pkcs1_sign_get_default()); + br_rsa_private_get_default(), br_rsa_pkcs1_sign_get_default()); br_ssl_engine_set_buffers_bidi(_eng, _iobuf_in.get(), _iobuf_in_size, _iobuf_out.get(), _iobuf_out_size); + if (cache != nullptr) + br_ssl_server_set_cache(_sc_svr.get(), cache->getCache()); if (client_CA_ta && !_installServerX509Validator(client_CA_ta)) { DEBUG_BSSL("_connectSSLServerRSA: Can't install serverX509check\n"); return false; @@ -1205,16 +1224,23 @@ bool WiFiClientSecure::_connectSSLServerRSA(const X509List *chain, } // Called by WiFiServerBearSSL when an elliptic curve cert/key is specified. -bool WiFiClientSecure::_connectSSLServerEC(const X509List *chain, +bool WiFiClientSecureCtx::_connectSSLServerEC(const X509List *chain, unsigned cert_issuer_key_type, const PrivateKey *sk, - const X509List *client_CA_ta) { + ServerSessions *cache, const X509List *client_CA_ta) { #ifndef BEARSSL_SSL_BASIC _freeSSL(); _oom_err = false; _sc_svr = std::make_shared(); _eng = &_sc_svr->eng; // Allocation/deallocation taken care of by the _sc shared_ptr - _iobuf_in = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_in_size], std::default_delete()); - _iobuf_out = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_out_size], std::default_delete()); + { // ESP.setIramHeap(); + HeapSelectIram ephemeral; + _iobuf_in = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_in_size], std::default_delete()); + _iobuf_out = std::shared_ptr(new (std::nothrow) unsigned char[_iobuf_out_size], std::default_delete()); + DBG_MMU_PRINTF("\n_iobuf_in: %p\n", _iobuf_in.get()); + DBG_MMU_PRINTF( "_iobuf_out: %p\n", _iobuf_out.get()); + DBG_MMU_PRINTF( "_iobuf_in_size: %u\n", _iobuf_in_size); + DBG_MMU_PRINTF( "_iobuf_out_size: %u\n", _iobuf_out_size); + } // ESP.resetHeap(); if (!_sc_svr || !_iobuf_in || !_iobuf_out) { _freeSSL(); @@ -1228,6 +1254,8 @@ bool WiFiClientSecure::_connectSSLServerEC(const X509List *chain, sk ? sk->getEC() : nullptr, BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN, cert_issuer_key_type, br_ssl_engine_get_ec(_eng), br_ecdsa_i15_sign_asn1); br_ssl_engine_set_buffers_bidi(_eng, _iobuf_in.get(), _iobuf_in_size, _iobuf_out.get(), _iobuf_out_size); + if (cache != nullptr) + br_ssl_server_set_cache(_sc_svr.get(), cache->getCache()); if (client_CA_ta && !_installServerX509Validator(client_CA_ta)) { DEBUG_BSSL("_connectSSLServerEC: Can't install serverX509check\n"); return false; @@ -1251,14 +1279,25 @@ bool WiFiClientSecure::_connectSSLServerEC(const X509List *chain, // Returns an error ID and possibly a string (if dest != null) of the last // BearSSL reported error. -int WiFiClientSecure::getLastSSLError(char *dest, size_t len) { +int WiFiClientSecureCtx::getLastSSLError(char *dest, size_t len) { int err = 0; const char *t = PSTR("OK"); + const char *recv_fatal = ""; + const char *send_fatal = ""; if (_sc || _sc_svr) { err = br_ssl_engine_last_error(_eng); } if (_oom_err) { err = -1000; + } else { + if (err & BR_ERR_RECV_FATAL_ALERT) { + recv_fatal = PSTR("SSL received fatal alert - "); + err &= ~BR_ERR_RECV_FATAL_ALERT; + } + if (err & BR_ERR_SEND_FATAL_ALERT) { + send_fatal = PSTR("SSL sent fatal alert - "); + err &= ~BR_ERR_SEND_FATAL_ALERT; + } } switch (err) { case -1000: t = PSTR("Unable to allocate memory for SSL structures and buffers."); break; @@ -1323,8 +1362,8 @@ int WiFiClientSecure::getLastSSLError(char *dest, size_t len) { default: t = PSTR("Unknown error code."); break; } if (dest) { - strncpy_P(dest, t, len); - dest[len - 1] = 0; + // snprintf is PSTR safe and guaranteed to 0-terminate + snprintf(dest, len, "%s%s%s", recv_fatal, send_fatal, t); } return err; } @@ -1395,7 +1434,7 @@ bool WiFiClientSecure::probeMaxFragmentLength(IPAddress ip, uint16_t port, uint1 0x00, 26 + 14 + 6 + 5, // Extension length 0x00, 0x0d, 0x00, 0x16, 0x00, 0x14, 0x04, 0x03, 0x03, 0x03, 0x05, 0x03, 0x06, 0x03, 0x02, 0x03, 0x04, 0x01, 0x03, 0x01, 0x05, 0x01, 0x06, - 0x01, 0x02, 0x01, // Supported signature algorithms + 0x01, 0x02, 0x01, // Supported signature algorithms 0x00, 0x0a, 0x00, 0x0a, 0x00, 0x08, 0x00, 0x17, 0x00, 0x18, 0x00, 0x19, 0x00, 0x1d, // Supported groups 0x00, 0x0b, 0x00, 0x02, 0x01, 0x00, // Supported EC formats diff --git a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h index 7cc3af257..55c366075 100644 --- a/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h +++ b/libraries/ESP8266WiFi/src/WiFiClientSecureBearSSL.h @@ -31,13 +31,13 @@ namespace BearSSL { -class WiFiClientSecure : public WiFiClient { +class WiFiClientSecureCtx : public WiFiClient { public: - WiFiClientSecure(); - WiFiClientSecure(const WiFiClientSecure &rhs); - ~WiFiClientSecure() override; + WiFiClientSecureCtx(); + WiFiClientSecureCtx(const WiFiClientSecure &rhs) = delete; + ~WiFiClientSecureCtx() override; - WiFiClientSecure& operator=(const WiFiClientSecure&) = default; // The shared-ptrs handle themselves automatically + WiFiClientSecureCtx& operator=(const WiFiClientSecureCtx&) = delete; int connect(IPAddress ip, uint16_t port) override; int connect(const String& host, uint16_t port) override; @@ -46,12 +46,6 @@ class WiFiClientSecure : public WiFiClient { uint8_t connected() override; size_t write(const uint8_t *buf, size_t size) override; size_t write_P(PGM_P buf, size_t size) override; - size_t write(const char *buf) { - return write((const uint8_t*)buf, strlen(buf)); - } - size_t write_P(const char *buf) { - return write_P((PGM_P)buf, strlen_P(buf)); - } size_t write(Stream& stream); // Note this is not virtual int read(uint8_t *buf, size_t size) override; int available() override; @@ -116,21 +110,16 @@ class WiFiClientSecure : public WiFiClient { int getLastSSLError(char *dest = NULL, size_t len = 0); // Attach a preconfigured certificate store - void setCertStore(CertStore *certStore) { + void setCertStore(CertStoreBase *certStore) { _certStore = certStore; } // Select specific ciphers (i.e. optimize for speed over security) // These may be in PROGMEM or RAM, either will run properly bool setCiphers(const uint16_t *cipherAry, int cipherCount); - bool setCiphers(std::vector list); + bool setCiphers(const std::vector& list); bool setCiphersLessSecure(); // Only use the limited set of RSA ciphers without EC - // Check for Maximum Fragment Length support for given len before connection (possibly insecure) - static bool probeMaxFragmentLength(IPAddress ip, uint16_t port, uint16_t len); - static bool probeMaxFragmentLength(const char *hostname, uint16_t port, uint16_t len); - static bool probeMaxFragmentLength(const String& host, uint16_t port, uint16_t len); - protected: bool _connectSSL(const char *hostName); // Do initial SSL handshake @@ -151,7 +140,7 @@ class WiFiClientSecure : public WiFiClient { std::shared_ptr _iobuf_out; time_t _now; const X509List *_ta; - CertStore *_certStore; + CertStoreBase *_certStore; int _iobuf_in_size; int _iobuf_out_size; bool _handshake_done; @@ -188,25 +177,135 @@ class WiFiClientSecure : public WiFiClient { unsigned _cert_issuer_key_type; // Methods for handling server.available() call which returns a client connection. - friend class WiFiServerSecure; // Server needs to access these constructors - WiFiClientSecure(ClientContext *client, const X509List *chain, unsigned cert_issuer_key_type, - const PrivateKey *sk, int iobuf_in_size, int iobuf_out_size, const X509List *client_CA_ta); - WiFiClientSecure(ClientContext* client, const X509List *chain, const PrivateKey *sk, - int iobuf_in_size, int iobuf_out_size, const X509List *client_CA_ta); + friend class WiFiClientSecure; // access to private context constructors + WiFiClientSecureCtx(ClientContext *client, const X509List *chain, unsigned cert_issuer_key_type, + const PrivateKey *sk, int iobuf_in_size, int iobuf_out_size, ServerSessions *cache, + const X509List *client_CA_ta); + WiFiClientSecureCtx(ClientContext* client, const X509List *chain, const PrivateKey *sk, + int iobuf_in_size, int iobuf_out_size, ServerSessions *cache, + const X509List *client_CA_ta); // RSA keyed server - bool _connectSSLServerRSA(const X509List *chain, const PrivateKey *sk, const X509List *client_CA_ta); + bool _connectSSLServerRSA(const X509List *chain, const PrivateKey *sk, + ServerSessions *cache, const X509List *client_CA_ta); // EC keyed server bool _connectSSLServerEC(const X509List *chain, unsigned cert_issuer_key_type, const PrivateKey *sk, - const X509List *client_CA_ta); + ServerSessions *cache, const X509List *client_CA_ta); // X.509 validators differ from server to client bool _installClientX509Validator(); // Set up X509 validator for a client conn. bool _installServerX509Validator(const X509List *client_CA_ta); // Setup X509 client cert validation, if supplied uint8_t *_streamLoad(Stream& stream, size_t size); -}; +}; // class WiFiClientSecureCtx -}; + +class WiFiClientSecure : public WiFiClient { + + // WiFiClient's "ClientContext* _client" is always nullptr in this class. + // Instead, all virtual functions call their counterpart in "WiFiClientecureCtx* _ctx" + // which also derives from WiFiClient (this parent is the one which is eventually used) + + public: + + WiFiClientSecure():_ctx(new WiFiClientSecureCtx()) { } + WiFiClientSecure(const WiFiClientSecure &rhs): WiFiClient(), _ctx(rhs._ctx) { } + ~WiFiClientSecure() override { _ctx = nullptr; } + + WiFiClientSecure& operator=(const WiFiClientSecure&) = default; // The shared-ptrs handle themselves automatically + + uint8_t status() override { return _ctx->status(); } + int connect(IPAddress ip, uint16_t port) override { return _ctx->connect(ip, port); } + int connect(const String& host, uint16_t port) override { return _ctx->connect(host, port); } + int connect(const char* name, uint16_t port) override { return _ctx->connect(name, port); } + + uint8_t connected() override { return _ctx->connected(); } + size_t write(const uint8_t *buf, size_t size) override { return _ctx->write(buf, size); } + size_t write_P(PGM_P buf, size_t size) override { return _ctx->write_P(buf, size); } + size_t write(const char *buf) { return write((const uint8_t*)buf, strlen(buf)); } + size_t write_P(const char *buf) { return write_P((PGM_P)buf, strlen_P(buf)); } + size_t write(Stream& stream) /* Note this is not virtual */ { return _ctx->write(stream); } + int read(uint8_t *buf, size_t size) override { return _ctx->read(buf, size); } + int available() override { return _ctx->available(); } + int read() override { return _ctx->read(); } + int peek() override { return _ctx->peek(); } + size_t peekBytes(uint8_t *buffer, size_t length) override { return _ctx->peekBytes(buffer, length); } + bool flush(unsigned int maxWaitMs) { return _ctx->flush(maxWaitMs); } + bool stop(unsigned int maxWaitMs) { return _ctx->stop(maxWaitMs); } + void flush() override { (void)flush(0); } + void stop() override { (void)stop(0); } + + // Allow sessions to be saved/restored automatically to a memory area + void setSession(Session *session) { _ctx->setSession(session); } + + // Don't validate the chain, just accept whatever is given. VERY INSECURE! + void setInsecure() { _ctx->setInsecure(); } + + // Assume a given public key, don't validate or use cert info at all + void setKnownKey(const PublicKey *pk, unsigned usages = BR_KEYTYPE_KEYX | BR_KEYTYPE_SIGN) { + _ctx->setKnownKey(pk, usages); + } + // Only check SHA1 fingerprint of certificate + bool setFingerprint(const uint8_t fingerprint[20]) { + return _ctx->setFingerprint(fingerprint); + } + bool setFingerprint(const char *fpStr) { return _ctx->setFingerprint(fpStr); } + // Accept any certificate that's self-signed + void allowSelfSignedCerts() { _ctx->allowSelfSignedCerts(); } + + // Install certificates of trusted CAs or specific site + void setTrustAnchors(const X509List *ta) { _ctx->setTrustAnchors(ta); } + // In cases when NTP is not used, app must set a time manually to check cert validity + void setX509Time(time_t now) { _ctx->setX509Time(now); } + // Install a client certificate for this connection, in case the server requires it (i.e. MQTT) + void setClientRSACert(const X509List *cert, const PrivateKey *sk) { _ctx->setClientRSACert(cert, sk); } + void setClientECCert(const X509List *cert, const PrivateKey *sk, + unsigned allowed_usages, unsigned cert_issuer_key_type) { + _ctx->setClientECCert(cert, sk, allowed_usages, cert_issuer_key_type); + } + + // Sets the requested buffer size for transmit and receive + void setBufferSizes(int recv, int xmit) { _ctx->setBufferSizes(recv, xmit); } + + // Returns whether MFLN negotiation for the above buffer sizes succeeded (after connection) + int getMFLNStatus() { return _ctx->getMFLNStatus(); } + + // Return an error code and possibly a text string in a passed-in buffer with last SSL failure + int getLastSSLError(char *dest = NULL, size_t len = 0) { return _ctx->getLastSSLError(dest, len); } + + // Attach a preconfigured certificate store + void setCertStore(CertStoreBase *certStore) { _ctx->setCertStore(certStore); } + + // Select specific ciphers (i.e. optimize for speed over security) + // These may be in PROGMEM or RAM, either will run properly + bool setCiphers(const uint16_t *cipherAry, int cipherCount) { return _ctx->setCiphers(cipherAry, cipherCount); } + bool setCiphers(const std::vector list) { return _ctx->setCiphers(list); } + bool setCiphersLessSecure() { return _ctx->setCiphersLessSecure(); } // Only use the limited set of RSA ciphers without EC + + // Check for Maximum Fragment Length support for given len before connection (possibly insecure) + static bool probeMaxFragmentLength(IPAddress ip, uint16_t port, uint16_t len); + static bool probeMaxFragmentLength(const char *hostname, uint16_t port, uint16_t len); + static bool probeMaxFragmentLength(const String& host, uint16_t port, uint16_t len); + + private: + std::shared_ptr _ctx; + + // Methods for handling server.available() call which returns a client connection. + friend class WiFiServerSecure; // Server needs to access these constructors + WiFiClientSecure(ClientContext *client, const X509List *chain, unsigned cert_issuer_key_type, + const PrivateKey *sk, int iobuf_in_size, int iobuf_out_size, ServerSessions *cache, + const X509List *client_CA_ta): + _ctx(new WiFiClientSecureCtx(client, chain, cert_issuer_key_type, sk, iobuf_in_size, iobuf_out_size, cache, client_CA_ta)) { + } + + WiFiClientSecure(ClientContext* client, const X509List *chain, const PrivateKey *sk, + int iobuf_in_size, int iobuf_out_size, ServerSessions *cache, + const X509List *client_CA_ta): + _ctx(new WiFiClientSecureCtx(client, chain, sk, iobuf_in_size, iobuf_out_size, cache, client_CA_ta)) { + } + +}; // class WiFiClientSecure + +}; // namespace BearSSL #endif diff --git a/libraries/ESP8266WiFi/src/WiFiServer.cpp b/libraries/ESP8266WiFi/src/WiFiServer.cpp index 10e72b3ea..644f8b45d 100644 --- a/libraries/ESP8266WiFi/src/WiFiServer.cpp +++ b/libraries/ESP8266WiFi/src/WiFiServer.cpp @@ -115,9 +115,10 @@ WiFiClient WiFiServer::available(byte* status) { WiFiClient result(_unclaimed); // pcb can be null when peer has already closed the connection - if (_unclaimed->getPCB()) + if (_unclaimed->getPCB()) { // give permission to lwIP to accept one more peer tcp_backlog_accepted(_unclaimed->getPCB()); + } _unclaimed = _unclaimed->next(); result.setNoDelay(getNoDelay()); diff --git a/libraries/ESP8266WiFi/src/WiFiServer.h b/libraries/ESP8266WiFi/src/WiFiServer.h index 202384054..59aea48fa 100644 --- a/libraries/ESP8266WiFi/src/WiFiServer.h +++ b/libraries/ESP8266WiFi/src/WiFiServer.h @@ -23,7 +23,7 @@ #define wifiserver_h extern "C" { - #include "include/wl_definitions.h" + #include "wl_definitions.h" struct tcp_pcb; } diff --git a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp index 6478c8df9..5f7bcac07 100644 --- a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp +++ b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.cpp @@ -79,13 +79,13 @@ WiFiClientSecure WiFiServerSecure::available(uint8_t* status) { (void) status; // Unused if (_unclaimed) { if (_sk && _sk->isRSA()) { - WiFiClientSecure result(_unclaimed, _chain, _sk, _iobuf_in_size, _iobuf_out_size, _client_CA_ta); + WiFiClientSecure result(_unclaimed, _chain, _sk, _iobuf_in_size, _iobuf_out_size, _cache, _client_CA_ta); _unclaimed = _unclaimed->next(); result.setNoDelay(_noDelay); DEBUGV("WS:av\r\n"); return result; } else if (_sk && _sk->isEC()) { - WiFiClientSecure result(_unclaimed, _chain, _cert_issuer_key_type, _sk, _iobuf_in_size, _iobuf_out_size, _client_CA_ta); + WiFiClientSecure result(_unclaimed, _chain, _cert_issuer_key_type, _sk, _iobuf_in_size, _iobuf_out_size, _cache, _client_CA_ta); _unclaimed = _unclaimed->next(); result.setNoDelay(_noDelay); DEBUGV("WS:av\r\n"); diff --git a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h index 21916e3cb..716f00eaa 100644 --- a/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h +++ b/libraries/ESP8266WiFi/src/WiFiServerSecureBearSSL.h @@ -42,6 +42,11 @@ class WiFiServerSecure : public WiFiServer { _iobuf_out_size = xmit; } + // Sets the server's cache to the given one. + void setCache(ServerSessions *cache) { + _cache = cache; + } + // Set the server's RSA key and x509 certificate (required, pick one). // Caller needs to preserve the chain and key throughout the life of the server. void setRSACert(const X509List *chain, const PrivateKey *sk); @@ -69,6 +74,7 @@ class WiFiServerSecure : public WiFiServer { int _iobuf_in_size = BR_SSL_BUFSIZE_INPUT; int _iobuf_out_size = 837; const X509List *_client_CA_ta = nullptr; + ServerSessions *_cache = nullptr; }; diff --git a/libraries/ESP8266WiFi/src/WiFiUdp.cpp b/libraries/ESP8266WiFi/src/WiFiUdp.cpp index a0a5c1d4e..fc4bfe324 100644 --- a/libraries/ESP8266WiFi/src/WiFiUdp.cpp +++ b/libraries/ESP8266WiFi/src/WiFiUdp.cpp @@ -25,7 +25,7 @@ extern "C" { - #include "include/wl_definitions.h" + #include "wl_definitions.h" #include "osapi.h" #include "ets_sys.h" } diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock_v2/mDNS_Clock_v2.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock_v2/mDNS_Clock_v2.ino deleted file mode 100644 index a098bcb3e..000000000 --- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_Clock_v2/mDNS_Clock_v2.ino +++ /dev/null @@ -1,269 +0,0 @@ -/* - ESP8266 mDNS responder clock - - This example demonstrates two features of the LEA clsLEAMDNSHost: - 1. The host and service domain negotiation process that ensures - the uniqueness of the finally chosen host and service domain name. - 2. The dynamic MDNS service TXT feature - - A 'clock' service in announced via the MDNS responder and the current - time is set as a TXT item (eg. 'curtime=Mon Oct 15 19:54:35 2018'). - The time value is updated every second! - - The ESP is initially announced to clients as 'esp8266.local', if this host domain - is already used in the local network, another host domain is negotiated. Keep an - eye on the serial output to learn the final host domain for the clock service. - The service itself is is announced as 'host domain'._espclk._tcp.local. - As the service uses port 80, a very simple HTTP server is also installed to deliver - a small web page containing a greeting and the current time (not updated). - The web server code is taken nearly 1:1 from the 'mDNS_Web_Server.ino' example. - Point your browser to 'host domain'.local to see this web page. - - Instructions: - - Update WiFi SSID and password as necessary. - - Flash the sketch to the ESP8266 board - - Install host software: - - For Linux, install Avahi (http://avahi.org/). - - For Windows, install Bonjour (http://www.apple.com/support/bonjour/). - - For Mac OSX and iOS support is built in through Bonjour already. - - Use a MDNS/Bonjour browser like 'Discovery' to find the clock service in your local - network and see the current time updates. - -*/ - - -#include -#include -#include -#include -#include -#include - -// uses API MDNSApiVersion::LEAv2 -#define NO_GLOBAL_MDNS // our MDNS is defined below -#include - -/* - Global defines and vars -*/ - -#define TIMEZONE_OFFSET 1 // CET -#define DST_OFFSET 1 // CEST -#define UPDATE_CYCLE (1 * 1000) // every second - -#define START_AP_AFTER_MS 10000 // start AP after delay -#define SERVICE_PORT 80 // HTTP port - -#ifndef STASSID -#define STASSID "your-ssid" -#define STAPSK "your-password" -#endif - -#ifndef APSSID -#define APSSID "ap4mdnsClock" -#define APPSK "mdnsClock" -#endif - -const char* ssid = STASSID; -const char* password = STAPSK; - -clsLEAMDNSHost MDNSRESP; // MDNS responder -bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain -clsLEAMDNSHost::clsService* hMDNSService = 0; // The handle of the clock service in the MDNS responder - -// HTTP server at port 'SERVICE_PORT' will respond to HTTP requests -ESP8266WebServer server(SERVICE_PORT); - -/* - getTimeString -*/ -const char* getTimeString(void) { - - static char acTimeString[32]; - time_t now = time(nullptr); - ctime_r(&now, acTimeString); - size_t stLength; - while (((stLength = strlen(acTimeString))) && - ('\n' == acTimeString[stLength - 1])) { - acTimeString[stLength - 1] = 0; // Remove trailing line break... - } - return acTimeString; -} - - -/* - setClock - - Set time via NTP -*/ -void setClock(void) { - configTime((TIMEZONE_OFFSET * 3600), (DST_OFFSET * 3600), "pool.ntp.org", "time.nist.gov", "time.windows.com"); - - Serial.print("Waiting for NTP time sync: "); - time_t now = time(nullptr); // Secs since 01.01.1970 (when uninitalized starts with (8 * 3600 = 28800) - while (now < 8 * 3600 * 2) { // Wait for realistic value - delay(500); - Serial.print("."); - now = time(nullptr); - } - Serial.println(""); - Serial.printf("Current time: %s\n", getTimeString()); -} - - -/* - setStationHostname -*/ -bool setStationHostname(const char* p_pcHostname) { - - if (p_pcHostname) { - WiFi.hostname(p_pcHostname); - Serial.printf("setDeviceHostname: Station hostname is set to '%s'\n", p_pcHostname); - } - return true; -} - - -/* - MDNSDynamicServiceTxtCallback - - Add a dynamic MDNS TXT item 'ct' to the clock service. - The callback function is called every time, the TXT items for the clock service - are needed. - This can be triggered by calling MDNSRESP.announce(). - -*/ -void MDNSDynamicServiceTxtCallback(const clsLEAMDNSHost::hMDNSService& p_hService) { - Serial.println("MDNSDynamicServiceTxtCallback"); - - if (hMDNSService == &p_hService) { - Serial.printf("Updating curtime TXT item to: %s\n", getTimeString()); - hMDNSService->addDynamicServiceTxt("curtime", getTimeString()); - } -} - - -/* - handleHTTPClient -*/ - -void handleHTTPRequest() { - Serial.println(""); - Serial.println("HTTP Request"); - - // Get current time - time_t now = time(nullptr);; - struct tm timeinfo; - gmtime_r(&now, &timeinfo); - - String s; - s.reserve(300); - - s = "\r\nHello from "; - s += WiFi.hostname() + " at " + WiFi.localIP().toString(); - // Simple addition of the current time - s += "\r\nCurrent time is: "; - s += getTimeString(); - // done :-) - s += "\r\n\r\n"; - Serial.println("Sending 200"); - server.send(200, "text/html", s); -} - -/* - setup -*/ -void setup(void) { - Serial.begin(115200); - - // Connect to WiFi network - - WiFi.persistent(false); - - // useless informative callback - if (!LwipIntf::stateUpCB([](netif * nif) { - Serial.printf("New interface %c%c/%d is up\n", - nif->name[0], - nif->name[1], - netif_get_index(nif)); - })) { - Serial.println("Error: could not add informative callback\n"); - } - - WiFi.mode(WIFI_STA); - WiFi.begin(ssid, password); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(ssid); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - // Sync clock - setClock(); - - // Setup MDNS responder - // Init the (currently empty) host domain string with 'leamdnsv2' - if (MDNSRESP.begin("leamdnsv2", - [](clsLEAMDNSHost & p_rMDNSHost, const char* p_pcDomainName, bool p_bProbeResult)->void { - if (p_bProbeResult) { - Serial.printf("mDNSHost_AP::ProbeResultCallback: '%s' is %s\n", p_pcDomainName, (p_bProbeResult ? "FREE" : "USED!")); - // Unattended added service - hMDNSService = p_rMDNSHost.addService(0, "espclk", "tcp", 80); - hMDNSService->addDynamicServiceTxt("curtime", getTimeString()); - hMDNSService->setDynamicServiceTxtCallback(MDNSDynamicServiceTxtCallback); - } else { - // Change hostname, use '-' as divider between base name and index - MDNSRESP.setHostName(clsLEAMDNSHost::indexDomainName(p_pcDomainName, "-", 0)); - } - })) { - Serial.println("mDNS-AP started"); - } else { - Serial.println("FAILED to start mDNS-AP"); - } - - // Setup HTTP server - server.on("/", handleHTTPRequest); - server.begin(); - Serial.println("HTTP server started"); -} - -/* - loop -*/ -void loop(void) { - - // Check if a request has come in - server.handleClient(); - // Allow MDNS processing - MDNSRESP.update(); - - static esp8266::polledTimeout::periodicMs timeout(UPDATE_CYCLE); - if (timeout.expired()) { - - if (hMDNSService) { - // Just trigger a new MDNS announcement, this will lead to a call to - // 'MDNSDynamicServiceTxtCallback', which will update the time TXT item - Serial.printf("Announce trigger from user\n"); - MDNSRESP.announce(); - } - } - - static bool AP_started = false; - if (!AP_started && millis() > START_AP_AFTER_MS) { - AP_started = true; - Serial.printf("Starting AP...\n"); - WiFi.mode(WIFI_AP_STA); - WiFi.softAP(APSSID, APPSK); - Serial.printf("AP started...(%s:%s, %s)\n", - WiFi.softAPSSID().c_str(), - WiFi.softAPPSK().c_str(), - WiFi.softAPIP().toString().c_str()); - } -} diff --git a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor_v2/mDNS_ServiceMonitor_v2.ino b/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor_v2/mDNS_ServiceMonitor_v2.ino deleted file mode 100644 index 1d24990be..000000000 --- a/libraries/ESP8266mDNS/examples/LEAmDNS/mDNS_ServiceMonitor_v2/mDNS_ServiceMonitor_v2.ino +++ /dev/null @@ -1,259 +0,0 @@ -/* - ESP8266 mDNS Responder Service Monitor - - This example demonstrates two features of the LEA clsLEAMDNSHost: - 1. The host and service domain negotiation process that ensures - the uniqueness of the finally choosen host and service domain name. - 2. The dynamic MDNS service lookup/query feature. - - A list of 'HTTP' services in the local network is created and kept up to date. - In addition to this, a (very simple) HTTP server is set up on port 80 - and announced as a service. - - The ESP itself is initially announced to clients as 'esp8266.local', if this host domain - is already used in the local network, another host domain is negociated. Keep an - eye to the serial output to learn the final host domain for the HTTP service. - The service itself is is announced as 'host domain'._http._tcp.local. - The HTTP server delivers a short greeting and the current list of other 'HTTP' services (not updated). - The web server code is taken nearly 1:1 from the 'mDNS_Web_Server.ino' example. - Point your browser to 'host domain'.local to see this web page. - - Instructions: - - Update WiFi SSID and password as necessary. - - Flash the sketch to the ESP8266 board - - Install host software: - - For Linux, install Avahi (http://avahi.org/). - - For Windows, install Bonjour (http://www.apple.com/support/bonjour/). - - For Mac OSX and iOS support is built in through Bonjour already. - - Use a browser like 'Safari' to see the page at http://'host domain'.local. - -*/ - -// THIS IS A WORK IN PROGRESS: some TODOs need completion - -#ifndef STASSID -#define STASSID "ssid" -#define STAPSK "psk" -#endif - -#ifndef APSSID -#define APSSID "esp8266" -//#define APPSK "psk" -#endif - -#include -#include -#include - -#define NO_GLOBAL_MDNS // our MDNS is defined below -#include - -/* - Global defines and vars -*/ - -#define SERVICE_PORT 80 // HTTP port -clsLEAMDNSHost MDNS; // MDNS responder - -char* pcHostDomain = 0; // Negociated host domain -bool bHostDomainConfirmed = false; // Flags the confirmation of the host domain -clsLEAMDNSHost::clsService* hMDNSService = 0; // The handle of the http service in the MDNS responder -clsLEAMDNSHost::clsQuery* hMDNSServiceQuery = 0; // The handle of the 'http.tcp' service query in the MDNS responder - -const String cstrNoHTTPServices = "Currently no 'http.tcp' services in the local network!
"; -String strHTTPServices = cstrNoHTTPServices; - -// HTTP server at port 'SERVICE_PORT' will respond to HTTP requests -ESP8266WebServer server(SERVICE_PORT); - - -/* - setStationHostname -*/ -bool setStationHostname(const char* p_pcHostname) { - - if (p_pcHostname) { - WiFi.hostname(p_pcHostname); - Serial.printf("setStationHostname: Station hostname is set to '%s'\n", p_pcHostname); - return true; - } - return false; -} - - -void MDNSServiceQueryCallback(const clsLEAMDNSHost::clsQuery& p_Query, - const clsLEAMDNSHost::clsQuery::clsAnswer& p_Answer, - clsLEAMDNSHost::clsQuery::clsAnswer::typeQueryAnswerType p_QueryAnswerTypeFlags, - bool p_bSetContent) { - (void)p_Query; - - String answerInfo; - switch (p_QueryAnswerTypeFlags) { - case static_cast(clsLEAMDNSHost::clsQuery::clsAnswer::enuQueryAnswerType::ServiceDomain): - answerInfo = "ServiceDomain " + String(p_Answer.m_ServiceDomain.c_str()); - break; - - case static_cast(clsLEAMDNSHost::clsQuery::clsAnswer::enuQueryAnswerType::HostDomainPort): - answerInfo = "HostDomainAndPort " + String(p_Answer.m_HostDomain.c_str()) + ":" + String(p_Answer.m_u16Port); - break; - case static_cast(clsLEAMDNSHost::clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address): - answerInfo = "IP4Address "; - for (auto ip : p_Answer.m_IPv4Addresses) { - answerInfo += "- " + ip->m_IPAddress.toString(); - }; - break; - case static_cast(clsLEAMDNSHost::clsQuery::clsAnswer::enuQueryAnswerType::Txts): - answerInfo = "TXT "; - for (auto kv : p_Answer.m_Txts.m_Txts) { - answerInfo += "\nkv : " + String(kv->m_pcKey) + " : " + String(kv->m_pcValue); - } - break; - default : - answerInfo = "Unknown Answertype " + String(p_QueryAnswerTypeFlags); - - } - Serial.printf("Answer %s %s\n", answerInfo.c_str(), p_bSetContent ? "Modified" : "Deleted"); -} - -/* - MDNSServiceProbeResultCallback - Probe result callback for Services -*/ - -void serviceProbeResult(clsLEAMDNSHost::clsService& p_rMDNSService, - const char* p_pcInstanceName, - bool p_bProbeResult) { - (void)p_rMDNSService; - Serial.printf("MDNSServiceProbeResultCallback: Service %s probe %s\n", p_pcInstanceName, (p_bProbeResult ? "succeeded." : "failed!")); -} - -/* - MDNSHostProbeResultCallback - - Probe result callback for the host domain. - If the domain is free, the host domain is set and the http service is - added. - If the domain is already used, a new name is created and the probing is - restarted via p_pclsLEAMDNSHost->setHostname(). - -*/ - -void hostProbeResult(clsLEAMDNSHost & p_rMDNSHost, String p_pcDomainName, bool p_bProbeResult) { - - (void)p_rMDNSHost; - Serial.printf("MDNSHostProbeResultCallback: Host domain '%s.local' is %s\n", p_pcDomainName.c_str(), (p_bProbeResult ? "free" : "already USED!")); - - if (true == p_bProbeResult) { - // Set station hostname - setStationHostname(pcHostDomain); - - if (!bHostDomainConfirmed) { - // Hostname free -> setup clock service - bHostDomainConfirmed = true; - - if (!hMDNSService) { - // Add a 'http.tcp' service to port 'SERVICE_PORT', using the host domain as instance domain - hMDNSService = MDNS.addService(0, "http", "tcp", SERVICE_PORT, serviceProbeResult); - - if (hMDNSService) { - hMDNSService->setProbeResultCallback(serviceProbeResult); - // MDNS.setServiceProbeResultCallback(hMDNSService, serviceProbeResult); - - // Add some '_http._tcp' protocol specific MDNS service TXT items - // See: http://www.dns-sd.org/txtrecords.html#http - hMDNSService->addServiceTxt("user", ""); - hMDNSService->addServiceTxt("password", ""); - hMDNSService->addServiceTxt("path", "/"); - } - - // Install dynamic 'http.tcp' service query - if (!hMDNSServiceQuery) { - hMDNSServiceQuery = MDNS.installServiceQuery("http", "tcp", MDNSServiceQueryCallback); - if (hMDNSServiceQuery) { - Serial.printf("MDNSProbeResultCallback: Service query for 'http.tcp' services installed.\n"); - } else { - Serial.printf("MDNSProbeResultCallback: FAILED to install service query for 'http.tcp' services!\n"); - } - } - } - } - } else { - // Change hostname, use '-' as divider between base name and index - MDNS.setHostName(clsLEAMDNSHost::indexDomainName(p_pcDomainName.c_str(), "-", 0)); - } -} - -/* - HTTP request function (not found is handled by server) -*/ -void handleHTTPRequest() { - Serial.println(""); - Serial.println("HTTP Request"); - - IPAddress ip = server.client().localIP(); - String ipStr = ip.toString(); - String s; - s.reserve(200 /* + service listed */); - s = "\r\n

Hello from "; - s += WiFi.hostname() + ".local at " + server.client().localIP().toString() + "

"; - s += "

Local HTTP services are :

"; - s += "
    "; - - // TODO: list services - - s += "

"; - - Serial.println("Sending 200"); - server.send(200, "text/html", s); - Serial.println("Done with request"); -} - -/* - setup -*/ -void setup(void) { - Serial.begin(115200); - Serial.setDebugOutput(false); - - Serial.println(""); - Serial.println("THIS IS A WORK IN PROGRESS: some TODOs need completion"); - Serial.println(""); - - // Connect to WiFi network - WiFi.mode(WIFI_AP_STA); - WiFi.softAP(APSSID); - WiFi.begin(STASSID, STAPSK); - Serial.println(""); - - // Wait for connection - while (WiFi.status() != WL_CONNECTED) { - delay(500); - Serial.print("."); - } - Serial.println(""); - Serial.print("Connected to "); - Serial.println(STASSID); - Serial.print("IP address: "); - Serial.println(WiFi.localIP()); - - // Setup HTTP server - server.on("/", handleHTTPRequest); - - // Setup MDNS responders - MDNS.setProbeResultCallback(hostProbeResult); - - // Init the (currently empty) host domain string with 'leamdnsv2' - MDNS.begin("leamdnsv2"); - Serial.println("MDNS responder started"); - - // Start HTTP server - server.begin(); - Serial.println("HTTP server started"); -} - -void loop(void) { - // Check if a request has come in - server.handleClient(); - // Allow MDNS processing - MDNS.update(); -} diff --git a/libraries/ESP8266mDNS/src/ESP8266mDNS.h b/libraries/ESP8266mDNS/src/ESP8266mDNS.h index ec1242338..7c1a1bd5d 100644 --- a/libraries/ESP8266mDNS/src/ESP8266mDNS.h +++ b/libraries/ESP8266mDNS/src/ESP8266mDNS.h @@ -45,18 +45,11 @@ #ifndef __ESP8266MDNS_H #define __ESP8266MDNS_H -enum class MDNSApiVersion { LEA, LEAv2 }; - #include "LEAmDNS.h" // LEA -#include "LEAmDNS2Host.h" // LEAv2 - API updated - -// clsLEAMDNSHost replaces MDNSResponder in LEAv2 -using clsLEAMDNSHost = esp8266::experimental::clsLEAMDNSHost; #if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_MDNS) // Maps the implementation to use to the global namespace type using MDNSResponder = esp8266::MDNSImplementation::MDNSResponder; // LEA -//using MDNSResponder = clsLEAMDNSHost; // LEAv2 extern MDNSResponder MDNS; #endif diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.cpp b/libraries/ESP8266mDNS/src/LEAmDNS.cpp index 828fac52e..24e5799bb 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS.cpp @@ -28,7 +28,8 @@ #include "ESP8266mDNS.h" #include "LEAmDNS_Priv.h" #include // LwipIntf::stateUpCB() -#include "lwip/igmp.h" +#include +#include namespace esp8266 { @@ -1304,7 +1305,7 @@ bool MDNSResponder::_joinMulticastGroups(void) { if (netif_is_up(pNetIf)) { -#ifdef MDNS_IPV4_SUPPORT +#ifdef MDNS_IP4_SUPPORT ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT; if (!(pNetIf->flags & NETIF_FLAG_IGMP)) { @@ -1354,7 +1355,7 @@ bool MDNSResponder::_leaveMulticastGroups() bResult = true; // Leave multicast group(s) -#ifdef MDNS_IPV4_SUPPORT +#ifdef MDNS_IP4_SUPPORT ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT; if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))) { diff --git a/libraries/ESP8266mDNS/src/LEAmDNS.h b/libraries/ESP8266mDNS/src/LEAmDNS.h index 091bebaea..bf2f1e983 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS.h +++ b/libraries/ESP8266mDNS/src/LEAmDNS.h @@ -130,8 +130,9 @@ namespace MDNSImplementation #endif #define MDNS_IP4_SUPPORT +#if LWIP_IPV6 //#define MDNS_IP6_SUPPORT - +#endif #ifdef MDNS_IP4_SUPPORT #define MDNS_IP4_SIZE 4 diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2Host.cpp b/libraries/ESP8266mDNS/src/LEAmDNS2Host.cpp deleted file mode 100644 index 7722ea602..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2Host.cpp +++ /dev/null @@ -1,1331 +0,0 @@ -/* - LEAmDNS2Host.cpp - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#include -#include // LwipIntf::stateUpCB() -#include // strrstr() - -#include "ESP8266mDNS.h" -#include "LEAmDNS2Host.h" -#include "LEAmDNS2_Priv.h" - -#ifdef MDNS_IPV4_SUPPORT -#include -#endif -#ifdef MDNS2_IPV6_SUPPORT -#include -#endif - -/** - STRINGIZE -*/ -#ifndef STRINGIZE -#define STRINGIZE(x) #x -#endif -#ifndef STRINGIZE_VALUE_OF -#define STRINGIZE_VALUE_OF(x) STRINGIZE(x) -#endif - -namespace esp8266 -{ - - -namespace experimental -{ - - -/* - - HELPERS - -*/ - -/* - clsLEAmDNS2_Host::indexDomainName (static) - - Increments the given domain 'p_pcDomainName' by appending a delimiter and an index number. - - If the given domain name already has a numeric index (after the given delimiter), this index - is incremented. If not, the delimiter and index '2' is added. - - If 'p_pcDomainName' is empty (==0), the given default name 'p_pcDefaultDomainName' is used, - if no default is given, 'esp8266' is used. - -*/ - -clsLEAMDNSHost::fnProbeResultCallback clsLEAMDNSHost::stProbeResultCallback = nullptr; - -const char* clsLEAMDNSHost::indexDomainName(const char* p_pcDomainName, - const char* p_pcDivider /*= "-"*/, - const char* p_pcDefaultDomainName /*= 0*/) -{ - static char acResultDomainName[clsConsts::stDomainLabelMaxLength]; - *acResultDomainName = 0; - - // Ensure a divider exists; use '-' as default - const char* pcDivider = (p_pcDivider ? : "-"); - - if (p_pcDomainName) - { - // Given domain - const char* pFoundDivider = strrstr(p_pcDomainName, pcDivider); - if (pFoundDivider) // maybe already extended - { - char* pEnd = nullptr; - unsigned long ulIndex = strtoul((pFoundDivider + strlen(pcDivider)), &pEnd, 10); - if ((ulIndex) && - ((pEnd - p_pcDomainName) == (ptrdiff_t)strlen(p_pcDomainName)) && - (!*pEnd)) - { - // Valid (old) index found - char acIndexBuffer[16]; - sprintf(acIndexBuffer, "%lu", (++ulIndex)); - //size_t stLength = ((pFoundDivider - p_pcDomainName + strlen(pcDivider)) + strlen(acIndexBuffer) + 1); - - memcpy(acResultDomainName, p_pcDomainName, (pFoundDivider - p_pcDomainName + strlen(pcDivider))); - acResultDomainName[pFoundDivider - p_pcDomainName + strlen(pcDivider)] = 0; - strcat(acResultDomainName, acIndexBuffer); - } - else - { - pFoundDivider = nullptr; // Flag the need to (base) extend the hostname - } - } - - if (!pFoundDivider) - { - // not yet extended (or failed to increment extension) -> start indexing - //size_t stLength = strlen(p_pcDomainName) + (strlen(pcDivider) + 1 + 1); // Name + Divider + '2' + '\0' - sprintf(acResultDomainName, "%s%s2", p_pcDomainName, pcDivider); - } - } - else - { - // No given domain, use base or default - const char* cpcDefaultName = (p_pcDefaultDomainName ? : "esp8266"); - strncpy(acResultDomainName, cpcDefaultName, sizeof(acResultDomainName)); - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[mDNS] indexDomainName: From '%s' to '%s'\n"), (p_pcDomainName ? : ""), acResultDomainName);); - return acResultDomainName; -} - - -/* - clsLEAmDNS2_Host::setStationHostName (static) - - Sets the staion hostname - -*/ -// static -bool clsLEAMDNSHost::setNetIfHostName(const char* p_pcHostName) -{ - if (p_pcHostName) - for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next) - { - if (netif_is_up(pNetIf)) - { - netif_set_hostname(pNetIf, p_pcHostName); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("[mDNS] setNetIfHostName host name: %s on " NETIFID_STR "!\n"), p_pcHostName, NETIFID_VAL(pNetIf));); - } - } - return true; -} - - -/** - clsLEAmDNS2_Host::sm_pBackbone - -*/ -clsLEAMDNSHost::clsBackbone* clsLEAMDNSHost::clsBackbone::sm_pBackbone = 0; - -/** - Consts::... - -*/ -const char* clsLEAMDNSHost::clsConsts::pcLocal = "local"; -const char* clsLEAMDNSHost::clsConsts::pcServices = "services"; -const char* clsLEAMDNSHost::clsConsts::pcDNSSD = "dns-sd"; -const char* clsLEAMDNSHost::clsConsts::pcUDP = "udp"; -//const char* clsLEAMDNSHost::clsConsts::pcTCP = "tcp"; - -#ifdef MDNS_IPV4_SUPPORT -const char* clsLEAMDNSHost::clsConsts::pcReverseIPv4Domain = "in-addr"; -#endif -#ifdef MDNS2_IPV6_SUPPORT -const char* clsLEAMDNSHost::clsConsts::pcReverseIPv6Domain = "ip6"; -#endif -const char* clsLEAMDNSHost::clsConsts::pcReverseTopDomain = "arpa"; - - -/* - clsLEAmDNS2_Host::clsLEAmDNS2_Host constructor - -*/ -clsLEAMDNSHost::clsLEAMDNSHost(void) - : m_pUDPContext(0), - m_pcHostName(0), - m_pcDefaultInstanceName(0), - m_ProbeInformation() -{ -} - -/* - clsLEAmDNS2_Host::~clsLEAmDNS2_Host destructor - -*/ -clsLEAMDNSHost::~clsLEAMDNSHost(void) -{ - close(); -} - -/* - - INIT - -*/ - -/* - clsLEAmDNS2_Host::begin (hostname, probe_callback) - - setup global mDNS (adding all netif to the multicast groups), - sets up the instance data (hostname, ...) and starts the probing process - -*/ -bool clsLEAMDNSHost::begin(const char* p_pcHostName, - clsLEAMDNSHost::fnProbeResultCallback p_fnCallback /*= 0*/) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s begin(%s)\n"), _DH(), (p_pcHostName ? : "_"));); - - bool bResult = false; - - if (m_pUDPContext) - { - close(); - } - - bResult = (setHostName(p_pcHostName)) && - (_joinMulticastGroups()) && - (p_fnCallback ? setProbeResultCallback(p_fnCallback) : true) && - ((m_pUDPContext = _allocBackbone())) && - (restart()); - - if (!bResult) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s begin: FAILED for '%s'!\n"), _DH(), (p_pcHostName ? : "-"));); - return false; - } - - bResult = LwipIntf::stateUpCB([this](netif * nif) - { - (void)nif; - // This is called when a new interface appears: - // resend announces on all available interfaces. - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s a new interface %c%c/%d is up, restarting mDNS\n"), - _DH(), nif->name[0], nif->name[1], netif_get_index(nif));); - if (restart()) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s restart: success!\n"), _DH())); - } - else - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s restart failed!\n"), _DH())); - } - // No need to react when an interface disappears, - // because mDNS always loop on all available interfaces. - }); - - if (!bResult) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s begin: could not add netif status callback\n"), _DH())); - } - return bResult; -} - -/* - clsLEAmDNS2_Host::close - -*/ -bool clsLEAMDNSHost::close(void) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s close\n"), _DH());); - - m_pUDPContext = nullptr; - return ((_leaveMulticastGroups()) && - (_releaseBackbone())); -} - - -/* - - HOSTNAME - -*/ - -/* - clsLEAmDNS2_Host::setHostName - -*/ -bool clsLEAMDNSHost::setHostName(const char* p_pcHostName) -{ - bool bResult; - if ((bResult = _allocHostName(p_pcHostName))) - { - m_ProbeInformation.clear(false); - m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::ReadyToStart; - - // Replace 'auto-set' service names - for (clsService* pService : m_Services) - { - if ((pService->m_bAutoName) && - (!m_pcDefaultInstanceName)) - { - if (!((bResult = pService->setInstanceName(p_pcHostName)))) - { - break; - } - } - } - } - return bResult; -} - -/* - clsLEAmDNS2_Host::indexHostName - -*/ -bool clsLEAMDNSHost::indexHostName(void) -{ - return setHostName(clsLEAMDNSHost::indexDomainName(hostName(), "-", 0)); -} - -/* - clsLEAmDNS2_Host::hostName - -*/ -const char* clsLEAMDNSHost::hostName(void) const -{ - return m_pcHostName; -} - -/* - clsLEAmDNS2_Host::setProbeResultCallback - -*/ -bool clsLEAMDNSHost::setProbeResultCallback(clsLEAMDNSHost::fnProbeResultCallback p_fnCallback) -{ - m_ProbeInformation.m_fnProbeResultCallback = p_fnCallback; - return true; -} - -/* - clsLEAmDNS2_Host::probeStatus - -*/ -bool clsLEAMDNSHost::probeStatus(void) const -{ - return (clsProbeInformation_Base::enuProbingStatus::DoneFinally == m_ProbeInformation.m_ProbingStatus); -} - - -/* - - SERVICES - -*/ - -/* - clsLEAmDNS2_Host::setDefaultInstanceName - -*/ -bool clsLEAMDNSHost::setDefaultInstanceName(const char* p_pcDefaultInstanceName) -{ - bool bResult; - if ((bResult = _allocDefaultInstanceName(p_pcDefaultInstanceName))) - { - // Replace 'auto-set' service names - for (clsService* pService : m_Services) - { - if (pService->m_bAutoName) - { - if (!((bResult = pService->setInstanceName(p_pcDefaultInstanceName)))) - { - break; - } - } - } - } - return bResult; -} - -/* - clsLEAmDNS2_Host::defaultInstanceName - -*/ -const char* clsLEAMDNSHost::defaultInstanceName(void) const -{ - return m_pcDefaultInstanceName; -} - -/* - clsLEAmDNS2_Host::addService - -*/ -clsLEAMDNSHost::clsService* clsLEAMDNSHost::addService(const char* p_pcInstanceName, - const char* p_pcType, - const char* p_pcProtocol, - uint16_t p_u16Port, - clsLEAMDNSHost::clsService::fnProbeResultCallback p_fnCallback /*= 0*/) -{ - clsService* pService = nullptr; - - if (!((pService = findService(_instanceName(p_pcInstanceName), p_pcType, p_pcProtocol, p_u16Port)))) - { - // Not already used - if ((pService = new clsService)) - { - if ((pService->setInstanceName(_instanceName(p_pcInstanceName))) && - (pService->setType(p_pcType)) && - (pService->setProtocol(p_pcProtocol)) && - (pService->setPort(p_u16Port)) && - (p_fnCallback ? pService->setProbeResultCallback(p_fnCallback) : true)) - { - m_Services.push_back(pService); - } - else - { - delete pService; - pService = nullptr; - } - } - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s addService: %s to add service '%s.%s.%s.local'!\n"), _DH(pService), (pService ? "Succeeded" : "FAILED"), _instanceName(p_pcInstanceName) ? : "-", (p_pcType ? : ""), (p_pcProtocol ? : ""));); - DEBUG_EX_ERR(if (!pService) DEBUG_OUTPUT.printf_P(PSTR("%s addService: FAILED to add service '%s.%s.%s.local'!\n"), _DH(pService), _instanceName(p_pcInstanceName) ? : "-", (p_pcType ? : ""), (p_pcProtocol ? : ""));); - return pService; -} - -/* - clsLEAmDNS2_Host::removeService - -*/ -bool clsLEAMDNSHost::removeService(clsLEAMDNSHost::clsService* p_pService) -{ - bool bResult = true; - - if (p_pService && - (m_Services.end() != std::find(m_Services.begin(), m_Services.end(), p_pService))) - { - bResult = bResult && _announceService(*p_pService, false); - } - - m_Services.remove(p_pService); - delete p_pService; - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _removeService: FAILED!\n"), _DH(p_pService));); - return bResult; -} - -/* - clsLEAmDNS2_Host::findService (const) - -*/ -const clsLEAMDNSHost::clsService* clsLEAMDNSHost::findService(const char* p_pcInstanceName, - const char* p_pcType, - const char* p_pcProtocol, - uint16_t p_u16Port/*= (uint16_t)(-1)*/) const -{ - clsService* pFoundService = nullptr; - - for (clsService* pService : m_Services) - { - if ((0 == strcmp(pService->instanceName(), _instanceName(p_pcInstanceName))) && - (0 == strcmp(pService->type(), p_pcType)) && - (0 == strcmp(pService->protocol(), p_pcProtocol)) && - (((uint16_t)(-1) == p_u16Port) || - (pService->port() == p_u16Port))) - { - pFoundService = pService; - break; - } - } - return pFoundService; -} - -/* - clsLEAmDNS2_Host::findService - -*/ -clsLEAMDNSHost::clsService* clsLEAMDNSHost::findService(const char* p_pcInstanceName, - const char* p_pcType, - const char* p_pcProtocol, - uint16_t p_u16Port /*= (uint16_t)(-1)*/) -{ - return (clsService*)((const clsLEAMDNSHost*)this)->findService(p_pcInstanceName, p_pcType, p_pcProtocol, p_u16Port); -} - -/* - clsLEAMDNSHost::services - -*/ -const clsLEAMDNSHost::clsService::list& clsLEAMDNSHost::services(void) const -{ - return m_Services; -} - - -/* - - QUERIES - -*/ - -/* - clsLEAmDNS2_Host::queryService - -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor::vector clsLEAMDNSHost::queryService(const char* p_pcService, - const char* p_pcProtocol, - const uint16_t p_u16Timeout) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s queryService '_%s._%s.local'\n"), _DH(), p_pcService, p_pcProtocol);); - - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::vector ret; - - if (_removeLegacyQuery() && - (p_pcService) && (*p_pcService) && - (p_pcProtocol) && (*p_pcProtocol) && - (p_u16Timeout)) - { - std::list queries; - - clsQuery* pQuery = nullptr; - if (((pQuery = _allocQuery(clsQuery::enuQueryType::Service))) && - (_buildDomainForService(p_pcService, p_pcProtocol, pQuery->m_Domain))) - { - if (((pQuery->m_bStaticQuery = true)) && (_sendQuery(*pQuery))) - { - queries.push_back(pQuery); - } - else - { - // FAILED to send query - _removeQuery(pQuery); - } - } - - if (queries.size()) - { - // Wait for answers to arrive - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s queryService: Waiting %u ms for answers...\n"), _DH(), p_u16Timeout);); - //XXXFIXME could this delay be ASYNC? - delay(p_u16Timeout); - - // All answers should have arrived by now -> stop adding new answers - for (auto& q : queries) - { - q->m_bAwaitingAnswers = false; - ret.insert(ret.end(), std::make_move_iterator(q->answerAccessors().begin()), std::make_move_iterator(q->answerAccessors().end())); - } - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s queryService: INVALID input data!\n"), _DH());); - } - - } - return ret; -} - -/* - clsLEAmDNS2_Host::queryHost - -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor::vector clsLEAMDNSHost::queryHost(const char* p_pcHostName, - const uint16_t p_u16Timeout) -{ - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::vector ret; - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s queryHost '%s.local'\n"), _DH(), p_pcHostName);); - - if ((p_pcHostName) && (*p_pcHostName) && - (p_u16Timeout) && - (_removeLegacyQuery())) - { - std::list queries; - - clsQuery* pQuery = nullptr; - if (((pQuery = _allocQuery(clsQuery::enuQueryType::Host))) && - (_buildDomainForHost(p_pcHostName, pQuery->m_Domain))) - { - if (((pQuery->m_bStaticQuery = true)) && (_sendQuery(*pQuery))) - { - queries.push_back(pQuery); - } - else - { - // FAILED to send query - _removeQuery(pQuery); - } - } - - - if (queries.size()) - { - // Wait for answers to arrive - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s queryHost: Waiting %u ms for answers...\n"), _DH(), p_u16Timeout);); - //XXXFIXME could this delay be ASYNC? - delay(p_u16Timeout); - - // All answers should have arrived by now -> stop adding new answers - - for (auto& q : queries) - { - q->m_bAwaitingAnswers = false; - ret.insert(ret.end(), std::make_move_iterator(q->answerAccessors().begin()), std::make_move_iterator(q->answerAccessors().end())); - } - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s queryHost: INVALID input data!\n"), _DH());); - } - } - - return ret; -} -/* - clsLEAmDNS2_Host::removeQuery - -*/ -bool clsLEAMDNSHost::removeQuery(void) -{ - return _removeLegacyQuery(); -} - -/* - clsLEAmDNS2_Host::hasQuery - -*/ -bool clsLEAMDNSHost::hasQuery(void) -{ - return (0 != _findLegacyQuery()); -} - -/* - clsLEAmDNS2_Host::getQuery - -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::getQuery(void) const -{ - return _findLegacyQuery(); -} - -/* - clsLEAmDNS2_Host::installServiceQuery (answer) - -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::installServiceQuery(const char* p_pcService, - const char* p_pcProtocol, - clsLEAMDNSHost::clsQuery::QueryCallbackAnswerFn p_fnCallbackAnswer) -{ - clsQuery* pQuery = nullptr; - if ((pQuery = _installServiceQuery(p_pcService, p_pcProtocol))) - { - pQuery->m_fnCallbackAnswer = p_fnCallbackAnswer; - } - return pQuery; -} - -/* - clsLEAmDNS2_Host::installServiceQuery (accessor) - -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::installServiceQuery(const char* p_pcService, - const char* p_pcProtocol, - clsLEAMDNSHost::clsQuery::QueryCallbackAccessorFn p_fnCallbackAccessor) -{ - clsQuery* pQuery = nullptr; - if ((pQuery = _installServiceQuery(p_pcService, p_pcProtocol))) - { - pQuery->m_fnCallbackAccessor = p_fnCallbackAccessor; - } - return pQuery; -} - -/* - clsLEAmDNS2_Host::installHostQuery (answer) -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::installHostQuery(const char* p_pcHostName, - clsLEAMDNSHost::clsQuery::QueryCallbackAnswerFn p_fnCallbackAnswer) -{ - clsQuery* pQuery = nullptr; - if ((p_pcHostName) && (*p_pcHostName)) - { - clsRRDomain domain; - if ((pQuery = ((_buildDomainForHost(p_pcHostName, domain)) - ? _installDomainQuery(domain, clsQuery::enuQueryType::Host) - : nullptr))) - { - pQuery->m_fnCallbackAnswer = p_fnCallbackAnswer; - } - } - return pQuery; -} -/* - clsLEAmDNS2_Host::installHostQuery (accessor) -*/ - -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::installHostQuery(const char* p_pcHostName, - clsLEAMDNSHost::clsQuery::QueryCallbackAccessorFn p_fnCallbackAccessor) -{ - clsQuery* pQuery = nullptr; - if ((p_pcHostName) && (*p_pcHostName)) - { - clsRRDomain domain; - if ((pQuery = ((_buildDomainForHost(p_pcHostName, domain)) - ? _installDomainQuery(domain, clsQuery::enuQueryType::Host) - : nullptr))) - { - pQuery->m_fnCallbackAccessor = p_fnCallbackAccessor; - } - } - return pQuery; -} - -/* - clsLEAmDNS2_Host::removeQuery -*/ -bool clsLEAMDNSHost::removeQuery(clsLEAMDNSHost::clsQuery * p_pMDNSQuery) -{ - bool bResult = ((p_pMDNSQuery) && - (_removeQuery(p_pMDNSQuery))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s removeQuery: FAILED!\n"), _DH());); - return bResult; -} - -/* - PROCESSING -*/ - -/* - clsLEAmDNS2_Host::update -*/ -bool clsLEAMDNSHost::update(void) -{ - if (!_updateProbeStatus()) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: FAILED\n"), _DH())); - return false; - } - - if (!_checkQueryCache()) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: FAILED\n"), _DH())); - return false; - } - - return true; -} - -/* - clsLEAmDNS2_Host::announce -*/ - -bool clsLEAMDNSHost::announce(bool p_bAnnounce /*= true*/, - bool p_bIncludeServices /*= true*/) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s ::announce() externally called\n"), _DH());); - return _announce(p_bAnnounce, p_bIncludeServices); -} - -/* - clsLEAmDNS2_Host::announceService -*/ - -bool clsLEAMDNSHost::announceService(clsService * p_pService, - bool p_bAnnounce /*= true*/) -{ - - return _announceService(*p_pService, p_bAnnounce); -} - - -/* - clsLEAmDNS2_Host::restart -*/ -bool clsLEAMDNSHost::restart(void) -{ - return (_resetProbeStatus(true)); // Stop and restart probing -} - - -/* - clsLEAMDNSHost_Legacy::enableArduino -*/ -clsLEAMDNSHost::clsService* clsLEAMDNSHost::enableArduino(uint16_t p_u16Port, - bool p_bAuthUpload /*= false*/) -{ - clsLEAMDNSHost::clsService* svc = addService(nullptr, "arduino", "tcp", p_u16Port); - if (svc) - { - if ((!svc->addServiceTxt("tcp_check", "no")) - || (!svc->addServiceTxt("ssh_upload", "no")) - || (!svc->addServiceTxt("board", STRINGIZE_VALUE_OF(ARDUINO_BOARD))) - || (!svc->addServiceTxt("auth_upload", (p_bAuthUpload) ? "yes" : "no"))) - { - removeService(svc); - svc = nullptr; - } - } - return svc; -} - - -/* - P R O T E C T E D -*/ - -/* - - BACKBONE - -*/ - -/* - clsLEAmDNS2_Host::_allocBackbone - -*/ -UdpContext* clsLEAMDNSHost::_allocBackbone(void) -{ - UdpContext* pUDPContext = nullptr; - - if (!clsBackbone::sm_pBackbone) - { - // Not yet created - clsBackbone::sm_pBackbone = new clsBackbone; - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _allocBackbone: Created backbone.\n"), _DH());); - - if ((clsBackbone::sm_pBackbone) && - (!clsBackbone::sm_pBackbone->init())) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _allocBackbone: FAILED to init backbone!\n"), _DH());); - - delete clsBackbone::sm_pBackbone; - clsBackbone::sm_pBackbone = nullptr; - } - } - if (clsBackbone::sm_pBackbone) - { - pUDPContext = clsBackbone::sm_pBackbone->addHost(this); - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _allocBackbone: %s to add host to backbone.\n"), _DH(), (pUDPContext ? "Succeeded" : "FAILED"));); - return pUDPContext; -} - -/* - clsLEAmDNS2_Host::_releaseBackbone - -*/ -bool clsLEAMDNSHost::_releaseBackbone(void) -{ - bool bResult = false; - - if ((clsBackbone::sm_pBackbone) && - ((bResult = clsBackbone::sm_pBackbone->removeHost(this))) && - (0 == clsBackbone::sm_pBackbone->hostCount())) - { - delete clsBackbone::sm_pBackbone; - clsBackbone::sm_pBackbone = nullptr; - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _releaseBackbone: Released backbone."), _DH());); - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _releaseBackbone: %s to remove host from backbone."), _DH(), (bResult ? "Succeeded" : "FAILED"));); - return bResult; -} - - -/* - - MULTICAST GROUPS - -*/ - -/* - clsLEAmDNS2_Host::_joinMulticastGroups -*/ -bool clsLEAMDNSHost::_joinMulticastGroups(void) -{ - bool bResult = false; - - // Join multicast group(s) - for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next) - { - if (netif_is_up(pNetIf)) - { -#ifdef MDNS_IPV4_SUPPORT - ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT; - if (!(pNetIf->flags & NETIF_FLAG_IGMP)) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _createHost: Setting flag: flags & NETIF_FLAG_IGMP\n"), _DH());); - pNetIf->flags |= NETIF_FLAG_IGMP; - - if (ERR_OK != igmp_start(pNetIf)) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _createHost: igmp_start FAILED!\n"), _DH());); - } - } - - if ((ERR_OK == igmp_joingroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4)))) - { - bResult = true; - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _createHost: igmp_joingroup_netif(" NETIFID_STR ": %s) FAILED!\n"), - _DH(), NETIFID_VAL(pNetIf), IPAddress(multicast_addr_V4).toString().c_str());); - } -#endif - -#ifdef MDNS2_IPV6_SUPPORT - ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT; - bResult = ((bResult) && - (ERR_OK == mld6_joingroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6)))); - DEBUG_EX_ERR_IF(!bResult, DEBUG_OUTPUT.printf_P(PSTR("%s _createHost: mld6_joingroup_netif (" NETIFID_STR ") FAILED!\n"), - _DH(), NETIFID_VAL(pNetIf))); -#endif - } - } - return bResult; -} - -/* - clsLEAmDNS2_Host::_leaveMulticastGroups -*/ -bool clsLEAMDNSHost::_leaveMulticastGroups() -{ - bool bResult = false; - - for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next) - { - if (netif_is_up(pNetIf)) - { - bResult = true; - - // Leave multicast group(s) -#ifdef MDNS_IPV4_SUPPORT - ip_addr_t multicast_addr_V4 = DNS_MQUERY_IPV4_GROUP_INIT; - if (ERR_OK != igmp_leavegroup_netif(pNetIf, ip_2_ip4(&multicast_addr_V4))) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n"));); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - ip_addr_t multicast_addr_V6 = DNS_MQUERY_IPV6_GROUP_INIT; - if (ERR_OK != mld6_leavegroup_netif(pNetIf, ip_2_ip6(&multicast_addr_V6)/*&(multicast_addr_V6.u_addr.ip6)*/)) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("\n"));); - } -#endif - } - } - return bResult; -} - - -/* - PROCESSING -*/ - -/* - clsLEAmDNS2_Host::_processUDPInput -*/ -bool clsLEAMDNSHost::_processUDPInput(void) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processUDPInput\n"), _DH());); - - bool bResult = _parseMessage(); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s processUDPInput: FAILED!\n"), _DH());); - - return bResult; -} - - -/* - DOMAIN NAMES -*/ - -/* - clsLEAmDNS2_Host::_allocDomainName -*/ -bool clsLEAMDNSHost::_allocDomainName(const char* p_pcNewDomainName, - char*& p_rpcDomainName) -{ - bool bResult = false; - - _releaseDomainName(p_rpcDomainName); - - size_t stLength = 0; - if ((p_pcNewDomainName) && - (clsConsts::stDomainLabelMaxLength >= (stLength = strlen(p_pcNewDomainName)))) // char max size for a single label - { - // Copy in hostname characters as lowercase - if ((bResult = (0 != (p_rpcDomainName = new char[stLength + 1])))) - { -#ifdef MDNS_FORCE_LOWERCASE_HOSTNAME - size_t i = 0; - for (; i < stLength; ++i) - { - p_rpcDomainName[i] = tolower(p_pcNewDomainName[i]); - } - p_rpcDomainName[i] = 0; -#else - strncpy(p_rpcDomainName, p_pcNewDomainName, (stLength + 1)); -#endif - } - } - return bResult; -} - -/* - clsLEAmDNS2_Host::_releaseDomainName -*/ -bool clsLEAMDNSHost::_releaseDomainName(char*& p_rpcDomainName) -{ - bool bResult; - if ((bResult = (nullptr != p_rpcDomainName))) - { - delete[] p_rpcDomainName; - p_rpcDomainName = nullptr; - } - return bResult; -} - -/* - clsLEAmDNS2_Host::_allocHostName -*/ -bool clsLEAMDNSHost::_allocHostName(const char* p_pcHostName) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _allocHostName (%s)\n"), _DH(), p_pcHostName);); - return _allocDomainName(p_pcHostName, m_pcHostName); -} - -/* - clsLEAmDNS2_Host::_releaseHostName -*/ -bool clsLEAMDNSHost::_releaseHostName(void) -{ - return _releaseDomainName(m_pcHostName); -} - -/* - clsLEAmDNS2_Host::_allocDefaultInstanceName -*/ -bool clsLEAMDNSHost::_allocDefaultInstanceName(const char* p_pcDefaultInstanceName) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _allocDefaultInstanceName (%s)\n"), _DH(), p_pcDefaultInstanceName);); - return _allocDomainName(p_pcDefaultInstanceName, m_pcDefaultInstanceName); -} - -/* - clsLEAmDNS2_Host::_releaseDefaultInstanceName -*/ -bool clsLEAMDNSHost::_releaseDefaultInstanceName(void) -{ - return _releaseDomainName(m_pcDefaultInstanceName); -} - -/* - clsLEAmDNS2_Host::_instanceName -*/ -const char* clsLEAMDNSHost::_instanceName(const char* p_pcInstanceName) const -{ - return (p_pcInstanceName ? : (m_pcDefaultInstanceName ? : (m_pcHostName ? : nullptr))); -} - - -/* - SERVICE TXT -*/ - -/* - clsLEAmDNS2_Host::_collectServiceTxts -*/ -bool clsLEAMDNSHost::_collectServiceTxts(clsLEAMDNSHost::clsService & p_rService) -{ - if (p_rService.m_fnTxtCallback) - { - p_rService.m_fnTxtCallback(p_rService); - } - return true; -} - -/* - clsLEAmDNS2_Host::_releaseTempServiceTxts -*/ -bool clsLEAMDNSHost::_releaseTempServiceTxts(clsLEAMDNSHost::clsService & p_rService) -{ - return (p_rService.m_Txts.removeTempTxts()); -} - - -/* - - QUERIES - -*/ - -/* - MDNSResponder::_allocQuery - -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::_allocQuery(clsLEAMDNSHost::clsQuery::enuQueryType p_QueryType) -{ - clsQuery* pQuery = new clsQuery(p_QueryType); - if (pQuery) - { - // Link to query list - m_Queries.push_back(pQuery); - } - return pQuery; -} - -/* - MDNSResponder:clsHost:::_removeQuery - -*/ -bool clsLEAMDNSHost::_removeQuery(clsLEAMDNSHost::clsQuery * p_pQuery) -{ - bool bResult = false; - - clsQuery::list::iterator it(p_pQuery - ? std::find(m_Queries.begin(), m_Queries.end(), p_pQuery) - : m_Queries.end()); - if (m_Queries.end() != it) - { - m_Queries.erase(it); - delete p_pQuery; - - bResult = true; - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _releaseQuery: INVALID query!"), _DH());); - } - return bResult; -} - -/* - clsLEAmDNS2_Host::_removeLegacyQuery - -*/ -bool clsLEAMDNSHost::_removeLegacyQuery(void) -{ - clsQuery* pLegacyQuery = nullptr; - return (((pLegacyQuery = _findLegacyQuery())) - ? _removeQuery(pLegacyQuery) - : true); -} - -/* - clsLEAmDNS2_Host::_findLegacyQuery - -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::_findLegacyQuery(void) const -{ - clsQuery* pLegacyQuery = nullptr; - - for (clsQuery* pQuery : m_Queries) - { - if (pQuery->m_bStaticQuery) - { - pLegacyQuery = pQuery; - break; - } - } - return pLegacyQuery; -} - -/* - clsLEAmDNS2_Host::_releaseQueries - -*/ -bool clsLEAMDNSHost::_releaseQueries(void) -{ - for (clsQuery* pQuery : m_Queries) - { - delete pQuery; - } - m_Queries.clear(); - return true; -} - -/* - clsLEAmDNS2_Host::_findNextQueryByDomain - -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::_findNextQueryByDomain(const clsLEAMDNSHost::clsRRDomain & p_Domain, - const clsLEAMDNSHost::clsQuery::enuQueryType p_QueryType, - const clsQuery * p_pPrevQuery) -{ - clsQuery* pMatchingQuery = nullptr; - - clsQuery::list::iterator it(m_Queries.begin()); - if (p_pPrevQuery) - { - if (m_Queries.end() != ((it = std::find(m_Queries.begin(), m_Queries.end(), p_pPrevQuery)))) - { - // Found previous object - it++; - } - DEBUG_EX_ERR(else - { - DEBUG_OUTPUT.printf_P(PSTR("%s _findNextQueryByDomain: FAILED to find 'previous' object!\n"), _DH()); - }); // if not prev was found -> 'cancel' - } - - for (; it != m_Queries.end(); it++) - { - if (((clsQuery::enuQueryType::None == p_QueryType) || - ((*it)->m_QueryType == p_QueryType)) && - (p_Domain == (*it)->m_Domain)) - { - pMatchingQuery = *it; - break; - } - } - return pMatchingQuery; -} - -/* - clsLEAmDNS2_Host::_installServiceQuery - -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::_installServiceQuery( - const char* p_pcService, - const char* p_pcProtocol) -{ - clsQuery* pMDNSQuery = nullptr; - - if ((p_pcService) && (*p_pcService) && - (p_pcProtocol) && (*p_pcProtocol) && - ((pMDNSQuery = _allocQuery(clsQuery::enuQueryType::Service))) && - (_buildDomainForService(p_pcService, p_pcProtocol, pMDNSQuery->m_Domain))) - { - pMDNSQuery->m_bStaticQuery = false; - - if (_sendQuery(*pMDNSQuery)) - { - pMDNSQuery->m_u32SentCount = 1; - pMDNSQuery->m_ResendTimeout.reset(clsConsts::u32DynamicQueryResendDelay); - } - else - { - _removeQuery(pMDNSQuery); - } - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _installServiceQuery: %s for '_%s._%s.local'!\n\n"), _DH(), (pMDNSQuery ? "Succeeded" : "FAILED"), (p_pcService ? : "-"), (p_pcProtocol ? : "-"));); - DEBUG_EX_ERR(if (!pMDNSQuery) DEBUG_OUTPUT.printf_P(PSTR("%s _installServiceQuery: FAILED for '_%s._%s.local'!\n\n"), _DH(), (p_pcService ? : "-"), (p_pcProtocol ? : "-"));); - return pMDNSQuery; -} - -/* - clsLEAmDNS2_Host::_installDomainQuery -*/ -clsLEAMDNSHost::clsQuery* clsLEAMDNSHost::_installDomainQuery( - clsLEAMDNSHost::clsRRDomain & p_Domain, - clsLEAMDNSHost::clsQuery::enuQueryType p_QueryType) -{ - clsQuery* pQuery = nullptr; - - if ((pQuery = _allocQuery(p_QueryType))) - { - pQuery->m_Domain = p_Domain; - pQuery->m_bStaticQuery = false; - - if (_sendQuery(*pQuery)) - { - pQuery->m_u32SentCount = 1; - pQuery->m_ResendTimeout.reset(clsConsts::u32DynamicQueryResendDelay); - } - else - { - _removeQuery(pQuery); - } - } - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _installDomainQuery: %s for "), (pQuery ? "Succeeded" : "FAILED"), _DH()); - _printRRDomain(p_Domain); - DEBUG_OUTPUT.println(); - ); - DEBUG_EX_ERR_IF(!pQuery, - DEBUG_OUTPUT.printf_P(PSTR("%s _installDomainQuery: FAILED for "), _DH()); - _printRRDomain(p_Domain); - DEBUG_OUTPUT.println()); - return pQuery; -} - -/* - clsLEAmDNS2_Host::_hasQueriesWaitingForAnswers -*/ -bool clsLEAMDNSHost::_hasQueriesWaitingForAnswers(void) const -{ - bool bOpenQueries = false; - - for (const clsQuery* pQuery : m_Queries) - { - if (pQuery->m_bAwaitingAnswers) - { - bOpenQueries = true; - break; - } - } - return bOpenQueries; -} - -/* - clsLEAmDNS2_Host::_executeQueryCallback -*/ -bool clsLEAMDNSHost::_executeQueryCallback(const clsQuery & p_Query, - const clsQuery::clsAnswer & p_Answer, - clsQuery::clsAnswer::typeQueryAnswerType p_QueryAnswerTypeFlags, - bool p_bSetContent) -{ - if (p_Query.m_fnCallbackAnswer) - { - p_Query.m_fnCallbackAnswer(p_Query, p_Answer, p_QueryAnswerTypeFlags, p_bSetContent); - } - if (p_Query.m_fnCallbackAccessor) - { - p_Query.m_fnCallbackAccessor(p_Query, clsQuery::clsAnswerAccessor(&p_Answer), p_QueryAnswerTypeFlags, p_bSetContent); - } - return true; -} - - -} // namespace MDNSImplementation - - -} // namespace esp8266 - - - - diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2Host.h b/libraries/ESP8266mDNS/src/LEAmDNS2Host.h deleted file mode 100644 index 7d0c4c8de..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2Host.h +++ /dev/null @@ -1,1584 +0,0 @@ -/* - LEAmDNS2Host.h - (c) 2020, LaborEtArs - - Version 0.9 beta - - Some notes (from LaborEtArs, 2020): - - Supported mDNS features (in some cases somewhat limited): - - Announcing a DNS-SD service to interested observers, eg. a http server by announcing a esp8266._http._tcp.local. service - - Support for multi-level compressed names in input; in output only a very simple one-level full-name compression is implemented - - Probing host and service domains for uniqueness in the local network - - Tiebreaking while probing is supported in a very minimalistic way (the 'higher' IP address wins the tiebreak) - - Announcing available services after successful probing - - Using fixed service TXT items or - - Using dynamic service TXT items for presented services (via callback) - - Remove services (and un-announcing them to the observers by sending goodbye-messages) - - Static queries for hosts or DNS-SD services (creating a fixed answer set after a certain timeout period) - - Dynamic queries for hosts or DNS-SD services with cached and updated answers and user notifications - - - Usage: - A LEAmDNS2Host is attached to an existing netif (Network Interface). - If more than one netif is used (eg. in WIFI_AP_STA mode) and mDNS support is needed, every used netif needs its own LEAmDNS2Host! - - For presenting services: - In 'setup()': - Create an clsLEAMDNSHost instance for every netif you plan to use. - Call 'begin' on every instance with the intended hostname and the associated netif (or WiFi mode, WIFI_STA). - The given hostname is the 'probed' for uniqueness in the netifs local link. If domain name conflicts occur, the host name - will be automatically changed until it is unique in the local link. - Optionally a callback can be registered in 'begin', to control the probing process manually. - Next you can register DNS-SD services with 'addService("MyESP", "http", "tcp", 5000)' - All added service domain names are also probed for uniqueness and updated if needed. - Optionally a 'probe result' callback can be given for every service in 'addService', too. - - Finally you can add service TXT items with 'pService->addServiceTxt("c#", "1")' or by installing a service TXT callback - using 'pService->setDynamicServiceTxtCallback()' and calling 'pService->addDynamicServiceTxt("c#", "1")' inside. - - In 'loop()': - Call 'update()' for every clsLEAmDNS_Host instance. - - For querying services/hosts: - Static: - Call 'queryService("http", "tcp")' or 'queryHost("esp8266")'; - You should call MDNS.removeQuery() sometimes later (when the answers are not needed anymore) - - Dynamic: - Install a dynamic service query by calling 'installService/HostQuery("http", "tcp", serviceQueryCallback);' - The callback is called for any change in the answer set. - Call 'MDNS.removeQuery(pQuery)' when the answers are not needed anymore - - - Reference: - Used mDNS messages: - A (0x01): eg. esp8266.local A OP TTL 123.456.789.012 - AAAA (0x1C): eg. esp8266.local AAAA OP TTL 1234:5678::90 - PTR (0x0C, srv name): eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local - PTR (0x0C, srv type): eg. _services._dns-sd._udp.local PTR OP TTL _http._tcp.local - PTR (0x0C, IPv4): eg. 012.789.456.123.in-addr.arpa PTR OP TTL esp8266.local - PTR (0x0C, IPv6): eg. 90.0.0.0.0.0.0.0.0.0.0.0.78.56.34.12.ip6.arpa PTR OP TTL esp8266.local - SRV (0x21): eg. MyESP._http._tcp.local SRV OP TTL PRIORITY WEIGHT PORT esp8266.local - TXT (0x10): eg. MyESP._http._tcp.local TXT OP TTL c#=1 - NSEC (0x2F): eg. esp8266.local ... (DNSSEC) - - Some NOT used message types: - OPT (0x29): eDNS - - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#ifndef __LEAMDNS2HOST_H__ -#define __LEAMDNS2HOST_H__ - -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include - -#include - -#include "LEAmDNS2_lwIPdefs.h" - - -#define MDNS_IPV4_SUPPORT -#if LWIP_IPV6 -#define MDNS2_IPV6_SUPPORT // If we've got IPv6 support, then we need IPv6 support :-) -#endif - -namespace esp8266 -{ - - -namespace experimental -{ - - -/** - clsLEAMDNSHost -*/ -class clsLEAMDNSHost -{ -protected: - /* - clsConsts - */ - class clsConsts - { - public: -#ifdef MDNS_IPV4_SUPPORT - static constexpr uint16_t u16IPv4Size = 4; // IPv4 address size in bytes -#endif -#ifdef MDNS2_IPV6_SUPPORT - static constexpr uint16_t u16IPv6Size = 16; // IPv6 address size in bytes -#endif - static constexpr size_t stServiceTxtMaxLength = 1300; // Maximum length for all service txts for one service - static constexpr size_t stDomainMaxLength = 256; // Maximum length for a full domain name eg. MyESP._http._tcp.local - static constexpr size_t stDomainLabelMaxLength = 63; // Maximum length of on label in a domain name (length info fits into 6 bits) - static constexpr size_t stServiceTypeMaxLength = 15; // Maximum length of a service name eg. http - static constexpr size_t stServiceProtocolMaxLength = 3; // Maximum length of a service protocol name eg. tcp - - static constexpr uint32_t u32LegacyTTL = 10; // Legacy DNS record TTL - static constexpr uint32_t u32HostTTL = 120; // Host level records are set to 2min (120s) - static constexpr uint32_t u32ServiceTTL = 4500; // Service level records are set to 75min (4500s) - - static constexpr uint16_t u16SRVPriority = 0; // Default service priority and weight in SRV answers - static constexpr uint16_t u16SRVWeight = 0; // - static constexpr uint8_t u8DomainCompressMark = 0xC0; // Compressed labels are flaged by the two topmost bits of the length byte being set - static constexpr uint8_t u8DomainMaxRedirections = 6; // Avoid endless recursion because of malformed compressed labels - - static constexpr uint32_t u32ProbeDelay = 1000; // Default 250, but ESP is slow...; delay between and number of probes for host and service domains - static constexpr uint32_t u32ProbeCount = 3; - static constexpr uint32_t u32AnnounceDelay = 1000; // Delay between and number of announces for host and service domains - static constexpr uint32_t u32AnnounceCount = 3; - static constexpr uint32_t u32DynamicQueryResendDelay = 1000; // Delay between and number of queries; the delay is multiplied by the resent number in '_checkQueryCache' - - static const char* pcLocal; // "local"; - static const char* pcServices; // "services"; - static const char* pcDNSSD; // "dns-sd"; - static const char* pcUDP; // "udp"; - -#ifdef MDNS_IPV4_SUPPORT - static const char* pcReverseIPv4Domain; // "in-addr"; -#endif -#ifdef MDNS2_IPV6_SUPPORT - static const char* pcReverseIPv6Domain; // "ip6"; -#endif - static const char* pcReverseTopDomain; // "arpa"; - -#ifdef DNS_RRTYPE_NSEC - static constexpr uint8_t u8DNS_RRTYPE_NSEC = DNS_RRTYPE_NSEC; -#else - static constexpr uint8_t u8DNS_RRTYPE_NSEC = 0x2F; -#endif - static constexpr uint32_t u32SendTimeoutMs = 50; // timeout (ms) for a call to `UDPContext->send()` (12ms=1460B@1Mb/s) - - }; - - /** - list - */ - //using list = std::list; - - // File: ..._Backbone - /** - clsBackbone - XXXX should be merged with holder clsLEAMDNSHost because there is no list anymore in it - */ - class clsBackbone - { - public: - static clsBackbone* sm_pBackbone; - clsBackbone(void); - ~clsBackbone(void); - - bool init(void); - - UdpContext* addHost(clsLEAMDNSHost* p_pHost); - bool removeHost(clsLEAMDNSHost* p_pHost); - size_t hostCount(void) const; - bool setDelayUDPProcessing(bool p_bDelayProcessing); - - clsLEAMDNSHost* getUniqueHost() const - { - return m_uniqueHost; - } - - protected: - UdpContext* m_pUDPContext; - bool m_bDelayUDPProcessing; - uint32_t m_u32DelayedDatagrams; - //list m_HostList; - clsLEAMDNSHost* m_uniqueHost; - - bool _allocUDPContext(void); - bool _releaseUDPContext(void); - - bool _processUDPInput(void); - - const clsLEAMDNSHost* _findHost() const - { - return m_uniqueHost; - } - clsLEAMDNSHost* _findHost() - { - return m_uniqueHost; - } - - const char* _DH(void) const; - }; - - - // File: ..._Host_Structs - /** - typeIPProtocolType & enuIPProtocolType - */ - using typeIPProtocolType = uint8_t; - enum class enuIPProtocolType : typeIPProtocolType - { -#ifdef MDNS_IPV4_SUPPORT - V4 = 0x01, -#endif -#ifdef MDNS2_IPV6_SUPPORT - V6 = 0x02, -#endif - }; - - /** - typeNetIfState & enuNetIfState - */ - using typeNetIfState = uint8_t; - enum class enuNetIfState : typeNetIfState - { - None = 0x00, - - IsUp = 0x01, - UpMask = (IsUp), - - LinkIsUp = 0x02, - LinkMask = (LinkIsUp), - - IPv4 = 0x04, - IPv6 = 0x08, - IPMask = (IPv4 | IPv6), - }; - -public: - - /** - clsServiceTxt - */ - class clsServiceTxt - { - public: - char* m_pcKey; - char* m_pcValue; - bool m_bTemp; - - clsServiceTxt(const char* p_pcKey = 0, - const char* p_pcValue = 0, - bool p_bTemp = false); - clsServiceTxt(const clsServiceTxt& p_Other); - ~clsServiceTxt(void); - - clsServiceTxt& operator=(const clsServiceTxt& p_Other); - bool clear(void); - - char* allocKey(size_t p_stLength); - bool setKey(const char* p_pcKey, - size_t p_stLength); - bool setKey(const char* p_pcKey); - bool releaseKey(void); - - char* allocValue(size_t p_stLength); - bool setValue(const char* p_pcValue, - size_t p_stLength); - bool setValue(const char* p_pcValue); - bool releaseValue(void); - - bool set(const char* p_pcKey, - const char* p_pcValue, - bool p_bTemp = false); - - bool update(const char* p_pcValue); - - size_t length(void) const; - - /** - list - */ - using list = std::list; - }; - - /** - clsServiceTxts - */ - class clsServiceTxts - { - public: - clsServiceTxt::list m_Txts; - char* m_pcCache; - - clsServiceTxts(void); - clsServiceTxts(const clsServiceTxts& p_Other); - ~clsServiceTxts(void); - - clsServiceTxts& operator=(const clsServiceTxts& p_Other); - - bool clear(void); - bool clearCache(void); - - bool add(clsServiceTxt* p_pTxt); - bool remove(clsServiceTxt* p_pTxt); - - size_t count(void) const; - - bool removeTempTxts(void); - - clsServiceTxt* find(const char* p_pcKey); - const clsServiceTxt* find(const char* p_pcKey) const; - clsServiceTxt* find(const clsServiceTxt* p_pTxt); - - size_t length(void) const; - - size_t c_strLength(void) const; - bool c_str(char* p_pcBuffer); - const char* c_str(void) const; - - size_t bufferLength(void) const; - bool buffer(char* p_pcBuffer); - - bool compare(const clsServiceTxts& p_Other) const; - bool operator==(const clsServiceTxts& p_Other) const; - bool operator!=(const clsServiceTxts& p_Other) const; - }; - -protected: - /** - clsProbeInformation_Base - */ - class clsProbeInformation_Base - { - public: - /** - typeProbingStatus & enuProbingStatus - */ - using typeProbingStatus = uint8_t; - enum class enuProbingStatus : typeProbingStatus - { - WaitingForData, - ReadyToStart, - InProgress, - ReadyToAnnounce, - DoneFinally - }; - - enuProbingStatus m_ProbingStatus; - uint32_t m_u32SentCount; // Used for probes and announcements - esp8266::polledTimeout::oneShot m_Timeout; // Used for probes and announcements - bool m_bConflict; - bool m_bTiebreakNeeded; - - clsProbeInformation_Base(void); - - bool clear(void); // No 'virtual' needed, no polymorphic use (save 4 bytes) - }; - -public: - /** - fnProbeResultCallback - Callback function for host domain probe results - */ - using fnProbeResultCallback = std::function; - - static fnProbeResultCallback stProbeResultCallback; - -protected: - /** - clsProbeInformation - */ - class clsProbeInformation : public clsProbeInformation_Base - { - public: - fnProbeResultCallback m_fnProbeResultCallback; - - clsProbeInformation(void); - - bool clear(bool p_bClearUserdata = false); - }; - -public: - /** - clsService - */ - struct clsService - { - public: - /** - fnDynamicServiceTxtCallback - */ - using fnDynamicServiceTxtCallback = std::function; - - /** - fnProbeResultCallback - */ - using fnProbeResultCallback = std::function; - - protected: - friend clsLEAMDNSHost; - /** - clsProbeInformation - */ - class clsProbeInformation : public clsProbeInformation_Base - { - public: - fnProbeResultCallback m_fnProbeResultCallback; - - clsProbeInformation(void); - - bool clear(bool p_bClearUserdata = false); - }; - - char* m_pcInstanceName; - bool m_bAutoName; // Name was set automatically to hostname (if no name was supplied) - char* m_pcType; - char* m_pcProtocol; - uint16_t m_u16Port; - uint32_t m_u32ReplyMask; - clsServiceTxts m_Txts; - fnDynamicServiceTxtCallback m_fnTxtCallback; - clsProbeInformation m_ProbeInformation; - - clsService(void); - ~clsService(void); - - bool _releaseInstanceName(void); - bool _releaseType(void); - bool _releaseProtocol(void); - - void _resetProbeStatus(void); - - clsServiceTxt* _addServiceTxt(const char* p_pcKey, - const char* p_pcValue, - bool p_bTemp); - clsServiceTxt* _addServiceTxt(const char* p_pcKey, - uint32_t p_u32Value, - bool p_bTemp); - clsServiceTxt* _addServiceTxt(const char* p_pcKey, - int32_t p_i32Value, - bool p_bTemp); - - public: - bool setInstanceName(const char* p_pcInstanceName); - bool indexInstanceName(void); - const char* instanceName(void) const; - - bool setType(const char* p_pcType); - const char* type(void) const; - - bool setProtocol(const char* p_pcProtocol); - const char* protocol(void) const; - - bool setPort(uint16_t p_i16Port); - uint16_t port(void) const; - - bool setProbeResultCallback(fnProbeResultCallback p_fnProbeResultCallback); - bool probeStatus(void) const; - - // TXT - // Add a (static) MDNS TXT item ('key' = 'value') to the service - clsServiceTxt* addServiceTxt(const char* p_pcKey, - const char* p_pcValue); - clsServiceTxt* addServiceTxt(const char* p_pcKey, - uint32_t p_u32Value); - clsServiceTxt* addServiceTxt(const char* p_pcKey, - uint16_t p_u16Value); - clsServiceTxt* addServiceTxt(const char* p_pcKey, - uint8_t p_u8Value); - clsServiceTxt* addServiceTxt(const char* p_pcKey, - int32_t p_i32Value); - clsServiceTxt* addServiceTxt(const char* p_pcKey, - int16_t p_i16Value); - clsServiceTxt* addServiceTxt(const char* p_pcKey, - int8_t p_i8Value); - - bool removeServiceTxt(const char* p_pcKey); - bool removeServiceTxt(clsServiceTxt* p_pTxt); - const clsServiceTxt* findServiceTxt(const char* p_pcKey) const; - clsServiceTxt* findServiceTxt(const char* p_pcKey); - - // Add a (dynamic) MDNS TXT item ('key' = 'value') to the service - // Dynamic TXT items are removed right after one-time use. So they need to be added - // every time the value s needed (via callback). - clsServiceTxt* addDynamicServiceTxt(const char* p_pcKey, - const char* p_pcValue); - clsServiceTxt* addDynamicServiceTxt(const char* p_pcKey, - uint32_t p_u32Value); - clsServiceTxt* addDynamicServiceTxt(const char* p_pcKey, - uint16_t p_u16Value); - clsServiceTxt* addDynamicServiceTxt(const char* p_pcKey, - uint8_t p_u8Value); - clsServiceTxt* addDynamicServiceTxt(const char* p_pcKey, - int32_t p_i32Value); - clsServiceTxt* addDynamicServiceTxt(const char* p_pcKey, - int16_t p_i16Value); - clsServiceTxt* addDynamicServiceTxt(const char* p_pcKey, - int8_t p_i8Value); - - bool setDynamicServiceTxtCallback(fnDynamicServiceTxtCallback p_fnCallback); - - /** - list - */ - using list = std::list; - }; - using hMDNSService = clsService; // backward compatibility with LEAmDNS - -protected: - /** - typeContentFlag & enuContentFlag - */ - using typeContentFlag = uint16_t; - enum class enuContentFlag : typeContentFlag - { - // Host - A = 0x0001, - PTR_IPv4 = 0x0002, - PTR_IPv6 = 0x0004, - AAAA = 0x0008, - // Service - PTR_TYPE = 0x0010, - PTR_NAME = 0x0020, - TXT = 0x0040, - SRV = 0x0080, - // DNSSEC - NSEC = 0x0100, - - PTR = (PTR_IPv4 | PTR_IPv6 | PTR_TYPE | PTR_NAME) - }; - - /** - clsMsgHeader - */ - class clsMsgHeader - { - public: - uint16_t m_u16ID; // Identifier - bool m_1bQR : 1; // Query/Response flag - uint8_t m_4bOpcode : 4; // Operation code - bool m_1bAA : 1; // Authoritative Answer flag - bool m_1bTC : 1; // Truncation flag - bool m_1bRD : 1; // Recursion desired - bool m_1bRA : 1; // Recursion available - uint8_t m_3bZ : 3; // Zero - uint8_t m_4bRCode : 4; // Response code - uint16_t m_u16QDCount; // Question count - uint16_t m_u16ANCount; // Answer count - uint16_t m_u16NSCount; // Authority Record count - uint16_t m_u16ARCount; // Additional Record count - - clsMsgHeader(uint16_t p_u16ID = 0, - bool p_bQR = false, - uint8_t p_u8Opcode = 0, - bool p_bAA = false, - bool p_bTC = false, - bool p_bRD = false, - bool p_bRA = false, - uint8_t p_u8RCode = 0, - uint16_t p_u16QDCount = 0, - uint16_t p_u16ANCount = 0, - uint16_t p_u16NSCount = 0, - uint16_t p_u16ARCount = 0); - }; - - /** - clsRRDomain - */ - class clsRRDomain - { - public: - char m_acName[clsConsts::stDomainMaxLength]; // Encoded domain name - uint16_t m_u16NameLength; // Length (incl. '\0') - char* m_pcDecodedName; - - clsRRDomain(void); - clsRRDomain(const clsRRDomain& p_Other); - ~clsRRDomain(void); - - clsRRDomain& operator=(const clsRRDomain& p_Other); - - bool clear(void); - bool clearNameCache(void); - - bool addLabel(const char* p_pcLabel, - bool p_bPrependUnderline = false); - - bool compare(const clsRRDomain& p_Other) const; - bool operator==(const clsRRDomain& p_Other) const; - bool operator!=(const clsRRDomain& p_Other) const; - bool operator>(const clsRRDomain& p_Other) const; - - size_t c_strLength(void) const; - bool c_str(char* p_pcBuffer) const; - const char* c_str(void) const; - }; - - /** - clsRRAttributes - */ - class clsRRAttributes - { - public: - uint16_t m_u16Type; // Type - uint16_t m_u16Class; // Class, nearly always 'IN' - - clsRRAttributes(uint16_t p_u16Type = 0, - uint16_t p_u16Class = 1 /*DNS_RRCLASS_IN Internet*/); - clsRRAttributes(const clsRRAttributes& p_Other); - - clsRRAttributes& operator=(const clsRRAttributes& p_Other); - }; - - /** - clsRRHeader - */ - class clsRRHeader - { - public: - clsRRDomain m_Domain; - clsRRAttributes m_Attributes; - - clsRRHeader(void); - clsRRHeader(const clsRRHeader& p_Other); - - clsRRHeader& operator=(const clsRRHeader& p_Other); - - bool clear(void); - }; - - /** - clsRRQuestion - */ - struct clsRRQuestion - { - clsRRHeader m_Header; - bool m_bUnicast; // Unicast reply requested - - /** - list - */ - using list = std::list; - - clsRRQuestion(void); - }; - - /** - clsNSECBitmap - */ - class clsNSECBitmap - { - public: - uint8_t m_au8BitmapData[6]; // 6 bytes data - - clsNSECBitmap(void); - - bool clear(void); - uint16_t length(void) const; - bool setBit(uint16_t p_u16Bit); - bool getBit(uint16_t p_u16Bit) const; - }; - - /** - typeAnswerType & enuAnswerType - */ - using typeAnswerType = uint8_t; - enum class enuAnswerType : typeAnswerType - { - A, - PTR, - TXT, - AAAA, - SRV, - //NSEC, not used - https://tools.ietf.org/html/rfc6762#section-6.1 - Generic - }; - - /** - clsRRAnswer - */ - struct clsRRAnswer - { - clsRRAnswer* m_pNext; - const enuAnswerType m_AnswerType; - clsRRHeader m_Header; - bool m_bCacheFlush; // Cache flush command bit - uint32_t m_u32TTL; // Validity time in seconds - - virtual ~clsRRAnswer(void); - - enuAnswerType answerType(void) const; - - bool clear(void); - - protected: - clsRRAnswer(enuAnswerType p_AnswerType, - const clsRRHeader& p_Header, - uint32_t p_u32TTL); - }; - -#ifdef MDNS_IPV4_SUPPORT - /** - clsRRAnswerA - */ - class clsRRAnswerA : public clsRRAnswer - { - public: - IPAddress m_IPAddress; - - clsRRAnswerA(const clsRRHeader& p_Header, - uint32_t p_u32TTL); - ~clsRRAnswerA(void); - - bool clear(void); - }; -#endif - - /** - clsRRAnswerPTR - */ - class clsRRAnswerPTR : public clsRRAnswer - { - public: - clsRRDomain m_PTRDomain; - - clsRRAnswerPTR(const clsRRHeader& p_Header, - uint32_t p_u32TTL); - ~clsRRAnswerPTR(void); - - bool clear(void); - }; - - /** - clsRRAnswerTXT - */ - class clsRRAnswerTXT : public clsRRAnswer - { - public: - clsServiceTxts m_Txts; - - clsRRAnswerTXT(const clsRRHeader& p_Header, - uint32_t p_u32TTL); - ~clsRRAnswerTXT(void); - - bool clear(void); - }; - -#ifdef MDNS2_IPV6_SUPPORT - /** - clsRRAnswerAAAA - */ - class clsRRAnswerAAAA : public clsRRAnswer - { - public: - IPAddress m_IPAddress; - - clsRRAnswerAAAA(const clsRRHeader& p_Header, - uint32_t p_u32TTL); - ~clsRRAnswerAAAA(void); - - bool clear(void); - }; -#endif - - /** - clsRRAnswerSRV - */ - class clsRRAnswerSRV : public clsRRAnswer - { - public: - uint16_t m_u16Priority; - uint16_t m_u16Weight; - uint16_t m_u16Port; - clsRRDomain m_SRVDomain; - - clsRRAnswerSRV(const clsRRHeader& p_Header, - uint32_t p_u32TTL); - ~clsRRAnswerSRV(void); - - bool clear(void); - }; - - /** - clsRRAnswerGeneric - */ - class clsRRAnswerGeneric : public clsRRAnswer - { - public: - uint16_t m_u16RDLength; // Length of variable answer - uint8_t* m_pu8RDData; // Offset of start of variable answer in packet - - clsRRAnswerGeneric(const clsRRHeader& p_Header, - uint32_t p_u32TTL); - ~clsRRAnswerGeneric(void); - - bool clear(void); - }; - - - /** - clsSendParameter - */ - class clsSendParameter - { - protected: - /** - clsDomainCacheItem - */ - class clsDomainCacheItem - { - public: - const void* m_pHostNameOrService; // Opaque id for host or service domain (pointer) - bool m_bAdditionalData; // Opaque flag for special info (service domain included) - uint16_t m_u16Offset; // Offset in UDP output buffer - - /** - list - */ - using list = std::list; - - clsDomainCacheItem(const void* p_pHostNameOrService, - bool p_bAdditionalData, - uint32_t p_u16Offset); - }; - - public: - /** - typeResponseType & enuResponseType - */ - using typeResponseType = uint8_t; - enum class enuResponseType : typeResponseType - { - None, - Response, - Unsolicited - }; - - uint16_t m_u16ID; // Query ID (used only in lagacy queries) - clsRRQuestion::list m_RRQuestions; // A list of queries - uint32_t m_u32HostReplyMask; // Flags for reply components/answers - bool m_bLegacyDNSQuery; // Flag: Legacy query - enuResponseType m_Response; // Enum: Response to a query - bool m_bAuthorative; // Flag: Authorative (owner) response - bool m_bCacheFlush; // Flag: Clients should flush their caches - bool m_bUnicast; // Flag: Unicast response - bool m_bUnannounce; // Flag: Unannounce service - - // Temp content; created while processing _prepareMessage - uint16_t m_u16Offset; // Current offset in UDP write buffer (mainly for domain cache) - clsDomainCacheItem::list m_DomainCacheItems; // Cached host and service domains - - clsSendParameter(void); - ~clsSendParameter(void); - - bool clear(void); - bool flushQuestions(void); - bool flushDomainCache(void); - bool flushTempContent(void); - - bool shiftOffset(uint16_t p_u16Shift); - - bool addDomainCacheItem(const void* p_pHostNameOrService, - bool p_bAdditionalData, - uint16_t p_u16Offset); - uint16_t findCachedDomainOffset(const void* p_pHostNameOrService, - bool p_bAdditionalData) const; - }; - -public: - // QUERIES & ANSWERS - - /** - clsQuery - */ - class clsQuery - { - public: - /** - clsAnswer - */ - class clsAnswer - { - public: - /** - typeQueryAnswerType & enuQueryAnswerType - */ - using typeQueryAnswerType = uint8_t; - enum class enuQueryAnswerType : typeQueryAnswerType - { - Unknown = 0x00, - ServiceDomain = 0x01, // Service domain - HostDomain = 0x02, // Host domain - Port = 0x04, // Port - HostDomainPort = 0x06, - Txts = 0x08, // TXT items -#ifdef MDNS_IPV4_SUPPORT - IPv4Address = 0x10, // IPv4 address -#endif -#ifdef MDNS2_IPV6_SUPPORT - IPv6Address = 0x20, // IPv6 address -#endif - }; - - /** - stcTTL - */ - class clsTTL - { - public: - /** - typeTimeoutLevel & enuTimeoutLevel - */ - using typeTimeoutLevel = uint8_t; - enum class enuTimeoutLevel : typeTimeoutLevel - { - None = 0, - Base = 80, - Interval = 5, - Final = 100 - }; - - uint32_t m_u32TTL; - esp8266::polledTimeout::oneShot m_TTLTimeout; - typeTimeoutLevel m_TimeoutLevel; - - clsTTL(void); - bool set(uint32_t p_u32TTL); - - bool flagged(void) const; - bool restart(void); - - bool prepareDeletion(void); - bool finalTimeoutLevel(void) const; - - unsigned long timeout(void) const; - }; - - /** - clsIPAddressWithTTL - */ - class clsIPAddressWithTTL - { - public: - IPAddress m_IPAddress; - clsTTL m_TTL; - - /** - list - */ - using list = std::list; - - clsIPAddressWithTTL(IPAddress p_IPAddress, - uint32_t p_u32TTL = 0); - }; - - // The service domain is the first 'answer' (from PTR answer, using service and protocol) to be set - // Defines the key for additional answer, like host domain, etc. - clsRRDomain m_ServiceDomain; // 1. level answer (PTR), eg. MyESP._http._tcp.local - clsTTL m_TTLServiceDomain; - clsRRDomain m_HostDomain; // 2. level answer (SRV, using service domain), eg. esp8266.local - uint16_t m_u16Port; // 2. level answer (SRV, using service domain), eg. 5000 - clsTTL m_TTLHostDomainAndPort; - clsServiceTxts m_Txts; // 2. level answer (TXT, using service domain), eg. c#=1 - clsTTL m_TTLTxts; -#ifdef MDNS_IPV4_SUPPORT - clsIPAddressWithTTL::list m_IPv4Addresses; // 3. level answer (A, using host domain), eg. 123.456.789.012 -#endif -#ifdef MDNS2_IPV6_SUPPORT - clsIPAddressWithTTL::list m_IPv6Addresses; // 3. level answer (AAAA, using host domain), eg. 1234::09 -#endif - typeQueryAnswerType m_QueryAnswerFlags; // enuQueryAnswerType - - /** - list - */ - using list = std::list; - - clsAnswer(void); - ~clsAnswer(void); - - bool clear(void); - -#ifdef MDNS_IPV4_SUPPORT - bool releaseIPv4Addresses(void); - bool addIPv4Address(clsIPAddressWithTTL* p_pIPAddress); - bool removeIPv4Address(clsIPAddressWithTTL* p_pIPAddress); - const clsIPAddressWithTTL* findIPv4Address(const IPAddress& p_IPAddress) const; - clsIPAddressWithTTL* findIPv4Address(const IPAddress& p_IPAddress); - uint32_t IPv4AddressCount(void) const; - const clsIPAddressWithTTL* IPv4AddressAtIndex(uint32_t p_u32Index) const; - clsIPAddressWithTTL* IPv4AddressAtIndex(uint32_t p_u32Index); -#endif -#ifdef MDNS2_IPV6_SUPPORT - bool releaseIPv6Addresses(void); - bool addIPv6Address(clsIPAddressWithTTL* p_pIPAddress); - bool removeIPv6Address(clsIPAddressWithTTL* p_pIPAddress); - const clsIPAddressWithTTL* findIPv6Address(const IPAddress& p_IPAddress) const; - clsIPAddressWithTTL* findIPv6Address(const IPAddress& p_IPAddress); - uint32_t IPv6AddressCount(void) const; - const clsIPAddressWithTTL* IPv6AddressAtIndex(uint32_t p_u32Index) const; - clsIPAddressWithTTL* IPv6AddressAtIndex(uint32_t p_u32Index); -#endif - }; // clsAnswer - - /** - clsAnswerAccessor - */ - class clsAnswerAccessor - { - protected: - /** - stcCompareTxtKey - */ - struct stcCompareTxtKey - { - bool operator()(char const* p_pA, char const* p_pB) const; - }; - public: - clsAnswerAccessor(const clsAnswer* p_pAnswer); - ~clsAnswerAccessor(void); - - /** - clsTxtKeyValueMap - */ - using clsTxtKeyValueMap = std::map; - /** - clsIPAddressVector - */ - using clsIPAddressVector = std::vector; - /** - vector - */ - using vector = std::vector; - - bool serviceDomainAvailable(void) const; - const char* serviceDomain(void) const; - bool hostDomainAvailable(void) const; - const char* hostDomain(void) const; - bool hostPortAvailable(void) const; - uint16_t hostPort(void) const; -#ifdef MDNS_IPV4_SUPPORT - bool IPv4AddressAvailable(void) const; - clsIPAddressVector IPv4Addresses(void) const; -#endif -#ifdef MDNS2_IPV6_SUPPORT - bool IPv6AddressAvailable(void) const; - clsIPAddressVector IPv6Addresses(void) const; -#endif - bool txtsAvailable(void) const; - const char* txts(void) const; - const clsTxtKeyValueMap& txtKeyValues(void) const; - const char* txtValue(const char* p_pcKey) const; - - size_t printTo(Print& p_Print) const; - - protected: - const clsAnswer* m_pAnswer; - clsTxtKeyValueMap m_TxtKeyValueMap; - }; - - /** - typeQueryType & enuQueryType - */ - using typeQueryType = uint8_t; - enum class enuQueryType : typeQueryType - { - None, - Service, - Host - }; - - /** - QueryCallbackAnswerFn - */ - using QueryCallbackAnswerFn = std::function; // true: Answer component set, false: component deleted - /** - QueryCallbackAccessorFn - */ - using QueryCallbackAccessorFn = std::function; // true: Answer component set, false: component deleted - - protected: - friend clsLEAMDNSHost; - - enuQueryType m_QueryType; - clsRRDomain m_Domain; // Type:Service -> _http._tcp.local; Type:Host -> esp8266.local - QueryCallbackAnswerFn m_fnCallbackAnswer; - QueryCallbackAccessorFn m_fnCallbackAccessor; - bool m_bStaticQuery; - uint32_t m_u32SentCount; - esp8266::polledTimeout::oneShot m_ResendTimeout; - bool m_bAwaitingAnswers; - clsAnswer::list m_Answers; - - /** - list - */ - using list = std::list; - - clsQuery(const enuQueryType p_QueryType); - ~clsQuery(void); - - bool clear(void); - - bool addAnswer(clsAnswer* p_pAnswer); - bool removeAnswer(clsAnswer* p_pAnswer); - - clsAnswer* findAnswerForServiceDomain(const clsRRDomain& p_ServiceDomain); - clsAnswer* findAnswerForHostDomain(const clsRRDomain& p_HostDomain); - - public: - uint32_t answerCount(void) const; - const clsAnswer* answer(uint32_t p_u32Index) const; - uint32_t indexOfAnswer(const clsAnswer* p_pAnswer) const; - - clsAnswerAccessor::vector answerAccessors(void) const; - clsAnswerAccessor answerAccessor(uint32 p_u32AnswerIndex) const; - }; - -public: - static const char* indexDomainName(const char* p_pcDomainName, - const char* p_pcDivider = "-", - const char* p_pcDefaultDomainName = 0); - static bool setNetIfHostName(const char* p_pcHostName); - - clsLEAMDNSHost(void); - ~clsLEAMDNSHost(void); - - // INIT - // Create a MDNS host by setting the default hostname - // Later call 'update()' in every 'loop' to run the process loop - // (probing, announcing, responding, ...) - // If no callback is given, the (maybe) already installed callback stays set - bool begin(const char* p_pcHostName, - fnProbeResultCallback p_fnCallback = 0); - - bool close(void); - - // HOST - bool setHostName(const char* p_pcHostName); - bool indexHostName(void); - const char* hostName(void) const; - - bool setProbeResultCallback(fnProbeResultCallback p_fnCallback); - - // Returns 'true' is host domain probing is done - bool probeStatus(void) const; - - // SERVICE - bool setDefaultInstanceName(const char* p_pcInstanceName); - const char* defaultInstanceName(void) const; - - clsService* addService(const char* p_pcInstanceName, - const char* p_pcServiceType, - const char* p_pcProtocol, - uint16_t p_u16Port, - clsService::fnProbeResultCallback p_fnCallback = 0); - bool removeService(clsService* p_pMDNSService); - - const clsService* findService(const char* p_pcInstanceName, - const char* p_pcType, - const char* p_pcProtocol, - uint16_t p_u16Port = (uint16_t)(-1)) const; - clsService* findService(const char* p_pcInstanceName, - const char* p_pcType, - const char* p_pcProtocol, - uint16_t p_u16Port = (uint16_t)(-1)); - const clsService::list& services(void) const; - - // QUERIES - - // - STATIC - // Perform a (static) service/host query. The function returns after p_u16Timeout milliseconds - // The answers (the number of received answers is returned) can be retrieved by calling - // - answerHostName (or hostname) - // - answerIP (or IP) - // - answerPort (or port) - clsQuery::clsAnswerAccessor::vector queryService(const char* p_pcService, - const char* p_pcProtocol, - const uint16_t p_u16Timeout); - clsQuery::clsAnswerAccessor::vector queryHost(const char* p_pcHostName, - const uint16_t p_u16Timeout); - bool removeQuery(void); - bool hasQuery(void); - clsQuery* getQuery(void) const; - - // - DYNAMIC - // Install a dynamic service/host query. For every received answer (part) the given callback - // function is called. The query will be updated every time, the TTL for an answer - // has timed-out. - // The answers can also be retrieved by calling - // - answerCount service/host (for host queries, this should never be >1) - // - answerServiceDomain service - // - hasAnswerHostDomain/answerHostDomain service/host - // - hasAnswerIPv4Address/answerIPv4Address service/host - // - hasAnswerIPv6Address/answerIPv6Address service/host - // - hasAnswerPort/answerPort service - // - hasAnswerTxts/answerTxts service - - /* - install*Query() creates several queries on the interfaces. - it does not return a single query but a boolean until the API is adapted - */ - clsQuery* installServiceQuery(const char* p_pcServiceType, - const char* p_pcProtocol, - clsQuery::QueryCallbackAnswerFn p_fnCallbackAnswer); - clsQuery* installServiceQuery(const char* p_pcServiceType, - const char* p_pcProtocol, - clsQuery::QueryCallbackAccessorFn p_fnCallbackAccessor); - clsQuery* installHostQuery(const char* p_pcHostName, - clsQuery::QueryCallbackAnswerFn p_fnCallbackAnswer); - clsQuery* installHostQuery(const char* p_pcHostName, - clsQuery::QueryCallbackAccessorFn p_fnCallbackAccessor); - // Remove a dynamic service query - bool removeQuery(clsQuery* p_pQuery); - - // PROCESSING - bool update(void); - - bool announce(bool p_bAnnounce = true, - bool p_bIncludeServices = true); - bool announceService(clsService* p_pService, - bool p_bAnnounce = true); - - bool restart(void); - - clsService* enableArduino(uint16_t p_u16Port, bool p_bAuthUpload = false); - -protected: - // File: ..._Host - UdpContext* _allocBackbone(void); - bool _releaseBackbone(void); - - bool _joinMulticastGroups(void); - bool _leaveMulticastGroups(void); - - // NETIF - typeNetIfState _getNetIfState(void) const; - bool _checkNetIfState(void); - - // PROCESSING - bool _processUDPInput(void); - - // DOMAIN NAMES - bool _allocDomainName(const char* p_pcNewDomainName, - char*& p_rpcDomainName); - bool _releaseDomainName(char*& p_rpcDomainName); - bool _allocHostName(const char* p_pcHostName); - bool _releaseHostName(void); - - bool _allocDefaultInstanceName(const char* p_pcInstanceName); - bool _releaseDefaultInstanceName(void); - const char* _instanceName(const char* p_pcInstanceName) const; - - // SERVICE - clsService* _allocService(const char* p_pcName, - const char* p_pcServiceType, - const char* p_pcProtocol, - uint16_t p_u16Port); - bool _releaseService(clsService* p_pService); - - // SERVICE TXT - clsServiceTxt* _allocServiceTxt(clsService* p_pService, - const char* p_pcKey, - const char* p_pcValue, - bool p_bTemp); - bool _releaseServiceTxt(clsService* p_pService, - clsServiceTxt* p_pTxt); - clsServiceTxt* _updateServiceTxt(clsService* p_pService, - clsServiceTxt* p_pTxt, - const char* p_pcValue, - bool p_bTemp); - clsServiceTxt* _findServiceTxt(clsService* p_pService, - const char* p_pcKey); - clsServiceTxt* _addServiceTxt(clsService* p_pService, - const char* p_pcKey, - const char* p_pcValue, - bool p_bTemp); - clsServiceTxt* _answerKeyValue(const clsQuery p_pQuery, - const uint32_t p_u32AnswerIndex); - bool _collectServiceTxts(clsService& p_rService); - bool _releaseTempServiceTxts(clsService& p_rService); - - - // QUERIES - clsQuery* _allocQuery(clsQuery::enuQueryType p_QueryType); - bool _removeQuery(clsQuery* p_pQuery); - bool _removeLegacyQuery(void); - clsQuery* _findLegacyQuery(void) const; - bool _releaseQueries(void); - clsQuery* _findNextQueryByDomain(const clsRRDomain& p_Domain, - const clsQuery::enuQueryType p_QueryType, - const clsQuery* p_pPrevQuery); - clsQuery* _installServiceQuery(const char* p_pcService, - const char* p_pcProtocol); - clsQuery* _installDomainQuery(clsRRDomain& p_Domain, - clsQuery::enuQueryType p_QueryType); - bool _hasQueriesWaitingForAnswers(void) const; - bool _executeQueryCallback(const clsQuery& p_Query, - const clsQuery::clsAnswer& p_Answer, - clsQuery::clsAnswer::typeQueryAnswerType p_QueryAnswerTypeFlags, - bool p_SetContent); - - - // File: ..._Host_Control - // RECEIVING - bool _parseMessage(); - bool _parseQuery(netif* pNetIf, - const clsMsgHeader& p_Header); - - bool _parseResponse(netif* pNetIf, const clsMsgHeader& p_Header); - bool _processAnswers(netif* pNetIf, const clsRRAnswer* p_pPTRAnswers); - bool _processPTRAnswer(const clsRRAnswerPTR* p_pPTRAnswer, - bool& p_rbFoundNewKeyAnswer); - bool _processSRVAnswer(const clsRRAnswerSRV* p_pSRVAnswer, - bool& p_rbFoundNewKeyAnswer); - bool _processTXTAnswer(const clsRRAnswerTXT* p_pTXTAnswer); -#ifdef MDNS_IPV4_SUPPORT - bool _processAAnswer(const clsRRAnswerA* p_pAAnswer); -#endif -#ifdef MDNS2_IPV6_SUPPORT - bool _processAAAAAnswer(const clsRRAnswerAAAA* p_pAAAAAnswer); -#endif - - // PROBING - bool _updateProbeStatus(); - bool _resetProbeStatus(bool p_bRestart = true); - bool _hasProbesWaitingForAnswers(void) const; - bool _sendHostProbe(); - bool _sendServiceProbe(clsService& p_rService); - bool _cancelProbingForHost(void); - bool _cancelProbingForService(clsService& p_rService); - bool _callHostProbeResultCallback(bool p_bResult); - bool _callServiceProbeResultCallback(clsService& p_rService, - bool p_bResult); - - // ANNOUNCE - bool _announce(bool p_bAnnounce, - bool p_bIncludeServices); - bool _announceService(clsService& p_pService, - bool p_bAnnounce = true); - - // QUERY CACHE - bool _checkQueryCache(); - - uint32_t _replyMaskForHost(netif* pNetIf, - const clsRRHeader& p_RRHeader, - bool* p_pbFullNameMatch = 0) const; - uint32_t _replyMaskForService(const clsRRHeader& p_RRHeader, - clsService& p_rService, - bool* p_pbFullNameMatch = 0); - - - // File: ..._Host_Transfer - // SENDING - bool _sendMessage(netif* pNetIf, clsSendParameter& p_SendParameter); - bool _sendMessage(clsSendParameter& p_SendParameter); - bool _sendMessage_Multicast(netif* pNetIf, - clsSendParameter& p_rSendParameter, - uint8_t p_IPProtocolTypes); - bool _prepareMessage(netif* pNetIf, clsSendParameter& p_SendParameter); - bool _addQueryRecord(clsSendParameter& p_rSendParameter, - const clsRRDomain& p_QueryDomain, - uint16_t p_u16QueryType); - bool _sendQuery(const clsQuery& p_Query, - clsQuery::clsAnswer::list* p_pKnownAnswers = 0); - bool _sendQuery(const clsRRDomain& p_QueryDomain, - uint16_t p_u16RecordType, - clsQuery::clsAnswer::list* p_pKnownAnswers = 0); - - IPAddress _getResponderIPAddress(netif* pNetIf, - enuIPProtocolType p_IPProtocolType) const; - - // RESOURCE RECORD - bool _readRRQuestion(clsRRQuestion& p_rQuestion); - bool _readRRAnswer(clsRRAnswer*& p_rpAnswer); -#ifdef MDNS_IPV4_SUPPORT - bool _readRRAnswerA(clsRRAnswerA& p_rRRAnswerA, - uint16_t p_u16RDLength); -#endif - bool _readRRAnswerPTR(clsRRAnswerPTR& p_rRRAnswerPTR, - uint16_t p_u16RDLength); - bool _readRRAnswerTXT(clsRRAnswerTXT& p_rRRAnswerTXT, - uint16_t p_u16RDLength); -#ifdef MDNS2_IPV6_SUPPORT - bool _readRRAnswerAAAA(clsRRAnswerAAAA& p_rRRAnswerAAAA, - uint16_t p_u16RDLength); -#endif - bool _readRRAnswerSRV(clsRRAnswerSRV& p_rRRAnswerSRV, - uint16_t p_u16RDLength); - bool _readRRAnswerGeneric(clsRRAnswerGeneric& p_rRRAnswerGeneric, - uint16_t p_u16RDLength); - - bool _readRRHeader(clsRRHeader& p_rHeader); - bool _readRRDomain(clsRRDomain& p_rRRDomain); - bool _readRRDomain_Loop(clsRRDomain& p_rRRDomain, - uint8_t p_u8Depth); - bool _readRRAttributes(clsRRAttributes& p_rAttributes); - - // DOMAIN NAMES - bool _buildDomainForHost(const char* p_pcHostName, - clsRRDomain& p_rHostDomain) const; - bool _buildDomainForDNSSD(clsRRDomain& p_rDNSSDDomain) const; - bool _buildDomainForService(const clsService& p_Service, - bool p_bIncludeName, - clsRRDomain& p_rServiceDomain) const; - bool _buildDomainForService(const char* p_pcService, - const char* p_pcProtocol, - clsRRDomain& p_rServiceDomain) const; -#ifdef MDNS_IPV4_SUPPORT - bool _buildDomainForReverseIPv4(IPAddress p_IPv4Address, - clsRRDomain& p_rReverseIPv4Domain) const; -#endif -#ifdef MDNS2_IPV6_SUPPORT - bool _buildDomainForReverseIPv6(IPAddress p_IPv4Address, - clsRRDomain& p_rReverseIPv6Domain) const; -#endif - - // UDP - bool _udpReadBuffer(unsigned char* p_pBuffer, - size_t p_stLength); - bool _udpRead8(uint8_t& p_ru8Value); - bool _udpRead16(uint16_t& p_ru16Value); - bool _udpRead32(uint32_t& p_ru32Value); - - bool _udpAppendBuffer(const unsigned char* p_pcBuffer, - size_t p_stLength); - bool _udpAppend8(uint8_t p_u8Value); - bool _udpAppend16(uint16_t p_u16Value); - bool _udpAppend32(uint32_t p_u32Value); - -#if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER - bool _udpDump(bool p_bMovePointer = false); - bool _udpDump(unsigned p_uOffset, - unsigned p_uLength); -#endif - - // READ/WRITE MDNS STRUCTS - bool _readMDNSMsgHeader(clsMsgHeader& p_rMsgHeader); - - bool _write8(uint8_t p_u8Value, - clsSendParameter& p_rSendParameter); - bool _write16(uint16_t p_u16Value, - clsSendParameter& p_rSendParameter); - bool _write32(uint32_t p_u32Value, - clsSendParameter& p_rSendParameter); - - bool _writeMDNSMsgHeader(const clsMsgHeader& p_MsgHeader, - clsSendParameter& p_rSendParameter); - bool _writeMDNSRRAttributes(const clsRRAttributes& p_Attributes, - clsSendParameter& p_rSendParameter); - bool _writeMDNSRRDomain(const clsRRDomain& p_Domain, - clsSendParameter& p_rSendParameter); - bool _writeMDNSHostDomain(const char* m_pcHostName, - bool p_bPrependRDLength, - uint16_t p_u16AdditionalLength, - clsSendParameter& p_rSendParameter); - bool _writeMDNSServiceDomain(const clsService& p_Service, - bool p_bIncludeName, - bool p_bPrependRDLength, - uint16_t p_u16AdditionalLength, - clsSendParameter& p_rSendParameter); - - bool _writeMDNSQuestion(clsRRQuestion& p_Question, - clsSendParameter& p_rSendParameter); - -#ifdef MDNS_IPV4_SUPPORT - bool _writeMDNSAnswer_A(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter); - bool _writeMDNSAnswer_PTR_IPv4(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter); -#endif - bool _writeMDNSAnswer_PTR_TYPE(clsService& p_rService, - clsSendParameter& p_rSendParameter); - bool _writeMDNSAnswer_PTR_NAME(clsService& p_rService, - clsSendParameter& p_rSendParameter); - bool _writeMDNSAnswer_TXT(clsService& p_rService, - clsSendParameter& p_rSendParameter); -#ifdef MDNS2_IPV6_SUPPORT - bool _writeMDNSAnswer_AAAA(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter); - bool _writeMDNSAnswer_PTR_IPv6(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter); -#endif - bool _writeMDNSAnswer_SRV(clsService& p_rService, - clsSendParameter& p_rSendParameter); - clsNSECBitmap* _createNSECBitmap(uint32_t p_u32NSECContent); - bool _writeMDNSNSECBitmap(const clsNSECBitmap& p_NSECBitmap, - clsSendParameter& p_rSendParameter); - bool _writeMDNSAnswer_NSEC(uint32_t p_u32NSECContent, - clsSendParameter& p_rSendParameter); -#ifdef MDNS_IPV4_SUPPORT - bool _writeMDNSAnswer_NSEC_PTR_IPv4(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter); -#endif -#ifdef MDNS2_IPV6_SUPPORT - bool _writeMDNSAnswer_NSEC_PTR_IPv6(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter); -#endif - bool _writeMDNSAnswer_NSEC(clsService& p_rService, - uint32_t p_u32NSECContent, - clsSendParameter& p_rSendParameter); - - - // File: ..._Host_Debug -#if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_MDNS_RESPONDER - const char* _DH(const clsService* p_pMDNSService = 0) const; - const char* _service2String(const clsService* p_pMDNSService) const; - - bool _printRRDomain(const clsRRDomain& p_rRRDomain) const; - bool _printRRAnswer(const clsRRAnswer& p_RRAnswer) const; - const char* _RRType2Name(uint16_t p_u16RRType) const; - const char* _RRClass2String(uint16_t p_u16RRClass, - bool p_bIsQuery) const; - const char* _replyFlags2String(uint32_t p_u32ReplyFlags) const; - const char* _NSECBitmap2String(const clsNSECBitmap* p_pNSECBitmap) const; -#endif - - -protected: - UdpContext* m_pUDPContext; - - char* m_pcHostName; - char* m_pcDefaultInstanceName; - clsService::list m_Services; - clsQuery::list m_Queries; - clsProbeInformation m_ProbeInformation; -}; - - -} // namespace MDNSImplementation - - -} // namespace esp8266 - - -#endif // __LEAMDNS2HOST_H__ - - - diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS2Host_Control.cpp deleted file mode 100644 index 4325df7ba..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Control.cpp +++ /dev/null @@ -1,2219 +0,0 @@ -/* - LEAmDNS2Host_Control.cpp - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#include "ESP8266mDNS.h" -#include "LEAmDNS2Host.h" -#include "LEAmDNS2_Priv.h" - -namespace esp8266 -{ - - -namespace experimental -{ - - -/* - - RECEIVING - -*/ - -/* - clsLEAmDNS2_Host::_parseMessage - -*/ -bool clsLEAMDNSHost::_parseMessage() -{ - DEBUG_EX_INFO( - unsigned long ulStartTime = millis(); - unsigned uStartMemory = ESP.getFreeHeap(); - DEBUG_OUTPUT.printf_P(PSTR("%s _parseMessage (Time: %lu ms, heap: %u bytes, from %s, to %s)\n"), _DH(), ulStartTime, uStartMemory, - m_pUDPContext->getRemoteAddress().toString().c_str(), - m_pUDPContext->getDestAddress().toString().c_str()); - ); - //DEBUG_EX_INFO(_udpDump();); - netif* pNetIf = m_pUDPContext->getInputNetif(); - - bool bResult = false; - - clsMsgHeader header; - if (_readMDNSMsgHeader(header)) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"), - _DH(), - (unsigned)header.m_u16ID, - (unsigned)header.m_1bQR, (unsigned)header.m_4bOpcode, (unsigned)header.m_1bAA, (unsigned)header.m_1bTC, (unsigned)header.m_1bRD, - (unsigned)header.m_1bRA, (unsigned)header.m_4bRCode, - (unsigned)header.m_u16QDCount, - (unsigned)header.m_u16ANCount, - (unsigned)header.m_u16NSCount, - (unsigned)header.m_u16ARCount)); - if (0 == header.m_4bOpcode) - { - // A standard query - if (header.m_1bQR) - { - // Received a response -> answers to a query - //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseMessage: Reading answers: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), _DH(), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount);); - bResult = _parseResponse(pNetIf, header); - } - else - { - // Received a query (Questions) - //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseMessage: Reading query: ID:%u, Q:%u, A:%u, NS:%u, AR:%u\n"), _DH(), header.m_u16ID, header.m_u16QDCount, header.m_u16ANCount, header.m_u16NSCount, header.m_u16ARCount);); - bResult = _parseQuery(m_pUDPContext->getInputNetif(), header); - } - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseMessage: Received UNEXPECTED opcode:%u. Ignoring message!\n"), _DH(), header.m_4bOpcode);); - m_pUDPContext->flush(); - } - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseMessage: FAILED to read header\n"), _DH());); - m_pUDPContext->flush(); - } - DEBUG_EX_INFO( - unsigned uFreeHeap = ESP.getFreeHeap(); - DEBUG_OUTPUT.printf_P(PSTR("%s _parseMessage: Done (%s after %lu ms, ate %i bytes, remaining %u)\n\n"), _DH(), (bResult ? "Succeeded" : "FAILED"), (millis() - ulStartTime), (uStartMemory - uFreeHeap), uFreeHeap); - ); - return bResult; -} - -/* - clsLEAmDNS2_Host::_parseQuery - - Queries are of interest in two cases: - 1. allow for tiebreaking while probing in the case of a race condition between two instances probing for - the same name at the same time - 2. provide answers to questions for our host domain or any presented service - - When reading the questions, a set of (planned) responses is created, eg. a reverse PTR question for the host domain - gets an A (IP address) response, a PTR question for the _services._dns-sd domain gets a PTR (type) response for any - registered service, ... - - As any mDNS responder should be able to handle 'legacy' queries (from DNS clients), this case is handled here also. - Legacy queries have got only one (unicast) question and are directed to the local DNS port (not the multicast port). - -*/ -bool clsLEAMDNSHost::_parseQuery(netif* pNetIf, - const clsLEAMDNSHost::clsMsgHeader& p_MsgHeader) -{ - bool bResult = true; - - clsSendParameter sendParameter; - uint32_t u32HostOrServiceReplies = 0; - bool bHostOrServiceTiebreakNeeded = false; - for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd) - { - clsRRQuestion questionRR; - if ((bResult = _readRRQuestion(questionRR))) - { - // Define host replies, BUT only answer queries after probing is done - u32HostOrServiceReplies = - sendParameter.m_u32HostReplyMask |= ((probeStatus()) - ? _replyMaskForHost(pNetIf, questionRR.m_Header, 0) - : 0); - DEBUG_EX_INFO(if (u32HostOrServiceReplies) DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Host reply needed %s\n"), _DH(), _replyFlags2String(u32HostOrServiceReplies));); - - // Check tiebreak need for host domain - if (clsProbeInformation_Base::clsProbeInformation_Base::enuProbingStatus::InProgress == m_ProbeInformation.m_ProbingStatus) - { - bool bFullNameMatch = false; - if ((_replyMaskForHost(pNetIf, questionRR.m_Header, &bFullNameMatch)) && - (bFullNameMatch)) - { - // We're in 'probing' state and someone is asking for our host domain: this might be - // a race-condition: Two hosts with the same domain names try simutanously to probe their domains - // See: RFC 6762, 8.2 (Tiebraking) - // However, we're using a max. reduced approach for tiebreaking here: The higher IP-address wins! - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Possible race-condition for host domain detected while probing.\n"), _DH());); - - bHostOrServiceTiebreakNeeded = - m_ProbeInformation.m_bTiebreakNeeded = true; - } - } - - // Define service replies - for (clsService::list::iterator it = m_Services.begin(); ((bResult) && (it != m_Services.end())); it++) - { - clsService* pService = *it; - - // Define service replies, BUT only answer queries after probing is done - uint32_t u32ReplyMaskForQuestion = ((pService->probeStatus()) - ? _replyMaskForService(questionRR.m_Header, *pService, 0) - : 0); - u32HostOrServiceReplies |= (pService->m_u32ReplyMask |= u32ReplyMaskForQuestion); - DEBUG_EX_INFO(if (u32ReplyMaskForQuestion) DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Service reply needed: %s\n"), _DH(pService), _replyFlags2String(u32ReplyMaskForQuestion));); - - // Check tiebreak need for service domain - if (clsProbeInformation_Base::clsProbeInformation_Base::enuProbingStatus::InProgress == pService->m_ProbeInformation.m_ProbingStatus) - { - bool bFullNameMatch = false; - if ((_replyMaskForService(questionRR.m_Header, *pService, &bFullNameMatch)) && - (bFullNameMatch)) - { - // We're in 'probing' state and someone is asking for this service domain: this might be - // a race-condition: Two services with the same domain names try simutanously to probe their domains - // See: RFC 6762, 8.2 (Tiebraking) - // However, we're using a max. reduced approach for tiebreaking here: The 'higher' SRV host wins! - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Possible race-condition for service domain detected while probing.\n"), _DH(pService));); - - bHostOrServiceTiebreakNeeded = - pService->m_ProbeInformation.m_bTiebreakNeeded = true; - } - } - } - - // Handle unicast and legacy specialities - // If only one question asks for unicast reply, the whole reply packet is send unicast - if (((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) || // Unicast (maybe legacy) query OR - (questionRR.m_bUnicast)) && // Expressivly unicast query - (!sendParameter.m_bUnicast)) - { - sendParameter.m_bUnicast = true; - //sendParameter.m_bCacheFlush = false; - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Unicast response asked for %s!\n"), _DH(), m_pUDPContext->getRemoteAddress().toString().c_str());); - //Serial.printf_P(PSTR("%s _parseQuery: Ignored Unicast response asked for by %s!\n"), _DH(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str()); - - if ((DNS_MQUERY_PORT != m_pUDPContext->getRemotePort()) && // Unicast (maybe legacy) query AND - (1 == p_MsgHeader.m_u16QDCount) && // Only one question AND - ((sendParameter.m_u32HostReplyMask) || // Host replies OR - (u32HostOrServiceReplies))) // Host or service replies available - { - // Local host check - // We're a match for this legacy query, BUT - // make sure, that the query comes from a local host - if ((m_pUDPContext) && -#ifdef MDNS_IPV4_SUPPORT - (m_pUDPContext->getRemoteAddress().isV4()) && - (ip4_addr_netcmp(ip_2_ip4((const ip_addr_t*)m_pUDPContext->getRemoteAddress()), - ip_2_ip4(&m_pUDPContext->getInputNetif()->ip_addr), - ip_2_ip4(&m_pUDPContext->getInputNetif()->netmask))) -#else - (true) -#endif - && -#ifdef MDNS2_IPV6_SUPPORT - (m_pUDPContext->getRemoteAddress().isV6()) && - (ip6_addr_islinklocal(ip_2_ip6((const ip_addr_t*)m_pUDPContext->getRemoteAddress()))) -#else - (true) -#endif - ) - { - DEBUG_EX_RX(DEBUG_OUTPUT.println("\n\n\nUNICAST QUERY\n\n")); - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Legacy DNS query from local host %s!\n"), _DH(), m_pUDPContext->getRemoteAddress().toString().c_str());); - - sendParameter.m_u16ID = p_MsgHeader.m_u16ID; - sendParameter.m_bLegacyDNSQuery = true; - sendParameter.m_bCacheFlush = false; - clsRRQuestion* pNewRRQuestion = new clsRRQuestion; - if (pNewRRQuestion) - { - pNewRRQuestion->m_Header.m_Domain = questionRR.m_Header.m_Domain; - pNewRRQuestion->m_Header.m_Attributes.m_u16Type = questionRR.m_Header.m_Attributes.m_u16Type; - pNewRRQuestion->m_Header.m_Attributes.m_u16Class = questionRR.m_Header.m_Attributes.m_u16Class; - - sendParameter.m_RRQuestions.push_back(pNewRRQuestion); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: FAILED to add legacy DNS question!\n"), _DH());); - } - } - else - { - DEBUG_EX_RX(DEBUG_OUTPUT.printf("\n\n\nINVALID UNICAST QUERY from %s\n\n\n", m_pUDPContext->getRemoteAddress().toString().c_str())); - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Legacy DNS query from NON-LOCAL host at %s!\n"), _DH(), m_pUDPContext->getRemoteAddress().toString().c_str());); - bResult = false; - } - } - } - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: FAILED to read question!\n"), _DH());); - } - } // for questions - - //DEBUG_EX_INFO(if (u8HostOrServiceReplies) DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Reply needed: %u (%s: %s->%s)\n"), _DH(), u8HostOrServiceReplies, clsTimeSyncer::timestr(), IPAddress(m_pUDPContext->getRemoteAddress()).toString().c_str(), IPAddress(m_pUDPContext->getDestAddress()).toString().c_str());); - //bHostOrServiceTiebreakNeeded = false; - - // Handle known answers - uint32_t u32Answers = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount); - if (((u32HostOrServiceReplies) || - (bHostOrServiceTiebreakNeeded)) && - (u32Answers)) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Reading known answers(%u):\n"), _DH(), u32Answers);); - - for (uint32_t an = 0; ((bResult) && (an < u32Answers)); ++an) - { - clsRRAnswer* pKnownRRAnswer = 0; - if (((bResult = _readRRAnswer(pKnownRRAnswer))) && - (pKnownRRAnswer)) - { - if ((DNS_RRTYPE_ANY != pKnownRRAnswer->m_Header.m_Attributes.m_u16Type) && // No ANY type answer - (DNS_RRCLASS_ANY != (pKnownRRAnswer->m_Header.m_Attributes.m_u16Class & (~0x8000)))) // No ANY class answer - { - /* - RFC6762 7.1 Suppression only for 'Shared Records' - - // Find match between planned answer (sendParameter.m_u8HostReplyMask) and this 'known answer' - uint32_t u32HostMatchMask = (sendParameter.m_u32HostReplyMask & _replyMaskForHost(pNetIf, pKnownRRAnswer->m_Header)); - if ((u32HostMatchMask) && // The RR in the known answer matches an RR we are planning to send, AND - ((Consts::u32HostTTL / 2) <= pKnownRRAnswer->m_u32TTL)) // The TTL of the known answer is longer than half of the new host TTL (120s) - { - - // Compare contents - if (enuAnswerType::PTR == pKnownRRAnswer->answerType()) - { - stcRRDomain hostDomain; - if ((_buildDomainForHost(m_pcHostName, hostDomain)) && - (((stcRRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain == hostDomain)) - { - // Host domain match - #ifdef MDNS_IPV4_SUPPORT - if (u32HostMatchMask & static_cast(enuContentFlag::PTR_IPv4)) - { - // IPv4 PTR was asked for, but is already known -> skipping - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: IPv4 PTR already known (TTL:%u)... skipping!\n"), _DH(), pKnownRRAnswer->m_u32TTL);); - sendParameter.m_u32HostReplyMask &= ~static_cast(enuContentFlag::PTR_IPv4); - } - #endif - #ifdef MDNS2_IPV6_SUPPORT - if (u32HostMatchMask & static_cast(enuContentFlag::PTR_IPv6)) - { - // IPv6 PTR was asked for, but is already known -> skipping - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: IPv6 PTR already known (TTL:%u)... skipping!\n"), _DH(), pKnownRRAnswer->m_u32TTL);); - sendParameter.m_u32HostReplyMask &= ~static_cast(enuContentFlag::PTR_IPv6); - } - #endif - } - } - else if (u32HostMatchMask & static_cast(enuContentFlag::A)) - { - // IPv4 address was asked for - #ifdef MDNS_IPV4_SUPPORT - if ((enuAnswerType::A == pKnownRRAnswer->answerType()) && - (((stcRRAnswerA*)pKnownRRAnswer)->m_IPAddress == _getResponderIPAddress(pNetIf, enuIPProtocolType::V4))) - { - - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: IPv4 address already known (TTL:%u)... skipping!\n"), _DH(), pKnownRRAnswer->m_u32TTL);); - sendParameter.m_u32HostReplyMask &= ~static_cast(enuContentFlag::A); - } // else: RData NOT IPv4 length !! - #endif - } - else if (u32HostMatchMask & static_cast(enuContentFlag::AAAA)) - { - // IPv6 address was asked for - #ifdef MDNS2_IPV6_SUPPORT - if ((enuAnswerType::AAAA == pKnownRRAnswer->answerType()) && - (((stcRRAnswerAAAA*)pKnownRRAnswer)->m_IPAddress == _getResponderIPAddress(pNetIf, enuIPProtocolType::V6))) - { - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: IPv6 address already known... skipping!\n"), _DH());); - sendParameter.m_u32HostReplyMask &= ~static_cast(enuContentFlag::AAAA); - } // else: RData NOT IPv6 length !! - #endif - } - } // Host match and TTL - */ - - // - // Check host tiebreak possibility - if (m_ProbeInformation.m_bTiebreakNeeded) - { - clsRRDomain hostDomain; - if ((_buildDomainForHost(m_pcHostName, hostDomain)) && - (pKnownRRAnswer->m_Header.m_Domain == hostDomain)) - { - // Host domain match -#ifdef MDNS_IPV4_SUPPORT - if (enuAnswerType::A == pKnownRRAnswer->answerType()) - { - // CHECK - IPAddress localIPAddress(_getResponderIPAddress(pNetIf, enuIPProtocolType::V4)); - if (((clsRRAnswerA*)pKnownRRAnswer)->m_IPAddress == localIPAddress) - { - // SAME IP address -> We've received an old message from ourselfs (same IP) - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (IPv4) WON (was an old message)!\n"), _DH());); - m_ProbeInformation.m_bTiebreakNeeded = false; - } - else - { - if ((uint32_t)(((clsRRAnswerA*)pKnownRRAnswer)->m_IPAddress) > (uint32_t)localIPAddress) // The OTHER IP is 'higher' -> LOST - { - // LOST tiebreak - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (IPv4) LOST (lower IPv4)!\n"), _DH());); - _cancelProbingForHost(); - m_ProbeInformation.m_bTiebreakNeeded = false; - } - else - { - // WON tiebreak - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (IPv4) WON (higher IPv4)!\n"), _DH());); - m_ProbeInformation.m_bTiebreakNeeded = false; - } - } - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - if (enuAnswerType::AAAA == pKnownRRAnswer->answerType()) - { - IPAddress localIPAddress(_getResponderIPAddress(pNetIf, enuIPProtocolType::V6)); - if (((clsRRAnswerAAAA*)pKnownRRAnswer)->m_IPAddress == localIPAddress) - { - // SAME IP address -> We've received an old message from ourselfs (same IP) - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (IPv6) WON (was an old message)!\n"), _DH());); - m_ProbeInformation.m_bTiebreakNeeded = false; - } - else - { - // memcmp delivers >0 (positive) if the first non-matching byte in A is higher than in B - if (0 < memcmp((((clsRRAnswerAAAA*)pKnownRRAnswer)->m_IPAddress).raw6(), localIPAddress.raw6(), clsConsts::u16IPv6Size)) // The OTHER IP is 'higher' -> LOST - { - // LOST tiebreak - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (IPv6) LOST (lower IPv6)!\n"), _DH());); - _cancelProbingForHost(); - m_ProbeInformation.m_bTiebreakNeeded = false; - } - else - { - // WON tiebreak - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (IPv6) WON (higher IPv6)!\n"), _DH());); - m_ProbeInformation.m_bTiebreakNeeded = false; - } - } - } -#endif - } - } // Host tiebreak possibility - - // Check service answers - for (clsService::list::iterator it = m_Services.begin(); ((bResult) && (it != m_Services.end())); it++) - { - clsService* pService = *it; - - uint32_t u32ServiceMatchMask = (pService->m_u32ReplyMask & _replyMaskForService(pKnownRRAnswer->m_Header, *pService)); - - if ((u32ServiceMatchMask) && // The RR in the known answer matches an RR we are planning to send, AND - ((clsConsts::u32ServiceTTL / 2) <= pKnownRRAnswer->m_u32TTL)) // The TTL of the known answer is longer than half of the new service TTL (4500s) - { - if (enuAnswerType::PTR == pKnownRRAnswer->answerType()) - { - clsRRDomain serviceDomain; - if ((u32ServiceMatchMask & static_cast(enuContentFlag::PTR_TYPE)) && - (_buildDomainForService(*pService, false, serviceDomain)) && - (serviceDomain == ((clsRRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain)) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Service type PTR already known (TTL:%u)... skipping!\n"), _DH(pService), pKnownRRAnswer->m_u32TTL);); - pService->m_u32ReplyMask &= ~static_cast(enuContentFlag::PTR_TYPE); - } - if ((u32ServiceMatchMask & static_cast(enuContentFlag::PTR_NAME)) && - (_buildDomainForService(*pService, true, serviceDomain)) && - (serviceDomain == ((clsRRAnswerPTR*)pKnownRRAnswer)->m_PTRDomain)) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Service name PTR already known (TTL:%u)... skipping!\n"), _DH(pService), pKnownRRAnswer->m_u32TTL);); - pService->m_u32ReplyMask &= ~static_cast(enuContentFlag::PTR_NAME); - } - } - /* - RFC6762 7.1 Suppression only for 'Shared Records' - else if (u32ServiceMatchMask & static_cast(enuContentFlag::SRV)) - { - DEBUG_EX_ERR(if (enuAnswerType::SRV != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: ERROR! INVALID answer type (SRV)!\n"), _DH(pService));); - stcRRDomain hostDomain; - if ((_buildDomainForHost(m_pcHostName, hostDomain)) && - (hostDomain == ((stcRRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain)) // Host domain match - { - - if ((Consts::u16SRVPriority == ((stcRRAnswerSRV*)pKnownRRAnswer)->m_u16Priority) && - (Consts::u16SRVWeight == ((stcRRAnswerSRV*)pKnownRRAnswer)->m_u16Weight) && - (pService->m_u16Port == ((stcRRAnswerSRV*)pKnownRRAnswer)->m_u16Port)) - { - - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Service SRV answer already known (TTL:%u)... skipping!\n"), _DH(pService), pKnownRRAnswer->m_u32TTL);); - pService->m_u32ReplyMask &= ~static_cast(enuContentFlag::SRV); - } // else: Small differences -> send update message - } - }*/ - /* - RFC6762 7.1 Suppression only for 'Shared Records' - else if (u32ServiceMatchMask & static_cast(enuContentFlag::TXT)) - { - DEBUG_EX_ERR(if (enuAnswerType::TXT != pKnownRRAnswer->answerType()) DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: ERROR! INVALID answer type (TXT)!\n"), _DH(pService));); - _collectServiceTxts(*pService); - if (pService->m_Txts == ((stcRRAnswerTXT*)pKnownRRAnswer)->m_Txts) - { - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Service TXT answer already known (TTL:%u)... skipping!\n"), _DH(pService), pKnownRRAnswer->m_u32TTL);); - pService->m_u32ReplyMask &= ~static_cast(enuContentFlag::TXT); - } - _releaseTempServiceTxts(*pService); - }*/ - } // Service match and enough TTL - - // - // Check service tiebreak possibility - if (pService->m_ProbeInformation.m_bTiebreakNeeded) - { - clsRRDomain serviceDomain; - if ((_buildDomainForService(*pService, true, serviceDomain)) && - (pKnownRRAnswer->m_Header.m_Domain == serviceDomain)) - { - // Service domain match - if (enuAnswerType::SRV == pKnownRRAnswer->answerType()) - { - clsRRDomain hostDomain; - if ((_buildDomainForHost(m_pcHostName, hostDomain)) && - (hostDomain == ((clsRRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain)) // Host domain match - { - // We've received an old message from ourselfs (same SRV) - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (SRV) won (was an old message)!\n"), _DH(pService));); - pService->m_ProbeInformation.m_bTiebreakNeeded = false; - } - else - { - if (((clsRRAnswerSRV*)pKnownRRAnswer)->m_SRVDomain > hostDomain) // The OTHER domain is 'higher' -> LOST - { - // LOST tiebreak - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (SRV) LOST (lower)!\n"), _DH(pService));); - _cancelProbingForService(*pService); - pService->m_ProbeInformation.m_bTiebreakNeeded = false; - } - else - { - // WON tiebreak - DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Tiebreak (SRV) won (higher)!\n"), _DH(pService));); - pService->m_ProbeInformation.m_bTiebreakNeeded = false; - } - } - } - } - } // service tiebreak possibility - } // for services - } // ANY answers - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: FAILED to read known answer!\n"), _DH());); - } - - if (pKnownRRAnswer) - { - delete pKnownRRAnswer; - pKnownRRAnswer = 0; - } - } // for answers - } - else - { - DEBUG_EX_INFO(if (u32Answers) DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Skipped %u known answers!\n"), _DH(), u32Answers);); - m_pUDPContext->flush(); - } - - if (bResult) - { - // Check, if a reply is needed - uint32_t u32ReplyNeeded = sendParameter.m_u32HostReplyMask; - for (const clsService* pService : m_Services) - { - u32ReplyNeeded |= pService->m_u32ReplyMask; - } - - if (u32ReplyNeeded) - { - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Sending %s answer(%s)...\n"), _DH(), (sendParameter.m_bUnicast ? "UC" : "MC"), _replyFlags2String(u32ReplyNeeded));); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Sending %s answer(%s)...\n"), _DH(), (sendParameter.m_bUnicast ? "UC" : "MC"), _replyFlags2String(u32ReplyNeeded));); - - sendParameter.m_Response = clsSendParameter::enuResponseType::Response; - sendParameter.m_bAuthorative = true; - - bResult = _sendMessage(pNetIf, sendParameter); - } - DEBUG_EX_INFO(else - { - DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: No reply needed\n"), _DH()); - }); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: Something FAILED!\n"), _DH());); - m_pUDPContext->flush(); - } - - // - // Check and reset tiebreak-states - if (m_ProbeInformation.m_bTiebreakNeeded) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: UNSOLVED tiebreak-need for host domain!\n"), _DH());); - m_ProbeInformation.m_bTiebreakNeeded = false; - } - for (clsService* pService : m_Services) - { - if (pService->m_ProbeInformation.m_bTiebreakNeeded) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: UNSOLVED tiebreak-need for service domain '%s')\n"), _DH(), _service2String(pService));); - pService->m_ProbeInformation.m_bTiebreakNeeded = false; - } - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _parseQuery: FAILED!\n"), _DH());); - return bResult; -} - -/* - clsLEAmDNS2_Host::_parseResponse - - Responses are of interest in two cases: - 1. find domain name conflicts while probing - 2. get answers to service queries - - In both cases any included questions are ignored - - 1. If any answer has a domain name similar to one of the domain names we're planning to use (and are probing for), - then we've got a 'probing conflict'. The conflict has to be solved on our side of the conflict (eg. by - setting a new hostname and restart probing). The callback 'm_fnProbeResultCallback' is called with - 'p_bProbeResult=false' in this case. - - 2. Service queries like '_http._tcp.local' will (if available) produce PTR, SRV, TXT and A/AAAA answers. - All stored answers are pivoted by the service instance name (from the PTR record). Other answer parts, - like host domain or IP address are than attached to this element. - Any answer part carries a TTL, this is also stored (incl. the reception time); if the TTL is '0' the - answer (part) is withdrawn by the sender and should be removed from any cache. RFC 6762, 10.1 proposes to - set the caches TTL-value to 1 second in such a case and to delete the item only, if no update has - has taken place in this second. - Answer parts may arrive in 'unsorted' order, so they are grouped into three levels: - Level 1: PRT - names the service instance (and is used as pivot), voids all other parts if is withdrawn or outdates - Level 2: SRV - links the instance name to a host domain and port, voids A/AAAA parts if is withdrawn or outdates - TXT - links the instance name to services TXTs - Level 3: A/AAAA - links the host domain to an IP address -*/ -bool clsLEAMDNSHost::_parseResponse(netif* pNetIf, const clsLEAMDNSHost::clsMsgHeader& p_MsgHeader) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse\n"));); - //DEBUG_EX_INFO(_udpDump();); - - bool bResult = false; - - // A response should be the result of a query or a probe - if ((_hasQueriesWaitingForAnswers()) || // Waiting for query answers OR - (_hasProbesWaitingForAnswers())) // Probe responses - { - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: Received a response\n"), _DH()); - //_udpDump(); - ); - - bResult = true; - // - // Ignore questions here - clsRRQuestion dummyRRQ; - for (uint16_t qd = 0; ((bResult) && (qd < p_MsgHeader.m_u16QDCount)); ++qd) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: Received a response containing a question... ignoring!\n"), _DH());); - bResult = _readRRQuestion(dummyRRQ); - } // for queries - - // - // Read and collect answers - clsRRAnswer* pCollectedRRAnswers = 0; - uint32_t u32NumberOfAnswerRRs = (p_MsgHeader.m_u16ANCount + p_MsgHeader.m_u16NSCount + p_MsgHeader.m_u16ARCount); - for (uint32_t an = 0; ((bResult) && (an < u32NumberOfAnswerRRs)); ++an) - { - clsRRAnswer* pRRAnswer = 0; - if (((bResult = _readRRAnswer(pRRAnswer))) && - (pRRAnswer)) - { - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: ADDING answer!\n"));); - pRRAnswer->m_pNext = pCollectedRRAnswers; - pCollectedRRAnswers = pRRAnswer; - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: FAILED to read answer!\n"), _DH());); - if (pRRAnswer) - { - delete pRRAnswer; - pRRAnswer = 0; - } - bResult = false; - } - } // for answers - - // - // Process answers - if (bResult) - { - bResult = ((!pCollectedRRAnswers) || - (_processAnswers(pNetIf, pCollectedRRAnswers))); - } - else // Some failure while reading answers - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: FAILED to read answers!\n"), _DH());); - m_pUDPContext->flush(); - } - - // Delete collected answers - while (pCollectedRRAnswers) - { - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: DELETING answer!\n"), _DH());); - clsRRAnswer* pNextAnswer = pCollectedRRAnswers->m_pNext; - delete pCollectedRRAnswers; - pCollectedRRAnswers = pNextAnswer; - } - } - else // Received an unexpected response -> ignore - { - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: Received an unexpected response... ignoring!\n"), _DH()); - /* - DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: Received an unexpected response... ignoring!\nDUMP:\n"), _DH()); - bool bDumpResult = true; - for (uint16_t qd=0; ((bDumpResult) && (qdflush(); - bResult = true; - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _parseResponse: FAILED!\n"), _DH());); - return bResult; -} - -/* - clsLEAmDNS2_Host::_processAnswers - Host: - A (0x01): eg. esp8266.local A OP TTL 123.456.789.012 - AAAA (01Cx): eg. esp8266.local AAAA OP TTL 1234:5678::90 - PTR (0x0C, IPv4): eg. 012.789.456.123.in-addr.arpa PTR OP TTL esp8266.local - PTR (0x0C, IPv6): eg. 90.0.0.0.0.0.0.0.0.0.0.0.78.56.34.12.ip6.arpa PTR OP TTL esp8266.local - Service: - PTR (0x0C, srv name): eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local - PTR (0x0C, srv type): eg. _services._dns-sd._udp.local PTR OP TTL _http._tcp.local - SRV (0x21): eg. MyESP._http._tcp.local SRV OP TTL PRIORITY WEIGHT PORT esp8266.local - TXT (0x10): eg. MyESP._http._tcp.local TXT OP TTL c#=1 - -*/ -bool clsLEAMDNSHost::_processAnswers(netif* pNetIf, const clsLEAMDNSHost::clsRRAnswer* p_pAnswers) -{ - bool bResult = false; - - if (p_pAnswers) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processAnswers: Processing answers...\n"), _DH());); - bResult = true; - - // Answers may arrive in an unexpected order. So we loop our answers as long, as we - // can connect new information to service queries - bool bFoundNewKeyAnswer; - do - { - bFoundNewKeyAnswer = false; - - const clsRRAnswer* pRRAnswer = p_pAnswers; - while ((pRRAnswer) && - (bResult)) - { - // 1. level answer (PTR) - if (enuAnswerType::PTR == pRRAnswer->answerType()) - { - // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local - bResult = _processPTRAnswer((clsRRAnswerPTR*)pRRAnswer, bFoundNewKeyAnswer); // May 'enable' new SRV or TXT answers to be linked to queries - } - // 2. level answers - // SRV -> host domain and port - else if (enuAnswerType::SRV == pRRAnswer->answerType()) - { - // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local - bResult = _processSRVAnswer((clsRRAnswerSRV*)pRRAnswer, bFoundNewKeyAnswer); // May 'enable' new A/AAAA answers to be linked to queries - } - // TXT -> Txts - else if (enuAnswerType::TXT == pRRAnswer->answerType()) - { - // eg. MyESP_http._tcp.local TXT xxxx xx c#=1 - bResult = _processTXTAnswer((clsRRAnswerTXT*)pRRAnswer); - } - // 3. level answers -#ifdef MDNS_IPV4_SUPPORT - // A -> IPv4Address - else if (enuAnswerType::A == pRRAnswer->answerType()) - { - // eg. esp8266.local A xxxx xx 192.168.2.120 - bResult = _processAAnswer((clsRRAnswerA*)pRRAnswer); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - // AAAA -> IPv6Address - else if (enuAnswerType::AAAA == pRRAnswer->answerType()) - { - // eg. esp8266.local AAAA xxxx xx 09cf::0c - bResult = _processAAAAAnswer((clsRRAnswerAAAA*)pRRAnswer); - } -#endif - - // Finally check for probing conflicts - // Host domain - if ((clsProbeInformation_Base::enuProbingStatus::InProgress == m_ProbeInformation.m_ProbingStatus) && - ((enuAnswerType::A == pRRAnswer->answerType()) || - (enuAnswerType::AAAA == pRRAnswer->answerType()))) - { - clsRRDomain hostDomain; - if ((_buildDomainForHost(m_pcHostName, hostDomain)) && - (pRRAnswer->m_Header.m_Domain == hostDomain)) - { - bool bPossibleEcho = false; -#ifdef MDNS_IPV4_SUPPORT - if ((enuAnswerType::A == pRRAnswer->answerType()) && - (((clsRRAnswerA*)pRRAnswer)->m_IPAddress == _getResponderIPAddress(pNetIf, enuIPProtocolType::V4))) - { - bPossibleEcho = true; - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - if ((enuAnswerType::AAAA == pRRAnswer->answerType()) && - (((clsRRAnswerAAAA*)pRRAnswer)->m_IPAddress == _getResponderIPAddress(pNetIf, enuIPProtocolType::V6))) - { - bPossibleEcho = true; - } -#endif - if (!bPossibleEcho) - { - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _processAnswers: Probing CONFLICT found with '%s.local'\n"), _DH(), m_pcHostName);); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processAnswers: Probing CONFLICT found with '%s.local'\n"), _DH(), m_pcHostName);); - _cancelProbingForHost(); - } - else - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processAnswers: Ignoring CONFLICT found with '%s.local' as echo!\n"), _DH(), m_pcHostName);); - } - } - } - // Service domains - for (clsService* pService : m_Services) - { - if ((clsProbeInformation_Base::enuProbingStatus::InProgress == pService->m_ProbeInformation.m_ProbingStatus) && - ((enuAnswerType::TXT == pRRAnswer->answerType()) || - (enuAnswerType::SRV == pRRAnswer->answerType()))) - { - clsRRDomain serviceDomain; - if ((_buildDomainForService(*pService, true, serviceDomain)) && - (pRRAnswer->m_Header.m_Domain == serviceDomain)) - { - // TODO: Echo management needed? - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _processAnswers: Probing CONFLICT found with '%s'\n"), _DH(), _service2String(pService));); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processAnswers: Probing CONFLICT found with '%s'\n"), _DH(), _service2String(pService));); - _cancelProbingForService(*pService); - } - } - } - - pRRAnswer = pRRAnswer->m_pNext; // Next collected answer - } // while (answers) - } while ((bFoundNewKeyAnswer) && - (bResult)); - } // else: No answers provided - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _processAnswers: FAILED!\n"), _DH());); - return bResult; -} - -/* - clsLEAmDNS2_Host::_processPTRAnswer (level 1) -*/ -bool clsLEAMDNSHost::_processPTRAnswer(const clsLEAMDNSHost::clsRRAnswerPTR* p_pPTRAnswer, - bool& p_rbFoundNewKeyAnswer) -{ - bool bResult = false; - - if ((bResult = (0 != p_pPTRAnswer))) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processPTRAnswer: Processing PTR answers...\n"), _DH());); - // eg. _http._tcp.local PTR xxxx xx MyESP._http._tcp.local - // Check pending service queries for eg. '_http._tcp' - - clsQuery* pQuery = _findNextQueryByDomain(p_pPTRAnswer->m_Header.m_Domain, clsQuery::enuQueryType::Service, 0); - while (pQuery) - { - if (pQuery->m_bAwaitingAnswers) - { - // Find answer for service domain (eg. MyESP._http._tcp.local) - clsQuery::clsAnswer* pSQAnswer = pQuery->findAnswerForServiceDomain(p_pPTRAnswer->m_PTRDomain); - if (pSQAnswer) - { - // existing answer - if (p_pPTRAnswer->m_u32TTL) - { - // Received update message - pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL); // Update TTL tag - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processPTRAnswer: Updated TTL(%lu) for "), _DH(), p_pPTRAnswer->m_u32TTL); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR("\n")); - ); - } - else - { - // received goodbye-message - pSQAnswer->m_TTLServiceDomain.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1 - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processPTRAnswer: 'Goodbye' received for "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR("\n")); - ); - } - } - else if ((p_pPTRAnswer->m_u32TTL) && // Not just a goodbye-message - ((pSQAnswer = new clsQuery::clsAnswer))) // Not yet included -> add answer - { - pSQAnswer->m_ServiceDomain = p_pPTRAnswer->m_PTRDomain; - pSQAnswer->m_QueryAnswerFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::ServiceDomain); - pSQAnswer->m_TTLServiceDomain.set(p_pPTRAnswer->m_u32TTL); - //pSQAnswer->releaseServiceDomain(); - - bResult = pQuery->addAnswer(pSQAnswer); - - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processPTRAnswer: Added service domain to answer: "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.println(); - ); - - p_rbFoundNewKeyAnswer = true; - _executeQueryCallback(*pQuery, *pSQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::ServiceDomain), true); - } - } - pQuery = _findNextQueryByDomain(p_pPTRAnswer->m_Header.m_Domain, clsQuery::enuQueryType::Service, pQuery); - } - } // else: No p_pPTRAnswer - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _processPTRAnswer: FAILED!\n"), _DH());); - return bResult; -} - -/* - clsLEAmDNS2_Host::_processSRVAnswer (level 2) -*/ -bool clsLEAMDNSHost::_processSRVAnswer(const clsLEAMDNSHost::clsRRAnswerSRV* p_pSRVAnswer, - bool& p_rbFoundNewKeyAnswer) -{ - bool bResult = false; - - if ((bResult = (0 != p_pSRVAnswer))) - { - // eg. MyESP._http._tcp.local SRV xxxx xx yy zz 5000 esp8266.local - for (clsQuery::list::iterator it = m_Queries.begin(); ((bResult) && (it != m_Queries.end())); it++) - { - clsQuery* pQuery = *it; - - if (pQuery->m_bAwaitingAnswers) - { - clsQuery::clsAnswer* pSQAnswer = pQuery->findAnswerForServiceDomain(p_pSRVAnswer->m_Header.m_Domain); - if (pSQAnswer) - { - // Answer for this service domain (eg. MyESP._http._tcp.local) available - if (p_pSRVAnswer->m_u32TTL) - { - // First or update message (TTL != 0) - pSQAnswer->m_TTLHostDomainAndPort.set(p_pSRVAnswer->m_u32TTL); // Update TTL tag - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processSRVAnswer: Updated TTL(%lu) for "), _DH(), p_pSRVAnswer->m_u32TTL); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")); - ); - // Host domain & Port - if ((pSQAnswer->m_HostDomain != p_pSRVAnswer->m_SRVDomain) || - (pSQAnswer->m_u16Port != p_pSRVAnswer->m_u16Port)) - { - - pSQAnswer->m_HostDomain = p_pSRVAnswer->m_SRVDomain; - //pSQAnswer->releaseHostDomain(); - pSQAnswer->m_u16Port = p_pSRVAnswer->m_u16Port; - pSQAnswer->m_QueryAnswerFlags |= (static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain) | static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Port)); - - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processSVRAnswer: Added host domain and port to "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(": ")); - _printRRDomain(pSQAnswer->m_HostDomain); - DEBUG_OUTPUT.printf_P(PSTR(": %u\n"), pSQAnswer->m_u16Port); - ); - - p_rbFoundNewKeyAnswer = true; - _executeQueryCallback(*pQuery, *pSQAnswer, (static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain) | static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Port)), true); - } - } - else - { - // Goodby message - pSQAnswer->m_TTLHostDomainAndPort.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1 - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processSRVAnswer: 'Goodbye' received for "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")); - ); - } - } - } // m_bAwaitingAnswers - } // for(queries) - } // else: No p_pSRVAnswer - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _processSRVAnswer: FAILED!\n"), _DH());); - return bResult; -} - -/* - clsLEAmDNS2_Host::_processTXTAnswer (level 2) -*/ -bool clsLEAMDNSHost::_processTXTAnswer(const clsLEAMDNSHost::clsRRAnswerTXT* p_pTXTAnswer) -{ - bool bResult = false; - - if ((bResult = (0 != p_pTXTAnswer))) - { - // eg. MyESP._http._tcp.local TXT xxxx xx c#=1 - for (clsQuery::list::iterator it = m_Queries.begin(); ((bResult) && (it != m_Queries.end())); it++) - { - clsQuery* pQuery = *it; - - if (pQuery->m_bAwaitingAnswers) - { - clsQuery::clsAnswer* pSQAnswer = pQuery->findAnswerForServiceDomain(p_pTXTAnswer->m_Header.m_Domain); - if (pSQAnswer) - { - // Answer for this service domain (eg. MyESP._http._tcp.local) available - if (p_pTXTAnswer->m_u32TTL) - { - // First or update message - pSQAnswer->m_TTLTxts.set(p_pTXTAnswer->m_u32TTL); // Update TTL tag - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processTXTAnswer: Updated TTL(%lu) for "), _DH(), p_pTXTAnswer->m_u32TTL); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")); - ); - if (!pSQAnswer->m_Txts.compare(p_pTXTAnswer->m_Txts)) - { - pSQAnswer->m_Txts = p_pTXTAnswer->m_Txts; - pSQAnswer->m_QueryAnswerFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Txts); - //pSQAnswer->releaseTxts(); - - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processTXTAnswer: Added TXT to "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.println(); - ); - - _executeQueryCallback(*pQuery, *pSQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Txts), true); - } - } - else - { - // Goodby message - pSQAnswer->m_TTLTxts.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1 - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processTXTAnswer: 'Goodbye' received for "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")); - ); - } - } - } // m_bAwaitingAnswers - } // for(queries) - } // else: No p_pTXTAnswer - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _processTXTAnswer: FAILED!\n"), _DH());); - return bResult; -} - -#ifdef MDNS_IPV4_SUPPORT -/* - clsLEAmDNS2_Host::_processAAnswer (level 3) -*/ -bool clsLEAMDNSHost::_processAAnswer(const clsLEAMDNSHost::clsRRAnswerA* p_pAAnswer) -{ - bool bResult = false; - - if ((bResult = (0 != p_pAAnswer))) - { - // eg. esp8266.local A xxxx xx 192.168.2.120 - for (clsQuery::list::iterator it = m_Queries.begin(); ((bResult) && (it != m_Queries.end())); it++) - { - clsQuery* pQuery = *it; - - if (pQuery->m_bAwaitingAnswers) - { - // Look for answers to host queries - if ((p_pAAnswer->m_u32TTL) && // NOT just a goodbye message - (clsQuery::enuQueryType::Host == pQuery->m_QueryType) && // AND a host query - (pQuery->m_Domain == p_pAAnswer->m_Header.m_Domain)) // AND a matching host domain - { - clsQuery::clsAnswer* pSQAnswer = pQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain); - if ((!pSQAnswer) && - ((pSQAnswer = new clsQuery::clsAnswer))) - { - // Add not yet included answer - pSQAnswer->m_HostDomain = p_pAAnswer->m_Header.m_Domain; - //pSQAnswer->releaseHostDomain(); - - bResult = pQuery->addAnswer(pSQAnswer); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAnswer: Added host query answer for "), _DH()); - _printRRDomain(pQuery->m_Domain); - DEBUG_OUTPUT.println(); - ); - - pSQAnswer->m_QueryAnswerFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain); - _executeQueryCallback(*pQuery, *pSQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain), true); - } - } - - // Look for answers to service queries - clsQuery::clsAnswer* pSQAnswer = pQuery->findAnswerForHostDomain(p_pAAnswer->m_Header.m_Domain); - if (pSQAnswer) - { - // Answer for this host domain (eg. esp8266.local) available - clsQuery::clsAnswer::clsIPAddressWithTTL* pIPAddress = pSQAnswer->findIPv4Address(p_pAAnswer->m_IPAddress); - if (pIPAddress) - { - // Already known IPv4 address - if (p_pAAnswer->m_u32TTL) - { - // Valid TTL -> Update answers TTL - pIPAddress->m_TTL.set(p_pAAnswer->m_u32TTL); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAnswer: Updated TTL(%lu) for "), _DH(), p_pAAnswer->m_u32TTL); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv4 address (%s)\n"), pIPAddress->m_IPAddress.toString().c_str()); - ); - } - else - { - // 'Goodbye' message for known IPv4 address - pIPAddress->m_TTL.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1 - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAnswer: 'Goodbye' received for "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv4 address (%s)\n"), pIPAddress->m_IPAddress.toString().c_str()); - ); - } - } - else - { - // Until now unknown IPv4 address -> Add (if the message isn't just a 'Goodbye' note) - if (p_pAAnswer->m_u32TTL) - { - // NOT just a 'Goodbye' message - pIPAddress = new clsQuery::clsAnswer::clsIPAddressWithTTL(p_pAAnswer->m_IPAddress, p_pAAnswer->m_u32TTL); - if ((pIPAddress) && - (pSQAnswer->addIPv4Address(pIPAddress))) - { - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAnswer: Added IPv4 address to "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(": %s\n"), pIPAddress->m_IPAddress.toString().c_str()); - ); - - pSQAnswer->m_QueryAnswerFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address); - _executeQueryCallback(*pQuery, *pSQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address), true); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _processAAnswer: FAILED to add IPv4 address (%s)!\n"), _DH(), p_pAAnswer->m_IPAddress.toString().c_str());); - } - } - } - } - } // m_bAwaitingAnswers - } // for(queries) - } // else: No p_pAAnswer - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _processAAnswer: FAILED!\n"), _DH());); - return bResult; -} -#endif - -#ifdef MDNS2_IPV6_SUPPORT -/* - clsLEAmDNS2_Host::_processAAAAAnswer (level 3) -*/ -bool clsLEAMDNSHost::_processAAAAAnswer(const clsLEAMDNSHost::clsRRAnswerAAAA* p_pAAAAAnswer) -{ - bool bResult = false; - - if ((bResult = (0 != p_pAAAAAnswer))) - { - // eg. esp8266.local AAAA xxxx xx 0bf3::0c - for (clsQuery::list::iterator it = m_Queries.begin(); ((bResult) && (it != m_Queries.end())); it++) - { - clsQuery* pQuery = *it; - - if (pQuery->m_bAwaitingAnswers) - { - // Look for answers to host queries - if ((p_pAAAAAnswer->m_u32TTL) && // NOT just a goodbye message - (clsQuery::enuQueryType::Host == pQuery->m_QueryType) && // AND a host query - (pQuery->m_Domain == p_pAAAAAnswer->m_Header.m_Domain)) // AND a matching host domain - { - clsQuery::clsAnswer* pSQAnswer = pQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain); - if ((!pSQAnswer) && - ((pSQAnswer = new clsQuery::clsAnswer))) - { - // Add not yet included answer - pSQAnswer->m_HostDomain = p_pAAAAAnswer->m_Header.m_Domain; - //pSQAnswer->releaseHostDomain(); - - bResult = pQuery->addAnswer(pSQAnswer); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAAAAnswer: Added host query answer for "), _DH()); - _printRRDomain(pQuery->m_Domain); - DEBUG_OUTPUT.println(); - ); - - pSQAnswer->m_QueryAnswerFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain); - _executeQueryCallback(*pQuery, *pSQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain), true); - } - } - - // Look for answers to service queries - clsQuery::clsAnswer* pSQAnswer = pQuery->findAnswerForHostDomain(p_pAAAAAnswer->m_Header.m_Domain); - if (pSQAnswer) // Answer for this host domain (eg. esp8266.local) available - { - clsQuery::clsAnswer::clsIPAddressWithTTL* pIPAddress = pSQAnswer->findIPv6Address(p_pAAAAAnswer->m_IPAddress); - if (pIPAddress) - { - // Already known IPv6 address - if (p_pAAAAAnswer->m_u32TTL) - { - // Valid TTL -> Update answers TTL - pIPAddress->m_TTL.set(p_pAAAAAnswer->m_u32TTL); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAAAAnswer: Updated TTL(%lu) for "), _DH(), p_pAAAAAnswer->m_u32TTL); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv6 address (%s)\n"), pIPAddress->m_IPAddress.toString().c_str()); - ); - } - else - { - // 'Goodbye' message for known IPv6 address - pIPAddress->m_TTL.prepareDeletion(); // Prepare answer deletion according to RFC 6762, 10.1 - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAAAAnswer: 'Goodbye' received for "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv6 address (%s)\n"), pIPAddress->m_IPAddress.toString().c_str()); - ); - } - } - else - { - // Until now unknown IPv6 address -> Add (if the message isn't just a 'Goodbye' note) - if (p_pAAAAAnswer->m_u32TTL) - { - // NOT just a 'Goodbye' message - pIPAddress = new clsQuery::clsAnswer::clsIPAddressWithTTL(p_pAAAAAnswer->m_IPAddress, p_pAAAAAnswer->m_u32TTL); - if ((pIPAddress) && - (pSQAnswer->addIPv6Address(pIPAddress))) - { - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _processAAAAAnswer: Added IPv6 address to "), _DH()); - _printRRDomain(pSQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(": %s\n"), pIPAddress->m_IPAddress.toString().c_str()); - ); - - pSQAnswer->m_QueryAnswerFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv6Address); - _executeQueryCallback(*pQuery, *pSQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv6Address), true); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _processAAAAAnswer: FAILED to add IPv6 address (%s)!\n"), _DH(), p_pAAAAAnswer->m_IPAddress.toString().c_str());); - } - } - } - } - } // m_bAwaitingAnswers - } // for(queries) - } // else: No p_pAAAAAnswer - - return bResult; -} -#endif - - -/* - - PROBING - -*/ - -/* - clsLEAmDNS2_Host::_updateProbeStatus - - Manages the (outgoing) probing process. - - If probing has not been started yet (ProbingStatus_NotStarted), the initial delay (see RFC 6762) is determined and - the process is started - - After timeout (of initial or subsequential delay) a probe message is send out for three times. If the message has - already been sent out three times, the probing has been successful and is finished. - - Conflict management is handled in '_parseResponse ff.' - Tiebraking is handled in 'parseQuery ff.' -*/ -bool clsLEAMDNSHost::_updateProbeStatus() -{ - bool bResult = true; - - // - // Probe host domain - if ((clsProbeInformation_Base::enuProbingStatus::ReadyToStart == m_ProbeInformation.m_ProbingStatus))// && // Ready to get started AND - /* - (( - #ifdef MDNS_IPV4_SUPPORT - _getResponderIPAddress(pNetIf, enuIPProtocolType::V4).isSet() // AND has IPv4 address - #else - true - #endif - ) || ( - #ifdef MDNS2_IPV6_SUPPORT - _getResponderIPAddress(pNetIf, enuIPProtocolType::V6).isSet() // OR has IPv6 address - #else - true - #endif - ))) // Has IP address - */ - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Starting host probing...\n"), _DH());); - - // First probe delay SHOULD be random 0-250 ms - m_ProbeInformation.m_Timeout.reset(rand() % clsConsts::u32ProbeDelay); - m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::InProgress; - } - else if ((clsProbeInformation_Base::enuProbingStatus::InProgress == m_ProbeInformation.m_ProbingStatus) && // Probing AND - (m_ProbeInformation.m_Timeout.expired())) // Time for next probe - { - if (clsConsts::u32ProbeCount > m_ProbeInformation.m_u32SentCount) - { - // Send next probe - if ((bResult = _sendHostProbe())) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Did sent host probe for '%s.local'\n\n"), _DH(), (m_pcHostName ? : ""));); - m_ProbeInformation.m_Timeout.reset(clsConsts::u32ProbeDelay); - ++m_ProbeInformation.m_u32SentCount; - } - } - else - { - // Probing finished - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("\n%s _updateProbeStatus: Done host probing for '%s.local'.\n\n\n"), _DH(), (m_pcHostName ? : ""));); - m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce; - m_ProbeInformation.m_Timeout.reset(esp8266::polledTimeout::oneShot::neverExpires); - - _callHostProbeResultCallback(true); - - // Prepare to announce host - m_ProbeInformation.m_u32SentCount = 0; - m_ProbeInformation.m_Timeout.reset(clsConsts::u32AnnounceDelay); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Prepared host announcing.\n\n"), _DH());); - } - } // else: Probing already finished OR waiting for next time slot - else if ((clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce == m_ProbeInformation.m_ProbingStatus) && - (m_ProbeInformation.m_Timeout.expired())) - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: ReadyToAnnounce => Announce (without services), now\n"), _DH());); - if ((bResult = _announce(true, false))) - { - // Don't announce services here - ++m_ProbeInformation.m_u32SentCount; // 1.. - - if (clsConsts::u32AnnounceCount > m_ProbeInformation.m_u32SentCount) - { - m_ProbeInformation.m_Timeout.reset(clsConsts::u32AnnounceDelay * pow(2, (m_ProbeInformation.m_u32SentCount - 1))); // 2^(0..) -> 1, 2, 4, ... - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Announcing host '%s.local' (%lu).\n\n"), _DH(), (m_pcHostName ? : ""), m_ProbeInformation.m_u32SentCount);); - } - else - { - m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::DoneFinally; - m_ProbeInformation.m_Timeout.reset(esp8266::polledTimeout::oneShot::neverExpires); - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Done host announcing for '%s.local'.\n"), _DH(), (m_pcHostName ? : ""));); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Done host announcing for '%s.local'.\n\n"), _DH(), (m_pcHostName ? : ""));); - //DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Done host announcing for '%s.local'.\n"), _DH(), (m_pcHostName ? : "")); - } - } - } - - // - // Probe services - for (clsService::list::iterator it = m_Services.begin(); ((bResult) && (it != m_Services.end())); it++) - { - clsService* pService = *it; - - if (clsProbeInformation_Base::enuProbingStatus::ReadyToStart == pService->m_ProbeInformation.m_ProbingStatus) - { - // Ready to get started - pService->m_ProbeInformation.m_Timeout.reset(clsConsts::u32ProbeDelay); // More or equal than first probe for host domain - pService->m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::InProgress; - } - else if ((clsProbeInformation_Base::enuProbingStatus::InProgress == pService->m_ProbeInformation.m_ProbingStatus) && // Probing AND - (pService->m_ProbeInformation.m_Timeout.expired())) // Time for next probe - { - if (clsConsts::u32ProbeCount > pService->m_ProbeInformation.m_u32SentCount) - { - // Send next probe - if ((bResult = _sendServiceProbe(*pService))) - { - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Did sent service probe for '%s' (%u)\n\n"), _DH(), _service2String(pService), (pService->m_ProbeInformation.m_u32SentCount + 1));); - pService->m_ProbeInformation.m_Timeout.reset(clsConsts::u32ProbeDelay); - ++pService->m_ProbeInformation.m_u32SentCount; - } - } - else - { - // Probing finished - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("\n%s _updateProbeStatus: Done service probing '%s'\n\n\n"), _DH(), _service2String(pService));); - pService->m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce; - pService->m_ProbeInformation.m_Timeout.reset(esp8266::polledTimeout::oneShot::neverExpires); - - _callServiceProbeResultCallback(*pService, true); - - // Prepare to announce service - pService->m_ProbeInformation.m_u32SentCount = 0; - pService->m_ProbeInformation.m_Timeout.reset(clsConsts::u32AnnounceDelay); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Prepared service announcing.\n\n"), _DH());); - } - } - else if ((clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce == pService->m_ProbeInformation.m_ProbingStatus) && - (pService->m_ProbeInformation.m_Timeout.expired())) - { - // Probing already finished OR waiting for next time slot - if ((bResult = _announceService(*pService))) - { - // Announce service - ++pService->m_ProbeInformation.m_u32SentCount; // 1.. - - if (clsConsts::u32AnnounceCount > pService->m_ProbeInformation.m_u32SentCount) - { - pService->m_ProbeInformation.m_Timeout.reset(clsConsts::u32AnnounceDelay * pow(2, (pService->m_ProbeInformation.m_u32SentCount - 1))); // 2^(0..) -> 1, 2, 4, ... - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Announcing service '%s' (%lu)\n\n"), _DH(), _service2String(pService), pService->m_ProbeInformation.m_u32SentCount);); - } - else - { - pService->m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::DoneFinally; - pService->m_ProbeInformation.m_Timeout.reset(esp8266::polledTimeout::oneShot::neverExpires); - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Done service announcing for '%s'\n"), _DH(), _service2String(pService));); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Done service announcing for '%s'\n\n"), _DH(), _service2String(pService));); - //DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: Done service announcing for '%s'\n"), _DH(), _service2String(pService)); - } - } - } - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _updateProbeStatus: FAILED!\n\n"), _DH());); - return bResult; -} - -/* - clsLEAmDNS2_Host::_resetProbeStatus - - Resets the probe status. - If 'p_bRestart' is set, the status is set to ProbingStatus_NotStarted. Consequently, - when running 'updateProbeStatus' (which is done in every '_update' loop), the probing - process is restarted. - -*/ -bool clsLEAMDNSHost::_resetProbeStatus(bool p_bRestart /*= true*/) -{ - m_ProbeInformation.clear(false); - m_ProbeInformation.m_ProbingStatus = (p_bRestart ? clsProbeInformation_Base::enuProbingStatus::ReadyToStart : clsProbeInformation_Base::enuProbingStatus::DoneFinally); - - for (clsService* pService : m_Services) - { - pService->m_ProbeInformation.clear(false); - pService->m_ProbeInformation.m_ProbingStatus = m_ProbeInformation.m_ProbingStatus; - } - return true; -} - -/* - clsLEAmDNS2_Host::_hasProbesWaitingForAnswers - -*/ -bool clsLEAMDNSHost::_hasProbesWaitingForAnswers(void) const -{ - bool bResult = ((clsProbeInformation_Base::enuProbingStatus::InProgress == m_ProbeInformation.m_ProbingStatus) && // Probing - (0 < m_ProbeInformation.m_u32SentCount)); // And really probing - - for (clsService::list::const_iterator it = m_Services.cbegin(); ((!bResult) && (it != m_Services.cend())); it++) - { - clsService* pService = *it; - - bResult = ((clsProbeInformation_Base::enuProbingStatus::InProgress == pService->m_ProbeInformation.m_ProbingStatus) && // Probing - (0 < pService->m_ProbeInformation.m_u32SentCount)); // And really probing - } - return bResult; -} - -/* - clsLEAmDNS2_Host::_sendHostProbe - - Asks (probes) in the local network for the planned host domain - - (eg. esp8266.local) - - To allow 'tiebreaking' (see '_parseQuery'), the answers for these questions are delivered in - the 'known answers' section of the query. - Host domain: - - A/AAAA (eg. esp8266.esp -> 192.168.2.120) - -*/ -bool clsLEAMDNSHost::_sendHostProbe() -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendHostProbe (%s.local, %lu)\n"), _DH(), m_pcHostName, millis());); - - bool bResult = true; - - // Requests for host domain - clsSendParameter sendParameter; - sendParameter.m_bCacheFlush = false; // RFC 6762 10.2 - - clsRRQuestion* pNewRRQuestion = new clsRRQuestion; - if (((bResult = (0 != pNewRRQuestion))) && - ((bResult = _buildDomainForHost(m_pcHostName, pNewRRQuestion->m_Header.m_Domain)))) - { - //sendParameter.m_pQuestions->m_bUnicast = true; - pNewRRQuestion->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY; - pNewRRQuestion->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN); // Unicast & INternet - - sendParameter.m_RRQuestions.push_back(pNewRRQuestion); - - // Add known answers -#ifdef MDNS_IPV4_SUPPORT - sendParameter.m_u32HostReplyMask |= static_cast(enuContentFlag::A); // Add A answer -#endif -#ifdef MDNS2_IPV6_SUPPORT - sendParameter.m_u32HostReplyMask |= static_cast(enuContentFlag::AAAA); // Add AAAA answer -#endif - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _sendHostProbe: FAILED to create host question!\n"), _DH());); - if (pNewRRQuestion) - { - delete pNewRRQuestion; - pNewRRQuestion = 0; - } - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _sendHostProbe: FAILED!\n"), _DH());); - return ((bResult) && - (_sendMessage(sendParameter))); -} - -/* - clsLEAmDNS2_Host::_sendServiceProbe - - Asks (probes) in the local network for the planned service instance domain - - (eg. MyESP._http._tcp.local). - - To allow 'tiebreaking' (see '_parseQuery'), the answers for these questions are delivered in - the 'known answers' section of the query. - Service domain: - - SRV (eg. MyESP._http._tcp.local -> 5000 esp8266.local) - - PTR NAME (eg. _http._tcp.local -> MyESP._http._tcp.local) (TODO: Check if needed, maybe TXT is better) - -*/ -bool clsLEAMDNSHost::_sendServiceProbe(clsService& p_rService) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendServiceProbe (%s, %lu)\n"), _DH(), _service2String(&p_rService), millis());); - - bool bResult = true; - - // Requests for service instance domain - clsSendParameter sendParameter; - sendParameter.m_bCacheFlush = false; // RFC 6762 10.2 - - clsRRQuestion* pNewRRQuestion = new clsRRQuestion; - if (((bResult = (0 != pNewRRQuestion))) && - ((bResult = _buildDomainForService(p_rService, true, pNewRRQuestion->m_Header.m_Domain)))) - { - pNewRRQuestion->m_bUnicast = true; - pNewRRQuestion->m_Header.m_Attributes.m_u16Type = DNS_RRTYPE_ANY; - pNewRRQuestion->m_Header.m_Attributes.m_u16Class = (0x8000 | DNS_RRCLASS_IN); // Unicast & INternet - - sendParameter.m_RRQuestions.push_back(pNewRRQuestion); - - // Add known answers - p_rService.m_u32ReplyMask = (static_cast(enuContentFlag::SRV) | static_cast(enuContentFlag::PTR_NAME)); // Add SRV and PTR NAME answers - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _sendServiceProbe: FAILED to create service question!\n"), _DH());); - if (pNewRRQuestion) - { - delete pNewRRQuestion; - pNewRRQuestion = 0; - } - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _sendServiceProbe: FAILED!\n"), _DH());); - return ((bResult) && - (_sendMessage(sendParameter))); -} - -/* - clsLEAmDNS2_Host::_cancelProbingForHost - -*/ -bool clsLEAMDNSHost::_cancelProbingForHost(void) -{ - bool bResult; - - m_ProbeInformation.clear(false); - - // Send host notification - bResult = _callHostProbeResultCallback(false); - - for (clsService* pService : m_Services) - { - bResult = bResult && _cancelProbingForService(*pService); - } - return bResult; -} - -/* - clsLEAmDNS2_Host::_cancelProbingForService - -*/ -bool clsLEAMDNSHost::_cancelProbingForService(clsService& p_rService) -{ - p_rService.m_ProbeInformation.clear(false); - - // Send notification - return _callServiceProbeResultCallback(p_rService, false); -} - -/* - clsLEAmDNS2_Host::_callHostProbeResultCallback - -*/ -bool clsLEAMDNSHost::_callHostProbeResultCallback(bool p_bResult) -{ - if (m_ProbeInformation.m_fnProbeResultCallback) - { - m_ProbeInformation.m_fnProbeResultCallback(*this, m_pcHostName, p_bResult); - } - else if (!p_bResult) - { - // Auto-Handle failure by changing the host name, use '-' as divider between base name and index - indexHostName(); - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _callHostProbeResultCallback: Changed Host Name: %s\n"), _DH(), (m_pcHostName ? : ""))); - } - return true; -} - -/* - clsLEAmDNS2_Host::_callServiceProbeResultCallback - -*/ -bool clsLEAMDNSHost::_callServiceProbeResultCallback(clsLEAMDNSHost::clsService& p_rService, - bool p_bResult) -{ - if (p_rService.m_ProbeInformation.m_fnProbeResultCallback) - { - p_rService.m_ProbeInformation.m_fnProbeResultCallback(p_rService, p_rService.instanceName(), p_bResult); - } - else if (!p_bResult) - { - // Auto-Handle failure by changing the service name, use ' #' as divider between base name and index - p_rService.indexInstanceName(); - DEBUG_EX_INFO2(DEBUG_OUTPUT.printf_P(PSTR("%s _callServiceProbeResultCallback: Changed Service Domain: %s\n"), _DH(), _service2String(&p_rService))); - } - return true; -} - - -/* - - ANNOUNCING - -*/ - -/* - clsLEAmDNS2_Host::_announce - - Announces the host domain: - - A/AAAA (eg. esp8266.local -> 192.168.2.120) - - PTR (eg. 192.168.2.120.in-addr.arpa -> esp8266.local) - - and all presented services: - - PTR_TYPE (_services._dns-sd._udp.local -> _http._tcp.local) - - PTR_NAME (eg. _http._tcp.local -> MyESP8266._http._tcp.local) - - SRV (eg. MyESP8266._http._tcp.local -> 5000 esp8266.local) - - TXT (eg. MyESP8266._http._tcp.local -> c#=1) - - Goodbye (Un-Announcing) for the host domain and all services is also handled here. - Goodbye messages are created by setting the TTL for the answer to 0, this happens - inside the '_writeXXXAnswer' procs via 'sendParameter.m_bUnannounce = true' - -*/ -bool clsLEAMDNSHost::_announce(bool p_bAnnounce, - bool p_bIncludeServices) -{ - bool bResult = false; - - clsSendParameter sendParameter; - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s ::announce() status=%d (waiting4data:%d ready2start:%d inprogress:%d ready2announce:%d done:%d\r\n"), - _DH(), m_ProbeInformation.m_ProbingStatus, - clsProbeInformation_Base::enuProbingStatus::WaitingForData, - clsProbeInformation_Base::enuProbingStatus::ReadyToStart, - clsProbeInformation_Base::enuProbingStatus::InProgress, - clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce, - clsProbeInformation_Base::enuProbingStatus::DoneFinally);); - - if ((clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce == m_ProbeInformation.m_ProbingStatus) || - (clsProbeInformation_Base::enuProbingStatus::DoneFinally == m_ProbeInformation.m_ProbingStatus)) - { - bResult = true; - - sendParameter.m_Response = clsSendParameter::enuResponseType::Unsolicited; // Announces are 'Unsolicited authorative responses' - sendParameter.m_bAuthorative = true; - sendParameter.m_bCacheFlush = true; // RFC 6762 8.3 - sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers - - // Announce host - sendParameter.m_u32HostReplyMask = 0; -#ifdef MDNS_IPV4_SUPPORT - sendParameter.m_u32HostReplyMask |= static_cast(enuContentFlag::A); // A answer - sendParameter.m_u32HostReplyMask |= static_cast(enuContentFlag::PTR_IPv4); // PTR_IPv4 answer -#endif -#ifdef MDNS2_IPV6_SUPPORT - sendParameter.m_u32HostReplyMask |= static_cast(enuContentFlag::AAAA); // AAAA answer - sendParameter.m_u32HostReplyMask |= static_cast(enuContentFlag::PTR_IPv6); // PTR_IPv6 answer -#endif - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _announce: Announcing host %s (content: %s)\n"), _DH(), m_pcHostName, _replyFlags2String(sendParameter.m_u32HostReplyMask));); - - if (p_bIncludeServices) - { - // Announce services (service type, name, SRV (location) and TXTs) - for (clsService* pService : m_Services) - { - if ((clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce == pService->m_ProbeInformation.m_ProbingStatus) || - (clsProbeInformation_Base::enuProbingStatus::DoneFinally == pService->m_ProbeInformation.m_ProbingStatus)) - { - pService->m_u32ReplyMask = (static_cast(enuContentFlag::PTR_TYPE) | - static_cast(enuContentFlag::PTR_NAME) | - static_cast(enuContentFlag::SRV) | - static_cast(enuContentFlag::TXT)); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _announce: Announcing service '%s' (content %s)\n"), _DH(), _service2String(pService), _replyFlags2String(pService->m_u32ReplyMask));); - } - } - } - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _announce: FAILED!\n\n"), _DH());); - return ((bResult) && - (_sendMessage(sendParameter))); -} - -/* - clsLEAmDNS2_Host::_announceService - -*/ -bool clsLEAMDNSHost::_announceService(clsLEAMDNSHost::clsService& p_rService, - bool p_bAnnounce /*= true*/) -{ - bool bResult = false; - - clsSendParameter sendParameter; - if (clsProbeInformation_Base::enuProbingStatus::ReadyToAnnounce == p_rService.m_ProbeInformation.m_ProbingStatus) - { - sendParameter.m_Response = clsSendParameter::enuResponseType::Unsolicited; // Announces are 'Unsolicited authorative responses' - sendParameter.m_bAuthorative = true; - sendParameter.m_bUnannounce = !p_bAnnounce; // When unannouncing, the TTL is set to '0' while creating the answers - - // DON'T announce host - sendParameter.m_u32HostReplyMask = 0; - - // Announce services (service type, name, SRV (location) and TXTs) - p_rService.m_u32ReplyMask = (static_cast(enuContentFlag::PTR_TYPE) | - static_cast(enuContentFlag::PTR_NAME) | - static_cast(enuContentFlag::SRV) | - static_cast(enuContentFlag::TXT)); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _announceService: Announcing service '%s' (content: %s)\n"), _DH(), _service2String(&p_rService), _replyFlags2String(p_rService.m_u32ReplyMask));); - - bResult = true; - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _announceService: FAILED!\n"), _DH());); - return ((bResult) && - (_sendMessage(sendParameter))); -} - - -/* - - QUERY CACHE - -*/ - -/* - clsLEAmDNS2_Host::_checkQueryCache - - For any 'living' query (m_bAwaitingAnswers == true) all available answers (their components) - are checked for topicality based on the stored reception time and the answers TTL. - When the components TTL is outlasted by more than 80%, a new question is generated, to get updated information. - When no update arrived (in time), the component is removed from the answer (cache). - -*/ -bool clsLEAMDNSHost::_checkQueryCache() -{ - bool bResult = true; - - DEBUG_EX_INFO( - bool printedInfo = false; - ); - for (clsQuery::list::iterator itQ = m_Queries.begin(); ((bResult) && (itQ != m_Queries.end())); itQ++) - { - clsQuery* pQuery = *itQ; - // - // Resend dynamic queries, if not already done often enough - if ((!pQuery->m_bStaticQuery) && - (pQuery->m_ResendTimeout.expired())) - { - if ((bResult = _sendQuery(*pQuery))) - { - // The re-query rate is increased to more than one hour (RFC 6762 5.2) - ++pQuery->m_u32SentCount; - uint32_t u32NewDelay = (clsConsts::u32DynamicQueryResendDelay * pow(2, std::min((pQuery->m_u32SentCount - 1), (uint32_t)12))); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: Next query in %u seconds!\n"), _DH(), (u32NewDelay));); - pQuery->m_ResendTimeout.reset(u32NewDelay); - } - else - { - break; - } - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: %s to resend query!\n"), _DH(), (bResult ? "Succeeded" : "FAILED")); - printedInfo = true; - ); - } - - // - // Schedule updates for cached answers - if (pQuery->m_bAwaitingAnswers) - { - clsQuery::clsAnswer::list expiredAnswers; - for (clsQuery::clsAnswer::list::iterator itQA = pQuery->m_Answers.begin(); ((bResult) && (itQA != pQuery->m_Answers.end())); itQA++) - { - clsQuery::clsAnswer* pQAnswer = *itQA; - - // 1. level answer - if ((bResult) && - (pQAnswer->m_TTLServiceDomain.flagged())) - { - if (!pQAnswer->m_TTLServiceDomain.finalTimeoutLevel()) - { - bResult = ((_sendQuery(*pQuery)) && - (pQAnswer->m_TTLServiceDomain.restart())); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: PTR update scheduled for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), (bResult ? "OK" : "FAILURE")); - printedInfo = true; - ); - } - else - { - // Timed out! -> Delete - _executeQueryCallback(*pQuery, *pQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::ServiceDomain), false); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: Will remove PTR answer for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR("\n")); - printedInfo = true; - ); - - expiredAnswers.push_back(pQAnswer); - continue; // Don't use this answer anymore - } - } // ServiceDomain flagged - - // 2. level answers - // HostDomain & Port (from SRV) - if ((bResult) && - (pQAnswer->m_TTLHostDomainAndPort.flagged())) - { - if (!pQAnswer->m_TTLHostDomainAndPort.finalTimeoutLevel()) - { - bResult = ((_sendQuery(pQAnswer->m_ServiceDomain, DNS_RRTYPE_SRV)) && - (pQAnswer->m_TTLHostDomainAndPort.restart())); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: SRV update scheduled for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" host domain and port %s\n"), (bResult ? "OK" : "FAILURE")); - printedInfo = true; - ); - } - else - { - // Timed out! -> Delete - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: Will remove SRV answer for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" host domain and port\n")); - printedInfo = true; - ); - // Delete - pQAnswer->m_HostDomain.clear(); - //pSQAnswer->releaseHostDomain(); - pQAnswer->m_u16Port = 0; - pQAnswer->m_TTLHostDomainAndPort.set(0); - clsQuery::clsAnswer::typeQueryAnswerType queryAnswerContentFlags = (static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain) | static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Port)); - // As the host domain is the base for the IPv4- and IPv6Address, remove these too -#ifdef MDNS_IPV4_SUPPORT - pQAnswer->releaseIPv4Addresses(); - queryAnswerContentFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address); -#endif -#ifdef MDNS2_IPV6_SUPPORT - pQAnswer->releaseIPv6Addresses(); - queryAnswerContentFlags |= static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv6Address); -#endif - - // Remove content flags for deleted answer parts - pQAnswer->m_QueryAnswerFlags &= ~queryAnswerContentFlags; - _executeQueryCallback(*pQuery, *pQAnswer, queryAnswerContentFlags, false); - } - } // HostDomainAndPort flagged - - // Txts (from TXT) - if ((bResult) && - (pQAnswer->m_TTLTxts.flagged())) - { - if (!pQAnswer->m_TTLTxts.finalTimeoutLevel()) - { - bResult = ((_sendQuery(pQAnswer->m_ServiceDomain, DNS_RRTYPE_TXT)) && - (pQAnswer->m_TTLTxts.restart())); - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: TXT update scheduled for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" TXTs %s\n"), (bResult ? "OK" : "FAILURE")); - printedInfo = true; - ); - } - else - { - // Timed out! -> Delete - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: Will remove TXT answer for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" TXTs\n")); - printedInfo = true; - ); - // Delete - pQAnswer->m_Txts.clear(); - pQAnswer->m_TTLTxts.set(0); - - // Remove content flags for deleted answer parts - pQAnswer->m_QueryAnswerFlags &= ~static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Txts); - _executeQueryCallback(*pQuery, *pQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Txts), false); - } - } // TXTs flagged - - // 3. level answers -#ifdef MDNS_IPV4_SUPPORT - // IPv4Address (from A) - clsQuery::clsAnswer::clsIPAddressWithTTL::list expiredIPv4Addresses; - bool bAUpdateQuerySent = false; - for (clsQuery::clsAnswer::clsIPAddressWithTTL::list::iterator itQAIPv4 = pQAnswer->m_IPv4Addresses.begin(); ((bResult) && (itQAIPv4 != pQAnswer->m_IPv4Addresses.end())); itQAIPv4++) - { - clsQuery::clsAnswer::clsIPAddressWithTTL* pIPv4Address = *itQAIPv4; - - if (pIPv4Address->m_TTL.flagged()) - { - if (!pIPv4Address->m_TTL.finalTimeoutLevel()) - { - // Needs update - if ((bAUpdateQuerySent) || - ((bResult = _sendQuery(pQAnswer->m_HostDomain, DNS_RRTYPE_A)))) - { - pIPv4Address->m_TTL.restart(); - bAUpdateQuerySent = true; - - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: IPv4 update scheduled for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv4 address (%s)\n"), (pIPv4Address->m_IPAddress.toString().c_str())); - printedInfo = true; - ); - } - } - else - { - // Timed out! -> Delete - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: Will remove IPv4 answer for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv4 address\n")); - printedInfo = true; - ); - if (1 == pQAnswer->m_IPv4Addresses.size()) - { - // NO IPv4 address left after this -> remove content flag - pQAnswer->m_QueryAnswerFlags &= ~static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address); - } - // Notify client - _executeQueryCallback(*pQuery, *pQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address), false); - expiredIPv4Addresses.push_back(pIPv4Address); - } - } // IPv4 flagged - } // for - // Finally remove expired IPv4 addresses - for (clsQuery::clsAnswer::clsIPAddressWithTTL* pIPv4Address : expiredIPv4Addresses) - { - pQAnswer->removeIPv4Address(pIPv4Address); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - // IPv6Address (from AAAA) - clsQuery::clsAnswer::clsIPAddressWithTTL::list expiredIPv6Addresses; - bool bAAAAUpdateQuerySent = false; - for (clsQuery::clsAnswer::clsIPAddressWithTTL::list::iterator itQAIPv6 = pQAnswer->m_IPv6Addresses.begin(); ((bResult) && (itQAIPv6 != pQAnswer->m_IPv6Addresses.end())); itQAIPv6++) - { - clsQuery::clsAnswer::clsIPAddressWithTTL* pIPv6Address = *itQAIPv6; - - if (pIPv6Address->m_TTL.flagged()) - { - if (!pIPv6Address->m_TTL.finalTimeoutLevel()) - { - // Needs update - if ((bAAAAUpdateQuerySent) || - ((bResult = _sendQuery(pQAnswer->m_HostDomain, DNS_RRTYPE_AAAA)))) - { - pIPv6Address->m_TTL.restart(); - bAAAAUpdateQuerySent = true; - - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: IPv6 update scheduled for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv6 address (%s)\n"), (pIPv6Address->m_IPAddress.toString().c_str())); - printedInfo = true; - ); - } - } - else - { - // Timed out! -> Delete - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: Will remove answer for "), _DH()); - _printRRDomain(pQAnswer->m_ServiceDomain); - DEBUG_OUTPUT.printf_P(PSTR(" IPv6 address\n")); - printedInfo = true; - ); - if (1 == pQAnswer->m_IPv6Addresses.size()) - { - // NO IPv6 address left after this -> remove content flag - pQAnswer->m_QueryAnswerFlags &= ~static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv6Address); - } - // Notify client - _executeQueryCallback(*pQuery, *pQAnswer, static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv6Address), false); - expiredIPv6Addresses.push_back(pIPv6Address); - } - } // IPv6 flagged - // Finally remove expired IPv6 addresses - for (clsQuery::clsAnswer::clsIPAddressWithTTL* pIPv6Address : expiredIPv6Addresses) - { - pQAnswer->removeIPv6Address(pIPv6Address); - } - } // while -#endif - } - - // Finally remove expired answers - for (clsQuery::clsAnswer* pAnswer : expiredAnswers) - { - pQuery->removeAnswer(pAnswer); - } - } - } - DEBUG_EX_INFO(if (printedInfo) DEBUG_OUTPUT.printf_P(PSTR("\n"));); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _checkQueryCache: FAILED!\n"), _DH());); - return bResult; -} - - -/* - clsLEAmDNS2_Host::_replyMaskForHost - - Determines the relevant host answers for the given question. - - A question for the hostname (eg. esp8266.local) will result in an A/AAAA (eg. 192.168.2.129) reply. - - A question for the reverse IP address (eg. 192-168.2.120.inarpa.arpa) will result in an PTR_IPv4 (eg. esp8266.local) reply. - - In addition, a full name match (question domain == host domain) is marked. -*/ -uint32_t clsLEAMDNSHost::_replyMaskForHost(netif* pNetIf, - const clsLEAMDNSHost::clsRRHeader& p_RRHeader, - bool* p_pbFullNameMatch /*= 0*/) const -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _replyMaskForHost\n"));); - - uint32_t u32ReplyMask = 0; - (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0); - - if ((DNS_RRCLASS_IN == (p_RRHeader.m_Attributes.m_u16Class & (~0x8000))) || - (DNS_RRCLASS_ANY == (p_RRHeader.m_Attributes.m_u16Class & (~0x8000)))) - { - - if ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || - (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)) - { - // PTR request -#ifdef MDNS_IPV4_SUPPORT - clsRRDomain reverseIPv4Domain; - if ((_getResponderIPAddress(pNetIf, enuIPProtocolType::V4).isSet()) && - (_buildDomainForReverseIPv4(_getResponderIPAddress(pNetIf, enuIPProtocolType::V4), reverseIPv4Domain)) && - (p_RRHeader.m_Domain == reverseIPv4Domain)) - { - // Reverse domain match - u32ReplyMask |= static_cast(enuContentFlag::PTR_IPv4); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - clsRRDomain reverseIPv6Domain; - if ((_getResponderIPAddress(pNetIf, enuIPProtocolType::V6).isSet()) && - (_buildDomainForReverseIPv6(_getResponderIPAddress(pNetIf, enuIPProtocolType::V6), reverseIPv6Domain)) && - (p_RRHeader.m_Domain == reverseIPv6Domain)) - { - // Reverse domain match - u32ReplyMask |= static_cast(enuContentFlag::PTR_IPv6); - } -#endif - } // Address qeuest - - clsRRDomain hostDomain; - if ((_buildDomainForHost(m_pcHostName, hostDomain)) && - (p_RRHeader.m_Domain == hostDomain)) // Host domain match - { - (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0)); - -#ifdef MDNS_IPV4_SUPPORT - if ((DNS_RRTYPE_A == p_RRHeader.m_Attributes.m_u16Type) || - (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)) - { - // IPv4 address request - u32ReplyMask |= static_cast(enuContentFlag::A); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - if ((DNS_RRTYPE_AAAA == p_RRHeader.m_Attributes.m_u16Type) || - (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)) - { - // IPv6 address request - u32ReplyMask |= static_cast(enuContentFlag::AAAA); - } -#endif - } - } - else - { - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _replyMaskForHost: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class);); - } - DEBUG_EX_INFO(if (u32ReplyMask) DEBUG_OUTPUT.printf_P(PSTR("%s _replyMaskForHost: %s\n"), _DH(), _replyFlags2String(u32ReplyMask));); - return u32ReplyMask; -} - -/* - clsLEAmDNS2_Host::_replyMaskForService - - Determines the relevant service answers for the given question - - A PTR dns-sd service enum question (_services.dns-sd._udp.local) will result into an PTR_TYPE (eg. _http._tcp.local) answer - - A PTR service type question (eg. _http._tcp.local) will result into an PTR_NAME (eg. MyESP._http._tcp.local) answer - - A PTR service name question (eg. MyESP._http._tcp.local) will result into an PTR_NAME (eg. MyESP._http._tcp.local) answer - - A SRV service name question (eg. MyESP._http._tcp.local) will result into an SRV (eg. 5000 MyESP.local) answer - - A TXT service name question (eg. MyESP._http._tcp.local) will result into an TXT (eg. c#=1) answer - - In addition, a full name match (question domain == service instance domain) is marked. - -*/ -uint32_t clsLEAMDNSHost::_replyMaskForService(const clsLEAMDNSHost::clsRRHeader& p_RRHeader, - clsLEAMDNSHost::clsService& p_rService, - bool* p_pbFullNameMatch /*= 0*/) -{ - uint32_t u32ReplyMask = 0; - (p_pbFullNameMatch ? *p_pbFullNameMatch = false : 0); - - if ((DNS_RRCLASS_IN == (p_RRHeader.m_Attributes.m_u16Class & (~0x8000))) || - (DNS_RRCLASS_ANY == (p_RRHeader.m_Attributes.m_u16Class & (~0x8000)))) - { - clsRRDomain DNSSDDomain; - if ((_buildDomainForDNSSD(DNSSDDomain)) && // _services._dns-sd._udp.local - (p_RRHeader.m_Domain == DNSSDDomain) && - ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || - (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))) - { - // Common service info requested - u32ReplyMask |= static_cast(enuContentFlag::PTR_TYPE); - } - - clsRRDomain serviceDomain; - if ((_buildDomainForService(p_rService, false, serviceDomain)) && // eg. _http._tcp.local - (p_RRHeader.m_Domain == serviceDomain) && - ((DNS_RRTYPE_PTR == p_RRHeader.m_Attributes.m_u16Type) || - (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type))) - { - // Special service info requested - u32ReplyMask |= static_cast(enuContentFlag::PTR_NAME); - } - - if ((_buildDomainForService(p_rService, true, serviceDomain)) && // eg. MyESP._http._tcp.local - (p_RRHeader.m_Domain == serviceDomain)) - { - (p_pbFullNameMatch ? (*p_pbFullNameMatch = true) : (0)); - - if ((DNS_RRTYPE_SRV == p_RRHeader.m_Attributes.m_u16Type) || - (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)) - { - // Instance info SRV requested - u32ReplyMask |= static_cast(enuContentFlag::SRV); - } - if ((DNS_RRTYPE_TXT == p_RRHeader.m_Attributes.m_u16Type) || - (DNS_RRTYPE_ANY == p_RRHeader.m_Attributes.m_u16Type)) - { - // Instance info TXT requested - u32ReplyMask |= static_cast(enuContentFlag::TXT); - } - } - } - else - { - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _replyMaskForService: INVALID RR-class (0x%04X)!\n"), p_RRHeader.m_Attributes.m_u16Class);); - } - DEBUG_EX_INFO(if (u32ReplyMask) DEBUG_OUTPUT.printf_P(PSTR("%s _replyMaskForService(%s.%s.%s): %s\n"), _DH(), p_rService.m_pcInstanceName, p_rService.m_pcType, p_rService.m_pcProtocol, _replyFlags2String(u32ReplyMask));); - return u32ReplyMask; -} - - -} // namespace MDNSImplementation - - -} // namespace esp8266 - - - diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Debug.cpp b/libraries/ESP8266mDNS/src/LEAmDNS2Host_Debug.cpp deleted file mode 100644 index 9e584e48d..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Debug.cpp +++ /dev/null @@ -1,328 +0,0 @@ -/* - LEAmDNS2Host_Debug.h - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#include "ESP8266mDNS.h" -#include "LEAmDNS2Host.h" -#include "LEAmDNS2_Priv.h" - -namespace esp8266 -{ - - -namespace experimental -{ - - -#ifdef DEBUG_ESP_PORT - -/* - clsLEAmDNS2_Host::_DH - -*/ -const char* clsLEAMDNSHost::_DH(const clsLEAMDNSHost::clsService* p_pService /*= 0*/) const -{ - static char acBuffer[16 + 64]; - - *acBuffer = 0; - sprintf_P(acBuffer, PSTR("[mDNS]")); - if (p_pService) - { - strcat_P(acBuffer, PSTR(">")); - strcat(acBuffer, _service2String(p_pService)); - } - return acBuffer; -} - -/* - clsLEAmDNS2_Host::_service2String - -*/ -const char* clsLEAMDNSHost::_service2String(const clsLEAMDNSHost::clsService* p_pService) const -{ - static char acBuffer[64]; - - *acBuffer = 0; - if (p_pService) - { - sprintf_P(acBuffer, PSTR("%s.%s%s.%s%s.local"), - (p_pService->m_pcInstanceName ? : "-"), - (p_pService->m_pcType ? ('_' == *(p_pService->m_pcType) ? "" : "_") : "-"), - (p_pService->m_pcType ? : "-"), - (p_pService->m_pcProtocol ? ('_' == *(p_pService->m_pcProtocol) ? "" : "_") : "-"), - (p_pService->m_pcProtocol ? : "-")); - } - return acBuffer; -} - -/* - clsLEAmDNS2_Host::_printRRDomain - -*/ -bool clsLEAMDNSHost::_printRRDomain(const clsLEAMDNSHost::clsRRDomain& p_RRDomain) const -{ - //DEBUG_OUTPUT.printf_P(PSTR("Domain: ")); - - const char* pCursor = p_RRDomain.m_acName; - uint8_t u8Length = *pCursor++; - if (u8Length) - { - while (u8Length) - { - for (uint8_t u = 0; u < u8Length; ++u) - { - DEBUG_OUTPUT.printf_P(PSTR("%c"), *(pCursor++)); - } - u8Length = *pCursor++; - if (u8Length) - { - DEBUG_OUTPUT.printf_P(PSTR(".")); - } - } - } - else // empty domain - { - DEBUG_OUTPUT.printf_P(PSTR("-empty-")); - } - //DEBUG_OUTPUT.printf_P(PSTR("\n")); - - return true; -} - -/* - clsLEAmDNS2_Host::_printRRAnswer - -*/ -bool clsLEAMDNSHost::_printRRAnswer(const clsLEAMDNSHost::clsRRAnswer& p_RRAnswer) const -{ - DEBUG_OUTPUT.printf_P(PSTR("%s RRAnswer: "), _DH()); - _printRRDomain(p_RRAnswer.m_Header.m_Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:0x%04X Class:0x%04X TTL:%u, "), p_RRAnswer.m_Header.m_Attributes.m_u16Type, p_RRAnswer.m_Header.m_Attributes.m_u16Class, p_RRAnswer.m_u32TTL); - switch (p_RRAnswer.m_Header.m_Attributes.m_u16Type & (~0x8000)) // Topmost bit might carry 'cache flush' flag - { -#ifdef MDNS_IPV4_SUPPORT - case DNS_RRTYPE_A: - DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((const clsRRAnswerA*)&p_RRAnswer)->m_IPAddress.toString().c_str()); - break; -#endif - case DNS_RRTYPE_PTR: - DEBUG_OUTPUT.printf_P(PSTR("PTR ")); - _printRRDomain(((const clsRRAnswerPTR*)&p_RRAnswer)->m_PTRDomain); - break; - case DNS_RRTYPE_TXT: - { - size_t stTxtLength = ((const clsRRAnswerTXT*)&p_RRAnswer)->m_Txts.c_strLength(); - char* pTxts = new char[stTxtLength]; - if (pTxts) - { - ((/*const c_str()!!*/clsRRAnswerTXT*)&p_RRAnswer)->m_Txts.c_str(pTxts); - DEBUG_OUTPUT.printf_P(PSTR("TXT(%u) %s"), stTxtLength, pTxts); - delete[] pTxts; - } - break; - } -#ifdef MDNS2_IPV6_SUPPORT - case DNS_RRTYPE_AAAA: - DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((clsRRAnswerAAAA*&)p_RRAnswer)->m_IPAddress.toString().c_str()); - break; -#endif - case DNS_RRTYPE_SRV: - DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((const clsRRAnswerSRV*)&p_RRAnswer)->m_u16Port); - _printRRDomain(((const clsRRAnswerSRV*)&p_RRAnswer)->m_SRVDomain); - break; - default: - DEBUG_OUTPUT.printf_P(PSTR("generic ")); - break; - } - DEBUG_OUTPUT.printf_P(PSTR("\n")); - - return true; -} - -/* - clsLEAmDNS2_Host::_RRType2Name - -*/ -const char* clsLEAMDNSHost::_RRType2Name(uint16_t p_u16RRType) const -{ - static char acRRName[16]; - *acRRName = 0; - - switch (p_u16RRType & (~0x8000)) // Topmost bit might carry 'cache flush' flag - { -#ifdef MDNS_IPV4_SUPPORT - case DNS_RRTYPE_A: strcpy_P(acRRName, PSTR("A")); break; -#endif - case DNS_RRTYPE_PTR: strcpy_P(acRRName, PSTR("PTR")); break; - case DNS_RRTYPE_TXT: strcpy_P(acRRName, PSTR("TXT")); break; -#ifdef MDNS2_IPV6_SUPPORT - case DNS_RRTYPE_AAAA: strcpy_P(acRRName, PSTR("AAAA")); break; -#endif - case DNS_RRTYPE_SRV: strcpy_P(acRRName, PSTR("SRV")); break; - case clsConsts::u8DNS_RRTYPE_NSEC: strcpy_P(acRRName, PSTR("NSEC")); break; - case DNS_RRTYPE_ANY: strcpy_P(acRRName, PSTR("ANY")); break; - default: sprintf_P(acRRName, PSTR("Unknown(0x%04X"), p_u16RRType); // MAX 15! - } - return acRRName; -} - -/* - clsLEAmDNS2_Host::_RRClass2String - -*/ -const char* clsLEAMDNSHost::_RRClass2String(uint16_t p_u16RRClass, - bool p_bIsQuery) const -{ - static char acClassString[16]; - *acClassString = 0; - - if (p_u16RRClass & 0x0001) - { - strcat_P(acClassString, PSTR("IN ")); // 3 - } - if (p_u16RRClass & 0x8000) - { - strcat_P(acClassString, (p_bIsQuery ? PSTR("UNICAST ") : PSTR("FLUSH "))); // 8/6 - } - - return acClassString; // 11 -} - -/* - clsLEAmDNS2_Host::_replyFlags2String - -*/ -const char* clsLEAMDNSHost::_replyFlags2String(uint32_t p_u32ReplyFlags) const -{ - static char acFlagsString[64]; - - *acFlagsString = 0; - if (p_u32ReplyFlags & static_cast(enuContentFlag::A)) - { - strcat_P(acFlagsString, PSTR("A ")); // 2 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::PTR_IPv4)) - { - strcat_P(acFlagsString, PSTR("PTR_IPv4 ")); // 7 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::PTR_IPv6)) - { - strcat_P(acFlagsString, PSTR("PTR_IPv6 ")); // 7 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::AAAA)) - { - strcat_P(acFlagsString, PSTR("AAAA ")); // 5 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::PTR_TYPE)) - { - strcat_P(acFlagsString, PSTR("PTR_TYPE ")); // 9 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::PTR_NAME)) - { - strcat_P(acFlagsString, PSTR("PTR_NAME ")); // 9 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::TXT)) - { - strcat_P(acFlagsString, PSTR("TXT ")); // 4 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::SRV)) - { - strcat_P(acFlagsString, PSTR("SRV ")); // 4 - } - if (p_u32ReplyFlags & static_cast(enuContentFlag::NSEC)) - { - strcat_P(acFlagsString, PSTR("NSEC ")); // 5 - } - - if (0 == p_u32ReplyFlags) - { - strcpy_P(acFlagsString, PSTR("none")); - } - - // Remove trailing spaces - while ((*acFlagsString) && - (' ' == acFlagsString[strlen(acFlagsString) - 1])) - { - acFlagsString[strlen(acFlagsString) - 1] = 0; - } - - return acFlagsString; // 63 -} - -/* - clsLEAmDNS2_Host::_NSECBitmap2String - -*/ -const char* clsLEAMDNSHost::_NSECBitmap2String(const clsNSECBitmap* p_pNSECBitmap) const -{ - static char acFlagsString[32]; - - *acFlagsString = 0; -#ifdef MDNS_IPV4_SUPPORT - if (p_pNSECBitmap->getBit(DNS_RRTYPE_A)) - { - strcat_P(acFlagsString, PSTR("A ")); // 2 - } -#endif - if (p_pNSECBitmap->getBit(DNS_RRTYPE_PTR)) - { - strcat_P(acFlagsString, PSTR("PTR ")); // 4 - } -#ifdef MDNS2_IPV6_SUPPORT - if (p_pNSECBitmap->getBit(DNS_RRTYPE_AAAA)) - { - strcat_P(acFlagsString, PSTR("AAAA ")); // 5 - } -#endif - if (p_pNSECBitmap->getBit(DNS_RRTYPE_TXT)) - { - strcat_P(acFlagsString, PSTR("TXT ")); // 4 - } - if (p_pNSECBitmap->getBit(DNS_RRTYPE_SRV)) - { - strcat_P(acFlagsString, PSTR("SRV ")); // 4 - } - if (p_pNSECBitmap->getBit(clsConsts::u8DNS_RRTYPE_NSEC)) - { - strcat_P(acFlagsString, PSTR("NSEC ")); // 5 - } - - if (!*acFlagsString) - { - strcpy_P(acFlagsString, PSTR("none")); - } - - return acFlagsString; // 31 -} - -#endif // DEBUG_ESP_PORT - - -} // namespace MDNSImplementation - - -} // namespace esp8266 - - - - diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Structs.cpp b/libraries/ESP8266mDNS/src/LEAmDNS2Host_Structs.cpp deleted file mode 100644 index 9c323bc32..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Structs.cpp +++ /dev/null @@ -1,3185 +0,0 @@ -/* - LEAmDNS2Host_Structs.cpp - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#include - -#include "ESP8266mDNS.h" -#include "LEAmDNS2Host.h" -#include "LEAmDNS2_Priv.h" - -namespace esp8266 -{ - - -namespace experimental -{ - - -/** - Internal CLASSES & STRUCTS -*/ - -/** - clsLEAMDNSHost::clsServiceTxt - - One MDNS TXT item. - m_pcValue may be '\0'. - Objects can be chained together (list). - A 'm_bTemp' flag differentiates between static and dynamic items. - Output as byte array 'c#=1' is supported. -*/ - -/* - clsLEAMDNSHost::clsServiceTxt::clsServiceTxt constructor - -*/ -clsLEAMDNSHost::clsServiceTxt::clsServiceTxt(const char* p_pcKey /*= 0*/, - const char* p_pcValue /*= 0*/, - bool p_bTemp /*= false*/) - : m_pcKey(0), - m_pcValue(0), - m_bTemp(p_bTemp) -{ - setKey(p_pcKey); - setValue(p_pcValue); -} - -/* - clsLEAMDNSHost::clsServiceTxt::clsServiceTxt copy-constructor - -*/ -clsLEAMDNSHost::clsServiceTxt::clsServiceTxt(const clsLEAMDNSHost::clsServiceTxt& p_Other) - : m_pcKey(0), - m_pcValue(0), - m_bTemp(false) -{ - operator=(p_Other); -} - -/* - clsLEAMDNSHost::clsServiceTxt::~stcServiceTxt destructor - -*/ -clsLEAMDNSHost::clsServiceTxt::~clsServiceTxt(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsServiceTxt::operator= - -*/ -clsLEAMDNSHost::clsServiceTxt& clsLEAMDNSHost::clsServiceTxt::operator=(const clsLEAMDNSHost::clsServiceTxt& p_Other) -{ - if (&p_Other != this) - { - clear(); - set(p_Other.m_pcKey, p_Other.m_pcValue, p_Other.m_bTemp); - } - return *this; -} - -/* - clsLEAMDNSHost::clsServiceTxt::clear - -*/ -bool clsLEAMDNSHost::clsServiceTxt::clear(void) -{ - releaseKey(); - releaseValue(); - return true; -} - -/* - clsLEAMDNSHost::clsServiceTxt::allocKey - -*/ -char* clsLEAMDNSHost::clsServiceTxt::allocKey(size_t p_stLength) -{ - releaseKey(); - if (p_stLength) - { - m_pcKey = new char[p_stLength + 1]; - } - return m_pcKey; -} - -/* - clsLEAMDNSHost::clsServiceTxt::setKey - -*/ -bool clsLEAMDNSHost::clsServiceTxt::setKey(const char* p_pcKey, - size_t p_stLength) -{ - bool bResult = false; - - releaseKey(); - if (p_stLength) - { - if (allocKey(p_stLength)) - { - strncpy(m_pcKey, p_pcKey, p_stLength + 1); - m_pcKey[p_stLength] = 0; - bResult = true; - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsServiceTxt::setKey - -*/ -bool clsLEAMDNSHost::clsServiceTxt::setKey(const char* p_pcKey) -{ - return setKey(p_pcKey, (p_pcKey ? strlen(p_pcKey) : 0)); -} - -/* - clsLEAMDNSHost::clsServiceTxt::releaseKey - -*/ -bool clsLEAMDNSHost::clsServiceTxt::releaseKey(void) -{ - if (m_pcKey) - { - delete[] m_pcKey; - m_pcKey = 0; - } - return true; -} - -/* - clsLEAMDNSHost::clsServiceTxt::allocValue - -*/ -char* clsLEAMDNSHost::clsServiceTxt::allocValue(size_t p_stLength) -{ - releaseValue(); - if (p_stLength) - { - m_pcValue = new char[p_stLength + 1]; - } - return m_pcValue; -} - -/* - clsLEAMDNSHost::clsServiceTxt::setValue - -*/ -bool clsLEAMDNSHost::clsServiceTxt::setValue(const char* p_pcValue, - size_t p_stLength) -{ - bool bResult = false; - - releaseValue(); - if (p_stLength) - { - if (allocValue(p_stLength)) - { - strncpy(m_pcValue, p_pcValue, p_stLength + 1); - m_pcValue[p_stLength] = 0; - bResult = true; - } - } - else - { - // No value -> also OK - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsServiceTxt::setValue - -*/ -bool clsLEAMDNSHost::clsServiceTxt::setValue(const char* p_pcValue) -{ - return setValue(p_pcValue, (p_pcValue ? strlen(p_pcValue) : 0)); -} - -/* - clsLEAMDNSHost::clsServiceTxt::releaseValue - -*/ -bool clsLEAMDNSHost::clsServiceTxt::releaseValue(void) -{ - if (m_pcValue) - { - delete[] m_pcValue; - m_pcValue = 0; - } - return true; -} - -/* - clsLEAMDNSHost::clsServiceTxt::set - -*/ -bool clsLEAMDNSHost::clsServiceTxt::set(const char* p_pcKey, - const char* p_pcValue, - bool p_bTemp /*= false*/) -{ - m_bTemp = p_bTemp; - return ((setKey(p_pcKey)) && - (setValue(p_pcValue))); -} - -/* - clsLEAMDNSHost::clsServiceTxt::update - -*/ -bool clsLEAMDNSHost::clsServiceTxt::update(const char* p_pcValue) -{ - return setValue(p_pcValue); -} - -/* - clsLEAMDNSHost::clsServiceTxt::length - - length of eg. 'c#=1' without any closing '\0' - -*/ -size_t clsLEAMDNSHost::clsServiceTxt::length(void) const -{ - size_t stLength = 0; - if (m_pcKey) - { - stLength += strlen(m_pcKey); // Key - stLength += 1; // '=' - stLength += (m_pcValue ? strlen(m_pcValue) : 0); // Value - } - return stLength; -} - - -/** - clsLEAMDNSHost::clsServiceTxts - - A list of zero or more MDNS TXT (stcServiceTxt) items. - Dynamic TXT items can be removed by 'removeTempTxts'. - A TXT item can be looked up by its 'key' member. - Export as ';'-separated byte array is supported. - Export as 'length byte coded' byte array is supported. - Comparison ((all A TXT items in B and equal) AND (all B TXT items in A and equal)) is supported. - -*/ - -/* - clsLEAMDNSHost::clsServiceTxts::clsServiceTxts contructor - -*/ -clsLEAMDNSHost::clsServiceTxts::clsServiceTxts(void) - : m_pcCache(0) -{ -} - -/* - clsLEAMDNSHost::clsServiceTxts::clsServiceTxts copy-constructor - -*/ -clsLEAMDNSHost::clsServiceTxts::clsServiceTxts(const clsServiceTxts& p_Other) - : m_pcCache(0) -{ - operator=(p_Other); -} - -/* - clsLEAMDNSHost::clsServiceTxts::~stcServiceTxts destructor - -*/ -clsLEAMDNSHost::clsServiceTxts::~clsServiceTxts(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsServiceTxts::operator= - -*/ -clsLEAMDNSHost::clsServiceTxts& clsLEAMDNSHost::clsServiceTxts::operator=(const clsServiceTxts& p_Other) -{ - if (this != &p_Other) - { - clear(); - - for (const clsServiceTxt* pOtherTxt : p_Other.m_Txts) - { - add(new clsServiceTxt(*pOtherTxt)); - } - } - return *this; -} - -/* - clsLEAMDNSHost::clsServiceTxts::clear - -*/ -bool clsLEAMDNSHost::clsServiceTxts::clear(void) -{ - for (clsServiceTxt* pTxt : m_Txts) - { - delete pTxt; - } - m_Txts.clear(); - - return clearCache(); -} - -/* - clsLEAMDNSHost::clsServiceTxts::clearCache - -*/ -bool clsLEAMDNSHost::clsServiceTxts::clearCache(void) -{ - if (m_pcCache) - { - delete[] m_pcCache; - m_pcCache = 0; - } - return true; -} - -/* - clsLEAMDNSHost::clsServiceTxts::add - -*/ -bool clsLEAMDNSHost::clsServiceTxts::add(clsLEAMDNSHost::clsServiceTxt* p_pTxt) -{ - bool bResult = false; - - if (p_pTxt) - { - m_Txts.push_back(p_pTxt); - bResult = true; - } - return ((clearCache()) && - (bResult)); -} - -/* - clsLEAMDNSHost::clsServiceTxts::remove - -*/ -bool clsLEAMDNSHost::clsServiceTxts::remove(clsServiceTxt* p_pTxt) -{ - bool bResult = false; - - clsServiceTxt::list::iterator it(p_pTxt - ? std::find(m_Txts.begin(), m_Txts.end(), p_pTxt) - : m_Txts.end()); - if (m_Txts.end() != it) - { - m_Txts.erase(it); - delete p_pTxt; - - bResult = true; - } - return ((clearCache()) && - (bResult)); -} - -/* - clsLEAMDNSHost::clsServiceTxts::count - -*/ -size_t clsLEAMDNSHost::clsServiceTxts::count(void) const -{ - size_t stResult = m_Txts.size(); - return stResult; -} - -/* - clsLEAMDNSHost::clsServiceTxts::removeTempTxts - -*/ -bool clsLEAMDNSHost::clsServiceTxts::removeTempTxts(void) -{ - bool bResult = true; - - // Delete content - clsServiceTxt::list tempTxts; - for (clsServiceTxt* pTxt : m_Txts) - { - if (pTxt->m_bTemp) - { - tempTxts.push_back(pTxt); - delete pTxt; - } - } - // Remove objects from list - for (clsServiceTxt* pTempTxt : tempTxts) - { - m_Txts.remove(pTempTxt); - } - return ((clearCache()) && - (bResult)); -} - -/* - clsLEAMDNSHost::clsServiceTxts::find - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsServiceTxts::find(const char* p_pcKey) -{ - clsServiceTxt* pResult = 0; - - for (clsServiceTxt* pTxt : m_Txts) - { - if ((p_pcKey) && - (0 == strcmp(pTxt->m_pcKey, p_pcKey))) - { - pResult = pTxt; - break; - } - } - return pResult; -} - -/* - clsLEAMDNSHost::clsServiceTxts::find (const) - -*/ -const clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsServiceTxts::find(const char* p_pcKey) const -{ - const clsServiceTxt* pResult = 0; - - for (const clsServiceTxt* pTxt : m_Txts) - { - if ((p_pcKey) && - (0 == strcmp(pTxt->m_pcKey, p_pcKey))) - { - pResult = pTxt; - break; - } - } - return pResult; -} - -/* - clsLEAMDNSHost::clsServiceTxts::find - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsServiceTxts::find(const clsServiceTxt* p_pTxt) -{ - clsServiceTxt* pResult = 0; - - for (clsServiceTxt* pTxt : m_Txts) - { - if (p_pTxt == pTxt) - { - pResult = pTxt; - break; - } - } - return pResult; -} - -/* - clsLEAMDNSHost::clsServiceTxts::length - -*/ -size_t clsLEAMDNSHost::clsServiceTxts::length(void) const -{ - size_t szLength = 0; - - for (clsServiceTxt* pTxt : m_Txts) - { - szLength += 1; // Length byte - szLength += pTxt->length(); // Text - } - return szLength; -} - -/* - clsLEAMDNSHost::clsServiceTxts::c_strLength - - (incl. closing '\0'). Length bytes place is used for delimiting ';' and closing '\0' - -*/ -size_t clsLEAMDNSHost::clsServiceTxts::c_strLength(void) const -{ - return length(); -} - -/* - clsLEAMDNSHost::clsServiceTxts::c_str - -*/ -bool clsLEAMDNSHost::clsServiceTxts::c_str(char* p_pcBuffer) -{ - bool bResult = false; - - if (p_pcBuffer) - { - bResult = true; - - char* pcCursor = p_pcBuffer; - *pcCursor = 0; - for (const clsServiceTxt* pTxt : m_Txts) - { - size_t stLength; - if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0))))) - { - if (pcCursor != p_pcBuffer) - { - *pcCursor++ = ';'; - } - strcpy(pcCursor, pTxt->m_pcKey); - pcCursor += stLength; - *pcCursor++ = '='; - if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0))) - { - strcpy(pcCursor, pTxt->m_pcValue); - pcCursor += stLength; - } - } - else - { - break; - } - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsServiceTxts::c_str - -*/ -const char* clsLEAMDNSHost::clsServiceTxts::c_str(void) const -{ - - if ((!m_pcCache) && - (m_Txts.size()) && - ((((clsServiceTxts*)this)->m_pcCache = new char[c_strLength()]))) // TRANSPARENT caching - { - ((clsServiceTxts*)this)->c_str(m_pcCache); - } - return m_pcCache; -} - -/* - clsLEAMDNSHost::clsServiceTxts::bufferLength - - (incl. closing '\0'). - -*/ -size_t clsLEAMDNSHost::clsServiceTxts::bufferLength(void) const -{ - return (length() + 1); -} - -/* - clsLEAMDNSHost::clsServiceTxts::buffer - -*/ -bool clsLEAMDNSHost::clsServiceTxts::buffer(char* p_pcBuffer) -{ - bool bResult = false; - - if (p_pcBuffer) - { - bResult = true; - - *p_pcBuffer = 0; - for (const clsServiceTxt* pTxt : m_Txts) - { - *(unsigned char*)p_pcBuffer++ = pTxt->length(); - size_t stLength; - if ((bResult = (0 != (stLength = (pTxt->m_pcKey ? strlen(pTxt->m_pcKey) : 0))))) - { - strcpy(p_pcBuffer, pTxt->m_pcKey); - p_pcBuffer += stLength; - *p_pcBuffer++ = '='; - if ((stLength = (pTxt->m_pcValue ? strlen(pTxt->m_pcValue) : 0))) - { - strcpy(p_pcBuffer, pTxt->m_pcValue); - p_pcBuffer += stLength; - } - } - else - { - break; - } - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsServiceTxts::compare - -*/ -bool clsLEAMDNSHost::clsServiceTxts::compare(const clsLEAMDNSHost::clsServiceTxts& p_Other) const -{ - bool bResult = false; - - if ((bResult = (length() == p_Other.length()))) - { - // Compare A->B - for (const clsServiceTxt* pTxt : m_Txts) - { - const clsServiceTxt* pOtherTxt = p_Other.find(pTxt->m_pcKey); - if (!((bResult = ((pOtherTxt) && - (pTxt->m_pcValue) && - (pOtherTxt->m_pcValue) && - (0 == strcmp(pTxt->m_pcValue, pOtherTxt->m_pcValue)))))) - { - break; - } - } - // Compare B->A - for (const clsServiceTxt* pOtherTxt : p_Other.m_Txts) - { - const clsServiceTxt* pTxt = find(pOtherTxt->m_pcKey); - if (!((bResult = ((pTxt) && - (pOtherTxt->m_pcValue) && - (pTxt->m_pcValue) && - (0 == strcmp(pOtherTxt->m_pcValue, pTxt->m_pcValue)))))) - { - break; - } - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsServiceTxts::operator== - -*/ -bool clsLEAMDNSHost::clsServiceTxts::operator==(const clsServiceTxts& p_Other) const -{ - return compare(p_Other); -} - -/* - clsLEAMDNSHost::clsServiceTxts::operator!= - -*/ -bool clsLEAMDNSHost::clsServiceTxts::operator!=(const clsServiceTxts& p_Other) const -{ - return !compare(p_Other); -} - - -/** - clsLEAMDNSHost::clsProbeInformation_Base - - Probing status information for a host or service domain - -*/ - -/* - clsLEAMDNSHost::clsProbeInformation_Base::clsProbeInformation_Base constructor -*/ -clsLEAMDNSHost::clsProbeInformation_Base::clsProbeInformation_Base(void) - : m_ProbingStatus(enuProbingStatus::WaitingForData), - m_u32SentCount(0), - m_Timeout(std::numeric_limits::max()), - m_bConflict(false), - m_bTiebreakNeeded(false) -{ -} - -/* - clsLEAMDNSHost::clsProbeInformation_Base::clear -*/ -bool clsLEAMDNSHost::clsProbeInformation_Base::clear(void) -{ - m_ProbingStatus = enuProbingStatus::WaitingForData; - m_u32SentCount = 0; - m_Timeout.reset(std::numeric_limits::max()); - m_bConflict = false; - m_bTiebreakNeeded = false; - - return true; -} - - -/** - clsLEAMDNSHost::clsProbeInformation_Host - - Probing status information for a host or service domain - -*/ - -/* - clsLEAMDNSHost::clsProbeInformation::clsProbeInformation constructor -*/ -clsLEAMDNSHost::clsProbeInformation::clsProbeInformation(void) - : m_fnProbeResultCallback(0) -{ -} - -/* - clsLEAMDNSHost::clsProbeInformation::clear -*/ -bool clsLEAMDNSHost::clsProbeInformation::clear(bool p_bClearUserdata /*= false*/) -{ - if (p_bClearUserdata) - { - m_fnProbeResultCallback = 0; - } - return clsProbeInformation_Base::clear(); -} - - -/** - clsLEAMDNSHost::clsService::clsProbeInformation - - Probing status information for a host or service domain - -*/ - -/* - clsLEAMDNSHost::clsService::clsProbeInformation::clsProbeInformation constructor -*/ -clsLEAMDNSHost::clsService::clsProbeInformation::clsProbeInformation(void) - : m_fnProbeResultCallback(0) -{ -} - -/* - clsLEAMDNSHost::clsService::clsProbeInformation::clear -*/ -bool clsLEAMDNSHost::clsService::clsProbeInformation::clear(bool p_bClearUserdata /*= false*/) -{ - if (p_bClearUserdata) - { - m_fnProbeResultCallback = 0; - } - return clsProbeInformation_Base::clear(); -} - - -/** - clsLEAMDNSHost::clsService - - A MDNS service object (to be announced by the MDNS responder) - The service instance may be '\0'; in this case the hostname is used - and the flag m_bAutoName is set. If the hostname changes, all 'auto- - named' services are renamed also. - m_u8Replymask is used while preparing a response to a MDNS query. It is - resetted in '_sendMDNSMessage' afterwards. -*/ - -/* - clsLEAMDNSHost::clsService::clsService constructor - -*/ -clsLEAMDNSHost::clsService::clsService(void) - : m_pcInstanceName(0), - m_bAutoName(false), - m_pcType(0), - m_pcProtocol(0), - m_u16Port(0), - m_u32ReplyMask(0), - m_fnTxtCallback(0) -{ -} - -/* - clsLEAMDNSHost::clsService::~clsService destructor - -*/ -clsLEAMDNSHost::clsService::~clsService(void) -{ - _releaseInstanceName(); - _releaseType(); - _releaseProtocol(); -} - -/* - clsLEAMDNSHost::clsService::setInstanceName - -*/ -bool clsLEAMDNSHost::clsService::setInstanceName(const char* p_pcInstanceName) -{ - bool bResult = false; - - _releaseInstanceName(); - size_t stLength = (p_pcInstanceName ? strlen(p_pcInstanceName) : 0); - if ((stLength) && - (stLength <= clsConsts::stDomainLabelMaxLength)) - { - if ((bResult = (0 != (m_pcInstanceName = new char[stLength + 1])))) - { - strcpy(m_pcInstanceName, p_pcInstanceName); - _resetProbeStatus(); - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsService::indexInstanceName - -*/ -bool clsLEAMDNSHost::clsService::indexInstanceName(void) -{ - bool bResult = false; - - if ((bResult = setInstanceName(clsLEAMDNSHost::indexDomainName(m_pcInstanceName, "#", 0)))) - { - _resetProbeStatus(); - } - return bResult; -} - -/* - clsLEAMDNSHost::clsService::instanceName - -*/ -const char* clsLEAMDNSHost::clsService::instanceName(void) const -{ - return m_pcInstanceName; -} - -/* - clsLEAMDNSHost::clsService::_releaseInstanceName - -*/ -bool clsLEAMDNSHost::clsService::_releaseInstanceName(void) -{ - if (m_pcInstanceName) - { - delete[] m_pcInstanceName; - m_pcInstanceName = 0; - } - return true; -} - -/* - clsLEAMDNSHost::clsService::setType - -*/ -bool clsLEAMDNSHost::clsService::setType(const char* p_pcType) -{ - bool bResult = false; - - _releaseType(); - size_t stLength = (p_pcType ? strlen(p_pcType) : 0); - if ((stLength) && - (stLength <= clsConsts::stServiceTypeMaxLength)) - { - if ((bResult = (0 != (m_pcType = new char[stLength + 1])))) - { - strcpy(m_pcType, p_pcType); - _resetProbeStatus(); - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsService::type - -*/ -const char* clsLEAMDNSHost::clsService::type(void) const -{ - return m_pcType; -} - -/* - clsLEAMDNSHost::clsService::_releaseType - -*/ -bool clsLEAMDNSHost::clsService::_releaseType(void) -{ - if (m_pcType) - { - delete[] m_pcType; - m_pcType = 0; - } - return true; -} - -/* - clsLEAMDNSHost::clsService::setProtocol - -*/ -bool clsLEAMDNSHost::clsService::setProtocol(const char* p_pcProtocol) -{ - bool bResult = false; - - _releaseProtocol(); - size_t stLength = (p_pcProtocol ? strlen(p_pcProtocol) : 0); - if ((stLength) && - (stLength <= clsConsts::stServiceProtocolMaxLength)) - { - if ((bResult = (0 != (m_pcProtocol = new char[stLength + 1])))) - { - strcpy(m_pcProtocol, p_pcProtocol); - _resetProbeStatus(); - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsService::protocol - -*/ -const char* clsLEAMDNSHost::clsService::protocol(void) const -{ - return m_pcProtocol; -} - -/* - clsLEAMDNSHost::clsService::_releaseProtocol - -*/ -bool clsLEAMDNSHost::clsService::_releaseProtocol(void) -{ - if (m_pcProtocol) - { - delete[] m_pcProtocol; - m_pcProtocol = 0; - } - return true; -} - -/* - clsLEAMDNSHost::clsService::setPort - -*/ -bool clsLEAMDNSHost::clsService::setPort(uint16_t p_u16Port) -{ - bool bResult = false; - - if ((bResult = (0 != p_u16Port))) - { - m_u16Port = p_u16Port; - - _resetProbeStatus(); - } - return bResult; -} - -/* - clsLEAMDNSHost::clsService::port - -*/ -uint16_t clsLEAMDNSHost::clsService::port(void) const -{ - return m_u16Port; -} - -/* - clsLEAMDNSHost::clsService::setProbeResultCallback - -*/ -bool clsLEAMDNSHost::clsService::setProbeResultCallback(fnProbeResultCallback p_fnProbeResultCallback) -{ - m_ProbeInformation.m_fnProbeResultCallback = p_fnProbeResultCallback; - return true; -} - -/* - clsLEAMDNSHost::clsService::probeStatus - -*/ -bool clsLEAMDNSHost::clsService::probeStatus(void) const -{ - return (clsProbeInformation_Base::enuProbingStatus::DoneFinally == m_ProbeInformation.m_ProbingStatus); -} - -/* - clsLEAMDNSHost::clsService::_resetProbeStatus - -*/ -void clsLEAMDNSHost::clsService::_resetProbeStatus(void) -{ - m_ProbeInformation.clear(false); - m_ProbeInformation.m_ProbingStatus = clsProbeInformation_Base::enuProbingStatus::ReadyToStart; -} - -/* - clsLEAMDNSHost::clsService::addServiceTxt (const char*) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addServiceTxt(const char* p_pcKey, - const char* p_pcValue) -{ - return _addServiceTxt(p_pcKey, p_pcValue, false); -} - -/* - clsLEAMDNSHost::clsService::addServiceTxt (uint32_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addServiceTxt(const char* p_pcKey, - uint32_t p_u32Value) -{ - return _addServiceTxt(p_pcKey, p_u32Value, false); -} - -/* - clsLEAMDNSHost::clsService::addServiceTxt (uint16_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addServiceTxt(const char* p_pcKey, - uint16_t p_u16Value) -{ - return _addServiceTxt(p_pcKey, p_u16Value, false); -} - -/* - clsLEAMDNSHost::clsService::addServiceTxt (uint8_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addServiceTxt(const char* p_pcKey, - uint8_t p_u8Value) -{ - return _addServiceTxt(p_pcKey, p_u8Value, false); -} - -/* - clsLEAMDNSHost::clsService::addServiceTxt (int32_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addServiceTxt(const char* p_pcKey, - int32_t p_i32Value) -{ - return _addServiceTxt(p_pcKey, p_i32Value, false); -} - -/* - clsLEAMDNSHost::clsService::addServiceTxt (int16_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addServiceTxt(const char* p_pcKey, - int16_t p_i16Value) -{ - return _addServiceTxt(p_pcKey, p_i16Value, false); -} - -/* - clsLEAMDNSHost::clsService::addServiceTxt (int8_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addServiceTxt(const char* p_pcKey, - int8_t p_i8Value) -{ - return _addServiceTxt(p_pcKey, p_i8Value, false); -} - -/* - clsLEAMDNSHost::clsService::addDynamicServiceTxt (const char*) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addDynamicServiceTxt(const char* p_pcKey, - const char* p_pcValue) -{ - return _addServiceTxt(p_pcKey, p_pcValue, true); -} - -/* - clsLEAMDNSHost::clsService::addDynamicServiceTxt (uint32_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addDynamicServiceTxt(const char* p_pcKey, - uint32_t p_u32Value) -{ - return _addServiceTxt(p_pcKey, p_u32Value, true); -} - -/* - clsLEAMDNSHost::clsService::addDynamicServiceTxt (uint16_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addDynamicServiceTxt(const char* p_pcKey, - uint16_t p_u16Value) -{ - return _addServiceTxt(p_pcKey, p_u16Value, true); -} - -/* - clsLEAMDNSHost::clsService::addDynamicServiceTxt (uint8_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addDynamicServiceTxt(const char* p_pcKey, - uint8_t p_u8Value) -{ - return _addServiceTxt(p_pcKey, p_u8Value, true); -} - -/* - clsLEAMDNSHost::clsService::addDynamicServiceTxt (int32_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addDynamicServiceTxt(const char* p_pcKey, - int32_t p_i32Value) -{ - return _addServiceTxt(p_pcKey, p_i32Value, true); -} - -/* - clsLEAMDNSHost::clsService::addDynamicServiceTxt (int16_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addDynamicServiceTxt(const char* p_pcKey, - int16_t p_i16Value) -{ - return _addServiceTxt(p_pcKey, p_i16Value, true); -} - -/* - clsLEAMDNSHost::clsService::addDynamicServiceTxt (int8_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::addDynamicServiceTxt(const char* p_pcKey, - int8_t p_i8Value) -{ - return _addServiceTxt(p_pcKey, p_i8Value, true); -} - -/* - clsLEAMDNSHost::clsService::setDynamicServiceTxtCallback - -*/ -bool clsLEAMDNSHost::clsService::setDynamicServiceTxtCallback(fnDynamicServiceTxtCallback p_fnCallback) -{ - m_fnTxtCallback = p_fnCallback; - return true; -} - -/* - clsLEAMDNSHost::clsService::_addServiceTxt (const char*) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::_addServiceTxt(const char* p_pcKey, - const char* p_pcValue, - bool p_bTemp) -{ - clsServiceTxt* pServiceTxt = 0; - - if ((p_pcKey) && - (*p_pcKey)) - { - if ((pServiceTxt = m_Txts.find(p_pcKey))) - { - // Change existing TXT - if (clsConsts::stServiceTxtMaxLength > (m_Txts.length() - - (pServiceTxt->m_pcValue ? strlen(pServiceTxt->m_pcValue) : 0) + - (p_pcValue ? strlen(p_pcValue) : 0))) - { - // Enough space left for changed content - if (!pServiceTxt->update(p_pcValue)) - { - // FAILED to update - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[LEAmDNS2_Host] clsService::_addServiceTxt: FAILED to update TXT item '%s'!\n"), p_pcKey)); - pServiceTxt = 0; - } - } - else - { - // NOT enough space for changed TXT content - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[LEAmDNS2_Host] clsService::_addServiceTxt: FAILED to change TXT item '%s' (too large)!\n"), p_pcKey)); - pServiceTxt = 0; - } - } - else - { - // Create new TXT - if (clsConsts::stServiceTxtMaxLength > (m_Txts.length() + - 1 + // Length byte - (p_pcKey ? strlen(p_pcKey) : 0) + - 1 + // '=' - (p_pcValue ? strlen(p_pcValue) : 0))) - { - if (!(((pServiceTxt = new clsServiceTxt)) && - (pServiceTxt->set(p_pcKey, p_pcValue, p_bTemp)) && - (m_Txts.add(pServiceTxt)))) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[LEAmDNS2_Host] clsService::_addServiceTxt: FAILED to add TXT item '%s'!\n"), p_pcKey)); - if (pServiceTxt) - { - delete pServiceTxt; - pServiceTxt = 0; - } - } - } - else - { - // NOT enough space for added TXT item - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("[LEAmDNS2_Host] clsService::_addServiceTxt: FAILED to add TXT item '%s' (too large)!\n"), p_pcKey)); - pServiceTxt = 0; - } - } - } - return pServiceTxt; -} - -/* - clsLEAMDNSHost::clsService::_addServiceTxt (uint32_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::_addServiceTxt(const char* p_pcKey, - uint32_t p_u32Value, - bool p_bTemp) -{ - char acValueBuffer[16]; // 32-bit max 10 digits - *acValueBuffer = 0; - sprintf(acValueBuffer, "%u", p_u32Value); - - return _addServiceTxt(p_pcKey, acValueBuffer, p_bTemp); -} - -/* - clsLEAMDNSHost::clsService::_addServiceTxt (int32_t) - -*/ -clsLEAMDNSHost::clsServiceTxt* clsLEAMDNSHost::clsService::_addServiceTxt(const char* p_pcKey, - int32_t p_i32Value, - bool p_bTemp) -{ - char acValueBuffer[16]; // 32-bit max 10 digits - *acValueBuffer = 0; - sprintf(acValueBuffer, "%i", p_i32Value); - - return _addServiceTxt(p_pcKey, acValueBuffer, p_bTemp); -} - -/** - clsLEAMDNSHost::clsMsgHeader - - A MDNS message header. - -*/ - -/* - clsLEAMDNSHost::clsMsgHeader::clsMsgHeader - -*/ -clsLEAMDNSHost::clsMsgHeader::clsMsgHeader(uint16_t p_u16ID /*= 0*/, - bool p_bQR /*= false*/, - uint8_t p_u8Opcode /*= 0*/, - bool p_bAA /*= false*/, - bool p_bTC /*= false*/, - bool p_bRD /*= false*/, - bool p_bRA /*= false*/, - uint8_t p_u8RCode /*= 0*/, - uint16_t p_u16QDCount /*= 0*/, - uint16_t p_u16ANCount /*= 0*/, - uint16_t p_u16NSCount /*= 0*/, - uint16_t p_u16ARCount /*= 0*/) - : m_u16ID(p_u16ID), - m_1bQR(p_bQR), m_4bOpcode(p_u8Opcode), m_1bAA(p_bAA), m_1bTC(p_bTC), m_1bRD(p_bRD), - m_1bRA(p_bRA), m_3bZ(0), m_4bRCode(p_u8RCode), - m_u16QDCount(p_u16QDCount), - m_u16ANCount(p_u16ANCount), - m_u16NSCount(p_u16NSCount), - m_u16ARCount(p_u16ARCount) -{ -} - - -/** - clsLEAMDNSHost::clsRRDomain - - A MDNS domain object. - The labels of the domain are stored (DNS-like encoded) in 'm_acName': - [length byte]varlength label[length byte]varlength label[0] - 'm_u16NameLength' stores the used length of 'm_acName'. - Dynamic label addition is supported. - Comparison is supported. - Export as byte array 'esp8266.local' is supported. - -*/ - -/* - clsLEAMDNSHost::clsRRDomain::clsRRDomain constructor - -*/ -clsLEAMDNSHost::clsRRDomain::clsRRDomain(void) - : m_u16NameLength(0), - m_pcDecodedName(0) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRDomain::clsRRDomain copy-constructor - -*/ -clsLEAMDNSHost::clsRRDomain::clsRRDomain(const clsRRDomain& p_Other) - : m_u16NameLength(0), - m_pcDecodedName(0) -{ - operator=(p_Other); -} - -/* - clsLEAMDNSHost::clsRRDomain::clsRRDomain destructor - -*/ -clsLEAMDNSHost::clsRRDomain::~clsRRDomain(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRDomain::operator = - -*/ -clsLEAMDNSHost::clsRRDomain& clsLEAMDNSHost::clsRRDomain::operator=(const clsRRDomain& p_Other) -{ - if (&p_Other != this) - { - clear(); - memcpy(m_acName, p_Other.m_acName, sizeof(m_acName)); - m_u16NameLength = p_Other.m_u16NameLength; - } - return *this; -} - -/* - clsLEAMDNSHost::clsRRDomain::clear - -*/ -bool clsLEAMDNSHost::clsRRDomain::clear(void) -{ - memset(m_acName, 0, sizeof(m_acName)); - m_u16NameLength = 0; - return clearNameCache(); -} - -/* - clsLEAMDNSHost::clsRRDomain::clearNameCache - -*/ -bool clsLEAMDNSHost::clsRRDomain::clearNameCache(void) -{ - if (m_pcDecodedName) - { - delete[] m_pcDecodedName; - m_pcDecodedName = 0; - } - return true; -} - -/* - clsLEAMDNSHost::clsRRDomain::addLabel - -*/ -bool clsLEAMDNSHost::clsRRDomain::addLabel(const char* p_pcLabel, - bool p_bPrependUnderline /*= false*/) -{ - bool bResult = false; - - size_t stLength = (p_pcLabel - ? (strlen(p_pcLabel) + (p_bPrependUnderline ? 1 : 0)) - : 0); - if ((clsConsts::stDomainLabelMaxLength >= stLength) && - (clsConsts::stDomainMaxLength >= (m_u16NameLength + (1 + stLength)))) - { - // Length byte - m_acName[m_u16NameLength] = (unsigned char)stLength; // Might be 0! - ++m_u16NameLength; - // Label - if (stLength) - { - if (p_bPrependUnderline) - { - m_acName[m_u16NameLength++] = '_'; - --stLength; - } - strcpy(&(m_acName[m_u16NameLength]), p_pcLabel); - m_u16NameLength += stLength; - } - bResult = clearNameCache(); - } - return bResult; -} - -/* - clsLEAMDNSHost::clsRRDomain::compare - -*/ -bool clsLEAMDNSHost::clsRRDomain::compare(const clsRRDomain& p_Other) const -{ - bool bResult = false; - - if (m_u16NameLength == p_Other.m_u16NameLength) - { - const char* pT = m_acName; - const char* pO = p_Other.m_acName; - while ((pT) && - (pO) && - (*((unsigned char*)pT) == *((unsigned char*)pO)) && // Same length AND - (0 == strncasecmp((pT + 1), (pO + 1), *((unsigned char*)pT)))) // Same content - { - if (*((unsigned char*)pT)) // Not 0 - { - pT += (1 + * ((unsigned char*)pT)); // Shift by length byte and length - pO += (1 + * ((unsigned char*)pO)); - } - else // Is 0 -> Successfully reached the end - { - bResult = true; - break; - } - } - } - return bResult; -} - -/* - clsLEAMDNSHost::clsRRDomain::operator == - -*/ -bool clsLEAMDNSHost::clsRRDomain::operator==(const clsRRDomain& p_Other) const -{ - return compare(p_Other); -} - -/* - clsLEAMDNSHost::clsRRDomain::operator != - -*/ -bool clsLEAMDNSHost::clsRRDomain::operator!=(const clsRRDomain& p_Other) const -{ - return !compare(p_Other); -} - -/* - clsLEAMDNSHost::clsRRDomain::operator > - -*/ -bool clsLEAMDNSHost::clsRRDomain::operator>(const clsRRDomain& p_Other) const -{ - // TODO: Check, if this is a good idea... - return !compare(p_Other); -} - -/* - clsLEAMDNSHost::clsRRDomain::c_strLength - -*/ -size_t clsLEAMDNSHost::clsRRDomain::c_strLength(void) const -{ - size_t stLength = 0; - - unsigned char* pucLabelLength = (unsigned char*)m_acName; - while (*pucLabelLength) - { - stLength += (*pucLabelLength + 1 /* +1 for '.' or '\0'*/); - pucLabelLength += (*pucLabelLength + 1); - } - return stLength; -} - -/* - clsLEAMDNSHost::clsRRDomain::c_str (const) - -*/ -bool clsLEAMDNSHost::clsRRDomain::c_str(char* p_pcBuffer) const -{ - bool bResult = false; - - if (p_pcBuffer) - { - *p_pcBuffer = 0; - unsigned char* pucLabelLength = (unsigned char*)m_acName; - while (*pucLabelLength) - { - memcpy(p_pcBuffer, (const char*)(pucLabelLength + 1), *pucLabelLength); - p_pcBuffer += *pucLabelLength; - pucLabelLength += (*pucLabelLength + 1); - *p_pcBuffer++ = (*pucLabelLength ? '.' : '\0'); - } - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsRRDomain::c_str - -*/ -const char* clsLEAMDNSHost::clsRRDomain::c_str(void) const -{ - if ((!m_pcDecodedName) && - (m_u16NameLength) && - ((((clsRRDomain*)this)->m_pcDecodedName = new char[c_strLength()]))) // TRANSPARENT caching - { - ((clsRRDomain*)this)->c_str(m_pcDecodedName); - } - return m_pcDecodedName; -} - - -/** - clsLEAMDNSHost::clsRRAttributes - - A MDNS attributes object. - -*/ - -/* - clsLEAMDNSHost::clsRRAttributes::clsRRAttributes constructor - -*/ -clsLEAMDNSHost::clsRRAttributes::clsRRAttributes(uint16_t p_u16Type /*= 0*/, - uint16_t p_u16Class /*= 1 DNS_RRCLASS_IN Internet*/) - : m_u16Type(p_u16Type), - m_u16Class(p_u16Class) -{ -} - -/* - clsLEAMDNSHost::clsRRAttributes::clsRRAttributes copy-constructor - -*/ -clsLEAMDNSHost::clsRRAttributes::clsRRAttributes(const clsLEAMDNSHost::clsRRAttributes& p_Other) -{ - operator=(p_Other); -} - -/* - clsLEAMDNSHost::clsRRAttributes::operator = - -*/ -clsLEAMDNSHost::clsRRAttributes& clsLEAMDNSHost::clsRRAttributes::operator=(const clsLEAMDNSHost::clsRRAttributes& p_Other) -{ - if (&p_Other != this) - { - m_u16Type = p_Other.m_u16Type; - m_u16Class = p_Other.m_u16Class; - } - return *this; -} - - -/** - clsLEAMDNSHost::clsRRHeader - - A MDNS record header (domain and attributes) object. - -*/ - -/* - clsLEAMDNSHost::clsRRHeader::clsRRHeader constructor - -*/ -clsLEAMDNSHost::clsRRHeader::clsRRHeader(void) -{ -} - -/* - clsLEAMDNSHost::clsRRHeader::clsRRHeader copy-constructor - -*/ -clsLEAMDNSHost::clsRRHeader::clsRRHeader(const clsRRHeader& p_Other) -{ - operator=(p_Other); -} - -/* - clsLEAMDNSHost::clsRRHeader::operator = - -*/ -clsLEAMDNSHost::clsRRHeader& clsLEAMDNSHost::clsRRHeader::operator=(const clsLEAMDNSHost::clsRRHeader& p_Other) -{ - if (&p_Other != this) - { - m_Domain = p_Other.m_Domain; - m_Attributes = p_Other.m_Attributes; - } - return *this; -} - -/* - clsLEAMDNSHost::clsRRHeader::clear - -*/ -bool clsLEAMDNSHost::clsRRHeader::clear(void) -{ - m_Domain.clear(); - return true; -} - - -/** - clsLEAMDNSHost::clsRRQuestion - - A MDNS question record object (header + question flags) - -*/ - -/* - clsLEAMDNSHost::clsRRQuestion::clsRRQuestion constructor -*/ -clsLEAMDNSHost::clsRRQuestion::clsRRQuestion(void) - : m_bUnicast(false) -{ -} - - -/** - clsLEAMDNSHost::clsNSECBitmap - - A MDNS question record object (header + question flags) - -*/ - -/* - clsLEAMDNSHost::clsNSECBitmap::clsNSECBitmap constructor - -*/ -clsLEAMDNSHost::clsNSECBitmap::clsNSECBitmap(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsNSECBitmap::clsNSECBitmap destructor - -*/ -bool clsLEAMDNSHost::clsNSECBitmap::clear(void) -{ - memset(m_au8BitmapData, 0, sizeof(m_au8BitmapData)); - return true; -} - -/* - clsLEAMDNSHost::clsNSECBitmap::length - -*/ -uint16_t clsLEAMDNSHost::clsNSECBitmap::length(void) const -{ - return sizeof(m_au8BitmapData); // 6 -} - -/* - clsLEAMDNSHost::clsNSECBitmap::setBit - -*/ -bool clsLEAMDNSHost::clsNSECBitmap::setBit(uint16_t p_u16Bit) -{ - bool bResult = false; - - if ((p_u16Bit) && - (length() > (p_u16Bit / 8))) // bit between 0..47(2F) - { - - uint8_t& ru8Byte = m_au8BitmapData[p_u16Bit / 8]; - uint8_t u8Flag = 1 << (7 - (p_u16Bit % 8)); // (7 - (0..7)) = 7..0 - - ru8Byte |= u8Flag; - - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsNSECBitmap::getBit - -*/ -bool clsLEAMDNSHost::clsNSECBitmap::getBit(uint16_t p_u16Bit) const -{ - bool bResult = false; - - if ((p_u16Bit) && - (length() > (p_u16Bit / 8))) // bit between 0..47(2F) - { - - uint8_t u8Byte = m_au8BitmapData[p_u16Bit / 8]; - uint8_t u8Flag = 1 << (7 - (p_u16Bit % 8)); // (7 - (0..7)) = 7..0 - - bResult = (u8Byte & u8Flag); - } - return bResult; -} - - -/** - clsLEAMDNSHost::clsRRAnswer - - A MDNS answer record object (header + answer content). - This is a 'virtual' base class for all other MDNS answer classes. - -*/ - -/* - clsLEAMDNSHost::clsRRAnswer::clsRRAnswer constructor - -*/ -clsLEAMDNSHost::clsRRAnswer::clsRRAnswer(enuAnswerType p_AnswerType, - const clsLEAMDNSHost::clsRRHeader& p_Header, - uint32_t p_u32TTL) - : m_pNext(0), - m_AnswerType(p_AnswerType), - m_Header(p_Header), - m_u32TTL(p_u32TTL) -{ - // Extract 'cache flush'-bit - m_bCacheFlush = (m_Header.m_Attributes.m_u16Class & 0x8000); - m_Header.m_Attributes.m_u16Class &= (~0x8000); -} - -/* - clsLEAMDNSHost::clsRRAnswer::~stcRRAnswer destructor - -*/ -clsLEAMDNSHost::clsRRAnswer::~clsRRAnswer(void) -{ -} - -/* - clsLEAMDNSHost::clsRRAnswer::answerType - -*/ -clsLEAMDNSHost::enuAnswerType clsLEAMDNSHost::clsRRAnswer::answerType(void) const -{ - return m_AnswerType; -} - -/* - clsLEAMDNSHost::clsRRAnswer::clear - -*/ -bool clsLEAMDNSHost::clsRRAnswer::clear(void) -{ - m_pNext = 0; - m_Header.clear(); - return true; -} - - -/** - clsLEAMDNSHost::clsRRAnswerA - - A MDNS A answer object. - Extends the base class by an IPv4 address member. - -*/ - -#ifdef MDNS_IPV4_SUPPORT -/* - clsLEAMDNSHost::clsRRAnswerA::clsRRAnswerA constructor - -*/ -clsLEAMDNSHost::clsRRAnswerA::clsRRAnswerA(const clsLEAMDNSHost::clsRRHeader& p_Header, - uint32_t p_u32TTL) - : clsRRAnswer(enuAnswerType::A, p_Header, p_u32TTL), - m_IPAddress() -{ -} - -/* - clsLEAMDNSHost::clsRRAnswerA::clsRRAnswerA destructor - -*/ -clsLEAMDNSHost::clsRRAnswerA::~clsRRAnswerA(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRAnswerA::clear - -*/ -bool clsLEAMDNSHost::clsRRAnswerA::clear(void) -{ - m_IPAddress = IPAddress(); - return true; -} -#endif - - -/** - clsLEAMDNSHost::clsRRAnswerPTR - - A MDNS PTR answer object. - Extends the base class by a MDNS domain member. - -*/ - -/* - clsLEAMDNSHost::clsRRAnswerPTR::clsRRAnswerPTR constructor - -*/ -clsLEAMDNSHost::clsRRAnswerPTR::clsRRAnswerPTR(const clsLEAMDNSHost::clsRRHeader& p_Header, - uint32_t p_u32TTL) - : clsRRAnswer(enuAnswerType::PTR, p_Header, p_u32TTL) -{ -} - -/* - clsLEAMDNSHost::clsRRAnswerPTR::~stcRRAnswerPTR destructor - -*/ -clsLEAMDNSHost::clsRRAnswerPTR::~clsRRAnswerPTR(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRAnswerPTR::clear - -*/ -bool clsLEAMDNSHost::clsRRAnswerPTR::clear(void) -{ - m_PTRDomain.clear(); - return true; -} - - -/** - clsLEAMDNSHost::clsRRAnswerTXT - - A MDNS TXT answer object. - Extends the base class by a MDNS TXT items list member. - -*/ - -/* - clsLEAMDNSHost::clsRRAnswerTXT::clsRRAnswerTXT constructor - -*/ -clsLEAMDNSHost::clsRRAnswerTXT::clsRRAnswerTXT(const clsLEAMDNSHost::clsRRHeader& p_Header, - uint32_t p_u32TTL) - : clsRRAnswer(enuAnswerType::TXT, p_Header, p_u32TTL) -{ -} - -/* - clsLEAMDNSHost::clsRRAnswerTXT::~stcRRAnswerTXT destructor - -*/ -clsLEAMDNSHost::clsRRAnswerTXT::~clsRRAnswerTXT(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRAnswerTXT::clear - -*/ -bool clsLEAMDNSHost::clsRRAnswerTXT::clear(void) -{ - m_Txts.clear(); - return true; -} - - -/** - clsLEAMDNSHost::clsRRAnswerAAAA - - A MDNS AAAA answer object. - Extends the base class by an IPv6 address member. - -*/ - -#ifdef MDNS2_IPV6_SUPPORT -/* - clsLEAMDNSHost::clsRRAnswerAAAA::clsRRAnswerAAAA constructor - -*/ -clsLEAMDNSHost::clsRRAnswerAAAA::clsRRAnswerAAAA(const clsLEAMDNSHost::clsRRHeader& p_Header, - uint32_t p_u32TTL) - : clsRRAnswer(enuAnswerType::AAAA, p_Header, p_u32TTL), - m_IPAddress() -{ -} - -/* - clsLEAMDNSHost::clsRRAnswerAAAA::~stcRRAnswerAAAA destructor - -*/ -clsLEAMDNSHost::clsRRAnswerAAAA::~clsRRAnswerAAAA(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRAnswerAAAA::clear - -*/ -bool clsLEAMDNSHost::clsRRAnswerAAAA::clear(void) -{ - m_IPAddress = IPAddress(); - return true; -} -#endif - - -/** - clsLEAMDNSHost::clsRRAnswerSRV - - A MDNS SRV answer object. - Extends the base class by a port member. - -*/ - -/* - clsLEAMDNSHost::clsRRAnswerSRV::clsRRAnswerSRV constructor - -*/ -clsLEAMDNSHost::clsRRAnswerSRV::clsRRAnswerSRV(const clsLEAMDNSHost::clsRRHeader& p_Header, - uint32_t p_u32TTL) - : clsRRAnswer(enuAnswerType::SRV, p_Header, p_u32TTL), - m_u16Priority(0), - m_u16Weight(0), - m_u16Port(0) -{ -} - -/* - clsLEAMDNSHost::clsRRAnswerSRV::~stcRRAnswerSRV destructor - -*/ -clsLEAMDNSHost::clsRRAnswerSRV::~clsRRAnswerSRV(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRAnswerSRV::clear - -*/ -bool clsLEAMDNSHost::clsRRAnswerSRV::clear(void) -{ - m_u16Priority = 0; - m_u16Weight = 0; - m_u16Port = 0; - m_SRVDomain.clear(); - return true; -} - - -/** - clsLEAMDNSHost::clsRRAnswerGeneric - - An unknown (generic) MDNS answer object. - Extends the base class by a RDATA buffer member. - -*/ - -/* - clsLEAMDNSHost::clsRRAnswerGeneric::clsRRAnswerGeneric constructor - -*/ -clsLEAMDNSHost::clsRRAnswerGeneric::clsRRAnswerGeneric(const clsRRHeader& p_Header, - uint32_t p_u32TTL) - : clsRRAnswer(enuAnswerType::Generic, p_Header, p_u32TTL), - m_u16RDLength(0), - m_pu8RDData(0) -{ -} - -/* - clsLEAMDNSHost::clsRRAnswerGeneric::~stcRRAnswerGeneric destructor - -*/ -clsLEAMDNSHost::clsRRAnswerGeneric::~clsRRAnswerGeneric(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsRRAnswerGeneric::clear - -*/ -bool clsLEAMDNSHost::clsRRAnswerGeneric::clear(void) -{ - if (m_pu8RDData) - { - delete[] m_pu8RDData; - m_pu8RDData = 0; - } - m_u16RDLength = 0; - - return true; -} - - -/** - clsLEAMDNSHost::clsSendParameter - - A 'collection' of properties and flags for one MDNS query or response. - Mainly managed by the 'Control' functions. - The current offset in the UPD output buffer is tracked to be able to do - a simple host or service domain compression. - -*/ - -/** - clsLEAMDNSHost::clsSendParameter::clsDomainCacheItem - - A cached host or service domain, incl. the offset in the UDP output buffer. - -*/ - -/* - clsLEAMDNSHost::clsSendParameter::clsDomainCacheItem::clsDomainCacheItem constructor - -*/ -clsLEAMDNSHost::clsSendParameter::clsDomainCacheItem::clsDomainCacheItem(const void* p_pHostNameOrService, - bool p_bAdditionalData, - uint32_t p_u16Offset) - : m_pHostNameOrService(p_pHostNameOrService), - m_bAdditionalData(p_bAdditionalData), - m_u16Offset(p_u16Offset) -{ -} - -/** - clsLEAMDNSHost::clsSendParameter - -*/ - -/* - clsLEAMDNSHost::clsSendParameter::clsSendParameter constructor - -*/ -clsLEAMDNSHost::clsSendParameter::clsSendParameter(void) - : m_u16ID(0), - m_u32HostReplyMask(0), - m_bLegacyDNSQuery(false), - m_Response(enuResponseType::None), - m_bAuthorative(false), - m_bCacheFlush(false), - m_bUnicast(false), - m_bUnannounce(false), - m_u16Offset(0) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsSendParameter::~stcSendParameter destructor - -*/ -clsLEAMDNSHost::clsSendParameter::~clsSendParameter(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsSendParameter::clear - -*/ -bool clsLEAMDNSHost::clsSendParameter::clear(void) -{ - m_u16ID = 0; - flushQuestions(); - m_u32HostReplyMask = 0; - - m_bLegacyDNSQuery = false; - m_Response = enuResponseType::None; - m_bAuthorative = false; - m_bCacheFlush = true; - m_bUnicast = false; - m_bUnannounce = false; - - m_u16Offset = 0; - flushDomainCache(); - return true; -} - -/* - clsLEAMDNSHost::clsSendParameter::flushQuestions - -*/ -bool clsLEAMDNSHost::clsSendParameter::flushQuestions(void) -{ - for (clsRRQuestion* pRRQuestion : m_RRQuestions) - { - delete pRRQuestion; - } - m_RRQuestions.clear(); - return true; -} - -/* - clsLEAMDNSHost::clsSendParameter::flushDomainCache - -*/ -bool clsLEAMDNSHost::clsSendParameter::flushDomainCache(void) -{ - for (clsDomainCacheItem* pDomainCacheItem : m_DomainCacheItems) - { - delete pDomainCacheItem; - } - m_DomainCacheItems.clear(); - return true; -} - -/* - clsLEAMDNSHost::clsSendParameter::flushTempContent - -*/ -bool clsLEAMDNSHost::clsSendParameter::flushTempContent(void) -{ - m_u16Offset = 0; - flushDomainCache(); - return true; -} - -/* - clsLEAMDNSHost::clsSendParameter::shiftOffset - -*/ -bool clsLEAMDNSHost::clsSendParameter::shiftOffset(uint16_t p_u16Shift) -{ - m_u16Offset += p_u16Shift; - return true; -} - -/* - clsLEAMDNSHost::clsSendParameter::addDomainCacheItem - -*/ -bool clsLEAMDNSHost::clsSendParameter::addDomainCacheItem(const void* p_pHostNameOrService, - bool p_bAdditionalData, - uint16_t p_u16Offset) -{ - bool bResult = false; - - clsDomainCacheItem* pNewItem = 0; - if ((p_pHostNameOrService) && - (p_u16Offset) && - ((pNewItem = new clsDomainCacheItem(p_pHostNameOrService, p_bAdditionalData, p_u16Offset)))) - { - m_DomainCacheItems.push_back(pNewItem); - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsSendParameter::findCachedDomainOffset - -*/ -uint16_t clsLEAMDNSHost::clsSendParameter::findCachedDomainOffset(const void* p_pHostNameOrService, - bool p_bAdditionalData) const -{ - const clsDomainCacheItem* pMatchingCacheItem = 0; - - for (const clsDomainCacheItem* pCacheItem : m_DomainCacheItems) - { - if ((pCacheItem->m_pHostNameOrService == p_pHostNameOrService) && - (pCacheItem->m_bAdditionalData == p_bAdditionalData)) // Found cache item - { - pMatchingCacheItem = pCacheItem; - break; - } - } - return (pMatchingCacheItem ? pMatchingCacheItem->m_u16Offset : 0); -} - - -/** - clsLEAMDNSHost::clsQuery - - A MDNS service query object. - Service queries may be static or dynamic. - As the static service query is processed in the blocking function 'queryService', - only one static service service may exist. The processing of the answers is done - on the WiFi-stack side of the ESP stack structure (via 'UDPContext.onRx(_update)'). - -*/ - -/** - clsLEAMDNSHost::clsQuery::clsAnswer - - One answer for a query. - Every answer must contain - - a service instance entry (pivot), - and may contain - - a host domain, - - a port - - an IPv4 address - (- an IPv6 address) - - a MDNS TXTs - The existance of a component is flaged in 'm_u32ContentFlags'. - For every answer component a TTL value is maintained. - Answer objects can be connected to a linked list. - - For the host domain, service domain and TXTs components, a char array - representation can be retrieved (which is created on demand). - -*/ - -/** - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL - - The TTL (Time-To-Live) for an specific answer content. - If the answer is scheduled for an update, the corresponding flag should be set. - -*/ - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::clsTTL constructor - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::clsTTL(void) - : m_u32TTL(0), - m_TTLTimeout(std::numeric_limits::max()), - m_TimeoutLevel(static_cast(enuTimeoutLevel::None)) -{ -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::set - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::set(uint32_t p_u32TTL) -{ - m_u32TTL = p_u32TTL; - if (m_u32TTL) - { - m_TimeoutLevel = static_cast(enuTimeoutLevel::Base); // Set to 80% - m_TTLTimeout.reset(timeout()); - } - else - { - m_TimeoutLevel = static_cast(enuTimeoutLevel::None); // undef - m_TTLTimeout.reset(std::numeric_limits::max()); - } - return true; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::flagged - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::flagged(void) const -{ - return ((m_u32TTL) && - (static_cast(enuTimeoutLevel::None) != m_TimeoutLevel) && - (((esp8266::polledTimeout::timeoutTemplate*)&m_TTLTimeout)->expired())); // Cast-away the const; in case of oneShot-timer OK (but ugly...) -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::restart - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::restart(void) -{ - bool bResult = true; - - if ((static_cast(enuTimeoutLevel::Base) <= m_TimeoutLevel) && // >= 80% AND - (static_cast(enuTimeoutLevel::Final) > m_TimeoutLevel)) // < 100% - { - m_TimeoutLevel += static_cast(enuTimeoutLevel::Interval); // increment by 5% - m_TTLTimeout.reset(timeout()); - } - else - { - bResult = false; - m_TTLTimeout.reset(std::numeric_limits::max()); - m_TimeoutLevel = static_cast(enuTimeoutLevel::None); - } - return bResult; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::prepareDeletion - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::prepareDeletion(void) -{ - m_TimeoutLevel = static_cast(enuTimeoutLevel::Final); - m_TTLTimeout.reset(1 * 1000); // See RFC 6762, 10.1 - - return true; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::finalTimeoutLevel - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::finalTimeoutLevel(void) const -{ - return (static_cast(enuTimeoutLevel::Final) == m_TimeoutLevel); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::timeout - -*/ -unsigned long clsLEAMDNSHost::clsQuery::clsAnswer::clsTTL::timeout(void) const -{ - uint32_t u32Timeout = std::numeric_limits::max(); - - if (static_cast(enuTimeoutLevel::Base) == m_TimeoutLevel) // 80% - { - u32Timeout = (m_u32TTL * 800); // to milliseconds - } - else if ((static_cast(enuTimeoutLevel::Base) < m_TimeoutLevel) && // >80% AND - (static_cast(enuTimeoutLevel::Final) >= m_TimeoutLevel)) // <= 100% - { - u32Timeout = (m_u32TTL * 50); - } // else: invalid - return u32Timeout; -} - - -/** - clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddress - -*/ - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddress::clsIPAddress constructor - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL::clsIPAddressWithTTL(IPAddress p_IPAddress, - uint32_t p_u32TTL /*= 0*/) - : m_IPAddress(p_IPAddress) -{ - m_TTL.set(p_u32TTL); -} - - -/** - clsLEAMDNSHost::clsQuery::clsAnswer - -*/ - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clsAnswer constructor - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::clsAnswer(void) - : m_u16Port(0), - m_QueryAnswerFlags(0) -{ -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::~clsAnswer destructor - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::~clsAnswer(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::clear - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::clear(void) -{ - return ( -#ifdef MDNS_IPV4_SUPPORT - (releaseIPv4Addresses()) -#else - (true) -#endif - && -#ifdef MDNS2_IPV6_SUPPORT - (releaseIPv6Addresses()) -#else - (true) -#endif - ); -} - -#ifdef MDNS_IPV4_SUPPORT -/* - clsLEAMDNSHost::clsQuery::clsAnswer::releaseIPv4Addresses - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::releaseIPv4Addresses(void) -{ - for (clsIPAddressWithTTL* pIPAddress : m_IPv4Addresses) - { - delete pIPAddress; - } - m_IPv4Addresses.clear(); - return true; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::addIPv4Address - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::addIPv4Address(clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* p_pIPv4Address) -{ - bool bResult = false; - - if (p_pIPv4Address) - { - m_IPv4Addresses.push_back(p_pIPv4Address); - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::removeIPv4Address - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::removeIPv4Address(clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* p_pIPv4Address) -{ - bool bResult = false; - - clsIPAddressWithTTL::list::iterator it(p_pIPv4Address - ? std::find(m_IPv4Addresses.begin(), m_IPv4Addresses.end(), p_pIPv4Address) - : m_IPv4Addresses.end()); - if (m_IPv4Addresses.end() != it) - { - m_IPv4Addresses.erase(it); - delete p_pIPv4Address; - - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::findIPv4Address (const) - -*/ -const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::findIPv4Address(const IPAddress& p_IPAddress) const -{ - return (clsIPAddressWithTTL*)(((const clsAnswer*)this)->findIPv4Address(p_IPAddress)); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::findIPv4Address - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::findIPv4Address(const IPAddress& p_IPAddress) -{ - clsIPAddressWithTTL* pMatchingIPv4Address = 0; - - for (clsIPAddressWithTTL* pIPv4Address : m_IPv4Addresses) - { - if (pIPv4Address->m_IPAddress == p_IPAddress) - { - pMatchingIPv4Address = pIPv4Address; - break; - } - } - return pMatchingIPv4Address; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::IPv4AddressCount - -*/ -uint32_t clsLEAMDNSHost::clsQuery::clsAnswer::IPv4AddressCount(void) const -{ - uint32_t u32Count = m_IPv4Addresses.size(); - return u32Count; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::IPv4AddressAtIndex - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::IPv4AddressAtIndex(uint32_t p_u32Index) -{ - return (clsIPAddressWithTTL*)(((const clsAnswer*)this)->IPv4AddressAtIndex(p_u32Index)); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::IPv4AddressAtIndex (const) - -*/ -const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::IPv4AddressAtIndex(uint32_t p_u32Index) const -{ - const clsIPAddressWithTTL* pIPv4AddressAtIndex = 0; - - uint32_t u32CurIndex = 0; - for (clsIPAddressWithTTL::list::const_iterator it = m_IPv4Addresses.begin(); - (((uint32_t)(-1) != p_u32Index) && (u32CurIndex <= p_u32Index) && (it != m_IPv4Addresses.end())); - it++, u32CurIndex++) - { - if (p_u32Index == u32CurIndex++) - { - pIPv4AddressAtIndex = *it; - break; - } - } - return pIPv4AddressAtIndex; -} -#endif - -#ifdef MDNS2_IPV6_SUPPORT -/* - clsLEAMDNSHost::clsQuery::clsAnswer::releaseIPv6Addresses - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::releaseIPv6Addresses(void) -{ - for (clsIPAddressWithTTL* pIPAddress : m_IPv6Addresses) - { - delete pIPAddress; - } - m_IPv6Addresses.clear(); - return true; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::addIPv6Address - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::addIPv6Address(clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* p_pIPv6Address) -{ - bool bResult = false; - - if (p_pIPv6Address) - { - m_IPv6Addresses.push_back(p_pIPv6Address); - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::removeIPv6Address - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswer::removeIPv6Address(clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* p_pIPv6Address) -{ - bool bResult = false; - - clsIPAddressWithTTL::list::iterator it(p_pIPv6Address - ? std::find(m_IPv6Addresses.begin(), m_IPv6Addresses.end(), p_pIPv6Address) - : m_IPv6Addresses.end()); - if (m_IPv6Addresses.end() != it) - { - m_IPv6Addresses.erase(it); - delete p_pIPv6Address; - - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::findIPv6Address - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::findIPv6Address(const IPAddress& p_IPAddress) -{ - return (clsIPAddressWithTTL*)(((const clsAnswer*)this)->findIPv6Address(p_IPAddress)); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::findIPv6Address (const) - -*/ -const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::findIPv6Address(const IPAddress& p_IPAddress) const -{ - clsIPAddressWithTTL* pMatchingIPv6Address = 0; - - for (clsIPAddressWithTTL* pIPv6Address : m_IPv6Addresses) - { - if (pIPv6Address->m_IPAddress == p_IPAddress) - { - pMatchingIPv6Address = pIPv6Address; - break; - } - } - return pMatchingIPv6Address; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::IPv6AddressCount - -*/ -uint32_t clsLEAMDNSHost::clsQuery::clsAnswer::IPv6AddressCount(void) const -{ - uint32_t u32Count = m_IPv6Addresses.size(); - return u32Count; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::IPv6AddressAtIndex - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::IPv6AddressAtIndex(uint32_t p_u32Index) -{ - return (clsIPAddressWithTTL*)(((const clsAnswer*)this)->IPv6AddressAtIndex(p_u32Index)); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswer::IPv6AddressAtIndex (const) - -*/ -const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* clsLEAMDNSHost::clsQuery::clsAnswer::IPv6AddressAtIndex(uint32_t p_u32Index) const -{ - const clsIPAddressWithTTL* pIPv6AddressAtIndex = 0; - - uint32_t u32CurIndex = 0; - for (clsIPAddressWithTTL::list::const_iterator it = m_IPv6Addresses.begin(); - (((uint32_t)(-1) != p_u32Index) && (u32CurIndex <= p_u32Index) && (it != m_IPv6Addresses.end())); - it++, u32CurIndex++) - { - if (p_u32Index == u32CurIndex++) - { - pIPv6AddressAtIndex = *it; - break; - } - } - return pIPv6AddressAtIndex; -} -#endif - - -/** - clsLEAMDNSHost::clsQuery::clsAnswerAccessor - -*/ - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsAnswerAccessor constructor - -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsAnswerAccessor(const clsLEAMDNSHost::clsQuery::clsAnswer* p_pAnswer) - : m_pAnswer(p_pAnswer) -{ - if ((m_pAnswer) && - (txtsAvailable())) - { - // Prepare m_TxtKeyValueMap - for (const clsLEAMDNSHost::clsServiceTxt* pTxt : m_pAnswer->m_Txts.m_Txts) - { - m_TxtKeyValueMap.emplace(std::pair(pTxt->m_pcKey, pTxt->m_pcValue)); - } - } -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::~clsAnswerAccessor destructor -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor::~clsAnswerAccessor(void) -{ -} - -/** - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsCompareTxtKey - -*/ - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::stcCompareTxtKey::operator() - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswerAccessor::stcCompareTxtKey::operator()(char const* p_pA, - char const* p_pB) const -{ - return (0 > strcasecmp(p_pA, p_pB)); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::serviceDomainAvailable - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswerAccessor::serviceDomainAvailable(void) const -{ - return ((m_pAnswer) && - (m_pAnswer->m_QueryAnswerFlags & static_cast(clsQuery::clsAnswer::enuQueryAnswerType::ServiceDomain))); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::serviceDomain - -*/ -const char* clsLEAMDNSHost::clsQuery::clsAnswerAccessor::serviceDomain(void) const -{ - return ((m_pAnswer) - ? m_pAnswer->m_ServiceDomain.c_str() - : 0); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostDomainAvailable - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostDomainAvailable(void) const -{ - return ((m_pAnswer) && - (m_pAnswer->m_QueryAnswerFlags & static_cast(clsQuery::clsAnswer::enuQueryAnswerType::HostDomain))); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostDomain - -*/ -const char* clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostDomain(void) const -{ - return ((m_pAnswer) - ? m_pAnswer->m_HostDomain.c_str() - : 0); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostPortAvailable - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostPortAvailable(void) const -{ - return ((m_pAnswer) && - (m_pAnswer->m_QueryAnswerFlags & static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Port))); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostPort - -*/ -uint16_t clsLEAMDNSHost::clsQuery::clsAnswerAccessor::hostPort(void) const -{ - return ((m_pAnswer) - ? (m_pAnswer->m_u16Port) - : 0); -} - -#ifdef MDNS_IPV4_SUPPORT -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv4AddressAvailable - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv4AddressAvailable(void) const -{ - return ((m_pAnswer) && - (m_pAnswer->m_QueryAnswerFlags & static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv4Address))); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv4Addresses - -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsIPAddressVector clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv4Addresses(void) const -{ - clsIPAddressVector internalIP; - if ((m_pAnswer) && - (IPv4AddressAvailable())) - { - for (uint32_t u = 0; u < m_pAnswer->IPv4AddressCount(); ++u) - { - const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* pIPAddr = m_pAnswer->IPv4AddressAtIndex(u); - if (pIPAddr) - { - internalIP.emplace_back(pIPAddr->m_IPAddress); - } - } - } - return internalIP; -} -#endif - -#ifdef MDNS2_IPV6_SUPPORT -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv6AddressAvailable - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv6AddressAvailable(void) const -{ - return ((m_pAnswer) && - (m_pAnswer->m_QueryAnswerFlags & static_cast(clsQuery::clsAnswer::enuQueryAnswerType::IPv6Address))); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv6Addresses - -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsIPAddressVector clsLEAMDNSHost::clsQuery::clsAnswerAccessor::IPv6Addresses(void) const -{ - clsIPAddressVector internalIP; - if ((m_pAnswer) && - (IPv6AddressAvailable())) - { - for (uint32_t u = 0; u < m_pAnswer->IPv6AddressCount(); ++u) - { - const clsLEAMDNSHost::clsQuery::clsAnswer::clsIPAddressWithTTL* pIPAddr = m_pAnswer->IPv6AddressAtIndex(u); - if (pIPAddr) - { - internalIP.emplace_back(pIPAddr->m_IPAddress); - } - } - } - return internalIP; -} -#endif - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txtsAvailable - -*/ -bool clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txtsAvailable(void) const -{ - return ((m_pAnswer) && - (m_pAnswer->m_QueryAnswerFlags & static_cast(clsQuery::clsAnswer::enuQueryAnswerType::Txts))); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txts - - Returns all TXT items for the given service as a ';'-separated string. - If not already existing; the string is alloced, filled and attached to the answer. - -*/ -const char* clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txts(void) const -{ - return ((m_pAnswer) - ? m_pAnswer->m_Txts.c_str() - : 0); -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txtKeyValues - -*/ -const clsLEAMDNSHost::clsQuery::clsAnswerAccessor::clsTxtKeyValueMap& clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txtKeyValues(void) const -{ - return m_TxtKeyValueMap; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txtValue - -*/ -const char* clsLEAMDNSHost::clsQuery::clsAnswerAccessor::txtValue(const char* p_pcKey) const -{ - char* pcResult = 0; - - if (m_pAnswer) - { - for (const clsLEAMDNSHost::clsServiceTxt* pTxt : m_pAnswer->m_Txts.m_Txts) - { - if ((p_pcKey) && - (0 == strcasecmp(pTxt->m_pcKey, p_pcKey))) - { - pcResult = pTxt->m_pcValue; - break; - } - } - } - return pcResult; -} - -/* - clsLEAMDNSHost::clsQuery::clsAnswerAccessor::printTo - -*/ -size_t clsLEAMDNSHost::clsQuery::clsAnswerAccessor::printTo(Print& p_Print) const -{ - size_t stLen = 0; - const char* cpcI = " * "; - const char* cpcS = " "; - - stLen += p_Print.println(" * * * * *"); - if (hostDomainAvailable()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.print("Host domain: "); - stLen += p_Print.println(hostDomain()); - } -#ifdef MDNS_IPV4_SUPPORT - if (IPv4AddressAvailable()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.println("IPv4 address(es):"); - for (const IPAddress& addr : IPv4Addresses()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.print(cpcS); - stLen += p_Print.println(addr); - } - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - if (IPv6AddressAvailable()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.println("IPv6 address(es):"); - for (const IPAddress& addr : IPv6Addresses()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.print(cpcS); - stLen += p_Print.println(addr); - } - } -#endif - if (serviceDomainAvailable()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.print("Service domain: "); - stLen += p_Print.println(serviceDomain()); - } - if (hostPortAvailable()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.print("Host port: "); - stLen += p_Print.println(hostPort()); - } - if (txtsAvailable()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.print("TXTs:"); - for (auto const& x : txtKeyValues()) - { - stLen += p_Print.print(cpcI); - stLen += p_Print.print(cpcS); - stLen += p_Print.print(x.first); - stLen += p_Print.print("="); - stLen += p_Print.println(x.second); - } - } - stLen += p_Print.println(" * * * * *"); - - return stLen; -} - - -/** - clsLEAMDNSHost::clsQuery - - A service or host query object. - A static query is flaged via 'm_bLegacyQuery'; while the function 'queryService' - is waiting for answers, the internal flag 'm_bAwaitingAnswers' is set. When the - timeout is reached, the flag is removed. These two flags are only used for static - service queries. - All answers to the query are stored in the 'm_Answers' list. - Individual answers may be addressed by index (in the list of answers). - Every time a answer component is added (or changed) in a dynamic query, - the callback 'm_fnCallback' is called. - The answer list may be searched by service and host domain. - - Query object may be connected to a linked list. - -*/ - -/* - clsLEAMDNSHost::clsQuery::clsQuery constructor - -*/ -clsLEAMDNSHost::clsQuery::clsQuery(const enuQueryType p_QueryType) - : m_QueryType(p_QueryType), - m_fnCallbackAnswer(0), - m_fnCallbackAccessor(0), - m_bStaticQuery(false), - m_u32SentCount(0), - m_ResendTimeout(std::numeric_limits::max()), - m_bAwaitingAnswers(true) -{ - clear(); - m_QueryType = p_QueryType; -} - -/* - clsLEAMDNSHost::clsQuery::~stcQuery destructor - -*/ -clsLEAMDNSHost::clsQuery::~clsQuery(void) -{ - clear(); -} - -/* - clsLEAMDNSHost::clsQuery::clear - -*/ -bool clsLEAMDNSHost::clsQuery::clear(void) -{ - m_QueryType = enuQueryType::None; - m_fnCallbackAnswer = 0; - m_fnCallbackAccessor = 0; - m_bStaticQuery = false; - m_u32SentCount = 0; - m_ResendTimeout.reset(std::numeric_limits::max()); - m_bAwaitingAnswers = true; - for (clsAnswer* pAnswer : m_Answers) - { - delete pAnswer; - } - m_Answers.clear(); - return true; -} - -/* - clsLEAMDNSHost::clsQuery::answerCount - -*/ -uint32_t clsLEAMDNSHost::clsQuery::answerCount(void) const -{ - uint32_t u32Count = m_Answers.size(); - return u32Count; -} - -/* - clsLEAMDNSHost::clsQuery::answer - -*/ -const clsLEAMDNSHost::clsQuery::clsAnswer* clsLEAMDNSHost::clsQuery::answer(uint32_t p_u32Index) const -{ - const clsAnswer* pAnswerAtIndex = 0; - - uint32_t u32CurIndex = 0; - for (clsAnswer::list::const_iterator it = m_Answers.begin(); - (((uint32_t)(-1) != p_u32Index) && (u32CurIndex <= p_u32Index) && (it != m_Answers.end())); - it++, u32CurIndex++) - { - if (p_u32Index == u32CurIndex++) - { - pAnswerAtIndex = *it; - break; - } - } - return pAnswerAtIndex; -} - -/* - clsLEAMDNSHost::clsQuery::indexOfAnswer - -*/ -uint32_t clsLEAMDNSHost::clsQuery::indexOfAnswer(const clsLEAMDNSHost::clsQuery::clsAnswer* p_pAnswer) const -{ - uint32_t u32IndexOfAnswer = ((uint32_t)(-1)); - - uint32_t u32CurIndex = 0; - for (const clsAnswer* pAnswer : m_Answers) - { - if (pAnswer == p_pAnswer) - { - u32IndexOfAnswer = u32CurIndex; - break; - } - ++u32CurIndex; - } - return u32IndexOfAnswer; -} - -/* - clsLEAMDNSHost::clsQuery::answerAccessors - -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor::vector clsLEAMDNSHost::clsQuery::answerAccessors(void) const -{ - clsAnswerAccessor::vector tempAccessors; - for (const clsAnswer* pAnswer : m_Answers) - { - tempAccessors.emplace_back(pAnswer); - } - return tempAccessors; -} - -/* - clsLEAMDNSHost::clsQuery::answerAccessor - -*/ -clsLEAMDNSHost::clsQuery::clsAnswerAccessor clsLEAMDNSHost::clsQuery::answerAccessor(uint32 p_u32AnswerIndex) const -{ - return clsAnswerAccessor(answer(p_u32AnswerIndex)); -} - -/* - clsLEAMDNSHost::clsQuery::addAnswer - -*/ -bool clsLEAMDNSHost::clsQuery::addAnswer(clsLEAMDNSHost::clsQuery::clsAnswer* p_pAnswer) -{ - bool bResult = false; - - if (p_pAnswer) - { - m_Answers.push_back(p_pAnswer); - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsQuery::removeAnswer - -*/ -bool clsLEAMDNSHost::clsQuery::removeAnswer(clsLEAMDNSHost::clsQuery::clsAnswer* p_pAnswer) -{ - bool bResult = false; - - clsAnswer::list::iterator it(p_pAnswer - ? std::find(m_Answers.begin(), m_Answers.end(), p_pAnswer) - : m_Answers.end()); - if (m_Answers.end() != it) - { - m_Answers.erase(it); - delete p_pAnswer; - - bResult = true; - } - return bResult; -} - -/* - clsLEAMDNSHost::clsQuery::findAnswerForServiceDomain - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer* clsLEAMDNSHost::clsQuery::findAnswerForServiceDomain(const clsLEAMDNSHost::clsRRDomain& p_ServiceDomain) -{ - clsAnswer* pAnswerForServiceDomain = 0; - - for (clsAnswer* pAnswer : m_Answers) - { - if (pAnswer->m_ServiceDomain == p_ServiceDomain) - { - pAnswerForServiceDomain = pAnswer; - break; - } - } - return pAnswerForServiceDomain; -} - -/* - clsLEAMDNSHost::clsQuery::findAnswerForHostDomain - -*/ -clsLEAMDNSHost::clsQuery::clsAnswer* clsLEAMDNSHost::clsQuery::findAnswerForHostDomain(const clsLEAMDNSHost::clsRRDomain& p_HostDomain) -{ - clsAnswer* pAnswerForHostDomain = 0; - - for (clsAnswer* pAnswer : m_Answers) - { - if (pAnswer->m_HostDomain == p_HostDomain) - { - pAnswerForHostDomain = pAnswer; - break; - } - } - return pAnswerForHostDomain; -} - - -} // namespace MDNSImplementation - - -} // namespace esp8266 - - - - - diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Transfer.cpp b/libraries/ESP8266mDNS/src/LEAmDNS2Host_Transfer.cpp deleted file mode 100644 index 0d719da36..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2Host_Transfer.cpp +++ /dev/null @@ -1,2451 +0,0 @@ -/* - LEAmDNS2Host_Transfer.cpp - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#include // for can_yield() -#include "ESP8266mDNS.h" -#include "LEAmDNS2Host.h" -#include "LEAmDNS2_Priv.h" - -namespace esp8266 -{ - - -namespace experimental -{ - - -/* - - SENDING - -*/ - -/* - MDNSResponder::_sendMessage - - Unicast responses are prepared and sent directly to the querier. - Multicast responses or queries are transferred to _sendMessage_Multicast - - Any reply flags in installed services are removed at the end! - -*/ -bool clsLEAMDNSHost::_sendMessage(clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - bool bResult = true; - for (netif* pNetIf = netif_list; pNetIf; pNetIf = pNetIf->next) - if (netif_is_up(pNetIf)) - { - bResult = bResult && _sendMessage(pNetIf, p_rSendParameter); - } - - // Finally clear service reply masks - for (clsService* pService : m_Services) - { - pService->m_u32ReplyMask = 0; - } - return bResult; -} -bool clsLEAMDNSHost::_sendMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - bool bResult = false; - uint8_t u8AvailableProtocols = 0; - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage: if=" NETIFID_STR "\n"), _DH(), NETIFID_VAL(pNetIf))); - -#ifdef MDNS_IPV4_SUPPORT - // Only send out IPv4 messages, if we've got an IPv4 address - if (_getResponderIPAddress(pNetIf, enuIPProtocolType::V4).isSet()) - { - u8AvailableProtocols |= static_cast(enuIPProtocolType::V4); - } - DEBUG_EX_INFO(else - { - DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage: No IPv4 address available!\n"), _DH()); - }); -#endif -#ifdef MDNS2_IPV6_SUPPORT - // Only send out IPv6 messages, if we've got an IPv6 address - if (_getResponderIPAddress(pNetIf, enuIPProtocolType::V6).isSet()) - { - u8AvailableProtocols |= static_cast(enuIPProtocolType::V6); - } - DEBUG_EX_INFO(else - { - DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage: No IPv6 address available!\n"), _DH()); - }); -#endif - - if (clsBackbone::sm_pBackbone->setDelayUDPProcessing(true)) - { - // Avoid 're-entry-like problems because delay() is called! - if (clsSendParameter::enuResponseType::None != p_rSendParameter.m_Response) - { - IPAddress ipRemote = ((clsSendParameter::enuResponseType::Response == p_rSendParameter.m_Response) - ? m_pUDPContext->getRemoteAddress() - : IPAddress()); - - if (p_rSendParameter.m_bUnicast) - { - // Unicast response -> Send to querier - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage: Will send unicast to '%s'.\n"), _DH(), ipRemote.toString().c_str());); - DEBUG_EX_ERR(if (!ipRemote.isSet()) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage: MISSING remote address for unicast response!\n"), _DH());); - - bResult = ((ipRemote.isSet()) && - (_prepareMessage(pNetIf, p_rSendParameter)) && - (m_pUDPContext->sendTimeout(ipRemote, m_pUDPContext->getRemotePort(), clsConsts::u32SendTimeoutMs)) /*&& - (Serial.println("Did send UC"), true)*/); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage (V4): FAILED!\n"), _DH());); - } - else - { - // Multicast response -> Send via the same network interface, that received the query -#ifdef MDNS_IPV4_SUPPORT - if (((!ipRemote.isSet()) || // NO remote IP - (ipRemote.isV4())) && // OR IPv4 - (u8AvailableProtocols & static_cast(enuIPProtocolType::V4))) // AND IPv4 protocol available - { - bResult = _sendMessage_Multicast(pNetIf, p_rSendParameter, static_cast(enuIPProtocolType::V4)); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - if (((!ipRemote.isSet()) || // NO remote IP - (ipRemote.isV6())) && // OR IPv6 - (u8AvailableProtocols & static_cast(enuIPProtocolType::V6))) // AND IPv6 protocol available - { - bResult = _sendMessage_Multicast(pNetIf, p_rSendParameter, static_cast(enuIPProtocolType::V6)); - } -#endif - } - } - else - { - // Multicast query -> Send by all available protocols - bResult = ((u8AvailableProtocols) && - (_sendMessage_Multicast(pNetIf, p_rSendParameter, u8AvailableProtocols))); - } - - clsBackbone::sm_pBackbone->setDelayUDPProcessing(false); - } - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_sendMessage_Multicast - - Fills the UDP output buffer (via _prepareMessage) and sends the buffer - via the selected WiFi protocols -*/ -bool clsLEAMDNSHost::_sendMessage_Multicast(netif* pNetIf, clsLEAMDNSHost::clsSendParameter& p_rSendParameter, - uint8_t p_IPProtocolTypes) -{ - bool bIPv4Result = true; - bool bIPv6Result = true; - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast: if=" NETIFID_STR "\n"), _DH(), NETIFID_VAL(pNetIf))); - -#ifdef MDNS_IPV4_SUPPORT - if (p_IPProtocolTypes & static_cast(enuIPProtocolType::V4)) - { - IPAddress ip4MulticastAddress(DNS_MQUERY_IPV4_GROUP_INIT); - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast IPv4: Will send to '%s'.\n"), _DH(), ip4MulticastAddress.toString().c_str());); - DEBUG_EX_INFO(if (!_getResponderIPAddress(pNetIf, enuIPProtocolType::V4)) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast IPv4: NO IPv4 address!.\n"), _DH());); - bIPv4Result = ((_prepareMessage(pNetIf, p_rSendParameter)) && - (m_pUDPContext->setMulticastInterface(pNetIf), true) && - (m_pUDPContext->sendTimeout(ip4MulticastAddress, DNS_MQUERY_PORT, clsConsts::u32SendTimeoutMs)) && - (m_pUDPContext->setMulticastInterface(0), true) /*&& - (Serial.println("Did send MC V4"), true)*/); - DEBUG_EX_ERR(if (!bIPv4Result) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast (V4): FAILED!\n"), _DH());); - } -#endif - -#ifdef MDNS2_IPV6_SUPPORT - if (p_IPProtocolTypes & static_cast(enuIPProtocolType::V6)) - { - IPAddress ip6MulticastAddress(DNS_MQUERY_IPV6_GROUP_INIT); - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast IPv6: Will send to '%s'.\n"), _DH(), ip6MulticastAddress.toString().c_str());); - DEBUG_EX_INFO(if (!_getResponderIPAddress(pNetIf, enuIPProtocolType::V6)) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast IPv6: NO IPv6 address!.\n"), _DH());); - DEBUG_EX_ERR( - bool bPrepareMessage = false; - bool bUDPContextSend = false; - ); - bIPv6Result = ((DEBUG_EX_ERR(bPrepareMessage =)_prepareMessage(pNetIf, p_rSendParameter)) && - (m_pUDPContext->setMulticastInterface(pNetIf), true) && - (DEBUG_EX_ERR(bUDPContextSend =)m_pUDPContext->sendTimeout(ip6MulticastAddress, DNS_MQUERY_PORT, clsConsts::u32SendTimeoutMs)) && - (m_pUDPContext->setMulticastInterface(0), true) /*&& - (Serial.println("Did send MC V6"), true)*/); - DEBUG_EX_ERR(if (!bIPv6Result) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast (IPv6): FAILED! (%s, %s, %s)\n"), _DH(), (_getResponderIPAddress(pNetIf, enuIPProtocolType::V6).isSet() ? "1" : "0"), (bPrepareMessage ? "1" : "0"), (bUDPContextSend ? "1" : "0"));); - } -#endif - - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast: %s!\n\n"), _DH(), ((bIPv4Result && bIPv6Result) ? "Succeeded" : "FAILED"));); - DEBUG_EX_ERR(if (!(bIPv4Result && bIPv6Result)) DEBUG_OUTPUT.printf_P(PSTR("%s _sendMessage_Multicast: FAILED!\n"), _DH());); - return (bIPv4Result && bIPv6Result); -} - -/* - MDNSResponder::_prepareMessage - - The MDNS message is composed in a two-step process. - In the first loop 'only' the header informations (mainly number of answers) are collected, - while in the second loop, the header and all queries and answers are written to the UDP - output buffer. - -*/ -bool clsLEAMDNSHost::_prepareMessage(netif* pNetIf, clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage\n"));); - bool bResult = true; - - // Prepare output buffer for potential reuse - p_rSendParameter.flushTempContent(); - - // Prepare header; count answers - clsMsgHeader msgHeader(p_rSendParameter.m_u16ID, - (static_cast(clsSendParameter::enuResponseType::None) != p_rSendParameter.m_Response), - 0, - p_rSendParameter.m_bAuthorative); - // If this is a response, the answers are anwers, - // else this is a query or probe and the answers go into auth section - uint16_t& ru16Answers = ((clsSendParameter::enuResponseType::None != p_rSendParameter.m_Response) - ? msgHeader.m_u16ANCount // Usual answers - : msgHeader.m_u16NSCount); // Authorative answers - - /** - enuSequence - */ - using typeSequence = uint8_t; - enum class enuSequence : typeSequence - { - Count = 0, - Send = 1 - }; - - // Two step sequence: 'Count' and 'Send' - for (typeSequence sequence = static_cast(enuSequence::Count); ((bResult) && (sequence <= static_cast(enuSequence::Send))); ++sequence) - { - /* - DEBUG_EX_INFO( - if (static_cast(enuSequence::Send) == sequence) - DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"), - _DH(), - (unsigned)msgHeader.m_u16ID, - (unsigned)msgHeader.m_1bQR, (unsigned)msgHeader.m_4bOpcode, (unsigned)msgHeader.m_1bAA, (unsigned)msgHeader.m_1bTC, (unsigned)msgHeader.m_1bRD, - (unsigned)msgHeader.m_1bRA, (unsigned)msgHeader.m_4bRCode, - (unsigned)msgHeader.m_u16QDCount, - (unsigned)msgHeader.m_u16ANCount, - (unsigned)msgHeader.m_u16NSCount, - (unsigned)msgHeader.m_u16ARCount); - ); - */ - // Count/send - // Header - bResult = ((static_cast(enuSequence::Count) == sequence) - ? true - : _writeMDNSMsgHeader(msgHeader, p_rSendParameter)); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSMsgHeader FAILED!\n"), _DH());); - // Questions - for (clsRRQuestion::list::iterator it = p_rSendParameter.m_RRQuestions.begin(); ((bResult) && (it != p_rSendParameter.m_RRQuestions.end())); it++) - { - clsRRQuestion* pQuestion = *it; - - ((static_cast(enuSequence::Count) == sequence) - ? ++msgHeader.m_u16QDCount - : (bResult = _writeMDNSQuestion(*pQuestion, p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSQuestion FAILED!\n"), _DH());); - } - - // Answers and authorative answers - // NSEC host (part 1) - uint32_t u32NSECContent = 0; -#ifdef MDNS_IPV4_SUPPORT - // A - if ((bResult) && - (p_rSendParameter.m_u32HostReplyMask & static_cast(enuContentFlag::A)) && - (_getResponderIPAddress(pNetIf, enuIPProtocolType::V4).isSet())) - { - - u32NSECContent |= static_cast(enuContentFlag::A); - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_A(_getResponderIPAddress(pNetIf, enuIPProtocolType::V4), p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_A(A) FAILED!\n"), _DH());); - } - // PTR_IPv4 - if ((bResult) && - (p_rSendParameter.m_u32HostReplyMask & static_cast(enuContentFlag::PTR_IPv4)) && - (_getResponderIPAddress(pNetIf, enuIPProtocolType::V4).isSet())) - { - - u32NSECContent |= static_cast(enuContentFlag::PTR_IPv4); - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_PTR_IPv4(_getResponderIPAddress(pNetIf, enuIPProtocolType::V4), p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_PTR_IPv4 FAILED!\n"), _DH());); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - // AAAA - if ((bResult) && - (p_rSendParameter.m_u32HostReplyMask & static_cast(enuContentFlag::AAAA)) && - (_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)).isSet())) - { - - u32NSECContent |= static_cast(enuContentFlag::AAAA); - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_AAAA(_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)), p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_AAAA(A) FAILED!\n"), _DH());); - } - // PTR_IPv6 - if ((bResult) && - (p_rSendParameter.m_u32HostReplyMask & static_cast(enuContentFlag::PTR_IPv6)) && - (_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)).isSet())) - { - - u32NSECContent |= static_cast(enuContentFlag::PTR_IPv6); - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_PTR_IPv6(_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)), p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_PTR_IPv6 FAILED!\n"), _DH());); - } -#endif - - for (clsService::list::iterator it = m_Services.begin(); ((bResult) && (it != m_Services.end())); it++) - { - clsService* pService = *it; - - // PTR_TYPE - if ((bResult) && - (pService->m_u32ReplyMask & static_cast(enuContentFlag::PTR_TYPE))) - { - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_PTR_TYPE(*pService, p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_PTR_TYPE FAILED!\n"), _DH());); - } - // PTR_NAME - if ((bResult) && - (pService->m_u32ReplyMask & static_cast(enuContentFlag::PTR_NAME))) - { - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_PTR_NAME(*pService, p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_PTR_NAME FAILED!\n"), _DH());); - } - // SRV - if ((bResult) && - (pService->m_u32ReplyMask & static_cast(enuContentFlag::SRV))) - { - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_SRV(A) FAILED!\n"), _DH());); - } - // TXT - if ((bResult) && - (pService->m_u32ReplyMask & static_cast(enuContentFlag::TXT))) - { - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16Answers - : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_TXT(A) FAILED!\n"), _DH());); - } - } // for services - - // Additional answers - uint16_t& ru16AdditionalAnswers = msgHeader.m_u16ARCount; - -#ifdef MDNS_IPV4_SUPPORT - bool bNeedsAdditionalAnswerA = false; -#endif -#ifdef MDNS2_IPV6_SUPPORT - bool bNeedsAdditionalAnswerAAAA = false; -#endif - for (clsService::list::iterator it = m_Services.begin(); ((bResult) && (it != m_Services.end())); it++) - { - clsService* pService = *it; - - if ((bResult) && - (pService->m_u32ReplyMask & static_cast(enuContentFlag::PTR_NAME)) && // If PTR_NAME is requested, AND - (!(pService->m_u32ReplyMask & static_cast(enuContentFlag::SRV)))) // NOT SRV -> add SRV as additional answer - { - - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16AdditionalAnswers - : (bResult = _writeMDNSAnswer_SRV(*pService, p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_SRV(B) FAILED!\n"), _DH());); - } - /* AppleTV doesn't add TXT - if ((bResult) && - (pService->m_u32ReplyMask & ContentFlag_PTR_NAME) && // If PTR_NAME is requested, AND - (!(pService->m_u32ReplyMask & ContentFlag_TXT))) { // NOT TXT -> add TXT as additional answer - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16AdditionalAnswers - : (bResult = _writeMDNSAnswer_TXT(*pService, p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_TXT(B) FAILED!\n"));); - } - */ - if ((pService->m_u32ReplyMask & (static_cast(enuContentFlag::PTR_NAME) | static_cast(enuContentFlag::SRV))) || // If service instance name or SRV OR - (p_rSendParameter.m_u32HostReplyMask & (static_cast(enuContentFlag::A) | static_cast(enuContentFlag::AAAA)))) // any host IP address is requested - { -#ifdef MDNS_IPV4_SUPPORT - if ((bResult) && - (!(p_rSendParameter.m_u32HostReplyMask & static_cast(enuContentFlag::A)))) // Add IPv4 address - { - bNeedsAdditionalAnswerA = true; - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - if ((bResult) && - (!(p_rSendParameter.m_u32HostReplyMask & static_cast(enuContentFlag::AAAA)))) // Add IPv6 address - { - bNeedsAdditionalAnswerAAAA = true; - } -#endif - } - // NSEC record for service - if ((bResult) && - (pService->m_u32ReplyMask) && - ((clsSendParameter::enuResponseType::None != p_rSendParameter.m_Response))) - { - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16AdditionalAnswers - : (bResult = _writeMDNSAnswer_NSEC(*pService, (static_cast(enuContentFlag::TXT) | static_cast(enuContentFlag::SRV)), p_rSendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_NSEC(Service) FAILED!\n"), _DH());); - } - } // for services - -#ifdef MDNS_IPV4_SUPPORT - // Answer A needed? - if ((bResult) && - (bNeedsAdditionalAnswerA) && - (_getResponderIPAddress(pNetIf, (enuIPProtocolType::V4)).isSet())) - { - // Additional A - u32NSECContent |= static_cast(enuContentFlag::A); - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16AdditionalAnswers - : (bResult = _writeMDNSAnswer_A(_getResponderIPAddress(pNetIf, (enuIPProtocolType::V4)), p_rSendParameter))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_A(B) FAILED!\n"), _DH());); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - // Answer AAAA needed? - if ((bResult) && - (bNeedsAdditionalAnswerAAAA) && - (_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)).isSet())) - { - // Additional AAAA - u32NSECContent |= static_cast(enuContentFlag::AAAA); - ((static_cast(enuSequence::Count) == sequence) - ? ++ru16AdditionalAnswers - : (bResult = _writeMDNSAnswer_AAAA(_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)), p_rSendParameter))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_AAAA(B) FAILED!\n"), _DH());); - } -#endif - - // NSEC host (part 2) - if ((bResult) && - ((clsSendParameter::enuResponseType::None != p_rSendParameter.m_Response)) && - (u32NSECContent)) - { - // NSEC PTR IPv4/IPv6 are separate answers; make sure, that this is counted for -#ifdef MDNS_IPV4_SUPPORT - uint32_t u32NSECContent_PTR_IPv4 = (u32NSECContent & static_cast(enuContentFlag::PTR_IPv4)); - u32NSECContent &= ~static_cast(enuContentFlag::PTR_IPv4); -#endif -#ifdef MDNS2_IPV6_SUPPORT - uint32_t u32NSECContent_PTR_IPv6 = (u32NSECContent & static_cast(enuContentFlag::PTR_IPv6)); - u32NSECContent &= ~static_cast(enuContentFlag::PTR_IPv6); -#endif - - ((static_cast(enuSequence::Count) == sequence) - ? (ru16AdditionalAnswers += ((u32NSECContent ? 1 : 0) -#ifdef MDNS_IPV4_SUPPORT - + (u32NSECContent_PTR_IPv4 ? 1 : 0) -#endif -#ifdef MDNS2_IPV6_SUPPORT - + (u32NSECContent_PTR_IPv6 ? 1 : 0) -#endif - )) - : (bResult = (((!u32NSECContent) || - // Write host domain NSEC answer - (_writeMDNSAnswer_NSEC(u32NSECContent, p_rSendParameter))) -#ifdef MDNS_IPV4_SUPPORT - // Write separate answer for host PTR IPv4 - && ((!u32NSECContent_PTR_IPv4) || - ((!_getResponderIPAddress(pNetIf, (enuIPProtocolType::V4)).isSet()) || - (_writeMDNSAnswer_NSEC_PTR_IPv4(_getResponderIPAddress(pNetIf, (enuIPProtocolType::V4)), p_rSendParameter)))) -#endif -#ifdef MDNS2_IPV6_SUPPORT - // Write separate answer for host PTR IPv6 - && ((!u32NSECContent_PTR_IPv6) || - ((!_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)).isSet()) || - (_writeMDNSAnswer_NSEC_PTR_IPv6(_getResponderIPAddress(pNetIf, (enuIPProtocolType::V6)), p_rSendParameter)))) -#endif - ))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: _writeMDNSAnswer_NSEC(Host) FAILED!\n"), _DH());); - } - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: Loop %i FAILED!\n"), _DH(), sequence);); - } // for sequence - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _prepareMDNSMessage: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_addQueryRecord - - Adds a query for the given domain and query type. - -*/ -bool clsLEAMDNSHost::_addQueryRecord(clsLEAMDNSHost::clsSendParameter& p_rSendParameter, - const clsLEAMDNSHost::clsRRDomain& p_QueryDomain, - uint16_t p_u16RecordType) -{ - bool bResult = false; - - clsRRQuestion* pNewRRQuestion = new clsRRQuestion; - if ((bResult = (0 != pNewRRQuestion))) - { - // Link to list of questions - p_rSendParameter.m_RRQuestions.push_back(pNewRRQuestion); - - pNewRRQuestion->m_Header.m_Domain = p_QueryDomain; - - pNewRRQuestion->m_Header.m_Attributes.m_u16Type = p_u16RecordType; - // It seems, that some mDNS implementations don't support 'unicast response' questions... - pNewRRQuestion->m_Header.m_Attributes.m_u16Class = (/*0x8000 |*/ DNS_RRCLASS_IN); // /*Unicast &*/ INternet - } - return bResult; -} - -/* - MDNSResponder::_sendQuery - - Creates and sends a query for the given domain and query type. - -*/ -bool clsLEAMDNSHost::_sendQuery(const clsLEAMDNSHost::clsQuery& p_Query, - clsLEAMDNSHost::clsQuery::clsAnswer::list* p_pKnownAnswers /*= 0*/) -{ - bool bResult = false; - - clsSendParameter sendParameter; - switch (p_Query.m_QueryType) - { - case clsQuery::enuQueryType::Host: -#ifdef MDNS_IPV4_SUPPORT - bResult = _addQueryRecord(sendParameter, p_Query.m_Domain, DNS_RRTYPE_A); -#endif -#ifdef MDNS2_IPV6_SUPPORT - bResult = _addQueryRecord(sendParameter, p_Query.m_Domain, DNS_RRTYPE_AAAA); -#endif - break; - - case clsQuery::enuQueryType::Service: - bResult = _addQueryRecord(sendParameter, p_Query.m_Domain, DNS_RRTYPE_PTR); - break; - - case clsQuery::enuQueryType::None: - default: - break; - } - - // TODO: Add known answers to query - (void)p_pKnownAnswers; - bResult = ((bResult) && - (_sendMessage(sendParameter))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _sendQuery: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_sendQuery - - Creates and sends a query for the given domain and record type. - -*/ -bool clsLEAMDNSHost::_sendQuery(const clsLEAMDNSHost::clsRRDomain& p_QueryDomain, - uint16_t p_u16RecordType, - clsLEAMDNSHost::clsQuery::clsAnswer::list* p_pKnownAnswers /*= 0*/) -{ - bool bResult = false; - - clsSendParameter sendParameter; - bResult = ((_addQueryRecord(sendParameter, p_QueryDomain, p_u16RecordType)) && - (_sendMessage(sendParameter))); - - // TODO: Add known answer records - (void) p_pKnownAnswers; - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _sendQuery: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_getResponderIPAddress -*/ -IPAddress clsLEAMDNSHost::_getResponderIPAddress(netif* pNetIf, enuIPProtocolType p_IPProtocolType) const -{ - IPAddress ipResponder; -#ifdef MDNS_IPV4_SUPPORT - if (enuIPProtocolType::V4 == p_IPProtocolType) - { - ipResponder = netif_ip_addr4(pNetIf); - } -#endif -#ifdef MDNS2_IPV6_SUPPORT - if (enuIPProtocolType::V6 == p_IPProtocolType) - { - bool bCheckLinkLocal = true; - for (int i = 0; ((!ipResponder.isSet()) && (i < 2)); ++i) // Two loops: First with link-local check, second without - { - for (int idx = 0; idx < LWIP_IPV6_NUM_ADDRESSES; ++idx) - { - //DEBUG_EX_INFO(if ip6_addr_isvalid(netif_ip6_addr_state(&pNetIf, idx)) DEBUG_OUTPUT.printf_P(PSTR("%s _getResponderIPAddress: Checking IPv6 address %s (LL: %s)\n"), _DH(), IPAddress(netif_ip_addr6(pNetIf, idx)).toString().c_str(), (bCheckLinkLocal ? "YES" : "NO"));); - if ((ip6_addr_isvalid(netif_ip6_addr_state(pNetIf, idx))) && - (((!bCheckLinkLocal) || - (ip6_addr_islinklocal(netif_ip6_addr(pNetIf, idx)))))) - { - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _getResponderIPAddress: Selected IPv6 address %s (LL: %s)\n"), _DH(), IPAddress(netif_ip_addr6(pNetIf, idx)).toString().c_str(), (bCheckLinkLocal ? "YES" : "NO"));); - ipResponder = netif_ip_addr6(pNetIf, idx); - break; - } - } - bCheckLinkLocal = false; - } - } -#endif - return ipResponder; -} - - -/** - HELPERS -*/ - -/** - RESOURCE RECORDS -*/ - -/* - MDNSResponder::_readRRQuestion - - Reads a question (eg. MyESP._http._tcp.local ANY IN) from the UPD input buffer. - -*/ -bool clsLEAMDNSHost::_readRRQuestion(clsLEAMDNSHost::clsRRQuestion& p_rRRQuestion) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRQuestion\n"));); - - bool bResult = false; - - if ((bResult = _readRRHeader(p_rRRQuestion.m_Header))) - { - // Extract unicast flag from class field - p_rRRQuestion.m_bUnicast = (p_rRRQuestion.m_Header.m_Attributes.m_u16Class & 0x8000); - //p_rRRQuestion.m_Header.m_Attributes.m_u16Class &= (~0x8000); - - DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRQuestion "), _DH()); - _printRRDomain(p_rRRQuestion.m_Header.m_Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:%s\n"), _RRType2Name(p_rRRQuestion.m_Header.m_Attributes.m_u16Type), _RRClass2String(p_rRRQuestion.m_Header.m_Attributes.m_u16Class, true)); - ); - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRQuestion: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_readRRAnswer - - Reads an answer (eg. _http._tcp.local PTR OP TTL MyESP._http._tcp.local) - from the UDP input buffer. - After reading the domain and type info, the further processing of the answer - is transferred the answer specific reading functions. - Unknown answer types are processed by the generic answer reader (to remove them - from the input buffer). - -*/ -bool clsLEAMDNSHost::_readRRAnswer(clsLEAMDNSHost::clsRRAnswer*& p_rpRRAnswer) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswer\n"));); - - bool bResult = false; - - clsRRHeader header; - uint32_t u32TTL; - uint16_t u16RDLength; - if ((_readRRHeader(header)) && - (_udpRead32(u32TTL)) && - (_udpRead16(u16RDLength))) - { - /* DEBUG_EX_INFO( - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswer: Reading 0x%04X answer (class:0x%04X, TTL:%u, RDLength:%u) for "), header.m_Attributes.m_u16Type, header.m_Attributes.m_u16Class, u32TTL, u16RDLength); - _printRRDomain(header.m_Domain); - DEBUG_OUTPUT.printf_P(PSTR("\n")); - );*/ - - switch (header.m_Attributes.m_u16Type /*& (~0x8000)*/) // Topmost bit might carry 'cache flush' flag - { -#ifdef MDNS_IPV4_SUPPORT - case DNS_RRTYPE_A: - p_rpRRAnswer = new clsRRAnswerA(header, u32TTL); - bResult = _readRRAnswerA(*(clsRRAnswerA*&)p_rpRRAnswer, u16RDLength); - break; -#endif - case DNS_RRTYPE_PTR: - p_rpRRAnswer = new clsRRAnswerPTR(header, u32TTL); - bResult = _readRRAnswerPTR(*(clsRRAnswerPTR*&)p_rpRRAnswer, u16RDLength); - break; - case DNS_RRTYPE_TXT: - p_rpRRAnswer = new clsRRAnswerTXT(header, u32TTL); - bResult = _readRRAnswerTXT(*(clsRRAnswerTXT*&)p_rpRRAnswer, u16RDLength); - break; -#ifdef MDNS2_IPV6_SUPPORT - case DNS_RRTYPE_AAAA: - p_rpRRAnswer = new clsRRAnswerAAAA(header, u32TTL); - bResult = _readRRAnswerAAAA(*(clsRRAnswerAAAA*&)p_rpRRAnswer, u16RDLength); - break; -#endif - case DNS_RRTYPE_SRV: - p_rpRRAnswer = new clsRRAnswerSRV(header, u32TTL); - bResult = _readRRAnswerSRV(*(clsRRAnswerSRV*&)p_rpRRAnswer, u16RDLength); - break; - default: - p_rpRRAnswer = new clsRRAnswerGeneric(header, u32TTL); - bResult = _readRRAnswerGeneric(*(clsRRAnswerGeneric*&)p_rpRRAnswer, u16RDLength); - break; - } - - DEBUG_EX_INFO_IF((bResult) && (p_rpRRAnswer), - { - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswer: "), _DH()); - _printRRDomain(p_rpRRAnswer->m_Header.m_Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:0x%04X TTL:%u, RDLength:%u "), - _RRType2Name(p_rpRRAnswer->m_Header.m_Attributes.m_u16Type), - (p_rpRRAnswer->m_Header.m_Attributes.m_u16Class | (p_rpRRAnswer->m_bCacheFlush ? 0x8000 : 0)), - p_rpRRAnswer->m_u32TTL, - u16RDLength); - switch (header.m_Attributes.m_u16Type /*& (~0x8000)*/) // Topmost bit might carry 'cache flush' flag - { -#ifdef MDNS_IPV4_SUPPORT - case DNS_RRTYPE_A: - DEBUG_OUTPUT.printf_P(PSTR("A IP:%s"), ((clsRRAnswerA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str()); - break; -#endif - case DNS_RRTYPE_PTR: - DEBUG_OUTPUT.printf_P(PSTR("PTR ")); - _printRRDomain(((clsRRAnswerPTR*&)p_rpRRAnswer)->m_PTRDomain); - break; - case DNS_RRTYPE_TXT: - { - size_t stTxtLength = ((clsRRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_strLength(); - char* pTxts = new char[stTxtLength]; - if (pTxts) - { - ((clsRRAnswerTXT*&)p_rpRRAnswer)->m_Txts.c_str(pTxts); - DEBUG_OUTPUT.printf_P(PSTR("TXT(%u) %s"), stTxtLength, pTxts); - delete[] pTxts; - } - break; - } -#ifdef MDNS2_IPV6_SUPPORT - case DNS_RRTYPE_AAAA: - DEBUG_OUTPUT.printf_P(PSTR("AAAA IP:%s"), ((clsRRAnswerAAAA*&)p_rpRRAnswer)->m_IPAddress.toString().c_str()); - break; -#endif - case DNS_RRTYPE_SRV: - DEBUG_OUTPUT.printf_P(PSTR("SRV Port:%u "), ((clsRRAnswerSRV*&)p_rpRRAnswer)->m_u16Port); - _printRRDomain(((clsRRAnswerSRV*&)p_rpRRAnswer)->m_SRVDomain); - break; - /* case DNS_RRTYPE_NSEC: - DEBUG_OUTPUT.printf_P(PSTR("NSEC ")); - _printRRDomain(((stcRRAnswerNSEC*&)p_rpRRAnswer)->m_NSECDomain); - for (uint32_t u=0; u<(((stcRRAnswerNSEC*&)p_rpRRAnswer)->m_pNSECBitmap->m_u16BitmapLength * 8); ++u) { - uint8_t byte = ((stcRRAnswerNSEC*&)p_rpRRAnswer)->m_pNSECBitmap->m_pu8BitmapData[u / 8]; - uint8_t flag = 1 << (7 - (u % 8)); // (7 - (0..7)) = 7..0 - if (byte & flag) { - DEBUG_OUTPUT.printf_P(PSTR(" %s"), _RRType2Name(u)); - } - } - break;*/ - default: - DEBUG_OUTPUT.printf_P(PSTR("generic ")); - break; - } - DEBUG_OUTPUT.printf_P(PSTR("\n")); - }); // DEBUG_EX_INFO - - DEBUG_EX_INFO_IF(!((bResult) && (p_rpRRAnswer)), - { - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswer: FAILED to read specific answer of type 0x%04X!\n"), _DH(), p_rpRRAnswer->m_Header.m_Attributes.m_u16Type); - }); - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswer: FAILED!\n"), _DH());); - return bResult; -} - -#ifdef MDNS_IPV4_SUPPORT -/* - MDNSResponder::_readRRAnswerA -*/ -bool clsLEAMDNSHost::_readRRAnswerA(clsLEAMDNSHost::clsRRAnswerA& p_rRRAnswerA, - uint16_t p_u16RDLength) -{ - uint32_t u32IPv4Address; - bool bResult = ((clsConsts::u16IPv4Size == p_u16RDLength) && - (_udpReadBuffer((unsigned char*)&u32IPv4Address, clsConsts::u16IPv4Size)) && - ((p_rRRAnswerA.m_IPAddress = IPAddress(u32IPv4Address)))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerA: FAILED!\n"), _DH());); - return bResult; -} -#endif - -/* - MDNSResponder::_readRRAnswerPTR -*/ -bool clsLEAMDNSHost::_readRRAnswerPTR(clsLEAMDNSHost::clsRRAnswerPTR& p_rRRAnswerPTR, - uint16_t p_u16RDLength) -{ - bool bResult = ((p_u16RDLength) && - (_readRRDomain(p_rRRAnswerPTR.m_PTRDomain))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerPTR: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_readRRAnswerTXT - - Read TXT items from a buffer like 4c#=15ff=20 -*/ -bool clsLEAMDNSHost::_readRRAnswerTXT(clsLEAMDNSHost::clsRRAnswerTXT& p_rRRAnswerTXT, - uint16_t p_u16RDLength) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: RDLength:%u\n"), _DH(), p_u16RDLength);); - bool bResult = true; - - p_rRRAnswerTXT.clear(); - if (p_u16RDLength) - { - bResult = false; - - unsigned char* pucBuffer = new unsigned char[p_u16RDLength]; - if (pucBuffer) - { - if (_udpReadBuffer(pucBuffer, p_u16RDLength)) - { - bResult = true; - - const unsigned char* pucCursor = pucBuffer; - while ((pucCursor < (pucBuffer + p_u16RDLength)) && - (bResult)) - { - bResult = false; - - clsServiceTxt* pTxt = 0; - unsigned char ucLength = *pucCursor++; // Length of the next txt item - if (ucLength) - { - DEBUG_EX_INFO( - char sacBuffer[64]; - *sacBuffer = 0; - uint8_t u8MaxLength = ((ucLength > (sizeof(sacBuffer) - 1)) ? (sizeof(sacBuffer) - 1) : ucLength); - os_strncpy(sacBuffer, (const char*)pucCursor, u8MaxLength + 1); - sacBuffer[u8MaxLength] = 0; - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: Item(%u): %s\n"), _DH(), ucLength, sacBuffer); - ); - - unsigned char* pucEqualSign = (unsigned char*)os_strchr((const char*)pucCursor, '='); // Position of the '=' sign - unsigned char ucKeyLength; - if ((pucEqualSign) && - ((ucKeyLength = (pucEqualSign - pucCursor)))) - { - unsigned char ucValueLength = (ucLength - (pucEqualSign - pucCursor + 1)); - bResult = (((pTxt = new clsServiceTxt)) && - (pTxt->setKey((const char*)pucCursor, ucKeyLength)) && - (pTxt->setValue((const char*)(pucEqualSign + 1), ucValueLength))); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: INVALID TXT format (No '=')!\n"), _DH());); - } - pucCursor += ucLength; - } - else // no/zero length TXT - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: INFO! TXT answer contains no items.\n"), _DH());); - bResult = true; - } - - if ((bResult) && - (pTxt)) - { - // Everythings fine so far - // Link TXT item to answer TXTs - p_rRRAnswerTXT.m_Txts.add(pTxt); - } - else - { - // At least no TXT (migth be OK, if length was 0) OR an error - if (!bResult) - { - DEBUG_EX_ERR( - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: FAILED to read TXT item!\n"), _DH()); - DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n")); - _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength); - DEBUG_OUTPUT.printf_P(PSTR("\n")); - ); - } - if (pTxt) - { - delete pTxt; - pTxt = 0; - } - p_rRRAnswerTXT.clear(); - } - } // while - - DEBUG_EX_ERR( - if (!bResult) // Some failure - { - DEBUG_OUTPUT.printf_P(PSTR("RData dump:\n")); - _udpDump((m_pUDPContext->tell() - p_u16RDLength), p_u16RDLength); - DEBUG_OUTPUT.printf_P(PSTR("\n")); - } - ); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: FAILED to read TXT content!\n"), _DH());); - } - // Clean up - delete[] pucBuffer; - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: FAILED to alloc buffer for TXT content!\n"), _DH());); - } - } - else - { - DEBUG_EX_ERR( - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: WARNING! No content in TXT answer from "), _DH()); - _printRRDomain(p_rRRAnswerTXT.m_Header.m_Domain); - DEBUG_OUTPUT.printf_P(PSTR("\n")); - ); - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerTXT: FAILED!\n"), _DH());); - return bResult; -} - -#ifdef MDNS2_IPV6_SUPPORT -bool clsLEAMDNSHost::_readRRAnswerAAAA(clsLEAMDNSHost::clsRRAnswerAAAA& p_rRRAnswerAAAA, - uint16_t p_u16RDLength) -{ - bool bResult = false; - - uint32_t au32IPv6Address[4]; // 16 bytes - if ((bResult = ((clsConsts::u16IPv6Size == p_u16RDLength) && - (_udpReadBuffer((uint8_t*)&au32IPv6Address[0], clsConsts::u16IPv6Size))))) - { - // ?? IPADDR6_INIT_HOST ?? - ip_addr_t addr = IPADDR6_INIT(au32IPv6Address[0], au32IPv6Address[1], au32IPv6Address[2], au32IPv6Address[3]); - p_rRRAnswerAAAA.m_IPAddress = IPAddress(addr); - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerAAAA: FAILED!\n"), _DH());); - return bResult; -} -#endif - -/* - MDNSResponder::_readRRAnswerSRV -*/ -bool clsLEAMDNSHost::_readRRAnswerSRV(clsLEAMDNSHost::clsRRAnswerSRV& p_rRRAnswerSRV, - uint16_t p_u16RDLength) -{ - bool bResult = (((3 * sizeof(uint16_t)) < p_u16RDLength) && - (_udpRead16(p_rRRAnswerSRV.m_u16Priority)) && - (_udpRead16(p_rRRAnswerSRV.m_u16Weight)) && - (_udpRead16(p_rRRAnswerSRV.m_u16Port)) && - (_readRRDomain(p_rRRAnswerSRV.m_SRVDomain))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerSRV: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_readRRAnswerGeneric -*/ -bool clsLEAMDNSHost::_readRRAnswerGeneric(clsLEAMDNSHost::clsRRAnswerGeneric& p_rRRAnswerGeneric, - uint16_t p_u16RDLength) -{ - bool bResult = (0 == p_u16RDLength); - - p_rRRAnswerGeneric.clear(); - if (((p_rRRAnswerGeneric.m_u16RDLength = p_u16RDLength)) && - ((p_rRRAnswerGeneric.m_pu8RDData = new unsigned char[p_rRRAnswerGeneric.m_u16RDLength]))) - { - bResult = _udpReadBuffer(p_rRRAnswerGeneric.m_pu8RDData, p_rRRAnswerGeneric.m_u16RDLength); - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAnswerGeneric: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_readRRHeader -*/ -bool clsLEAMDNSHost::_readRRHeader(clsLEAMDNSHost::clsRRHeader& p_rRRHeader) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRHeader\n"));); - - bool bResult = ((_readRRDomain(p_rRRHeader.m_Domain)) && - (_readRRAttributes(p_rRRHeader.m_Attributes))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRHeader: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_readRRDomain - - Reads a (maybe multilevel compressed) domain from the UDP input buffer. - -*/ -bool clsLEAMDNSHost::_readRRDomain(clsLEAMDNSHost::clsRRDomain& p_rRRDomain) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain\n"));); - - bool bResult = ((p_rRRDomain.clear()) && - (_readRRDomain_Loop(p_rRRDomain, 0))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_readRRDomain_Loop - - Reads a domain from the UDP input buffer. For every compression level, the functions - calls itself recursively. To avoid endless recursion because of malformed MDNS records, - the maximum recursion depth is set by clsConsts::u8DomainMaxRedirections. - -*/ -bool clsLEAMDNSHost::_readRRDomain_Loop(clsLEAMDNSHost::clsRRDomain& p_rRRDomain, - uint8_t p_u8Depth) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u)\n"), _DH(), p_u8Depth);); - - bool bResult = false; - - if (clsConsts::u8DomainMaxRedirections >= p_u8Depth) - { - bResult = true; - - uint8_t u8Len = 0; - do - { - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): Offset:%u p0:%02x\n"), _DH(), p_u8Depth, m_pUDPContext->tell(), m_pUDPContext->peek());); - _udpRead8(u8Len); - - if (u8Len & clsConsts::u8DomainCompressMark) - { - // Compressed label(s) - uint16_t u16Offset = ((u8Len & ~clsConsts::u8DomainCompressMark) << 8); // Implicit BE to LE conversion! - _udpRead8(u8Len); - u16Offset |= u8Len; - - if (m_pUDPContext->isValidOffset(u16Offset)) - { - size_t stCurrentPosition = m_pUDPContext->tell(); // Prepare return from recursion - - //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): Redirecting from %u to %u!\n"), _DH(), p_u8Depth, stCurrentPosition, u16Offset);); - m_pUDPContext->seek(u16Offset); - if (_readRRDomain_Loop(p_rRRDomain, p_u8Depth + 1)) // Do recursion - { - //DEBUG_EX_RX(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): Succeeded to read redirected label! Returning to %u\n"), _DH(), p_u8Depth, stCurrentPosition);); - m_pUDPContext->seek(stCurrentPosition); // Restore after recursion - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): FAILED to read redirected label!\n"), _DH(), p_u8Depth);); - bResult = false; - } - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): INVALID offset in redirection!\n"), _DH(), p_u8Depth);); - bResult = false; - } - break; - } - else - { - // Normal (uncompressed) label (maybe '\0' only) - if (clsConsts::stDomainMaxLength > (p_rRRDomain.m_u16NameLength + u8Len)) - { - // Add length byte - p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength] = u8Len; - ++(p_rRRDomain.m_u16NameLength); - if (u8Len) // Add name - { - if ((bResult = _udpReadBuffer((unsigned char*) & (p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength]), u8Len))) - { - /* DEBUG_EX_INFO( - p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength + u8Len] = 0; // Closing '\0' for printing - DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): Domain label (%u): %s\n"), _DH(), p_u8Depth, (unsigned)(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength - 1]), &(p_rRRDomain.m_acName[p_rRRDomain.m_u16NameLength])); - );*/ - - p_rRRDomain.m_u16NameLength += u8Len; - } - } - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(2) offset:%u p0:%x\n"), _DH(), m_pUDPContext->tell(), m_pUDPContext->peek());); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): ERROR! Domain name too long (%u + %u)!\n"), _DH(), p_u8Depth, p_rRRDomain.m_u16NameLength, u8Len);); - bResult = false; - break; - } - } - } while ((bResult) && - (0 != u8Len)); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRDomain_Loop(%u): ERROR! Too many redirections!\n"), _DH(), p_u8Depth);); - } - return bResult; -} - -/* - MDNSResponder::_readRRAttributes - -*/ -bool clsLEAMDNSHost::_readRRAttributes(clsLEAMDNSHost::clsRRAttributes& p_rRRAttributes) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAttributes\n"));); - - bool bResult = ((_udpRead16(p_rRRAttributes.m_u16Type)) && - (_udpRead16(p_rRRAttributes.m_u16Class))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readRRAttributes: FAILED!\n"), _DH());); - return bResult; -} - - -/* - - DOMAIN NAMES - -*/ - -/* - MDNSResponder::_buildDomainForHost - - Builds a MDNS host domain (eg. esp8266.local) for the given hostname. - -*/ -bool clsLEAMDNSHost::_buildDomainForHost(const char* p_pcHostName, - clsLEAMDNSHost::clsRRDomain& p_rHostDomain) const -{ - - p_rHostDomain.clear(); - bool bResult = ((p_pcHostName) && - (*p_pcHostName) && - (p_rHostDomain.addLabel(p_pcHostName)) && - (p_rHostDomain.addLabel(clsConsts::pcLocal)) && - (p_rHostDomain.addLabel(0))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _buildDomainForHost: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_buildDomainForDNSSD - - Builds the '_services._dns-sd._udp.local' domain. - Used while detecting generic service enum question (DNS-SD) and answering these questions. - -*/ -bool clsLEAMDNSHost::_buildDomainForDNSSD(clsLEAMDNSHost::clsRRDomain& p_rDNSSDDomain) const -{ - p_rDNSSDDomain.clear(); - bool bResult = ((p_rDNSSDDomain.addLabel(clsConsts::pcServices, true)) && - (p_rDNSSDDomain.addLabel(clsConsts::pcDNSSD, true)) && - (p_rDNSSDDomain.addLabel(clsConsts::pcUDP, true)) && - (p_rDNSSDDomain.addLabel(clsConsts::pcLocal)) && - (p_rDNSSDDomain.addLabel(0))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _buildDomainForDNSSD: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_buildDomainForService - - Builds the domain for the given service (eg. _http._tcp.local or - MyESP._http._tcp.local (if p_bIncludeName is set)). - -*/ -bool clsLEAMDNSHost::_buildDomainForService(const clsLEAMDNSHost::clsService& p_Service, - bool p_bIncludeName, - clsLEAMDNSHost::clsRRDomain& p_rServiceDomain) const -{ - p_rServiceDomain.clear(); - bool bResult = (((!p_bIncludeName) || - (p_rServiceDomain.addLabel(p_Service.instanceName()))) && - (p_rServiceDomain.addLabel(p_Service.type(), ('_' != *p_Service.type()))) && - (p_rServiceDomain.addLabel(p_Service.protocol(), ('_' != *p_Service.protocol()))) && - (p_rServiceDomain.addLabel(clsConsts::pcLocal)) && - (p_rServiceDomain.addLabel(0))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _buildDomainForService: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_buildDomainForService - - Builds the domain for the given service properties (eg. _http._tcp.local). - The usual prepended '_' are added, if missing in the input strings. - -*/ -bool clsLEAMDNSHost::_buildDomainForService(const char* p_pcServiceType, - const char* p_pcProtocol, - clsLEAMDNSHost::clsRRDomain& p_rServiceDomain) const -{ - p_rServiceDomain.clear(); - bool bResult = ((p_pcServiceType) && - (p_pcProtocol) && - (p_rServiceDomain.addLabel(p_pcServiceType, ('_' != *p_pcServiceType))) && - (p_rServiceDomain.addLabel(p_pcProtocol, ('_' != *p_pcProtocol))) && - (p_rServiceDomain.addLabel(clsConsts::pcLocal)) && - (p_rServiceDomain.addLabel(0))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _buildDomainForService: FAILED for (%s.%s)!\n"), _DH(), (p_pcServiceType ? : "-"), (p_pcProtocol ? : "-"));); - return bResult; -} - -#ifdef MDNS_IPV4_SUPPORT -/* - MDNSResponder::_buildDomainForReverseIPv4 - - The IPv4 address is stringized by printing the four address bytes into a char buffer in reverse order - and adding 'in-addr.arpa' (eg. 012.789.456.123.in-addr.arpa). - Used while detecting reverse IPv4 questions and answering these - -*/ -bool clsLEAMDNSHost::_buildDomainForReverseIPv4(IPAddress p_IPv4Address, - clsLEAMDNSHost::clsRRDomain& p_rReverseIPv4Domain) const -{ - bool bResult = ((p_IPv4Address.isSet()) && - (p_IPv4Address.isV4())); - - p_rReverseIPv4Domain.clear(); - - char acBuffer[32]; - for (int i = clsConsts::u16IPv4Size; ((bResult) && (i >= 1)); --i) - { - itoa(p_IPv4Address[i - 1], acBuffer, 10); - bResult = p_rReverseIPv4Domain.addLabel(acBuffer); - } - bResult = ((bResult) && - (p_rReverseIPv4Domain.addLabel(clsConsts::pcReverseIPv4Domain)) && - (p_rReverseIPv4Domain.addLabel(clsConsts::pcReverseTopDomain)) && - (p_rReverseIPv4Domain.addLabel(0))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _buildDomainForReverseIPv4: FAILED!\n"), _DH());); - return bResult; -} -#endif - -#ifdef MDNS2_IPV6_SUPPORT -/* - MDNSResponder::_buildDomainForReverseIPv6 - - The IPv6 address is stringized by printing the 16 address bytes (32 nibbles) into a char buffer in reverse order - and adding 'ip6.arpa' (eg. 3.B.6.E.A.1.B.B.A.B.F.7.F.8.0.1.0.0.0.0.0.0.0.0.0.0.0.0.0.8.E.F.ip6.arpa). - Used while detecting reverse IPv6 questions and answering these - -*/ -bool clsLEAMDNSHost::_buildDomainForReverseIPv6(IPAddress p_IPv6Address, - clsLEAMDNSHost::clsRRDomain& p_rReverseIPv6Domain) const -{ - bool bResult = ((p_IPv6Address.isSet()) && - (p_IPv6Address.isV6())); - - p_rReverseIPv6Domain.clear(); - - const uint16_t* pRaw = p_IPv6Address.raw6(); - for (int8_t i8 = (clsConsts::u16IPv6Size / 2); ((bResult) && (i8 > 0)); --i8) // 8..1 - { - uint16_t u16Part = ntohs(pRaw[i8 - 1] & 0xFFFF); - char acBuffer[2]; - for (uint8_t u8 = 0; ((bResult) && (u8 < 4)); ++u8) // 0..3 - { - itoa((u16Part & 0xF), acBuffer, 16); - bResult = p_rReverseIPv6Domain.addLabel(acBuffer); - u16Part >>= 4; - } - } - bResult = ((bResult) && - (p_rReverseIPv6Domain.addLabel(clsConsts::pcReverseIPv6Domain)) && // .ip6.arpa - (p_rReverseIPv6Domain.addLabel(clsConsts::pcReverseTopDomain)) && // .local - (p_rReverseIPv6Domain.addLabel(0))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _buildDomainForReverseIPv6: FAILED!\n"), _DH());); - return bResult; -} -#endif - - -/* - - UDP - -*/ - -/* - MDNSResponder::_udpReadBuffer - -*/ -bool clsLEAMDNSHost::_udpReadBuffer(unsigned char* p_pBuffer, - size_t p_stLength) -{ - bool bResult = ((m_pUDPContext->getSize() >= p_stLength) && - (p_pBuffer) && - (p_stLength) && - ((p_stLength == m_pUDPContext->read((char*)p_pBuffer, p_stLength)))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _udpReadBuffer: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_udpRead8 - -*/ -bool clsLEAMDNSHost::_udpRead8(uint8_t& p_ru8Value) -{ - return _udpReadBuffer((unsigned char*)&p_ru8Value, sizeof(p_ru8Value)); -} - -/* - MDNSResponder::_udpRead16 - -*/ -bool clsLEAMDNSHost::_udpRead16(uint16_t& p_ru16Value) -{ - bool bResult = false; - - if (_udpReadBuffer((unsigned char*)&p_ru16Value, sizeof(p_ru16Value))) - { - p_ru16Value = lwip_ntohs(p_ru16Value); - bResult = true; - } - return bResult; -} - -/* - MDNSResponder::_udpRead32 - -*/ -bool clsLEAMDNSHost::_udpRead32(uint32_t& p_ru32Value) -{ - bool bResult = false; - - if (_udpReadBuffer((unsigned char*)&p_ru32Value, sizeof(p_ru32Value))) - { - p_ru32Value = lwip_ntohl(p_ru32Value); - bResult = true; - } - return bResult; -} - -/* - MDNSResponder::_udpAppendBuffer - -*/ -bool clsLEAMDNSHost::_udpAppendBuffer(const unsigned char* p_pcBuffer, - size_t p_stLength) -{ - bool bResult = ((p_pcBuffer) && - (p_stLength) && - (p_stLength == m_pUDPContext->append((const char*)p_pcBuffer, p_stLength))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _udpAppendBuffer: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_udpAppend8 - -*/ -bool clsLEAMDNSHost::_udpAppend8(uint8_t p_u8Value) -{ - return (_udpAppendBuffer((unsigned char*)&p_u8Value, sizeof(p_u8Value))); -} - -/* - MDNSResponder::_udpAppend16 - -*/ -bool clsLEAMDNSHost::_udpAppend16(uint16_t p_u16Value) -{ - p_u16Value = lwip_htons(p_u16Value); - return (_udpAppendBuffer((unsigned char*)&p_u16Value, sizeof(p_u16Value))); -} - -/* - MDNSResponder::_udpAppend32 - -*/ -bool clsLEAMDNSHost::_udpAppend32(uint32_t p_u32Value) -{ - p_u32Value = lwip_htonl(p_u32Value); - return (_udpAppendBuffer((unsigned char*)&p_u32Value, sizeof(p_u32Value))); -} - -#ifdef DEBUG_ESP_PORT -/* - MDNSResponder::_udpDump - -*/ -bool clsLEAMDNSHost::_udpDump(bool p_bMovePointer /*= false*/) -{ - const uint8_t cu8BytesPerLine = 16; - - uint32_t u32StartPosition = m_pUDPContext->tell(); - DEBUG_OUTPUT.println("UDP Context Dump:"); - uint32_t u32Counter = 0; - uint8_t u8Byte = 0; - - while (_udpRead8(u8Byte)) - { - DEBUG_OUTPUT.printf_P(PSTR("%02x %s"), u8Byte, ((++u32Counter % cu8BytesPerLine) ? "" : "\n")); - } - DEBUG_OUTPUT.printf_P(PSTR("%sDone: %u bytes\n"), (((u32Counter) && (u32Counter % cu8BytesPerLine)) ? "\n" : ""), u32Counter); - - if (!p_bMovePointer) // Restore - { - m_pUDPContext->seek(u32StartPosition); - } - return true; -} - -/* - MDNSResponder::_udpDump - -*/ -bool clsLEAMDNSHost::_udpDump(unsigned p_uOffset, - unsigned p_uLength) -{ - if (m_pUDPContext->isValidOffset(p_uOffset)) - { - unsigned uCurrentPosition = m_pUDPContext->tell(); // Remember start position - - m_pUDPContext->seek(p_uOffset); - uint8_t u8Byte; - for (unsigned u = 0; ((u < p_uLength) && (_udpRead8(u8Byte))); ++u) - { - DEBUG_OUTPUT.printf_P(PSTR("%02x "), u8Byte); - } - // Return to start position - m_pUDPContext->seek(uCurrentPosition); - } - return true; -} -#endif // DEBUG_ESP_PORT - - -/** - READ/WRITE MDNS STRUCTS -*/ - -/* - MDNSResponder::_readMDNSMsgHeader - - Read a MDNS header from the UDP input buffer. - | 8 | 8 | 8 | 8 | - 00| Identifier | Flags & Codes | - 01| Question count | Answer count | - 02| NS answer count | Ad answer count | - - All 16-bit and 32-bit elements need to be translated from network coding to host coding (done in _udpRead16 and _udpRead32) - In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they - need some mapping here - -*/ -bool clsLEAMDNSHost::_readMDNSMsgHeader(clsLEAMDNSHost::clsMsgHeader& p_rMsgHeader) -{ - bool bResult = false; - - uint8_t u8B1; - uint8_t u8B2; - if ((_udpRead16(p_rMsgHeader.m_u16ID)) && - (_udpRead8(u8B1)) && - (_udpRead8(u8B2)) && - (_udpRead16(p_rMsgHeader.m_u16QDCount)) && - (_udpRead16(p_rMsgHeader.m_u16ANCount)) && - (_udpRead16(p_rMsgHeader.m_u16NSCount)) && - (_udpRead16(p_rMsgHeader.m_u16ARCount))) - { - - p_rMsgHeader.m_1bQR = (u8B1 & 0x80); // Query/Response flag - p_rMsgHeader.m_4bOpcode = (u8B1 & 0x78); // Operation code (0: Standard query, others ignored) - p_rMsgHeader.m_1bAA = (u8B1 & 0x04); // Authorative answer - p_rMsgHeader.m_1bTC = (u8B1 & 0x02); // Truncation flag - p_rMsgHeader.m_1bRD = (u8B1 & 0x01); // Recursion desired - - p_rMsgHeader.m_1bRA = (u8B2 & 0x80); // Recursion available - p_rMsgHeader.m_3bZ = (u8B2 & 0x70); // Zero - p_rMsgHeader.m_4bRCode = (u8B2 & 0x0F); // Response code - - /* DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _readMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"), - _DH(), - (unsigned)p_rMsgHeader.m_u16ID, - (unsigned)p_rMsgHeader.m_1bQR, (unsigned)p_rMsgHeader.m_4bOpcode, (unsigned)p_rMsgHeader.m_1bAA, (unsigned)p_rMsgHeader.m_1bTC, (unsigned)p_rMsgHeader.m_1bRD, - (unsigned)p_rMsgHeader.m_1bRA, (unsigned)p_rMsgHeader.m_4bRCode, - (unsigned)p_rMsgHeader.m_u16QDCount, - (unsigned)p_rMsgHeader.m_u16ANCount, - (unsigned)p_rMsgHeader.m_u16NSCount, - (unsigned)p_rMsgHeader.m_u16ARCount););*/ - bResult = true; - } - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _readMDNSMsgHeader: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_write8 - -*/ -bool clsLEAMDNSHost::_write8(uint8_t p_u8Value, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - return ((_udpAppend8(p_u8Value)) && - (p_rSendParameter.shiftOffset(sizeof(p_u8Value)))); -} - -/* - MDNSResponder::_write16 - -*/ -bool clsLEAMDNSHost::_write16(uint16_t p_u16Value, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - return ((_udpAppend16(p_u16Value)) && - (p_rSendParameter.shiftOffset(sizeof(p_u16Value)))); -} - -/* - MDNSResponder::_write32 - -*/ -bool clsLEAMDNSHost::_write32(uint32_t p_u32Value, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - return ((_udpAppend32(p_u32Value)) && - (p_rSendParameter.shiftOffset(sizeof(p_u32Value)))); -} - -/* - MDNSResponder::_writeMDNSMsgHeader - - Write MDNS header to the UDP output buffer. - - All 16-bit and 32-bit elements need to be translated from host coding to network coding (done in _udpAppend16 and _udpAppend32) - In addition, bitfield memory order is undefined in C standard (GCC doesn't order them in the coded direction...), so they - need some mapping here - -*/ -bool clsLEAMDNSHost::_writeMDNSMsgHeader(const clsLEAMDNSHost::clsMsgHeader& p_MsgHeader, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - /* DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSMsgHeader: ID:%u QR:%u OP:%u AA:%u TC:%u RD:%u RA:%u R:%u QD:%u AN:%u NS:%u AR:%u\n"), - _DH(), - (unsigned)p_MsgHeader.m_u16ID, - (unsigned)p_MsgHeader.m_1bQR, (unsigned)p_MsgHeader.m_4bOpcode, (unsigned)p_MsgHeader.m_1bAA, (unsigned)p_MsgHeader.m_1bTC, (unsigned)p_MsgHeader.m_1bRD, - (unsigned)p_MsgHeader.m_1bRA, (unsigned)p_MsgHeader.m_4bRCode, - (unsigned)p_MsgHeader.m_u16QDCount, - (unsigned)p_MsgHeader.m_u16ANCount, - (unsigned)p_MsgHeader.m_u16NSCount, - (unsigned)p_MsgHeader.m_u16ARCount););*/ - - uint8_t u8B1((p_MsgHeader.m_1bQR << 7) | (p_MsgHeader.m_4bOpcode << 3) | (p_MsgHeader.m_1bAA << 2) | (p_MsgHeader.m_1bTC << 1) | (p_MsgHeader.m_1bRD)); - uint8_t u8B2((p_MsgHeader.m_1bRA << 7) | (p_MsgHeader.m_3bZ << 4) | (p_MsgHeader.m_4bRCode)); - bool bResult = ((_write16(p_MsgHeader.m_u16ID, p_rSendParameter)) && - (_write8(u8B1, p_rSendParameter)) && - (_write8(u8B2, p_rSendParameter)) && - (_write16(p_MsgHeader.m_u16QDCount, p_rSendParameter)) && - (_write16(p_MsgHeader.m_u16ANCount, p_rSendParameter)) && - (_write16(p_MsgHeader.m_u16NSCount, p_rSendParameter)) && - (_write16(p_MsgHeader.m_u16ARCount, p_rSendParameter))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSMsgHeader: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_writeRRAttributes - -*/ -bool clsLEAMDNSHost::_writeMDNSRRAttributes(const clsLEAMDNSHost::clsRRAttributes& p_Attributes, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - bool bResult = ((_write16(p_Attributes.m_u16Type, p_rSendParameter)) && - (_write16(p_Attributes.m_u16Class, p_rSendParameter))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSRRAttributes: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_writeMDNSRRDomain - -*/ -bool clsLEAMDNSHost::_writeMDNSRRDomain(const clsLEAMDNSHost::clsRRDomain& p_Domain, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - bool bResult = ((_udpAppendBuffer((const unsigned char*)p_Domain.m_acName, p_Domain.m_u16NameLength)) && - (p_rSendParameter.shiftOffset(p_Domain.m_u16NameLength))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSRRDomain: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_writeMDNSHostDomain - - Write a host domain to the UDP output buffer. - If the domain record is part of the answer, the records length is - prepended (p_bPrependRDLength is set). - - A very simple form of name compression is applied here: - If the domain is written to the UDP output buffer, the write offset is stored - together with a domain id (the pointer) in a p_rSendParameter substructure (cache). - If the same domain (pointer) should be written to the UDP output later again, - the old offset is retrieved from the cache, marked as a compressed domain offset - and written to the output buffer. - -*/ -bool clsLEAMDNSHost::_writeMDNSHostDomain(const char* p_pcHostName, - bool p_bPrependRDLength, - uint16_t p_u16AdditionalLength, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV' - uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)p_pcHostName, false); - - clsRRDomain hostDomain; - bool bResult = (u16CachedDomainOffset - // Found cached domain -> mark as compressed domain - ? ((clsConsts::u8DomainCompressMark > ((u16CachedDomainOffset >> 8) & ~clsConsts::u8DomainCompressMark)) && // Valid offset - ((!p_bPrependRDLength) || - (_write16((2 + p_u16AdditionalLength), p_rSendParameter))) && // Length of 'Cxxx' - (_write8(((u16CachedDomainOffset >> 8) | clsConsts::u8DomainCompressMark), p_rSendParameter)) && // Compression mark (and offset) - (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter))) - // No cached domain -> add this domain to cache and write full domain name - : ((_buildDomainForHost(p_pcHostName, hostDomain)) && // eg. esp8266.local - ((!p_bPrependRDLength) || - (_write16((hostDomain.m_u16NameLength + p_u16AdditionalLength), p_rSendParameter))) && // RDLength (if needed) - (p_rSendParameter.addDomainCacheItem((const void*)p_pcHostName, false, p_rSendParameter.m_u16Offset)) && - (_writeMDNSRRDomain(hostDomain, p_rSendParameter)))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSHostDomain: FAILED!\n"), _DH());); - return bResult; - -} - -/* - MDNSResponder::_writeMDNSServiceDomain - - Write a service domain to the UDP output buffer. - If the domain record is part of the answer, the records length is - prepended (p_bPrependRDLength is set). - - A very simple form of name compression is applied here: see '_writeMDNSHostDomain' - The cache differentiates of course between service domains which includes - the instance name (p_bIncludeName is set) and thoose who don't. - -*/ -bool clsLEAMDNSHost::_writeMDNSServiceDomain(const clsLEAMDNSHost::clsService& p_Service, - bool p_bIncludeName, - bool p_bPrependRDLength, - uint16_t p_u16AdditionalLength, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - // The 'skip-compression' version is handled in '_writeMDNSAnswer_SRV' - uint16_t u16CachedDomainOffset = p_rSendParameter.findCachedDomainOffset((const void*)&p_Service, p_bIncludeName); - - clsRRDomain serviceDomain; - bool bResult = (u16CachedDomainOffset - // Found cached domain -> mark as compressed domain - ? ((clsConsts::u8DomainCompressMark > ((u16CachedDomainOffset >> 8) & ~clsConsts::u8DomainCompressMark)) && // Valid offset - ((!p_bPrependRDLength) || - (_write16((2 + p_u16AdditionalLength), p_rSendParameter))) && // Lenght of 'Cxxx' - (_write8(((u16CachedDomainOffset >> 8) | clsConsts::u8DomainCompressMark), p_rSendParameter)) && // Compression mark (and offset) - (_write8((uint8_t)(u16CachedDomainOffset & 0xFF), p_rSendParameter))) - // No cached domain -> add this domain to cache and write full domain name - : ((_buildDomainForService(p_Service, p_bIncludeName, serviceDomain)) && // eg. MyESP._http._tcp.local - ((!p_bPrependRDLength) || - (_write16((serviceDomain.m_u16NameLength + p_u16AdditionalLength), p_rSendParameter))) && // RDLength (if needed) - (p_rSendParameter.addDomainCacheItem((const void*)&p_Service, p_bIncludeName, p_rSendParameter.m_u16Offset)) && - (_writeMDNSRRDomain(serviceDomain, p_rSendParameter)))); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSServiceDomain: FAILED!\n"), _DH());); - return bResult; - -} - -/* - MDNSResponder::_writeMDNSQuestion - - Write a MDNS question to the UDP output buffer - - QNAME (host/service domain, eg. esp8266.local) - QTYPE (16bit, eg. ANY) - QCLASS (16bit, eg. IN) - -*/ -bool clsLEAMDNSHost::_writeMDNSQuestion(clsLEAMDNSHost::clsRRQuestion& p_Question, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSQuestion\n"));); - - bool bResult = ((_writeMDNSRRDomain(p_Question.m_Header.m_Domain, p_rSendParameter)) && - (_writeMDNSRRAttributes(p_Question.m_Header.m_Attributes, p_rSendParameter))); - - DEBUG_EX_INFO(if (bResult) -{ - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSQuestion "), _DH()); - _printRRDomain(p_Question.m_Header.m_Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:0x%04X\n"), - _RRType2Name(p_Question.m_Header.m_Attributes.m_u16Type), - p_Question.m_Header.m_Attributes.m_u16Class); - }); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSQuestion: FAILED!\n"), _DH());); - return bResult; -} - - -#ifdef MDNS_IPV4_SUPPORT -/* - MDNSResponder::_writeMDNSAnswer_A - - Write a MDNS A answer to the UDP output buffer. - - NAME (var, host/service domain, eg. esp8266.local - TYPE (16bit, eg. A) - CLASS (16bit, eg. IN) - TTL (32bit, eg. 120) - RDLENGTH (16bit, eg 4) - RDATA (var, eg. 123.456.789.012) - - eg. esp8266.local A 0x8001 120 4 123.456.789.012 - Ref: http://www.zytrax.com/books/dns/ch8/a.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_A(IPAddress p_IPAddress, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_A (%s)%s\n"), p_IPAddress.toString().c_str(), (p_rSendParameter.m_bCacheFlush ? "" : " nF"));); - - clsRRAttributes attributes(DNS_RRTYPE_A, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - const unsigned char aucIPAddress[clsConsts::u16IPv4Size] = { p_IPAddress[0], p_IPAddress[1], p_IPAddress[2], p_IPAddress[3] }; - bool bResult = ((p_IPAddress.isV4()) && - (_writeMDNSHostDomain(m_pcHostName, false, 0, p_rSendParameter)) && - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), p_rSendParameter)) && // TTL - (_write16(clsConsts::u16IPv4Size, p_rSendParameter)) && // RDLength - (_udpAppendBuffer(aucIPAddress, clsConsts::u16IPv4Size)) && // RData - (p_rSendParameter.shiftOffset(clsConsts::u16IPv4Size))); - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_A %s.local Type:%s Class:0x%04X TTL:%u %s\n"), - _DH(), - m_pcHostName, - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), - p_IPAddress.toString().c_str()); - ); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_A: FAILED!\n"), _DH());); - return bResult; - -} - -/* - MDNSResponder::_writeMDNSAnswer_PTR_IPv4 - - Write a MDNS reverse IPv4 PTR answer to the UDP output buffer. - See: '_writeMDNSAnswer_A' - - eg. 012.789.456.123.in-addr.arpa PTR 0x8001 120 15 esp8266.local - Used while answering reverse IPv4 questions - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_PTR_IPv4(IPAddress p_IPAddress, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_IPv4 (%s)%s\n"), p_IPAddress.toString().c_str(), (p_rSendParameter.m_bCacheFlush ? "" : " nF"));); - - clsRRDomain reverseIPv4Domain; - clsRRAttributes attributes(DNS_RRTYPE_PTR, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - clsRRDomain hostDomain; - bool bResult = ((p_IPAddress.isV4()) && - (_buildDomainForReverseIPv4(p_IPAddress, reverseIPv4Domain)) && // 012.789.456.123.in-addr.arpa - (_writeMDNSRRDomain(reverseIPv4Domain, p_rSendParameter)) && - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), p_rSendParameter)) && // TTL - (_writeMDNSHostDomain(m_pcHostName, true, 0, p_rSendParameter))); // RDLength & RData (host domain, eg. esp8266.local) - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_IPv4 "), _DH()); - _printRRDomain(reverseIPv4Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:0x%04X TTL:%u %s.local\n"), - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), - m_pcHostName); - ); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_IPv4: FAILED!\n"), _DH());); - return bResult; -} -#endif - -/* - MDNSResponder::_writeMDNSAnswer_PTR_TYPE - - Write a MDNS PTR answer to the UDP output buffer. - See: '_writeMDNSAnswer_A' - - PTR all-services -> service type - eg. _services._dns-sd._udp.local PTR 0x8001 5400 xx _http._tcp.local - http://www.zytrax.com/books/dns/ch8/ptr.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_PTR_TYPE(clsLEAMDNSHost::clsService& p_rService, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_TYPE\n"));); - - clsRRDomain dnssdDomain; - clsRRDomain serviceDomain; - clsRRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN); // No cache flush for shared records! only INternet - bool bResult = ((_buildDomainForDNSSD(dnssdDomain)) && // _services._dns-sd._udp.local - (_writeMDNSRRDomain(dnssdDomain, p_rSendParameter)) && - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL)), p_rSendParameter)) && // TTL - (_writeMDNSServiceDomain(p_rService, false, true, 0, p_rSendParameter))); // RDLength & RData (service domain, eg. _http._tcp.local) - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_TYPE "), _DH()); - _printRRDomain(dnssdDomain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:0x%04X TTL:%u _%s._%s.local\n"), - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL)), - p_rService.m_pcType, - p_rService.m_pcProtocol); - ); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_TYPE: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_writeMDNSAnswer_PTR_NAME - - Write a MDNS PTR answer to the UDP output buffer. - See: '_writeMDNSAnswer_A' - - PTR service type -> service name - eg. _http.tcp.local PTR 0x8001 120 xx myESP._http._tcp.local - http://www.zytrax.com/books/dns/ch8/ptr.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_PTR_NAME(clsLEAMDNSHost::clsService& p_rService, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_NAME\n"), _DH());); - - clsRRAttributes attributes(DNS_RRTYPE_PTR, DNS_RRCLASS_IN); // No cache flush for shared records! only INternet - bool bResult = ((_writeMDNSServiceDomain(p_rService, false, false, 0, p_rSendParameter)) && // _http._tcp.local - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL)), p_rSendParameter)) && // TTL - (_writeMDNSServiceDomain(p_rService, true, true, 0, p_rSendParameter))); // RDLength & RData (service domain, eg. MyESP._http._tcp.local) - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_NAME _%s._%s.local Type:%s Class:0x%04X TTL:%u %s._%s._%s.local\n"), - _DH(), - p_rService.m_pcType, - p_rService.m_pcProtocol, - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL)), - p_rService.m_pcInstanceName, - p_rService.m_pcType, - p_rService.m_pcProtocol); - ); - DEBUG_EX_ERR(if (!bResult)DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_NAME: FAILED!\n"), _DH());); - return bResult; -} - - -/* - MDNSResponder::_writeMDNSAnswer_TXT - - Write a MDNS TXT answer to the UDP output buffer. - See: '_writeMDNSAnswer_A' - - The TXT items in the RDATA block are 'length byte encoded': [len]vardata - - eg. myESP._http._tcp.local TXT 0x8001 120 4 c#=1 - http://www.zytrax.com/books/dns/ch8/txt.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_TXT(clsLEAMDNSHost::clsService& p_rService, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_TXT%s\n"), (p_rSendParameter.m_bCacheFlush ? "" : " nF"), _DH());); - - bool bResult = false; - - clsRRAttributes attributes(DNS_RRTYPE_TXT, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - - if ((_collectServiceTxts(p_rService)) && - (_writeMDNSServiceDomain(p_rService, true, false, 0, p_rSendParameter)) && // MyESP._http._tcp.local - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery // TTL - ? clsConsts::u32LegacyTTL - : clsConsts::u32ServiceTTL)), p_rSendParameter)) && - (_write16((p_rService.m_Txts.count() // RDLength - ? p_rService.m_Txts.length() // default case - : 1), p_rSendParameter))) // If no TXT records exist, a single 0 byte is sent - { - bResult = true; - // RData Txts - if (p_rService.m_Txts.count()) - { - for (const clsServiceTxt* pTxt : p_rService.m_Txts.m_Txts) - { - unsigned char ucLengthByte = pTxt->length(); - if (!((bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) && // Length - (p_rSendParameter.shiftOffset(sizeof(ucLengthByte))) && - ((size_t)os_strlen(pTxt->m_pcKey) == m_pUDPContext->append(pTxt->m_pcKey, os_strlen(pTxt->m_pcKey))) && // Key - (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcKey))) && - (1 == m_pUDPContext->append("=", 1)) && // = - (p_rSendParameter.shiftOffset(1)) && - ((!pTxt->m_pcValue) || - (((size_t)os_strlen(pTxt->m_pcValue) == m_pUDPContext->append(pTxt->m_pcValue, os_strlen(pTxt->m_pcValue))) && // Value - (p_rSendParameter.shiftOffset((size_t)os_strlen(pTxt->m_pcValue))))))))) - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_TXT: FAILED to write %sTxt %s=%s!\n"), _DH(), (pTxt->m_bTemp ? "temp. " : ""), (pTxt->m_pcKey ? : "?"), (pTxt->m_pcValue ? : "?"));); - break; - } - } - } - else - { - // RFC 6763 Ch.6: Every DNS-SD service MUST have a TXT record in addition to its SRV record, ... - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_TXT: Adding EMPTY TXT record!\n"), _DH());); - unsigned char ucLengthByte = 0; - bResult = ((_udpAppendBuffer((unsigned char*)&ucLengthByte, sizeof(ucLengthByte))) && // Length - (p_rSendParameter.shiftOffset(sizeof(ucLengthByte)))); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_TXT: FAILED to write EMPTY TXT record!\n"), _DH());); - } - } - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_TXT %s._%s._%s.local Type:%s Class:0x%04X TTL:%u \n"), - _DH(), - p_rService.m_pcInstanceName, - p_rService.m_pcType, - p_rService.m_pcProtocol, - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL))); - ); - - _releaseTempServiceTxts(p_rService); - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_TXT: FAILED!\n"), _DH());); - return bResult; -} - -#ifdef MDNS2_IPV6_SUPPORT -/* - MDNSResponder::_writeMDNSAnswer_AAAA - - Write a MDNS AAAA answer to the UDP output buffer. - See: '_writeMDNSAnswer_AAAA' - - eg. esp8266.local AAAA 0x8001 120 16 xxxx::xx - http://www.zytrax.com/books/dns/ch8/aaaa.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_AAAA(IPAddress p_IPAddress, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_AAAA (%s)%s\n"), p_IPAddress.toString().c_str(), (p_rSendParameter.m_bCacheFlush ? "" : " nF"));); - - clsRRAttributes attributes(DNS_RRTYPE_AAAA, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - bool bResult = ((p_IPAddress.isV6()) && - (_writeMDNSHostDomain(m_pcHostName, false, 0, p_rSendParameter)) && // esp8266.local - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), p_rSendParameter)) && // TTL - (_write16(clsConsts::u16IPv6Size, p_rSendParameter)) && // RDLength - (_udpAppendBuffer((uint8_t*)p_IPAddress.raw6(), clsConsts::u16IPv6Size)) && // RData - (p_rSendParameter.shiftOffset(clsConsts::u16IPv6Size))); - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_AAAA %s.local Type:%s Class:0x%04X TTL:%u %s\n"), - _DH(), - m_pcHostName, - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), - p_IPAddress.toString().c_str()); - ); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_AAAA: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_writeMDNSAnswer_PTR_IPv6 - - Write a MDNS reverse IPv6 PTR answer to the UDP output buffer. - See: '_writeMDNSAnswer_AAAA' - - eg. xxxx::xx.ip6.arpa PTR 0x8001 120 15 esp8266.local - Used while answering reverse IPv6 questions - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_PTR_IPv6(IPAddress p_IPAddress, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_IPv6%s\n"), (p_rSendParameter.m_bCacheFlush ? "" : " nF"));); - - clsRRDomain reverseIPv6Domain; - clsRRAttributes attributes(DNS_RRTYPE_PTR, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - bool bResult = ((p_IPAddress.isV6()) && - (_buildDomainForReverseIPv6(p_IPAddress, reverseIPv6Domain)) && // xxxx::xx.ip6.arpa - (_writeMDNSRRDomain(reverseIPv6Domain, p_rSendParameter)) && - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), p_rSendParameter)) && // TTL - (_writeMDNSHostDomain(m_pcHostName, true, 0, p_rSendParameter))); // RDLength & RData (host domain, eg. esp8266.local) - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_IPv6 "), _DH()); - _printRRDomain(reverseIPv6Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:0x%04X TTL:%u %s.local\n"), - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), - m_pcHostName); - ); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_PTR_IPv6: FAILED!\n"), _DH());); - return bResult; -} -#endif - -/* - MDNSResponder::_writeMDNSAnswer_SRV - - eg. MyESP._http.tcp.local SRV 0x8001 120 0 0 60068 esp8266.local - http://www.zytrax.com/books/dns/ch8/srv.html ???? Include instance name ???? - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_SRV(clsLEAMDNSHost::clsService& p_rService, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_SRV%s\n"), (p_rSendParameter.m_bCacheFlush ? "" : " nF"));); - - uint16_t u16CachedDomainOffset = (p_rSendParameter.m_bLegacyDNSQuery - ? 0 - : p_rSendParameter.findCachedDomainOffset((const void*)m_pcHostName, false)); - - clsRRAttributes attributes(DNS_RRTYPE_SRV, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - clsRRDomain hostDomain; - bool bResult = ((_writeMDNSServiceDomain(p_rService, true, false, 0, p_rSendParameter)) && // MyESP._http._tcp.local - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL/*Consts::u32ServiceTTL*/)), p_rSendParameter)) && // TTL - (!u16CachedDomainOffset - // No cache for domain name (or no compression allowed) - ? ((_buildDomainForHost(m_pcHostName, hostDomain)) && - (_write16((sizeof(uint16_t /*Prio*/) + // RDLength - sizeof(uint16_t /*Weight*/) + - sizeof(uint16_t /*Port*/) + - hostDomain.m_u16NameLength), p_rSendParameter)) && // Domain length - (_write16(clsConsts::u16SRVPriority, p_rSendParameter)) && // Priority - (_write16(clsConsts::u16SRVWeight, p_rSendParameter)) && // Weight - (_write16(p_rService.m_u16Port, p_rSendParameter)) && // Port - (p_rSendParameter.addDomainCacheItem((const void*)m_pcHostName, false, p_rSendParameter.m_u16Offset)) && - (_writeMDNSRRDomain(hostDomain, p_rSendParameter))) // Host, eg. esp8266.local - // Cache available for domain - : ((clsConsts::u8DomainCompressMark > ((u16CachedDomainOffset >> 8) & ~clsConsts::u8DomainCompressMark)) && // Valid offset - (_write16((sizeof(uint16_t /*Prio*/) + // RDLength - sizeof(uint16_t /*Weight*/) + - sizeof(uint16_t /*Port*/) + - 2), p_rSendParameter)) && // Length of 'C0xx' - (_write16(clsConsts::u16SRVPriority, p_rSendParameter)) && // Priority - (_write16(clsConsts::u16SRVWeight, p_rSendParameter)) && // Weight - (_write16(p_rService.m_u16Port, p_rSendParameter)) && // Port - (_write8(((u16CachedDomainOffset >> 8) | clsConsts::u8DomainCompressMark), p_rSendParameter)) && // Compression mark (and offset) - (_write8((uint8_t)u16CachedDomainOffset, p_rSendParameter))))); // Offset - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_SRV %s._%s._%s.local Type:%s Class:0x%04X TTL:%u %u %u %u %s.local\n"), - _DH(), - p_rService.m_pcInstanceName, - p_rService.m_pcType, - p_rService.m_pcProtocol, - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), - clsConsts::u16SRVPriority, - clsConsts::u16SRVWeight, - p_rService.m_u16Port, - m_pcHostName); - ); - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_SRV: FAILED!\n"), _DH());); - return bResult; -} - -/* - MDNSResponder::_createNSECBitmap - -*/ -clsLEAMDNSHost::clsNSECBitmap* clsLEAMDNSHost::_createNSECBitmap(uint32_t p_u32NSECContent) -{ - // Currently 6 bytes (6*8 -> 0..47) are long enough, and only this is implemented - clsNSECBitmap* pNSECBitmap = new clsNSECBitmap; - if (pNSECBitmap) - { -#ifdef MDNS_IPV4_SUPPORT - if (p_u32NSECContent & static_cast(enuContentFlag::A)) - { - pNSECBitmap->setBit(DNS_RRTYPE_A); // 01/0x01 - } -#endif - if ((p_u32NSECContent & static_cast(enuContentFlag::PTR_IPv4)) || - (p_u32NSECContent & static_cast(enuContentFlag::PTR_IPv6))) - { - pNSECBitmap->setBit(DNS_RRTYPE_PTR); // 12/0x0C - } -#ifdef MDNS2_IPV6_SUPPORT - if (p_u32NSECContent & static_cast(enuContentFlag::AAAA)) - { - pNSECBitmap->setBit(DNS_RRTYPE_AAAA); // 28/0x1C - } -#endif - if (p_u32NSECContent & static_cast(enuContentFlag::TXT)) - { - pNSECBitmap->setBit(DNS_RRTYPE_TXT); // 16/0x10 - } - if (p_u32NSECContent & static_cast(enuContentFlag::SRV)) - { - pNSECBitmap->setBit(DNS_RRTYPE_SRV); // 33/0x21 - } - if (p_u32NSECContent & static_cast(enuContentFlag::NSEC)) - { - pNSECBitmap->setBit(clsConsts::u8DNS_RRTYPE_NSEC); // 47/0x2F - } - } - return pNSECBitmap; -} - -/* - MDNSResponder::_writeMDNSNSECBitmap - -*/ -bool clsLEAMDNSHost::_writeMDNSNSECBitmap(const clsLEAMDNSHost::clsNSECBitmap& p_NSECBitmap, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - /* DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("_writeMDNSNSECBitmap: ")); - for (uint16_t u=0; ulength()), p_rSendParameter)) && // XX esp8266.local - (_writeMDNSNSECBitmap(*pNSECBitmap, p_rSendParameter))); // NSEC bitmap - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC %s.local Type:%s Class:0x%04X TTL:%u %s %s\n"), - _DH(), - m_pcHostName, - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), - m_pcHostName, - _NSECBitmap2String(pNSECBitmap)); - ); - - if (pNSECBitmap) - { - delete pNSECBitmap; - pNSECBitmap = 0; - } - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC (host): FAILED!\n"), _DH());); - return bResult; -} - - -#ifdef MDNS_IPV4_SUPPORT -/* - MDNSResponder::_writeMDNSAnswer_NSEC_PTR_IPv4(host) - - eg. 012.789.456.123.in-addr.arpa NSEC 0x8001 120 XX 012.789.456.123.in-addr.arpa xyz - http://www.zytrax.com/books/dns/ch8/nsec.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_NSEC_PTR_IPv4(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC_PTR_IPv4\n"));); - - clsRRAttributes attributes(clsConsts::u8DNS_RRTYPE_NSEC, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - clsNSECBitmap* pNSECBitmap = _createNSECBitmap(static_cast(enuContentFlag::PTR_IPv4)); - clsRRDomain reverseIPv4Domain; - bool bResult = ((p_IPAddress.isV4()) && - (pNSECBitmap) && // NSEC bitmap created - (_buildDomainForReverseIPv4(p_IPAddress, reverseIPv4Domain)) && // 012.789.456.123.in-addr.arpa - (_writeMDNSRRDomain(reverseIPv4Domain, p_rSendParameter)) && // 012.789.456.123.in-addr.arpa - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), p_rSendParameter)) && // TTL - (_write16((reverseIPv4Domain.m_u16NameLength + (2 + pNSECBitmap->length())), p_rSendParameter)) && - (_writeMDNSRRDomain(reverseIPv4Domain, p_rSendParameter)) && // 012.789.456.123.in-addr.arpa - (_writeMDNSNSECBitmap(*pNSECBitmap, p_rSendParameter))); // NSEC bitmap - - DEBUG_EX_INFO(if (bResult) -{ - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC_PTR_IPv4 "), _DH()); - _printRRDomain(reverseIPv4Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:0x%04X TTL:%u "), - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL))); - _printRRDomain(reverseIPv4Domain); - DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), _NSECBitmap2String(pNSECBitmap)); - }); - - if (pNSECBitmap) - { - delete pNSECBitmap; - pNSECBitmap = 0; - } - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC_PTR_IPv4 (host): FAILED!\n"), _DH());); - return bResult; -} -#endif - - -#ifdef MDNS2_IPV6_SUPPORT -/* - MDNSResponder::_writeMDNSAnswer_NSEC_PTR_IPv6(host) - - eg. 9.0.0.0.0.0.0.0.0.0.0.0.0.7.8.5.6.3.4.1.2.ip6.arpa NSEC 0x8001 120 XX 9.0.0.0.0.0.0.0.0.0.0.0.0.7.8.5.6.3.4.1.2.ip6.arpa xyz - http://www.zytrax.com/books/dns/ch8/nsec.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_NSEC_PTR_IPv6(IPAddress p_IPAddress, - clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC_PTR_IPv6\n"));); - - clsRRAttributes attributes(clsConsts::u8DNS_RRTYPE_NSEC, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - clsNSECBitmap* pNSECBitmap = _createNSECBitmap(static_cast(enuContentFlag::PTR_IPv6)); - clsRRDomain reverseIPv6Domain; - bool bResult = ((p_IPAddress.isV6()) && - (pNSECBitmap) && // NSEC bitmap created - (_buildDomainForReverseIPv6(p_IPAddress, reverseIPv6Domain)) && // 9.0.0.0.0.0.0.0.0.0.0.0.0.7.8.5.6.3.4.1.2.ip6.arpa - (_writeMDNSRRDomain(reverseIPv6Domain, p_rSendParameter)) && // 9.0.0.0.0.0.0.0.0.0.0.0.0.7.8.5.6.3.4.1.2.ip6.arpa - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32HostTTL)), p_rSendParameter)) && // TTL - (_write16((reverseIPv6Domain.m_u16NameLength + (2 + pNSECBitmap->length())), p_rSendParameter)) && - (_writeMDNSRRDomain(reverseIPv6Domain, p_rSendParameter)) && // 9.0.0.0.0.0.0.0.0.0.0.0.0.7.8.5.6.3.4.1.2.ip6.arpa - (_writeMDNSNSECBitmap(*pNSECBitmap, p_rSendParameter))); // NSEC bitmap - - DEBUG_EX_INFO(if (bResult) -{ - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC_PTR_IPv6 "), _DH()); - _printRRDomain(reverseIPv6Domain); - DEBUG_OUTPUT.printf_P(PSTR(" Type:%s Class:0x%04X TTL:%u "), - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL))); - _printRRDomain(reverseIPv6Domain); - DEBUG_OUTPUT.printf_P(PSTR(" %s\n"), _NSECBitmap2String(pNSECBitmap)); - }); - - if (pNSECBitmap) - { - delete pNSECBitmap; - pNSECBitmap = 0; - } - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC_PTR_IPv6 (host): FAILED!\n"), _DH());); - return bResult; -} -#endif - -/* - MDNSResponder::_writeMDNSAnswer_NSEC(service) - - eg. MyESP._http.tcp.local NSEC 0x8001 4500 XX MyESP._http.tcp.local xyz - http://www.zytrax.com/books/dns/ch8/nsec.html - -*/ -bool clsLEAMDNSHost::_writeMDNSAnswer_NSEC(clsLEAMDNSHost::clsService& p_rService, - uint32_t p_u32NSECContent, - clsLEAMDNSHost::clsSendParameter& p_rSendParameter) -{ - //DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC (service: %s)\n"), _DH(), _replyFlags2String(p_u32NSECContent));); - - clsRRAttributes attributes(clsConsts::u8DNS_RRTYPE_NSEC, - ((p_rSendParameter.m_bCacheFlush ? 0x8000 : 0) | DNS_RRCLASS_IN)); // Cache flush? & INternet - clsNSECBitmap* pNSECBitmap = _createNSECBitmap(p_u32NSECContent); - bool bResult = ((pNSECBitmap) && // NSEC bitmap created - (_writeMDNSServiceDomain(p_rService, true, false, 0, p_rSendParameter)) && // MyESP._http._tcp.local - (_writeMDNSRRAttributes(attributes, p_rSendParameter)) && // TYPE & CLASS - (_write32((p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL)), p_rSendParameter)) && // TTL - (_writeMDNSServiceDomain(p_rService, true, true, (2 + pNSECBitmap->length()), p_rSendParameter)) && // XX MyESP._http._tcp.local - (_writeMDNSNSECBitmap(*pNSECBitmap, p_rSendParameter))); // NSEC bitmap - - DEBUG_EX_INFO(if (bResult) - DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC %s._%s._%s.local Type:%s Class:0x%04X TTL:%u %s\n"), - _DH(), - p_rService.m_pcInstanceName, - p_rService.m_pcType, - p_rService.m_pcProtocol, - _RRType2Name(attributes.m_u16Type), - attributes.m_u16Class, - (p_rSendParameter.m_bUnannounce - ? 0 - : (p_rSendParameter.m_bLegacyDNSQuery ? clsConsts::u32LegacyTTL : clsConsts::u32ServiceTTL)), - _NSECBitmap2String(pNSECBitmap)); - ); - - if (pNSECBitmap) - { - delete pNSECBitmap; - pNSECBitmap = 0; - } - - DEBUG_EX_ERR(if (!bResult) DEBUG_OUTPUT.printf_P(PSTR("%s _writeMDNSAnswer_NSEC (service): FAILED!\n"), _DH());); - return bResult; -} - - -} // namespace MDNSImplementation - - -} // namespace esp8266 - - - - - - diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2_Backbone.cpp b/libraries/ESP8266mDNS/src/LEAmDNS2_Backbone.cpp deleted file mode 100644 index 87f263eff..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2_Backbone.cpp +++ /dev/null @@ -1,262 +0,0 @@ -/* - LEAmDNS2_Backbone.cpp - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#include "ESP8266mDNS.h" -#include "LEAmDNS2Host.h" -#include "LEAmDNS2_Priv.h" - -namespace esp8266 -{ - - -namespace experimental -{ - - -/* - clsLEAmDNS2_Host::clsBackbone::clsBackbone constructor - -*/ -clsLEAMDNSHost::clsBackbone::clsBackbone(void) - : m_pUDPContext(0), - m_bDelayUDPProcessing(false), - m_u32DelayedDatagrams(0), - m_uniqueHost(0) -{ -} - -/* - clsLEAmDNS2_Host::clsBackbone::clsBackbone destructor - -*/ -clsLEAMDNSHost::clsBackbone::~clsBackbone(void) -{ - _releaseUDPContext(); -} - -/* - clsLEAmDNS2_Host::clsBackbone::init - -*/ -bool clsLEAMDNSHost::clsBackbone::init(void) -{ - return _allocUDPContext(); -} - -/* - clsLEAmDNS2_Host::clsBackbone::addHost - -*/ -UdpContext* clsLEAMDNSHost::clsBackbone::addHost(clsLEAMDNSHost* p_pHost) -{ - UdpContext* pUDPContext = nullptr; - - if ((m_pUDPContext) && (p_pHost) && (m_uniqueHost == nullptr)) - { - m_uniqueHost = p_pHost; - pUDPContext = m_pUDPContext; - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s addHost: %s to add host!\n"), _DH(), (pUDPContext ? "Succeeded" : "FAILED"));); - return pUDPContext; -} - -/* - clsLEAmDNS2_Host::clsBackbone::removeHost - -*/ -bool clsLEAMDNSHost::clsBackbone::removeHost(clsLEAMDNSHost* p_pHost) -{ - bool bResult = false; - - if ((p_pHost) && (m_uniqueHost == p_pHost)) - { - m_uniqueHost = nullptr; - bResult = true; - } - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s removeHost: %s to remove host!\n"), _DH(), (bResult ? "Succeeded" : "FAILED"));); - return bResult; -} - - -/* - clsLEAmDNS2_Host::clsBackbone::hostCount - -*/ -size_t clsLEAMDNSHost::clsBackbone::hostCount(void) const -{ - return m_uniqueHost == nullptr ? 0 : 1; -} - -/* - clsLEAMDNSHost::clsBackbone::::setDelayUDPProcessing - - When executing _sendMessage, with multiple or larger messages, sometimes the ESP IP stack seems - to need a small delay to get the job done. To allow for this delay, a 'delay' was added after one - send operation. However, while 'taking' this delay, sometimes a UDP datagram is received and - processed (which might cause another send operation or change global states). - To avoid 're-entry-like' problems, UDP processing might be blocked for a short period of time. - -*/ -bool clsLEAMDNSHost::clsBackbone::setDelayUDPProcessing(bool p_bDelayUDPProcessing) -{ - if (m_bDelayUDPProcessing != p_bDelayUDPProcessing) - { - m_bDelayUDPProcessing = p_bDelayUDPProcessing; - - if ((!m_bDelayUDPProcessing) && - (m_u32DelayedDatagrams)) - { - DEBUG_EX_INFO2(if (6 <= m_u32DelayedDatagrams) DEBUG_OUTPUT.printf_P(PSTR("%s setDelayUDPProcessing: Processing %u delayed datagram(s)\n"), _DH(), m_u32DelayedDatagrams);); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s setDelayUDPProcessing: Processing %u delayed datagram(s)\n"), _DH(), m_u32DelayedDatagrams);); - _processUDPInput(); - } - m_u32DelayedDatagrams = 0; - } - return true; -} - -/* - clsLEAmDNS2_Host::clsBackbone::_allocUDPContext - -*/ -bool clsLEAMDNSHost::clsBackbone::_allocUDPContext(void) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _allocUDPContext\n"), _DH());); - if (_releaseUDPContext()) - { - m_pUDPContext = new UdpContext; - if (m_pUDPContext) - { - m_pUDPContext->ref(); - - //ip_set_option(m_pUDPContext->pcb(), SOF_REUSEADDR); - //udp_bind_netif(m_pUDPContext->pcb(), m_pNetIf); - - if (m_pUDPContext->listen(IP_ANY_TYPE, DNS_MQUERY_PORT)) - { - // This is NOT the TTL (Time-To-Live) for MDNS records, but the subnet level distance MDNS records should travel. - // 1 sets the subnet distance to 'local', which is default for MDNS. - // (Btw.: 255 would set it to 'as far as possible' -> internet), however, RFC 3171 seems to force 255 instead - const uint8_t c_u8MulticastTTL = 255;//1;//255; - - m_pUDPContext->setMulticastTTL(c_u8MulticastTTL); - m_pUDPContext->onRx(std::bind(&clsLEAMDNSHost::clsBackbone::_processUDPInput, this)); - /* m_pUDPContext->onRx([&](void)->void - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _allocUDPContext::onRx Received data!\n"), _DH());); - });*/ - m_pUDPContext->connect(IP_ANY_TYPE, DNS_MQUERY_PORT); - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _allocUDPContext: Succeeded to alloc UDPContext!\n"), _DH());); - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _allocUDPContext: FAILED to make UDPContext listening!\n"), _DH());); - _releaseUDPContext(); - } - } - else - { - DEBUG_EX_ERR(DEBUG_OUTPUT.printf_P(PSTR("%s _allocUDPContext: FAILED to alloc UDPContext!\n"), _DH());); - } - } - DEBUG_EX_ERR(if (!m_pUDPContext) DEBUG_OUTPUT.printf_P(PSTR("%s _allocUDPContext: FAILED!\n"), _DH());); - return (0 != m_pUDPContext); -} - -/* - clsLEAmDNS2_Host::clsBackbone::_releaseUDPContext - -*/ -bool clsLEAMDNSHost::clsBackbone::_releaseUDPContext(void) -{ - if (m_pUDPContext) - { - m_pUDPContext->unref(); - m_pUDPContext = nullptr; - } - return true; -} - -/* - clsLEAmDNS2_Host::clsBackbone::_processUDPInput - - Called in SYS context! - -*/ -bool clsLEAMDNSHost::clsBackbone::_processUDPInput(void) -{ - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processUDPInput\n"), _DH());); - - bool bResult = true; - - if (!m_bDelayUDPProcessing) - { - while ((m_pUDPContext) && - (m_pUDPContext->next())) - { - clsLEAMDNSHost* pHost = _findHost(); - - bResult = pHost->_processUDPInput(); - - DEBUG_EX_INFO2_IF(!bResult, - DEBUG_OUTPUT.printf_P(PSTR("%s _processUDPInput: FAILED to process UDP input!\n"), _DH())); - DEBUG_EX_ERR_IF((-1) != m_pUDPContext->peek(), - DEBUG_OUTPUT.printf_P(PSTR("%s _processUDPInput: !!!! CONTENT LEFT IN UDP BUFFER !!!!\n"), - _DH())); - m_pUDPContext->flush(); - } - } - else - { - DEBUG_EX_INFO(DEBUG_OUTPUT.printf_P(PSTR("%s _processUDPInput: Delaying datagram!\n"), _DH());); - ++m_u32DelayedDatagrams; - } - return bResult; -} - -/* - MISC -*/ - -#if not defined ESP_8266_MDNS_INCLUDE || defined DEBUG_ESP_PORT - -/* - clsLEAmDNS2_Host::clsBackbone::_DH -*/ -const char* clsLEAMDNSHost::clsBackbone::_DH(void) const -{ - static char acBuffer[20] = { 0, }; - if (!acBuffer[0]) - { - strcpy_P(acBuffer, PSTR("[mDNS::backbone]")); - } - return acBuffer; -} - -#endif - -} // namespace MDNSImplementation - - -} // namespace esp8266 diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS2_Priv.h deleted file mode 100644 index 312a03d04..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2_Priv.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - LEAmDNS_Priv.h - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#ifndef MDNS2_PRIV_H -#define MDNS2_PRIV_H - -/* - LWIP_OPEN_SRC -*/ -#ifndef LWIP_OPEN_SRC -#define LWIP_OPEN_SRC -#endif - -/* - Enable class debug functions -*/ -#define ESP_8266_MDNS_INCLUDE -//#define DEBUG_ESP_MDNS_RESPONDER // force debug, arduino IDE uses DEBUG_ESP_MDNS - -/* - Enable/disable debug trace macros -*/ - -#if defined(DEBUG_ESP_PORT) -#define DEBUG_ESP_MDNS_ERR -#endif - -#if defined(DEBUG_ESP_PORT) && (defined(DEBUG_ESP_MDNS) || defined(DEBUG_ESP_MDNS_RESPONDER)) -#define DEBUG_ESP_MDNS_INFO -#define DEBUG_ESP_MDNS_INFO2 -//#define DEBUG_ESP_MDNS_TX -//#define DEBUG_ESP_MDNS_RX -#endif - -#ifdef DEBUG_ESP_PORT -#define DEBUG_OUTPUT DEBUG_ESP_PORT -#else -#define DEBUG_OUTPUT Serialx -#endif - -#ifdef DEBUG_ESP_MDNS_INFO -#define DEBUG_EX_INFO(A) A -#define DEBUG_EX_INFO_IF(C,A...) do if (C) { A; } while (0) -#else -#define DEBUG_EX_INFO(A) -#define DEBUG_EX_INFO_IF(C,A...) -#endif - -#ifdef DEBUG_ESP_MDNS_INFO2 -#define DEBUG_EX_INFO2(A) A -#define DEBUG_EX_INFO2_IF(C,A...) do if (C) { A; } while (0) -#else -#define DEBUG_EX_INFO2(A) -#define DEBUG_EX_INFO2_IF(C,A...) -#endif - -#ifdef DEBUG_ESP_MDNS_ERR -#define DEBUG_EX_ERR(A) A -#define DEBUG_EX_ERR_IF(C,A...) do if (C) { A; } while (0) -#else -#define DEBUG_EX_ERR(A) -#define DEBUG_EX_ERR_IF(C,A...) -#endif - -#ifdef DEBUG_ESP_MDNS_TX -#define DEBUG_EX_TX(A) do { A; } while (0) -#else -#define DEBUG_EX_TX(A) -#endif - -#ifdef DEBUG_ESP_MDNS_RX -#define DEBUG_EX_RX(A) do { A; } while (0) -#else -#define DEBUG_EX_RX(A) -#endif - -/* - Enable/disable the usage of the F() macro in debug trace printf calls. - There needs to be an PGM comptible printf function to use this. - - USE_PGM_PRINTF and F -*/ -#define USE_PGM_PRINTF - -#ifdef USE_PGM_PRINTF -#else -#ifdef F -#undef F -#endif -#define F(A) A -#endif - - -#endif // MDNS2_PRIV_H diff --git a/libraries/ESP8266mDNS/src/LEAmDNS2_lwIPdefs.h b/libraries/ESP8266mDNS/src/LEAmDNS2_lwIPdefs.h deleted file mode 100644 index a24cf62ba..000000000 --- a/libraries/ESP8266mDNS/src/LEAmDNS2_lwIPdefs.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - LEAmDNS2_lwIPdefs.h - - License (MIT license): - 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 the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. - -*/ - -#ifndef LEAMDNS2_LWIPDEFS_H -#define LEAMDNS2_LWIPDEFS_H - -#include -#include // DNS_RRTYPE_xxx, DNS_MQUERY_PORT - -#endif // LEAMDNS2_LWIPDEFS_H diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp index bc8cb3a69..677456fcc 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Control.cpp @@ -97,8 +97,8 @@ bool MDNSResponder::_process(bool p_bUserContext) bool MDNSResponder::_restart(void) { - return ((_resetProbeStatus(true)) && // Stop and restart probing - (_allocUDPContext())); // Restart UDP + return ((_resetProbeStatus(true/*restart*/)) && // Stop and restart probing + (_allocUDPContext())); // Restart UDP } /** diff --git a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h index 4750669d3..a7d8a8f99 100644 --- a/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h +++ b/libraries/ESP8266mDNS/src/LEAmDNS_Priv.h @@ -94,13 +94,12 @@ namespace MDNSImplementation #define DEBUG_EX_RX(A) do { (void)0; } while (0) #endif - -/* Replaced by 'lwip/prot/dns.h' definitions +/* already defined in lwIP ('lwip/prot/dns.h') #ifdef MDNS_IP4_SUPPORT - #define MDNS_MULTICAST_ADDR_IP4 (IPAddress(224, 0, 0, 251)) // ip_addr_t v4group = DNS_MQUERY_IPV4_GROUP_INIT + #define DNS_MQUERY_IPV4_GROUP_INIT (IPAddress(224, 0, 0, 251)) // ip_addr_t v4group = DNS_MQUERY_IPV4_GROUP_INIT #endif #ifdef MDNS_IP6_SUPPORT - #define MDNS_MULTICAST_ADDR_IP6 (IPAddress("FF02::FB")) // ip_addr_t v6group = DNS_MQUERY_IPV6_GROUP_INIT + #define DNS_MQUERY_IPV6_GROUP_INIT IPADDR6_INIT_HOST(0xFF020000,0,0,0xFB) // ip_addr_t v6group = DNS_MQUERY_IPV6_GROUP_INIT #endif*/ //#define MDNS_MULTICAST_PORT 5353 diff --git a/libraries/LittleFS/lib/littlefs b/libraries/LittleFS/lib/littlefs index a049f1318..1a59954ec 160000 --- a/libraries/LittleFS/lib/littlefs +++ b/libraries/LittleFS/lib/littlefs @@ -1 +1 @@ -Subproject commit a049f1318eecbe502549f9d74a41951985fb956f +Subproject commit 1a59954ec64ca168828a15242cc6de94ac75f9d1 diff --git a/libraries/LittleFS/src/LittleFS.cpp b/libraries/LittleFS/src/LittleFS.cpp index 7fd4351fc..16f4df55e 100644 --- a/libraries/LittleFS/src/LittleFS.cpp +++ b/libraries/LittleFS/src/LittleFS.cpp @@ -70,14 +70,14 @@ FileImplPtr LittleFSImpl::open(const char* path, OpenMode openMode, AccessMode a } time_t creation = 0; - if (timeCallback && (openMode & OM_CREATE)) { + if (_timeCallback && (openMode & OM_CREATE)) { // O_CREATE means we *may* make the file, but not if it already exists. // See if it exists, and only if not update the creation time int rc = lfs_file_open(&_lfs, fd.get(), path, LFS_O_RDONLY); if (rc == 0) { lfs_file_close(&_lfs, fd.get()); // It exists, don't update create time } else { - creation = timeCallback(); // File didn't exist or otherwise, so we're going to create this time + creation = _timeCallback(); // File didn't exist or otherwise, so we're going to create this time } } diff --git a/libraries/LittleFS/src/LittleFS.h b/libraries/LittleFS/src/LittleFS.h index f78680f66..0a483c9b1 100644 --- a/libraries/LittleFS/src/LittleFS.h +++ b/libraries/LittleFS/src/LittleFS.h @@ -424,7 +424,7 @@ public: lfs_file_close(_fs->getFS(), _getFD()); _opened = false; DEBUGV("lfs_file_close: fd=%p\n", _getFD()); - if (timeCallback && (_flags & LFS_O_WRONLY)) { + if (_timeCallback && (_flags & LFS_O_WRONLY)) { // If the file opened with O_CREAT, write the creation time attribute if (_creation) { int rc = lfs_setattr(_fs->getFS(), _name.get(), 'c', (const void *)&_creation, sizeof(_creation)); @@ -433,7 +433,7 @@ public: } } // Add metadata with last write time - time_t now = timeCallback(); + time_t now = _timeCallback(); int rc = lfs_setattr(_fs->getFS(), _name.get(), 't', (const void *)&now, sizeof(now)); if (rc < 0) { DEBUGV("Unable to set last write time on '%s' to %d\n", _name.get(), now); @@ -556,11 +556,35 @@ public: } time_t fileTime() override { - return (time_t)_getAttr4('t'); + time_t t; + int32_t t32b; + + // If the attribute is 8-bytes, we're all set + if (_getAttr('t', 8, &t)) { + return t; + } else if (_getAttr('t', 4, &t32b)) { + // If it's 4 bytes silently promote to 64b + return (time_t)t32b; + } else { + // OTW, none present + return 0; + } } time_t fileCreationTime() override { - return (time_t)_getAttr4('c'); + time_t t; + int32_t t32b; + + // If the attribute is 8-bytes, we're all set + if (_getAttr('c', 8, &t)) { + return t; + } else if (_getAttr('c', 4, &t32b)) { + // If it's 4 bytes silently promote to 64b + return (time_t)t32b; + } else { + // OTW, none present + return 0; + } } @@ -599,20 +623,17 @@ protected: return _dir.get(); } - uint32_t _getAttr4(char attr) { - if (!_valid) { - return 0; + bool _getAttr(char attr, int len, void *dest) { + if (!_valid || !len || !dest) { + return false; } int nameLen = 3; // Slashes, terminator nameLen += _dirPath.get() ? strlen(_dirPath.get()) : 0; nameLen += strlen(_dirent.name); char tmpName[nameLen]; snprintf(tmpName, nameLen, "%s%s%s", _dirPath.get() ? _dirPath.get() : "", _dirPath.get()&&_dirPath.get()[0]?"/":"", _dirent.name); - time_t ftime = 0; - int rc = lfs_getattr(_fs->getFS(), tmpName, attr, (void *)&ftime, sizeof(ftime)); - if (rc != sizeof(ftime)) - ftime = 0; // Error, so clear read value - return ftime; + int rc = lfs_getattr(_fs->getFS(), tmpName, attr, dest, len); + return (rc == len); } String _pattern; diff --git a/libraries/Netdump/src/Netdump.cpp b/libraries/Netdump/src/Netdump.cpp index a608a1c3b..326f2eaa7 100644 --- a/libraries/Netdump/src/Netdump.cpp +++ b/libraries/Netdump/src/Netdump.cpp @@ -84,12 +84,17 @@ void Netdump::fileDump(File& outfile, const Filter nf) fileDumpProcess(outfile, ndp); }, nf); } -void Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf) +bool Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf) { if (!packetBuffer) { packetBuffer = new (std::nothrow) char[tcpBufferSize]; + + if (!packetBuffer) + { + return false; + } } bufferIndex = 0; @@ -97,6 +102,7 @@ void Netdump::tcpDump(WiFiServer &tcpDumpServer, const Filter nf) { tcpDumpLoop(tcpDumpServer, nf); }); + return true; } void Netdump::capture(int netif_idx, const char* data, size_t len, int out, int success) @@ -176,7 +182,7 @@ void Netdump::tcpDumpProcess(const Packet& np) bufferIndex += incl_len; } - if (bufferIndex && tcpDumpClient && tcpDumpClient.availableForWrite() >= bufferIndex) + if (bufferIndex && tcpDumpClient && tcpDumpClient.availableForWrite() >= (int)bufferIndex) { tcpDumpClient.write(packetBuffer, bufferIndex); bufferIndex = 0; @@ -202,7 +208,7 @@ void Netdump::tcpDumpLoop(WiFiServer &tcpDumpServer, const Filter nf) { setCallback(nullptr); } - if (bufferIndex && tcpDumpClient && tcpDumpClient.availableForWrite() >= bufferIndex) + if (bufferIndex && tcpDumpClient && tcpDumpClient.availableForWrite() >= (int)bufferIndex) { tcpDumpClient.write(packetBuffer, bufferIndex); bufferIndex = 0; diff --git a/libraries/Netdump/src/Netdump.h b/libraries/Netdump/src/Netdump.h index 1011a8e95..8ef453288 100644 --- a/libraries/Netdump/src/Netdump.h +++ b/libraries/Netdump/src/Netdump.h @@ -53,7 +53,7 @@ public: void printDump(Print& out, Packet::PacketDetail ndd, const Filter nf = nullptr); void fileDump(File& outfile, const Filter nf = nullptr); - void tcpDump(WiFiServer &tcpDumpServer, const Filter nf = nullptr); + bool tcpDump(WiFiServer &tcpDumpServer, const Filter nf = nullptr); private: diff --git a/libraries/SD/src/SD.h b/libraries/SD/src/SD.h index d15d8f85b..fee20da54 100644 --- a/libraries/SD/src/SD.h +++ b/libraries/SD/src/SD.h @@ -32,7 +32,7 @@ class SDClass { public: - boolean begin(uint8_t csPin, SPISettings cfg = SPI_HALF_SPEED) { + boolean begin(uint8_t csPin, uint32_t cfg = SPI_HALF_SPEED) { SDFS.setConfig(SDFSConfig(csPin, cfg)); return (boolean)SDFS.begin(); } @@ -68,6 +68,14 @@ public: return (boolean)SDFS.exists(filepath.c_str()); } + boolean rename(const char* filepathfrom, const char* filepathto) { + return (boolean)SDFS.rename(filepathfrom, filepathto); + } + + boolean rename(const String &filepathfrom, const String &filepathto) { + return (boolean)rename(filepathfrom.c_str(), filepathto.c_str()); + } + boolean mkdir(const char *filepath) { return (boolean)SDFS.mkdir(filepath); } diff --git a/libraries/SDFS/src/SDFS.cpp b/libraries/SDFS/src/SDFS.cpp index d862ff5d8..e7a891a08 100644 --- a/libraries/SDFS/src/SDFS.cpp +++ b/libraries/SDFS/src/SDFS.cpp @@ -25,7 +25,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ #include "SDFS.h" -#include "SDFSFormatter.h" #include using namespace fs; @@ -37,6 +36,8 @@ FS SDFS = FS(FSImplPtr(new sdfs::SDFSImpl())); namespace sdfs { +// Required to be global because SDFAT doesn't allow a this pointer in it's own time call +time_t (*__sdfs_timeCallback)(void) = nullptr; FileImplPtr SDFSImpl::open(const char* path, OpenMode openMode, AccessMode accessMode) { @@ -63,13 +64,13 @@ FileImplPtr SDFSImpl::open(const char* path, OpenMode openMode, AccessMode acces } free(pathStr); } - sdfat::File fd = _fs.open(path, flags); + sdfat::File32 fd = _fs.open(path, flags); if (!fd) { DEBUGV("SDFSImpl::openFile: fd=%p path=`%s` openMode=%d accessMode=%d", &fd, path, openMode, accessMode); return FileImplPtr(); } - auto sharedFd = std::make_shared(fd); + auto sharedFd = std::make_shared(fd); return std::make_shared(this, sharedFd, path); } @@ -89,7 +90,7 @@ DirImplPtr SDFSImpl::openDir(const char* path) } // At this point we have a name of "/blah/blah/blah" or "blah" or "" // If that references a directory, just open it and we're done. - sdfat::File dirFile; + sdfat::File32 dirFile; const char *filter = ""; if (!pathStr[0]) { // openDir("") === openDir("/") @@ -134,7 +135,7 @@ DirImplPtr SDFSImpl::openDir(const char* path) DEBUGV("SDFSImpl::openDir: path=`%s`\n", path); return DirImplPtr(); } - auto sharedDir = std::make_shared(dirFile); + auto sharedDir = std::make_shared(dirFile); auto ret = std::make_shared(filter, this, sharedDir, pathStr); free(pathStr); return ret; @@ -144,8 +145,15 @@ bool SDFSImpl::format() { if (_mounted) { return false; } - SDFSFormatter formatter; - bool ret = formatter.format(&_fs, _cfg._csPin, _cfg._spiSettings); + sdfat::SdCardFactory cardFactory; + sdfat::SdCard* card = cardFactory.newCard(sdfat::SdSpiConfig(_cfg._csPin, DEDICATED_SPI, _cfg._spiSettings)); + if (!card || card->errorCode()) { + return false; + } + sdfat::FatFormatter fatFormatter; + uint8_t *sectorBuffer = new uint8_t[512]; + bool ret = fatFormatter.format(card, sectorBuffer, nullptr); + delete[] sectorBuffer; return ret; } diff --git a/libraries/SDFS/src/SDFS.h b/libraries/SDFS/src/SDFS.h index a884552ff..0051852a2 100644 --- a/libraries/SDFS/src/SDFS.h +++ b/libraries/SDFS/src/SDFS.h @@ -47,7 +47,7 @@ class SDFSConfig : public FSConfig public: static constexpr uint32_t FSId = 0x53444653; - SDFSConfig(uint8_t csPin = 4, SPISettings spi = SD_SCK_MHZ(10)) : FSConfig(FSId, false), _csPin(csPin), _part(0), _spiSettings(spi) { } + SDFSConfig(uint8_t csPin = 4, uint32_t spi = SD_SCK_MHZ(10)) : FSConfig(FSId, false), _csPin(csPin), _part(0), _spiSettings(spi) { } SDFSConfig setAutoFormat(bool val = true) { _autoFormat = val; @@ -57,7 +57,7 @@ public: _csPin = pin; return *this; } - SDFSConfig setSPI(SPISettings spi) { + SDFSConfig setSPI(uint32_t spi) { _spiSettings = spi; return *this; } @@ -67,9 +67,9 @@ public: } // Inherit _type and _autoFormat - uint8_t _csPin; - uint8_t _part; - SPISettings _spiSettings; + uint8_t _csPin; + uint8_t _part; + uint32_t _spiSettings; }; class SDFSImpl : public FSImpl @@ -97,11 +97,11 @@ public: return false; } info.maxOpenFiles = 999; // TODO - not valid - info.blockSize = _fs.vol()->blocksPerCluster() * 512; + info.blockSize = _fs.vol()->sectorsPerCluster() * _fs.vol()->bytesPerSector(); info.pageSize = 0; // TODO ? info.maxPathLength = 255; // TODO ? - info.totalBytes =_fs.vol()->volumeBlockCount() * 512LL; - info.usedBytes = info.totalBytes - (_fs.vol()->freeClusterCount() * _fs.vol()->blocksPerCluster() * 512LL); + info.totalBytes =_fs.vol()->clusterCount() * info.blockSize; + info.usedBytes = info.totalBytes - (_fs.vol()->freeClusterCount() * _fs.vol()->sectorsPerCluster() * _fs.vol()->bytesPerSector()); return true; } @@ -156,7 +156,7 @@ public: format(); _mounted = _fs.begin(_cfg._csPin, _cfg._spiSettings); } - sdfat::SdFile::dateTimeCallback(dateTimeCB); + sdfat::FsDateTime::setCallback(dateTimeCB); return _mounted; } @@ -176,7 +176,7 @@ public: return _fs.vol()->fatType(); } size_t blocksPerCluster() { - return _fs.vol()->blocksPerCluster(); + return _fs.vol()->sectorsPerCluster(); } size_t totalClusters() { return _fs.vol()->clusterCount(); @@ -185,7 +185,7 @@ public: return (totalClusters() / blocksPerCluster()); } size_t clusterSize() { - return blocksPerCluster() * 512; // 512b block size + return blocksPerCluster() * _fs.vol()->bytesPerSector(); } size_t size() { return (clusterSize() * totalClusters()); @@ -205,12 +205,21 @@ public: return mktime(&tiempo); } + virtual void setTimeCallback(time_t (*cb)(void)) override { + extern time_t (*__sdfs_timeCallback)(void); + __sdfs_timeCallback = cb; + } + // Because SdFat has a single, global setting for this we can only use a - // static member of our class to return the time/date. However, since - // this is static, we can't see the time callback variable. Punt for now, - // using time(NULL) as the best we can do. + // static member of our class to return the time/date. static void dateTimeCB(uint16_t *dosYear, uint16_t *dosTime) { - time_t now = time(nullptr); + time_t now; + extern time_t (*__sdfs_timeCallback)(void); + if (__sdfs_timeCallback) { + now = __sdfs_timeCallback(); + } else { + now = time(nullptr); + } struct tm *tiempo = localtime(&now); *dosYear = ((tiempo->tm_year - 80) << 9) | ((tiempo->tm_mon + 1) << 5) | tiempo->tm_mday; *dosTime = (tiempo->tm_hour << 11) | (tiempo->tm_min << 5) | tiempo->tm_sec; @@ -255,7 +264,7 @@ protected: class SDFSFileImpl : public FileImpl { public: - SDFSFileImpl(SDFSImpl *fs, std::shared_ptr fd, const char *name) + SDFSFileImpl(SDFSImpl *fs, std::shared_ptr fd, const char *name) : _fs(fs), _fd(fd), _opened(true) { _name = std::shared_ptr(new char[strlen(name) + 1], std::default_delete()); @@ -268,6 +277,11 @@ public: close(); } + int availableForWrite() override + { + return _opened ? _fd->availableSpaceForWrite() : 0; + } + size_t write(const uint8_t *buf, size_t size) override { return _opened ? _fd->write(buf, size) : -1; @@ -281,7 +295,6 @@ public: void flush() override { if (_opened) { - _fd->flush(); _fd->sync(); } } @@ -361,15 +374,15 @@ public: bool isDirectory() const override { - return _opened ? _fd->isDirectory() : false; + return _opened ? _fd->isDir() : false; } time_t getLastWrite() override { time_t ftime = 0; if (_opened && _fd) { - sdfat::dir_t tmp; + sdfat::DirFat_t tmp; if (_fd.get()->dirEntry(&tmp)) { - ftime = SDFSImpl::FatToTimeT(tmp.lastWriteDate, tmp.lastWriteTime); + ftime = SDFSImpl::FatToTimeT(*(uint16_t*)tmp.modifyDate, *(uint16_t*)tmp.modifyTime); } } return ftime; @@ -378,19 +391,17 @@ public: time_t getCreationTime() override { time_t ftime = 0; if (_opened && _fd) { - sdfat::dir_t tmp; + sdfat::DirFat_t tmp; if (_fd.get()->dirEntry(&tmp)) { - ftime = SDFSImpl::FatToTimeT(tmp.creationDate, tmp.creationTime); + ftime = SDFSImpl::FatToTimeT(*(uint16_t*)tmp.createDate, *(uint16_t*)tmp.createTime); } } return ftime; } - - protected: SDFSImpl* _fs; - std::shared_ptr _fd; + std::shared_ptr _fd; std::shared_ptr _name; bool _opened; }; @@ -398,7 +409,7 @@ protected: class SDFSDirImpl : public DirImpl { public: - SDFSDirImpl(const String& pattern, SDFSImpl* fs, std::shared_ptr dir, const char *dirPath = nullptr) + SDFSDirImpl(const String& pattern, SDFSImpl* fs, std::shared_ptr dir, const char *dirPath = nullptr) : _pattern(pattern), _fs(fs), _dir(dir), _valid(false), _dirPath(nullptr) { if (dirPath) { @@ -473,17 +484,17 @@ public: { const int n = _pattern.length(); do { - sdfat::File file; + sdfat::File32 file; file.openNext(_dir.get(), sdfat::O_READ); if (file) { _valid = 1; _size = file.fileSize(); _isFile = file.isFile(); - _isDirectory = file.isDirectory(); - sdfat::dir_t tmp; + _isDirectory = file.isDir(); + sdfat::DirFat_t tmp; if (file.dirEntry(&tmp)) { - _time = SDFSImpl::FatToTimeT(tmp.lastWriteDate, tmp.lastWriteTime); - _creation = SDFSImpl::FatToTimeT(tmp.creationDate, tmp.creationTime); + _time = SDFSImpl::FatToTimeT(*(uint16_t*)tmp.modifyDate, *(uint16_t*)tmp.modifyTime); + _creation = SDFSImpl::FatToTimeT(*(uint16_t*)tmp.createDate, *(uint16_t*)tmp.createTime); } else { _time = 0; _creation = 0; @@ -507,7 +518,7 @@ public: protected: String _pattern; SDFSImpl* _fs; - std::shared_ptr _dir; + std::shared_ptr _dir; bool _valid; char _lfn[64]; time_t _time; diff --git a/libraries/SDFS/src/SDFSFormatter.h b/libraries/SDFS/src/SDFSFormatter.h deleted file mode 100644 index d1fe6c94a..000000000 --- a/libraries/SDFS/src/SDFSFormatter.h +++ /dev/null @@ -1,405 +0,0 @@ -/* - SDFSFormatter.cpp - Formatter for SdFat SD cards - Copyright (c) 2019 Earle F. Philhower, III. All rights reserved. - - A C++ implementation of the SdFat/examples/SdFormatter sketch: - | Copyright (c) 2011-2018 Bill Greiman - - 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 - */ - -#ifndef _SDFSFORMATTER_H -#define _SDFSFORMATTER_H - -#include "SDFS.h" -#include -#include - -namespace sdfs { - -class SDFSFormatter { -private: - // Taken from main FS object - sdfat::Sd2Card *card; - sdfat::cache_t *cache; - - uint32_t cardSizeBlocks; - uint32_t cardCapacityMB; - - - // MBR information - uint8_t partType; - uint32_t relSector; - uint32_t partSize; - - // Fake disk geometry - uint8_t numberOfHeads; - uint8_t sectorsPerTrack; - - // FAT parameters - uint16_t reservedSectors; - uint8_t sectorsPerCluster; - uint32_t fatStart; - uint32_t fatSize; - uint32_t dataStart; - - uint8_t writeCache(uint32_t lbn) { - return card->writeBlock(lbn, cache->data); - } - - void clearCache(uint8_t addSig) { - memset(cache, 0, sizeof(*cache)); - if (addSig) { - cache->mbr.mbrSig0 = sdfat::BOOTSIG0; - cache->mbr.mbrSig1 = sdfat::BOOTSIG1; - } - } - - bool clearFatDir(uint32_t bgn, uint32_t count) { - clearCache(false); - if (!card->writeStart(bgn, count)) { - DEBUGV("SDFS: Clear FAT/DIR writeStart failed"); - return false; - } - esp8266::polledTimeout::periodicFastMs timeToYield(5); // Yield every 5ms of runtime - for (uint32_t i = 0; i < count; i++) { - if (timeToYield) { - delay(0); // WDT feed - } - if (!card->writeData(cache->data)) { - DEBUGV("SDFS: Clear FAT/DIR writeData failed"); - return false; - } - } - if (!card->writeStop()) { - DEBUGV("SDFS: Clear FAT/DIR writeStop failed"); - return false; - } - return true; - } - - uint16_t lbnToCylinder(uint32_t lbn) { - return lbn / (numberOfHeads * sectorsPerTrack); - } - - uint8_t lbnToHead(uint32_t lbn) { - return (lbn % (numberOfHeads * sectorsPerTrack)) / sectorsPerTrack; - } - - uint8_t lbnToSector(uint32_t lbn) { - return (lbn % sectorsPerTrack) + 1; - } - - bool writeMbr() { - clearCache(true); - sdfat::part_t* p = cache->mbr.part; - p->boot = 0; - uint16_t c = lbnToCylinder(relSector); - if (c > 1023) { - DEBUGV("SDFS: MBR CHS"); - return false; - } - p->beginCylinderHigh = c >> 8; - p->beginCylinderLow = c & 0XFF; - p->beginHead = lbnToHead(relSector); - p->beginSector = lbnToSector(relSector); - p->type = partType; - uint32_t endLbn = relSector + partSize - 1; - c = lbnToCylinder(endLbn); - if (c <= 1023) { - p->endCylinderHigh = c >> 8; - p->endCylinderLow = c & 0XFF; - p->endHead = lbnToHead(endLbn); - p->endSector = lbnToSector(endLbn); - } else { - // Too big flag, c = 1023, h = 254, s = 63 - p->endCylinderHigh = 3; - p->endCylinderLow = 255; - p->endHead = 254; - p->endSector = 63; - } - p->firstSector = relSector; - p->totalSectors = partSize; - if (!writeCache(0)) { - DEBUGV("SDFS: write MBR"); - return false; - } - return true; - } - - uint32_t volSerialNumber() { - return (cardSizeBlocks << 8) + micros(); - } - - bool makeFat16() { - uint16_t const BU16 = 128; - uint32_t nc; - for (dataStart = 2 * BU16;; dataStart += BU16) { - nc = (cardSizeBlocks - dataStart)/sectorsPerCluster; - fatSize = (nc + 2 + 255)/256; - uint32_t r = BU16 + 1 + 2 * fatSize + 32; - if (dataStart < r) { - continue; - } - relSector = dataStart - r + BU16; - break; - } - // check valid cluster count for FAT16 volume - if (nc < 4085 || nc >= 65525) { - DEBUGV("SDFS: Bad cluster count"); - } - reservedSectors = 1; - fatStart = relSector + reservedSectors; - partSize = nc * sectorsPerCluster + 2 * fatSize + reservedSectors + 32; - if (partSize < 32680) { - partType = 0X01; - } else if (partSize < 65536) { - partType = 0X04; - } else { - partType = 0X06; - } - // write MBR - if (!writeMbr()) { - DEBUGV("SDFS: writembr failed"); - return false; - } - - clearCache(true); - sdfat::fat_boot_t* pb = &cache->fbs; - pb->jump[0] = 0XEB; - pb->jump[1] = 0X00; - pb->jump[2] = 0X90; - for (uint8_t i = 0; i < sizeof(pb->oemId); i++) { - pb->oemId[i] = ' '; - } - pb->bytesPerSector = 512; - pb->sectorsPerCluster = sectorsPerCluster; - pb->reservedSectorCount = reservedSectors; - pb->fatCount = 2; - pb->rootDirEntryCount = 512; - pb->mediaType = 0XF8; - pb->sectorsPerFat16 = fatSize; - pb->sectorsPerTrack = sectorsPerTrack; - pb->headCount = numberOfHeads; - pb->hidddenSectors = relSector; - pb->totalSectors32 = partSize; - pb->driveNumber = 0X80; - pb->bootSignature = sdfat::EXTENDED_BOOT_SIG; - pb->volumeSerialNumber = volSerialNumber(); - memcpy_P(pb->volumeLabel, PSTR("NO NAME "), sizeof(pb->volumeLabel)); - memcpy_P(pb->fileSystemType, PSTR("FAT16 "), sizeof(pb->fileSystemType)); - // write partition boot sector - if (!writeCache(relSector)) { - DEBUGV("SDFS: FAT16 write PBS failed"); - return false; - } - // clear FAT and root directory - if (!clearFatDir(fatStart, dataStart - fatStart)) { - DEBUGV("SDFS: FAT16 clear root failed\n"); - return false; - } - clearCache(false); - cache->fat16[0] = 0XFFF8; - cache->fat16[1] = 0XFFFF; - // write first block of FAT and backup for reserved clusters - if (!writeCache(fatStart) || !writeCache(fatStart + fatSize)) { - DEBUGV("FAT16 reserve failed"); - return false; - } - return true; - } - - bool makeFat32() { - uint16_t const BU32 = 8192; - uint32_t nc; - relSector = BU32; - for (dataStart = 2 * BU32;; dataStart += BU32) { - nc = (cardSizeBlocks - dataStart)/sectorsPerCluster; - fatSize = (nc + 2 + 127)/128; - uint32_t r = relSector + 9 + 2 * fatSize; - if (dataStart >= r) { - break; - } - } - // error if too few clusters in FAT32 volume - if (nc < 65525) { - DEBUGV("SDFS: Bad cluster count"); - return false; - } - reservedSectors = dataStart - relSector - 2 * fatSize; - fatStart = relSector + reservedSectors; - partSize = nc * sectorsPerCluster + dataStart - relSector; - // type depends on address of end sector - // max CHS has lbn = 16450560 = 1024*255*63 - if ((relSector + partSize) <= 16450560) { - // FAT32 - partType = 0X0B; - } else { - // FAT32 with INT 13 - partType = 0X0C; - } - if (!writeMbr()) { - DEBUGV("SDFS: writembr failed"); - return false; - } - - clearCache(true); - - sdfat::fat32_boot_t* pb = &cache->fbs32; - pb->jump[0] = 0XEB; - pb->jump[1] = 0X00; - pb->jump[2] = 0X90; - for (uint8_t i = 0; i < sizeof(pb->oemId); i++) { - pb->oemId[i] = ' '; - } - pb->bytesPerSector = 512; - pb->sectorsPerCluster = sectorsPerCluster; - pb->reservedSectorCount = reservedSectors; - pb->fatCount = 2; - pb->mediaType = 0XF8; - pb->sectorsPerTrack = sectorsPerTrack; - pb->headCount = numberOfHeads; - pb->hidddenSectors = relSector; - pb->totalSectors32 = partSize; - pb->sectorsPerFat32 = fatSize; - pb->fat32RootCluster = 2; - pb->fat32FSInfo = 1; - pb->fat32BackBootBlock = 6; - pb->driveNumber = 0X80; - pb->bootSignature = sdfat::EXTENDED_BOOT_SIG; - pb->volumeSerialNumber = volSerialNumber(); - memcpy_P(pb->volumeLabel, PSTR("NO NAME "), sizeof(pb->volumeLabel)); - memcpy_P(pb->fileSystemType, PSTR("FAT32 "), sizeof(pb->fileSystemType)); - // write partition boot sector and backup - if (!writeCache(relSector) || !writeCache(relSector + 6)) { - DEBUGV("SDFS: FAT32 write PBS failed"); - return false; - } - clearCache(true); - // write extra boot area and backup - if (!writeCache(relSector + 2) || !writeCache(relSector + 8)) { - DEBUGV("SDFS: FAT32 PBS ext failed"); - return false; - } - sdfat::fat32_fsinfo_t* pf = &cache->fsinfo; - pf->leadSignature = sdfat::FSINFO_LEAD_SIG; - pf->structSignature = sdfat::FSINFO_STRUCT_SIG; - pf->freeCount = 0XFFFFFFFF; - pf->nextFree = 0XFFFFFFFF; - // write FSINFO sector and backup - if (!writeCache(relSector + 1) || !writeCache(relSector + 7)) { - DEBUGV("SDFS: FAT32 FSINFO failed"); - return false; - } - clearFatDir(fatStart, 2 * fatSize + sectorsPerCluster); - clearCache(false); - cache->fat32[0] = 0x0FFFFFF8; - cache->fat32[1] = 0x0FFFFFFF; - cache->fat32[2] = 0x0FFFFFFF; - // write first block of FAT and backup for reserved clusters - if (!writeCache(fatStart) || !writeCache(fatStart + fatSize)) { - DEBUGV("SDFS: FAT32 reserve failed"); - return false; - } - return true; - } - -public: - bool format(sdfat::SdFat *_fs, int8_t _csPin, SPISettings _spiSettings) { - card = static_cast(_fs->card()); - cache = _fs->cacheClear(); - - if (!card->begin(_csPin, _spiSettings)) { - return false; - } - cardSizeBlocks = card->cardSize(); - if (cardSizeBlocks == 0) { - return false; - } - - cardCapacityMB = (cardSizeBlocks + 2047)/2048; - - if (cardCapacityMB <= 6) { - return false; // Card is too small - } else if (cardCapacityMB <= 16) { - sectorsPerCluster = 2; - } else if (cardCapacityMB <= 32) { - sectorsPerCluster = 4; - } else if (cardCapacityMB <= 64) { - sectorsPerCluster = 8; - } else if (cardCapacityMB <= 128) { - sectorsPerCluster = 16; - } else if (cardCapacityMB <= 1024) { - sectorsPerCluster = 32; - } else if (cardCapacityMB <= 32768) { - sectorsPerCluster = 64; - } else { - // SDXC cards - sectorsPerCluster = 128; - } - - // set fake disk geometry - sectorsPerTrack = cardCapacityMB <= 256 ? 32 : 63; - - if (cardCapacityMB <= 16) { - numberOfHeads = 2; - } else if (cardCapacityMB <= 32) { - numberOfHeads = 4; - } else if (cardCapacityMB <= 128) { - numberOfHeads = 8; - } else if (cardCapacityMB <= 504) { - numberOfHeads = 16; - } else if (cardCapacityMB <= 1008) { - numberOfHeads = 32; - } else if (cardCapacityMB <= 2016) { - numberOfHeads = 64; - } else if (cardCapacityMB <= 4032) { - numberOfHeads = 128; - } else { - numberOfHeads = 255; - } - - // Erase all data on card (TRIM) - uint32_t const ERASE_SIZE = 262144L; - uint32_t firstBlock = 0; - uint32_t lastBlock; - do { - lastBlock = firstBlock + ERASE_SIZE - 1; - if (lastBlock >= cardSizeBlocks) { - lastBlock = cardSizeBlocks - 1; - } - if (!card->erase(firstBlock, lastBlock)) { - return false; // Erase fail - } - delay(0); // yield to the OS to avoid WDT - firstBlock += ERASE_SIZE; - } while (firstBlock < cardSizeBlocks); - - if (!card->readBlock(0, cache->data)) { - return false; - } - - if (card->type() != sdfat::SD_CARD_TYPE_SDHC) { - return makeFat16(); - } else { - return makeFat32(); - } - } -}; // class SDFSFormatter - -}; // namespace sdfs - - -#endif // _SDFSFORMATTER_H diff --git a/libraries/Servo/src/Servo.cpp b/libraries/Servo/src/Servo.cpp index 3dc2c7753..d24ea3379 100644 --- a/libraries/Servo/src/Servo.cpp +++ b/libraries/Servo/src/Servo.cpp @@ -27,15 +27,15 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA uint32_t Servo::_servoMap = 0; // similiar to map but will have increased accuracy that provides a more -// symetric api (call it and use result to reverse will provide the original value) +// symmetrical api (call it and use result to reverse will provide the original value) int improved_map(int value, int minIn, int maxIn, int minOut, int maxOut) { const int rangeIn = maxIn - minIn; const int rangeOut = maxOut - minOut; const int deltaIn = value - minIn; // fixed point math constants to improve accurancy of divide and rounding - const int fixedHalfDecimal = 1; - const int fixedDecimal = fixedHalfDecimal * 2; + constexpr int fixedHalfDecimal = 1; + constexpr int fixedDecimal = fixedHalfDecimal * 2; return ((deltaIn * rangeOut * fixedDecimal) / (rangeIn) + fixedHalfDecimal) / fixedDecimal + minOut; } @@ -46,9 +46,9 @@ int improved_map(int value, int minIn, int maxIn, int minOut, int maxOut) Servo::Servo() { _attached = false; - _valueUs = DEFAULT_PULSE_WIDTH; - _minUs = MIN_PULSE_WIDTH; - _maxUs = MAX_PULSE_WIDTH; + _valueUs = DEFAULT_NEUTRAL_PULSE_WIDTH; + _minUs = DEFAULT_MIN_PULSE_WIDTH; + _maxUs = DEFAULT_MAX_PULSE_WIDTH; } Servo::~Servo() { @@ -58,14 +58,24 @@ Servo::~Servo() { uint8_t Servo::attach(int pin) { - return attach(pin, MIN_PULSE_WIDTH, MAX_PULSE_WIDTH); + return attach(pin, DEFAULT_MIN_PULSE_WIDTH, DEFAULT_MAX_PULSE_WIDTH); } uint8_t Servo::attach(int pin, uint16_t minUs, uint16_t maxUs) +{ + return attach(pin, minUs, maxUs, _valueUs); +} + +uint8_t Servo::attach(int pin, uint16_t minUs, uint16_t maxUs, int value) { if (!_attached) { +#ifdef WAVEFORM_LOCKED_PHASE + pinMode(pin, OUTPUT); + digitalWrite(pin, LOW); +#else digitalWrite(pin, LOW); pinMode(pin, OUTPUT); +#endif _pin = pin; _attached = true; } @@ -76,7 +86,7 @@ uint8_t Servo::attach(int pin, uint16_t minUs, uint16_t maxUs) _maxUs = max((uint16_t)250, min((uint16_t)3000, maxUs)); _minUs = max((uint16_t)200, min(_maxUs, minUs)); - write(_valueUs); + write(value); return pin; } @@ -85,20 +95,24 @@ void Servo::detach() { if (_attached) { _servoMap &= ~(1 << _pin); +#ifdef WAVEFORM_LOCKED_PHASE + startWaveform(_pin, 0, REFRESH_INTERVAL, 1); +#else + // TODO - timeHigh == 0 is illegal in _PWM code branch. Do nothing for now. +#endif + delay(REFRESH_INTERVAL / 1000); // long enough to complete active period under all circumstances. stopWaveform(_pin); _attached = false; - digitalWrite(_pin, LOW); + _valueUs = DEFAULT_NEUTRAL_PULSE_WIDTH; } } void Servo::write(int value) { - // treat values less than 544 as angles in degrees (valid values in microseconds are handled as microseconds) - if (value < _minUs) { + // treat any value less than 200 as angle in degrees (values equal or larger are handled as microseconds) + if (value < 200) { // assumed to be 0-180 degrees servo value = constrain(value, 0, 180); - // writeMicroseconds will contrain the calculated value for us - // for any user defined min and max, but we must use default min max value = improved_map(value, 0, 180, _minUs, _maxUs); } writeMicroseconds(value); @@ -106,10 +120,18 @@ void Servo::write(int value) void Servo::writeMicroseconds(int value) { + value = constrain(value, _minUs, _maxUs); _valueUs = value; if (_attached) { _servoMap &= ~(1 << _pin); - if (startWaveform(_pin, _valueUs, REFRESH_INTERVAL - _valueUs, 0)) { +#ifdef WAVEFORM_LOCKED_PHASE + // Find the first GPIO being generated by checking GCC's find-first-set (returns 1 + the bit of the first 1 in an int32_t) + int phaseReference = __builtin_ffs(_servoMap) - 1; + if (startWaveform(_pin, _valueUs, REFRESH_INTERVAL - _valueUs, 0, phaseReference)) +#else + if (startWaveform(_pin, _valueUs, REFRESH_INTERVAL - _valueUs, 0)) +#endif + { _servoMap |= (1 << _pin); } } @@ -117,8 +139,7 @@ void Servo::writeMicroseconds(int value) int Servo::read() // return the value as degrees { - // read returns the angle for an assumed 0-180, so we calculate using - // the normal min/max constants and not user defined ones + // read returns the angle for an assumed 0-180 return improved_map(readMicroseconds(), _minUs, _maxUs, 0, 180); } diff --git a/libraries/Servo/src/Servo.h b/libraries/Servo/src/Servo.h index 45f593c0d..38d78709a 100644 --- a/libraries/Servo/src/Servo.h +++ b/libraries/Servo/src/Servo.h @@ -27,9 +27,9 @@ // // Servo - Class for manipulating servo motors connected to Arduino pins. // -// attach(pin ) - Attaches a servo motor to an i/o pin. -// attach(pin, min, max ) - Attaches to a pin setting min and max values in microseconds -// default min is 544, max is 2400 +// attach(pin) - Attaches a servo motor to an i/o pin. +// attach(pin, min, max) - Attaches to a pin setting min and max values in microseconds +// default min is 1000, max is 2000 // // write() - Sets the servo angle in degrees. (invalid angle that is valid as pulse in microseconds is treated as microseconds) // writeMicroseconds() - Sets the servo pulse width in microseconds @@ -44,13 +44,17 @@ #include -// the following are in us (microseconds) -// -#define MIN_PULSE_WIDTH 544 // the shortest pulse sent to a servo -#define MAX_PULSE_WIDTH 2400 // the longest pulse sent to a servo -#define DEFAULT_PULSE_WIDTH 1500 // default pulse width when servo is attached -#define REFRESH_INTERVAL 20000 // minumim time to refresh servos in microseconds -#define MAX_SERVOS 12 +// The following values are in us (microseconds). +// Since the defaults can be overwritten in the new attach() member function, +// they were modified from the Arduino AVR defaults to be in the safe range +// of publically available specifications. While this implies that many 180° +// servos do not operate the full 0° to 180° sweep using these, it also prevents +// unsuspecting damage. For Arduino AVR, the same change is being discussed. +#define DEFAULT_MIN_PULSE_WIDTH 1000 // uncalibrated default, the shortest duty cycle sent to a servo +#define DEFAULT_MAX_PULSE_WIDTH 2000 // uncalibrated default, the longest duty cycle sent to a servo +#define DEFAULT_NEUTRAL_PULSE_WIDTH 1500 // default duty cycle when servo is attached +#define REFRESH_INTERVAL 20000 // classic default period to refresh servos in microseconds +#define MAX_SERVOS 9 // D0-D8 #if !defined(ESP8266) @@ -63,8 +67,16 @@ class Servo public: Servo(); ~Servo(); - uint8_t attach(int pin); // attach the given pin to the next free channel, sets pinMode, returns channel number or 0 if failure - uint8_t attach(int pin, uint16_t min, uint16_t max); // as above but also sets min and max values for writes. + // attach the given pin to the next free channel, sets pinMode, returns channel number or 0 if failure. + // returns channel number or 0 if failure. + uint8_t attach(int pin); + // attach the given pin to the next free channel, sets pinMode, min, and max values for write(). + // returns channel number or 0 if failure. + uint8_t attach(int pin, uint16_t min, uint16_t max); + // attach the given pin to the next free channel, sets pinMode, min, and max values for write(), + // and sets the initial value, the same as write(). + // returns channel number or 0 if failure. + uint8_t attach(int pin, uint16_t min, uint16_t max, int value); void detach(); void write(int value); // if value is < 200 its treated as an angle, otherwise as pulse width in microseconds void writeMicroseconds(int value); // Write pulse width in microseconds diff --git a/libraries/SoftwareSerial b/libraries/SoftwareSerial index 4c08ee8d2..adec3fe4f 160000 --- a/libraries/SoftwareSerial +++ b/libraries/SoftwareSerial @@ -1 +1 @@ -Subproject commit 4c08ee8d2cb7b5b27eb4f86797694cbac94aa5c9 +Subproject commit adec3fe4f16ef3a61463c0b4eaeafebcb5487a45 diff --git a/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino new file mode 100644 index 000000000..57a9e6beb --- /dev/null +++ b/libraries/esp8266/examples/FadePolledTimeout/FadePolledTimeout.ino @@ -0,0 +1,73 @@ +/* + ESP8266 LED fade with polledTimeout and locked phase PWM + + Modified from an BlinkPolledTimeout.ino, + Copyright (c) 2018 Daniel Salazar. 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 + + + Note that this sketch uses LED_BUILTIN to find the pin with the internal LED +*/ + +#include +#include + +esp8266::polledTimeout::periodicFastUs stepPeriod(50000); + +// the setup function runs only once at start +void setup() { + Serial.begin(115200); + Serial.println(); + + // This next line will call will cause the code to use the Phase-Locked waveform generator + // instead of the default one. Comment it out to try the default version. + // For more information on choosing between the two options, see the following pull requests: + // Phase-Locked generator: https://github.com/esp8266/Arduino/pull/7022 + // PWM-Locked generator: https://github.com/esp8266/Arduino/pull/7231 + enablePhaseLockedWaveform(); + + pinMode(LED_BUILTIN, OUTPUT); // Initialize the LED_BUILTIN pin as an output + analogWriteRange(1000); + + using esp8266::polledTimeout::oneShotMs; //import the type to the local namespace + + digitalWrite(LED_BUILTIN, LOW); // Turn the LED on (Note that LOW is the voltage level + + oneShotMs timeoutOn(2000); + while (!timeoutOn) { + yield(); + } + + stepPeriod.reset(); +} + + +void loop() { + static int val = 0; + static int delta = 100; + if (stepPeriod) { + val += delta; + if (val < 0) { + val = 100; + delta = 100; + } else if (val > 1000) { + val = 900; + delta = -100; + } + analogWrite(LED_BUILTIN, val); + } +} diff --git a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino index e56fc0d24..3119042ca 100644 --- a/libraries/esp8266/examples/HeapMetric/HeapMetric.ino +++ b/libraries/esp8266/examples/HeapMetric/HeapMetric.ino @@ -4,6 +4,7 @@ #include #include +#include void stats(const char* what) { // we could use getFreeHeap() getMaxFreeBlockSize() and getHeapFragmentation() @@ -109,6 +110,7 @@ void setup() { Serial.begin(115200); WiFi.mode(WIFI_OFF); + Serial.printf("\r\nDemo Heap Metrics for DRAM\r\n"); tryit(8000); tryit(4000); tryit(2000); @@ -118,6 +120,21 @@ void setup() { tryit(100); tryit(50); tryit(15); +#ifdef UMM_HEAP_IRAM + { + HeapSelectIram ephemeral; + Serial.printf("\r\nDemo Heap Metrics for IRAM\r\n"); + tryit(8000); + tryit(4000); + tryit(2000); + tryit(1000); + tryit(500); + tryit(200); + tryit(100); + tryit(50); + tryit(15); + } +#endif } void loop() { diff --git a/libraries/esp8266/examples/IramReserve/IramReserve.ino b/libraries/esp8266/examples/IramReserve/IramReserve.ino new file mode 100644 index 000000000..344622f95 --- /dev/null +++ b/libraries/esp8266/examples/IramReserve/IramReserve.ino @@ -0,0 +1,124 @@ +/* + Overview: Of the 48KB of IRAM, the remaining IRAM after your code is untouched + during the reboot process. For a sketch that does not use deep-sleep, it is + possible to pass/hold information across boot cycles in this area of IRAM. + + With the selection of Arduino IDE Tools Option: 'MMU: 16KB cache + 48KB IRAM + and 2nd Heap (shared)' all of this space goes into a managed 2nd Heap. + Managed, in this case, refers to using malloc, free, realloc, etc. API. + + The objective of this example is to show how to modify the 2nd Heap creation + to omit a block of IRAM at the end of the 2nd Heap. In this example, we use + this block to store a boot count. +*/ + +#include +#include +#include +#if defined(UMM_HEAP_IRAM) + +// durable - as in long life, persisting across reboots. +struct durable { + uint32_t bootCounter; + uint32_t chksum; +}; + + +// Leave a durable block of IRAM after the 2nd heap. + +// The block should be in 8-byte increments and fall on an 8-byte alignment. +#define IRAM_RESERVE_SZ ((sizeof(struct durable) + 7UL) & ~7UL) + +// Position its address just above the reduced 2nd Heap. +#define IRAM_RESERVE (0x40100000UL + 0xC000UL - IRAM_RESERVE_SZ) + +// Define a reference with the right properties to make access easier. +#define DURABLE ((struct durable *)IRAM_RESERVE) +#define INCREMENT_BOOTCOUNT() (DURABLE->bootCounter)++ + +extern struct rst_info resetInfo; + +/* + Define a function to determine if IRAM stored data is valid. The criteria used + here can vary with how exhaustively you want the process to be. + + In this example, we are just going to look at the reset cause and assume all + is well in certain situations. For this example, we include + REASON_EXT_SYS_RST as a possible case for IRAM not being valid. The problem + here is some devices will indicate REASON_EXT_SYS_RST for the Power-on case. + + If you wanted to be able to isolate the power-on case from a + REASON_EXT_SYS_RST, you could add additional logic to set and verify a CRC or + XOR sum on the IRAM data (or just a section of the IRAM data). +*/ +inline bool is_iram_valid(void) { + return (REASON_WDT_RST <= resetInfo.reason && + REASON_SOFT_RESTART >= resetInfo.reason); +} + + +void setup() { + WiFi.persistent(false); + WiFi.mode(WIFI_OFF); + Serial.begin(115200); + delay(10); + Serial.printf_P(PSTR("\r\nSetup ...\r\n")); + + if (!is_iram_valid()) { + DURABLE->bootCounter = 0; + } + + DURABLE->bootCounter++; + + Serial.printf("Number of reboots at %u\r\n", DURABLE->bootCounter); + Serial.printf("\r\nSome less than direct, ways to restart:\r\n"); + processKey(Serial, '?'); + +} + +void loop(void) { + if (Serial.available() > 0) { + int hotKey = Serial.read(); + processKey(Serial, hotKey); + } +} + +////////////////////////////////////////////////////////////////////////////// + +/* + Create a block of unmanaged IRAM for special uses. + + This is done by reducing the size of the managed 2nd Heap (Shared) at + initialization time. +*/ + +extern "C" void _text_end(void); + +extern "C" void umm_init_iram(void) { + /* + Calculate the start of 2nd heap, staying clear of possible segment alignment + adjustments and checksums. These can affect the persistence of data across + reboots. + */ + uint32_t sec_heap = (uint32_t)_text_end + 32; + sec_heap &= ~7; + size_t sec_heap_sz = 0xC000UL - (sec_heap - 0x40100000UL); + sec_heap_sz -= IRAM_RESERVE_SZ; // Shrink IRAM heap + if (0xC000UL > sec_heap_sz) { + + umm_init_iram_ex((void *)sec_heap, sec_heap_sz, true); + } +} + +#else +void setup() { + WiFi.persistent(false); + WiFi.mode(WIFI_OFF); + Serial.begin(115200); + delay(10); + Serial.println("\r\n\r\nThis sketch requires Tools Option: 'MMU: 16KB cache + 48KB IRAM and 2nd Heap (shared)'"); +} + +void loop(void) { +} +#endif diff --git a/libraries/esp8266/examples/IramReserve/ProcessKey.ino b/libraries/esp8266/examples/IramReserve/ProcessKey.ino new file mode 100644 index 000000000..9c12ac7c1 --- /dev/null +++ b/libraries/esp8266/examples/IramReserve/ProcessKey.ino @@ -0,0 +1,116 @@ +#include +void crashMeIfYouCan(void)__attribute__((weak)); +int divideA_B(int a, int b); + +int* nullPointer = NULL; + +void processKey(Print& out, int hotKey) { + switch (hotKey) { + case 'r': + out.printf_P(PSTR("Reset, ESP.reset(); ...\r\n")); + ESP.reset(); + break; + case 't': + out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n")); + ESP.restart(); + break; + case 's': { + uint32_t startTime = millis(); + out.printf_P(PSTR("Now crashing with Software WDT. This will take about 3 seconds.\r\n")); + ets_install_putc1(ets_putc); + while (true) { + ets_printf("%9lu\r", (millis() - startTime)); + ets_delay_us(250000); + // stay in an loop blocking other system activity. + } + } + break; + case 'h': + out.printf_P(PSTR("Now crashing with Hardware WDT. This will take about 6 seconds.\r\n")); + asm volatile("mov.n a2, %0\n\t" + "mov.n a3, %1\n\t" + "mov.n a4, %2\n\t" + "mov.n a5, %3\n\t" + "mov.n a6, %4\n\t" + : : "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa), "r"(0xaaaaaaaa) : "memory"); + // Could not find these in the stack dump, unless interrupts were enabled. + { + uint32_t startTime = millis(); + // Avoid all the Core functions that play nice, so we can hog + // the system and crash. + ets_install_putc1(ets_putc); + xt_rsil(15); + while (true) { + ets_printf("%9lu\r", (millis() - startTime)); + ets_delay_us(250000); + // stay in an loop blocking other system activity. + // + // Note: + // Hardware WDT kicks in if Software WDT is unable to perform. + // With the Hardware WDT, nothing is saved on the stack, that I have seen. + } + } + break; + case 'p': + out.println(F("Time to panic()!")); + panic(); + break; + case 'z': + out.println(F("Crashing by dividing by zero. This should generate an exception(0).")); + out.printf_P(PSTR("This should not print %d\n"), divideA_B(1, 0)); + break; + case 'w': + out.println(F("Now calling: void crashMeIfYouCan(void)__attribute__((weak));")); + out.println(F("This function has a prototype but was missing when the sketch was linked. ...")); + crashMeIfYouCan(); + break; + case 'b': + out.println(F("Executing a break instruction w/o GDB will cause a HWDT reset.")); + asm volatile("break 1, 15;"); + out.println(F("This line will not be printable w/o running GDB")); + break; + case '0': + out.println(F("Crashing at an embeded 'break 1, 15' instruction that was generated")); + out.println(F("by the compiler after detecting a divide by zero.")); + out.printf_P(PSTR("This should not print %d\n"), divideA_B_bp(1, 0)); + break; + case '\r': + out.println(); + case '\n': + break; + case '?': + out.println(); + out.println(F("Press a key + ")); + out.println(F(" r - Reset, ESP.reset();")); + out.println(F(" t - Restart, ESP.restart();")); + out.println(F(" ? - Print Help")); + out.println(); + out.println(F("Crash with:")); + out.println(F(" s - Software WDT")); + out.println(F(" h - Hardware WDT - looping with interrupts disabled")); + out.println(F(" w - Hardware WDT - calling a missing (weak) function.")); + out.println(F(" 0 - Hardware WDT - a hard coded compiler breakpoint from a compile time detected divide by zero")); + out.println(F(" b - Hardware WDT - a forgotten hard coded 'break 1, 15;' and no GDB running.")); + out.println(F(" z - Divide by zero, exception(0);")); + out.println(F(" p - panic();")); + out.println(); + break; + default: + out.printf_P(PSTR("\"%c\" - Not an option? / ? - help"), hotKey); + out.println(); + processKey(out, '?'); + break; + } +} + +// With the current toolchain 10.1, using this to divide by zero will *not* be +// caught at compile time. +int __attribute__((noinline)) divideA_B(int a, int b) { + return (a / b); +} + +// With the current toolchain 10.1, using this to divide by zero *will* be +// caught at compile time. And a hard coded breakpoint will be inserted. +int divideA_B_bp(int a, int b) { + return (a / b); +} diff --git a/libraries/esp8266/examples/MMU48K/MMU48K.ino b/libraries/esp8266/examples/MMU48K/MMU48K.ino new file mode 100644 index 000000000..6acb3840f --- /dev/null +++ b/libraries/esp8266/examples/MMU48K/MMU48K.ino @@ -0,0 +1,322 @@ +#include +#include +#include +#include + +uint32_t timed_byte_read(char *pc, uint32_t * o); +uint32_t timed_byte_read2(char *pc, uint32_t * o); +int divideA_B(int a, int b); + +int* nullPointer = NULL; + +char *probe_b = NULL; +short *probe_s = NULL; +char *probe_c = (char *)0x40110000; +short *unaligned_probe_s = NULL; + +uint32_t read_var = 0x11223344; + +/* + Notes, + When accessing IRAM as data storage all access must be word aligned and + full word length. + +*/ + +#if defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP) +uint32_t *gobble; +size_t gobble_sz; + +#elif (MMU_IRAM_SIZE > 32*1024) +uint32_t gobble[4 * 1024] IRAM_ATTR; +constexpr size_t gobble_sz = sizeof(gobble); + +#else +uint32_t gobble[256] IRAM_ATTR; +constexpr size_t gobble_sz = sizeof(gobble); +#endif + +bool isValid(uint32_t *probe) { + bool rc = true; + if (NULL == probe) { + ets_uart_printf("\nNULL memory pointer %p ...\n", probe); + return false; + } + + ets_uart_printf("\nTesting for valid memory at %p ...\n", probe); + uint32_t savePS = xt_rsil(15); + uint32_t saveData = *probe; + for (size_t i = 0; i < 32; i++) { + *probe = BIT(i); + asm volatile("" ::: "memory"); + uint32_t val = *probe; + if (val != BIT(i)) { + ets_uart_printf(" Read 0x%08X != Wrote 0x%08X\n", val, (uint32_t)BIT(i)); + rc = false; + } + } + *probe = saveData; + xt_wsr_ps(savePS); + ets_uart_printf(" %s\n", (rc) ? "Pass" : "Fail!"); + return rc; +} + + +void dump_mem32(const void * addr, const size_t len) { + uint32_t *addr32 = (uint32_t *)addr; + ets_uart_printf("\n"); + if ((uintptr_t)addr32 & 3) { + ets_uart_printf("non-32-bit access\n"); + ets_delay_us(12000); + } + for (size_t i = 0; i < len;) { + ets_uart_printf("%p: ", &addr32[i]); + do { + ets_uart_printf(" 0x%08x", addr32[i]); + } while (i++, (i & 3) && (i < len)); + ets_uart_printf("\n"); + } + ets_uart_printf("\n"); +} + +extern "C" void _text_end(void); +// extern void *_text_end; +void print_mmu_status(Print& oStream) { + oStream.println(); + oStream.printf_P(PSTR("MMU Configuration")); + oStream.println(); + oStream.println(); + uint32_t iram_bank_reg = ESP8266_DREG(0x24); + if (0 == (iram_bank_reg & 0x10)) { // if bit clear, is enabled + oStream.printf_P(PSTR(" IRAM block mapped to: 0x40108000")); + oStream.println(); + } + if (0 == (iram_bank_reg & 0x08)) { + oStream.printf_P(PSTR(" IRAM block mapped to: 0x4010C000")); + oStream.println(); + } +#ifdef MMU_ICACHE_SIZE + oStream.printf_P(PSTR(" ICACHE Size: %u"), MMU_ICACHE_SIZE); + oStream.println(); +#endif +#ifdef MMU_IRAM_SIZE + oStream.printf_P(PSTR(" IRAM Size: %u"), MMU_IRAM_SIZE); + oStream.println(); + const uint32_t iram_free = MMU_IRAM_SIZE - (uint32_t)((uintptr_t)_text_end - 0x40100000UL); + oStream.printf_P(PSTR(" IRAM free: %u"), iram_free); + oStream.println(); +#endif + oStream.printf_P(PSTR(" IRAM _text_end: %p"), _text_end); + oStream.println(); +#ifdef MMU_SEC_HEAP + oStream.printf_P(PSTR(" Secondary Heap at: %p"), MMU_SEC_HEAP); + oStream.println(); + oStream.printf_P(PSTR(" Secondary Heap Size: %u"), MMU_SEC_HEAP_SIZE); + oStream.println(); +#endif +} + + +void setup() { + WiFi.persistent(false); + WiFi.mode(WIFI_OFF); + // Serial.begin(74880); + Serial.begin(115200); + delay(10); + Serial.printf_P(PSTR("\r\n\r\nSetup ...\r\n")); + + print_mmu_status(Serial); + +#if defined(MMU_IRAM_HEAP) + { + HeapSelectIram ephemeral; + // Serial.printf_P(PSTR("ESP.getFreeHeap(): %u\n"), ESP.getFreeHeap()); + gobble_sz = ESP.getFreeHeap() - UMM_OVERHEAD_ADJUST; // - 4096; + gobble = (uint32_t *)malloc(gobble_sz); + } + Serial.printf_P(PSTR("\r\nmalloc() from IRAM Heap:\r\n")); + Serial.printf_P(PSTR(" gobble_sz: %u\r\n"), gobble_sz); + Serial.printf_P(PSTR(" gobble: %p\r\n"), gobble); + +#elif defined(MMU_SEC_HEAP) + gobble = (uint32_t *)MMU_SEC_HEAP; + gobble_sz = MMU_SEC_HEAP_SIZE; +#endif + +#if (MMU_IRAM_SIZE > 0x8000) || defined(MMU_IRAM_HEAP) || defined(MMU_SEC_HEAP) + if (isValid(gobble)) { + // Put something in our new memory + for (size_t i = 0; i < (gobble_sz / 4); i++) { + gobble[i] = (uint32_t)&gobble[i]; + } + + // Now is it there? + dump_mem32(gobble, 32); + // dump_mem32(&gobble[gobble_sz / 4 / 2], 32); + dump_mem32(&gobble[gobble_sz / 4 - 32], 32); + } +#endif + + // Lets peak over the edge + Serial.printf_P(PSTR("\r\nPeek over the edge of memory at 0x4010C000\r\n")); + dump_mem32((void *)(0x4010C000 - 16 * 4), 32); + + probe_b = (char *)gobble; + probe_s = (short *)((uintptr_t)gobble); + unaligned_probe_s = (short *)((uintptr_t)gobble + 1); + +} + +void processKey(Print& out, int hotKey) { + switch (hotKey) { + case 't': { + uint32_t tmp; + out.printf_P(PSTR("Test how much time is added by exception handling")); + out.println(); + out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp); + out.println(); + out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40200003, &tmp), tmp); + out.println(); + out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)0x40108000, &tmp), tmp); + out.println(); + out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read((char *)((uintptr_t)&read_var + 1), &tmp), tmp); + out.println(); + out.printf_P(PSTR("Test how much time is used by the inline function method")); + out.println(); + out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp); + out.println(); + out.printf_P(PSTR("Timed byte read from iCACHE %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40200003, &tmp), tmp); + out.println(); + out.printf_P(PSTR("Timed byte read from iRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)0x40108000, &tmp), tmp); + out.println(); + out.printf_P(PSTR("Timed byte read from dRAM %u cpu cycle count, 0x%02X."), timed_byte_read2((char *)((uintptr_t)&read_var + 1), &tmp), tmp); + out.println(); + out.println(); + break; + } + case '9': + out.printf_P(PSTR("Unaligned exception by reading short")); + out.println(); + out.flush(); + xt_rsil(3); + out.printf_P(PSTR("Read short, 0x%02X at %p"), unaligned_probe_s[0], unaligned_probe_s); + xt_rsil(0); + out.println(); + break; + case 'c': + out.printf_P(PSTR("Load/Store exception by reading byte outside of handler range")); + out.println(); + out.flush(); + xt_rsil(3); + out.printf_P(PSTR("Read Byte, 0x%02X at %p"), probe_c[0], probe_c); + xt_rsil(0); + out.println(); + out.printf_P(PSTR("With Non32-bit access enabled, access range check is only done when 'Tools->Debug Level: CORE ...' is set.")); + out.println(); + break; + case 'b': + out.printf_P(PSTR("Load/Store exception by reading byte from iRAM")); + out.println(); + out.flush(); + out.printf_P(PSTR("Read Byte from iRAM, 0x%02X at %p"), probe_b[0], probe_b); + out.println(); + break; + case 'B': { + out.printf_P(PSTR("Load/Store exception by writing byte to iRAM")); + out.println(); + char val = 0x55; + out.printf_P(PSTR("Write byte, 0x%02X, to iRAM at %p"), val, probe_b); + out.println(); + out.flush(); + probe_b[0] = val; + out.printf_P(PSTR("Read Byte back from iRAM, 0x%02X at %p"), probe_b[0], probe_b); + out.println(); + break; + } + case 's': + out.printf_P(PSTR("Load/Store exception by reading short from iRAM")); + out.println(); + out.flush(); + out.printf_P(PSTR("Read short from iRAM, 0x%04X at %p"), probe_s[0], probe_s); + out.println(); + break; + case 'S': { + out.printf_P(PSTR("Load/Store exception by writing short to iRAM")); + out.println(); + short int val = 0x0AA0; + out.printf_P(PSTR("Write short, 0x%04X, to iRAM at %p"), val, probe_s); + out.println(); + out.flush(); + probe_s[0] = val; + out.printf_P(PSTR("Read short back from iRAM, 0x%04X at %p"), probe_s[0], probe_s); + out.println(); + break; + } + case 'R': + out.printf_P(PSTR("Restart, ESP.restart(); ...")); + out.println(); + ESP.restart(); + break; + case 'p': + out.println(F("Time to panic()!")); + panic(); + break; + case '0': + out.println(F("Crashing by dividing by zero.")); + out.printf_P(PSTR("This should not print %d"), divideA_B(1, 0)); + out.println(); + break; + case '\r': + out.println(); + case '\n': + break; + case '?': + out.println(); + out.println(F("Press a key + ")); + out.println(F(" R - Restart, ESP.restart();")); + out.println(F(" t - exception vs inline method timing info.")); + out.println(F(" ? - Print Help")); + out.println(); +#if defined(NON32XFER_HANDLER) + out.println(F("Test exception handling with non-32 bit transfer handler:")); +#else + out.println(F("Crash with:")); +#endif + out.println(F(" b - read byte, Load/Store exception")); + out.println(F(" B - write byte, Load/Store exception")); + out.println(F(" s - read short, Load/Store exception")); + out.println(F(" S - write short, Load/Store exception")); +#if defined(NON32XFER_HANDLER) + out.println(); + out.println(F("Crash with:")); +#endif + out.println(F(" c - read byte, Load/Store exception outside of handler range")); + out.println(F(" 9 - read short, Unaligned exception")); + + out.println(F(" 0 - Divide by zero, exception(0);")); + out.println(F(" p - panic();")); + out.println(); + break; + default: + out.printf_P(PSTR("\"%c\" - Not an option? / ? - help"), hotKey); + out.println(); + break; + } +} + + +void serialClientLoop(void) { + if (Serial.available() > 0) { + int hotKey = Serial.read(); + processKey(Serial, hotKey); + } +} + +void loop() { + serialClientLoop(); +} + + +int __attribute__((noinline)) divideA_B(int a, int b) { + return (a / b); +} diff --git a/libraries/esp8266/examples/MMU48K/timed.cpp b/libraries/esp8266/examples/MMU48K/timed.cpp new file mode 100644 index 000000000..80bd0c30d --- /dev/null +++ b/libraries/esp8266/examples/MMU48K/timed.cpp @@ -0,0 +1,16 @@ +#include +#include + +uint32_t IRAM_ATTR timed_byte_read(char *pc, uint32_t * o) { + uint32_t start = esp_get_cycle_count(); + *o = *pc; + // return clockCyclesToMicroseconds(esp_get_cycle_count() - start); + return (esp_get_cycle_count() - start); +} + +uint32_t IRAM_ATTR timed_byte_read2(char *pc, uint32_t * o) { + uint32_t start = esp_get_cycle_count(); + *o = mmu_get_uint8(pc); + // return clockCyclesToMicroseconds(esp_get_cycle_count() - start); + return (esp_get_cycle_count() - start); +} diff --git a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino index 1c7f12faa..376086fb6 100644 --- a/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino +++ b/libraries/esp8266/examples/NTP-TZ-DST/NTP-TZ-DST.ino @@ -64,8 +64,9 @@ static time_t now; static uint32_t now_ms, now_us; static esp8266::polledTimeout::periodicMs showTimeNow(60000); -static int time_machine_days = 0; // 0 = now +static int time_machine_days = 0; // 0 = present static bool time_machine_running = false; +static bool time_machine_run_once = false; // OPTIONAL: change SNTP startup delay // a weak function is already defined and returns 0 (RFC violation) @@ -112,7 +113,7 @@ void showTime() { // time from boot Serial.print("clock: "); Serial.print((uint32_t)tp.tv_sec); - Serial.print("s / "); + Serial.print("s + "); Serial.print((uint32_t)tp.tv_nsec); Serial.println("ns"); @@ -125,7 +126,7 @@ void showTime() { // EPOCH+tz+dst Serial.print("gtod: "); Serial.print((uint32_t)tv.tv_sec); - Serial.print("s / "); + Serial.print("s + "); Serial.print((uint32_t)tv.tv_usec); Serial.println("us"); @@ -140,7 +141,7 @@ void showTime() { Serial.print("ctime: "); Serial.print(ctime(&now)); - // LwIP v2 is able to list more details about the currently configured SNTP servers + // lwIP v2 is able to list more details about the currently configured SNTP servers for (int i = 0; i < SNTP_MAX_SERVERS; i++) { IPAddress sntp = *sntp_getserver(i); const char* name = sntp_getservername(i); @@ -151,7 +152,7 @@ void showTime() { } else { Serial.printf("%s ", sntp.toString().c_str()); } - Serial.printf("IPv6: %s Reachability: %o\n", + Serial.printf("- IPv6: %s - Reachability: %o\n", sntp.isV6() ? "Yes" : "No", sntp_getreachability(i)); } @@ -159,40 +160,59 @@ void showTime() { Serial.println(); - // subsecond synchronisation - gettimeofday(&tv, nullptr); - time_t sec = tv.tv_sec; - do { + // show subsecond synchronisation + timeval prevtv; + time_t prevtime = time(nullptr); + gettimeofday(&prevtv, nullptr); + + while (true) { gettimeofday(&tv, nullptr); - Serial.printf("time(): %u gettimeofday(): %u.%06u", - (uint32_t)time(nullptr), - (uint32_t)tv.tv_sec, (uint32_t)tv.tv_usec); - if (tv.tv_sec == sec) { - Serial.println(" second unchanged"); - } else { - Serial.println(" <-- second changed"); + if (tv.tv_sec != prevtv.tv_sec) { + Serial.printf("time(): %u gettimeofday(): %u.%06u seconds are unchanged\n", + (uint32_t)prevtime, + (uint32_t)prevtv.tv_sec, (uint32_t)prevtv.tv_usec); + Serial.printf("time(): %u gettimeofday(): %u.%06u <-- seconds have changed\n", + (uint32_t)(prevtime = time(nullptr)), + (uint32_t)tv.tv_sec, (uint32_t)tv.tv_usec); + break; } + prevtv = tv; delay(50); - } while (tv.tv_sec == sec); + } Serial.println(); } -void time_is_set_scheduled() { - // everything is allowed in this function +void time_is_set(bool from_sntp /* <= this parameter is optional */) { + // in CONT stack, unlike ISRs, + // any function is allowed in this callback if (time_machine_days == 0) { - time_machine_running = !time_machine_running; + if (time_machine_running) { + time_machine_run_once = true; + time_machine_running = false; + } else { + time_machine_running = from_sntp && !time_machine_run_once; + } + if (time_machine_running) { + Serial.printf("\n-- \n-- Starting time machine demo to show libc's " + "automatic DST handling\n-- \n"); + } } + Serial.print("settimeofday("); + if (from_sntp) { + Serial.print("SNTP"); + } else { + Serial.print("USER"); + } + Serial.print(")"); + // time machine demo if (time_machine_running) { - if (time_machine_days == 0) - Serial.printf("---- settimeofday() has been called - possibly from SNTP\n" - " (starting time machine demo to show libc's automatic DST handling)\n\n"); now = time(nullptr); const tm* tm = localtime(&now); - Serial.printf("future=%3ddays: DST=%s - ", + Serial.printf(": future=%3ddays: DST=%s - ", time_machine_days, tm->tm_isdst ? "true " : "false"); Serial.print(ctime(&now)); @@ -207,49 +227,55 @@ void time_is_set_scheduled() { } settimeofday(&tv, nullptr); } else { - showTime(); + Serial.println(); } } void setup() { + WiFi.persistent(false); + WiFi.mode(WIFI_OFF); + Serial.begin(115200); - Serial.println("\nStarting...\n"); + Serial.println("\nStarting in 2secs...\n"); + delay(2000); + + // install callback - called when settimeofday is called (by SNTP or user) + // once enabled (by DHCP), SNTP is updated every hour by default + // ** optional boolean in callback function is true when triggerred by SNTP ** + settimeofday_cb(time_is_set); // setup RTC time // it will be used until NTP server will send us real current time + Serial.println("Manually setting some time from some RTC:"); time_t rtc = RTC_UTC_TEST; timeval tv = { rtc, 0 }; settimeofday(&tv, nullptr); - // install callback - called when settimeofday is called (by SNTP or us) - // once enabled (by DHCP), SNTP is updated every hour - settimeofday_cb(time_is_set_scheduled); - // NTP servers may be overriden by your DHCP server for a more local one // (see below) // ----> Here is the ONLY ONE LINE needed in your sketch - configTime(MYTZ, "pool.ntp.org"); + // <---- + // Replace MYTZ by a value from TZ.h (search for this file in your filesystem). - // Here is the ONLY ONE LINE needed in your sketch <---- - // pick a value from TZ.h (search for this file in your filesystem) for MYTZ - - // former configTime is still valid, here is the call for 7 hours to the west + // Former configTime is still valid, here is the call for 7 hours to the west // with an enabled 30mn DST //configTime(7 * 3600, 3600 / 2, "pool.ntp.org"); // OPTIONAL: disable obtaining SNTP servers from DHCP //sntp_servermode_dhcp(0); // 0: disable obtaining SNTP servers from DHCP (enabled by default) + // Give now a chance to the settimeofday callback, + // because it is *always* deferred to the next yield()/loop()-call. + yield(); + // start network - WiFi.persistent(false); WiFi.mode(WIFI_STA); WiFi.begin(STASSID, STAPSK); // don't wait for network, observe time changing // when NTP timestamp is received - Serial.printf("Time is currently set by a constant:\n"); showTime(); } diff --git a/libraries/esp8266/examples/irammem/irammem.ino b/libraries/esp8266/examples/irammem/irammem.ino new file mode 100644 index 000000000..169d53e05 --- /dev/null +++ b/libraries/esp8266/examples/irammem/irammem.ino @@ -0,0 +1,471 @@ +/* + This sketch assumes you have selected IRAM as a Second Heap from + the Arduino IDE tools menu. +*/ + +#include +#include +#include + +// #define USE_SET_IRAM_HEAP + + +#ifndef ETS_PRINTF +#define ETS_PRINTF ets_uart_printf +#endif + +uint32_t cyclesToRead_nKx32(int n, unsigned int *x, uint32_t *res) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += *(x++); + } + *res = sum; + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToWrite_nKx32(int n, unsigned int *x) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += i; + *(x++) = sum; + } + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToRead_nKx16(int n, unsigned short *x, uint32_t *res) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += *(x++); + } + *res = sum; + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToWrite_nKx16(int n, unsigned short *x) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += i; + *(x++) = sum; + } + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToRead_nKxs16(int n, short *x, int32_t *res) { + uint32_t b = ESP.getCycleCount(); + int32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += *(x++); + } + *res = sum; + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToWrite_nKxs16(int n, short *x) { + uint32_t b = ESP.getCycleCount(); + int32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += i; + *(x++) = sum; + } + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToRead_nKx8(int n, unsigned char*x, uint32_t *res) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += *(x++); + } + *res = sum; + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToWrite_nKx8(int n, unsigned char*x) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += i; + *(x++) = sum; + } + return ESP.getCycleCount() - b; +} + +// Compare with Inline + +uint32_t cyclesToRead_nKx16_viaInline(int n, unsigned short *x, uint32_t *res) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += mmu_get_uint16(x++); //*(x++); + } + *res = sum; + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToWrite_nKx16_viaInline(int n, unsigned short *x) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += i; + // *(x++) = sum; + mmu_set_uint16(x++, sum); + } + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToRead_nKxs16_viaInline(int n, short *x, int32_t *res) { + uint32_t b = ESP.getCycleCount(); + int32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += mmu_get_int16(x++); //*(x++); + } + *res = sum; + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToWrite_nKxs16_viaInline(int n, short *x) { + uint32_t b = ESP.getCycleCount(); + int32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += i; + // *(x++) = sum; + mmu_set_int16(x++, sum); + } + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToRead_nKx8_viaInline(int n, unsigned char*x, uint32_t *res) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += mmu_get_uint8(x++); //*(x++); + } + *res = sum; + return ESP.getCycleCount() - b; +} + +uint32_t cyclesToWrite_nKx8_viaInline(int n, unsigned char*x) { + uint32_t b = ESP.getCycleCount(); + uint32_t sum = 0; + for (int i = 0; i < n * 1024; i++) { + sum += i; + // *(x++) = sum; + mmu_set_uint8(x++, sum); + } + return ESP.getCycleCount() - b; +} + +bool perfTest_nK(int nK, uint32_t *mem, uint32_t *imem) { + uint32_t res, verify_res; + uint32_t t; + bool success = true; + int sres, verify_sres; + + Serial.printf("\r\nPerformance numbers for 16 bit access - using inline macros or exception handling for IRAM.\r\n");; + t = cyclesToWrite_nKx16(nK, (uint16_t*)mem); + Serial.printf("DRAM Memory Write: %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx16(nK, (uint16_t*)mem, &verify_res); + Serial.printf("DRAM Memory Read: %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), verify_res); + t = cyclesToWrite_nKxs16(nK, (int16_t*)mem); + Serial.printf("DRAM Memory Write: %7d cycles for %dK by int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKxs16(nK, (int16_t*)mem, &verify_sres); + Serial.printf("DRAM Memory Read: %7d cycles for %dK by int16, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), verify_sres); + + t = cyclesToWrite_nKx16_viaInline(nK, (uint16_t*)imem); + Serial.printf("IRAM Memory Write Inline: %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx16_viaInline(nK, (uint16_t*)imem, &res); + Serial.printf("IRAM Memory Read Inline: %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res); + if (res == verify_res) { + Serial.printf("- passed\r\n"); + } else { + Serial.printf("!= (sum %08x ) - failed\r\n", verify_res); + success = false; + } + + t = cyclesToWrite_nKxs16_viaInline(nK, (int16_t*)imem); + Serial.printf("IRAM Memory Write Inline: %7d cycles for %dK by int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKxs16_viaInline(nK, (int16_t*)imem, &sres); + Serial.printf("IRAM Memory Read Inline: %7d cycles for %dK by int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres); + if (sres == verify_sres) { + Serial.printf("- passed\r\n"); + } else { + Serial.printf("!= (sum %08x ) - failed\r\n", verify_sres); + success = false; + } + + t = cyclesToWrite_nKx16(nK, (uint16_t*)imem); + Serial.printf("IRAM Memory Write: %7d cycles for %dK by uint16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx16(nK, (uint16_t*)imem, &res); + Serial.printf("IRAM Memory Read: %7d cycles for %dK by uint16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res); + if (res == verify_res) { + Serial.printf("- passed\r\n"); + } else { + Serial.printf("!= (sum %08x ) - failed\r\n", verify_res); + success = false; + } + t = cyclesToWrite_nKxs16(nK, (int16_t*)imem); + Serial.printf("IRAM Memory Write: %7d cycles for %dK by int16, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKxs16(nK, (int16_t*)imem, &sres); + Serial.printf("IRAM Memory Read: %7d cycles for %dK by int16, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), sres); + if (sres == verify_sres) { + Serial.printf("- passed\r\n"); + } else { + Serial.printf("!= (sum %08x ) - failed\r\n", verify_sres); + success = false; + } + + Serial.printf("\r\nPerformance numbers for 8 bit access - using inline macros or exception handling for IRAM access.\r\n");; + t = cyclesToWrite_nKx8(nK, (uint8_t*)mem); + Serial.printf("DRAM Memory Write: %7d cycles for %dK by uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx8(nK, (uint8_t*)mem, &verify_res); + Serial.printf("DRAM Memory Read: %7d cycles for %dK by uint8, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), verify_res); + + t = cyclesToWrite_nKx8_viaInline(nK, (uint8_t*)imem); + Serial.printf("IRAM Memory Write Inline: %7d cycles for %dK by uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx8_viaInline(nK, (uint8_t*)imem, &res); + Serial.printf("IRAM Memory Read Inline: %7d cycles for %dK by uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res); + if (res == verify_res) { + Serial.printf("- passed\r\n"); + } else { + Serial.printf("!= (sum %08x ) - failed\r\n", verify_res); + success = false; + } + + t = cyclesToWrite_nKx8(nK, (uint8_t*)imem); + Serial.printf("IRAM Memory Write: %7d cycles for %dK by uint8, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx8(nK, (uint8_t*)imem, &res); + Serial.printf("IRAM Memory Read: %7d cycles for %dK by uint8, %3d AVG cycles/transfer (sum %08x) ", t, nK, t / (nK * 1024), res); + if (res == verify_res) { + Serial.printf("- passed\r\n"); + } else { + Serial.printf("!= (sum %08x ) - failed\r\n", verify_res); + success = false; + } + Serial.println(); + + return success; +} + +void setup() { + WiFi.persistent(false); + WiFi.mode(WIFI_OFF); + // Serial.begin(74880); + Serial.begin(115200); + delay(20); + Serial.printf_P(PSTR("\n\nSetup ...\r\n")); +#ifndef UMM_HEAP_IRAM + Serial.printf("\r\n" + "This example needs IRAM Heap support enabled.\r\n" + " eg. Arduino IDE 'Tools->MMU:\"16KB cache + 48KB IRAM and 2nd Heap (shared)\"'\r\n" + "This build has IRAM Heap support disabled.\r\n" + "In this situation, all IRAM requests are satisfied with DRAM.\r\n\r\n"); +#endif + + // Compiling with Secondary Heap option does not change malloc to use the + // IRAM region. It will continue to use the builtin DRAM until we request + // otherwise. + Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap()); + uint32_t *mem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t)); + Serial.printf("DRAM buffer: Address %p, free %d\r\n", mem, ESP.getFreeHeap()); + if (!mem) { + return; + } + + // Now request from the IRAM heap +#ifdef USE_SET_IRAM_HEAP + ESP.setIramHeap(); + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + uint32_t *imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t)); + Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap()); + // Make sure we go back to the DRAM heap for other allocations. Don't forget to ESP.resetHeap()! + ESP.resetHeap(); +#else + uint32_t *imem; + { + HeapSelectIram ephemeral; + // This class effectively does this + // size_t _heap_id = umm_get_current_heap_id(); + // umm_set_heap_by_id(UMM_HEAP_IRAM); + // ... + // umm_set_heap_by_id(_heap_id); + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + imem = (uint32_t *)malloc(2 * 1024 * sizeof(uint32_t)); + Serial.printf("IRAM buffer: Address %p, free %d\r\n", imem, ESP.getFreeHeap()); + } +#endif + if (!imem) { + return; + } + + uint32_t res; + uint32_t t; + int nK = 1; + Serial.printf("\r\nPerformance numbers for 32 bit access - no exception handler or inline macros needed.\r\n");; + t = cyclesToWrite_nKx32(nK, mem); + Serial.printf("DRAM Memory Write: %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx32(nK, mem, &res); + Serial.printf("DRAM Memory Read: %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res); + + t = cyclesToWrite_nKx32(nK, imem); + Serial.printf("IRAM Memory Write: %7d cycles for %dK by uint32, %3d AVG cycles/transfer\r\n", t, nK, t / (nK * 1024)); + t = cyclesToRead_nKx32(nK, imem, &res); + Serial.printf("IRAM Memory Read: %7d cycles for %dK by uint32, %3d AVG cycles/transfer (sum %08x)\r\n", t, nK, t / (nK * 1024), res); + Serial.println(); + + + if (perfTest_nK(1, mem, imem)) { + Serial.println(); + } else { + Serial.println("\r\n*******************************"); + Serial.println("*******************************"); + Serial.println("** **"); + Serial.println("** One or more test failed **"); + Serial.println("** **"); + Serial.println("*******************************"); + Serial.println("*******************************\r\n"); + return; + } + +#ifdef USE_SET_IRAM_HEAP + // Let's use IRAM heap to make a big ole' String + ESP.setIramHeap(); + String s = ""; + for (int i = 0; i < 100; i++) { + s += i; + s += ' '; + } + ESP.resetHeap(); + Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap()); + ESP.setIramHeap(); + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + ESP.resetHeap(); + Serial.printf("String: %s\r\n", s.c_str()); + ESP.setIramHeap(); + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + ESP.resetHeap(); +#else + { + // Let's use IRAM heap to make a big ole' String + HeapSelectIram ephemeral; + String s = ""; + for (int i = 0; i < 100; i++) { + s += i; + s += ' '; + } + { + HeapSelectDram ephemeral; + Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap()); + } + // Back to IRAM + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + Serial.printf("String: %s\r\n", s.c_str()); + } + { + HeapSelectIram ephemeral; + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + } +#endif + + // Note that free/realloc will use the heap specified when the pointer was created. + // No need to change heaps to delete an object, only to create it. + free(imem); + free(mem); + imem = NULL; + mem = NULL; + + Serial.printf("DRAM free: %6d\r\n", ESP.getFreeHeap()); +#ifdef USE_SET_IRAM_HEAP + ESP.setIramHeap(); + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + ESP.resetHeap(); +#else + { + HeapSelectIram ephemeral; + Serial.printf("IRAM free: %6d\r\n", ESP.getFreeHeap()); + } +#endif + { + ETS_PRINTF("Try and allocate all of the heap in one chunk\n"); + HeapSelectIram ephemeral; + size_t free_iram = ESP.getFreeHeap(); + ETS_PRINTF("IRAM free: %6d\n", free_iram); + uint32_t hfree; + uint16_t hmax; + uint8_t hfrag; + ESP.getHeapStats(&hfree, &hmax, &hfrag); + ETS_PRINTF("ESP.getHeapStats(free: %u, max: %u, frag: %u)\n", + hfree, hmax, hfrag); + if (free_iram > UMM_OVERHEAD_ADJUST) { + void *all = malloc(free_iram - UMM_OVERHEAD_ADJUST); + ETS_PRINTF("%p = malloc(%u)\n", all, free_iram); + umm_info(NULL, true); + + free_iram = ESP.getFreeHeap(); + ETS_PRINTF("IRAM free: %6d\n", free_iram); + + free(all); + ETS_PRINTF("IRAM free: %6d\n", ESP.getFreeHeap()); + } + } +} + +void processKey(Print& out, int hotKey) { + switch (hotKey) { + case 'd': { + HeapSelectDram ephemeral; + umm_info(NULL, true); + break; + } + case 'i': { + HeapSelectIram ephemeral; + umm_info(NULL, true); + break; + } + case 'h': { + { + HeapSelectIram ephemeral; + Serial.printf(PSTR("IRAM ESP.getFreeHeap: %u\n"), ESP.getFreeHeap()); + } + { + HeapSelectDram ephemeral; + Serial.printf(PSTR("DRAM ESP.getFreeHeap: %u\r\n"), ESP.getFreeHeap()); + } + break; + } + case 'R': + out.printf_P(PSTR("Restart, ESP.restart(); ...\r\n")); + ESP.restart(); + break; + case '\r': + out.println(); + case '\n': + break; + case '?': + out.println(); + out.println(F("Press a key + ")); + out.println(F(" h - Free Heap Report;")); + out.println(F(" i - iRAM umm_info(null, true);")); + out.println(F(" d - dRAM umm_info(null, true);")); + out.println(F(" R - Restart, ESP.restart();")); + out.println(F(" ? - Print Help")); + out.println(); + break; + default: + out.printf_P(PSTR("\"%c\" - Not an option? / ? - help"), hotKey); + out.println(); + processKey(out, '?'); + break; + } +} + + +void loop(void) { + if (Serial.available() > 0) { + int hotKey = Serial.read(); + processKey(Serial, hotKey); + } +} diff --git a/libraries/esp8266/keywords.txt b/libraries/esp8266/keywords.txt index 1f100ff0e..75afea9ad 100644 --- a/libraries/esp8266/keywords.txt +++ b/libraries/esp8266/keywords.txt @@ -71,8 +71,12 @@ getResetInfo KEYWORD2 getResetInfoPtr KEYWORD2 eraseConfig KEYWORD2 getCycleCount KEYWORD2 +enableVM KEYWORD2 +setExternalHeap KEYWORD2 +setDramHeap KEYWORD2 +setIramHeap KEYWORD2 +resetHeap KEYWORD2 random->KEYWORD2 - setCtMinDataLength KEYWORD2 getCtMinDataLength KEYWORD2 setCtMaxDataLength KEYWORD2 @@ -87,6 +91,7 @@ produce KEYWORD2 encrypt KEYWORD2 decrypt KEYWORD2 + ####################################### # Constants (LITERAL1) ####################################### diff --git a/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino new file mode 100644 index 000000000..ed2943c27 --- /dev/null +++ b/libraries/lwIP_PPP/examples/PPPServer/PPPServer.ino @@ -0,0 +1,111 @@ + +// This is still beta / a work in progress + +// To run this sketch an (other) USB-serial converter is needed connected to RX-TX ports (below) +// hardware serial is used for logging +// software serial is used for the PPP link +// this example is subject for changes once everything is stabilized + +// testing on linux: +// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth nodetach debug dump +// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth + +// proxy arp is needed but we don't have it +// http://lwip.100.n7.nabble.com/PPP-proxy-arp-support-tp33286p33345.html +// using NAT instead + +#if LWIP_FEATURES && !LWIP_IPV6 + +#include +#include +#include +#include +#include +#include + +#ifndef STASSID +#define STASSID "your-ssid" +#define STAPSK "your-password" +#endif + +#define LOGGERBAUD 115200 +#define PPPLINKBAUD 38400 + +#define NAPT 200 +#define NAPT_PORT 3 + +#define RX 13 // d1mini D7 +#define TX 15 // d1mini D8 + +SoftwareSerial ppplink(RX, TX); +HardwareSerial& logger = Serial; +PPPServer ppp(&ppplink); + +void PPPConnectedCallback(netif* nif) { + logger.printf("ppp: ip=%s/mask=%s/gw=%s\n", + IPAddress(&nif->ip_addr).toString().c_str(), + IPAddress(&nif->netmask).toString().c_str(), + IPAddress(&nif->gw).toString().c_str()); + + logger.printf("Heap before: %d\n", ESP.getFreeHeap()); + err_t ret = ip_napt_init(NAPT, NAPT_PORT); + logger.printf("ip_napt_init(%d,%d): ret=%d (OK=%d)\n", NAPT, NAPT_PORT, (int)ret, (int)ERR_OK); + if (ret == ERR_OK) { + ret = ip_napt_enable_no(nif->num, 1); + logger.printf("ip_napt_enable(nif): ret=%d (OK=%d)\n", (int)ret, (int)ERR_OK); + if (ret == ERR_OK) { + logger.printf("PPP client is NATed\n"); + } + + // could not make this work yet, + // but packets are arriving on ppp client (= linux host) + logger.printf("redirect22=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 22, ip_2_ip4(&nif->gw)->addr, 22)); + logger.printf("redirect80=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 80, ip_2_ip4(&nif->gw)->addr, 80)); + logger.printf("redirect443=%d\n", ip_portmap_add(IP_PROTO_TCP, ip_2_ip4(&nif->ip_addr)->addr, 443, ip_2_ip4(&nif->gw)->addr, 443)); + } + logger.printf("Heap after napt init: %d\n", ESP.getFreeHeap()); + if (ret != ERR_OK) { + logger.printf("NAPT initialization failed\n"); + } +} + +void setup() { + logger.begin(LOGGERBAUD); + + WiFi.persistent(false); + WiFi.mode(WIFI_STA); + WiFi.begin(STASSID, STAPSK); + while (WiFi.status() != WL_CONNECTED) { + logger.print('.'); + delay(500); + } + logger.printf("\nSTA: %s (dns: %s / %s)\n", + WiFi.localIP().toString().c_str(), + WiFi.dnsIP(0).toString().c_str(), + WiFi.dnsIP(1).toString().c_str()); + + ppplink.begin(PPPLINKBAUD); + ppplink.enableIntTx(true); + logger.println(); + logger.printf("\n\nhey, trying to be a PPP server here\n\n"); + logger.printf("Now try this on your linux host:\n\n"); + logger.printf("connect a serial<->usb module (e.g. to /dev/ttyUSB1) and link it to the ESP (esprx=%d esptx=%d), then run:\n\n", RX, TX); + logger.printf("sudo /usr/sbin/pppd /dev/ttyUSB1 %d noipdefault nocrtscts local defaultroute noauth nodetach debug dump\n\n", PPPLINKBAUD); + + ppp.ifUpCb(PPPConnectedCallback); + bool ret = ppp.begin(WiFi.localIP()); + logger.printf("ppp: %d\n", ret); +} + + +#else + +void setup() { + Serial.begin(115200); + Serial.printf("\n\nPPP/NAPT not supported in this configuration\n"); +} + +#endif + +void loop() { +} diff --git a/libraries/lwIP_PPP/library.properties b/libraries/lwIP_PPP/library.properties new file mode 100644 index 000000000..9b2293dbf --- /dev/null +++ b/libraries/lwIP_PPP/library.properties @@ -0,0 +1,10 @@ +name=lwIP_PPP +version=1 +author=lwIP +maintainer=esp8266/Arduino +sentence=PPP interface +paragraph=PPP interface for esp8266 arduino +category=Network +url=https://github.com/esp8266/Arduino +architectures=esp8266 +dot_a_linkage=true diff --git a/libraries/lwIP_PPP/src/PPPServer.cpp b/libraries/lwIP_PPP/src/PPPServer.cpp new file mode 100644 index 000000000..98fddd777 --- /dev/null +++ b/libraries/lwIP_PPP/src/PPPServer.cpp @@ -0,0 +1,196 @@ + +// This is still beta / a work in progress + +// testing on linux: +// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth nodetach debug dump +// sudo /usr/sbin/pppd /dev/ttyUSB1 38400 noipdefault nocrtscts local defaultroute noauth + +// proxy arp is needed but we don't have it +// http://lwip.100.n7.nabble.com/PPP-proxy-arp-support-tp33286p33345.html +// using NAT instead (see in example) + +#include +#include +#include +#include + +#include "PPPServer.h" + +PPPServer::PPPServer(Stream* sio): _sio(sio), _cb(netif_status_cb_s), _enabled(false) +{ +} + +bool PPPServer::handlePackets() +{ + size_t avail; + if ((avail = _sio->available()) > 0) + { + // XXX block peeking would be useful here + if (avail > _bufsize) + { + avail = _bufsize; + } + avail = _sio->readBytes(_buf, avail); + pppos_input(_ppp, _buf, avail); + } + return _enabled; +} + +void PPPServer::link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx) +{ + bool stop = true; + netif* nif = ppp_netif(pcb); + + switch (err_code) + { + case PPPERR_NONE: /* No error. */ + { +#if LWIP_DNS + const ip_addr_t *ns; +#endif /* LWIP_DNS */ + ets_printf("ppp_link_status_cb: PPPERR_NONE\n\r"); +#if LWIP_IPV4 + ets_printf(" our_ip4addr = %s\n\r", ip4addr_ntoa(netif_ip4_addr(nif))); + ets_printf(" his_ipaddr = %s\n\r", ip4addr_ntoa(netif_ip4_gw(nif))); + ets_printf(" netmask = %s\n\r", ip4addr_ntoa(netif_ip4_netmask(nif))); +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + ets_printf(" our_ip6addr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0))); +#endif /* LWIP_IPV6 */ + +#if LWIP_DNS + ns = dns_getserver(0); + ets_printf(" dns1 = %s\n\r", ipaddr_ntoa(ns)); + ns = dns_getserver(1); + ets_printf(" dns2 = %s\n\r", ipaddr_ntoa(ns)); +#endif /* LWIP_DNS */ +#if PPP_IPV6_SUPPORT + ets_printf(" our6_ipaddr = %s\n\r", ip6addr_ntoa(netif_ip6_addr(nif, 0))); +#endif /* PPP_IPV6_SUPPORT */ + } + stop = false; + break; + + case PPPERR_PARAM: /* Invalid parameter. */ + ets_printf("ppp_link_status_cb: PPPERR_PARAM\n"); + break; + + case PPPERR_OPEN: /* Unable to open PPP session. */ + ets_printf("ppp_link_status_cb: PPPERR_OPEN\n"); + break; + + case PPPERR_DEVICE: /* Invalid I/O device for PPP. */ + ets_printf("ppp_link_status_cb: PPPERR_DEVICE\n"); + break; + + case PPPERR_ALLOC: /* Unable to allocate resources. */ + ets_printf("ppp_link_status_cb: PPPERR_ALLOC\n"); + break; + + case PPPERR_USER: /* User interrupt. */ + ets_printf("ppp_link_status_cb: PPPERR_USER\n"); + break; + + case PPPERR_CONNECT: /* Connection lost. */ + ets_printf("ppp_link_status_cb: PPPERR_CONNECT\n"); + break; + + case PPPERR_AUTHFAIL: /* Failed authentication challenge. */ + ets_printf("ppp_link_status_cb: PPPERR_AUTHFAIL\n"); + break; + + case PPPERR_PROTOCOL: /* Failed to meet protocol. */ + ets_printf("ppp_link_status_cb: PPPERR_PROTOCOL\n"); + break; + + case PPPERR_PEERDEAD: /* Connection timeout. */ + ets_printf("ppp_link_status_cb: PPPERR_PEERDEAD\n"); + break; + + case PPPERR_IDLETIMEOUT: /* Idle Timeout. */ + ets_printf("ppp_link_status_cb: PPPERR_IDLETIMEOUT\n"); + break; + + case PPPERR_CONNECTTIME: /* PPPERR_CONNECTTIME. */ + ets_printf("ppp_link_status_cb: PPPERR_CONNECTTIME\n"); + break; + + case PPPERR_LOOPBACK: /* Connection timeout. */ + ets_printf("ppp_link_status_cb: PPPERR_LOOPBACK\n"); + break; + + default: + ets_printf("ppp_link_status_cb: unknown errCode %d\n", err_code); + break; + } + + if (stop) + { + netif_remove(&static_cast(ctx)->_netif); + } +} + +u32_t PPPServer::output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx) +{ + (void)pcb; + (void)ctx; + return static_cast(ctx)->_sio->write(data, len); +} + +void PPPServer::netif_status_cb_s(netif* nif) +{ + ets_printf("PPPNETIF: %c%c%d is %s\n", nif->name[0], nif->name[1], nif->num, + netif_is_up(nif) ? "UP" : "DOWN"); +#if LWIP_IPV4 + ets_printf("IPV4: Host at %s ", ip4addr_ntoa(netif_ip4_addr(nif))); + ets_printf("mask %s ", ip4addr_ntoa(netif_ip4_netmask(nif))); + ets_printf("gateway %s\n", ip4addr_ntoa(netif_ip4_gw(nif))); +#endif /* LWIP_IPV4 */ +#if LWIP_IPV6 + ets_printf("IPV6: Host at %s\n", ip6addr_ntoa(netif_ip6_addr(nif, 0))); +#endif /* LWIP_IPV6 */ + ets_printf("FQDN: %s\n", netif_get_hostname(nif)); +} + +bool PPPServer::begin(const IPAddress& ourAddress, const IPAddress& peer) +{ + // lwip2-src/doc/ppp.txt + + _ppp = pppos_create(&_netif, PPPServer::output_cb_s, PPPServer::link_status_cb_s, this); + if (!_ppp) + { + return false; + } + + ppp_set_ipcp_ouraddr(_ppp, ip_2_ip4((const ip_addr_t*)ourAddress)); + ppp_set_ipcp_hisaddr(_ppp, ip_2_ip4((const ip_addr_t*)peer)); + + //ip4_addr_t addr; + //IP4_ADDR(&addr, 10,0,1,254); + //ppp_set_ipcp_dnsaddr(_ppp, 0, &addr); + + //ppp_set_auth(_ppp, PPPAUTHTYPE_ANY, "login", "password"); + //ppp_set_auth_required(_ppp, 1); + + ppp_set_silent(_ppp, 1); + ppp_listen(_ppp); + netif_set_status_callback(&_netif, _cb); + + _enabled = true; + if (!schedule_recurrent_function_us([&]() +{ + return this->handlePackets(); + }, 1000)) + { + netif_remove(&_netif); + return false; + } + + return true; +} + +void PPPServer::stop() +{ + _enabled = false; + ppp_close(_ppp, 0); +} diff --git a/libraries/lwIP_PPP/src/PPPServer.h b/libraries/lwIP_PPP/src/PPPServer.h new file mode 100644 index 000000000..e2c95658a --- /dev/null +++ b/libraries/lwIP_PPP/src/PPPServer.h @@ -0,0 +1,77 @@ +/* + 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. + + This file is part of the lwIP TCP/IP stack. + + Author: Dirk Ziegelmeier + +*/ + + +#ifndef __PPPSERVER_H +#define __PPPSERVER_H + +#include +#include +#include +#include +#include + +class PPPServer +{ +public: + + PPPServer(Stream* sio); + + bool begin(const IPAddress& ourAddress, const IPAddress& peer = IPAddress(172, 31, 255, 254)); + void stop(); + + void ifUpCb(void (*cb)(netif*)) + { + _cb = cb; + } + const ip_addr_t* getPeerAddress() const + { + return &_netif.gw; + } + +protected: + + static constexpr size_t _bufsize = 128; + Stream* _sio; + ppp_pcb* _ppp; + netif _netif; + void (*_cb)(netif*); + uint8_t _buf[_bufsize]; + bool _enabled; + + // feed ppp from stream - to call on a regular basis or on interrupt + bool handlePackets(); + + static u32_t output_cb_s(ppp_pcb* pcb, u8_t* data, u32_t len, void* ctx); + static void link_status_cb_s(ppp_pcb* pcb, int err_code, void* ctx); + static void netif_status_cb_s(netif* nif); + +}; + +#endif // __PPPSERVER_H diff --git a/libraries/lwIP_enc28j60/library.properties b/libraries/lwIP_enc28j60/library.properties new file mode 100644 index 000000000..444e0f1c4 --- /dev/null +++ b/libraries/lwIP_enc28j60/library.properties @@ -0,0 +1,10 @@ +name=lwIP_enc28j60 +version=1 +author=Nicholas Humfrey +maintainer=esp8266/Arduino +sentence=Ethernet driver +paragraph=ENC28J60 ethernet drivers for lwIP and esp8266 Arduino from https://github.com/njh/EtherSia/tree/master/src/enc28j60.cpp +category=Network +url=https://github.com/esp8266/Arduino +architectures=esp8266 +dot_a_linkage=true diff --git a/libraries/lwIP_enc28j60/src/ENC28J60lwIP.h b/libraries/lwIP_enc28j60/src/ENC28J60lwIP.h new file mode 100644 index 000000000..e525e9406 --- /dev/null +++ b/libraries/lwIP_enc28j60/src/ENC28J60lwIP.h @@ -0,0 +1,10 @@ + +#ifndef _ENC28J60LWIP_H +#define _ENC28J60LWIP_H + +#include +#include + +using ENC28J60lwIP = LwipIntfDev; + +#endif // _ENC28J60LWIP_H diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp new file mode 100644 index 000000000..42d1af7fc --- /dev/null +++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.cpp @@ -0,0 +1,744 @@ +/* + Copyright (c) 2012-2013, Thingsquare, http://www.thingsquare.com/. + Copyright (c) 2016, Nicholas Humfrey + All rights reserved. + + 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. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``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 + COPYRIGHT HOLDER OR CONTRIBUTORS 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. + +*/ + +// original sources: https://github.com/njh/EtherSia/tree/master/src/enc28j60.cpp + +#include +#include + +#include +#include +#include +#include + +#include "enc28j60.h" + + +void serial_printf(const char *fmt, ...) +{ + char buf[128]; + va_list args; + va_start(args, fmt); + vsnprintf(buf, 128, fmt, args); + va_end(args); + Serial.print(buf); +} + +#define DEBUG 0 +#if DEBUG +#define PRINTF(...) printf(__VA_ARGS__) +#else +#define PRINTF(...) do { (void)0; } while (0) +#endif + +#define EIE 0x1b +#define EIR 0x1c +#define ESTAT 0x1d +#define ECON2 0x1e +#define ECON1 0x1f + +#define ESTAT_CLKRDY 0x01 +#define ESTAT_TXABRT 0x02 + +#define ECON1_RXEN 0x04 +#define ECON1_TXRTS 0x08 + +#define ECON2_AUTOINC 0x80 +#define ECON2_PKTDEC 0x40 + +#define EIR_TXIF 0x08 + +#define ERXTX_BANK 0x00 + +#define ERDPTL 0x00 +#define ERDPTH 0x01 +#define EWRPTL 0x02 +#define EWRPTH 0x03 +#define ETXSTL 0x04 +#define ETXSTH 0x05 +#define ETXNDL 0x06 +#define ETXNDH 0x07 +#define ERXSTL 0x08 +#define ERXSTH 0x09 +#define ERXNDL 0x0a +#define ERXNDH 0x0b +#define ERXRDPTL 0x0c +#define ERXRDPTH 0x0d + +#define RX_BUF_START 0x0000 +#define RX_BUF_END 0x0fff + +#define TX_BUF_START 0x1200 + +/* MACONx registers are in bank 2 */ +#define MACONX_BANK 0x02 + +#define MACON1 0x00 +#define MACON3 0x02 +#define MACON4 0x03 +#define MABBIPG 0x04 +#define MAIPGL 0x06 +#define MAIPGH 0x07 +#define MAMXFLL 0x0a +#define MAMXFLH 0x0b + +#define MACON1_TXPAUS 0x08 +#define MACON1_RXPAUS 0x04 +#define MACON1_MARXEN 0x01 + +#define MACON3_PADCFG_FULL 0xe0 +#define MACON3_TXCRCEN 0x10 +#define MACON3_FRMLNEN 0x02 +#define MACON3_FULDPX 0x01 + +#define MAX_MAC_LENGTH 1518 + +#define MAADRX_BANK 0x03 +#define MAADR1 0x04 /* MAADR<47:40> */ +#define MAADR2 0x05 /* MAADR<39:32> */ +#define MAADR3 0x02 /* MAADR<31:24> */ +#define MAADR4 0x03 /* MAADR<23:16> */ +#define MAADR5 0x00 /* MAADR<15:8> */ +#define MAADR6 0x01 /* MAADR<7:0> */ +#define MISTAT 0x0a +#define EREVID 0x12 + +#define EPKTCNT_BANK 0x01 +#define ERXFCON 0x18 +#define EPKTCNT 0x19 + +#define ERXFCON_UCEN 0x80 +#define ERXFCON_ANDOR 0x40 +#define ERXFCON_CRCEN 0x20 +#define ERXFCON_MCEN 0x02 +#define ERXFCON_BCEN 0x01 + +// The ENC28J60 SPI Interface supports clock speeds up to 20 MHz +static const SPISettings spiSettings(20000000, MSBFIRST, SPI_MODE0); + +ENC28J60::ENC28J60(int8_t cs, SPIClass& spi, int8_t intr): + _bank(ERXTX_BANK), _cs(cs), _spi(spi) +{ + (void)intr; +} + +void +ENC28J60::enc28j60_arch_spi_select(void) +{ + SPI.beginTransaction(spiSettings); + digitalWrite(_cs, LOW); +} + +void +ENC28J60::enc28j60_arch_spi_deselect(void) +{ + digitalWrite(_cs, HIGH); + SPI.endTransaction(); +} + + +/*---------------------------------------------------------------------------*/ +uint8_t +ENC28J60::is_mac_mii_reg(uint8_t reg) +{ + /* MAC or MII register (otherwise, ETH register)? */ + switch (_bank) + { + case MACONX_BANK: + return reg < EIE; + case MAADRX_BANK: + return reg <= MAADR2 || reg == MISTAT; + case ERXTX_BANK: + case EPKTCNT_BANK: + default: + return 0; + } +} +/*---------------------------------------------------------------------------*/ +uint8_t +ENC28J60::readreg(uint8_t reg) +{ + uint8_t r; + enc28j60_arch_spi_select(); + SPI.transfer(0x00 | (reg & 0x1f)); + if (is_mac_mii_reg(reg)) + { + /* MAC and MII registers require that a dummy byte be read first. */ + SPI.transfer(0); + } + r = SPI.transfer(0); + enc28j60_arch_spi_deselect(); + return r; +} +/*---------------------------------------------------------------------------*/ +void +ENC28J60::writereg(uint8_t reg, uint8_t data) +{ + enc28j60_arch_spi_select(); + SPI.transfer(0x40 | (reg & 0x1f)); + SPI.transfer(data); + enc28j60_arch_spi_deselect(); +} +/*---------------------------------------------------------------------------*/ +void +ENC28J60::setregbitfield(uint8_t reg, uint8_t mask) +{ + if (is_mac_mii_reg(reg)) + { + writereg(reg, readreg(reg) | mask); + } + else + { + enc28j60_arch_spi_select(); + SPI.transfer(0x80 | (reg & 0x1f)); + SPI.transfer(mask); + enc28j60_arch_spi_deselect(); + } +} +/*---------------------------------------------------------------------------*/ +void +ENC28J60::clearregbitfield(uint8_t reg, uint8_t mask) +{ + if (is_mac_mii_reg(reg)) + { + writereg(reg, readreg(reg) & ~mask); + } + else + { + enc28j60_arch_spi_select(); + SPI.transfer(0xa0 | (reg & 0x1f)); + SPI.transfer(mask); + enc28j60_arch_spi_deselect(); + } +} +/*---------------------------------------------------------------------------*/ +void +ENC28J60::setregbank(uint8_t new_bank) +{ + writereg(ECON1, (readreg(ECON1) & 0xfc) | (new_bank & 0x03)); + _bank = new_bank; +} +/*---------------------------------------------------------------------------*/ +void +ENC28J60::writedata(const uint8_t *data, int datalen) +{ + int i; + enc28j60_arch_spi_select(); + /* The Write Buffer Memory (WBM) command is 0 1 1 1 1 0 1 0 */ + SPI.transfer(0x7a); + for (i = 0; i < datalen; i++) + { + SPI.transfer(data[i]); + } + enc28j60_arch_spi_deselect(); +} +/*---------------------------------------------------------------------------*/ +void +ENC28J60::writedatabyte(uint8_t byte) +{ + writedata(&byte, 1); +} +/*---------------------------------------------------------------------------*/ +int +ENC28J60::readdata(uint8_t *buf, int len) +{ + int i; + enc28j60_arch_spi_select(); + /* THe Read Buffer Memory (RBM) command is 0 0 1 1 1 0 1 0 */ + SPI.transfer(0x3a); + for (i = 0; i < len; i++) + { + buf[i] = SPI.transfer(0); + } + enc28j60_arch_spi_deselect(); + return i; +} +/*---------------------------------------------------------------------------*/ +uint8_t +ENC28J60::readdatabyte(void) +{ + uint8_t r; + readdata(&r, 1); + return r; +} + +/*---------------------------------------------------------------------------*/ +void +ENC28J60::softreset(void) +{ + enc28j60_arch_spi_select(); + /* The System Command (soft reset) is 1 1 1 1 1 1 1 1 */ + SPI.transfer(0xff); + enc28j60_arch_spi_deselect(); + _bank = ERXTX_BANK; +} + +/*---------------------------------------------------------------------------*/ +//#if DEBUG +uint8_t +ENC28J60::readrev(void) +{ + uint8_t rev; + setregbank(MAADRX_BANK); + rev = readreg(EREVID); + switch (rev) + { + case 2: + return 1; + case 6: + return 7; + default: + return rev; + } +} +//#endif + +/*---------------------------------------------------------------------------*/ + +bool +ENC28J60::reset(void) +{ + PRINTF("enc28j60: resetting chip\n"); + + pinMode(_cs, OUTPUT); + digitalWrite(_cs, HIGH); + SPI.begin(); + + /* + 6.0 INITIALIZATION + + Before the ENC28J60 can be used to transmit and receive packets, + certain device settings must be initialized. Depending on the + application, some configuration options may need to be + changed. Normally, these tasks may be accomplished once after + Reset and do not need to be changed thereafter. + + 6.1 Receive Buffer + + Before receiving any packets, the receive buffer must be + initialized by programming the ERXST and ERXND pointers. All + memory between and including the ERXST and ERXND addresses will be + dedicated to the receive hardware. It is recommended that the + ERXST pointer be programmed with an even address. + + Applications expecting large amounts of data and frequent packet + delivery may wish to allocate most of the memory as the receive + buffer. Applications that may need to save older packets or have + several packets ready for transmission should allocate less + memory. + + When programming the ERXST pointer, the ERXWRPT registers will + automatically be updated with the same values. The address in + ERXWRPT will be used as the starting location when the receive + hardware begins writing received data. For tracking purposes, the + ERXRDPT registers should additionally be programmed with the same + value. To program ERXRDPT, the host controller must write to + ERXRDPTL first, followed by ERXRDPTH. See Section 7.2.4 “Freeing + Receive Buffer Space for more information + + 6.2 Transmission Buffer + + All memory which is not used by the receive buffer is considered + the transmission buffer. Data which is to be transmitted should be + written into any unused space. After a packet is transmitted, + however, the hardware will write a seven-byte status vector into + memory after the last byte in the packet. Therefore, the host + controller should leave at least seven bytes between each packet + and the beginning of the receive buffer. No explicit action is + required to initialize the transmission buffer. + + 6.3 Receive Filters + + The appropriate receive filters should be enabled or disabled by + writing to the ERXFCON register. See Section 8.0 “Receive Filters + for information on how to configure it. + + 6.4 Waiting For OST + + If the initialization procedure is being executed immediately + following a Power-on Reset, the ESTAT.CLKRDY bit should be polled + to make certain that enough time has elapsed before proceeding to + modify the MAC and PHY registers. For more information on the OST, + see Section 2.2 “Oscillator Start-up Timer. + */ + + softreset(); + + /* Workaround for erratum #2. */ + delayMicroseconds(1000); + + /* Wait for OST */ + PRINTF("waiting for ESTAT_CLKRDY\n"); + while ((readreg(ESTAT) & ESTAT_CLKRDY) == 0) {}; + PRINTF("ESTAT_CLKRDY\n"); + + setregbank(ERXTX_BANK); + /* Set up receive buffer */ + writereg(ERXSTL, RX_BUF_START & 0xff); + writereg(ERXSTH, RX_BUF_START >> 8); + writereg(ERXNDL, RX_BUF_END & 0xff); + writereg(ERXNDH, RX_BUF_END >> 8); + writereg(ERDPTL, RX_BUF_START & 0xff); + writereg(ERDPTH, RX_BUF_START >> 8); + writereg(ERXRDPTL, RX_BUF_END & 0xff); + writereg(ERXRDPTH, RX_BUF_END >> 8); + + /* Receive filters */ + setregbank(EPKTCNT_BANK); + writereg(ERXFCON, ERXFCON_UCEN | ERXFCON_CRCEN | ERXFCON_MCEN); + + /* + 6.5 MAC Initialization Settings + + Several of the MAC registers require configuration during + initialization. This only needs to be done once; the order of + programming is unimportant. + + 1. Set the MARXEN bit in MACON1 to enable the MAC to receive + frames. If using full duplex, most applications should also set + TXPAUS and RXPAUS to allow IEEE defined flow control to function. + + 2. Configure the PADCFG, TXCRCEN and FULDPX bits of MACON3. Most + applications should enable automatic padding to at least 60 bytes + and always append a valid CRC. For convenience, many applications + may wish to set the FRMLNEN bit as well to enable frame length + status reporting. The FULDPX bit should be set if the application + will be connected to a full-duplex configured remote node; + otherwise, it should be left clear. + + 3. Configure the bits in MACON4. For conformance to the IEEE 802.3 + standard, set the DEFER bit. + + 4. Program the MAMXFL registers with the maximum frame length to + be permitted to be received or transmitted. Normal network nodes + are designed to handle packets that are 1518 bytes or less. + + 5. Configure the Back-to-Back Inter-Packet Gap register, + MABBIPG. Most applications will program this register with 15h + when Full-Duplex mode is used and 12h when Half-Duplex mode is + used. + + 6. Configure the Non-Back-to-Back Inter-Packet Gap register low + byte, MAIPGL. Most applications will program this register with + 12h. + + 7. If half duplex is used, the Non-Back-to-Back Inter-Packet Gap + register high byte, MAIPGH, should be programmed. Most + applications will program this register to 0Ch. + + 8. If Half-Duplex mode is used, program the Retransmission and + Collision Window registers, MACLCON1 and MACLCON2. Most + applications will not need to change the default Reset values. If + the network is spread over exceptionally long cables, the default + value of MACLCON2 may need to be increased. + + 9. Program the local MAC address into the MAADR1:MAADR6 registers. + */ + + setregbank(MACONX_BANK); + + /* Turn on reception and IEEE-defined flow control */ + setregbitfield(MACON1, MACON1_MARXEN | MACON1_TXPAUS | MACON1_RXPAUS); + + /* Set padding, crc, full duplex */ + setregbitfield(MACON3, MACON3_PADCFG_FULL | MACON3_TXCRCEN | MACON3_FULDPX | + MACON3_FRMLNEN); + + /* Don't modify MACON4 */ + + /* Set maximum frame length in MAMXFL */ + writereg(MAMXFLL, MAX_MAC_LENGTH & 0xff); + writereg(MAMXFLH, MAX_MAC_LENGTH >> 8); + + /* Set back-to-back inter packet gap */ + writereg(MABBIPG, 0x15); + + /* Set non-back-to-back packet gap */ + writereg(MAIPGL, 0x12); + + /* Set MAC address */ + setregbank(MAADRX_BANK); + writereg(MAADR6, _localMac[5]); + writereg(MAADR5, _localMac[4]); + writereg(MAADR4, _localMac[3]); + writereg(MAADR3, _localMac[2]); + writereg(MAADR2, _localMac[1]); + writereg(MAADR1, _localMac[0]); + + /* + 6.6 PHY Initialization Settings + + Depending on the application, bits in three of the PHY module’s + registers may also require configuration. The PHCON1.PDPXMD bit + partially controls the device’s half/full-duplex + configuration. Normally, this bit is initialized correctly by the + external circuitry (see Section 2.6 “LED Configuration). If the + external circuitry is not present or incorrect, however, the host + controller must program the bit properly. Alternatively, for an + externally configurable system, the PDPXMD bit may be read and the + FULDPX bit be programmed to match. + + For proper duplex operation, the PHCON1.PDPXMD bit must also match + the value of the MACON3.FULDPX bit. + + If using half duplex, the host controller may wish to set the + PHCON2.HDLDIS bit to prevent automatic loopback of the data which + is transmitted. The PHY register, PHLCON, controls the outputs of + LEDA and LEDB. If an application requires a LED configuration + other than the default, PHLCON must be altered to match the new + requirements. The settings for LED operation are discussed in + Section 2.6 “LED Configuration. The PHLCON register is shown in + Register 2-2 (page 9). + */ + + /* Don't worry about PHY configuration for now */ + + /* Turn on autoincrement for buffer access */ + setregbitfield(ECON2, ECON2_AUTOINC); + + /* Turn on reception */ + writereg(ECON1, ECON1_RXEN); + + return true; +} +/*---------------------------------------------------------------------------*/ +boolean +ENC28J60::begin(const uint8_t *address) +{ + _localMac = address; + + bool ret = reset(); + uint8_t rev = readrev(); + + PRINTF("ENC28J60 rev. B%d\n", rev); + + return ret && rev != 255; +} + +/*---------------------------------------------------------------------------*/ + +uint16_t +ENC28J60::sendFrame(const uint8_t *data, uint16_t datalen) +{ + uint16_t dataend; + + /* + 1. Appropriately program the ETXST pointer to point to an unused + location in memory. It will point to the per packet control + byte. In the example, it would be programmed to 0120h. It is + recommended that an even address be used for ETXST. + + 2. Use the WBM SPI command to write the per packet control byte, + the destination address, the source MAC address, the + type/length and the data payload. + + 3. Appropriately program the ETXND pointer. It should point to the + last byte in the data payload. In the example, it would be + programmed to 0156h. + + 4. Clear EIR.TXIF, set EIE.TXIE and set EIE.INTIE to enable an + interrupt when done (if desired). + + 5. Start the transmission process by setting + ECON1.TXRTS. + */ + + setregbank(ERXTX_BANK); + /* Set up the transmit buffer pointer */ + writereg(ETXSTL, TX_BUF_START & 0xff); + writereg(ETXSTH, TX_BUF_START >> 8); + writereg(EWRPTL, TX_BUF_START & 0xff); + writereg(EWRPTH, TX_BUF_START >> 8); + + /* Write the transmission control register as the first byte of the + output packet. We write 0x00 to indicate that the default + configuration (the values in MACON3) will be used. */ + writedatabyte(0x00); /* MACON3 */ + + writedata(data, datalen); + + /* Write a pointer to the last data byte. */ + dataend = TX_BUF_START + datalen; + writereg(ETXNDL, dataend & 0xff); + writereg(ETXNDH, dataend >> 8); + + /* Clear EIR.TXIF */ + clearregbitfield(EIR, EIR_TXIF); + + /* Don't care about interrupts for now */ + + /* Send the packet */ + setregbitfield(ECON1, ECON1_TXRTS); + while ((readreg(ECON1) & ECON1_TXRTS) > 0); + +#if DEBUG + if ((readreg(ESTAT) & ESTAT_TXABRT) != 0) + { + uint16_t erdpt; + uint8_t tsv[7]; + erdpt = (readreg(ERDPTH) << 8) | readreg(ERDPTL); + writereg(ERDPTL, (dataend + 1) & 0xff); + writereg(ERDPTH, (dataend + 1) >> 8); + readdata(tsv, sizeof(tsv)); + writereg(ERDPTL, erdpt & 0xff); + writereg(ERDPTH, erdpt >> 8); + PRINTF("enc28j60: tx err: %d: %02x:%02x:%02x:%02x:%02x:%02x\n" + " tsv: %02x%02x%02x%02x%02x%02x%02x\n", datalen, + 0xff & data[0], 0xff & data[1], 0xff & data[2], + 0xff & data[3], 0xff & data[4], 0xff & data[5], + tsv[6], tsv[5], tsv[4], tsv[3], tsv[2], tsv[1], tsv[0]); + } + else + { + PRINTF("enc28j60: tx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", datalen, + 0xff & data[0], 0xff & data[1], 0xff & data[2], + 0xff & data[3], 0xff & data[4], 0xff & data[5]); + } +#endif + + //sent_packets++; + //PRINTF("enc28j60: sent_packets %d\n", sent_packets); + return datalen; +} + +/*---------------------------------------------------------------------------*/ + +uint16_t +ENC28J60::readFrame(uint8_t *buffer, uint16_t bufsize) +{ + readFrameSize(); + return readFrameData(buffer, bufsize); +} + +uint16_t +ENC28J60::readFrameSize() +{ + uint8_t n; + + uint8_t nxtpkt[2]; + uint8_t status[2]; + uint8_t length[2]; + + setregbank(EPKTCNT_BANK); + n = readreg(EPKTCNT); + + if (n == 0) + { + return 0; + } + + PRINTF("enc28j60: EPKTCNT 0x%02x\n", n); + + setregbank(ERXTX_BANK); + /* Read the next packet pointer */ + nxtpkt[0] = readdatabyte(); + nxtpkt[1] = readdatabyte(); + _next = (nxtpkt[1] << 8) + nxtpkt[0]; + + PRINTF("enc28j60: nxtpkt 0x%02x%02x\n", _nxtpkt[1], _nxtpkt[0]); + + length[0] = readdatabyte(); + length[1] = readdatabyte(); + _len = (length[1] << 8) + length[0]; + + PRINTF("enc28j60: length 0x%02x%02x\n", length[1], length[0]); + + status[0] = readdatabyte(); + status[1] = readdatabyte(); + + /* This statement is just to avoid a compiler warning: */ + (void)status[0]; + PRINTF("enc28j60: status 0x%02x%02x\n", status[1], status[0]); + + return _len; +} + +void +ENC28J60::discardFrame(uint16_t framesize) +{ + (void)framesize; + (void)readFrameData(nullptr, 0); +} + +uint16_t +ENC28J60::readFrameData(uint8_t *buffer, uint16_t framesize) +{ + if (framesize < _len) + { + + buffer = nullptr; + + /* flush rx fifo */ + for (uint16_t i = 0; i < _len; i++) + { + readdatabyte(); + } + } + else + { + readdata(buffer, _len); + } + + /* Read an additional byte at odd lengths, to avoid FIFO corruption */ + if ((_len % 2) != 0) + { + readdatabyte(); + } + + /* Errata #14 */ + if (_next == RX_BUF_START) + { + _next = RX_BUF_END; + } + else + { + _next = _next - 1; + } + writereg(ERXRDPTL, _next & 0xff); + writereg(ERXRDPTH, _next >> 8); + + setregbitfield(ECON2, ECON2_PKTDEC); + + if (!buffer) + { + PRINTF("enc28j60: rx err: flushed %d\n", _len); + return 0; + } + PRINTF("enc28j60: rx: %d: %02x:%02x:%02x:%02x:%02x:%02x\n", _len, + 0xff & buffer[0], 0xff & buffer[1], 0xff & buffer[2], + 0xff & buffer[3], 0xff & buffer[4], 0xff & buffer[5]); + + //received_packets++; + //PRINTF("enc28j60: received_packets %d\n", received_packets); + + return _len; +} diff --git a/libraries/lwIP_enc28j60/src/utility/enc28j60.h b/libraries/lwIP_enc28j60/src/utility/enc28j60.h new file mode 100644 index 000000000..054503902 --- /dev/null +++ b/libraries/lwIP_enc28j60/src/utility/enc28j60.h @@ -0,0 +1,149 @@ +/** + Header file for direct Ethernet frame access to the ENC28J60 controller + @file enc28j60.h +*/ + +/* + Copyright (c) 2012-2013, Thingsquare, http://www.thingsquare.com/. + All rights reserved. + + 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. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``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 + COPYRIGHT HOLDER OR CONTRIBUTORS 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. + +*/ + +// original sources: https://github.com/njh/EtherSia/tree/master/src/enc28j60.h + +#ifndef ENC28J60_H +#define ENC28J60_H + +#include + +/** + Send and receive Ethernet frames directly using a ENC28J60 controller. +*/ +class ENC28J60 +{ + +public: + /** + Constructor that uses the default hardware SPI pins + @param cs the Arduino Chip Select / Slave Select pin (default 10 on Uno) + */ + ENC28J60(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1); + + /** + Initialise the Ethernet controller + Must be called before sending or receiving Ethernet frames + + @param address the local MAC address for the Ethernet interface + @return Returns true if setting up the Ethernet interface was successful + */ + boolean begin(const uint8_t *address); + + /** + Send an Ethernet frame + @param data a pointer to the data to send + @param datalen the length of the data in the packet + @return the number of bytes transmitted + */ + virtual uint16_t sendFrame(const uint8_t *data, uint16_t datalen); + + /** + Read an Ethernet frame + @param buffer a pointer to a buffer to write the packet to + @param bufsize the available space in the buffer + @return the length of the received packet + or 0 if no packet was received + */ + virtual uint16_t readFrame(uint8_t *buffer, uint16_t bufsize); + +protected: + + static constexpr bool interruptIsPossible() + { + return false; + } + + /** + Read an Ethernet frame size + @return the length of data do receive + or 0 if no frame was received + */ + uint16_t readFrameSize(); + + /** + discard an Ethernet frame + @param framesize readFrameSize()'s result + */ + void discardFrame(uint16_t framesize); + + /** + Read an Ethernet frame data + readFrameSize() must be called first, + its result must be passed into framesize parameter + @param buffer a pointer to a buffer to write the frame to + @param framesize readFrameSize()'s result + @return the length of the received frame + or 0 if a problem occured + */ + uint16_t readFrameData(uint8_t *frame, uint16_t framesize); + +private: + + uint8_t is_mac_mii_reg(uint8_t reg); + uint8_t readreg(uint8_t reg); + void writereg(uint8_t reg, uint8_t data); + void setregbitfield(uint8_t reg, uint8_t mask); + void clearregbitfield(uint8_t reg, uint8_t mask); + void setregbank(uint8_t new_bank); + void writedata(const uint8_t *data, int datalen); + void writedatabyte(uint8_t byte); + int readdata(uint8_t *buf, int len); + uint8_t readdatabyte(void); + void softreset(void); + uint8_t readrev(void); + bool reset(void); + + void enc28j60_arch_spi_init(void); + uint8_t enc28j60_arch_spi_write(uint8_t data); + uint8_t enc28j60_arch_spi_read(void); + void enc28j60_arch_spi_select(void); + void enc28j60_arch_spi_deselect(void); + + // Previously defined in contiki/core/sys/clock.h + void clock_delay_usec(uint16_t dt); + + uint8_t _bank; + int8_t _cs; + SPIClass& _spi; + + const uint8_t *_localMac; + + /* readFrame*() state */ + uint16_t _next, _len; +}; + +#endif /* ENC28J60_H */ diff --git a/libraries/lwIP_w5100/library.properties b/libraries/lwIP_w5100/library.properties new file mode 100644 index 000000000..b65d4fdb6 --- /dev/null +++ b/libraries/lwIP_w5100/library.properties @@ -0,0 +1,10 @@ +name=lwIP_w5500 +version=1 +author=Nicholas Humfrey +maintainer=esp8266/Arduino +sentence=Ethernet driver +paragraph=Wiznet5100 ethernet drivers for lwIP and esp8266 Arduino from https://github.com/njh/W5100MacRaw +category=Network +url=https://github.com/esp8266/Arduino +architectures=esp8266 +dot_a_linkage=true diff --git a/libraries/lwIP_w5100/src/W5100lwIP.h b/libraries/lwIP_w5100/src/W5100lwIP.h new file mode 100644 index 000000000..c8f549529 --- /dev/null +++ b/libraries/lwIP_w5100/src/W5100lwIP.h @@ -0,0 +1,10 @@ + +#ifndef _W5100LWIP_H +#define _W5100LWIP_H + +#include +#include + +using Wiznet5100lwIP = LwipIntfDev; + +#endif // _W5500LWIP_H diff --git a/libraries/lwIP_w5100/src/utility/w5100.cpp b/libraries/lwIP_w5100/src/utility/w5100.cpp new file mode 100644 index 000000000..6377aa5b6 --- /dev/null +++ b/libraries/lwIP_w5100/src/utility/w5100.cpp @@ -0,0 +1,369 @@ +/* + Copyright (c) 2013, WIZnet Co., Ltd. + Copyright (c) 2016, Nicholas Humfrey + All rights reserved. + + 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. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``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 + COPYRIGHT HOLDER OR CONTRIBUTORS 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. + +*/ + +// original sources: https://github.com/njh/W5100MacRaw + +#include +#include "w5100.h" + + +uint8_t Wiznet5100::wizchip_read(uint16_t address) +{ + uint8_t ret; + + wizchip_cs_select(); + _spi.transfer(0x0F); + _spi.transfer((address & 0xFF00) >> 8); + _spi.transfer((address & 0x00FF) >> 0); + ret = _spi.transfer(0); + wizchip_cs_deselect(); + + return ret; +} + +uint16_t Wiznet5100::wizchip_read_word(uint16_t address) +{ + return ((uint16_t)wizchip_read(address) << 8) + wizchip_read(address + 1); +} + + +void Wiznet5100::wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len) +{ + for (uint16_t i = 0; i < len; i++) + { + pBuf[i] = wizchip_read(address + i); + } +} + +void Wiznet5100::wizchip_write(uint16_t address, uint8_t wb) +{ + wizchip_cs_select(); + _spi.transfer(0xF0); + _spi.transfer((address & 0xFF00) >> 8); + _spi.transfer((address & 0x00FF) >> 0); + _spi.transfer(wb); // Data write (write 1byte data) + wizchip_cs_deselect(); +} + +void Wiznet5100::wizchip_write_word(uint16_t address, uint16_t word) +{ + wizchip_write(address, (uint8_t)(word >> 8)); + wizchip_write(address + 1, (uint8_t) word); +} + +void Wiznet5100::wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len) +{ + for (uint16_t i = 0; i < len; i++) + { + wizchip_write(address + i, pBuf[i]); + } +} + +void Wiznet5100::setSn_CR(uint8_t cr) +{ + // Write the command to the Command Register + wizchip_write(Sn_CR, cr); + + // Now wait for the command to complete + while (wizchip_read(Sn_CR)); +} + +uint16_t Wiznet5100::getSn_TX_FSR() +{ + uint16_t val = 0, val1 = 0; + do + { + val1 = wizchip_read_word(Sn_TX_FSR); + if (val1 != 0) + { + val = wizchip_read_word(Sn_TX_FSR); + } + } while (val != val1); + return val; +} + + +uint16_t Wiznet5100::getSn_RX_RSR() +{ + uint16_t val = 0, val1 = 0; + do + { + val1 = wizchip_read_word(Sn_RX_RSR); + if (val1 != 0) + { + val = wizchip_read_word(Sn_RX_RSR); + } + } while (val != val1); + return val; +} + +void Wiznet5100::wizchip_send_data(const uint8_t *wizdata, uint16_t len) +{ + uint16_t ptr; + uint16_t size; + uint16_t dst_mask; + uint16_t dst_ptr; + + ptr = getSn_TX_WR(); + + dst_mask = ptr & TxBufferMask; + dst_ptr = TxBufferAddress + dst_mask; + + if (dst_mask + len > TxBufferLength) + { + size = TxBufferLength - dst_mask; + wizchip_write_buf(dst_ptr, wizdata, size); + wizdata += size; + size = len - size; + dst_ptr = TxBufferAddress; + wizchip_write_buf(dst_ptr, wizdata, size); + } + else + { + wizchip_write_buf(dst_ptr, wizdata, len); + } + + ptr += len; + + setSn_TX_WR(ptr); +} + +void Wiznet5100::wizchip_recv_data(uint8_t *wizdata, uint16_t len) +{ + uint16_t ptr; + uint16_t size; + uint16_t src_mask; + uint16_t src_ptr; + + ptr = getSn_RX_RD(); + + src_mask = ptr & RxBufferMask; + src_ptr = RxBufferAddress + src_mask; + + + if ((src_mask + len) > RxBufferLength) + { + size = RxBufferLength - src_mask; + wizchip_read_buf(src_ptr, wizdata, size); + wizdata += size; + size = len - size; + src_ptr = RxBufferAddress; + wizchip_read_buf(src_ptr, wizdata, size); + } + else + { + wizchip_read_buf(src_ptr, wizdata, len); + } + + ptr += len; + + setSn_RX_RD(ptr); +} + +void Wiznet5100::wizchip_recv_ignore(uint16_t len) +{ + uint16_t ptr; + + ptr = getSn_RX_RD(); + ptr += len; + setSn_RX_RD(ptr); +} + +void Wiznet5100::wizchip_sw_reset() +{ + setMR(MR_RST); + getMR(); // for delay + + setSHAR(_mac_address); +} + + +Wiznet5100::Wiznet5100(int8_t cs, SPIClass& spi, int8_t intr): + _spi(spi), _cs(cs) +{ + (void)intr; +} + +boolean Wiznet5100::begin(const uint8_t *mac_address) +{ + memcpy(_mac_address, mac_address, 6); + + pinMode(_cs, OUTPUT); + wizchip_cs_deselect(); + +#if 0 + _spi.begin(); + _spi.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz? + _spi.setBitOrder(MSBFIRST); + _spi.setDataMode(SPI_MODE0); +#endif + + wizchip_sw_reset(); + + // Set the size of the Rx and Tx buffers + wizchip_write(RMSR, RxBufferSize); + wizchip_write(TMSR, TxBufferSize); + + // Set our local MAC address + setSHAR(_mac_address); + + // Open Socket 0 in MACRaw mode + setSn_MR(Sn_MR_MACRAW); + setSn_CR(Sn_CR_OPEN); + if (getSn_SR() != SOCK_MACRAW) + { + // Failed to put socket 0 into MACRaw mode + return false; + } + + // Success + return true; +} + +void Wiznet5100::end() +{ + setSn_CR(Sn_CR_CLOSE); + + // clear all interrupt of the socket + setSn_IR(0xFF); + + // Wait for socket to change to closed + while (getSn_SR() != SOCK_CLOSED); +} + +uint16_t Wiznet5100::readFrame(uint8_t *buffer, uint16_t bufsize) +{ + uint16_t data_len = readFrameSize(); + + if (data_len == 0) + { + return 0; + } + + if (data_len > bufsize) + { + // Packet is bigger than buffer - drop the packet + discardFrame(data_len); + return 0; + } + + return readFrameData(buffer, data_len); +} + +uint16_t Wiznet5100::readFrameSize() +{ + uint16_t len = getSn_RX_RSR(); + + if (len == 0) + { + return 0; + } + + uint8_t head[2]; + uint16_t data_len = 0; + + wizchip_recv_data(head, 2); + setSn_CR(Sn_CR_RECV); + + data_len = head[0]; + data_len = (data_len << 8) + head[1]; + data_len -= 2; + + return data_len; +} + +void Wiznet5100::discardFrame(uint16_t framesize) +{ + wizchip_recv_ignore(framesize); + setSn_CR(Sn_CR_RECV); +} + +uint16_t Wiznet5100::readFrameData(uint8_t *buffer, uint16_t framesize) +{ + wizchip_recv_data(buffer, framesize); + setSn_CR(Sn_CR_RECV); + +#if 1 + // let lwIP deal with mac address filtering + return framesize; +#else + // W5100 doesn't have any built-in MAC address filtering + if ((buffer[0] & 0x01) || memcmp(&buffer[0], _mac_address, 6) == 0) + { + // Addressed to an Ethernet multicast address or our unicast address + return framesize; + } + else + { + return 0; + } +#endif +} + +uint16_t Wiznet5100::sendFrame(const uint8_t *buf, uint16_t len) +{ + // Wait for space in the transmit buffer + while (1) + { + uint16_t freesize = getSn_TX_FSR(); + if (getSn_SR() == SOCK_CLOSED) + { + return -1; + } + if (len <= freesize) + { + break; + } + }; + + wizchip_send_data(buf, len); + setSn_CR(Sn_CR_SEND); + + while (1) + { + uint8_t tmp = getSn_IR(); + if (tmp & Sn_IR_SENDOK) + { + setSn_IR(Sn_IR_SENDOK); + // Packet sent ok + break; + } + else if (tmp & Sn_IR_TIMEOUT) + { + setSn_IR(Sn_IR_TIMEOUT); + // There was a timeout + return -1; + } + } + + return len; +} diff --git a/libraries/lwIP_w5100/src/utility/w5100.h b/libraries/lwIP_w5100/src/utility/w5100.h new file mode 100644 index 000000000..300cb334a --- /dev/null +++ b/libraries/lwIP_w5100/src/utility/w5100.h @@ -0,0 +1,499 @@ +/* + Copyright (c) 2013, WIZnet Co., Ltd. + Copyright (c) 2016, Nicholas Humfrey + All rights reserved. + + 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. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``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 + COPYRIGHT HOLDER OR CONTRIBUTORS 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. + +*/ + +// original sources: https://github.com/njh/W5100MacRaw + +#ifndef W5100_H +#define W5100_H + +#include +#include +#include + + +class Wiznet5100 +{ + +public: + /** + Constructor that uses the default hardware SPI pins + @param cs the Arduino Chip Select / Slave Select pin (default 10) + */ + Wiznet5100(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1); + + /** + Initialise the Ethernet controller + Must be called before sending or receiving Ethernet frames + + @param address the local MAC address for the Ethernet interface + @return Returns true if setting up the Ethernet interface was successful + */ + boolean begin(const uint8_t *address); + + /** + Shut down the Ethernet controlled + */ + void end(); + + /** + Send an Ethernet frame + @param data a pointer to the data to send + @param datalen the length of the data in the packet + @return the number of bytes transmitted + */ + uint16_t sendFrame(const uint8_t *data, uint16_t datalen); + + /** + Read an Ethernet frame + @param buffer a pointer to a buffer to write the packet to + @param bufsize the available space in the buffer + @return the length of the received packet + or 0 if no packet was received + */ + uint16_t readFrame(uint8_t *buffer, uint16_t bufsize); + +protected: + + static constexpr bool interruptIsPossible() + { + return false; + } + + /** + Read an Ethernet frame size + @return the length of data do receive + or 0 if no frame was received + */ + uint16_t readFrameSize(); + + /** + discard an Ethernet frame + @param framesize readFrameSize()'s result + */ + void discardFrame(uint16_t framesize); + + /** + Read an Ethernet frame data + readFrameSize() must be called first, + its result must be passed into framesize parameter + @param buffer a pointer to a buffer to write the frame to + @param framesize readFrameSize()'s result + @return the length of the received frame + or 0 if a problem occured + */ + uint16_t readFrameData(uint8_t *frame, uint16_t framesize); + + +private: + static const uint16_t TxBufferAddress = 0x4000; /* Internal Tx buffer address of the iinchip */ + static const uint16_t RxBufferAddress = 0x6000; /* Internal Rx buffer address of the iinchip */ + static const uint8_t TxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */ + static const uint8_t RxBufferSize = 0x3; /* Buffer size configuration: 0=1kb, 1=2kB, 2=4kB, 3=8kB */ + static const uint16_t TxBufferLength = (1 << TxBufferSize) << 10; /* Length of Tx buffer in bytes */ + static const uint16_t RxBufferLength = (1 << RxBufferSize) << 10; /* Length of Rx buffer in bytes */ + static const uint16_t TxBufferMask = TxBufferLength - 1; + static const uint16_t RxBufferMask = RxBufferLength - 1; + + + SPIClass& _spi; + int8_t _cs; + uint8_t _mac_address[6]; + + /** + Default function to select chip. + @note This function help not to access wrong address. If you do not describe this function or register any functions, + null function is called. + */ + inline void wizchip_cs_select() + { + digitalWrite(_cs, LOW); + } + + /** + Default function to deselect chip. + @note This function help not to access wrong address. If you do not describe this function or register any functions, + null function is called. + */ + inline void wizchip_cs_deselect() + { + digitalWrite(_cs, HIGH); + } + + /** + Read a 1 byte value from a register. + @param address Register address + @return The value of register + */ + uint8_t wizchip_read(uint16_t address); + + /** + Reads a 2 byte value from a register. + @param address Register address + @return The value of register + */ + uint16_t wizchip_read_word(uint16_t address); + + /** + It reads sequence data from registers. + @param address Register address + @param pBuf Pointer buffer to read data + @param len Data length + */ + void wizchip_read_buf(uint16_t address, uint8_t* pBuf, uint16_t len); + + /** + Write a 1 byte value to a register. + @param address Register address + @param wb Write data + @return void + */ + void wizchip_write(uint16_t address, uint8_t wb); + + /** + Write a 2 byte value to a register. + @param address Register address + @param wb Write data + @return void + */ + void wizchip_write_word(uint16_t address, uint16_t word); + + /** + It writes sequence data to registers. + @param address Register address + @param pBuf Pointer buffer to write data + @param len Data length + */ + void wizchip_write_buf(uint16_t address, const uint8_t* pBuf, uint16_t len); + + + /** + Reset WIZCHIP by softly. + */ + void wizchip_sw_reset(void); + + /** + It copies data to internal TX memory + + @details This function reads the Tx write pointer register and after that, + it copies the wizdata(pointer buffer) of the length of len(variable) bytes to internal TX memory + and updates the Tx write pointer register. + This function is being called by send() and sendto() function also. + + @param wizdata Pointer buffer to write data + @param len Data length + @sa wizchip_recv_data() + */ + void wizchip_send_data(const uint8_t *wizdata, uint16_t len); + + /** + It copies data to your buffer from internal RX memory + + @details This function read the Rx read pointer register and after that, + it copies the received data from internal RX memory + to wizdata(pointer variable) of the length of len(variable) bytes. + This function is being called by recv() also. + + @param wizdata Pointer buffer to read data + @param len Data length + @sa wizchip_send_data() + */ + void wizchip_recv_data(uint8_t *wizdata, uint16_t len); + + /** + It discard the received data in RX memory. + @details It discards the data of the length of len(variable) bytes in internal RX memory. + @param len Data length + */ + void wizchip_recv_ignore(uint16_t len); + + /** + Get @ref Sn_TX_FSR register + @return uint16_t. Value of @ref Sn_TX_FSR. + */ + uint16_t getSn_TX_FSR(); + + /** + Get @ref Sn_RX_RSR register + @return uint16_t. Value of @ref Sn_RX_RSR. + */ + uint16_t getSn_RX_RSR(); + + + /** Common registers */ + enum + { + MR = 0x0000, ///< Mode Register address (R/W) + GAR = 0x0001, ///< Gateway IP Register address (R/W) + SUBR = 0x0005, ///< Subnet mask Register address (R/W) + SHAR = 0x0009, ///< Source MAC Register address (R/W) + SIPR = 0x000F, ///< Source IP Register address (R/W) + IR = 0x0015, ///< Interrupt Register (R/W) + IMR = 0x0016, ///< Socket Interrupt Mask Register (R/W) + RTR = 0x0017, ///< Timeout register address (1 is 100us) (R/W) + RCR = 0x0019, ///< Retry count register (R/W) + RMSR = 0x001A, ///< Receive Memory Size + TMSR = 0x001B, ///< Transmit Memory Size + }; + + /** Socket registers */ + enum + { + Sn_MR = 0x0400, ///< Socket Mode register(R/W) + Sn_CR = 0x0401, ///< Socket command register (R/W) + Sn_IR = 0x0402, ///< Socket interrupt register (R) + Sn_SR = 0x0403, ///< Socket status register (R) + Sn_PORT = 0x0404, ///< Source port register (R/W) + Sn_DHAR = 0x0406, ///< Peer MAC register address (R/W) + Sn_DIPR = 0x040C, ///< Peer IP register address (R/W) + Sn_DPORT = 0x0410, ///< Peer port register address (R/W) + Sn_MSSR = 0x0412, ///< Maximum Segment Size(Sn_MSSR0) register address (R/W) + Sn_PROTO = 0x0414, ///< IP Protocol(PROTO) Register (R/W) + Sn_TOS = 0x0415, ///< IP Type of Service(TOS) Register (R/W) + Sn_TTL = 0x0416, ///< IP Time to live(TTL) Register (R/W) + Sn_TX_FSR = 0x0420, ///< Transmit free memory size register (R) + Sn_TX_RD = 0x0422, ///< Transmit memory read pointer register address (R) + Sn_TX_WR = 0x0424, ///< Transmit memory write pointer register address (R/W) + Sn_RX_RSR = 0x0426, ///< Received data size register (R) + Sn_RX_RD = 0x0428, ///< Read point of Receive memory (R/W) + Sn_RX_WR = 0x042A, ///< Write point of Receive memory (R) + }; + + /** Mode register values */ + enum + { + MR_RST = 0x80, ///< Reset + MR_PB = 0x10, ///< Ping block + MR_AI = 0x02, ///< Address Auto-Increment in Indirect Bus Interface + MR_IND = 0x01, ///< Indirect Bus Interface mode + }; + + /** Socket Mode Register values @ref Sn_MR */ + enum + { + Sn_MR_CLOSE = 0x00, ///< Unused socket + Sn_MR_TCP = 0x01, ///< TCP + Sn_MR_UDP = 0x02, ///< UDP + Sn_MR_IPRAW = 0x03, ///< IP LAYER RAW SOCK + Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK + Sn_MR_ND = 0x20, ///< No Delayed Ack(TCP) flag + Sn_MR_MF = 0x40, ///< Use MAC filter + Sn_MR_MULTI = 0x80, ///< support multicating + }; + + /** Socket Command Register values */ + enum + { + Sn_CR_OPEN = 0x01, ///< Initialise or open socket + Sn_CR_CLOSE = 0x10, ///< Close socket + Sn_CR_SEND = 0x20, ///< Update TX buffer pointer and send data + Sn_CR_SEND_MAC = 0x21, ///< Send data with MAC address, so without ARP process + Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message + Sn_CR_RECV = 0x40, ///< Update RX buffer pointer and receive data + }; + + /** Socket Interrupt register values */ + enum + { + Sn_IR_CON = 0x01, ///< CON Interrupt + Sn_IR_DISCON = 0x02, ///< DISCON Interrupt + Sn_IR_RECV = 0x04, ///< RECV Interrupt + Sn_IR_TIMEOUT = 0x08, ///< TIMEOUT Interrupt + Sn_IR_SENDOK = 0x10, ///< SEND_OK Interrupt + }; + + /** Socket Status Register values */ + enum + { + SOCK_CLOSED = 0x00, ///< Closed + SOCK_INIT = 0x13, ///< Initiate state + SOCK_LISTEN = 0x14, ///< Listen state + SOCK_SYNSENT = 0x15, ///< Connection state + SOCK_SYNRECV = 0x16, ///< Connection state + SOCK_ESTABLISHED = 0x17, ///< Success to connect + SOCK_FIN_WAIT = 0x18, ///< Closing state + SOCK_CLOSING = 0x1A, ///< Closing state + SOCK_TIME_WAIT = 0x1B, ///< Closing state + SOCK_CLOSE_WAIT = 0x1C, ///< Closing state + SOCK_LAST_ACK = 0x1D, ///< Closing state + SOCK_UDP = 0x22, ///< UDP socket + SOCK_IPRAW = 0x32, ///< IP raw mode socket + SOCK_MACRAW = 0x42, ///< MAC raw mode socket + }; + + /** + Set Mode Register + @param (uint8_t)mr The value to be set. + @sa getMR() + */ + inline void setMR(uint8_t mode) + { + wizchip_write(MR, mode); + } + + /** + Get Mode Register + @return uint8_t. The value of Mode register. + @sa setMR() + */ + inline uint8_t getMR() + { + return wizchip_read(MR); + } + + /** + Set local MAC address + @param (uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6 bytes. + @sa getSHAR() + */ + inline void setSHAR(const uint8_t* macaddr) + { + wizchip_write_buf(SHAR, macaddr, 6); + } + + /** + Get local MAC address + @param (uint8_t*)shar Pointer variable to get local MAC address. It should be allocated 6 bytes. + @sa setSHAR() + */ + inline void getSHAR(uint8_t* macaddr) + { + wizchip_read_buf(SHAR, macaddr, 6); + } + + /** + Get @ref Sn_TX_WR register + @param (uint16_t)txwr Value to set @ref Sn_TX_WR + @sa GetSn_TX_WR() + */ + inline uint16_t getSn_TX_WR() + { + return wizchip_read_word(Sn_TX_WR); + } + + /** + Set @ref Sn_TX_WR register + @param (uint16_t)txwr Value to set @ref Sn_TX_WR + @sa GetSn_TX_WR() + */ + inline void setSn_TX_WR(uint16_t txwr) + { + wizchip_write_word(Sn_TX_WR, txwr); + } + + /** + Get @ref Sn_RX_RD register + @regurn uint16_t. Value of @ref Sn_RX_RD. + @sa setSn_RX_RD() + */ + inline uint16_t getSn_RX_RD() + { + return wizchip_read_word(Sn_RX_RD); + } + + /** + Set @ref Sn_RX_RD register + @param (uint16_t)rxrd Value to set @ref Sn_RX_RD + @sa getSn_RX_RD() + */ + inline void setSn_RX_RD(uint16_t rxrd) + { + wizchip_write_word(Sn_RX_RD, rxrd); + } + + /** + Set @ref Sn_MR register + @param (uint8_t)mr Value to set @ref Sn_MR + @sa getSn_MR() + */ + inline void setSn_MR(uint8_t mr) + { + wizchip_write(Sn_MR, mr); + } + + /** + Get @ref Sn_MR register + @return uint8_t. Value of @ref Sn_MR. + @sa setSn_MR() + */ + inline uint8_t getSn_MR() + { + return wizchip_read(Sn_MR); + } + + /** + Set @ref Sn_CR register, then wait for the command to execute + @param (uint8_t)cr Value to set @ref Sn_CR + @sa getSn_CR() + */ + void setSn_CR(uint8_t cr); + + /** + Get @ref Sn_CR register + @return uint8_t. Value of @ref Sn_CR. + @sa setSn_CR() + */ + inline uint8_t getSn_CR() + { + return wizchip_read(Sn_CR); + } + + /** + Get @ref Sn_SR register + @return uint8_t. Value of @ref Sn_SR. + */ + inline uint8_t getSn_SR() + { + return wizchip_read(Sn_SR); + } + + /** + Get @ref Sn_IR register + @return uint8_t. Value of @ref Sn_IR. + @sa setSn_IR() + */ + inline uint8_t getSn_IR() + { + return wizchip_read(Sn_IR); + } + + /** + Set @ref Sn_IR register + @param (uint8_t)ir Value to set @ref Sn_IR + @sa getSn_IR() + */ + inline void setSn_IR(uint8_t ir) + { + wizchip_write(Sn_IR, ir); + } +}; + +#endif // W5100_H diff --git a/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino new file mode 100644 index 000000000..56dcb8092 --- /dev/null +++ b/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino @@ -0,0 +1,102 @@ +/* + This sketch establishes a TCP connection to a "quote of the day" service. + It sends a "hello" message, and then prints received data. +*/ + +#include +#include +//or #include +//or #include + +#include // WiFiClient (-> TCPClient) +#include // ESP8266WiFiClass::preinitWiFiOff() + +const char* host = "djxmmx.net"; +const uint16_t port = 17; + +using TCPClient = WiFiClient; + +#define CSPIN 16 // wemos/lolin/nodemcu D0 +Wiznet5500lwIP eth(CSPIN); + +void preinit() { + // (no C++ in function) + // disable wifi + ESP8266WiFiClass::preinitWiFiOff(); +} + +void setup() { + Serial.begin(115200); + + SPI.begin(); + SPI.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz? + SPI.setBitOrder(MSBFIRST); + SPI.setDataMode(SPI_MODE0); + eth.setDefault(); // use ethernet for default route + if (!eth.begin()) { + Serial.println("ethernet hardware not found ... sleeping"); + while (1) { + delay(1000); + } + } else { + Serial.print("connecting ethernet"); + while (!eth.connected()) { + Serial.print("."); + delay(1000); + } + } + Serial.println(); + Serial.print("ethernet IP address: "); + Serial.println(eth.localIP()); +} + +void loop() { + static bool wait = false; + + Serial.print("connecting to "); + Serial.print(host); + Serial.print(':'); + Serial.println(port); + + TCPClient client; + if (!client.connect(host, port)) { + Serial.println("connection failed"); + delay(5000); + return; + } + + // This will send a string to the server + Serial.println("sending data to server"); + if (client.connected()) { + client.println("hello from ESP8266"); + } + + // wait for data to be available + unsigned long timeout = millis(); + while (client.available() == 0) { + if (millis() - timeout > 5000) { + Serial.println(">>> Client Timeout !"); + client.stop(); + delay(60000); + return; + } + } + + // Read all the lines of the reply from server and print them to Serial + Serial.println("receiving from remote server"); + // not testing 'client.connected()' since we do not need to send data here + while (client.available()) { + char ch = static_cast(client.read()); + Serial.print(ch); + } + + // Close the connection + Serial.println(); + Serial.println("closing connection"); + client.stop(); + + if (wait) { + delay(300000); // execute once every 5 minutes, don't flood remote service + } + wait = true; +} diff --git a/libraries/lwIP_w5500/library.properties b/libraries/lwIP_w5500/library.properties new file mode 100644 index 000000000..8cb76d861 --- /dev/null +++ b/libraries/lwIP_w5500/library.properties @@ -0,0 +1,10 @@ +name=lwIP_w5500 +version=1 +author=Nicholas Humfrey +maintainer=esp8266/Arduino +sentence=Ethernet driver +paragraph=Wiznet5500 ethernet drivers for lwIP and esp8266 Arduino from https://github.com/njh/W5500MacRaw +category=Network +url=https://github.com/esp8266/Arduino +architectures=esp8266 +dot_a_linkage=true diff --git a/libraries/lwIP_w5500/src/W5500lwIP.h b/libraries/lwIP_w5500/src/W5500lwIP.h new file mode 100644 index 000000000..1e8f20133 --- /dev/null +++ b/libraries/lwIP_w5500/src/W5500lwIP.h @@ -0,0 +1,10 @@ + +#ifndef _W5500LWIP_H +#define _W5500LWIP_H + +#include +#include + +using Wiznet5500lwIP = LwipIntfDev; + +#endif // _W5500LWIP_H diff --git a/libraries/lwIP_w5500/src/utility/w5500.cpp b/libraries/lwIP_w5500/src/utility/w5500.cpp new file mode 100644 index 000000000..b3c3ce016 --- /dev/null +++ b/libraries/lwIP_w5500/src/utility/w5500.cpp @@ -0,0 +1,442 @@ +/* + Copyright (c) 2013, WIZnet Co., Ltd. + Copyright (c) 2016, Nicholas Humfrey + All rights reserved. + + 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. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``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 + COPYRIGHT HOLDER OR CONTRIBUTORS 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. + +*/ + +// original sources: https://github.com/njh/W5500MacRaw + +#include +#include "w5500.h" + + +uint8_t Wiznet5500::wizchip_read(uint8_t block, uint16_t address) +{ + uint8_t ret; + + wizchip_cs_select(); + + block |= AccessModeRead; + + wizchip_spi_write_byte((address & 0xFF00) >> 8); + wizchip_spi_write_byte((address & 0x00FF) >> 0); + wizchip_spi_write_byte(block); + + ret = wizchip_spi_read_byte(); + + wizchip_cs_deselect(); + return ret; +} + +uint16_t Wiznet5500::wizchip_read_word(uint8_t block, uint16_t address) +{ + return ((uint16_t)wizchip_read(block, address) << 8) + wizchip_read(block, address + 1); +} + +void Wiznet5500::wizchip_read_buf(uint8_t block, uint16_t address, uint8_t* pBuf, uint16_t len) +{ + uint16_t i; + + wizchip_cs_select(); + + block |= AccessModeRead; + + wizchip_spi_write_byte((address & 0xFF00) >> 8); + wizchip_spi_write_byte((address & 0x00FF) >> 0); + wizchip_spi_write_byte(block); + for (i = 0; i < len; i++) + { + pBuf[i] = wizchip_spi_read_byte(); + } + + wizchip_cs_deselect(); +} + +void Wiznet5500::wizchip_write(uint8_t block, uint16_t address, uint8_t wb) +{ + wizchip_cs_select(); + + block |= AccessModeWrite; + + wizchip_spi_write_byte((address & 0xFF00) >> 8); + wizchip_spi_write_byte((address & 0x00FF) >> 0); + wizchip_spi_write_byte(block); + wizchip_spi_write_byte(wb); + + wizchip_cs_deselect(); +} + +void Wiznet5500::wizchip_write_word(uint8_t block, uint16_t address, uint16_t word) +{ + wizchip_write(block, address, (uint8_t)(word >> 8)); + wizchip_write(block, address + 1, (uint8_t) word); +} + +void Wiznet5500::wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len) +{ + uint16_t i; + + wizchip_cs_select(); + + block |= AccessModeWrite; + + wizchip_spi_write_byte((address & 0xFF00) >> 8); + wizchip_spi_write_byte((address & 0x00FF) >> 0); + wizchip_spi_write_byte(block); + for (i = 0; i < len; i++) + { + wizchip_spi_write_byte(pBuf[i]); + } + + wizchip_cs_deselect(); +} + +void Wiznet5500::setSn_CR(uint8_t cr) +{ + // Write the command to the Command Register + wizchip_write(BlockSelectSReg, Sn_CR, cr); + + // Now wait for the command to complete + while (wizchip_read(BlockSelectSReg, Sn_CR)); +} + +uint16_t Wiznet5500::getSn_TX_FSR() +{ + uint16_t val = 0, val1 = 0; + do + { + val1 = wizchip_read_word(BlockSelectSReg, Sn_TX_FSR); + if (val1 != 0) + { + val = wizchip_read_word(BlockSelectSReg, Sn_TX_FSR); + } + } while (val != val1); + return val; +} + + +uint16_t Wiznet5500::getSn_RX_RSR() +{ + uint16_t val = 0, val1 = 0; + do + { + val1 = wizchip_read_word(BlockSelectSReg, Sn_RX_RSR); + if (val1 != 0) + { + val = wizchip_read_word(BlockSelectSReg, Sn_RX_RSR); + } + } while (val != val1); + return val; +} + +void Wiznet5500::wizchip_send_data(const uint8_t *wizdata, uint16_t len) +{ + uint16_t ptr = 0; + + if (len == 0) + { + return; + } + ptr = getSn_TX_WR(); + wizchip_write_buf(BlockSelectTxBuf, ptr, wizdata, len); + + ptr += len; + + setSn_TX_WR(ptr); +} + +void Wiznet5500::wizchip_recv_data(uint8_t *wizdata, uint16_t len) +{ + uint16_t ptr; + + if (len == 0) + { + return; + } + ptr = getSn_RX_RD(); + wizchip_read_buf(BlockSelectRxBuf, ptr, wizdata, len); + ptr += len; + + setSn_RX_RD(ptr); +} + +void Wiznet5500::wizchip_recv_ignore(uint16_t len) +{ + uint16_t ptr; + + ptr = getSn_RX_RD(); + ptr += len; + setSn_RX_RD(ptr); +} + +void Wiznet5500::wizchip_sw_reset() +{ + setMR(MR_RST); + getMR(); // for delay + + setSHAR(_mac_address); +} + +int8_t Wiznet5500::wizphy_getphylink() +{ + int8_t tmp; + if (getPHYCFGR() & PHYCFGR_LNK_ON) + { + tmp = PHY_LINK_ON; + } + else + { + tmp = PHY_LINK_OFF; + } + return tmp; +} + +int8_t Wiznet5500::wizphy_getphypmode() +{ + int8_t tmp = 0; + if (getPHYCFGR() & PHYCFGR_OPMDC_PDOWN) + { + tmp = PHY_POWER_DOWN; + } + else + { + tmp = PHY_POWER_NORM; + } + return tmp; +} + +void Wiznet5500::wizphy_reset() +{ + uint8_t tmp = getPHYCFGR(); + tmp &= PHYCFGR_RST; + setPHYCFGR(tmp); + tmp = getPHYCFGR(); + tmp |= ~PHYCFGR_RST; + setPHYCFGR(tmp); +} + +int8_t Wiznet5500::wizphy_setphypmode(uint8_t pmode) +{ + uint8_t tmp = 0; + tmp = getPHYCFGR(); + if ((tmp & PHYCFGR_OPMD) == 0) + { + return -1; + } + tmp &= ~PHYCFGR_OPMDC_ALLA; + if (pmode == PHY_POWER_DOWN) + { + tmp |= PHYCFGR_OPMDC_PDOWN; + } + else + { + tmp |= PHYCFGR_OPMDC_ALLA; + } + setPHYCFGR(tmp); + wizphy_reset(); + tmp = getPHYCFGR(); + if (pmode == PHY_POWER_DOWN) + { + if (tmp & PHYCFGR_OPMDC_PDOWN) + { + return 0; + } + } + else + { + if (tmp & PHYCFGR_OPMDC_ALLA) + { + return 0; + } + } + return -1; +} + + +Wiznet5500::Wiznet5500(int8_t cs, SPIClass& spi, int8_t intr): + _spi(spi), _cs(cs) +{ + (void)intr; +} + +boolean Wiznet5500::begin(const uint8_t *mac_address) +{ + memcpy(_mac_address, mac_address, 6); + + pinMode(_cs, OUTPUT); + wizchip_cs_deselect(); + +#if 0 + _spi.begin(); + _spi.setClockDivider(SPI_CLOCK_DIV4); // 4 MHz? + _spi.setBitOrder(MSBFIRST); + _spi.setDataMode(SPI_MODE0); +#endif + + wizchip_sw_reset(); + + // Use the full 16Kb of RAM for Socket 0 + setSn_RXBUF_SIZE(16); + setSn_TXBUF_SIZE(16); + + // Set our local MAC address + setSHAR(_mac_address); + + // Open Socket 0 in MACRaw mode + setSn_MR(Sn_MR_MACRAW); + setSn_CR(Sn_CR_OPEN); + if (getSn_SR() != SOCK_MACRAW) + { + // Failed to put socket 0 into MACRaw mode + return false; + } + + // Success + return true; +} + +void Wiznet5500::end() +{ + setSn_CR(Sn_CR_CLOSE); + + // clear all interrupt of the socket + setSn_IR(0xFF); + + // Wait for socket to change to closed + while (getSn_SR() != SOCK_CLOSED); +} + +uint16_t Wiznet5500::readFrame(uint8_t *buffer, uint16_t bufsize) +{ + uint16_t data_len = readFrameSize(); + + if (data_len == 0) + { + return 0; + } + + if (data_len > bufsize) + { + // Packet is bigger than buffer - drop the packet + discardFrame(data_len); + return 0; + } + + return readFrameData(buffer, data_len); +} + +uint16_t Wiznet5500::readFrameSize() +{ + uint16_t len = getSn_RX_RSR(); + + if (len == 0) + { + return 0; + } + + uint8_t head[2]; + uint16_t data_len = 0; + + wizchip_recv_data(head, 2); + setSn_CR(Sn_CR_RECV); + + data_len = head[0]; + data_len = (data_len << 8) + head[1]; + data_len -= 2; + + return data_len; +} + +void Wiznet5500::discardFrame(uint16_t framesize) +{ + wizchip_recv_ignore(framesize); + setSn_CR(Sn_CR_RECV); +} + +uint16_t Wiznet5500::readFrameData(uint8_t *buffer, uint16_t framesize) +{ + wizchip_recv_data(buffer, framesize); + setSn_CR(Sn_CR_RECV); + +#if 1 + // let lwIP deal with mac address filtering + return framesize; +#else + // Had problems with W5500 MAC address filtering (the Sn_MR_MFEN option) + // Do it in software instead: + if ((buffer[0] & 0x01) || memcmp(&buffer[0], _mac_address, 6) == 0) + { + // Addressed to an Ethernet multicast address or our unicast address + return framesize; + } + else + { + return 0; + } +#endif +} + +uint16_t Wiznet5500::sendFrame(const uint8_t *buf, uint16_t len) +{ + // Wait for space in the transmit buffer + while (1) + { + uint16_t freesize = getSn_TX_FSR(); + if (getSn_SR() == SOCK_CLOSED) + { + return -1; + } + if (len <= freesize) + { + break; + } + }; + + wizchip_send_data(buf, len); + setSn_CR(Sn_CR_SEND); + + while (1) + { + uint8_t tmp = getSn_IR(); + if (tmp & Sn_IR_SENDOK) + { + setSn_IR(Sn_IR_SENDOK); + // Packet sent ok + break; + } + else if (tmp & Sn_IR_TIMEOUT) + { + setSn_IR(Sn_IR_TIMEOUT); + // There was a timeout + return -1; + } + } + + return len; +} diff --git a/libraries/lwIP_w5500/src/utility/w5500.h b/libraries/lwIP_w5500/src/utility/w5500.h new file mode 100644 index 000000000..428689b8e --- /dev/null +++ b/libraries/lwIP_w5500/src/utility/w5500.h @@ -0,0 +1,767 @@ +/* + Copyright (c) 2013, WIZnet Co., Ltd. + Copyright (c) 2016, Nicholas Humfrey + All rights reserved. + + 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. Neither the name of the copyright holder nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + ``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 + COPYRIGHT HOLDER OR CONTRIBUTORS 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. + +*/ + +// original sources: https://github.com/njh/W5500MacRaw + +#ifndef W5500_H +#define W5500_H + +#include +#include +#include + + + +class Wiznet5500 +{ + +public: + /** + Constructor that uses the default hardware SPI pins + @param cs the Arduino Chip Select / Slave Select pin (default 10) + */ + Wiznet5500(int8_t cs = SS, SPIClass& spi = SPI, int8_t intr = -1); + + + /** + Initialise the Ethernet controller + Must be called before sending or receiving Ethernet frames + + @param address the local MAC address for the Ethernet interface + @return Returns true if setting up the Ethernet interface was successful + */ + boolean begin(const uint8_t *address); + + /** + Shut down the Ethernet controlled + */ + void end(); + + /** + Send an Ethernet frame + @param data a pointer to the data to send + @param datalen the length of the data in the packet + @return the number of bytes transmitted + */ + uint16_t sendFrame(const uint8_t *data, uint16_t datalen); + + /** + Read an Ethernet frame + @param buffer a pointer to a buffer to write the packet to + @param bufsize the available space in the buffer + @return the length of the received packet + or 0 if no packet was received + */ + uint16_t readFrame(uint8_t *buffer, uint16_t bufsize); + +protected: + + static constexpr bool interruptIsPossible() + { + return false; + } + + /** + Read an Ethernet frame size + @return the length of data do receive + or 0 if no frame was received + */ + uint16_t readFrameSize(); + + /** + discard an Ethernet frame + @param framesize readFrameSize()'s result + */ + void discardFrame(uint16_t framesize); + + /** + Read an Ethernet frame data + readFrameSize() must be called first, + its result must be passed into framesize parameter + @param buffer a pointer to a buffer to write the frame to + @param framesize readFrameSize()'s result + @return the length of the received frame + or 0 if a problem occured + */ + uint16_t readFrameData(uint8_t *frame, uint16_t framesize); + + +private: + + //< SPI interface Read operation in Control Phase + static const uint8_t AccessModeRead = (0x00 << 2); + + //< SPI interface Read operation in Control Phase + static const uint8_t AccessModeWrite = (0x01 << 2); + + //< Common register block in Control Phase + static const uint8_t BlockSelectCReg = (0x00 << 3); + + //< Socket 0 register block in Control Phase + static const uint8_t BlockSelectSReg = (0x01 << 3); + + //< Socket 0 Tx buffer address block + static const uint8_t BlockSelectTxBuf = (0x02 << 3); + + //< Socket 0 Rx buffer address block + static const uint8_t BlockSelectRxBuf = (0x03 << 3); + + + + SPIClass& _spi; + int8_t _cs; + uint8_t _mac_address[6]; + + /** + Default function to select chip. + @note This function help not to access wrong address. If you do not describe this function or register any functions, + null function is called. + */ + inline void wizchip_cs_select() + { + digitalWrite(_cs, LOW); + } + + /** + Default function to deselect chip. + @note This function help not to access wrong address. If you do not describe this function or register any functions, + null function is called. + */ + inline void wizchip_cs_deselect() + { + digitalWrite(_cs, HIGH); + } + + /** + Default function to read in SPI interface. + @note This function help not to access wrong address. If you do not describe this function or register any functions, + null function is called. + */ + inline uint8_t wizchip_spi_read_byte() + { + return _spi.transfer(0); + } + + /** + Default function to write in SPI interface. + @note This function help not to access wrong address. If you do not describe this function or register any functions, + null function is called. + */ + inline void wizchip_spi_write_byte(uint8_t wb) + { + _spi.transfer(wb); + } + + + /** + Read a 1 byte value from a register. + @param address Register address + @return The value of register + */ + uint8_t wizchip_read(uint8_t block, uint16_t address); + + /** + Reads a 2 byte value from a register. + @param address Register address + @return The value of register + */ + uint16_t wizchip_read_word(uint8_t block, uint16_t address); + + /** + It reads sequence data from registers. + @param address Register address + @param pBuf Pointer buffer to read data + @param len Data length + */ + void wizchip_read_buf(uint8_t block, uint16_t address, uint8_t* pBuf, uint16_t len); + + /** + Write a 1 byte value to a register. + @param address Register address + @param wb Write data + @return void + */ + void wizchip_write(uint8_t block, uint16_t address, uint8_t wb); + + /** + Write a 2 byte value to a register. + @param address Register address + @param wb Write data + @return void + */ + void wizchip_write_word(uint8_t block, uint16_t address, uint16_t word); + + /** + It writes sequence data to registers. + @param address Register address + @param pBuf Pointer buffer to write data + @param len Data length + */ + void wizchip_write_buf(uint8_t block, uint16_t address, const uint8_t* pBuf, uint16_t len); + + /** + Get @ref Sn_TX_FSR register + @return uint16_t. Value of @ref Sn_TX_FSR. + */ + uint16_t getSn_TX_FSR(); + + /** + Get @ref Sn_RX_RSR register + @return uint16_t. Value of @ref Sn_RX_RSR. + */ + uint16_t getSn_RX_RSR(); + + + /** + Reset WIZCHIP by softly. + */ + void wizchip_sw_reset(); + + /** + Get the link status of phy in WIZCHIP + */ + int8_t wizphy_getphylink(); + + /** + Get the power mode of PHY in WIZCHIP + */ + int8_t wizphy_getphypmode(); + + /** + Reset Phy + */ + void wizphy_reset(); + + /** + set the power mode of phy inside WIZCHIP. Refer to @ref PHYCFGR in W5500, @ref PHYSTATUS in W5200 + @param pmode Settig value of power down mode. + */ + int8_t wizphy_setphypmode(uint8_t pmode); + + /** + It copies data to internal TX memory + + @details This function reads the Tx write pointer register and after that, + it copies the wizdata(pointer buffer) of the length of len(variable) bytes to internal TX memory + and updates the Tx write pointer register. + This function is being called by send() and sendto() function also. + + @param wizdata Pointer buffer to write data + @param len Data length + @sa wizchip_recv_data() + */ + void wizchip_send_data(const uint8_t *wizdata, uint16_t len); + + /** + It copies data to your buffer from internal RX memory + + @details This function read the Rx read pointer register and after that, + it copies the received data from internal RX memory + to wizdata(pointer variable) of the length of len(variable) bytes. + This function is being called by recv() also. + + @param wizdata Pointer buffer to read data + @param len Data length + @sa wizchip_send_data() + */ + void wizchip_recv_data(uint8_t *wizdata, uint16_t len); + + /** + It discard the received data in RX memory. + @details It discards the data of the length of len(variable) bytes in internal RX memory. + @param len Data length + */ + void wizchip_recv_ignore(uint16_t len); + + + + /** Common registers */ + enum + { + MR = 0x0000, ///< Mode Register address (R/W) + SHAR = 0x0009, ///< Source MAC Register address (R/W) + INTLEVEL = 0x0013, ///< Set Interrupt low level timer register address (R/W) + IR = 0x0015, ///< Interrupt Register (R/W) + _IMR_ = 0x0016, ///< Interrupt mask register (R/W) + SIR = 0x0017, ///< Socket Interrupt Register (R/W) + SIMR = 0x0018, ///< Socket Interrupt Mask Register (R/W) + _RTR_ = 0x0019, ///< Timeout register address (1 is 100us) (R/W) + _RCR_ = 0x001B, ///< Retry count register (R/W) + UIPR = 0x0028, ///< Unreachable IP register address in UDP mode (R) + UPORTR = 0x002C, ///< Unreachable Port register address in UDP mode (R) + PHYCFGR = 0x002E, ///< PHY Status Register (R/W) + VERSIONR = 0x0039, ///< Chip version register address (R) + }; + + /** Socket registers */ + enum + { + Sn_MR = 0x0000, ///< Socket Mode register (R/W) + Sn_CR = 0x0001, ///< Socket command register (R/W) + Sn_IR = 0x0002, ///< Socket interrupt register (R) + Sn_SR = 0x0003, ///< Socket status register (R) + Sn_PORT = 0x0004, ///< Source port register (R/W) + Sn_DHAR = 0x0006, ///< Peer MAC register address (R/W) + Sn_DIPR = 0x000C, ///< Peer IP register address (R/W) + Sn_DPORT = 0x0010, ///< Peer port register address (R/W) + Sn_MSSR = 0x0012, ///< Maximum Segment Size(Sn_MSSR0) register address (R/W) + Sn_TOS = 0x0015, ///< IP Type of Service(TOS) Register (R/W) + Sn_TTL = 0x0016, ///< IP Time to live(TTL) Register (R/W) + Sn_RXBUF_SIZE = 0x001E, ///< Receive memory size register (R/W) + Sn_TXBUF_SIZE = 0x001F, ///< Transmit memory size register (R/W) + Sn_TX_FSR = 0x0020, ///< Transmit free memory size register (R) + Sn_TX_RD = 0x0022, ///< Transmit memory read pointer register address (R) + Sn_TX_WR = 0x0024, ///< Transmit memory write pointer register address (R/W) + Sn_RX_RSR = 0x0026, ///< Received data size register (R) + Sn_RX_RD = 0x0028, ///< Read point of Receive memory (R/W) + Sn_RX_WR = 0x002A, ///< Write point of Receive memory (R) + Sn_IMR = 0x002C, ///< Socket interrupt mask register (R) + Sn_FRAG = 0x002D, ///< Fragment field value in IP header register (R/W) + Sn_KPALVTR = 0x002F, ///< Keep Alive Timer register (R/W) + }; + + /** Mode register values */ + enum + { + MR_RST = 0x80, ///< Reset + MR_WOL = 0x20, ///< Wake on LAN + MR_PB = 0x10, ///< Ping block + MR_PPPOE = 0x08, ///< Enable PPPoE + MR_FARP = 0x02, ///< Enable UDP_FORCE_ARP CHECHK + }; + + /* Interrupt Register values */ + enum + { + IR_CONFLICT = 0x80, ///< Check IP conflict + IR_UNREACH = 0x40, ///< Get the destination unreachable message in UDP sending + IR_PPPoE = 0x20, ///< Get the PPPoE close message + IR_MP = 0x10, ///< Get the magic packet interrupt + }; + + /* Interrupt Mask Register values */ + enum + { + IM_IR7 = 0x80, ///< IP Conflict Interrupt Mask + IM_IR6 = 0x40, ///< Destination unreachable Interrupt Mask + IM_IR5 = 0x20, ///< PPPoE Close Interrupt Mask + IM_IR4 = 0x10, ///< Magic Packet Interrupt Mask + }; + + /** Socket Mode Register values @ref Sn_MR */ + enum + { + Sn_MR_CLOSE = 0x00, ///< Unused socket + Sn_MR_TCP = 0x01, ///< TCP + Sn_MR_UDP = 0x02, ///< UDP + Sn_MR_MACRAW = 0x04, ///< MAC LAYER RAW SOCK + Sn_MR_UCASTB = 0x10, ///< Unicast Block in UDP Multicasting + Sn_MR_ND = 0x20, ///< No Delayed Ack(TCP), Multicast flag + Sn_MR_BCASTB = 0x40, ///< Broadcast block in UDP Multicasting + Sn_MR_MULTI = 0x80, ///< Support UDP Multicasting + Sn_MR_MIP6B = 0x10, ///< IPv6 packet Blocking in @ref Sn_MR_MACRAW mode + Sn_MR_MMB = 0x20, ///< Multicast Blocking in @ref Sn_MR_MACRAW mode + Sn_MR_MFEN = 0x80, ///< MAC filter enable in @ref Sn_MR_MACRAW mode + }; + + /** Socket Command Register values */ + enum + { + Sn_CR_OPEN = 0x01, ///< Initialise or open socket + Sn_CR_LISTEN = 0x02, ///< Wait connection request in TCP mode (Server mode) + Sn_CR_CONNECT = 0x04, ///< Send connection request in TCP mode (Client mode) + Sn_CR_DISCON = 0x08, ///< Send closing request in TCP mode + Sn_CR_CLOSE = 0x10, ///< Close socket + Sn_CR_SEND = 0x20, ///< Update TX buffer pointer and send data + Sn_CR_SEND_MAC = 0x21, ///< Send data with MAC address, so without ARP process + Sn_CR_SEND_KEEP = 0x22, ///< Send keep alive message + Sn_CR_RECV = 0x40, ///< Update RX buffer pointer and receive data + }; + + /** Socket Interrupt register values */ + enum + { + Sn_IR_CON = 0x01, ///< CON Interrupt + Sn_IR_DISCON = 0x02, ///< DISCON Interrupt + Sn_IR_RECV = 0x04, ///< RECV Interrupt + Sn_IR_TIMEOUT = 0x08, ///< TIMEOUT Interrupt + Sn_IR_SENDOK = 0x10, ///< SEND_OK Interrupt + }; + + /** Socket Status Register values */ + enum + { + SOCK_CLOSED = 0x00, ///< Closed + SOCK_INIT = 0x13, ///< Initiate state + SOCK_LISTEN = 0x14, ///< Listen state + SOCK_SYNSENT = 0x15, ///< Connection state + SOCK_SYNRECV = 0x16, ///< Connection state + SOCK_ESTABLISHED = 0x17, ///< Success to connect + SOCK_FIN_WAIT = 0x18, ///< Closing state + SOCK_CLOSING = 0x1A, ///< Closing state + SOCK_TIME_WAIT = 0x1B, ///< Closing state + SOCK_CLOSE_WAIT = 0x1C, ///< Closing state + SOCK_LAST_ACK = 0x1D, ///< Closing state + SOCK_UDP = 0x22, ///< UDP socket + SOCK_MACRAW = 0x42, ///< MAC raw mode socket + }; + + + /* PHYCFGR register value */ + enum + { + PHYCFGR_RST = ~(1 << 7), //< For PHY reset, must operate AND mask. + PHYCFGR_OPMD = (1 << 6), // Configre PHY with OPMDC value + PHYCFGR_OPMDC_ALLA = (7 << 3), + PHYCFGR_OPMDC_PDOWN = (6 << 3), + PHYCFGR_OPMDC_NA = (5 << 3), + PHYCFGR_OPMDC_100FA = (4 << 3), + PHYCFGR_OPMDC_100F = (3 << 3), + PHYCFGR_OPMDC_100H = (2 << 3), + PHYCFGR_OPMDC_10F = (1 << 3), + PHYCFGR_OPMDC_10H = (0 << 3), + PHYCFGR_DPX_FULL = (1 << 2), + PHYCFGR_DPX_HALF = (0 << 2), + PHYCFGR_SPD_100 = (1 << 1), + PHYCFGR_SPD_10 = (0 << 1), + PHYCFGR_LNK_ON = (1 << 0), + PHYCFGR_LNK_OFF = (0 << 0), + }; + + enum + { + PHY_SPEED_10 = 0, ///< Link Speed 10 + PHY_SPEED_100 = 1, ///< Link Speed 100 + PHY_DUPLEX_HALF = 0, ///< Link Half-Duplex + PHY_DUPLEX_FULL = 1, ///< Link Full-Duplex + PHY_LINK_OFF = 0, ///< Link Off + PHY_LINK_ON = 1, ///< Link On + PHY_POWER_NORM = 0, ///< PHY power normal mode + PHY_POWER_DOWN = 1, ///< PHY power down mode + }; + + + /** + Set Mode Register + @param (uint8_t)mr The value to be set. + @sa getMR() + */ + inline void setMR(uint8_t mode) + { + wizchip_write(BlockSelectCReg, MR, mode); + } + + /** + Get Mode Register + @return uint8_t. The value of Mode register. + @sa setMR() + */ + inline uint8_t getMR() + { + return wizchip_read(BlockSelectCReg, MR); + } + + /** + Set local MAC address + @param (uint8_t*)shar Pointer variable to set local MAC address. It should be allocated 6 bytes. + @sa getSHAR() + */ + inline void setSHAR(const uint8_t* macaddr) + { + wizchip_write_buf(BlockSelectCReg, SHAR, macaddr, 6); + } + + /** + Get local MAC address + @param (uint8_t*)shar Pointer variable to get local MAC address. It should be allocated 6 bytes. + @sa setSHAR() + */ + inline void getSHAR(uint8_t* macaddr) + { + wizchip_read_buf(BlockSelectCReg, SHAR, macaddr, 6); + } + + /** + Set @ref IR register + @param (uint8_t)ir Value to set @ref IR register. + @sa getIR() + */ + inline void setIR(uint8_t ir) + { + wizchip_write(BlockSelectCReg, IR, (ir & 0xF0)); + } + + /** + Get @ref IR register + @return uint8_t. Value of @ref IR register. + @sa setIR() + */ + inline uint8_t getIR() + { + return wizchip_read(BlockSelectCReg, IR) & 0xF0; + } + + /** + Set @ref _IMR_ register + @param (uint8_t)imr Value to set @ref _IMR_ register. + @sa getIMR() + */ + inline void setIMR(uint8_t imr) + { + wizchip_write(BlockSelectCReg, _IMR_, imr); + } + + /** + Get @ref _IMR_ register + @return uint8_t. Value of @ref _IMR_ register. + @sa setIMR() + */ + inline uint8_t getIMR() + { + return wizchip_read(BlockSelectCReg, _IMR_); + } + + /** + Set @ref PHYCFGR register + @param (uint8_t)phycfgr Value to set @ref PHYCFGR register. + @sa getPHYCFGR() + */ + inline void setPHYCFGR(uint8_t phycfgr) + { + wizchip_write(BlockSelectCReg, PHYCFGR, phycfgr); + } + + /** + Get @ref PHYCFGR register + @return uint8_t. Value of @ref PHYCFGR register. + @sa setPHYCFGR() + */ + inline uint8_t getPHYCFGR() + { + return wizchip_read(BlockSelectCReg, PHYCFGR); + } + + /** + Get @ref VERSIONR register + @return uint8_t. Value of @ref VERSIONR register. + */ + inline uint8_t getVERSIONR() + { + return wizchip_read(BlockSelectCReg, VERSIONR); + } + + /** + Set @ref Sn_MR register + @param (uint8_t)mr Value to set @ref Sn_MR + @sa getSn_MR() + */ + inline void setSn_MR(uint8_t mr) + { + wizchip_write(BlockSelectSReg, Sn_MR, mr); + } + + /** + Get @ref Sn_MR register + @return uint8_t. Value of @ref Sn_MR. + @sa setSn_MR() + */ + inline uint8_t getSn_MR() + { + return wizchip_read(BlockSelectSReg, Sn_MR); + } + + /** + Set @ref Sn_CR register, then wait for the command to execute + @param (uint8_t)cr Value to set @ref Sn_CR + @sa getSn_CR() + */ + void setSn_CR(uint8_t cr); + + /** + Get @ref Sn_CR register + @return uint8_t. Value of @ref Sn_CR. + @sa setSn_CR() + */ + inline uint8_t getSn_CR() + { + return wizchip_read(BlockSelectSReg, Sn_CR); + } + + /** + Set @ref Sn_IR register + @param (uint8_t)ir Value to set @ref Sn_IR + @sa getSn_IR() + */ + inline void setSn_IR(uint8_t ir) + { + wizchip_write(BlockSelectSReg, Sn_IR, (ir & 0x1F)); + } + + /** + Get @ref Sn_IR register + @return uint8_t. Value of @ref Sn_IR. + @sa setSn_IR() + */ + inline uint8_t getSn_IR() + { + return (wizchip_read(BlockSelectSReg, Sn_IR) & 0x1F); + } + + /** + Set @ref Sn_IMR register + @param (uint8_t)imr Value to set @ref Sn_IMR + @sa getSn_IMR() + */ + inline void setSn_IMR(uint8_t imr) + { + wizchip_write(BlockSelectSReg, Sn_IMR, (imr & 0x1F)); + } + + /** + Get @ref Sn_IMR register + @return uint8_t. Value of @ref Sn_IMR. + @sa setSn_IMR() + */ + inline uint8_t getSn_IMR() + { + return (wizchip_read(BlockSelectSReg, Sn_IMR) & 0x1F); + } + + /** + Get @ref Sn_SR register + @return uint8_t. Value of @ref Sn_SR. + */ + inline uint8_t getSn_SR() + { + return wizchip_read(BlockSelectSReg, Sn_SR); + } + + /** + Set @ref Sn_RXBUF_SIZE register + @param (uint8_t)rxbufsize Value to set @ref Sn_RXBUF_SIZE + @sa getSn_RXBUF_SIZE() + */ + inline void setSn_RXBUF_SIZE(uint8_t rxbufsize) + { + wizchip_write(BlockSelectSReg, Sn_RXBUF_SIZE, rxbufsize); + } + + /** + Get @ref Sn_RXBUF_SIZE register + @return uint8_t. Value of @ref Sn_RXBUF_SIZE. + @sa setSn_RXBUF_SIZE() + */ + inline uint8_t getSn_RXBUF_SIZE() + { + return wizchip_read(BlockSelectSReg, Sn_RXBUF_SIZE); + } + + /** + Set @ref Sn_TXBUF_SIZE register + @param (uint8_t)txbufsize Value to set @ref Sn_TXBUF_SIZE + @sa getSn_TXBUF_SIZE() + */ + inline void setSn_TXBUF_SIZE(uint8_t txbufsize) + { + wizchip_write(BlockSelectSReg, Sn_TXBUF_SIZE, txbufsize); + } + + /** + Get @ref Sn_TXBUF_SIZE register + @return uint8_t. Value of @ref Sn_TXBUF_SIZE. + @sa setSn_TXBUF_SIZE() + */ + inline uint8_t getSn_TXBUF_SIZE() + { + return wizchip_read(BlockSelectSReg, Sn_TXBUF_SIZE); + } + + /** + Get @ref Sn_TX_RD register + @return uint16_t. Value of @ref Sn_TX_RD. + */ + inline uint16_t getSn_TX_RD() + { + return wizchip_read_word(BlockSelectSReg, Sn_TX_RD); + } + + /** + Set @ref Sn_TX_WR register + @param (uint16_t)txwr Value to set @ref Sn_TX_WR + @sa GetSn_TX_WR() + */ + inline void setSn_TX_WR(uint16_t txwr) + { + wizchip_write_word(BlockSelectSReg, Sn_TX_WR, txwr); + } + + /** + Get @ref Sn_TX_WR register + @return uint16_t. Value of @ref Sn_TX_WR. + @sa setSn_TX_WR() + */ + inline uint16_t getSn_TX_WR() + { + return wizchip_read_word(BlockSelectSReg, Sn_TX_WR); + } + + /** + Set @ref Sn_RX_RD register + @param (uint16_t)rxrd Value to set @ref Sn_RX_RD + @sa getSn_RX_RD() + */ + inline void setSn_RX_RD(uint16_t rxrd) + { + wizchip_write_word(BlockSelectSReg, Sn_RX_RD, rxrd); + } + + /** + Get @ref Sn_RX_RD register + @return uint16_t. Value of @ref Sn_RX_RD. + @sa setSn_RX_RD() + */ + inline uint16_t getSn_RX_RD() + { + return wizchip_read_word(BlockSelectSReg, Sn_RX_RD); + } + + /** + Get @ref Sn_RX_WR register + @return uint16_t. Value of @ref Sn_RX_WR. + */ + inline uint16_t getSn_RX_WR() + { + return wizchip_read_word(BlockSelectSReg, Sn_RX_WR); + } +}; + +#endif // W5500_H diff --git a/package/package_esp8266com_index.template.json b/package/package_esp8266com_index.template.json index 762ed7dde..42f263742 100644 --- a/package/package_esp8266com_index.template.json +++ b/package/package_esp8266com_index.template.json @@ -78,7 +78,7 @@ "name": "LOLIN(WEMOS) D1 mini Lite" }, { - "name": "WeMos D1 R1" + "name": "LOLIN(WeMos) D1 R1" }, { "name": "ESPino (ESP-12 Module)" @@ -123,12 +123,12 @@ "toolsDependencies": [ { "packager": "esp8266", - "version": "3.0.0-gnu13-2f311fd", + "version": "3.0.0-newlib4.0.0-gnu21-dba3cc8", "name": "xtensa-lx106-elf-gcc" }, { "packager": "esp8266", - "version": "3.0.0-gnu13-2f311fd", + "version": "3.0.0-newlib4.0.0-gnu21-dba3cc8", "name": "mkspiffs" }, { @@ -199,166 +199,166 @@ ] }, { - "version": "3.0.0-gnu13-2f311fd", + "version": "3.0.0-newlib4.0.0-gnu21-dba3cc8", "name": "xtensa-lx106-elf-gcc", "systems": [ { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/aarch64-linux-gnu.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "archiveFileName": "aarch64-linux-gnu.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "checksum": "SHA-256:92671a2ba50d4d425463f261247b01705c3e83cb20a9e743624d849cf4673135", - "size": "70866139" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/aarch64-linux-gnu.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "archiveFileName": "aarch64-linux-gnu.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "checksum": "SHA-256:fa6278eda34ec18fb7cbc3fb1b76f559a4a18bd6c817b795f6c8807f7cd181bc", + "size": "71018486" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/arm-linux-gnueabihf.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "archiveFileName": "arm-linux-gnueabihf.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "checksum": "SHA-256:ca5117531e9928ad057c992055fd0c8a68ba5cf8d08c86a6d94862912c867eaf", - "size": "66959729" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/arm-linux-gnueabihf.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "checksum": "SHA-256:87eccbeb735ece0e8eb45c060007ef906ac1975589259854a325f9f3911c9923", + "size": "67098909" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/i686-linux-gnu.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "archiveFileName": "i686-linux-gnu.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "checksum": "SHA-256:7e136377a9bce4094593f22104c7d6bfb197bba40894ffa64dad9ccb978cf79e", - "size": "74047727" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/i686-linux-gnu.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "archiveFileName": "i686-linux-gnu.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "checksum": "SHA-256:fc267621440e0a0f91c89a44edd604b07bec38bdcb7bcdda687a160d9397f04a", + "size": "74193717" }, { "host": "i686-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/i686-w64-mingw32.xtensa-lx106-elf-2f311fd.200918.zip", - "archiveFileName": "i686-w64-mingw32.xtensa-lx106-elf-2f311fd.200918.zip", - "checksum": "SHA-256:e8a9718e4a3e3b91392f11d38272f51da2931454e5ded573b2755c6a858f31c3", - "size": "71067395" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/i686-w64-mingw32.xtensa-lx106-elf-dba3cc8.201223.zip", + "archiveFileName": "i686-w64-mingw32.xtensa-lx106-elf-dba3cc8.201223.zip", + "checksum": "SHA-256:c909331865ec15a822300763e159fe183e7cd89a47e9283abb5d1fb0fcdeaf50", + "size": "71433726" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-apple-darwin14.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "archiveFileName": "x86_64-apple-darwin14.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "checksum": "SHA-256:8b81931fdf84913f09894747aaba7b26c950f578f5c294314889a14edfcaba2e", - "size": "75460809" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-apple-darwin14.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "checksum": "SHA-256:e193490e343c7d1c0222af6a1b961e26683367fd07bc49ee471b7c98298ce0ca", + "size": "75617500" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-linux-gnu.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "archiveFileName": "x86_64-linux-gnu.xtensa-lx106-elf-2f311fd.200918.tar.gz", - "checksum": "SHA-256:ec0c4036c1cb9efe2f21a89f42b77a2c0d6ee7dfe284ff8e35024b7a25a06d53", - "size": "74560398" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-linux-gnu.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "archiveFileName": "x86_64-linux-gnu.xtensa-lx106-elf-dba3cc8.201223.tar.gz", + "checksum": "SHA-256:356f6ac8bd8e241731a6b4bad17811f80d6ccfb9c479f8cf6128fb80152f2037", + "size": "74719337" }, { "host": "x86_64-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-w64-mingw32.xtensa-lx106-elf-2f311fd.200918.zip", - "archiveFileName": "x86_64-w64-mingw32.xtensa-lx106-elf-2f311fd.200918.zip", - "checksum": "SHA-256:988f7a2ecbdab45db392fd82d5b2a557264cd01b87e0659fc9e211990971f3d6", - "size": "75033229" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-w64-mingw32.xtensa-lx106-elf-dba3cc8.201223.zip", + "archiveFileName": "x86_64-w64-mingw32.xtensa-lx106-elf-dba3cc8.201223.zip", + "checksum": "SHA-256:56af2a313aa0b707d4308350b36bd6d112f98bfb8c22fe118dff9b27092f06ac", + "size": "75406203" } ] }, { - "version": "3.0.0-gnu13-2f311fd", + "version": "3.0.0-newlib4.0.0-gnu21-dba3cc8", "name": "mkspiffs", "systems": [ { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/aarch64-linux-gnu.mkspiffs-7fefeac.200918.tar.gz", - "archiveFileName": "aarch64-linux-gnu.mkspiffs-7fefeac.200918.tar.gz", - "checksum": "SHA-256:16f7bcc7dce9e44f73a1a343a845f56893799ef480f3292d0d52359ce61f3df5", - "size": "51260" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/aarch64-linux-gnu.mkspiffs-7fefeac.201223.tar.gz", + "archiveFileName": "aarch64-linux-gnu.mkspiffs-7fefeac.201223.tar.gz", + "checksum": "SHA-256:d2875219d38e176e03c6c1c96136dbc18a99f15e7de5e1bd08938ca8235a7bd8", + "size": "51258" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/arm-linux-gnueabihf.mkspiffs-7fefeac.200918.tar.gz", - "archiveFileName": "arm-linux-gnueabihf.mkspiffs-7fefeac.200918.tar.gz", - "checksum": "SHA-256:3ed5183d52cbe383804d521281087d25d5dedcf23307d8baf1e149c2d7fce6ef", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/arm-linux-gnueabihf.mkspiffs-7fefeac.201223.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.mkspiffs-7fefeac.201223.tar.gz", + "checksum": "SHA-256:20a19854e6b38220caa283fc0c9b0c3134474215899c05df68c11dabe85b0952", "size": "44270" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/i686-linux-gnu.mkspiffs-7fefeac.200918.tar.gz", - "archiveFileName": "i686-linux-gnu.mkspiffs-7fefeac.200918.tar.gz", - "checksum": "SHA-256:efc0dedc01945829d892f2709326e1c7bbd8180773c4101b00c695b072f69fc5", - "size": "54513" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/i686-linux-gnu.mkspiffs-7fefeac.201223.tar.gz", + "archiveFileName": "i686-linux-gnu.mkspiffs-7fefeac.201223.tar.gz", + "checksum": "SHA-256:43534ee2575a2d3ab895a2367f79ceed7e90e68cf6790106b91cdfb2eada34c8", + "size": "54516" }, { "host": "i686-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/i686-w64-mingw32.mkspiffs-7fefeac.200918.zip", - "archiveFileName": "i686-w64-mingw32.mkspiffs-7fefeac.200918.zip", - "checksum": "SHA-256:ff24cc666e3f6b2554717e084503c042072ad01a290b1f0c20e61aa829260487", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/i686-w64-mingw32.mkspiffs-7fefeac.201223.zip", + "archiveFileName": "i686-w64-mingw32.mkspiffs-7fefeac.201223.zip", + "checksum": "SHA-256:0f98fa50195f1523504021f793f4947fbc5e064f701308299ce4e67de22a8c6c", "size": "338192" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-apple-darwin14.mkspiffs-7fefeac.200918.tar.gz", - "archiveFileName": "x86_64-apple-darwin14.mkspiffs-7fefeac.200918.tar.gz", - "checksum": "SHA-256:34328f6bb9219a97c65941a54817d9f0be25b379d703414216ab6d7bcfd56b1d", - "size": "368774" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-apple-darwin14.mkspiffs-7fefeac.201223.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.mkspiffs-7fefeac.201223.tar.gz", + "checksum": "SHA-256:4807b03e1e9a4dee01acf9a0da37c3914983baf20e303fd2c2ae896a435af8b2", + "size": "368776" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-linux-gnu.mkspiffs-7fefeac.200918.tar.gz", - "archiveFileName": "x86_64-linux-gnu.mkspiffs-7fefeac.200918.tar.gz", - "checksum": "SHA-256:62b5140dc36f5a13ef183ece097b7b18c7c59fcce43e649d26dbd585ba5c1ec7", - "size": "52648" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-linux-gnu.mkspiffs-7fefeac.201223.tar.gz", + "archiveFileName": "x86_64-linux-gnu.mkspiffs-7fefeac.201223.tar.gz", + "checksum": "SHA-256:2139296513ce2449e602dfca690116580ce90d24e65da7361745f0030af0005b", + "size": "52647" }, { "host": "x86_64-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-w64-mingw32.mkspiffs-7fefeac.200918.zip", - "archiveFileName": "x86_64-w64-mingw32.mkspiffs-7fefeac.200918.zip", - "checksum": "SHA-256:9a08ea54593b901f7a853bacb39631e6585bdbefb9c0b4d1b40e9c5f31c78eed", - "size": "350355" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-w64-mingw32.mkspiffs-7fefeac.201223.zip", + "archiveFileName": "x86_64-w64-mingw32.mkspiffs-7fefeac.201223.zip", + "checksum": "SHA-256:9d58e0220356066ef912eef3ce2362d2b1ab1618c8379b4a01809c37120655e6", + "size": "350354" } ] }, { - "version": "3.0.0-gnu13-2f311fd", + "version": "3.0.0-newlib4.0.0-gnu21-dba3cc8", "name": "mklittlefs", "systems": [ { "host": "aarch64-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/aarch64-linux-gnu.mklittlefs-295fe9b.200918.tar.gz", - "archiveFileName": "aarch64-linux-gnu.mklittlefs-295fe9b.200918.tar.gz", - "checksum": "SHA-256:b5280de4d9057a4affbc731e3b3d750e7def02ffa54f924764bf6bad1e16bff9", - "size": "44793" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/aarch64-linux-gnu.mklittlefs-6b5c62d.201223.tar.gz", + "archiveFileName": "aarch64-linux-gnu.mklittlefs-6b5c62d.201223.tar.gz", + "checksum": "SHA-256:ff3b6559bcfb56bb0e20abd0297cb61e010667ef9ac8a1e7aad6a94ff8a32684", + "size": "44788" }, { "host": "arm-linux-gnueabihf", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/arm-linux-gnueabihf.mklittlefs-295fe9b.200918.tar.gz", - "archiveFileName": "arm-linux-gnueabihf.mklittlefs-295fe9b.200918.tar.gz", - "checksum": "SHA-256:0fa337876f09fa6e1a8bd70525b1d0866656dd6e797a823fbbbd41ae1fd17033", - "size": "37332" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/arm-linux-gnueabihf.mklittlefs-6b5c62d.201223.tar.gz", + "archiveFileName": "arm-linux-gnueabihf.mklittlefs-6b5c62d.201223.tar.gz", + "checksum": "SHA-256:f85dc41964321e4c1cf73118cbe255e6b852b58edef994beab220a6d1f8d3015", + "size": "37331" }, { "host": "i686-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/i686-linux-gnu.mklittlefs-295fe9b.200918.tar.gz", - "archiveFileName": "i686-linux-gnu.mklittlefs-295fe9b.200918.tar.gz", - "checksum": "SHA-256:460b3b2e63e859159cc9eafd4d80896bce779c99b37d7d6257032f51b028513b", - "size": "48241" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/i686-linux-gnu.mklittlefs-6b5c62d.201223.tar.gz", + "archiveFileName": "i686-linux-gnu.mklittlefs-6b5c62d.201223.tar.gz", + "checksum": "SHA-256:b909bbc0b9edba9f0db6ed19f5bcc5d7c614665e2b56b107cc9e9316673ba91c", + "size": "48242" }, { "host": "i686-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/i686-w64-mingw32.mklittlefs-295fe9b.200918.zip", - "archiveFileName": "i686-w64-mingw32.mklittlefs-295fe9b.200918.zip", - "checksum": "SHA-256:5b8198083cd57f7e33f3b9e18b85f704b6802b7b5afd4586c927db5ddbe9b831", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/i686-w64-mingw32.mklittlefs-6b5c62d.201223.zip", + "archiveFileName": "i686-w64-mingw32.mklittlefs-6b5c62d.201223.zip", + "checksum": "SHA-256:ec22bd21c4e5420d67dfdd014eec4b24342b575a097ef79d8e0eed05762e31e3", "size": "332804" }, { "host": "x86_64-apple-darwin", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-apple-darwin14.mklittlefs-295fe9b.200918.tar.gz", - "archiveFileName": "x86_64-apple-darwin14.mklittlefs-295fe9b.200918.tar.gz", - "checksum": "SHA-256:bb2b5dc41b8ef009a996b3e714ce6dbf0e9fdbfee16ef453fd2159764ba3bb7b", - "size": "362803" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-apple-darwin14.mklittlefs-6b5c62d.201223.tar.gz", + "archiveFileName": "x86_64-apple-darwin14.mklittlefs-6b5c62d.201223.tar.gz", + "checksum": "SHA-256:8735f6c2bdf5788c6238842bf41f2a35eac807fd55009f51f2659d2b11b1aa3c", + "size": "362805" }, { "host": "x86_64-pc-linux-gnu", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-linux-gnu.mklittlefs-295fe9b.200918.tar.gz", - "archiveFileName": "x86_64-linux-gnu.mklittlefs-295fe9b.200918.tar.gz", - "checksum": "SHA-256:271b21f65ab00584bb6778b95142878505629047e768ad5fa6703f50f4490e4b", - "size": "46919" + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-linux-gnu.mklittlefs-6b5c62d.201223.tar.gz", + "archiveFileName": "x86_64-linux-gnu.mklittlefs-6b5c62d.201223.tar.gz", + "checksum": "SHA-256:e11216bef3f85504d030762c390bc974a31d721063d4b001c03f0b03034df545", + "size": "46920" }, { "host": "x86_64-mingw32", - "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-gnu13/x86_64-w64-mingw32.mklittlefs-295fe9b.200918.zip", - "archiveFileName": "x86_64-w64-mingw32.mklittlefs-295fe9b.200918.zip", - "checksum": "SHA-256:9b8fc06f849904e764e997d5289fb2ecd87b46283a3799483130a5953927a0a6", + "url": "https://github.com/earlephilhower/esp-quick-toolchain/releases/download/3.0.0-newlib4.0.0-gnu21/x86_64-w64-mingw32.mklittlefs-6b5c62d.201223.zip", + "archiveFileName": "x86_64-w64-mingw32.mklittlefs-6b5c62d.201223.zip", + "checksum": "SHA-256:57311851b8c8710ea747f608f5a728d5e88e75355f0a644e6a93d05797d983a3", "size": "345249" } ] diff --git a/platform.txt b/platform.txt index c68d1985f..4f37b8e78 100644 --- a/platform.txt +++ b/platform.txt @@ -17,6 +17,8 @@ runtime.tools.signing={runtime.platform.path}/tools/signing.py runtime.tools.elf2bin={runtime.platform.path}/tools/elf2bin.py runtime.tools.sizes={runtime.platform.path}/tools/sizes.py runtime.tools.makecorever={runtime.platform.path}/tools/makecorever.py +runtime.tools.mkdir={runtime.platform.path}/tools/mkdir.py +runtime.tools.cp={runtime.platform.path}/tools/cp.py runtime.tools.eboot={runtime.platform.path}/bootloaders/eboot/eboot.elf compiler.warning_flags=-w @@ -32,6 +34,8 @@ build.lwip_flags=-DLWIP_OPEN_SRC build.vtable_flags=-DVTABLES_IN_FLASH build.sslflags= +build.mmuflags= +build.non32xferflags= build.exception_flags=-fno-exceptions build.stdcpp_lib=-lstdc++ @@ -55,18 +59,18 @@ compiler.libc.path={runtime.platform.path}/tools/sdk/libc/xtensa-lx106-elf compiler.cpreprocessor.flags=-D__ets__ -DICACHE_FLASH -U__STRICT_ANSI__ "-I{compiler.sdk.path}/include" "-I{compiler.sdk.path}/{build.lwip_include}" "-I{compiler.libc.path}/include" "-I{build.path}/core" compiler.c.cmd=xtensa-lx106-elf-gcc -compiler.c.flags=-c {compiler.warning_flags} -std=c17 {build.stacksmash_flags} -Os -g -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} +compiler.c.flags=-c {compiler.warning_flags} -std=gnu17 {build.stacksmash_flags} -Os -g -free -fipa-pta -Wpointer-arith -Wno-implicit-function-declaration -Wl,-EL -fno-inline-functions -nostdlib -mlongcalls -mtext-section-literals -falign-functions=4 -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} compiler.S.cmd=xtensa-lx106-elf-gcc -compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls +compiler.S.flags=-c -g -x assembler-with-cpp -MMD -mlongcalls "-I{runtime.tools.xtensa-lx106-elf-gcc.path}/include/" -compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/lib/{build.sdk}" "-L{compiler.sdk.path}/ld" "-L{compiler.libc.path}/lib" "-T{build.flash_ld}" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read +compiler.c.elf.flags=-g {compiler.warning_flags} -Os -nostdlib -Wl,--no-check-sections -u app_entry {build.float} -Wl,-static "-L{compiler.sdk.path}/lib" "-L{compiler.sdk.path}/lib/{build.sdk}" "-L{build.path}" "-L{compiler.libc.path}/lib" "-Tlocal.eagle.flash.ld" -Wl,--gc-sections -Wl,-wrap,system_restart_local -Wl,-wrap,spi_flash_read compiler.c.elf.cmd=xtensa-lx106-elf-gcc compiler.c.elf.libs=-lhal -lphy -lpp -lnet80211 {build.lwip_lib} -lwpa -lcrypto -lmain -lwps -lbearssl -lespnow -lsmartconfig -lairkiss -lwpa2 {build.stdcpp_lib} -lm -lc -lgcc compiler.cpp.cmd=xtensa-lx106-elf-g++ -compiler.cpp.flags=-c {compiler.warning_flags} {build.stacksmash_flags} -Os -g -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} +compiler.cpp.flags=-c {compiler.warning_flags} {build.stacksmash_flags} -Os -g -free -fipa-pta -mlongcalls -mtext-section-literals -fno-rtti -falign-functions=4 {build.stdcpp_level} -MMD -ffunction-sections -fdata-sections {build.exception_flags} {build.sslflags} {build.mmuflags} {build.non32xferflags} compiler.as.cmd=xtensa-lx106-elf-as @@ -94,10 +98,13 @@ compiler.elf2hex.extra_flags= ## needs git recipe.hooks.sketch.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode header --publickey "{build.source.path}/public.key" --out "{build.path}/core/Updater_Signing.h" # This is quite a working hack. This form of prebuild hook, while intuitive, is not explicitly documented. -recipe.hooks.prebuild.10.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" +recipe.hooks.prebuild.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.makecorever}" --build_path "{build.path}" --platform_path "{runtime.platform.path}" --version "unix-{version}" ## Build the app.ld linker file -recipe.hooks.linking.prelink.1.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" +recipe.hooks.linking.prelink.1.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.mkdir}" -p "{build.path}/ld_h/" +recipe.hooks.linking.prelink.2.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.cp}" "{runtime.platform.path}/tools/sdk/ld/{build.flash_ld}" "{build.path}/ld_h/local.eagle.flash.ld.h" +recipe.hooks.linking.prelink.3.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} {build.mmuflags} "{build.path}/ld_h/local.eagle.flash.ld.h" -o "{build.path}/local.eagle.flash.ld" +recipe.hooks.linking.prelink.4.pattern="{compiler.path}{compiler.c.cmd}" -CC -E -P {build.vtable_flags} {build.mmuflags} "{runtime.platform.path}/tools/sdk/ld/eagle.app.v6.common.ld.h" -o "{build.path}/local.eagle.app.v6.common.ld" ## Compile c files recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.c.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" @@ -106,13 +113,13 @@ recipe.c.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.fla recipe.cpp.o.pattern="{compiler.path}{compiler.cpp.cmd}" {compiler.cpreprocessor.flags} {compiler.cpp.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.cpp.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" ## Compile S files -recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.c.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" +recipe.S.o.pattern="{compiler.path}{compiler.c.cmd}" {compiler.cpreprocessor.flags} {compiler.S.flags} -D{build.sdk}=1 -DF_CPU={build.f_cpu} {build.lwip_flags} {build.debug_port} {build.debug_level} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DARDUINO_ARCH_{build.arch} -DARDUINO_BOARD="{build.board}" {build.led} {build.flash_flags} {compiler.S.extra_flags} {build.extra_flags} {includes} "{source_file}" -o "{object_file}" ## Create archives recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}" ## Combine gc-sections, archives, and objects -recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_flags} -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" +recipe.c.combine.pattern="{compiler.path}{compiler.c.elf.cmd}" {build.exception_flags} -Wl,-Map "-Wl,{build.path}/{build.project_name}.map" {compiler.c.elf.flags} {compiler.c.elf.extra_flags} -o "{build.path}/{build.project_name}.elf" -Wl,--start-group {object_files} "{archive_file_path}" {compiler.c.elf.libs} -Wl,--end-group "-L{build.path}" ## Create eeprom recipe.objcopy.eep.pattern= @@ -120,7 +127,7 @@ recipe.objcopy.eep.pattern= ## Create hex recipe.objcopy.hex.1.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.elf2bin}" --eboot "{runtime.tools.eboot}" --app "{build.path}/{build.project_name}.elf" --flash_mode {build.flash_mode} --flash_freq {build.flash_freq} --flash_size {build.flash_size} --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --out "{build.path}/{build.project_name}.bin" recipe.objcopy.hex.2.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.signing}" --mode sign --privatekey "{build.source.path}/private.key" --bin "{build.path}/{build.project_name}.bin" --out "{build.path}/{build.project_name}.bin.signed" --legacy "{build.path}/{build.project_name}.bin.legacy_sig" -recipe.objcopy.hex.3.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.sizes}" --elf "{build.path}/{build.project_name}.elf" --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" +recipe.objcopy.hex.3.pattern="{runtime.tools.python3.path}/python3" "{runtime.tools.sizes}" --elf "{build.path}/{build.project_name}.elf" --path "{runtime.tools.xtensa-lx106-elf-gcc.path}/bin" --mmu "{build.mmuflags}" ## Save hex recipe.output.tmp_file={build.project_name}.bin diff --git a/tests/common.sh b/tests/common.sh index 930071784..a99ff6a9c 100755 --- a/tests/common.sh +++ b/tests/common.sh @@ -8,15 +8,19 @@ function skip_ino() # Add items to the following list with "\n" netween them to skip running. No spaces, tabs, etc. allowed read -d '' skiplist << EOL || true /#attic/ -/AnalogBinLogger/ -/LowLatencyLogger/ -/LowLatencyLoggerADXL345/ -/LowLatencyLoggerMPU6050/ -/PrintBenchmark/ -/TeensySdioDemo/ +/AvrAdcLogger/ +/BackwardCompatibility/ +/examplesV1/ +/ExFatFormatter/ +/ExFatLogger/ +/ExFatUnicodeTest/ +/RtcTimestampTest/ /SoftwareSpi/ /STM32Test/ -/extras/ +/TeensyRtcTimestamp/ +/TeensySdioDemo/ +/UserChipSelectFunction/ +/UserSPIDriver/ EOL echo $ino | grep -q -F "$skiplist" echo $(( 1 - $? )) @@ -76,7 +80,8 @@ function build_sketches() if [ -e $cache_dir/core/*.a ]; then # We need to preserve the build.options.json file and replace the last .ino # with this sketch's ino file, or builder will throw everything away. - sed -i "s,^.*sketchLocation.*$, \"sketchLocation\": \"$sketch\"\,,g" $build_dir/build.options.json + jq '."sketchLocation" = "'$sketch'"' $build_dir/build.options.json > $build_dir/build.options.json.tmp + mv $build_dir/build.options.json.tmp $build_dir/build.options.json # Set the time of the cached core.a file to the future so the GIT header # we regen won't cause the builder to throw it out and rebuild from scratch. touch -d 'now + 1 day' $cache_dir/core/*.a @@ -104,7 +109,7 @@ function build_sketches() fi echo -e "\n ------------ Building $sketch ------------ \n"; # $arduino --verify $sketch; - if [ "$WINDOWS" == "1" ]; then + if [ "$WINDOWS" == "1" ]; then sketch=$(echo $sketch | sed 's/^\/c//') # MINGW will try to be helpful and silently convert args that look like paths to point to a spot inside the MinGW dir. This breaks everything. # http://www.mingw.org/wiki/Posix_path_conversion @@ -147,20 +152,21 @@ function install_libraries() function install_ide() { - #local idever='nightly' - #local ideurl='https://www.arduino.cc/download.php?f=/arduino-nightly' + local idever='nightly' + local ideurl='https://www.arduino.cc/download.php?f=/arduino-nightly' - local idever='1.8.10' - local ideurl="https://downloads.arduino.cc/arduino-$idever" + #local idever='1.8.10' + #local ideurl="https://downloads.arduino.cc/arduino-$idever" echo "using Arduino IDE distribution ${idever}" local ide_path=$1 local core_path=$2 local debug=$3 + mkdir -p ${core_path}/tools/dist if [ "$WINDOWS" = "1" ]; then - test -r arduino-windows.zip || curl --output arduino-windows.zip -L "${ideurl}-windows.zip" - unzip -q arduino-windows.zip + test -r ${core_path}/tools/dist/arduino-windows.zip || curl --output ${core_path}/tools/dist/arduino-windows.zip -L "${ideurl}-windows.zip" + unzip -q ${core_path}/tools/dist/arduino-windows.zip mv arduino-${idever} arduino-distrib elif [ "$MACOSX" = "1" ]; then # MACOS only has next-to-obsolete Python2 installed. Install Python 3 from python.org @@ -169,13 +175,13 @@ function install_ide() # Install the Python3 certificates, because SSL connections fail w/o them and of course they aren't installed by default. ( cd "/Applications/Python 3.7/" && sudo "./Install Certificates.command" ) # Hack to place arduino-builder in the same spot as sane OSes - test -r arduino-macos.zip || wget -q -O arduino-macos.zip "${ideurl}-macosx.zip" - unzip -q arduino-macos.zip + test -r ${core_path}/tools/dist/arduino-macos.zip || wget -q -O ${core_path}/tools/dist/arduino-macos.zip "${ideurl}-macosx.zip" + unzip -q ${core_path}/tools/dist/arduino-macos.zip mv Arduino.app arduino-distrib mv arduino-distrib/Contents/Java/* arduino-distrib/. else - test -r arduino-linux.tar.xz || wget -q -O arduino-linux.tar.xz "${ideurl}-linux64.tar.xz" - tar xf arduino-linux.tar.xz + test -r ${core_path}/tools/dist/arduino-linux.tar.xz || wget -q -O ${core_path}/tools/dist/arduino-linux.tar.xz "${ideurl}-linux64.tar.xz" + tar xf ${core_path}/tools/dist/arduino-linux.tar.xz mv arduino-${idever} arduino-distrib fi mv arduino-distrib $ide_path diff --git a/tests/host/Makefile b/tests/host/Makefile index 410dc3fb0..4bb6e83b3 100644 --- a/tests/host/Makefile +++ b/tests/host/Makefile @@ -1,13 +1,14 @@ -BINDIR := bin -LCOV_DIRECTORY := lcov -OUTPUT_BINARY := $(BINDIR)/host_tests -CORE_PATH := ../../cores/esp8266 -LIBRARIES_PATH := ../../libraries +CORE_PATH := $(abspath ../../cores/esp8266) +LIBRARIES_PATH := $(abspath ../../libraries) +common = common +HOST_COMMON_ABSPATH := $(abspath $(common)) FORCE32 ?= 1 OPTZ ?= -Os V ?= 0 R ?= noexec +TERM ?= xterm DEFSYM_FS ?= -Wl,--defsym,_FS_start=0x40300000 -Wl,--defsym,_FS_end=0x411FA000 -Wl,--defsym,_FS_page=0x100 -Wl,--defsym,_FS_block=0x2000 -Wl,--defsym,_EEPROM_start=0x411fb000 +RANLIB ?= ranlib MAKEFILE = $(word 1, $(MAKEFILE_LIST)) @@ -33,7 +34,7 @@ CXX ?= g++ endif GCOV ?= gcov VALGRIND ?= valgrind -LCOV ?= lcov +LCOV ?= lcov --gcov-tool $(GCOV) GENHTML ?= genhtml ifeq ($(FORCE32),1) @@ -43,111 +44,129 @@ $(warning Cannot compile in 32 bit mode (g++-multilib is missing?), switching to else N32 = 32 M32 = -m32 -E32 = .32 endif endif ifeq ($(N32),32) $(warning compiling in 32 bits mode) +BINDIR := $(abspath bin32) else $(warning compiling in native mode) +BINDIR := $(abspath bin) endif +OUTPUT_BINARY := $(BINDIR)/host_tests +LCOV_DIRECTORY := $(BINDIR)/../lcov ifeq ($(V), 0) VERBC = @echo "C $@"; VERBCXX = @echo "C++ $@"; VERBLD = @echo "LD $@"; VERBAR = @echo "AR $@"; +VERBRANLIB = @echo "RANLIB $@"; else VERBC = VERBCXX = VERBLD = VERBAR = +VERBRANLIB = endif $(shell mkdir -p $(BINDIR)) -CORE_CPP_FILES := $(addprefix $(CORE_PATH)/,\ - StreamString.cpp \ - Stream.cpp \ - WString.cpp \ - Print.cpp \ - FS.cpp \ - spiffs_api.cpp \ - MD5Builder.cpp \ - ../../libraries/LittleFS/src/LittleFS.cpp \ - core_esp8266_noniso.cpp \ - spiffs/spiffs_cache.cpp \ - spiffs/spiffs_check.cpp \ - spiffs/spiffs_gc.cpp \ - spiffs/spiffs_hydrogen.cpp \ - spiffs/spiffs_nucleus.cpp \ - libb64/cencode.cpp \ - libb64/cdecode.cpp \ - Schedule.cpp \ - HardwareSerial.cpp \ - crc32.cpp \ - Updater.cpp \ +CORE_CPP_FILES := \ + $(addprefix $(abspath $(CORE_PATH))/,\ + debug.cpp \ + StreamString.cpp \ + Stream.cpp \ + WString.cpp \ + Print.cpp \ + FS.cpp \ + spiffs_api.cpp \ + MD5Builder.cpp \ + ../../libraries/LittleFS/src/LittleFS.cpp \ + core_esp8266_noniso.cpp \ + spiffs/spiffs_cache.cpp \ + spiffs/spiffs_check.cpp \ + spiffs/spiffs_gc.cpp \ + spiffs/spiffs_hydrogen.cpp \ + spiffs/spiffs_nucleus.cpp \ + libb64/cencode.cpp \ + libb64/cdecode.cpp \ + Schedule.cpp \ + HardwareSerial.cpp \ + crc32.cpp \ + Updater.cpp \ ) \ - $(addprefix $(LIBRARIES_PATH)/ESP8266SdFat/src/, \ + $(addprefix $(abspath $(LIBRARIES_PATH)/ESP8266SdFat/src)/, \ FatLib/FatFile.cpp \ FatLib/FatFileLFN.cpp \ FatLib/FatFilePrint.cpp \ FatLib/FatFileSFN.cpp \ + FatLib/FatFormatter.cpp \ FatLib/FatVolume.cpp \ - FatLib/FmtNumber.cpp \ - FatLib/StdioStream.cpp \ + FatLib/FatPartition.cpp \ + common/FmtNumber.cpp \ + common/FsStructs.cpp \ + common/FsDateTime.cpp \ + common/PrintBasic.cpp \ ) \ - $(LIBRARIES_PATH)/SDFS/src/SDFS.cpp \ - $(LIBRARIES_PATH)/SD/src/SD.cpp + $(abspath $(LIBRARIES_PATH)/SDFS/src/SDFS.cpp) \ + $(abspath $(LIBRARIES_PATH)/SD/src/SD.cpp) \ -CORE_C_FILES := $(addprefix $(CORE_PATH)/,\ - ../../libraries/LittleFS/src/lfs.c \ - ../../libraries/LittleFS/src/lfs_util.c \ -) +CORE_C_FILES := \ + $(addprefix $(abspath $(CORE_PATH))/,\ + ../../libraries/LittleFS/src/lfs.c \ + ../../libraries/LittleFS/src/lfs_util.c \ + ) -MOCK_CPP_FILES_COMMON := $(addprefix common/,\ - Arduino.cpp \ - flash_hal_mock.cpp \ - spiffs_mock.cpp \ - littlefs_mock.cpp \ - sdfs_mock.cpp \ - WMath.cpp \ - MockUART.cpp \ - MockTools.cpp \ - MocklwIP.cpp \ - MockDigital.cpp \ -) +MOCK_CPP_FILES_COMMON := \ + $(addprefix $(abspath $(HOST_COMMON_ABSPATH))/,\ + Arduino.cpp \ + flash_hal_mock.cpp \ + spiffs_mock.cpp \ + littlefs_mock.cpp \ + sdfs_mock.cpp \ + WMath.cpp \ + MockUART.cpp \ + MockTools.cpp \ + MocklwIP.cpp \ + MockDigital.cpp \ + ) -MOCK_CPP_FILES := $(MOCK_CPP_FILES_COMMON) $(addprefix common/,\ - ArduinoCatch.cpp \ -) +MOCK_CPP_FILES := $(MOCK_CPP_FILES_COMMON) \ + $(addprefix $(HOST_COMMON_ABSPATH)/,\ + ArduinoCatch.cpp \ + ) -MOCK_CPP_FILES_EMU := $(MOCK_CPP_FILES_COMMON) $(addprefix common/,\ - ArduinoMain.cpp \ - ArduinoMainUdp.cpp \ - ArduinoMainSpiffs.cpp \ - ArduinoMainLittlefs.cpp \ - user_interface.cpp \ -) +MOCK_CPP_FILES_EMU := $(MOCK_CPP_FILES_COMMON) \ + $(addprefix $(HOST_COMMON_ABSPATH)/,\ + ArduinoMain.cpp \ + ArduinoMainUdp.cpp \ + ArduinoMainSpiffs.cpp \ + ArduinoMainLittlefs.cpp \ + user_interface.cpp \ + ) -MOCK_C_FILES := $(addprefix common/,\ - md5.c \ - noniso.c \ -) +MOCK_C_FILES := \ + $(addprefix $(HOST_COMMON_ABSPATH)/,\ + md5.c \ + noniso.c \ + ) -INC_PATHS += $(addprefix -I, \ - . \ - common \ - $(CORE_PATH) \ -) +INC_PATHS += \ + $(addprefix -I, \ + . \ + $(common) \ + $(CORE_PATH) \ + ) -INC_PATHS += $(addprefix -I,\ - $(shell echo ../../libraries/*/src) \ - $(shell echo ../../libraries/*) \ - ../../tools/sdk/include \ - ../../tools/sdk/lwip2/include \ -) +INC_PATHS += \ + $(addprefix -I,\ + $(shell echo ../../libraries/*/src) \ + $(shell echo ../../libraries/*) \ + ../../tools/sdk/include \ + ../../tools/sdk/lwip2/include \ + ) TEST_CPP_FILES := \ fs/test_fs.cpp \ @@ -159,8 +178,8 @@ TEST_CPP_FILES := \ core/test_Updater.cpp PREINCLUDES := \ - -include common/mock.h \ - -include common/c_types.h \ + -include $(common)/mock.h \ + -include $(common)/c_types.h \ ifneq ($(D),) OPTZ=-O0 @@ -180,7 +199,7 @@ FLAGS += -Wimplicit-fallthrough=2 # allow "// fall through" comments to stop spu FLAGS += $(USERCFLAGS) CXXFLAGS += -fno-rtti $(FLAGS) -funsigned-char CFLAGS += $(FLAGS) -funsigned-char -LDFLAGS += -coverage $(OPTZ) -g $(M32) +LDFLAGS += $(OPTZ) -g $(M32) LDFLAGS += $(USERLDFLAGS) VALGRINDFLAGS += --leak-check=full --track-origins=yes --error-limit=no --show-leak-kinds=all --error-exitcode=999 CXXFLAGS += -Wno-error=format-security # cores/esp8266/Print.cpp:42:24: error: format not a string literal and no format arguments [-Werror=format-security] -- (os_printf_plus(not_the_best_way)) @@ -190,48 +209,53 @@ remduplicates = $(strip $(if $1,$(firstword $1) $(call remduplicates,$(filter-ou C_SOURCE_FILES = $(MOCK_C_FILES) $(CORE_C_FILES) CPP_SOURCE_FILES = $(MOCK_CPP_FILES) $(CORE_CPP_FILES) $(TEST_CPP_FILES) -C_OBJECTS = $(C_SOURCE_FILES:.c=.c$(E32).o) +C_OBJECTS = $(C_SOURCE_FILES:.c=.c.o) -CPP_OBJECTS_CORE = $(MOCK_CPP_FILES:.cpp=.cpp$(E32).o) $(CORE_CPP_FILES:.cpp=.cpp$(E32).o) -CPP_OBJECTS_TESTS = $(TEST_CPP_FILES:.cpp=.cpp$(E32).o) +CPP_OBJECTS_CORE = $(MOCK_CPP_FILES:.cpp=.cpp.o) $(CORE_CPP_FILES:.cpp=.cpp.o) +CPP_OBJECTS_TESTS = $(TEST_CPP_FILES:.cpp=.cpp.o) CPP_OBJECTS = $(CPP_OBJECTS_CORE) $(CPP_OBJECTS_TESTS) OBJECTS = $(C_OBJECTS) $(CPP_OBJECTS) COVERAGE_FILES = $(OBJECTS:.o=.gc*) +.PHONY: all all: help +.PHONY: CI CI: # run CI - $(MAKE) -f $(MAKEFILE) MKFLAGS="-Werror -coverage" FORCE32=0 OPTZ=-O0 doCI + $(MAKE) -f $(MAKEFILE) MKFLAGS="-Werror --coverage" LDFLAGS="--coverage" FORCE32=0 OPTZ=-O0 doCI +.PHONY: doCI doCI: build-info $(OUTPUT_BINARY) valgrind test gcov test: $(OUTPUT_BINARY) # run host test for CI $(OUTPUT_BINARY) -clean: - make FORCE32=0 cleanarch; make FORCE32=1 cleanarch +.PHONY: clean +clean: clean-lcov clean-objects -cleanarch: clean-objects clean-coverage # clean everything - rm -rf $(BINDIR) +.PHONY: clean-lcov +clean-lcov: + rm -rf $(LCOV_DIRECTORY) +.PHONY: clean-objects clean-objects: - rm -rf $(C_OBJECTS) $(CPP_OBJECTS_CORE) $(CPP_OBJECTS_CORE_EMU) $(CPP_OBJECTS_TESTS) - -clean-coverage: - rm -rf $(COVERAGE_FILES) $(LCOV_DIRECTORY) *.gcov + rm -rf bin bin32 +.PHONY: test gcov: test # run coverage for CI - find $(CORE_PATH) -name "*.gcno" -exec $(GCOV) -r -pb {} + + ( mkdir -p $(BINDIR)/gcov; cd $(BINDIR)/gcov; find . -name "*.gcno" -exec $(GCOV) -s ../.. -r -pb {} + ) +.PHONY: valgrind valgrind: $(OUTPUT_BINARY) mkdir -p $(LCOV_DIRECTORY) - $(LCOV) --directory ../../cores/esp8266/ --zerocounters - $(VALGRIND) $(VALGRINDFLAGS) $(OUTPUT_BINARY) - $(LCOV) --directory $(CORE_PATH) --capture --output-file $(LCOV_DIRECTORY)/app.info + $(LCOV) --directory $(BINDIR) --zerocounters + ( cd $(LCOV_DIRECTORY); $(VALGRIND) $(VALGRINDFLAGS) $(OUTPUT_BINARY) ) + $(LCOV) --directory $(BINDIR) --capture --output-file $(LCOV_DIRECTORY)/app.info -$(GENHTML) $(LCOV_DIRECTORY)/app.info -o $(LCOV_DIRECTORY) +.PHONY: build-info build-info: # show toolchain version @echo "-------- build tools info --------" @echo "CC: " $(CC) @@ -242,22 +266,33 @@ build-info: # show toolchain version @echo "CXXFLAGS: " $(CXXFLAGS) @echo "----------------------------------" --include $(BINDIR)/.*.d +include $(shell find $(BINDIR) -name "*.d" -print) + .SUFFIXES: -.PRECIOUS: %.c$(E32).o -%.c$(E32).o: %.c - $(VERBC) $(CC) $(PREINCLUDES) $(CFLAGS) $(INC_PATHS) -MD -MF $(BINDIR)/.$(notdir $<).d -c -o $@ $< +.PRECIOUS: %.c.o -.PRECIOUS: %.cpp$(E32).o -%.cpp$(E32).o: %.cpp - $(VERBCXX) $(CXX) $(PREINCLUDES) $(CXXFLAGS) $(INC_PATHS) -MD -MF $(BINDIR)/.$(notdir $<).d -c -o $@ $< +$(BINDIR)/%.c.o: %.c + @mkdir -p $(dir $@) + $(VERBC) $(CC) $(PREINCLUDES) $(CFLAGS) $(INC_PATHS) -MD -MF $@.d -c -o $@ $< -$(BINDIR)/core.a: $(C_OBJECTS) $(CPP_OBJECTS_CORE) - ar -rcu $@ $^ - ranlib $@ +%.c.o: %.c + $(VERBC) $(CC) $(PREINCLUDES) $(CFLAGS) $(INC_PATHS) -MD -MF $@.d -c -o $@ $< -$(OUTPUT_BINARY): $(CPP_OBJECTS_TESTS) $(BINDIR)/core.a +.PRECIOUS: %.cpp.o + +$(BINDIR)/%.cpp.o: %.cpp + @mkdir -p $(dir $@) + $(VERBCXX) $(CXX) $(PREINCLUDES) $(CXXFLAGS) $(INC_PATHS) -MD -MF $@.d -c -o $@ $< + +%.cpp.o: %.cpp + $(VERBCXX) $(CXX) $(PREINCLUDES) $(CXXFLAGS) $(INC_PATHS) -MD -MF $@.d -c -o $@ $< + +$(BINDIR)/core.a: $(C_OBJECTS:%=$(BINDIR)/%) $(CPP_OBJECTS_CORE:%=$(BINDIR)/%) + $(AR) rc $@ $^ + $(RANLIB) $@ + +$(OUTPUT_BINARY): $(CPP_OBJECTS_TESTS:%=$(BINDIR)/%) $(BINDIR)/core.a $(VERBLD) $(CXX) $(DEFSYM_FS) $(LDFLAGS) $^ -o $@ ################################################# @@ -268,9 +303,11 @@ ARDUINO_LIBS := \ IPAddress.cpp \ Updater.cpp \ base64.cpp \ + LwipIntf.cpp \ LwipIntfCB.cpp \ + debug.cpp \ ) \ - $(addprefix ../../libraries/ESP8266WiFi/src/,\ + $(addprefix $(abspath ../../libraries/ESP8266WiFi/src)/,\ ESP8266WiFi.cpp \ ESP8266WiFiAP.cpp \ ESP8266WiFiGeneric.cpp \ @@ -286,42 +323,38 @@ ARDUINO_LIBS := \ CertStoreBearSSL.cpp \ ) -OPT_ARDUINO_LIBS ?= $(addprefix ../../libraries/,\ - $(addprefix ESP8266WebServer/src/,\ - detail/mimetable.cpp \ - ) \ - $(addprefix ESP8266mDNS/src/,\ - LEAmDNS.cpp \ - LEAmDNS_Control.cpp \ - LEAmDNS_Helpers.cpp \ - LEAmDNS_Structs.cpp \ - LEAmDNS_Transfer.cpp \ - ESP8266mDNS.cpp \ - LEAmDNS2Host.cpp \ - LEAmDNS2Host_Control.cpp \ - LEAmDNS2Host_Debug.cpp \ - LEAmDNS2Host_Structs.cpp \ - LEAmDNS2Host_Transfer.cpp \ - LEAmDNS2_Backbone.cpp \ - ) \ - ArduinoOTA/ArduinoOTA.cpp \ - DNSServer/src/DNSServer.cpp \ - ESP8266AVRISP/src/ESP8266AVRISP.cpp \ - ESP8266HTTPClient/src/ESP8266HTTPClient.cpp \ -) +OPT_ARDUINO_LIBS ?= \ + $(addprefix $(abspath ../../libraries)/,\ + $(addprefix ESP8266WebServer/src/,\ + detail/mimetable.cpp \ + ) \ + $(addprefix ESP8266mDNS/src/,\ + LEAmDNS.cpp \ + LEAmDNS_Control.cpp \ + LEAmDNS_Helpers.cpp \ + LEAmDNS_Structs.cpp \ + LEAmDNS_Transfer.cpp \ + ESP8266mDNS.cpp \ + ) \ + ArduinoOTA/ArduinoOTA.cpp \ + DNSServer/src/DNSServer.cpp \ + ESP8266AVRISP/src/ESP8266AVRISP.cpp \ + ESP8266HTTPClient/src/ESP8266HTTPClient.cpp \ + ) -MOCK_ARDUINO_LIBS := $(addprefix common/,\ - ClientContextSocket.cpp \ - ClientContextTools.cpp \ - MockWiFiServerSocket.cpp \ - MockWiFiServer.cpp \ - UdpContextSocket.cpp \ - HostWiring.cpp \ - MockEsp.cpp \ - MockEEPROM.cpp \ - MockSPI.cpp \ - strl.cpp \ -) +MOCK_ARDUINO_LIBS := \ + $(addprefix $(HOST_COMMON_ABSPATH)/,\ + ClientContextSocket.cpp \ + ClientContextTools.cpp \ + MockWiFiServerSocket.cpp \ + MockWiFiServer.cpp \ + UdpContextSocket.cpp \ + HostWiring.cpp \ + MockEsp.cpp \ + MockEEPROM.cpp \ + MockSPI.cpp \ + strl.cpp \ + ) CPP_SOURCES_CORE_EMU = \ $(MOCK_CPP_FILES_EMU) \ @@ -344,48 +377,43 @@ USERLIBDIRS = $(shell test -z "$(ULIBPATHS)" || for d in $(ULIBPATHS); do for dd USERLIBSRCS = $(shell test -z "$(ULIBPATHS)" || for d in $(ULIBPATHS); do for ss in $$d/*.cpp $$d/src/*.cpp $$d/src/libmad/*.c; do test -r $$ss && echo $$ss; done; done) INC_PATHS += $(USERLIBDIRS) INC_PATHS += -I$(INODIR)/.. -CPP_OBJECTS_CORE_EMU = $(CPP_SOURCES_CORE_EMU:.cpp=.cpp$(E32).o) $(USERLIBSRCS:.cpp=.cpp$(E32).o) $(USERCXXSOURCES:.cpp=.cpp$(E32).o) -C_OBJECTS_CORE_EMU = $(USERCSOURCES:.c=.c$(E32).o) +CPP_OBJECTS_CORE_EMU = $(CPP_SOURCES_CORE_EMU:.cpp=.cpp.o) $(USERLIBSRCS:.cpp=.cpp.o) $(USERCXXSOURCES:.cpp=.cpp.o) +C_OBJECTS_CORE_EMU = $(USERCSOURCES:.c=.c.o) -bin/fullcore$(E32).a: $(C_OBJECTS) $(CPP_OBJECTS_CORE_EMU) $(C_OBJECTS_CORE_EMU) - $(VERBAR) ar -rcu $@ $^ - $(VERBAR) ranlib $@ +FULLCORE_OBJECTS = $(C_OBJECTS) $(CPP_OBJECTS_CORE_EMU) $(C_OBJECTS_CORE_EMU) +FULLCORE_OBJECTS_ISOLATED = $(FULLCORE_OBJECTS:%.o=$(BINDIR)/%.o) -%: %.ino.cpp$(E32).o bin/fullcore$(E32).a - $(VERBLD) $(CXX) $(LDFLAGS) $< bin/fullcore$(E32).a $(LIBSSL) -o $@ - @echo "----> $@ <----" +$(BINDIR)/fullcore.a: $(FULLCORE_OBJECTS_ISOLATED) + $(VERBAR) $(AR) rc $@ $^ + $(VERBRANLIB) $(RANLIB) $@ -################################################# -# are we in primary make call ? ifeq ($(INO),) -%: %.ino - @# recursive 'make' with paths - $(MAKE) -f $(MAKEFILE) MKFLAGS=-Wextra INODIR=$(dir $@) INO=$(notdir $@) $(BINDIR)/$(notdir $@)/$(notdir $@) \ - USERCFLAGS="$(USERCFLAGS)" \ - USERCSOURCES="$(USERCSOURCES)" \ - USERCXXSOURCES="$(USERCXXSOURCES)" \ - USERLDFLAGS="$(USERLDFLAGS)" - test "$(R)" = noexec || $(BINDIR)/$(notdir $@)/$(notdir $@) $(R) - @# see below the new build rule with fixed output path outside from core location +%: + make INO=$@.ino $(BINDIR)/$(abspath $@) -##################### -# recursive call on ino target else -$(BINDIR)/$(INO)/$(INO).ino.cpp: - @# arduino builder would come around here (.ino -> .ino.cpp) - @mkdir -p $(BINDIR)/$(INO); \ - ( \ - echo "#include <$(INODIR)/$(INO).ino>"; \ - for i in $(INODIR)/*.ino; do \ - test "$$i" = $(INODIR)/$(INO).ino || echo "#include \"$$i\""; \ - done; \ - ) > $(BINDIR)/$(INO)/$(INO).ino.cpp - -endif # recursive -##################### +%: %.ino.cpp.o $(BINDIR)/fullcore.a FORCE + $(VERBLD) $(CXX) $(LDFLAGS) $< $(BINDIR)/fullcore.a $(LIBSSL) -o $@ + mkdir -p $(BINDIR)/$(lastword $(subst /, ,$@)) + ln -sf $@ $(BINDIR)/$(lastword $(subst /, ,$@)) + @echo "----> $(BINDIR)/$(lastword $(subst /, ,$@))/$(lastword $(subst /, ,$@)) <----" + @[ "$(R)" = noexec ] && echo '(not running it, use `make R="[]" ...` for valgrind+gdb)' || $(dir $(MAKEFILE))/valgdb $@ $(R) +FORCE: + +endif + +$(BINDIR)/$(abspath $(INO)).cpp: $(INO) + @# arduino builder would come around here - .ino -> .ino.cpp + @mkdir -p $(dir $@); \ + ( \ + for i in $(dir $<)/*.ino; do \ + echo "#include \"$$i\""; \ + done; \ + ) > $@ + ################################################# .PHONY: list diff --git a/tests/host/README.txt b/tests/host/README.txt index abcbb511a..07c0b276b 100644 --- a/tests/host/README.txt +++ b/tests/host/README.txt @@ -42,8 +42,8 @@ run it: Optional 'V=1' enables makefile verbosity -Optional 'D=1' enables core debug (same as IDE's tools menu) -Optional 'OPTZ=-O2' will update gcc -O option (default is -Os, D=1 implies -O0) +Optional 'D=1' enables core debug messages (same as Arduino IDE's tools/debug menu) +Optional 'OPTZ=-O2' will update gcc -O option (default is -Os, -D=1 implies -O0) Optional 'FORCE32=0' will use native/default gcc (default is FORCE32=1 unless gcc-multilib is not detected) Optional 'R=""' (ex: R="-b -v") runs the executable with given options after build diff --git a/tests/host/common/Arduino.cpp b/tests/host/common/Arduino.cpp index 8a0162b47..c02457f1a 100644 --- a/tests/host/common/Arduino.cpp +++ b/tests/host/common/Arduino.cpp @@ -18,18 +18,24 @@ #include +static struct timeval gtod0 = { 0, 0 }; + extern "C" unsigned long millis() { timeval time; gettimeofday(&time, NULL); - return (time.tv_sec * 1000) + (time.tv_usec / 1000); + if (gtod0.tv_sec == 0) + memcpy(>od0, &time, sizeof gtod0); + return ((time.tv_sec - gtod0.tv_sec) * 1000) + ((time.tv_usec - gtod0.tv_usec) / 1000); } extern "C" unsigned long micros() { timeval time; gettimeofday(&time, NULL); - return (time.tv_sec * 1000000) + time.tv_usec; + if (gtod0.tv_sec == 0) + memcpy(>od0, &time, sizeof gtod0); + return ((time.tv_sec - gtod0.tv_sec) * 1000000) + time.tv_usec - gtod0.tv_usec; } diff --git a/tests/host/common/ArduinoMain.cpp b/tests/host/common/ArduinoMain.cpp index a9d8d696f..051ca0dbc 100644 --- a/tests/host/common/ArduinoMain.cpp +++ b/tests/host/common/ArduinoMain.cpp @@ -295,6 +295,9 @@ int main (int argc, char* const argv []) // install exit handler in case Esp.restart() is called atexit(cleanup); + // first call to millis(): now is millis() and micros() beginning + millis(); + setup(); while (!user_exit) { diff --git a/tests/host/common/MockEsp.cpp b/tests/host/common/MockEsp.cpp index 4394c4162..f06d829f3 100644 --- a/tests/host/common/MockEsp.cpp +++ b/tests/host/common/MockEsp.cpp @@ -247,3 +247,19 @@ uint32_t esp_get_cycle_count() gettimeofday(&t, NULL); return (((uint64_t)t.tv_sec) * 1000000 + t.tv_usec) * (F_CPU / 1000000); } + +void EspClass::setDramHeap() +{ +} + +void EspClass::setIramHeap() +{ +} + +void EspClass::setExternalHeap() +{ +} + +void EspClass::resetHeap() +{ +} diff --git a/tests/host/common/mock.h b/tests/host/common/mock.h index f96194a34..da58c889a 100644 --- a/tests/host/common/mock.h +++ b/tests/host/common/mock.h @@ -99,6 +99,7 @@ uint32_t esp_get_cycle_count(); #ifdef __cplusplus extern "C" { #endif +#include int ets_printf (const char* fmt, ...) __attribute__ ((format (printf, 1, 2))); #define os_printf_plus printf #define ets_vsnprintf vsnprintf diff --git a/tests/host/common/user_interface.cpp b/tests/host/common/user_interface.cpp index f7061e38a..b3a302df1 100644 --- a/tests/host/common/user_interface.cpp +++ b/tests/host/common/user_interface.cpp @@ -41,6 +41,49 @@ #include "MocklwIP.h" +#include + +bool DhcpServer::set_dhcps_lease(struct dhcps_lease *please) +{ + (void)please; + return false; +} + +bool DhcpServer::set_dhcps_lease_time(uint32 minute) +{ + (void)minute; + return false; +} + +bool DhcpServer::set_dhcps_offer_option(uint8 level, void* optarg) +{ + (void)level; + (void)optarg; + return false; +} + +void DhcpServer::end () +{ +} + +bool DhcpServer::begin (struct ip_info *info) +{ + (void)info; + return false; +} + +DhcpServer::DhcpServer (netif* netif) +{ + (void)netif; +} + +DhcpServer::~DhcpServer () +{ + end(); +} + +DhcpServer dhcpSoftAP(nullptr); + extern "C" { diff --git a/tests/host/core/test_string.cpp b/tests/host/core/test_string.cpp index f9fb30a6d..1150ba591 100644 --- a/tests/host/core/test_string.cpp +++ b/tests/host/core/test_string.cpp @@ -245,6 +245,10 @@ TEST_CASE("String nulls", "[core][String]") REQUIRE(s.lastIndexOf("tacos") == -1); REQUIRE(s.lastIndexOf('t', 0) == -1); REQUIRE(s.lastIndexOf('t') == -1); + REQUIRE(s.indexOf(String("tacos"), 1) == -1); + REQUIRE(s.indexOf(String("tacos")) == -1); + REQUIRE(s.indexOf(F("tacos"), 1) == -1); + REQUIRE(s.indexOf(F("tacos")) == -1); REQUIRE(s.indexOf("tacos", 1) == -1); REQUIRE(s.indexOf("tacos") == -1); REQUIRE(s.indexOf('t', 1) == -1); diff --git a/tests/host/fs/test_fs.inc b/tests/host/fs/test_fs.inc index 683f3a99b..b7e7692a4 100644 --- a/tests/host/fs/test_fs.inc +++ b/tests/host/fs/test_fs.inc @@ -220,6 +220,40 @@ TEST_CASE(TESTPRE "Rewriting file frees space immediately (#7426)", TESTPAT) } } +#if FSTYPE != SPIFFS + +// Timestamp setter (#7682, #7775) +static time_t _my_time(void) +{ + struct tm t; + bzero(&t, sizeof(t)); + t.tm_year = 120; + t.tm_mon = 9; + t.tm_mday = 22; + t.tm_hour = 12; + t.tm_min = 13; + t.tm_sec = 14; + return mktime(&t); +} + +TEST_CASE("Verify timeCallback works properly") +{ + FS_MOCK_DECLARE(64, 8, 512, ""); + REQUIRE(FSTYPE.begin()); + + FSTYPE.setTimeCallback(_my_time); + File f = FSTYPE.open("/file.txt", "w"); + f.write("Had we but world enough, and time,"); + f.close(); + time_t expected = _my_time(); + f = FSTYPE.open("/file.txt", "r"); + REQUIRE(abs(f.getCreationTime() - expected) < 60); // FAT has less precision in timestamp than time_t + REQUIRE(abs(f.getLastWrite() - expected) < 60); // FAT has less precision in timestamp than time_t + f.close(); +} + +#endif + #ifdef FS_HAS_DIRS #if FSTYPE != SDFS diff --git a/tests/host/valgdb b/tests/host/valgdb new file mode 100755 index 000000000..7006528d3 --- /dev/null +++ b/tests/host/valgdb @@ -0,0 +1,3 @@ +valgrind --vgdb=full --vgdb-error=0 "$@" & pid=$! +echo "======== TUI: ^p='^' ^n='v' ^f='>' ^b='<' ========" +xterm -e "gdb -ex \"target remote | vgdb --pid=$pid\" -ex \"tui enable\" -ex cont $1; kill -9 $pid" diff --git a/tests/restyle.sh b/tests/restyle.sh index c50c5f641..f2961d63b 100755 --- a/tests/restyle.sh +++ b/tests/restyle.sh @@ -13,6 +13,8 @@ test -d libraries all=" libraries/ESP8266mDNS libraries/Wire +libraries/lwIP* +cores/esp8266/Lwip* cores/esp8266/core_esp8266_si2c.cpp libraries/Netdump " diff --git a/tools/TZupdate.sh b/tools/TZupdate.sh index 4c0d09e80..3c6f41e15 100755 --- a/tools/TZupdate.sh +++ b/tools/TZupdate.sh @@ -36,7 +36,8 @@ cat << EOF // $(date -u) // // This database is autogenerated from IANA timezone database -// https://www.iana.org/time-zones +// ${csv} +// (using https://www.iana.org/time-zones) // and can be updated on demand in this repository // or by yourself using the above script diff --git a/tools/boards.txt.py b/tools/boards.txt.py index f2b99fdc1..506582c22 100755 --- a/tools/boards.txt.py +++ b/tools/boards.txt.py @@ -635,7 +635,7 @@ boards = collections.OrderedDict([ ], }), ( 'd1', { - 'name': 'WeMos D1 R1', + 'name': 'LOLIN(WeMos) D1 R1', 'opts': { '.build.board': 'ESP8266_WEMOS_D1R1', '.build.variant': 'd1', @@ -956,7 +956,7 @@ boards = collections.OrderedDict([ }) ]) - + ################################################################ @@ -1200,6 +1200,27 @@ macros = { ( '.menu.ssl.basic.build.sslflags', '-DBEARSSL_SSL_BASIC'), ]), + ####################### mmu + + 'mmu_menu': collections.OrderedDict([ + ( '.menu.mmu.3232', '32KB cache + 32KB IRAM (balanced)' ), + ( '.menu.mmu.3232.build.mmuflags', '-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x8000'), + ( '.menu.mmu.4816', '16KB cache + 48KB IRAM (IRAM)' ), + ( '.menu.mmu.4816.build.mmuflags', '-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000' ), + ( '.menu.mmu.4816H', '16KB cache + 48KB IRAM and 2nd Heap (shared)' ), + ( '.menu.mmu.4816H.build.mmuflags', '-DMMU_IRAM_SIZE=0xC000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_IRAM_HEAP' ), + ( '.menu.mmu.3216', '16KB cache + 32KB IRAM + 16KB 2nd Heap (not shared)' ), + ( '.menu.mmu.3216.build.mmuflags', '-DMMU_IRAM_SIZE=0x8000 -DMMU_ICACHE_SIZE=0x4000 -DMMU_SEC_HEAP=0x40108000 -DMMU_SEC_HEAP_SIZE=0x4000' ), + ]), + + ######################## Non 32-bit load/store exception handler + + 'non32xfer_menu': collections.OrderedDict([ + ('.menu.non32xfer.fast', 'Use pgm_read macros for IRAM/PROGMEM' ), + ('.menu.non32xfer.fast.build.non32xferflags', ''), + ('.menu.non32xfer.safe', 'Byte/Word access to IRAM/PROGMEM (very slow)' ), + ('.menu.non32xfer.safe.build.non32xferflags', '-DNON32XFER_HANDLER'), + ]) } ################################################################ @@ -1370,7 +1391,8 @@ def flash_map (flashsize_kb, fs_kb = 0): print("{") print(" dport0_0_seg : org = 0x3FF00000, len = 0x10") print(" dram0_0_seg : org = 0x3FFE8000, len = 0x14000") - print(" iram1_0_seg : org = 0x40100000, len = 0x8000") + # Moved to ld/eagle.app.v6.common.ld.h as a 2nd MEMORY command. + # print(" iram1_0_seg : org = 0x40100000, len = MMU_IRAM_SIZE") print(" irom0_0_seg : org = 0x40201010, len = 0x%x" % max_upload_size) print("}") print("") @@ -1561,10 +1583,14 @@ def all_boards (): print('menu.wipe=Erase Flash') print('menu.sdk=Espressif FW') print('menu.ssl=SSL Support') + print('menu.mmu=MMU') + print('menu.non32xfer=Non-32-Bit Access') print('') missingboards = [] - for id in boardlist: + boardlistsortedbydisplayedname = [ k for k in sorted(boardlist, key = lambda item: boards[item]['name']) ] + sortedrequiredfirst = requiredboards + [ item for item in boardlistsortedbydisplayedname if item not in requiredboards ] + for id in sortedrequiredfirst: if id not in boards: missingboards += [ id ]; continue @@ -1579,7 +1605,7 @@ def all_boards (): print(id + optname + '=' + board['opts'][optname]) # macros - macrolist = [ 'defaults', 'cpufreq_menu', 'vtable_menu', 'exception_menu', 'stacksmash_menu', 'ssl_cipher_menu' ] + macrolist = [ 'defaults', 'cpufreq_menu', 'vtable_menu', 'exception_menu', 'stacksmash_menu', 'ssl_cipher_menu', 'mmu_menu', 'non32xfer_menu' ] if 'macro' in board: macrolist += board['macro'] macrolist += [ 'lwip', 'debug_menu', 'flash_erase_menu' ] diff --git a/tools/build.py b/tools/build.py index efb1409ba..791ac30e2 100755 --- a/tools/build.py +++ b/tools/build.py @@ -69,6 +69,8 @@ def compile(tmp_dir, sketch, cache, tools_dir, hardware_dir, ide_path, f, args): 'ResetMethod=nodemcu'.format(**vars(args)) if args.debug_port and args.debug_level: fqbn += 'dbg={debug_port},lvl={debug_level}'.format(**vars(args)) + if args.waveform_phase: + fqbn += ',waveform=phase' cmd += [fqbn] cmd += ['-built-in-libraries', ide_path + '/libraries'] cmd += ['-ide-version=10607'] @@ -115,6 +117,8 @@ def parse_args(): type=int, choices=[40, 80]) parser.add_argument('--debug_port', help='Debug port', choices=['Serial', 'Serial1']) + parser.add_argument('--waveform_phase', action='store_true', + help='Select waveform locked on phase') parser.add_argument('--debug_level', help='Debug level') parser.add_argument('--build_cache', help='Build directory to cache core.a', default='') parser.add_argument('sketch_path', help='Sketch file path') diff --git a/tools/cp.py b/tools/cp.py new file mode 100755 index 000000000..139a61803 --- /dev/null +++ b/tools/cp.py @@ -0,0 +1,18 @@ +#!/usr/bin/env python3 + +# Platform-independent single-file `cp` + +import argparse +import shutil +import sys + +def main(): + parser = argparse.ArgumentParser(description='Platform-independent single-file `cp`') + parser.add_argument('src', action='store') + parser.add_argument('dst', action='store') + ns = parser.parse_args() + shutil.copyfile(ns.src, ns.dst) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/elf2bin.py b/tools/elf2bin.py index ffc3a6208..231bd5e5d 100755 --- a/tools/elf2bin.py +++ b/tools/elf2bin.py @@ -141,6 +141,31 @@ def add_crc(out): with open(out, "wb") as binfile: binfile.write(raw) +def gzip_bin(mode, out): + import gzip + + firmware_path = out + gzip_path = firmware_path + '.gz' + orig_path = firmware_path + '.orig' + if os.path.exists(gzip_path): + os.remove(gzip_path) + print('GZipping firmware ' + firmware_path) + with open(firmware_path, 'rb') as firmware_file, \ + gzip.open(gzip_path, 'wb') as dest: + data = firmware_file.read() + dest.write(data) + orig_size = os.stat(firmware_path).st_size + gzip_size = os.stat(gzip_path).st_size + print("New FW size {:d} bytes vs old {:d} bytes".format( + gzip_size, orig_size)) + + if mode == "PIO": + if os.path.exists(orig_path): + os.remove(orig_path) + print('Moving original firmware to ' + orig_path) + os.rename(firmware_path, orig_path) + os.rename(gzip_path, firmware_path) + def main(): parser = argparse.ArgumentParser(description='Create a BIN file from eboot.elf and Arduino sketch.elf for upload by esptool.py') parser.add_argument('-e', '--eboot', action='store', required=True, help='Path to the Arduino eboot.elf bootloader') @@ -150,6 +175,7 @@ def main(): parser.add_argument('-s', '--flash_size', action='store', required=True, choices=['256K', '512K', '1M', '2M', '4M', '8M', '16M'], help='SPI flash size') parser.add_argument('-o', '--out', action='store', required=True, help='Output BIN filename') parser.add_argument('-p', '--path', action='store', required=True, help='Path to Xtensa toolchain binaries') + parser.add_argument('-g', '--gzip', choices=['PIO', 'Arduino'], help='PIO - generate gzipped BIN file, Arduino - generate BIN and BIN.gz') args = parser.parse_args() @@ -175,6 +201,9 @@ def main(): # Because the CRC includes both eboot and app, can only calculate it after the entire BIN generated add_crc(args.out) + if args.gzip: + gzip_bin(args.gzip, args.out) + return 0 diff --git a/tools/esptool b/tools/esptool index de30f21a2..4fa0bd7b0 160000 --- a/tools/esptool +++ b/tools/esptool @@ -1 +1 @@ -Subproject commit de30f21a222ec62f5a023dd955439b4f57702768 +Subproject commit 4fa0bd7b0d1f69f5ff22b043adc07c5e562a8931 diff --git a/tools/makecorever.py b/tools/makecorever.py index e7bd34868..144466235 100755 --- a/tools/makecorever.py +++ b/tools/makecorever.py @@ -26,7 +26,7 @@ def generate(path, platform_path, git_ver="ffffffff", git_desc="unspecified"): def git(*args): cmd = ["git", "-C", platform_path] cmd.extend(args) - proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True) + proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True, stderr=subprocess.DEVNULL) return proc.stdout.readlines()[0].strip() try: diff --git a/tools/mkdir.py b/tools/mkdir.py new file mode 100755 index 000000000..13fb26326 --- /dev/null +++ b/tools/mkdir.py @@ -0,0 +1,19 @@ +#!/usr/bin/env python3 + +# Platform-independent `mkdir` + +import argparse +import pathlib +import sys + +def main(): + parser = argparse.ArgumentParser(description='Platform-independent `mkdir`') + parser.add_argument('-p', '--parents', action='store_true', required=False, help='no error if existing, make parent directories as needed') + parser.add_argument('dir', action='store', nargs='+') + ns = parser.parse_args() + for p in ns.dir: + pathlib.Path(p).mkdir(parents=ns.parents, exist_ok=True) + return 0 + +if __name__ == '__main__': + sys.exit(main()) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index 1af8ff9a3..679d021a7 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -45,16 +45,21 @@ Builder.match_splitext = scons_patched_match_splitext env = DefaultEnvironment() platform = env.PioPlatform() +board = env.BoardConfig() +gzip_fw = board.get("build.gzip_fw", False) +gzip_switch = [] FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif8266") assert isdir(FRAMEWORK_DIR) +if gzip_fw: + gzip_switch = ["--gzip", "PIO"] env.Append( ASFLAGS=["-x", "assembler-with-cpp"], CFLAGS=[ - "-std=c17", + "-std=gnu17", "-Wpointer-arith", "-Wno-implicit-function-declaration", "-Wl,-EL", @@ -111,7 +116,8 @@ env.Append( join(FRAMEWORK_DIR, "tools", "sdk", "include"), join(FRAMEWORK_DIR, "tools", "sdk", "libc", "xtensa-lx106-elf", "include"), - join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")) + join(FRAMEWORK_DIR, "cores", env.BoardConfig().get("build.core")), + join(platform.get_package_dir("toolchain-xtensa"), "include") ], LIBPATH=[ @@ -145,7 +151,7 @@ env.Append( "--path", '"%s"' % join( platform.get_package_dir("toolchain-xtensa"), "bin"), "--out", "$TARGET" - ]), "Building $TARGET"), + ] + gzip_switch), "Building $TARGET"), suffix=".bin" ) ) @@ -237,6 +243,13 @@ else: LIBS=["lwip2-536-feat"] ) +# +# Waveform +# +if "PIO_FRAMEWORK_ARDUINO_WAVEFORM_LOCKED_PHASE" in flatten_cppdefines: + env.Append(CPPDEFINES=[("WAVEFORM_LOCKED_PHASE", 1)]) +# PIO_FRAMEWORK_ARDUINO_WAVEFORM_LOCKED_PWM will be used by default + # # VTables # @@ -253,17 +266,31 @@ if not current_vtables: env.Append(CPPDEFINES=[current_vtables]) assert current_vtables +current_mmu_iram_size = None +for flag in env["CPPDEFINES"]: + try: + d, val = flag + if str(d).startswith("MMU_IRAM_SIZE"): + current_mmu_iram_size = "{}={}".format(d, val) + except ValueError: + continue +if not current_mmu_iram_size: + current_mmu_iram_size = "MMU_IRAM_SIZE=0x8000" + env.Append(CPPDEFINES=[current_mmu_iram_size]) +assert current_mmu_iram_size + + # Build the eagle.app.v6.common.ld linker file app_ld = env.Command( join("$BUILD_DIR", "ld", "local.eagle.app.v6.common.ld"), join(FRAMEWORK_DIR, "tools", "sdk", "ld", "eagle.app.v6.common.ld.h"), env.VerboseAction( - "$CC -CC -E -P -D%s %s $SOURCE -o $TARGET" % (current_vtables, fp_in_irom), + "$CC -CC -E -P -D%s -D%s %s $SOURCE -o $TARGET" % (current_vtables, current_mmu_iram_size, fp_in_irom), "Generating LD script $TARGET")) env.Depends("$BUILD_DIR/$PROGNAME$PROGSUFFIX", app_ld) if not env.BoardConfig().get("build.ldscript", ""): - env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", "")) + env.Replace(LDSCRIPT_PATH=env.BoardConfig().get("build.arduino.ldscript", "")) # # Dynamic core_version.h for staging builds diff --git a/tools/pyserial b/tools/pyserial index c54c81d93..0e7634747 160000 --- a/tools/pyserial +++ b/tools/pyserial @@ -1 +1 @@ -Subproject commit c54c81d933b847458d465cd77e96cd702ff2e7be +Subproject commit 0e7634747568547b8a7f9fd0c48ed74f16af4b23 diff --git a/tools/sdk/include/bearssl/bearssl_git.h b/tools/sdk/include/bearssl/bearssl_git.h index 5d0ed89b0..fda5ef147 100644 --- a/tools/sdk/include/bearssl/bearssl_git.h +++ b/tools/sdk/include/bearssl/bearssl_git.h @@ -1,2 +1,2 @@ // Do not edit -- Automatically generated by tools/sdk/ssl/bearssl/Makefile -#define BEARSSL_GIT 149e503 +#define BEARSSL_GIT c0b69df diff --git a/tools/sdk/include/ipv4_addr.h b/tools/sdk/include/ipv4_addr.h index 8d8747866..e48d5fee4 100644 --- a/tools/sdk/include/ipv4_addr.h +++ b/tools/sdk/include/ipv4_addr.h @@ -34,13 +34,17 @@ // hence ipv4_addr/t is IPv4 version/copy of IPv4 ip_addr/_t // when IPv6 is enabled so we can deal with IPv4 use from firmware API. -// official lwIP's definitions -#include "lwip/ip_addr.h" -#include - #define ipv4_addr ip4_addr #define ipv4_addr_t ip4_addr_t +// official lwIP's definitions +#include "lwip/ip_addr.h" +#if LWIP_VERSION_MAJOR == 1 +struct ip4_addr { uint32_t addr; }; +typedef struct ip4_addr ip4_addr_t; +#else +#include + // defined in lwip-v1.4 sources only, used in fw struct ip_info { struct ipv4_addr ip; @@ -48,4 +52,5 @@ struct ip_info { struct ipv4_addr gw; }; +#endif #endif // __IPV4_ADDR_H__ diff --git a/tools/sdk/include/sntp.h b/tools/sdk/include/sntp.h index bb85e678b..23275f182 100644 --- a/tools/sdk/include/sntp.h +++ b/tools/sdk/include/sntp.h @@ -18,7 +18,7 @@ uint32 sntp_get_current_timestamp(); /** * get real time (GTM + 8 time zone) */ -char* sntp_get_real_time(long t); +char* sntp_get_real_time(time_t t); /** * SNTP get time_zone default GMT + 8 */ diff --git a/tools/sdk/include/user_interface.h b/tools/sdk/include/user_interface.h index 04d60645a..e69821b37 100644 --- a/tools/sdk/include/user_interface.h +++ b/tools/sdk/include/user_interface.h @@ -382,13 +382,17 @@ void wifi_softap_free_station_info(void); bool wifi_softap_dhcps_start(void); bool wifi_softap_dhcps_stop(void); +#if 1 // dhcp server +// these functions are open-source, in dhcp server, +// which is now moved to lwIPDhcpServer.cpp (lwip2) +// (but still there with lwip1) bool wifi_softap_set_dhcps_lease(struct dhcps_lease *please); bool wifi_softap_get_dhcps_lease(struct dhcps_lease *please); uint32 wifi_softap_get_dhcps_lease_time(void); bool wifi_softap_set_dhcps_lease_time(uint32 minute); bool wifi_softap_reset_dhcps_lease_time(void); - bool wifi_softap_add_dhcps_lease(uint8 *macaddr); // add static lease on the list, this will be the next available @ +#endif // dhcp server enum dhcp_status wifi_softap_dhcps_status(void); bool wifi_softap_set_dhcps_offer_option(uint8 level, void* optarg); diff --git a/tools/sdk/ld/eagle.app.v6.common.ld.h b/tools/sdk/ld/eagle.app.v6.common.ld.h index e18d5f731..c51de9840 100644 --- a/tools/sdk/ld/eagle.app.v6.common.ld.h +++ b/tools/sdk/ld/eagle.app.v6.common.ld.h @@ -1,6 +1,15 @@ /* This linker script generated from xt-genldscripts.tpp for LSP . */ /* Linker Script for ld -N */ +/* The restriction to one MEMORY command, appears to be a restriction in + past versions. https://stackoverflow.com/a/55673816 + This 2nd MEMORY command appears to work fine. +*/ +MEMORY +{ + iram1_0_seg : org = 0x40100000, len = MMU_IRAM_SIZE +} + PHDRS { dport0_0_phdr PT_LOAD; @@ -88,7 +97,7 @@ SECTIONS { *(.noinit) } >dram0_0_seg :dram0_0_phdr - + #ifdef VTABLES_IN_DRAM #include "eagle.app.v6.common.ld.vtables.h" #endif diff --git a/tools/sdk/ld/eagle.flash.16m14m.ld b/tools/sdk/ld/eagle.flash.16m14m.ld index a67ef97d1..13c1243fe 100644 --- a/tools/sdk/ld/eagle.flash.16m14m.ld +++ b/tools/sdk/ld/eagle.flash.16m14m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.16m15m.ld b/tools/sdk/ld/eagle.flash.16m15m.ld index bca117f76..ad689f0e9 100644 --- a/tools/sdk/ld/eagle.flash.16m15m.ld +++ b/tools/sdk/ld/eagle.flash.16m15m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.1m.ld b/tools/sdk/ld/eagle.flash.1m.ld index 57c35adbc..65c4e06ac 100644 --- a/tools/sdk/ld/eagle.flash.1m.ld +++ b/tools/sdk/ld/eagle.flash.1m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xf9ff0 } diff --git a/tools/sdk/ld/eagle.flash.1m128.ld b/tools/sdk/ld/eagle.flash.1m128.ld index f518f08fa..26de47013 100644 --- a/tools/sdk/ld/eagle.flash.1m128.ld +++ b/tools/sdk/ld/eagle.flash.1m128.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xd9ff0 } diff --git a/tools/sdk/ld/eagle.flash.1m144.ld b/tools/sdk/ld/eagle.flash.1m144.ld index 4a4f98651..cb3df4da4 100644 --- a/tools/sdk/ld/eagle.flash.1m144.ld +++ b/tools/sdk/ld/eagle.flash.1m144.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xd5ff0 } diff --git a/tools/sdk/ld/eagle.flash.1m160.ld b/tools/sdk/ld/eagle.flash.1m160.ld index 289c0ad0f..b4a26c4a7 100644 --- a/tools/sdk/ld/eagle.flash.1m160.ld +++ b/tools/sdk/ld/eagle.flash.1m160.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xd1ff0 } diff --git a/tools/sdk/ld/eagle.flash.1m192.ld b/tools/sdk/ld/eagle.flash.1m192.ld index 2b71f41ac..0999e501d 100644 --- a/tools/sdk/ld/eagle.flash.1m192.ld +++ b/tools/sdk/ld/eagle.flash.1m192.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xc9ff0 } diff --git a/tools/sdk/ld/eagle.flash.1m256.ld b/tools/sdk/ld/eagle.flash.1m256.ld index 6a90e9fcb..1e0714123 100644 --- a/tools/sdk/ld/eagle.flash.1m256.ld +++ b/tools/sdk/ld/eagle.flash.1m256.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xb9ff0 } diff --git a/tools/sdk/ld/eagle.flash.1m512.ld b/tools/sdk/ld/eagle.flash.1m512.ld index e3c6db39e..1e3b42f1b 100644 --- a/tools/sdk/ld/eagle.flash.1m512.ld +++ b/tools/sdk/ld/eagle.flash.1m512.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0x79ff0 } diff --git a/tools/sdk/ld/eagle.flash.1m64.ld b/tools/sdk/ld/eagle.flash.1m64.ld index 87032bd02..9fa4bae54 100644 --- a/tools/sdk/ld/eagle.flash.1m64.ld +++ b/tools/sdk/ld/eagle.flash.1m64.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xe9ff0 } diff --git a/tools/sdk/ld/eagle.flash.2m.ld b/tools/sdk/ld/eagle.flash.2m.ld index e39377b28..125f20278 100644 --- a/tools/sdk/ld/eagle.flash.2m.ld +++ b/tools/sdk/ld/eagle.flash.2m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.2m128.ld b/tools/sdk/ld/eagle.flash.2m128.ld index fd71ce458..e15a7896f 100644 --- a/tools/sdk/ld/eagle.flash.2m128.ld +++ b/tools/sdk/ld/eagle.flash.2m128.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.2m1m.ld b/tools/sdk/ld/eagle.flash.2m1m.ld index 172636740..1190e54d7 100644 --- a/tools/sdk/ld/eagle.flash.2m1m.ld +++ b/tools/sdk/ld/eagle.flash.2m1m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.2m256.ld b/tools/sdk/ld/eagle.flash.2m256.ld index 6b72dc167..51259864e 100644 --- a/tools/sdk/ld/eagle.flash.2m256.ld +++ b/tools/sdk/ld/eagle.flash.2m256.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.2m512.ld b/tools/sdk/ld/eagle.flash.2m512.ld index eab32089f..1c495fca0 100644 --- a/tools/sdk/ld/eagle.flash.2m512.ld +++ b/tools/sdk/ld/eagle.flash.2m512.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.2m64.ld b/tools/sdk/ld/eagle.flash.2m64.ld index 61a94b26d..5d4fcddc8 100644 --- a/tools/sdk/ld/eagle.flash.2m64.ld +++ b/tools/sdk/ld/eagle.flash.2m64.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.4m.ld b/tools/sdk/ld/eagle.flash.4m.ld index 31c059807..36e71f64a 100644 --- a/tools/sdk/ld/eagle.flash.4m.ld +++ b/tools/sdk/ld/eagle.flash.4m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.4m1m.ld b/tools/sdk/ld/eagle.flash.4m1m.ld index cf6bd7aa1..5b0c692e7 100644 --- a/tools/sdk/ld/eagle.flash.4m1m.ld +++ b/tools/sdk/ld/eagle.flash.4m1m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.4m2m.ld b/tools/sdk/ld/eagle.flash.4m2m.ld index 9723b9490..554237fb9 100644 --- a/tools/sdk/ld/eagle.flash.4m2m.ld +++ b/tools/sdk/ld/eagle.flash.4m2m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.4m3m.ld b/tools/sdk/ld/eagle.flash.4m3m.ld index a85a1da02..47cf1f93e 100644 --- a/tools/sdk/ld/eagle.flash.4m3m.ld +++ b/tools/sdk/ld/eagle.flash.4m3m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.512k.ld b/tools/sdk/ld/eagle.flash.512k.ld index 44ecf057d..df8d6fd3d 100644 --- a/tools/sdk/ld/eagle.flash.512k.ld +++ b/tools/sdk/ld/eagle.flash.512k.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0x79ff0 } diff --git a/tools/sdk/ld/eagle.flash.512k128.ld b/tools/sdk/ld/eagle.flash.512k128.ld index 63c5a4c6e..86132a9cf 100644 --- a/tools/sdk/ld/eagle.flash.512k128.ld +++ b/tools/sdk/ld/eagle.flash.512k128.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0x59ff0 } diff --git a/tools/sdk/ld/eagle.flash.512k32.ld b/tools/sdk/ld/eagle.flash.512k32.ld index ef031f4cd..12042444a 100644 --- a/tools/sdk/ld/eagle.flash.512k32.ld +++ b/tools/sdk/ld/eagle.flash.512k32.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0x71ff0 } diff --git a/tools/sdk/ld/eagle.flash.512k64.ld b/tools/sdk/ld/eagle.flash.512k64.ld index 3cd80b5da..47a8b1fd1 100644 --- a/tools/sdk/ld/eagle.flash.512k64.ld +++ b/tools/sdk/ld/eagle.flash.512k64.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0x69ff0 } diff --git a/tools/sdk/ld/eagle.flash.8m6m.ld b/tools/sdk/ld/eagle.flash.8m6m.ld index 107745422..f3febe208 100644 --- a/tools/sdk/ld/eagle.flash.8m6m.ld +++ b/tools/sdk/ld/eagle.flash.8m6m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.flash.8m7m.ld b/tools/sdk/ld/eagle.flash.8m7m.ld index 099f801f1..ee4de7108 100644 --- a/tools/sdk/ld/eagle.flash.8m7m.ld +++ b/tools/sdk/ld/eagle.flash.8m7m.ld @@ -10,7 +10,6 @@ MEMORY { dport0_0_seg : org = 0x3FF00000, len = 0x10 dram0_0_seg : org = 0x3FFE8000, len = 0x14000 - iram1_0_seg : org = 0x40100000, len = 0x8000 irom0_0_seg : org = 0x40201010, len = 0xfeff0 } diff --git a/tools/sdk/ld/eagle.rom.addr.v6.ld b/tools/sdk/ld/eagle.rom.addr.v6.ld index 84c5e3acf..e2cff957a 100644 --- a/tools/sdk/ld/eagle.rom.addr.v6.ld +++ b/tools/sdk/ld/eagle.rom.addr.v6.ld @@ -79,6 +79,11 @@ PROVIDE ( _xtos_l1int_handler = 0x4000048c ); PROVIDE ( _xtos_p_none = 0x4000dbf8 ); PROVIDE ( _xtos_restore_intlevel = 0x4000056c ); PROVIDE ( _xtos_return_from_exc = 0x4000dc54 ); + +/* Added to support replacing the ROM _xtos_c_wrapper_handler */ +PROVIDE ( _xtos_c_handler_table = 0x3fffc100 ); +PROVIDE ( _xtos_exc_handler_table = 0x3fffc000 ); + PROVIDE ( _xtos_set_exception_handler = 0x40000454 ); PROVIDE ( _xtos_set_interrupt_handler = 0x4000bd70 ); PROVIDE ( _xtos_set_interrupt_handler_arg = 0x4000bd28 ); diff --git a/tools/sdk/lib/libbearssl.a b/tools/sdk/lib/libbearssl.a index d1dd6d959..f6129a7df 100644 Binary files a/tools/sdk/lib/libbearssl.a and b/tools/sdk/lib/libbearssl.a differ diff --git a/tools/sdk/lib/libgcc.a b/tools/sdk/lib/libgcc.a deleted file mode 100644 index 2848020b5..000000000 Binary files a/tools/sdk/lib/libgcc.a and /dev/null differ diff --git a/tools/sdk/lib/libhal.a b/tools/sdk/lib/libhal.a index b0943c485..5528ff863 100644 Binary files a/tools/sdk/lib/libhal.a and b/tools/sdk/lib/libhal.a differ diff --git a/tools/sdk/lib/liblwip2-1460-feat.a b/tools/sdk/lib/liblwip2-1460-feat.a index 7141e9fa6..077150b28 100644 Binary files a/tools/sdk/lib/liblwip2-1460-feat.a and b/tools/sdk/lib/liblwip2-1460-feat.a differ diff --git a/tools/sdk/lib/liblwip2-1460.a b/tools/sdk/lib/liblwip2-1460.a index b12c0a9be..a0f62e0d4 100644 Binary files a/tools/sdk/lib/liblwip2-1460.a and b/tools/sdk/lib/liblwip2-1460.a differ diff --git a/tools/sdk/lib/liblwip2-536-feat.a b/tools/sdk/lib/liblwip2-536-feat.a index f7fdb3284..fe232ac23 100644 Binary files a/tools/sdk/lib/liblwip2-536-feat.a and b/tools/sdk/lib/liblwip2-536-feat.a differ diff --git a/tools/sdk/lib/liblwip2-536.a b/tools/sdk/lib/liblwip2-536.a index 8086111d2..eef7e0242 100644 Binary files a/tools/sdk/lib/liblwip2-536.a and b/tools/sdk/lib/liblwip2-536.a differ diff --git a/tools/sdk/lib/liblwip6-1460-feat.a b/tools/sdk/lib/liblwip6-1460-feat.a index a174a3f65..0ca9133d4 100644 Binary files a/tools/sdk/lib/liblwip6-1460-feat.a and b/tools/sdk/lib/liblwip6-1460-feat.a differ diff --git a/tools/sdk/lib/liblwip6-536-feat.a b/tools/sdk/lib/liblwip6-536-feat.a index d3253072c..b2373eb22 100644 Binary files a/tools/sdk/lib/liblwip6-536-feat.a and b/tools/sdk/lib/liblwip6-536-feat.a differ diff --git a/tools/sdk/lib/libstdc++-exc.a b/tools/sdk/lib/libstdc++-exc.a index aafe5f7fd..68f3a096a 100644 Binary files a/tools/sdk/lib/libstdc++-exc.a and b/tools/sdk/lib/libstdc++-exc.a differ diff --git a/tools/sdk/lib/libstdc++.a b/tools/sdk/lib/libstdc++.a index 9127d9855..1c7645c78 100644 Binary files a/tools/sdk/lib/libstdc++.a and b/tools/sdk/lib/libstdc++.a differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h b/tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h deleted file mode 100644 index 5fb990700..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/_ansi.h +++ /dev/null @@ -1,140 +0,0 @@ -/* Provide support for both ANSI and non-ANSI environments. */ - -/* Some ANSI environments are "broken" in the sense that __STDC__ cannot be - relied upon to have it's intended meaning. Therefore we must use our own - concoction: _HAVE_STDC. Always use _HAVE_STDC instead of __STDC__ in newlib - sources! - - To get a strict ANSI C environment, define macro __STRICT_ANSI__. This will - "comment out" the non-ANSI parts of the ANSI header files (non-ANSI header - files aren't affected). */ - -#ifndef _ANSIDECL_H_ -#define _ANSIDECL_H_ - -#include -#include - -/* First try to figure out whether we really are in an ANSI C environment. */ -/* FIXME: This probably needs some work. Perhaps sys/config.h can be - prevailed upon to give us a clue. */ - -#ifdef __STDC__ -#define _HAVE_STDC -#endif - -/* ISO C++. */ - -#ifdef __cplusplus -#if !(defined(_BEGIN_STD_C) && defined(_END_STD_C)) -#ifdef _HAVE_STD_CXX -#define _BEGIN_STD_C namespace std { extern "C" { -#define _END_STD_C } } -#else -#define _BEGIN_STD_C extern "C" { -#define _END_STD_C } -#endif -#if __GNUC_PREREQ (3, 3) -#define _NOTHROW __attribute__ ((__nothrow__)) -#else -#define _NOTHROW throw() -#endif -#endif -#else -#define _BEGIN_STD_C -#define _END_STD_C -#define _NOTHROW -#endif - -#ifdef _HAVE_STDC -#define _PTR void * -#define _AND , -#define _NOARGS void -#define _CONST const -#define _VOLATILE volatile -#define _SIGNED signed -#define _DOTS , ... -#define _VOID void -#ifdef __CYGWIN__ -#define _EXFUN_NOTHROW(name, proto) __cdecl name proto _NOTHROW -#define _EXFUN(name, proto) __cdecl name proto -#define _EXPARM(name, proto) (* __cdecl name) proto -#define _EXFNPTR(name, proto) (__cdecl * name) proto -#else -#define _EXFUN_NOTHROW(name, proto) name proto _NOTHROW -#define _EXFUN(name, proto) name proto -#define _EXPARM(name, proto) (* name) proto -#define _EXFNPTR(name, proto) (* name) proto -#endif -#define _DEFUN(name, arglist, args) name(args) -#define _DEFUN_VOID(name) name(_NOARGS) -#define _CAST_VOID (void) -#ifndef _LONG_DOUBLE -#define _LONG_DOUBLE long double -#endif -#ifndef _PARAMS -#define _PARAMS(paramlist) paramlist -#endif -#else -#define _PTR char * -#define _AND ; -#define _NOARGS -#define _CONST -#define _VOLATILE -#define _SIGNED -#define _DOTS -#define _VOID void -#define _EXFUN(name, proto) name() -#define _EXFUN_NOTHROW(name, proto) name() -#define _DEFUN(name, arglist, args) name arglist args; -#define _DEFUN_VOID(name) name() -#define _CAST_VOID -#define _LONG_DOUBLE double -#ifndef _PARAMS -#define _PARAMS(paramlist) () -#endif -#endif - -/* Support gcc's __attribute__ facility. */ - -#ifdef __GNUC__ -#define _ATTRIBUTE(attrs) __attribute__ (attrs) -#else -#define _ATTRIBUTE(attrs) -#endif - -/* The traditional meaning of 'extern inline' for GCC is not - to emit the function body unless the address is explicitly - taken. However this behaviour is changing to match the C99 - standard, which uses 'extern inline' to indicate that the - function body *must* be emitted. Likewise, a function declared - without either 'extern' or 'static' defaults to extern linkage - (C99 6.2.2p5), and the compiler may choose whether to use the - inline version or call the extern linkage version (6.7.4p6). - If we are using GCC, but do not have the new behaviour, we need - to use extern inline; if we are using a new GCC with the - C99-compatible behaviour, or a non-GCC compiler (which we will - have to hope is C99, since there is no other way to achieve the - effect of omitting the function if it isn't referenced) we use - 'static inline', which c99 defines to mean more-or-less the same - as the Gnu C 'extern inline'. */ -#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__) -/* We're using GCC, but without the new C99-compatible behaviour. */ -#define _ELIDABLE_INLINE extern __inline__ _ATTRIBUTE ((__always_inline__)) -#else -/* We're using GCC in C99 mode, or an unknown compiler which - we just have to hope obeys the C99 semantics of inline. */ -#define _ELIDABLE_INLINE static __inline__ -#endif - -#if __GNUC_PREREQ (3, 1) -#define _NOINLINE __attribute__ ((__noinline__)) -#define _NOINLINE_STATIC _NOINLINE static -#else -/* On non-GNU compilers and GCC prior to version 3.1 the compiler can't be - trusted not to inline if it is static. */ -#define _NOINLINE -#define _NOINLINE_STATIC -#endif - -#endif /* _ANSIDECL_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/_syslist.h b/tools/sdk/libc/xtensa-lx106-elf/include/_syslist.h deleted file mode 100644 index 271644efa..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/_syslist.h +++ /dev/null @@ -1,40 +0,0 @@ -/* internal use only -- mapping of "system calls" for libraries that lose - and only provide C names, so that we end up in violation of ANSI */ -#ifndef __SYSLIST_H -#define __SYSLIST_H - -#ifdef MISSING_SYSCALL_NAMES -#define _close close -#define _execve execve -#define _fcntl fcntl -#define _fork fork -#define _fstat fstat -#define _getpid getpid -#define _gettimeofday gettimeofday -#define _isatty isatty -#define _kill kill -#define _link link -#define _lseek lseek -#define _mkdir mkdir -#define _open open -#define _read read -#define _sbrk sbrk -#define _stat stat -#define _times times -#define _unlink unlink -#define _wait wait -#define _write write -#endif /* MISSING_SYSCALL_NAMES */ - -#if defined MISSING_SYSCALL_NAMES || !defined HAVE_OPENDIR -/* If the system call interface is missing opendir, readdir, and - closedir, there is an implementation of these functions in - libc/posix that is implemented using open, getdents, and close. - Note, these functions are currently not in the libc/syscalls - directory. */ -#define _opendir opendir -#define _readdir readdir -#define _closedir closedir -#endif /* MISSING_SYSCALL_NAMES || !HAVE_OPENDIR */ - -#endif /* !__SYSLIST_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/alloca.h b/tools/sdk/libc/xtensa-lx106-elf/include/alloca.h deleted file mode 100644 index 2ea0fd9b3..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/alloca.h +++ /dev/null @@ -1,21 +0,0 @@ -/* libc/include/alloca.h - Allocate memory on stack */ - -/* Written 2000 by Werner Almesberger */ -/* Rearranged for general inclusion by stdlib.h. - 2001, Corinna Vinschen */ - -#ifndef _NEWLIB_ALLOCA_H -#define _NEWLIB_ALLOCA_H - -#include "_ansi.h" -#include - -#undef alloca - -#ifdef __GNUC__ -#define alloca(size) __builtin_alloca(size) -#else -void * _EXFUN(alloca,(size_t)); -#endif - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/ar.h b/tools/sdk/libc/xtensa-lx106-elf/include/ar.h deleted file mode 100644 index ac2e4ca92..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/ar.h +++ /dev/null @@ -1,69 +0,0 @@ -/* $NetBSD: ar.h,v 1.4 1994/10/26 00:55:43 cgd Exp $ */ - -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * This code is derived from software contributed to Berkeley by - * Hugh Smith at The University of Guelph. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)ar.h 8.2 (Berkeley) 1/21/94 - */ - -#ifndef _AR_H_ -#define _AR_H_ - -/* Pre-4BSD archives had these magic numbers in them. */ -#define OARMAG1 0177555 -#define OARMAG2 0177545 - -#define ARMAG "!\n" /* ar "magic number" */ -#define SARMAG 8 /* strlen(ARMAG); */ - -#define AR_EFMT1 "#1/" /* extended format #1 */ - -struct ar_hdr { - char ar_name[16]; /* name */ - char ar_date[12]; /* modification time */ - char ar_uid[6]; /* user id */ - char ar_gid[6]; /* group id */ - char ar_mode[8]; /* octal file permissions */ - char ar_size[10]; /* size in bytes */ -#define ARFMAG "`\n" - char ar_fmag[2]; /* consistency check */ -}; - -#endif /* !_AR_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/argz.h b/tools/sdk/libc/xtensa-lx106-elf/include/argz.h deleted file mode 100644 index 02c9adbf3..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/argz.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#ifndef _ARGZ_H_ -#define _ARGZ_H_ - -#include -#include - -#include "_ansi.h" - -_BEGIN_STD_C - -/* The newlib implementation of these functions assumes that sizeof(char) == 1. */ -error_t argz_create (char *const argv[], char **argz, size_t *argz_len); -error_t argz_create_sep (const char *string, int sep, char **argz, size_t *argz_len); -size_t argz_count (const char *argz, size_t argz_len); -void argz_extract (char *argz, size_t argz_len, char **argv); -void argz_stringify (char *argz, size_t argz_len, int sep); -error_t argz_add (char **argz, size_t *argz_len, const char *str); -error_t argz_add_sep (char **argz, size_t *argz_len, const char *str, int sep); -error_t argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len); -error_t argz_delete (char **argz, size_t *argz_len, char *entry); -error_t argz_insert (char **argz, size_t *argz_len, char *before, const char *entry); -char * argz_next (char *argz, size_t argz_len, const char *entry); -error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count); - -_END_STD_C - -#endif /* _ARGZ_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/assert.h b/tools/sdk/libc/xtensa-lx106-elf/include/assert.h deleted file mode 100644 index f1c89029a..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/assert.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - assert.h -*/ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "_ansi.h" -#include - -#undef assert - -#ifdef NDEBUG /* required by ANSI standard */ -# define assert(__e) ((void)0) -#else -# define assert(__e) ((__e) ? (void)0 : __assert_func (PSTR(__FILE__), __LINE__, \ - __ASSERT_FUNC, PSTR(#__e))) - -# ifndef __ASSERT_FUNC - /* Use g++'s demangled names in C++. */ -# if defined __cplusplus && defined __GNUC__ -# define __ASSERT_FUNC __PRETTY_FUNCTION__ - - /* C99 requires the use of __func__. */ -# elif __STDC_VERSION__ >= 199901L -# define __ASSERT_FUNC __func__ - - /* Older versions of gcc don't have __func__ but can use __FUNCTION__. */ -# elif __GNUC__ >= 2 -# define __ASSERT_FUNC __FUNCTION__ - - /* failed to detect __func__ support. */ -# else -# define __ASSERT_FUNC ((char *) 0) -# endif -# endif /* !__ASSERT_FUNC */ -#endif /* !NDEBUG */ - -void _EXFUN(__assert, (const char *, int, const char *) - _ATTRIBUTE ((__noreturn__))); -void _EXFUN(__assert_func, (const char *, int, const char *, const char *) - _ATTRIBUTE ((__noreturn__))); - -#if __STDC_VERSION__ >= 201112L && !defined __cplusplus -# define static_assert _Static_assert -#endif - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/complex.h b/tools/sdk/libc/xtensa-lx106-elf/include/complex.h deleted file mode 100644 index 969b20e5f..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/complex.h +++ /dev/null @@ -1,124 +0,0 @@ -/* $NetBSD: complex.h,v 1.3 2010/09/15 16:11:30 christos Exp $ */ - -/* - * Written by Matthias Drochner. - * Public domain. - */ - -#ifndef _COMPLEX_H -#define _COMPLEX_H - -#define complex _Complex -#define _Complex_I 1.0fi -#define I _Complex_I - -#include - -__BEGIN_DECLS - -/* 7.3.5 Trigonometric functions */ -/* 7.3.5.1 The cacos functions */ -double complex cacos(double complex); -float complex cacosf(float complex); - -/* 7.3.5.2 The casin functions */ -double complex casin(double complex); -float complex casinf(float complex); - -/* 7.3.5.1 The catan functions */ -double complex catan(double complex); -float complex catanf(float complex); - -/* 7.3.5.1 The ccos functions */ -double complex ccos(double complex); -float complex ccosf(float complex); - -/* 7.3.5.1 The csin functions */ -double complex csin(double complex); -float complex csinf(float complex); - -/* 7.3.5.1 The ctan functions */ -double complex ctan(double complex); -float complex ctanf(float complex); - -/* 7.3.6 Hyperbolic functions */ -/* 7.3.6.1 The cacosh functions */ -double complex cacosh(double complex); -float complex cacoshf(float complex); - -/* 7.3.6.2 The casinh functions */ -double complex casinh(double complex); -float complex casinhf(float complex); - -/* 7.3.6.3 The catanh functions */ -double complex catanh(double complex); -float complex catanhf(float complex); - -/* 7.3.6.4 The ccosh functions */ -double complex ccosh(double complex); -float complex ccoshf(float complex); - -/* 7.3.6.5 The csinh functions */ -double complex csinh(double complex); -float complex csinhf(float complex); - -/* 7.3.6.6 The ctanh functions */ -double complex ctanh(double complex); -float complex ctanhf(float complex); - -/* 7.3.7 Exponential and logarithmic functions */ -/* 7.3.7.1 The cexp functions */ -double complex cexp(double complex); -float complex cexpf(float complex); - -/* 7.3.7.2 The clog functions */ -double complex clog(double complex); -float complex clogf(float complex); - -/* 7.3.8 Power and absolute-value functions */ -/* 7.3.8.1 The cabs functions */ -/*#ifndef __LIBM0_SOURCE__ */ -/* avoid conflict with historical cabs(struct complex) */ -/* double cabs(double complex) __RENAME(__c99_cabs); - float cabsf(float complex) __RENAME(__c99_cabsf); - #endif -*/ -double cabs(double complex) ; -float cabsf(float complex) ; - -/* 7.3.8.2 The cpow functions */ -double complex cpow(double complex, double complex); -float complex cpowf(float complex, float complex); - -/* 7.3.8.3 The csqrt functions */ -double complex csqrt(double complex); -float complex csqrtf(float complex); - -/* 7.3.9 Manipulation functions */ -/* 7.3.9.1 The carg functions */ -double carg(double complex); -float cargf(float complex); - -/* 7.3.9.2 The cimag functions */ -double cimag(double complex); -float cimagf(float complex); -/*long double cimagl(long double complex); */ - -/* 7.3.9.3 The conj functions */ -double complex conj(double complex); -float complex conjf(float complex); -/*long double complex conjl(long double complex); */ - -/* 7.3.9.4 The cproj functions */ -double complex cproj(double complex); -float complex cprojf(float complex); -/*long double complex cprojl(long double complex); */ - -/* 7.3.9.5 The creal functions */ -double creal(double complex); -float crealf(float complex); -/*long double creall(long double complex); */ - -__END_DECLS - -#endif /* ! _COMPLEX_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/config.h b/tools/sdk/libc/xtensa-lx106-elf/include/config.h deleted file mode 100644 index 6159c6f5e..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/config.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef __SYS_CONFIG_H__ -#define __SYS_CONFIG_H__ - -#include /* floating point macros */ -#include /* POSIX defs */ - -/************************************************************************* - esp8266-specific xtensa stuff - *************************************************************************/ - -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif - -/* esp8266 hardware FIFO buffers are 128 bytes */ -#define __BUFSIZ__ 128 - -/************************************************************************* - end of esp8266-specific stuff - *************************************************************************/ - -#ifndef __EXPORT -#define __EXPORT -#endif - -#ifndef __IMPORT -#define __IMPORT -#endif - -/* Define return type of read/write routines. In POSIX, the return type - for read()/write() is "ssize_t" but legacy newlib code has been using - "int" for some time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_RETURN_TYPE -#define _READ_WRITE_RETURN_TYPE int -#endif -/* Define `count' parameter of read/write routines. In POSIX, the `count' - parameter is "size_t" but legacy newlib code has been using "int" for some - time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_BUFSIZE_TYPE -#define _READ_WRITE_BUFSIZE_TYPE int -#endif - -#endif /* __SYS_CONFIG_H__ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/ctype.h b/tools/sdk/libc/xtensa-lx106-elf/include/ctype.h deleted file mode 100644 index 3e1999399..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/ctype.h +++ /dev/null @@ -1,118 +0,0 @@ -#ifndef _CTYPE_H_ -#define _CTYPE_H_ - -#include "_ansi.h" -#include - -_BEGIN_STD_C - -int _EXFUN(isalnum, (int __c)); -int _EXFUN(isalpha, (int __c)); -int _EXFUN(iscntrl, (int __c)); -int _EXFUN(isdigit, (int __c)); -int _EXFUN(isgraph, (int __c)); -int _EXFUN(islower, (int __c)); -int _EXFUN(isprint, (int __c)); -int _EXFUN(ispunct, (int __c)); -int _EXFUN(isspace, (int __c)); -int _EXFUN(isupper, (int __c)); -int _EXFUN(isxdigit,(int __c)); -int _EXFUN(tolower, (int __c)); -int _EXFUN(toupper, (int __c)); - -#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L -int _EXFUN(isblank, (int __c)); -#endif - -#ifndef __STRICT_ANSI__ -int _EXFUN(isascii, (int __c)); -int _EXFUN(toascii, (int __c)); -#define _tolower(__c) ((unsigned char)(__c) - 'A' + 'a') -#define _toupper(__c) ((unsigned char)(__c) - 'a' + 'A') -#endif - -#define _U 01 -#define _L 02 -#define _N 04 -#define _S 010 -#define _P 020 -#define _C 040 -#define _X 0100 -#define _B 0200 - -#ifndef _MB_CAPABLE -_CONST -#endif -extern __IMPORT char *__ctype_ptr__; - -#ifndef __cplusplus -/* These macros are intentionally written in a manner that will trigger - a gcc -Wall warning if the user mistakenly passes a 'char' instead - of an int containing an 'unsigned char'. Note that the sizeof will - always be 1, which is what we want for mapping EOF to __ctype_ptr__[0]; - the use of a raw index inside the sizeof triggers the gcc warning if - __c was of type char, and sizeof masks side effects of the extra __c. - Meanwhile, the real index to __ctype_ptr__+1 must be cast to int, - since isalpha(0x100000001LL) must equal isalpha(1), rather than being - an out-of-bounds reference on a 64-bit machine. */ -#ifdef pgm_read_byte - #define __ctype_lookup(__c) pgm_read_byte(&(__ctype_ptr__+sizeof(""[__c]))[(int)(__c)]) -#else - #define __ctype_lookup(__c) ((__ctype_ptr__+sizeof(""[__c]))[(int)(__c)]) -#endif - -#define isalpha(__c) (__ctype_lookup(__c)&(_U|_L)) -#define isupper(__c) ((__ctype_lookup(__c)&(_U|_L))==_U) -#define islower(__c) ((__ctype_lookup(__c)&(_U|_L))==_L) -#define isdigit(__c) (__ctype_lookup(__c)&_N) -#define isxdigit(__c) (__ctype_lookup(__c)&(_X|_N)) -#define isspace(__c) (__ctype_lookup(__c)&_S) -#define ispunct(__c) (__ctype_lookup(__c)&_P) -#define isalnum(__c) (__ctype_lookup(__c)&(_U|_L|_N)) -#define isprint(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N|_B)) -#define isgraph(__c) (__ctype_lookup(__c)&(_P|_U|_L|_N)) -#define iscntrl(__c) (__ctype_lookup(__c)&_C) - -#if defined(__GNUC__) && \ - (!defined(__STRICT_ANSI__) || __STDC_VERSION__ >= 199901L) -#define isblank(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - (__ctype_lookup(__x)&_B) || (int) (__x) == '\t';}) -#endif - - -/* Non-gcc versions will get the library versions, and will be - slightly slower. These macros are not NLS-aware so they are - disabled if the system supports the extended character sets. */ -# if defined(__GNUC__) -# if !defined (_MB_EXTENDED_CHARSETS_ISO) && !defined (_MB_EXTENDED_CHARSETS_WINDOWS) -# define toupper(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - islower (__x) ? (int) __x - 'a' + 'A' : (int) __x;}) -# define tolower(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - isupper (__x) ? (int) __x - 'A' + 'a' : (int) __x;}) -# else /* _MB_EXTENDED_CHARSETS* */ -/* Allow a gcc warning if the user passed 'char', but defer to the - function. */ -# define toupper(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - (void) __ctype_ptr__[__x]; (toupper) (__x);}) -# define tolower(__c) \ - __extension__ ({ __typeof__ (__c) __x = (__c); \ - (void) __ctype_ptr__[__x]; (tolower) (__x);}) -# endif /* _MB_EXTENDED_CHARSETS* */ -# endif /* __GNUC__ */ -#endif /* !__cplusplus */ - -#ifndef __STRICT_ANSI__ -#define isascii(__c) ((unsigned)(__c)<=0177) -#define toascii(__c) ((__c)&0177) -#endif - -/* For C++ backward-compatibility only. */ -extern __IMPORT _CONST char _ctype_[]; - -_END_STD_C - -#endif /* _CTYPE_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/dirent.h b/tools/sdk/libc/xtensa-lx106-elf/include/dirent.h deleted file mode 100644 index 6fefc03cb..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/dirent.h +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef _DIRENT_H_ -#define _DIRENT_H_ -#ifdef __cplusplus -extern "C" { -#endif -#include - -#if !defined(MAXNAMLEN) && !defined(_POSIX_SOURCE) -#define MAXNAMLEN 1024 -#endif - -#ifdef __cplusplus -} -#endif -#endif /*_DIRENT_H_*/ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/envlock.h b/tools/sdk/libc/xtensa-lx106-elf/include/envlock.h deleted file mode 100644 index 9bb6a813e..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/envlock.h +++ /dev/null @@ -1,15 +0,0 @@ -/* envlock.h -- header file for env routines. */ - -#ifndef _INCLUDE_ENVLOCK_H_ -#define _INCLUDE_ENVLOCK_H_ - -#include <_ansi.h> -#include - -#define ENV_LOCK __env_lock(reent_ptr) -#define ENV_UNLOCK __env_unlock(reent_ptr) - -void _EXFUN(__env_lock,(struct _reent *reent)); -void _EXFUN(__env_unlock,(struct _reent *reent)); - -#endif /* _INCLUDE_ENVLOCK_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/envz.h b/tools/sdk/libc/xtensa-lx106-elf/include/envz.h deleted file mode 100644 index e6a31c31d..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/envz.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#include -#include - -/* The newlib implementation of these functions assumes that sizeof(char) == 1. */ -char * envz_entry (const char *envz, size_t envz_len, const char *name); -char * envz_get (const char *envz, size_t envz_len, const char *name); -error_t envz_add (char **envz, size_t *envz_len, const char *name, const char *value); -error_t envz_merge (char **envz, size_t *envz_len, const char *envz2, size_t envz2_len, int override); -void envz_remove(char **envz, size_t *envz_len, const char *name); -void envz_strip (char **envz, size_t *envz_len); diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/errno.h b/tools/sdk/libc/xtensa-lx106-elf/include/errno.h deleted file mode 100644 index 7cc2ca86f..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/errno.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef __ERRNO_H__ -#define __ERRNO_H__ - -#ifndef __error_t_defined -typedef int error_t; -#define __error_t_defined 1 -#endif - -#include - -#endif /* !__ERRNO_H__ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/fastmath.h b/tools/sdk/libc/xtensa-lx106-elf/include/fastmath.h deleted file mode 100644 index 95eea5f34..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/fastmath.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _FASTMATH_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _FASTMATH_H_ - -#include -#include - -#ifdef __cplusplus -} -#endif -#endif /* _FASTMATH_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/fcntl.h b/tools/sdk/libc/xtensa-lx106-elf/include/fcntl.h deleted file mode 100644 index 86a916775..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/fcntl.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/fenv.h b/tools/sdk/libc/xtensa-lx106-elf/include/fenv.h deleted file mode 100644 index 2fa76f758..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/fenv.h +++ /dev/null @@ -1,88 +0,0 @@ -/* Copyright (c) 2011 Tensilica Inc. ALL RIGHTS RESERVED. - - 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. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "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 - TENSILICA INCORPORATED 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. */ - - -#ifndef _FENV_H -#define _FENV_H - -#ifdef __cplusplus -extern "C" { -#endif - -typedef unsigned long fenv_t; -typedef unsigned long fexcept_t; - -#define FE_DIVBYZERO 0x08 -#define FE_INEXACT 0x01 -#define FE_INVALID 0x10 -#define FE_OVERFLOW 0x04 -#define FE_UNDERFLOW 0x02 - -#define FE_ALL_EXCEPT \ - (FE_DIVBYZERO | \ - FE_INEXACT | \ - FE_INVALID | \ - FE_OVERFLOW | \ - FE_UNDERFLOW) - -#define FE_DOWNWARD 0x3 -#define FE_TONEAREST 0x0 -#define FE_TOWARDZERO 0x1 -#define FE_UPWARD 0x2 - -#define FE_DFL_ENV ((const fenv_t *) 0) - -int feclearexcept(int); -int fegetexceptflag(fexcept_t *, int); -int feraiseexcept(int); -int fesetexceptflag(const fexcept_t *, int); -int fetestexcept(int); -int fegetround(void); -int fesetround(int); -int fegetenv(fenv_t *); -int feholdexcept(fenv_t *); -int fesetenv(const fenv_t *); -int feupdateenv(const fenv_t *); - -/* glibc extensions */ -int feenableexcept(int excepts); -int fedisableexcept(int excepts); -int fegetexcept(void); - -#define _FE_EXCEPTION_FLAGS_OFFSET 7 -#define _FE_EXCEPTION_FLAG_MASK (FE_ALL_EXCEPT << _FE_EXCEPTION_FLAGS_OFFSET) -#define _FE_EXCEPTION_ENABLE_OFFSET 2 -#define _FE_EXCEPTION_ENABLE_MASK (FE_ALL_EXCEPT << _FE_EXCEPTION_ENABLE_OFFSET) -#define _FE_ROUND_MODE_OFFSET 0 -#define _FE_ROUND_MODE_MASK (0x3 << _FE_ROUND_MODE_OFFSET) -#define _FE_FLOATING_ENV_MASK (_FE_EXCEPTION_FLAG_MASK | _FE_EXCEPTION_ENABLE_MASK | _FE_ROUND_MODE_MASK) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/fnmatch.h b/tools/sdk/libc/xtensa-lx106-elf/include/fnmatch.h deleted file mode 100644 index 06311fc4b..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/fnmatch.h +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * $FreeBSD: src/include/fnmatch.h,v 1.10 2002/03/23 17:24:53 imp Exp $ - * @(#)fnmatch.h 8.1 (Berkeley) 6/2/93 - */ - -#ifndef _FNMATCH_H_ -#define _FNMATCH_H_ - -#define FNM_NOMATCH 1 /* Match failed. */ - -#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ -#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ -#define FNM_PERIOD 0x04 /* Period must be matched by period. */ - -#if defined(_GNU_SOURCE) || !defined(_ANSI_SOURCE) && !defined(_POSIX_SOURCE) -#define FNM_LEADING_DIR 0x08 /* Ignore / after Imatch. */ -#define FNM_CASEFOLD 0x10 /* Case insensitive search. */ -#define FNM_IGNORECASE FNM_CASEFOLD -#define FNM_FILE_NAME FNM_PATHNAME -#endif - -#include - -__BEGIN_DECLS -int fnmatch(const char *, const char *, int); -__END_DECLS - -#endif /* !_FNMATCH_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/getopt.h b/tools/sdk/libc/xtensa-lx106-elf/include/getopt.h deleted file mode 100644 index e12d253d4..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/getopt.h +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** - -getopt.h - Read command line options - -AUTHOR: Gregory Pietsch -CREATED Thu Jan 09 22:37:00 1997 - -DESCRIPTION: - -The getopt() function parses the command line arguments. Its arguments argc -and argv are the argument count and array as passed to the main() function -on program invocation. The argument optstring is a list of available option -characters. If such a character is followed by a colon (`:'), the option -takes an argument, which is placed in optarg. If such a character is -followed by two colons, the option takes an optional argument, which is -placed in optarg. If the option does not take an argument, optarg is NULL. - -The external variable optind is the index of the next array element of argv -to be processed; it communicates from one call to the next which element to -process. - -The getopt_long() function works like getopt() except that it also accepts -long options started by two dashes `--'. If these take values, it is either -in the form - ---arg=value - - or - ---arg value - -It takes the additional arguments longopts which is a pointer to the first -element of an array of type GETOPT_LONG_OPTION_T, defined below. The last -element of the array has to be filled with NULL for the name field. - -The longind pointer points to the index of the current long option relative -to longopts if it is non-NULL. - -The getopt() function returns the option character if the option was found -successfully, `:' if there was a missing parameter for one of the options, -`?' for an unknown option character, and EOF for the end of the option list. - -The getopt_long() function's return value is described below. - -The function getopt_long_only() is identical to getopt_long(), except that a -plus sign `+' can introduce long options as well as `--'. - -Describe how to deal with options that follow non-option ARGV-elements. - -If the caller did not specify anything, the default is REQUIRE_ORDER if the -environment variable POSIXLY_CORRECT is defined, PERMUTE otherwise. - -REQUIRE_ORDER means don't recognize them as options; stop option processing -when the first non-option is seen. This is what Unix does. This mode of -operation is selected by either setting the environment variable -POSIXLY_CORRECT, or using `+' as the first character of the optstring -parameter. - -PERMUTE is the default. We permute the contents of ARGV as we scan, so that -eventually all the non-options are at the end. This allows options to be -given in any order, even with programs that were not written to expect this. - -RETURN_IN_ORDER is an option available to programs that were written to -expect options and other ARGV-elements in any order and that care about the -ordering of the two. We describe each non-option ARGV-element as if it were -the argument of an option with character code 1. Using `-' as the first -character of the optstring parameter selects this mode of operation. - -The special argument `--' forces an end of option-scanning regardless of the -value of `ordering'. In the case of RETURN_IN_ORDER, only `--' can cause -getopt() and friends to return EOF with optind != argc. - -COPYRIGHT NOTICE AND DISCLAIMER: - -Copyright (C) 1997 Gregory Pietsch - -This file and the accompanying getopt.c implementation file are hereby -placed in the public domain without restrictions. Just give the author -credit, don't claim you wrote it or prevent anyone else from using it. - -Gregory Pietsch's current e-mail address: -gpietsch@comcast.net -****************************************************************************/ - -/* This is a glibc-extension header file. */ - -#ifndef GETOPT_H -#define GETOPT_H - -#include <_ansi.h> - -/* include files needed by this include file */ - -#define no_argument 0 -#define required_argument 1 -#define optional_argument 2 - -#ifdef __cplusplus -extern "C" -{ - -#endif /* __cplusplus */ - -/* types defined by this include file */ - struct option - { - const char *name; /* the name of the long option */ - int has_arg; /* one of the above macros */ - int *flag; /* determines if getopt_long() returns a - * value for a long option; if it is - * non-NULL, 0 is returned as a function - * value and the value of val is stored in - * the area pointed to by flag. Otherwise, - * val is returned. */ - int val; /* determines the value to return if flag is - * NULL. */ - - }; - -/* While getopt.h is a glibc extension, the following are newlib extensions. - * They are optionally included via the __need_getopt_newlib flag. */ - -#ifdef __need_getopt_newlib - - /* macros defined by this include file */ - #define NO_ARG no_argument - #define REQUIRED_ARG required_argument - #define OPTIONAL_ARG optional_argument - - /* The GETOPT_DATA_INITIALIZER macro is used to initialize a statically- - allocated variable of type struct getopt_data. */ - #define GETOPT_DATA_INITIALIZER {0,0,0,0,0} - - /* These #defines are to make accessing the reentrant functions easier. */ - #define getopt_r __getopt_r - #define getopt_long_r __getopt_long_r - #define getopt_long_only_r __getopt_long_only_r - - /* The getopt_data structure is for reentrancy. Its members are similar to - the externally-defined variables. */ - typedef struct getopt_data - { - char *optarg; - int optind, opterr, optopt, optwhere; - } getopt_data; - -#endif /* __need_getopt_newlib */ - - /* externally-defined variables */ - extern char *optarg; - extern int optind; - extern int opterr; - extern int optopt; - - /* function prototypes */ - int _EXFUN (getopt, - (int __argc, char *const __argv[], const char *__optstring)); - - int _EXFUN (getopt_long, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind)); - - int _EXFUN (getopt_long_only, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind)); - -#ifdef __need_getopt_newlib - int _EXFUN (__getopt_r, - (int __argc, char *const __argv[], const char *__optstring, - struct getopt_data * __data)); - - int _EXFUN (__getopt_long_r, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind, - struct getopt_data * __data)); - - int _EXFUN (__getopt_long_only_r, - (int __argc, char *const __argv[], const char *__shortopts, - const struct option * __longopts, int *__longind, - struct getopt_data * __data)); -#endif /* __need_getopt_newlib */ - -#ifdef __cplusplus -}; - -#endif /* __cplusplus */ - -#endif /* GETOPT_H */ - -/* END OF FILE getopt.h */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/glob.h b/tools/sdk/libc/xtensa-lx106-elf/include/glob.h deleted file mode 100644 index 7a300e69d..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/glob.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Guido van Rossum. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)glob.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/include/glob.h,v 1.6 2002/03/23 17:24:53 imp Exp $ - */ - -#ifndef _GLOB_H_ -#define _GLOB_H_ - -#include - -struct stat; -typedef struct { - int gl_pathc; /* Count of total paths so far. */ - int gl_matchc; /* Count of paths matching pattern. */ - int gl_offs; /* Reserved at beginning of gl_pathv. */ - int gl_flags; /* Copy of flags parameter to glob. */ - char **gl_pathv; /* List of paths matching pattern. */ - /* Copy of errfunc parameter to glob. */ - int (*gl_errfunc)(const char *, int); - - /* - * Alternate filesystem access methods for glob; replacement - * versions of closedir(3), readdir(3), opendir(3), stat(2) - * and lstat(2). - */ - void (*gl_closedir)(void *); - struct dirent *(*gl_readdir)(void *); - void *(*gl_opendir)(const char *); - int (*gl_lstat)(const char *, struct stat *); - int (*gl_stat)(const char *, struct stat *); -} glob_t; - -#define GLOB_APPEND 0x0001 /* Append to output from previous call. */ -#define GLOB_DOOFFS 0x0002 /* Use gl_offs. */ -#define GLOB_ERR 0x0004 /* Return on error. */ -#define GLOB_MARK 0x0008 /* Append / to matching directories. */ -#define GLOB_NOCHECK 0x0010 /* Return pattern itself if nothing matches. */ -#define GLOB_NOSORT 0x0020 /* Don't sort. */ - -#define GLOB_ALTDIRFUNC 0x0040 /* Use alternately specified directory funcs. */ -#define GLOB_BRACE 0x0080 /* Expand braces ala csh. */ -#define GLOB_MAGCHAR 0x0100 /* Pattern had globbing characters. */ -#define GLOB_NOMAGIC 0x0200 /* GLOB_NOCHECK without magic chars (csh). */ -#define GLOB_QUOTE 0x0400 /* Quote special chars with \. */ -#define GLOB_TILDE 0x0800 /* Expand tilde names from the passwd file. */ -#define GLOB_LIMIT 0x1000 /* limit number of returned paths */ - -/* backwards compatibility, this is the old name for this option */ -#define GLOB_MAXPATH GLOB_LIMIT - -#define GLOB_NOSPACE (-1) /* Malloc call failed. */ -#define GLOB_ABEND (-2) /* Unignored error. */ - -__BEGIN_DECLS -int glob(const char *__restrict, int, int (*)(const char *, int), - glob_t *__restrict); -void globfree(glob_t *); -__END_DECLS - -#endif /* !_GLOB_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/grp.h b/tools/sdk/libc/xtensa-lx106-elf/include/grp.h deleted file mode 100644 index c3a5a676c..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/grp.h +++ /dev/null @@ -1,95 +0,0 @@ -/* $NetBSD: grp.h,v 1.7 1995/04/29 05:30:40 cgd Exp $ */ - -/*- - * Copyright (c) 1989, 1993 - * The Regents of the University of California. All rights reserved. - * (c) UNIX System Laboratories, Inc. - * All or some portions of this file are derived from material licensed - * to the University of California by American Telephone and Telegraph - * Co. or Unix System Laboratories, Inc. and are reproduced herein with - * the permission of UNIX System Laboratories, Inc. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)grp.h 8.2 (Berkeley) 1/21/94 - */ - -#ifndef _GRP_H_ -#define _GRP_H_ - -#include -#include -#ifdef __CYGWIN__ -#include -#endif - -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) -#define _PATH_GROUP "/etc/group" -#endif - -struct group { - char *gr_name; /* group name */ - char *gr_passwd; /* group password */ - gid_t gr_gid; /* group id */ - char **gr_mem; /* group members */ -}; - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __INSIDE_CYGWIN__ -struct group *getgrgid (gid_t); -struct group *getgrnam (const char *); -int getgrnam_r (const char *, struct group *, - char *, size_t, struct group **); -int getgrgid_r (gid_t, struct group *, - char *, size_t, struct group **); -#ifndef _POSIX_SOURCE -struct group *getgrent (void); -void setgrent (void); -void endgrent (void); -#ifndef __CYGWIN__ -void setgrfile (const char *); -#endif /* !__CYGWIN__ */ -#ifndef _XOPEN_SOURCE -#ifndef __CYGWIN__ -char *group_from_gid (gid_t, int); -int setgroupent (int); -#endif /* !__CYGWIN__ */ -int initgroups (const char *, gid_t); -#endif /* !_XOPEN_SOURCE */ -#endif /* !_POSIX_SOURCE */ -#endif /* !__INSIDE_CYGWIN__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* !_GRP_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/iconv.h b/tools/sdk/libc/xtensa-lx106-elf/include/iconv.h deleted file mode 100644 index 4c023e9df..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/iconv.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2003-2004, Artem B. Bityuckiy, SoftMine Corporation. - * Rights transferred to Franklin Electronic Publishers. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ -#ifndef _ICONV_H_ -#define _ICONV_H_ - -#include <_ansi.h> -#include -#include -#include - -/* iconv_t: charset conversion descriptor type */ -typedef _iconv_t iconv_t; - -_BEGIN_STD_C - -#ifndef _REENT_ONLY -iconv_t -_EXFUN(iconv_open, (_CONST char *, _CONST char *)); - -size_t -_EXFUN(iconv, (iconv_t, char **__restrict, size_t *__restrict, - char **__restrict, size_t *__restrict)); - -int -_EXFUN(iconv_close, (iconv_t)); -#endif - -iconv_t -_EXFUN(_iconv_open_r, (struct _reent *, _CONST char *, _CONST char *)); - -size_t -_EXFUN(_iconv_r, (struct _reent *, iconv_t, _CONST char **, - size_t *, char **, size_t *)); - -int -_EXFUN(_iconv_close_r, (struct _reent *, iconv_t)); - -_END_STD_C - -#endif /* #ifndef _ICONV_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/ieeefp.h b/tools/sdk/libc/xtensa-lx106-elf/include/ieeefp.h deleted file mode 100644 index 0b06fb786..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/ieeefp.h +++ /dev/null @@ -1,256 +0,0 @@ -#ifndef _IEEE_FP_H_ -#define _IEEE_FP_H_ - -#include "_ansi.h" - -#include - -_BEGIN_STD_C - -/* FIXME FIXME FIXME: - Neither of __ieee_{float,double}_shape_tape seem to be used anywhere - except in libm/test. If that is the case, please delete these from here. - If that is not the case, please insert documentation here describing why - they're needed. */ - -#ifdef __IEEE_BIG_ENDIAN - -typedef union -{ - double value; - struct - { - unsigned int sign : 1; - unsigned int exponent: 11; - unsigned int fraction0:4; - unsigned int fraction1:16; - unsigned int fraction2:16; - unsigned int fraction3:16; - - } number; - struct - { - unsigned int sign : 1; - unsigned int exponent: 11; - unsigned int quiet:1; - unsigned int function0:3; - unsigned int function1:16; - unsigned int function2:16; - unsigned int function3:16; - } nan; - struct - { - unsigned long msw; - unsigned long lsw; - } parts; - long aslong[2]; -} __ieee_double_shape_type; - -#endif - -#ifdef __IEEE_LITTLE_ENDIAN - -typedef union -{ - double value; - struct - { -#ifdef __SMALL_BITFIELDS - unsigned int fraction3:16; - unsigned int fraction2:16; - unsigned int fraction1:16; - unsigned int fraction0: 4; -#else - unsigned int fraction1:32; - unsigned int fraction0:20; -#endif - unsigned int exponent :11; - unsigned int sign : 1; - } number; - struct - { -#ifdef __SMALL_BITFIELDS - unsigned int function3:16; - unsigned int function2:16; - unsigned int function1:16; - unsigned int function0:3; -#else - unsigned int function1:32; - unsigned int function0:19; -#endif - unsigned int quiet:1; - unsigned int exponent: 11; - unsigned int sign : 1; - } nan; - struct - { - unsigned long lsw; - unsigned long msw; - } parts; - - long aslong[2]; - -} __ieee_double_shape_type; - -#endif - -#ifdef __IEEE_BIG_ENDIAN - -typedef union -{ - float value; - struct - { - unsigned int sign : 1; - unsigned int exponent: 8; - unsigned int fraction0: 7; - unsigned int fraction1: 16; - } number; - struct - { - unsigned int sign:1; - unsigned int exponent:8; - unsigned int quiet:1; - unsigned int function0:6; - unsigned int function1:16; - } nan; - long p1; - -} __ieee_float_shape_type; - -#endif - -#ifdef __IEEE_LITTLE_ENDIAN - -typedef union -{ - float value; - struct - { - unsigned int fraction0: 7; - unsigned int fraction1: 16; - unsigned int exponent: 8; - unsigned int sign : 1; - } number; - struct - { - unsigned int function1:16; - unsigned int function0:6; - unsigned int quiet:1; - unsigned int exponent:8; - unsigned int sign:1; - } nan; - long p1; - -} __ieee_float_shape_type; - -#endif - - - - - -/* FLOATING ROUNDING */ - -typedef int fp_rnd; -#define FP_RN 0 /* Round to nearest */ -#define FP_RM 1 /* Round down */ -#define FP_RP 2 /* Round up */ -#define FP_RZ 3 /* Round to zero (trunate) */ - -fp_rnd _EXFUN(fpgetround,(void)); -fp_rnd _EXFUN(fpsetround, (fp_rnd)); - -/* EXCEPTIONS */ - -typedef int fp_except; -#define FP_X_INV 0x10 /* Invalid operation */ -#define FP_X_DX 0x80 /* Divide by zero */ -#define FP_X_OFL 0x04 /* Overflow exception */ -#define FP_X_UFL 0x02 /* Underflow exception */ -#define FP_X_IMP 0x01 /* imprecise exception */ - -fp_except _EXFUN(fpgetmask,(void)); -fp_except _EXFUN(fpsetmask,(fp_except)); -fp_except _EXFUN(fpgetsticky,(void)); -fp_except _EXFUN(fpsetsticky, (fp_except)); - -/* INTEGER ROUNDING */ - -typedef int fp_rdi; -#define FP_RDI_TOZ 0 /* Round to Zero */ -#define FP_RDI_RD 1 /* Follow float mode */ - -fp_rdi _EXFUN(fpgetroundtoi,(void)); -fp_rdi _EXFUN(fpsetroundtoi,(fp_rdi)); - -#undef isnan -#undef isinf - -int _EXFUN(isnan, (double)); -int _EXFUN(isinf, (double)); -int _EXFUN(finite, (double)); - - - -int _EXFUN(isnanf, (float)); -int _EXFUN(isinff, (float)); -int _EXFUN(finitef, (float)); - -#define __IEEE_DBL_EXPBIAS 1023 -#define __IEEE_FLT_EXPBIAS 127 - -#define __IEEE_DBL_EXPLEN 11 -#define __IEEE_FLT_EXPLEN 8 - - -#define __IEEE_DBL_FRACLEN (64 - (__IEEE_DBL_EXPLEN + 1)) -#define __IEEE_FLT_FRACLEN (32 - (__IEEE_FLT_EXPLEN + 1)) - -#define __IEEE_DBL_MAXPOWTWO ((double)(1L << 32 - 2) * (1L << (32-11) - 32 + 1)) -#define __IEEE_FLT_MAXPOWTWO ((float)(1L << (32-8) - 1)) - -#define __IEEE_DBL_NAN_EXP 0x7ff -#define __IEEE_FLT_NAN_EXP 0xff - -#ifndef __ieeefp_isnanf -#define __ieeefp_isnanf(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \ - ((*(long *)&(x) & 0x007fffffL)!=0000000000L)) -#endif -#define isnanf(x) __ieeefp_isnanf(x) - -#ifndef __ieeefp_isinff -#define __ieeefp_isinff(x) (((*(long *)&(x) & 0x7f800000L)==0x7f800000L) && \ - ((*(long *)&(x) & 0x007fffffL)==0000000000L)) -#endif -#define isinff(x) __ieeefp_isinff(x) - -#ifndef __ieeefp_finitef -#define __ieeefp_finitef(x) (((*(long *)&(x) & 0x7f800000L)!=0x7f800000L)) -#endif -#define finitef(x) __ieeefp_finitef(x) - -#ifdef _DOUBLE_IS_32BITS -#undef __IEEE_DBL_EXPBIAS -#define __IEEE_DBL_EXPBIAS __IEEE_FLT_EXPBIAS - -#undef __IEEE_DBL_EXPLEN -#define __IEEE_DBL_EXPLEN __IEEE_FLT_EXPLEN - -#undef __IEEE_DBL_FRACLEN -#define __IEEE_DBL_FRACLEN __IEEE_FLT_FRACLEN - -#undef __IEEE_DBL_MAXPOWTWO -#define __IEEE_DBL_MAXPOWTWO __IEEE_FLT_MAXPOWTWO - -#undef __IEEE_DBL_NAN_EXP -#define __IEEE_DBL_NAN_EXP __IEEE_FLT_NAN_EXP - -#undef __ieee_double_shape_type -#define __ieee_double_shape_type __ieee_float_shape_type - -#endif /* _DOUBLE_IS_32BITS */ - -_END_STD_C - -#endif /* _IEEE_FP_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/inttypes.h b/tools/sdk/libc/xtensa-lx106-elf/include/inttypes.h deleted file mode 100644 index 39bf13511..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/inttypes.h +++ /dev/null @@ -1,319 +0,0 @@ -/* - * Copyright (c) 2004, 2005 by - * Ralf Corsepius, Ulm/Germany. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -/** - * @file inttypes.h - */ - -#ifndef _INTTYPES_H -#define _INTTYPES_H - -#include -#include -#include -#define __need_wchar_t -#include - -#define __STRINGIFY(a) #a - -/* 8-bit types */ -#define __PRI8(x) __STRINGIFY(x) - -/* NOTICE: scanning 8-bit types requires use of the hh specifier - * which is only supported on newlib platforms that - * are built with C99 I/O format support enabled. If the flag in - * newlib.h hasn't been set during configuration to indicate this, the 8-bit - * scanning format macros are disabled here as they result in undefined - * behaviour which can include memory overwrite. Overriding the flag after the - * library has been built is not recommended as it will expose the underlying - * undefined behaviour. - */ - -#if defined(_WANT_IO_C99_FORMATS) - #define __SCN8(x) __STRINGIFY(hh##x) -#endif /* _WANT_IO_C99_FORMATS */ - - -#define PRId8 __PRI8(d) -#define PRIi8 __PRI8(i) -#define PRIo8 __PRI8(o) -#define PRIu8 __PRI8(u) -#define PRIx8 __PRI8(x) -#define PRIX8 __PRI8(X) - -/* Macros below are only enabled for a newlib built with C99 I/O format support. */ -#if defined(_WANT_IO_C99_FORMATS) - -#define SCNd8 __SCN8(d) -#define SCNi8 __SCN8(i) -#define SCNo8 __SCN8(o) -#define SCNu8 __SCN8(u) -#define SCNx8 __SCN8(x) - -#endif /* _WANT_IO_C99_FORMATS */ - - -#define PRIdLEAST8 __PRI8(d) -#define PRIiLEAST8 __PRI8(i) -#define PRIoLEAST8 __PRI8(o) -#define PRIuLEAST8 __PRI8(u) -#define PRIxLEAST8 __PRI8(x) -#define PRIXLEAST8 __PRI8(X) - -/* Macros below are only enabled for a newlib built with C99 I/O format support. */ -#if defined(_WANT_IO_C99_FORMATS) - - #define SCNdLEAST8 __SCN8(d) - #define SCNiLEAST8 __SCN8(i) - #define SCNoLEAST8 __SCN8(o) - #define SCNuLEAST8 __SCN8(u) - #define SCNxLEAST8 __SCN8(x) - -#endif /* _WANT_IO_C99_FORMATS */ - -#define PRIdFAST8 __PRI8(d) -#define PRIiFAST8 __PRI8(i) -#define PRIoFAST8 __PRI8(o) -#define PRIuFAST8 __PRI8(u) -#define PRIxFAST8 __PRI8(x) -#define PRIXFAST8 __PRI8(X) - -/* Macros below are only enabled for a newlib built with C99 I/O format support. */ -#if defined(_WANT_IO_C99_FORMATS) - - #define SCNdFAST8 __SCN8(d) - #define SCNiFAST8 __SCN8(i) - #define SCNoFAST8 __SCN8(o) - #define SCNuFAST8 __SCN8(u) - #define SCNxFAST8 __SCN8(x) - -#endif /* _WANT_IO_C99_FORMATS */ - -/* 16-bit types */ -#define __PRI16(x) __STRINGIFY(x) -#define __SCN16(x) __STRINGIFY(h##x) - - -#define PRId16 __PRI16(d) -#define PRIi16 __PRI16(i) -#define PRIo16 __PRI16(o) -#define PRIu16 __PRI16(u) -#define PRIx16 __PRI16(x) -#define PRIX16 __PRI16(X) - -#define SCNd16 __SCN16(d) -#define SCNi16 __SCN16(i) -#define SCNo16 __SCN16(o) -#define SCNu16 __SCN16(u) -#define SCNx16 __SCN16(x) - - -#define PRIdLEAST16 __PRI16(d) -#define PRIiLEAST16 __PRI16(i) -#define PRIoLEAST16 __PRI16(o) -#define PRIuLEAST16 __PRI16(u) -#define PRIxLEAST16 __PRI16(x) -#define PRIXLEAST16 __PRI16(X) - -#define SCNdLEAST16 __SCN16(d) -#define SCNiLEAST16 __SCN16(i) -#define SCNoLEAST16 __SCN16(o) -#define SCNuLEAST16 __SCN16(u) -#define SCNxLEAST16 __SCN16(x) - - -#define PRIdFAST16 __PRI16(d) -#define PRIiFAST16 __PRI16(i) -#define PRIoFAST16 __PRI16(o) -#define PRIuFAST16 __PRI16(u) -#define PRIxFAST16 __PRI16(x) -#define PRIXFAST16 __PRI16(X) - -#define SCNdFAST16 __SCN16(d) -#define SCNiFAST16 __SCN16(i) -#define SCNoFAST16 __SCN16(o) -#define SCNuFAST16 __SCN16(u) -#define SCNxFAST16 __SCN16(x) - -/* 32-bit types */ -#if __have_long32 -#define __PRI32(x) __STRINGIFY(l##x) -#define __SCN32(x) __STRINGIFY(l##x) -#else -#define __PRI32(x) __STRINGIFY(x) -#define __SCN32(x) __STRINGIFY(x) -#endif - -#define PRId32 __PRI32(d) -#define PRIi32 __PRI32(i) -#define PRIo32 __PRI32(o) -#define PRIu32 __PRI32(u) -#define PRIx32 __PRI32(x) -#define PRIX32 __PRI32(X) - -#define SCNd32 __SCN32(d) -#define SCNi32 __SCN32(i) -#define SCNo32 __SCN32(o) -#define SCNu32 __SCN32(u) -#define SCNx32 __SCN32(x) - - -#define PRIdLEAST32 __PRI32(d) -#define PRIiLEAST32 __PRI32(i) -#define PRIoLEAST32 __PRI32(o) -#define PRIuLEAST32 __PRI32(u) -#define PRIxLEAST32 __PRI32(x) -#define PRIXLEAST32 __PRI32(X) - -#define SCNdLEAST32 __SCN32(d) -#define SCNiLEAST32 __SCN32(i) -#define SCNoLEAST32 __SCN32(o) -#define SCNuLEAST32 __SCN32(u) -#define SCNxLEAST32 __SCN32(x) - - -#define PRIdFAST32 __PRI32(d) -#define PRIiFAST32 __PRI32(i) -#define PRIoFAST32 __PRI32(o) -#define PRIuFAST32 __PRI32(u) -#define PRIxFAST32 __PRI32(x) -#define PRIXFAST32 __PRI32(X) - -#define SCNdFAST32 __SCN32(d) -#define SCNiFAST32 __SCN32(i) -#define SCNoFAST32 __SCN32(o) -#define SCNuFAST32 __SCN32(u) -#define SCNxFAST32 __SCN32(x) - - -/* 64-bit types */ -#if __have_long64 -#define __PRI64(x) __STRINGIFY(l##x) -#define __SCN64(x) __STRINGIFY(l##x) -#elif __have_longlong64 -#define __PRI64(x) __STRINGIFY(ll##x) -#define __SCN64(x) __STRINGIFY(ll##x) -#else -#define __PRI64(x) __STRINGIFY(x) -#define __SCN64(x) __STRINGIFY(x) -#endif - -#define PRId64 __PRI64(d) -#define PRIi64 __PRI64(i) -#define PRIo64 __PRI64(o) -#define PRIu64 __PRI64(u) -#define PRIx64 __PRI64(x) -#define PRIX64 __PRI64(X) - -#define SCNd64 __SCN64(d) -#define SCNi64 __SCN64(i) -#define SCNo64 __SCN64(o) -#define SCNu64 __SCN64(u) -#define SCNx64 __SCN64(x) - -#if __int64_t_defined -#define PRIdLEAST64 __PRI64(d) -#define PRIiLEAST64 __PRI64(i) -#define PRIoLEAST64 __PRI64(o) -#define PRIuLEAST64 __PRI64(u) -#define PRIxLEAST64 __PRI64(x) -#define PRIXLEAST64 __PRI64(X) - -#define SCNdLEAST64 __SCN64(d) -#define SCNiLEAST64 __SCN64(i) -#define SCNoLEAST64 __SCN64(o) -#define SCNuLEAST64 __SCN64(u) -#define SCNxLEAST64 __SCN64(x) - - -#define PRIdFAST64 __PRI64(d) -#define PRIiFAST64 __PRI64(i) -#define PRIoFAST64 __PRI64(o) -#define PRIuFAST64 __PRI64(u) -#define PRIxFAST64 __PRI64(x) -#define PRIXFAST64 __PRI64(X) - -#define SCNdFAST64 __SCN64(d) -#define SCNiFAST64 __SCN64(i) -#define SCNoFAST64 __SCN64(o) -#define SCNuFAST64 __SCN64(u) -#define SCNxFAST64 __SCN64(x) -#endif - -/* max-bit types */ -#if __have_long64 -#define __PRIMAX(x) __STRINGIFY(l##x) -#define __SCNMAX(x) __STRINGIFY(l##x) -#elif __have_longlong64 -#define __PRIMAX(x) __STRINGIFY(ll##x) -#define __SCNMAX(x) __STRINGIFY(ll##x) -#else -#define __PRIMAX(x) __STRINGIFY(x) -#define __SCNMAX(x) __STRINGIFY(x) -#endif - -#define PRIdMAX __PRIMAX(d) -#define PRIiMAX __PRIMAX(i) -#define PRIoMAX __PRIMAX(o) -#define PRIuMAX __PRIMAX(u) -#define PRIxMAX __PRIMAX(x) -#define PRIXMAX __PRIMAX(X) - -#define SCNdMAX __SCNMAX(d) -#define SCNiMAX __SCNMAX(i) -#define SCNoMAX __SCNMAX(o) -#define SCNuMAX __SCNMAX(u) -#define SCNxMAX __SCNMAX(x) - -/* ptr types */ -#if defined(_UINTPTR_EQ_ULONGLONG) -# define __PRIPTR(x) __STRINGIFY(ll##x) -# define __SCNPTR(x) __STRINGIFY(ll##x) -#elif defined(_UINTPTR_EQ_ULONG) -# define __PRIPTR(x) __STRINGIFY(l##x) -# define __SCNPTR(x) __STRINGIFY(l##x) -#else -# define __PRIPTR(x) __STRINGIFY(x) -# define __SCNPTR(x) __STRINGIFY(x) -#endif - -#define PRIdPTR __PRIPTR(d) -#define PRIiPTR __PRIPTR(i) -#define PRIoPTR __PRIPTR(o) -#define PRIuPTR __PRIPTR(u) -#define PRIxPTR __PRIPTR(x) -#define PRIXPTR __PRIPTR(X) - -#define SCNdPTR __SCNPTR(d) -#define SCNiPTR __SCNPTR(i) -#define SCNoPTR __SCNPTR(o) -#define SCNuPTR __SCNPTR(u) -#define SCNxPTR __SCNPTR(x) - - -typedef struct { - intmax_t quot; - intmax_t rem; -} imaxdiv_t; - -#ifdef __cplusplus -extern "C" { -#endif - -extern intmax_t imaxabs(intmax_t j); -extern imaxdiv_t imaxdiv(intmax_t numer, intmax_t denomer); -extern intmax_t strtoimax(const char *__restrict, char **__restrict, int); -extern uintmax_t strtoumax(const char *__restrict, char **__restrict, int); -extern intmax_t wcstoimax(const wchar_t *__restrict, wchar_t **__restrict, int); -extern uintmax_t wcstoumax(const wchar_t *__restrict, wchar_t **__restrict, int); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/langinfo.h b/tools/sdk/libc/xtensa-lx106-elf/include/langinfo.h deleted file mode 100644 index 9040adeff..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/langinfo.h +++ /dev/null @@ -1,316 +0,0 @@ -/*- - * Copyright (c) 2001 Alexey Zelkin - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * $FreeBSD: src/include/langinfo.h,v 1.5 2002/03/23 17:24:53 imp Exp $ - */ - -#ifndef _LANGINFO_H_ -#define _LANGINFO_H_ - -#include -#include -#include - -typedef int nl_item; - -enum __nl_item -{ - /* POSIX and BSD defined items have to stick to the original values - to maintain backward compatibility. */ - _NL_CTYPE_CODESET_NAME = 0, /* codeset name */ -#define CODESET _NL_CTYPE_CODESET_NAME - D_T_FMT, /* string for formatting date and time */ -#define D_T_FMT D_T_FMT - D_FMT, /* date format string */ -#define D_FMT D_FMT - T_FMT, /* time format string */ -#define T_FMT T_FMT - T_FMT_AMPM, /* a.m. or p.m. time formatting string */ -#define T_FMT_AMPM T_FMT_AMPM - AM_STR, /* Ante Meridian affix */ -#define AM_STR AM_STR - PM_STR, /* Post Meridian affix */ -#define PM_STR PM_STR - -/* week day names */ - DAY_1, -#define DAY_1 DAY_1 - DAY_2, -#define DAY_2 DAY_2 - DAY_3, -#define DAY_3 DAY_3 - DAY_4, -#define DAY_4 DAY_4 - DAY_5, -#define DAY_5 DAY_5 - DAY_6, -#define DAY_6 DAY_6 - DAY_7, -#define DAY_7 DAY_7 - -/* abbreviated week day names */ - ABDAY_1, -#define ABDAY_1 ABDAY_1 - ABDAY_2, -#define ABDAY_2 ABDAY_2 - ABDAY_3, -#define ABDAY_3 ABDAY_3 - ABDAY_4, -#define ABDAY_4 ABDAY_4 - ABDAY_5, -#define ABDAY_5 ABDAY_5 - ABDAY_6, -#define ABDAY_6 ABDAY_6 - ABDAY_7, -#define ABDAY_7 ABDAY_7 - -/* month names */ - MON_1, -#define MON_1 MON_1 - MON_2, -#define MON_2 MON_2 - MON_3, -#define MON_3 MON_3 - MON_4, -#define MON_4 MON_4 - MON_5, -#define MON_5 MON_5 - MON_6, -#define MON_6 MON_6 - MON_7, -#define MON_7 MON_7 - MON_8, -#define MON_8 MON_8 - MON_9, -#define MON_9 MON_9 - MON_10, -#define MON_10 MON_10 - MON_11, -#define MON_11 MON_11 - MON_12, -#define MON_12 MON_12 - -/* abbreviated month names */ - ABMON_1, -#define ABMON_1 ABMON_1 - ABMON_2, -#define ABMON_2 ABMON_2 - ABMON_3, -#define ABMON_3 ABMON_3 - ABMON_4, -#define ABMON_4 ABMON_4 - ABMON_5, -#define ABMON_5 ABMON_5 - ABMON_6, -#define ABMON_6 ABMON_6 - ABMON_7, -#define ABMON_7 ABMON_7 - ABMON_8, -#define ABMON_8 ABMON_8 - ABMON_9, -#define ABMON_9 ABMON_9 - ABMON_10, -#define ABMON_10 ABMON_10 - ABMON_11, -#define ABMON_11 ABMON_11 - ABMON_12, -#define ABMON_12 ABMON_12 - - ERA, /* era description segments */ -#define ERA ERA - ERA_D_FMT, /* era date format string */ -#define ERA_D_FMT ERA_D_FMT - ERA_D_T_FMT, /* era date and time format string */ -#define ERA_D_T_FMT ERA_D_T_FMT - ERA_T_FMT, /* era time format string */ -#define ERA_T_FMT ERA_T_FMT - ALT_DIGITS, /* alternative symbols for digits */ -#define ALT_DIGITS ALT_DIGITS - - RADIXCHAR, /* radix char */ -#define RADIXCHAR RADIXCHAR - THOUSEP, /* separator for thousands */ -#define THOUSEP THOUSEP - - YESEXPR, /* affirmative response expression */ -#define YESEXPR YESEXPR - NOEXPR, /* negative response expression */ -#define NOEXPR NOEXPR - YESSTR, /* affirmative response for yes/no queries */ -#define YESSTR YESSTR - NOSTR, /* negative response for yes/no queries */ -#define NOSTR NOSTR - - CRNCYSTR, /* currency symbol */ -#define CRNCYSTR CRNCYSTR - - D_MD_ORDER, /* month/day order (BSD extension) */ -#define D_MD_ORDER D_MD_ORDER - - _NL_TIME_DATE_FMT = 84, /* date fmt used by date(1) (GNU extension) */ -#define _DATE_FMT _NL_TIME_DATE_FMT - -#ifdef __HAVE_LOCALE_INFO__ - _NL_CTYPE_MB_CUR_MAX, - _NL_MESSAGES_CODESET, - -#ifdef __HAVE_LOCALE_INFO_EXTENDED__ - - /* NOTE: - - Always maintain the order and position of existing entries! - Always append new entry to the list, prior to the definition - of _NL_LOCALE_EXTENDED_LAST_ENTRY. */ - - _NL_LOCALE_EXTENDED_FIRST_ENTRY, - - _NL_CTYPE_OUTDIGITS0_MB, - _NL_CTYPE_OUTDIGITS1_MB, - _NL_CTYPE_OUTDIGITS2_MB, - _NL_CTYPE_OUTDIGITS3_MB, - _NL_CTYPE_OUTDIGITS4_MB, - _NL_CTYPE_OUTDIGITS5_MB, - _NL_CTYPE_OUTDIGITS6_MB, - _NL_CTYPE_OUTDIGITS7_MB, - _NL_CTYPE_OUTDIGITS8_MB, - _NL_CTYPE_OUTDIGITS9_MB, - _NL_CTYPE_OUTDIGITS0_WC, - _NL_CTYPE_OUTDIGITS1_WC, - _NL_CTYPE_OUTDIGITS2_WC, - _NL_CTYPE_OUTDIGITS3_WC, - _NL_CTYPE_OUTDIGITS4_WC, - _NL_CTYPE_OUTDIGITS5_WC, - _NL_CTYPE_OUTDIGITS6_WC, - _NL_CTYPE_OUTDIGITS7_WC, - _NL_CTYPE_OUTDIGITS8_WC, - _NL_CTYPE_OUTDIGITS9_WC, - - _NL_TIME_CODESET, - _NL_TIME_WMON_1, - _NL_TIME_WMON_2, - _NL_TIME_WMON_3, - _NL_TIME_WMON_4, - _NL_TIME_WMON_5, - _NL_TIME_WMON_6, - _NL_TIME_WMON_7, - _NL_TIME_WMON_8, - _NL_TIME_WMON_9, - _NL_TIME_WMON_10, - _NL_TIME_WMON_11, - _NL_TIME_WMON_12, - _NL_TIME_WMONTH_1, - _NL_TIME_WMONTH_2, - _NL_TIME_WMONTH_3, - _NL_TIME_WMONTH_4, - _NL_TIME_WMONTH_5, - _NL_TIME_WMONTH_6, - _NL_TIME_WMONTH_7, - _NL_TIME_WMONTH_8, - _NL_TIME_WMONTH_9, - _NL_TIME_WMONTH_10, - _NL_TIME_WMONTH_11, - _NL_TIME_WMONTH_12, - _NL_TIME_WWDAY_1, - _NL_TIME_WWDAY_2, - _NL_TIME_WWDAY_3, - _NL_TIME_WWDAY_4, - _NL_TIME_WWDAY_5, - _NL_TIME_WWDAY_6, - _NL_TIME_WWDAY_7, - _NL_TIME_WWEEKDAY_1, - _NL_TIME_WWEEKDAY_2, - _NL_TIME_WWEEKDAY_3, - _NL_TIME_WWEEKDAY_4, - _NL_TIME_WWEEKDAY_5, - _NL_TIME_WWEEKDAY_6, - _NL_TIME_WWEEKDAY_7, - _NL_TIME_WT_FMT, - _NL_TIME_WD_FMT, - _NL_TIME_WD_T_FMT, - _NL_TIME_WAM_STR, - _NL_TIME_WPM_STR, - _NL_TIME_WDATE_FMT, - _NL_TIME_WT_FMT_AMPM, - _NL_TIME_WERA, - _NL_TIME_WERA_D_FMT, - _NL_TIME_WERA_D_T_FMT, - _NL_TIME_WERA_T_FMT, - _NL_TIME_WALT_DIGITS, - - _NL_NUMERIC_CODESET, - _NL_NUMERIC_GROUPING, - _NL_NUMERIC_DECIMAL_POINT_WC, - _NL_NUMERIC_THOUSANDS_SEP_WC, - - _NL_MONETARY_INT_CURR_SYMBOL, - _NL_MONETARY_CURRENCY_SYMBOL, - _NL_MONETARY_MON_DECIMAL_POINT, - _NL_MONETARY_MON_THOUSANDS_SEP, - _NL_MONETARY_MON_GROUPING, - _NL_MONETARY_POSITIVE_SIGN, - _NL_MONETARY_NEGATIVE_SIGN, - _NL_MONETARY_INT_FRAC_DIGITS, - _NL_MONETARY_FRAC_DIGITS, - _NL_MONETARY_P_CS_PRECEDES, - _NL_MONETARY_P_SEP_BY_SPACE, - _NL_MONETARY_N_CS_PRECEDES, - _NL_MONETARY_N_SEP_BY_SPACE, - _NL_MONETARY_P_SIGN_POSN, - _NL_MONETARY_N_SIGN_POSN, - _NL_MONETARY_INT_P_CS_PRECEDES, - _NL_MONETARY_INT_P_SEP_BY_SPACE, - _NL_MONETARY_INT_N_CS_PRECEDES, - _NL_MONETARY_INT_N_SEP_BY_SPACE, - _NL_MONETARY_INT_P_SIGN_POSN, - _NL_MONETARY_INT_N_SIGN_POSN, - _NL_MONETARY_CODESET, - _NL_MONETARY_WINT_CURR_SYMBOL, - _NL_MONETARY_WCURRENCY_SYMBOL, - _NL_MONETARY_WMON_DECIMAL_POINT, - _NL_MONETARY_WMON_THOUSANDS_SEP, - _NL_MONETARY_WPOSITIVE_SIGN, - _NL_MONETARY_WNEGATIVE_SIGN, - - _NL_MESSAGES_WYESEXPR, - _NL_MESSAGES_WNOEXPR, - _NL_MESSAGES_WYESSTR, - _NL_MESSAGES_WNOSTR, - - _NL_COLLATE_CODESET, - - /* This MUST be the last entry since it's used to check for an array - index in nl_langinfo(). */ - _NL_LOCALE_EXTENDED_LAST_ENTRY - -#endif /* __HAVE_LOCALE_INFO_EXTENDED__ */ -#endif /* __HAVE_LOCALE_INFO__ */ - -}; - -__BEGIN_DECLS -char *nl_langinfo(nl_item); -__END_DECLS - -#endif /* !_LANGINFO_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/libgen.h b/tools/sdk/libc/xtensa-lx106-elf/include/libgen.h deleted file mode 100644 index abfab0e5c..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/libgen.h +++ /dev/null @@ -1,23 +0,0 @@ -/* - * libgen.h - defined by XPG4 - */ - -#ifndef _LIBGEN_H_ -#define _LIBGEN_H_ - -#include "_ansi.h" -#include - -#ifdef __cplusplus -extern "C" { -#endif - -char *_EXFUN(basename, (char *)); -char *_EXFUN(dirname, (char *)); - -#ifdef __cplusplus -} -#endif - -#endif /* _LIBGEN_H_ */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/limits.h b/tools/sdk/libc/xtensa-lx106-elf/include/limits.h deleted file mode 100644 index 190f1f783..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/limits.h +++ /dev/null @@ -1,146 +0,0 @@ -#ifndef _LIBC_LIMITS_H_ -# define _LIBC_LIMITS_H_ 1 - -#include - -# ifdef _MB_LEN_MAX -# define MB_LEN_MAX _MB_LEN_MAX -# else -# define MB_LEN_MAX 1 -# endif - -/* Maximum number of positional arguments, if _WANT_IO_POS_ARGS. */ -# ifndef NL_ARGMAX -# define NL_ARGMAX 32 -# endif - -/* if do not have #include_next support, then we - have to define the limits here. */ -# if !defined __GNUC__ || __GNUC__ < 2 - -# ifndef _LIMITS_H -# define _LIMITS_H 1 - -# include - -/* Number of bits in a `char'. */ -# undef CHAR_BIT -# define CHAR_BIT 8 - -/* Minimum and maximum values a `signed char' can hold. */ -# undef SCHAR_MIN -# define SCHAR_MIN (-128) -# undef SCHAR_MAX -# define SCHAR_MAX 127 - -/* Maximum value an `unsigned char' can hold. (Minimum is 0). */ -# undef UCHAR_MAX -# define UCHAR_MAX 255 - -/* Minimum and maximum values a `char' can hold. */ -# ifdef __CHAR_UNSIGNED__ -# undef CHAR_MIN -# define CHAR_MIN 0 -# undef CHAR_MAX -# define CHAR_MAX 255 -# else -# undef CHAR_MIN -# define CHAR_MIN (-128) -# undef CHAR_MAX -# define CHAR_MAX 127 -# endif - -/* Minimum and maximum values a `signed short int' can hold. */ -# undef SHRT_MIN -/* For the sake of 16 bit hosts, we may not use -32768 */ -# define SHRT_MIN (-32767-1) -# undef SHRT_MAX -# define SHRT_MAX 32767 - -/* Maximum value an `unsigned short int' can hold. (Minimum is 0). */ -# undef USHRT_MAX -# define USHRT_MAX 65535 - -/* Minimum and maximum values a `signed int' can hold. */ -# ifndef __INT_MAX__ -# define __INT_MAX__ 2147483647 -# endif -# undef INT_MIN -# define INT_MIN (-INT_MAX-1) -# undef INT_MAX -# define INT_MAX __INT_MAX__ - -/* Maximum value an `unsigned int' can hold. (Minimum is 0). */ -# undef UINT_MAX -# define UINT_MAX (INT_MAX * 2U + 1) - -/* Minimum and maximum values a `signed long int' can hold. - (Same as `int'). */ -# ifndef __LONG_MAX__ -# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) || defined (__sparcv9) -# define __LONG_MAX__ 9223372036854775807L -# else -# define __LONG_MAX__ 2147483647L -# endif /* __alpha__ || sparc64 */ -# endif -# undef LONG_MIN -# define LONG_MIN (-LONG_MAX-1) -# undef LONG_MAX -# define LONG_MAX __LONG_MAX__ - -/* Maximum value an `unsigned long int' can hold. (Minimum is 0). */ -# undef ULONG_MAX -# define ULONG_MAX (LONG_MAX * 2UL + 1) - -# ifndef __LONG_LONG_MAX__ -# define __LONG_LONG_MAX__ 9223372036854775807LL -# endif - -# if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LLONG_MIN -# define LLONG_MIN (-LLONG_MAX-1) -# undef LLONG_MAX -# define LLONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULLONG_MAX -# define ULLONG_MAX (LLONG_MAX * 2ULL + 1) -# endif - -# if defined (__GNU_LIBRARY__) ? defined (__USE_GNU) : !defined (__STRICT_ANSI__) -/* Minimum and maximum values a `signed long long int' can hold. */ -# undef LONG_LONG_MIN -# define LONG_LONG_MIN (-LONG_LONG_MAX-1) -# undef LONG_LONG_MAX -# define LONG_LONG_MAX __LONG_LONG_MAX__ - -/* Maximum value an `unsigned long long int' can hold. (Minimum is 0). */ -# undef ULONG_LONG_MAX -# define ULONG_LONG_MAX (LONG_LONG_MAX * 2ULL + 1) -# endif - -# endif /* _LIMITS_H */ -# endif /* GCC 2. */ - -#endif /* !_LIBC_LIMITS_H_ */ - -#if defined __GNUC__ && !defined _GCC_LIMITS_H_ -/* `_GCC_LIMITS_H_' is what GCC's file defines. */ -# include_next -#endif /* __GNUC__ && !_GCC_LIMITS_H_ */ - -#ifndef _POSIX2_RE_DUP_MAX -/* The maximum number of repeated occurrences of a regular expression - * permitted when using the interval notation `\{M,N\}'. */ -#define _POSIX2_RE_DUP_MAX 255 -#endif /* _POSIX2_RE_DUP_MAX */ - -#ifndef ARG_MAX -#define ARG_MAX 4096 -#endif - -#ifndef PATH_MAX -#define PATH_MAX 4096 -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/locale.h b/tools/sdk/libc/xtensa-lx106-elf/include/locale.h deleted file mode 100644 index cbd658e41..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/locale.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - locale.h - Values appropriate for the formatting of monetary and other - numberic quantities. -*/ - -#ifndef _LOCALE_H_ -#define _LOCALE_H_ - -#include "_ansi.h" - -#define __need_NULL -#include - -#define LC_ALL 0 -#define LC_COLLATE 1 -#define LC_CTYPE 2 -#define LC_MONETARY 3 -#define LC_NUMERIC 4 -#define LC_TIME 5 -#define LC_MESSAGES 6 - -_BEGIN_STD_C - -struct lconv -{ - char *decimal_point; - char *thousands_sep; - char *grouping; - char *int_curr_symbol; - char *currency_symbol; - char *mon_decimal_point; - char *mon_thousands_sep; - char *mon_grouping; - char *positive_sign; - char *negative_sign; - char int_frac_digits; - char frac_digits; - char p_cs_precedes; - char p_sep_by_space; - char n_cs_precedes; - char n_sep_by_space; - char p_sign_posn; - char n_sign_posn; - char int_n_cs_precedes; - char int_n_sep_by_space; - char int_n_sign_posn; - char int_p_cs_precedes; - char int_p_sep_by_space; - char int_p_sign_posn; -}; - -#ifndef _REENT_ONLY -char *_EXFUN(setlocale,(int category, const char *locale)); -struct lconv *_EXFUN(localeconv,(void)); -#endif - -struct _reent; -char *_EXFUN(_setlocale_r,(struct _reent *, int category, const char *locale)); -struct lconv *_EXFUN(_localeconv_r,(struct _reent *)); - -_END_STD_C - -#endif /* _LOCALE_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/_default_types.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/_default_types.h deleted file mode 100644 index 03bdc523e..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/_default_types.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * _default_types implementation for xtensa lx106 arch - * - * Simplified version of generic _default_types.h, ignores gcc - * built-in standard types. - */ - -#ifndef _MACHINE__DEFAULT_TYPES_H -#define _MACHINE__DEFAULT_TYPES_H - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -typedef signed char __int8_t ; -typedef unsigned char __uint8_t ; -#define ___int8_t_defined 1 - -typedef signed short __int16_t; -typedef unsigned short __uint16_t; -#define ___int16_t_defined 1 - -typedef signed int __int32_t; -typedef unsigned int __uint32_t; -#define ___int32_t_defined 1 - -typedef signed long long __int64_t; -typedef unsigned long long __uint64_t; -#define ___int64_t_defined 1 - -typedef __int8_t __int_least8_t; -typedef __uint8_t __uint_least8_t; -#define ___int_least8_t_defined - -typedef __int16_t __int_least16_t; -typedef __uint16_t __uint_least16_t; -#define ___int_least16_t_defined - -typedef __int32_t __int_least32_t; -typedef __uint32_t __uint_least32_t; -#define ___int_least32_t_defined - -typedef __int64_t __int_least64_t; -typedef __uint64_t __uint_least64_t; -#define ___int_least64_t_defined - -typedef __INTPTR_TYPE__ __intptr_t; -typedef __UINTPTR_TYPE__ __uintptr_t; - -#ifdef __cplusplus -} -#endif - -#endif /* _MACHINE__DEFAULT_TYPES_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/_types.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/_types.h deleted file mode 100644 index 17e6d51e3..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/_types.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * $Id$ - */ - -#ifndef _MACHINE__TYPES_H -#define _MACHINE__TYPES_H -#include -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/ansi.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/ansi.h deleted file mode 100644 index 737b6d066..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/ansi.h +++ /dev/null @@ -1 +0,0 @@ -/* dummy header file to support BSD compiler */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/endian.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/endian.h deleted file mode 100644 index 07ebc8f63..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/endian.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __MACHINE_ENDIAN_H__ - -#include - -#ifndef BIG_ENDIAN -#define BIG_ENDIAN 4321 -#endif -#ifndef LITTLE_ENDIAN -#define LITTLE_ENDIAN 1234 -#endif - -#ifndef BYTE_ORDER -#if defined(__IEEE_LITTLE_ENDIAN) || defined(__IEEE_BYTES_LITTLE_ENDIAN) -#define BYTE_ORDER LITTLE_ENDIAN -#else -#define BYTE_ORDER BIG_ENDIAN -#endif -#endif - -#endif /* __MACHINE_ENDIAN_H__ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/fastmath.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/fastmath.h deleted file mode 100644 index b13befa22..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/fastmath.h +++ /dev/null @@ -1,100 +0,0 @@ -#ifdef __sysvnecv70_target -double EXFUN(fast_sin,(double)); -double EXFUN(fast_cos,(double)); -double EXFUN(fast_tan,(double)); - -double EXFUN(fast_asin,(double)); -double EXFUN(fast_acos,(double)); -double EXFUN(fast_atan,(double)); - -double EXFUN(fast_sinh,(double)); -double EXFUN(fast_cosh,(double)); -double EXFUN(fast_tanh,(double)); - -double EXFUN(fast_asinh,(double)); -double EXFUN(fast_acosh,(double)); -double EXFUN(fast_atanh,(double)); - -double EXFUN(fast_abs,(double)); -double EXFUN(fast_sqrt,(double)); -double EXFUN(fast_exp2,(double)); -double EXFUN(fast_exp10,(double)); -double EXFUN(fast_expe,(double)); -double EXFUN(fast_log10,(double)); -double EXFUN(fast_log2,(double)); -double EXFUN(fast_loge,(double)); - - -#define sin(x) fast_sin(x) -#define cos(x) fast_cos(x) -#define tan(x) fast_tan(x) -#define asin(x) fast_asin(x) -#define acos(x) fast_acos(x) -#define atan(x) fast_atan(x) -#define sinh(x) fast_sinh(x) -#define cosh(x) fast_cosh(x) -#define tanh(x) fast_tanh(x) -#define asinh(x) fast_asinh(x) -#define acosh(x) fast_acosh(x) -#define atanh(x) fast_atanh(x) -#define abs(x) fast_abs(x) -#define sqrt(x) fast_sqrt(x) -#define exp2(x) fast_exp2(x) -#define exp10(x) fast_exp10(x) -#define expe(x) fast_expe(x) -#define log10(x) fast_log10(x) -#define log2(x) fast_log2(x) -#define loge(x) fast_loge(x) - -#ifdef _HAVE_STDC -/* These functions are in assembler, they really do take floats. This - can only be used with a real ANSI compiler */ - -float EXFUN(fast_sinf,(float)); -float EXFUN(fast_cosf,(float)); -float EXFUN(fast_tanf,(float)); - -float EXFUN(fast_asinf,(float)); -float EXFUN(fast_acosf,(float)); -float EXFUN(fast_atanf,(float)); - -float EXFUN(fast_sinhf,(float)); -float EXFUN(fast_coshf,(float)); -float EXFUN(fast_tanhf,(float)); - -float EXFUN(fast_asinhf,(float)); -float EXFUN(fast_acoshf,(float)); -float EXFUN(fast_atanhf,(float)); - -float EXFUN(fast_absf,(float)); -float EXFUN(fast_sqrtf,(float)); -float EXFUN(fast_exp2f,(float)); -float EXFUN(fast_exp10f,(float)); -float EXFUN(fast_expef,(float)); -float EXFUN(fast_log10f,(float)); -float EXFUN(fast_log2f,(float)); -float EXFUN(fast_logef,(float)); -#define sinf(x) fast_sinf(x) -#define cosf(x) fast_cosf(x) -#define tanf(x) fast_tanf(x) -#define asinf(x) fast_asinf(x) -#define acosf(x) fast_acosf(x) -#define atanf(x) fast_atanf(x) -#define sinhf(x) fast_sinhf(x) -#define coshf(x) fast_coshf(x) -#define tanhf(x) fast_tanhf(x) -#define asinhf(x) fast_asinhf(x) -#define acoshf(x) fast_acoshf(x) -#define atanhf(x) fast_atanhf(x) -#define absf(x) fast_absf(x) -#define sqrtf(x) fast_sqrtf(x) -#define exp2f(x) fast_exp2f(x) -#define exp10f(x) fast_exp10f(x) -#define expef(x) fast_expef(x) -#define log10f(x) fast_log10f(x) -#define log2f(x) fast_log2f(x) -#define logef(x) fast_logef(x) -#endif -/* Override the functions defined in math.h */ -#endif /* __sysvnecv70_target */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/ieeefp.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/ieeefp.h deleted file mode 100644 index f11dc0535..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/ieeefp.h +++ /dev/null @@ -1,434 +0,0 @@ -#ifndef __IEEE_BIG_ENDIAN -#ifndef __IEEE_LITTLE_ENDIAN - -/* This file can define macros to choose variations of the IEEE float - format: - - _FLT_LARGEST_EXPONENT_IS_NORMAL - - Defined if the float format uses the largest exponent for finite - numbers rather than NaN and infinity representations. Such a - format cannot represent NaNs or infinities at all, but it's FLT_MAX - is twice the IEEE value. - - _FLT_NO_DENORMALS - - Defined if the float format does not support IEEE denormals. Every - float with a zero exponent is taken to be a zero representation. - - ??? At the moment, there are no equivalent macros above for doubles and - the macros are not fully supported by --enable-newlib-hw-fp. - - __IEEE_BIG_ENDIAN - - Defined if the float format is big endian. This is mutually exclusive - with __IEEE_LITTLE_ENDIAN. - - __IEEE_LITTLE_ENDIAN - - Defined if the float format is little endian. This is mutually exclusive - with __IEEE_BIG_ENDIAN. - - Note that one of __IEEE_BIG_ENDIAN or __IEEE_LITTLE_ENDIAN must be specified for a - platform or error will occur. - - __IEEE_BYTES_LITTLE_ENDIAN - - This flag is used in conjunction with __IEEE_BIG_ENDIAN to describe a situation - whereby multiple words of an IEEE floating point are in big endian order, but the - words themselves are little endian with respect to the bytes. - - _DOUBLE_IS_32BITS - - This is used on platforms that support double by using the 32-bit IEEE - float type. - - _FLOAT_ARG - - This represents what type a float arg is passed as. It is used when the type is - not promoted to double. - -*/ - -#if (defined(__arm__) || defined(__thumb__)) && !defined(__MAVERICK__) -/* ARM traditionally used big-endian words; and within those words the - byte ordering was big or little endian depending upon the target. - Modern floating-point formats are naturally ordered; in this case - __VFP_FP__ will be defined, even if soft-float. */ -#ifdef __VFP_FP__ -# ifdef __ARMEL__ -# define __IEEE_LITTLE_ENDIAN -# else -# define __IEEE_BIG_ENDIAN -# endif -#else -# define __IEEE_BIG_ENDIAN -# ifdef __ARMEL__ -# define __IEEE_BYTES_LITTLE_ENDIAN -# endif -#endif -#endif - -#if defined (__aarch64__) -#if defined (__AARCH64EL__) -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#endif - -#ifdef __epiphany__ -#define __IEEE_LITTLE_ENDIAN -#define Sudden_Underflow 1 -#endif - -#ifdef __hppa__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __nds32__ -#ifdef __big_endian__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __SPU__ -#define __IEEE_BIG_ENDIAN - -#define isfinite(__y) \ - (__extension__ ({int __cy; \ - (sizeof (__y) == sizeof (float)) ? (1) : \ - (__cy = fpclassify(__y)) != FP_INFINITE && __cy != FP_NAN;})) - -#define isinf(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isinfd(__x)) -#define isnan(__x) ((sizeof (__x) == sizeof (float)) ? (0) : __isnand(__x)) - -/* - * Macros for use in ieeefp.h. We can't just define the real ones here - * (like those above) as we have name space issues when this is *not* - * included via generic the ieeefp.h. - */ -#define __ieeefp_isnanf(x) 0 -#define __ieeefp_isinff(x) 0 -#define __ieeefp_finitef(x) 1 -#endif - -#ifdef __sparc__ -#ifdef __LITTLE_ENDIAN_DATA__ -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#endif - -#if defined(__m68k__) || defined(__mc68000__) -#define __IEEE_BIG_ENDIAN -#endif - -#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) -#define __IEEE_BIG_ENDIAN -#ifdef __HAVE_SHORT_DOUBLE__ -# define _DOUBLE_IS_32BITS -#endif -#endif - -#if defined (__H8300__) || defined (__H8300H__) || defined (__H8300S__) || defined (__H8500__) || defined (__H8300SX__) -#define __IEEE_BIG_ENDIAN -#define _FLOAT_ARG float -#define _DOUBLE_IS_32BITS -#endif - -#if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__) -#define __IEEE_LITTLE_ENDIAN -#define _FLOAT_ARG float -#define _DOUBLE_IS_32BITS -#endif - - -#ifdef __sh__ -#ifdef __LITTLE_ENDIAN__ -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#if defined(__SH2E__) || defined(__SH3E__) || defined(__SH4_SINGLE_ONLY__) || defined(__SH2A_SINGLE_ONLY__) -#define _DOUBLE_IS_32BITS -#endif -#endif - -#ifdef _AM29K -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef _WIN32 -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __i386__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __i960__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __lm32__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __M32R__ -#define __IEEE_BIG_ENDIAN -#endif - -#if defined(_C4x) || defined(_C3x) -#define __IEEE_BIG_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __TMS320C6X__ -#ifdef _BIG_ENDIAN -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __TIC80__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __MIPSEL__ -#define __IEEE_LITTLE_ENDIAN -#endif -#ifdef __MIPSEB__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __MMIX__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __D30V__ -#define __IEEE_BIG_ENDIAN -#endif - -/* necv70 was __IEEE_LITTLE_ENDIAN. */ - -#ifdef __W65__ -#define __IEEE_LITTLE_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#if defined(__Z8001__) || defined(__Z8002__) -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __m88k__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __mn10300__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __mn10200__ -#define __IEEE_LITTLE_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __v800 -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __v850 -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __D10V__ -#define __IEEE_BIG_ENDIAN -#if __DOUBLE__ == 32 -#define _DOUBLE_IS_32BITS -#endif -#endif - -#ifdef __PPC__ -#if (defined(_BIG_ENDIAN) && _BIG_ENDIAN) || (defined(_AIX) && _AIX) -#define __IEEE_BIG_ENDIAN -#else -#if (defined(_LITTLE_ENDIAN) && _LITTLE_ENDIAN) || (defined(__sun__) && __sun__) || (defined(_WIN32) && _WIN32) -#define __IEEE_LITTLE_ENDIAN -#endif -#endif -#endif - -#ifdef __xstormy16__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __arc__ -#ifdef __big_endian__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __CRX__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __fr30__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __mcore__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __mt__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __frv__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __moxie__ -#ifdef __MOXIE_BIG_ENDIAN__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __ia64__ -#ifdef __BIG_ENDIAN__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __AVR__ -#define __IEEE_LITTLE_ENDIAN -#define _DOUBLE_IS_32BITS -#endif - -#if defined(__or1k__) || defined(__OR1K__) || defined(__OR1KND__) -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __IP2K__ -#define __IEEE_BIG_ENDIAN -#define __SMALL_BITFIELDS -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __iq2000__ -#define __IEEE_BIG_ENDIAN -#endif - -#ifdef __MAVERICK__ -#ifdef __ARMEL__ -# define __IEEE_LITTLE_ENDIAN -#else /* must be __ARMEB__ */ -# define __IEEE_BIG_ENDIAN -#endif /* __ARMEL__ */ -#endif /* __MAVERICK__ */ - -#ifdef __m32c__ -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS -#endif - -#ifdef __CRIS__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __BFIN__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __x86_64__ -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifdef __mep__ -#ifdef __LITTLE_ENDIAN__ -#define __IEEE_LITTLE_ENDIAN -#else -#define __IEEE_BIG_ENDIAN -#endif -#endif - -#ifdef __MICROBLAZE__ -#ifndef __MICROBLAZEEL__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif -#endif - -#ifdef __MSP430__ -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS /* 16 Bit INT */ -#endif - -#ifdef __RL78__ -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS /* 16 Bit INT */ -#ifndef __RL78_64BIT_DOUBLES__ -#define _DOUBLE_IS_32BITS -#endif -#endif - -#ifdef __RX__ - -#ifdef __RX_BIG_ENDIAN__ -#define __IEEE_BIG_ENDIAN -#else -#define __IEEE_LITTLE_ENDIAN -#endif - -#ifndef __RX_64BIT_DOUBLES__ -#define _DOUBLE_IS_32BITS -#endif - -#ifdef __RX_16BIT_INTS__ -#define __SMALL_BITFIELDS -#endif - -#endif - -#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__)) -#define __IEEE_LITTLE_ENDIAN -#define __SMALL_BITFIELDS /* 16 Bit INT */ -#endif - -#ifdef __NIOS2__ -# ifdef __nios2_big_endian__ -# define __IEEE_BIG_ENDIAN -# else -# define __IEEE_LITTLE_ENDIAN -# endif -#endif - -#if (defined(__XTENSA__)) -# ifdef __XTENSA_EB__ -# define __IEEE_BIG_ENDIAN -# else -# define __IEEE_LITTLE_ENDIAN -# endif -#endif - -#ifndef __IEEE_BIG_ENDIAN -#ifndef __IEEE_LITTLE_ENDIAN -#error Endianess not declared!! -#endif /* not __IEEE_LITTLE_ENDIAN */ -#endif /* not __IEEE_BIG_ENDIAN */ - -#endif /* not __IEEE_LITTLE_ENDIAN */ -#endif /* not __IEEE_BIG_ENDIAN */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/malloc.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/malloc.h deleted file mode 100644 index fdada9ed7..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/malloc.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _MACHMALLOC_H_ -#define _MACHMALLOC_H_ - -/* place holder so platforms may add malloc.h extensions */ - -#endif /* _MACHMALLOC_H_ */ - - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/param.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/param.h deleted file mode 100644 index bdf8bf70f..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/param.h +++ /dev/null @@ -1 +0,0 @@ -/* Place holder for machine-specific param.h. */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/setjmp-dj.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/setjmp-dj.h deleted file mode 100644 index 6ca5e6526..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/setjmp-dj.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 1991 DJ Delorie - * All rights reserved. - * - * Redistribution, modification, and use in source and binary forms is permitted - * provided that the above copyright notice and following paragraph are - * duplicated in all such forms. - * - * This file is distributed WITHOUT ANY WARRANTY; without even the implied - * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - */ - -/* Modified to use SETJMP_DJ_H rather than SETJMP_H to avoid - conflicting with setjmp.h. Ian Taylor, Cygnus support, April, - 1993. */ - -#ifndef _SETJMP_DJ_H_ -#define _SETJMP_DJ_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -typedef struct { - unsigned long eax; - unsigned long ebx; - unsigned long ecx; - unsigned long edx; - unsigned long esi; - unsigned long edi; - unsigned long ebp; - unsigned long esp; - unsigned long eip; -} jmp_buf[1]; - -extern int setjmp(jmp_buf); -extern void longjmp(jmp_buf, int); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/setjmp.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/setjmp.h deleted file mode 100644 index 9f9d9e49b..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/setjmp.h +++ /dev/null @@ -1,453 +0,0 @@ - -_BEGIN_STD_C - -#if defined(__or1k__) || defined(__or1knd__) -#define _JBLEN 31 /* 32 GPRs - r0 */ -#define _JBTYPE unsigned long -#endif - -#if defined(__arm__) || defined(__thumb__) -/* - * All callee preserved registers: - * v1 - v7, fp, ip, sp, lr, f4, f5, f6, f7 - */ -#define _JBLEN 23 -#endif - -#if defined(__aarch64__) -#define _JBLEN 22 -#define _JBTYPE long long -#endif - -#if defined(__AVR__) -#define _JBLEN 24 -#endif - -#ifdef __sparc__ -/* - * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). - * All else recovered by under/over(flow) handling. - */ -#define _JBLEN 13 -#endif - -#ifdef __BFIN__ -#define _JBLEN 40 -#endif - -#ifdef __epiphany__ -/* All callee preserved registers: r4-r10,fp, sp, lr,r15, r32-r39 */ -#define _JBTYPE long long -#define _JBLEN 10 -#endif - -/* necv70 was 9 as well. */ - -#if defined(__m68k__) || defined(__mc68000__) -/* - * onsstack,sigmask,sp,pc,psl,d2-d7,a2-a6, - * fp2-fp7 for 68881. - * All else recovered by under/over(flow) handling. - */ -#define _JBLEN 34 -#endif - -#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) -/* - * D, X, Y are not saved. - * Only take into account the pseudo soft registers (max 32). - */ -#define _JBLEN 32 -#endif - -#ifdef __nds32__ -/* 17 words for GPRs, - 1 word for $fpcfg.freg and 30 words for FPUs - Reserved 2 words for aligement-adjustment. When storeing double-precision - floating-point register into memory, the address has to be - double-word-aligned. - Check libc/machine/nds32/setjmp.S for more information. */ -#if __NDS32_EXT_FPU_SP__ || __NDS32_EXT_FPU_DP__ -#define _JBLEN 50 -#else -#define _JBLEN 18 -#endif -#endif - -#if defined(__Z8001__) || defined(__Z8002__) -/* 16 regs + pc */ -#define _JBLEN 20 -#endif - -#ifdef _AM29K -/* - * onsstack,sigmask,sp,pc,npc,psr,g1,o0,wbcnt (sigcontext). - * All else recovered by under/over(flow) handling. - */ -#define _JBLEN 9 -#endif - -#ifdef __i386__ -# if defined(__CYGWIN__) && !defined (_JBLEN) -# define _JBLEN (13 * 4) -# elif defined(__unix__) || defined(__rtems__) -# define _JBLEN 9 -# else -# include "setjmp-dj.h" -# endif -#endif - -#ifdef __x86_64__ -# ifdef __CYGWIN__ -# define _JBTYPE long -# define _JBLEN 32 -# else -# define _JBTYPE long long -# define _JBLEN 8 -# endif -#endif - -#ifdef __i960__ -#define _JBLEN 35 -#endif - -#ifdef __M32R__ -/* Only 8 words are currently needed. 10 gives us some slop if we need - to expand. */ -#define _JBLEN 10 -#endif - -#ifdef __mips__ -# if defined(__mips64) -# define _JBTYPE long long -# endif -# ifdef __mips_soft_float -# define _JBLEN 11 -# else -# define _JBLEN 23 -# endif -#endif - -#ifdef __m88000__ -#define _JBLEN 21 -#endif - -#ifdef __H8300__ -#define _JBLEN 5 -#define _JBTYPE int -#endif - -#ifdef __H8300H__ -/* same as H8/300 but registers are twice as big */ -#define _JBLEN 5 -#define _JBTYPE long -#endif - -#if defined (__H8300S__) || defined (__H8300SX__) -/* same as H8/300 but registers are twice as big */ -#define _JBLEN 5 -#define _JBTYPE long -#endif - -#ifdef __H8500__ -#define _JBLEN 4 -#endif - -#ifdef __sh__ -#if __SH5__ -#define _JBLEN 50 -#define _JBTYPE long long -#else -#define _JBLEN 20 -#endif /* __SH5__ */ -#endif - -#ifdef __v800 -#define _JBLEN 28 -#endif - -#ifdef __PPC__ -#ifdef __ALTIVEC__ -#define _JBLEN 64 -#else -#define _JBLEN 32 -#endif -#define _JBTYPE double -#endif - -#ifdef __MICROBLAZE__ -#define _JBLEN 20 -#define _JBTYPE unsigned int -#endif - -#ifdef __hppa__ -/* %r30, %r2-%r18, %r27, pad, %fr12-%fr15. - Note space exists for the FP registers, but they are not - saved. */ -#define _JBLEN 28 -#endif - -#if defined(__mn10300__) || defined(__mn10200__) -#ifdef __AM33_2__ -#define _JBLEN 26 -#else -/* A guess */ -#define _JBLEN 10 -#endif -#endif - -#ifdef __v850 -/* I think our setjmp is saving 15 regs at the moment. Gives us one word - slop if we need to expand. */ -#define _JBLEN 16 -#endif - -#if defined(_C4x) -#define _JBLEN 10 -#endif -#if defined(_C3x) -#define _JBLEN 9 -#endif - -#ifdef __TMS320C6X__ -#define _JBLEN 13 -#endif - -#ifdef __TIC80__ -#define _JBLEN 13 -#endif - -#ifdef __D10V__ -#define _JBLEN 8 -#endif - -#ifdef __D30V__ -#define _JBLEN ((64 /* GPR */ + (2*2) /* ACs */ + 18 /* CRs */) / 2) -#define _JBTYPE double -#endif - -#ifdef __frv__ -#define _JBLEN (68/2) /* room for 68 32-bit regs */ -#define _JBTYPE double -#endif - -#ifdef __moxie__ -#define _JBLEN 16 -#endif - -#ifdef __CRX__ -#define _JBLEN 9 -#endif - -#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__)) -/* r6, r7, r8, r9, r10, r11, r12 (r12L, r12H), - * r13 (r13L, r13H), ra(raL, raH), sp(spL, spH) */ -#define _JBLEN 14 -#define _JBTYPE unsigned short -#endif - -#ifdef __fr30__ -#define _JBLEN 10 -#endif - -#ifdef __iq2000__ -#define _JBLEN 32 -#endif - -#ifdef __mcore__ -#define _JBLEN 16 -#endif - -#ifdef __MMIX__ -/* Using a layout compatible with GCC's built-in. */ -#define _JBLEN 5 -#define _JBTYPE unsigned long -#endif - -#ifdef __mt__ -#define _JBLEN 16 -#endif - -#ifdef __SPU__ -#define _JBLEN 50 -#define _JBTYPE __vector signed int -#endif - -#ifdef __xstormy16__ -/* 4 GPRs plus SP plus PC. */ -#define _JBLEN 8 -#endif - -#ifdef __XTENSA__ -#if __XTENSA_WINDOWED_ABI__ - -/* The jmp_buf structure for Xtensa windowed ABI holds the following - (where "proc" is the procedure that calls setjmp): 4-12 registers - from the window of proc, the 4 words from the save area at proc's $sp - (in case a subsequent alloca in proc moves $sp), and the return - address within proc. Everything else is saved on the stack in the - normal save areas. The jmp_buf structure is: - - struct jmp_buf { - int regs[12]; - int save[4]; - void *return_address; - } - - See the setjmp code for details. */ - -#define _JBLEN 17 /* 12 + 4 + 1 */ - -#else /* __XTENSA_CALL0_ABI__ */ - -#define _JBLEN 6 /* a0, a1, a12, a13, a14, a15 */ - -#endif /* __XTENSA_CALL0_ABI__ */ -#endif /* __XTENSA__ */ - -#ifdef __mep__ -/* 16 GPRs, pc, hi, lo */ -#define _JBLEN 19 -#endif - -#ifdef __CRIS__ -#define _JBLEN 18 -#endif - -#ifdef __lm32__ -#define _JBLEN 19 -#endif - -#ifdef __m32c__ -#if defined(__r8c_cpu__) || defined(__m16c_cpu__) -#define _JBLEN (22/2) -#else -#define _JBLEN (34/2) -#endif -#define _JBTYPE unsigned short -#endif /* __m32c__ */ - -#ifdef __MSP430__ -#define _JBLEN 9 - -#ifdef __MSP430X_LARGE__ -#define _JBTYPE unsigned long -#else -#define _JBTYPE unsigned short -#endif -#endif - -#ifdef __RL78__ -/* Three banks of registers, SP, CS, ES, PC */ -#define _JBLEN (8*3+8) -#define _JBTYPE unsigned char -#endif - -/* - * There are two versions of setjmp()/longjmp(): - * 1) Compiler (gcc) built-in versions. - * 2) Function-call versions. - * - * The built-in versions are used most of the time. When used, gcc replaces - * calls to setjmp()/longjmp() with inline assembly code. The built-in - * versions save/restore a variable number of registers. - - * _JBLEN is set to 40 to be ultra-safe with the built-in versions. - * It only needs to be 12 for the function-call versions - * but this data structure is used by both versions. - */ -#ifdef __NIOS2__ -#define _JBLEN 40 -#define _JBTYPE unsigned long -#endif - -#ifdef __RX__ -#define _JBLEN 0x44 -#endif - -#ifdef _JBLEN -#ifdef _JBTYPE -typedef _JBTYPE jmp_buf[_JBLEN]; -#else -typedef int jmp_buf[_JBLEN]; -#endif -#endif - -_END_STD_C - -#if defined(__CYGWIN__) || defined(__rtems__) -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* POSIX sigsetjmp/siglongjmp macros */ -#ifdef _JBTYPE -typedef _JBTYPE sigjmp_buf[_JBLEN+1+((sizeof (_JBTYPE) + sizeof (sigset_t) - 1) - /sizeof (_JBTYPE))]; -#else -typedef int sigjmp_buf[_JBLEN+1+(sizeof (sigset_t)/sizeof (int))]; -#endif - -#define _SAVEMASK _JBLEN -#define _SIGMASK (_JBLEN+1) - -#ifdef __CYGWIN__ -# define _CYGWIN_WORKING_SIGSETJMP -#endif - -#ifdef _POSIX_THREADS -#define __SIGMASK_FUNC pthread_sigmask -#else -#define __SIGMASK_FUNC sigprocmask -#endif - -#if defined(__GNUC__) - -#define sigsetjmp(env, savemask) \ - __extension__ \ - ({ \ - sigjmp_buf *_sjbuf = &(env); \ - ((*_sjbuf)[_SAVEMASK] = savemask,\ - __SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *)((*_sjbuf) + _SIGMASK)),\ - setjmp (*_sjbuf)); \ - }) - -#define siglongjmp(env, val) \ - __extension__ \ - ({ \ - sigjmp_buf *_sjbuf = &(env); \ - ((((*_sjbuf)[_SAVEMASK]) ? \ - __SIGMASK_FUNC (SIG_SETMASK, (sigset_t *)((*_sjbuf) + _SIGMASK), 0)\ - : 0), \ - longjmp (*_sjbuf, val)); \ - }) - -#else /* !__GNUC__ */ - -#define sigsetjmp(env, savemask) ((env)[_SAVEMASK] = savemask,\ - __SIGMASK_FUNC (SIG_SETMASK, 0, (sigset_t *) ((env) + _SIGMASK)),\ - setjmp (env)) - -#define siglongjmp(env, val) ((((env)[_SAVEMASK])?\ - __SIGMASK_FUNC (SIG_SETMASK, (sigset_t *) ((env) + _SIGMASK), 0):0),\ - longjmp (env, val)) - -#endif - -/* POSIX _setjmp/_longjmp, maintained for XSI compatibility. These - are equivalent to sigsetjmp/siglongjmp when not saving the signal mask. - New applications should use sigsetjmp/siglongjmp instead. */ -#ifdef __CYGWIN__ -extern void _longjmp(jmp_buf, int); -extern int _setjmp(jmp_buf); -#else -#define _setjmp(env) sigsetjmp ((env), 0) -#define _longjmp(env, val) siglongjmp ((env), (val)) -#endif - -#ifdef __cplusplus -} -#endif -#endif /* __CYGWIN__ or __rtems__ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/stdlib.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/stdlib.h deleted file mode 100644 index fa3f3a139..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/stdlib.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _MACHSTDLIB_H_ -#define _MACHSTDLIB_H_ - -/* place holder so platforms may add stdlib.h extensions */ - -#endif /* _MACHSTDLIB_H_ */ - - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/termios.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/termios.h deleted file mode 100644 index 41fd45938..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/termios.h +++ /dev/null @@ -1 +0,0 @@ -#define __MAX_BAUD B4000000 diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/time.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/time.h deleted file mode 100644 index 06e2ccffb..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/time.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef _MACHTIME_H_ -#define _MACHTIME_H_ - -#if defined(__rtems__) -#define _CLOCKS_PER_SEC_ sysconf(_SC_CLK_TCK) -#else /* !__rtems__ */ -#if defined(__aarch64__) || defined(__arm__) || defined(__thumb__) -#define _CLOCKS_PER_SEC_ 100 -#endif -#endif /* !__rtems__ */ - -#ifdef __SPU__ -#include -int nanosleep (const struct timespec *, struct timespec *); -#endif - -#endif /* _MACHTIME_H_ */ - - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/machine/types.h b/tools/sdk/libc/xtensa-lx106-elf/include/machine/types.h deleted file mode 100644 index 40a75faa5..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/machine/types.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef _MACHTYPES_H_ -#define _MACHTYPES_H_ - -/* - * The following section is RTEMS specific and is needed to more - * closely match the types defined in the BSD machine/types.h. - * This is needed to let the RTEMS/BSD TCP/IP stack compile. - */ -#if defined(__rtems__) -#include -#endif - -#define _CLOCK_T_ unsigned long /* clock() */ -#define _TIME_T_ long /* time() */ -#define _CLOCKID_T_ unsigned long -#define _TIMER_T_ unsigned long - -#ifndef _HAVE_SYSTYPES -typedef long int __off_t; -typedef int __pid_t; -#ifdef __GNUC__ -__extension__ typedef long long int __loff_t; -#else -typedef long int __loff_t; -#endif -#endif - -#endif /* _MACHTYPES_H_ */ - - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/malloc.h b/tools/sdk/libc/xtensa-lx106-elf/include/malloc.h deleted file mode 100644 index 41b5efdc0..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/malloc.h +++ /dev/null @@ -1,169 +0,0 @@ -/* malloc.h -- header file for memory routines. */ - -#ifndef _INCLUDE_MALLOC_H_ -#define _INCLUDE_MALLOC_H_ - -#include <_ansi.h> -#include - -#define __need_size_t -#include - -/* include any machine-specific extensions */ -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* This version of struct mallinfo must match the one in - libc/stdlib/mallocr.c. */ - -struct mallinfo { - size_t arena; /* total space allocated from system */ - size_t ordblks; /* number of non-inuse chunks */ - size_t smblks; /* unused -- always zero */ - size_t hblks; /* number of mmapped regions */ - size_t hblkhd; /* total space in mmapped regions */ - size_t usmblks; /* unused -- always zero */ - size_t fsmblks; /* unused -- always zero */ - size_t uordblks; /* total allocated space */ - size_t fordblks; /* total non-inuse space */ - size_t keepcost; /* top-most, releasable (via malloc_trim) space */ -}; - -/* The routines. */ - -extern _PTR malloc _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _malloc_r -#define _malloc_r(r, s) malloc (s) -#else -extern _PTR _malloc_r _PARAMS ((struct _reent *, size_t)); -#endif - -extern _VOID free _PARAMS ((_PTR)); -#ifdef __CYGWIN__ -#undef _free_r -#define _free_r(r, p) free (p) -#else -extern _VOID _free_r _PARAMS ((struct _reent *, _PTR)); -#endif - -extern _PTR realloc _PARAMS ((_PTR, size_t)); -#ifdef __CYGWIN__ -#undef _realloc_r -#define _realloc_r(r, p, s) realloc (p, s) -#else -extern _PTR _realloc_r _PARAMS ((struct _reent *, _PTR, size_t)); -#endif - -extern _PTR calloc _PARAMS ((size_t, size_t)); -#ifdef __CYGWIN__ -#undef _calloc_r -#define _calloc_r(r, s1, s2) calloc (s1, s2); -#else -extern _PTR _calloc_r _PARAMS ((struct _reent *, size_t, size_t)); -#endif - -extern _PTR memalign _PARAMS ((size_t, size_t)); -#ifdef __CYGWIN__ -#undef _memalign_r -#define _memalign_r(r, s1, s2) memalign (s1, s2); -#else -extern _PTR _memalign_r _PARAMS ((struct _reent *, size_t, size_t)); -#endif - -extern struct mallinfo mallinfo _PARAMS ((void)); -#ifdef __CYGWIN__ -#undef _mallinfo_r -#define _mallinfo_r(r) mallinfo () -#else -extern struct mallinfo _mallinfo_r _PARAMS ((struct _reent *)); -#endif - -extern void malloc_stats _PARAMS ((void)); -#ifdef __CYGWIN__ -#undef _malloc_stats_r -#define _malloc_stats_r(r) malloc_stats () -#else -extern void _malloc_stats_r _PARAMS ((struct _reent *)); -#endif - -extern int mallopt _PARAMS ((int, int)); -#ifdef __CYGWIN__ -#undef _mallopt_r -#define _mallopt_r(i1, i2) mallopt (i1, i2) -#else -extern int _mallopt_r _PARAMS ((struct _reent *, int, int)); -#endif - -extern size_t malloc_usable_size _PARAMS ((_PTR)); -#ifdef __CYGWIN__ -#undef _malloc_usable_size_r -#define _malloc_usable_size_r(r, p) malloc_usable_size (p) -#else -extern size_t _malloc_usable_size_r _PARAMS ((struct _reent *, _PTR)); -#endif - -/* These aren't too useful on an embedded system, but we define them - anyhow. */ - -extern _PTR valloc _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _valloc_r -#define _valloc_r(r, s) valloc (s) -#else -extern _PTR _valloc_r _PARAMS ((struct _reent *, size_t)); -#endif - -extern _PTR pvalloc _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _pvalloc_r -#define _pvalloc_r(r, s) pvalloc (s) -#else -extern _PTR _pvalloc_r _PARAMS ((struct _reent *, size_t)); -#endif - -extern int malloc_trim _PARAMS ((size_t)); -#ifdef __CYGWIN__ -#undef _malloc_trim_r -#define _malloc_trim_r(r, s) malloc_trim (s) -#else -extern int _malloc_trim_r _PARAMS ((struct _reent *, size_t)); -#endif - -/* A compatibility routine for an earlier version of the allocator. */ - -extern _VOID mstats _PARAMS ((char *)); -#ifdef __CYGWIN__ -#undef _mstats_r -#define _mstats_r(r, p) mstats (p) -#else -extern _VOID _mstats_r _PARAMS ((struct _reent *, char *)); -#endif - -/* SVID2/XPG mallopt options */ - -#define M_MXFAST 1 /* UNUSED in this malloc */ -#define M_NLBLKS 2 /* UNUSED in this malloc */ -#define M_GRAIN 3 /* UNUSED in this malloc */ -#define M_KEEP 4 /* UNUSED in this malloc */ - -/* mallopt options that actually do something */ - -#define M_TRIM_THRESHOLD -1 -#define M_TOP_PAD -2 -#define M_MMAP_THRESHOLD -3 -#define M_MMAP_MAX -4 - -#ifndef __CYGWIN__ -/* Some systems provide this, so do too for compatibility. */ -extern void cfree _PARAMS ((_PTR)); -#endif /* __CYGWIN__ */ - -#ifdef __cplusplus -} -#endif - -#endif /* _INCLUDE_MALLOC_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/math.h b/tools/sdk/libc/xtensa-lx106-elf/include/math.h deleted file mode 100644 index d16ce3074..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/math.h +++ /dev/null @@ -1,615 +0,0 @@ -#ifndef _MATH_H_ - -#define _MATH_H_ - -#include -#include -#include "_ansi.h" - -_BEGIN_STD_C - -/* __dmath, __fmath, and __ldmath are only here for backwards compatibility - * in case any code used them. They are no longer used by Newlib, itself, - * other than legacy. */ -union __dmath -{ - double d; - __ULong i[2]; -}; - -union __fmath -{ - float f; - __ULong i[1]; -}; - -#if defined(_HAVE_LONG_DOUBLE) -union __ldmath -{ - long double ld; - __ULong i[4]; -}; -#endif - -/* Natural log of 2 */ -#define _M_LN2 0.693147180559945309417 - -#if __GNUC_PREREQ (3, 3) - /* gcc >= 3.3 implicitly defines builtins for HUGE_VALx values. */ - -# ifndef HUGE_VAL -# define HUGE_VAL (__builtin_huge_val()) -# endif - -# ifndef HUGE_VALF -# define HUGE_VALF (__builtin_huge_valf()) -# endif - -# ifndef HUGE_VALL -# define HUGE_VALL (__builtin_huge_vall()) -# endif - -# ifndef INFINITY -# define INFINITY (__builtin_inff()) -# endif - -# ifndef NAN -# define NAN (__builtin_nanf("")) -# endif - -#else /* !gcc >= 3.3 */ - - /* No builtins. Use fixed defines instead. (All 3 HUGE plus the INFINITY - * and NAN macros are required to be constant expressions. Using a variable-- - * even a static const--does not meet this requirement, as it cannot be - * evaluated at translation time.) - * The infinities are done using numbers that are far in excess of - * something that would be expected to be encountered in a floating-point - * implementation. (A more certain way uses values from float.h, but that is - * avoided because system includes are not supposed to include each other.) - * This method might produce warnings from some compilers. (It does in - * newer GCCs, but not for ones that would hit this #else.) If this happens, - * please report details to the Newlib mailing list. */ - - #ifndef HUGE_VAL - #define HUGE_VAL (1.0e999999999) - #endif - - #ifndef HUGE_VALF - #define HUGE_VALF (1.0e999999999F) - #endif - - #if !defined(HUGE_VALL) && defined(_HAVE_LONG_DOUBLE) - #define HUGE_VALL (1.0e999999999L) - #endif - - #if !defined(INFINITY) - #define INFINITY (HUGE_VALF) - #endif - - #if !defined(NAN) - #if defined(__GNUC__) && defined(__cplusplus) - /* Exception: older g++ versions warn about the divide by 0 used in the - * normal case (even though older gccs do not). This trick suppresses the - * warning, but causes errors for plain gcc, so is only used in the one - * special case. */ - static const union { __ULong __i[1]; float __d; } __Nanf = {0x7FC00000}; - #define NAN (__Nanf.__d) - #else - #define NAN (0.0F/0.0F) - #endif - #endif - -#endif /* !gcc >= 3.3 */ - -/* Reentrant ANSI C functions. */ - -#ifndef __math_68881 -extern double atan _PARAMS((double)); -extern double cos _PARAMS((double)); -extern double sin _PARAMS((double)); -extern double tan _PARAMS((double)); -extern double tanh _PARAMS((double)); -extern double frexp _PARAMS((double, int *)); -extern double modf _PARAMS((double, double *)); -extern double ceil _PARAMS((double)); -extern double fabs _PARAMS((double)); -extern double floor _PARAMS((double)); -#endif /* ! defined (__math_68881) */ - -/* Non reentrant ANSI C functions. */ - -#ifndef _REENT_ONLY -#ifndef __math_68881 -extern double acos _PARAMS((double)); -extern double asin _PARAMS((double)); -extern double atan2 _PARAMS((double, double)); -extern double cosh _PARAMS((double)); -extern double sinh _PARAMS((double)); -extern double exp _PARAMS((double)); -extern double ldexp _PARAMS((double, int)); -extern double log _PARAMS((double)); -extern double log10 _PARAMS((double)); -extern double pow _PARAMS((double, double)); -extern double sqrt _PARAMS((double)); -extern double fmod _PARAMS((double, double)); -#endif /* ! defined (__math_68881) */ -#endif /* ! defined (_REENT_ONLY) */ - -#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) - -/* ISO C99 types and macros. */ - -/* FIXME: FLT_EVAL_METHOD should somehow be gotten from float.h (which is hard, - * considering that the standard says the includes it defines should not - * include other includes that it defines) and that value used. (This can be - * solved, but autoconf has a bug which makes the solution more difficult, so - * it has been skipped for now.) */ -#if !defined(FLT_EVAL_METHOD) && defined(__FLT_EVAL_METHOD__) - #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ - #define __TMP_FLT_EVAL_METHOD -#endif /* FLT_EVAL_METHOD */ -#if defined FLT_EVAL_METHOD - #if FLT_EVAL_METHOD == 0 - typedef float float_t; - typedef double double_t; - #elif FLT_EVAL_METHOD == 1 - typedef double float_t; - typedef double double_t; - #elif FLT_EVAL_METHOD == 2 - typedef long double float_t; - typedef long double double_t; - #else - /* Implementation-defined. Assume float_t and double_t have been - * defined previously for this configuration (e.g. config.h). */ - #endif -#else - /* Assume basic definitions. */ - typedef float float_t; - typedef double double_t; -#endif -#if defined(__TMP_FLT_EVAL_METHOD) - #undef FLT_EVAL_METHOD -#endif - -#define FP_NAN 0 -#define FP_INFINITE 1 -#define FP_ZERO 2 -#define FP_SUBNORMAL 3 -#define FP_NORMAL 4 - -#ifndef FP_ILOGB0 -# define FP_ILOGB0 (-INT_MAX) -#endif -#ifndef FP_ILOGBNAN -# define FP_ILOGBNAN INT_MAX -#endif - -#ifndef MATH_ERRNO -# define MATH_ERRNO 1 -#endif -#ifndef MATH_ERREXCEPT -# define MATH_ERREXCEPT 2 -#endif -#ifndef math_errhandling -# define math_errhandling MATH_ERRNO -#endif - -extern int __isinff (float x); -extern int __isinfd (double x); -extern int __isnanf (float x); -extern int __isnand (double x); -extern int __fpclassifyf (float x); -extern int __fpclassifyd (double x); -extern int __signbitf (float x); -extern int __signbitd (double x); - -#define fpclassify(__x) \ - ((sizeof(__x) == sizeof(float)) ? __fpclassifyf(__x) : \ - __fpclassifyd(__x)) - -#ifndef isfinite - #define isfinite(__y) \ - (__extension__ ({int __cy = fpclassify(__y); \ - __cy != FP_INFINITE && __cy != FP_NAN;})) -#endif - -/* Note: isinf and isnan were once functions in newlib that took double - * arguments. C99 specifies that these names are reserved for macros - * supporting multiple floating point types. Thus, they are - * now defined as macros. Implementations of the old functions - * taking double arguments still exist for compatibility purposes - * (prototypes for them are in ). */ -#ifndef isinf - #define isinf(y) (fpclassify(y) == FP_INFINITE) -#endif - -#ifndef isnan - #define isnan(y) (fpclassify(y) == FP_NAN) -#endif - -#define isnormal(y) (fpclassify(y) == FP_NORMAL) -#define signbit(__x) \ - ((sizeof(__x) == sizeof(float)) ? __signbitf(__x) : \ - __signbitd(__x)) - -#define isgreater(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x > __y);})) -#define isgreaterequal(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x >= __y);})) -#define isless(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x < __y);})) -#define islessequal(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x <= __y);})) -#define islessgreater(x,y) \ - (__extension__ ({__typeof__(x) __x = (x); __typeof__(y) __y = (y); \ - !isunordered(__x,__y) && (__x < __y || __x > __y);})) - -#define isunordered(a,b) \ - (__extension__ ({__typeof__(a) __a = (a); __typeof__(b) __b = (b); \ - fpclassify(__a) == FP_NAN || fpclassify(__b) == FP_NAN;})) - -/* Non ANSI double precision functions. */ - -extern double infinity _PARAMS((void)); -extern double nan _PARAMS((const char *)); -extern int finite _PARAMS((double)); -extern double copysign _PARAMS((double, double)); -extern double logb _PARAMS((double)); -extern int ilogb _PARAMS((double)); - -extern double asinh _PARAMS((double)); -extern double cbrt _PARAMS((double)); -extern double nextafter _PARAMS((double, double)); -extern double rint _PARAMS((double)); -extern double scalbn _PARAMS((double, int)); - -extern double exp2 _PARAMS((double)); -extern double scalbln _PARAMS((double, long int)); -extern double tgamma _PARAMS((double)); -extern double nearbyint _PARAMS((double)); -extern long int lrint _PARAMS((double)); -extern long long int llrint _PARAMS((double)); -extern double round _PARAMS((double)); -extern long int lround _PARAMS((double)); -extern long long int llround _PARAMS((double)); -extern double trunc _PARAMS((double)); -extern double remquo _PARAMS((double, double, int *)); -extern double fdim _PARAMS((double, double)); -extern double fmax _PARAMS((double, double)); -extern double fmin _PARAMS((double, double)); -extern double fma _PARAMS((double, double, double)); - -#ifndef __math_68881 -extern double log1p _PARAMS((double)); -extern double expm1 _PARAMS((double)); -#endif /* ! defined (__math_68881) */ - -#ifndef _REENT_ONLY -extern double acosh _PARAMS((double)); -extern double atanh _PARAMS((double)); -extern double remainder _PARAMS((double, double)); -extern double gamma _PARAMS((double)); -extern double lgamma _PARAMS((double)); -extern double erf _PARAMS((double)); -extern double erfc _PARAMS((double)); -extern double log2 _PARAMS((double)); -#if !defined(__cplusplus) -#define log2(x) (log (x) / _M_LN2) -#endif - -#ifndef __math_68881 -extern double hypot _PARAMS((double, double)); -#endif - -#endif /* ! defined (_REENT_ONLY) */ - -/* Single precision versions of ANSI functions. */ - -extern float atanf _PARAMS((float)); -extern float cosf _PARAMS((float)); -extern float sinf _PARAMS((float)); -extern float tanf _PARAMS((float)); -extern float tanhf _PARAMS((float)); -extern float frexpf _PARAMS((float, int *)); -extern float modff _PARAMS((float, float *)); -extern float ceilf _PARAMS((float)); -extern float fabsf _PARAMS((float)); -extern float floorf _PARAMS((float)); - -#ifndef _REENT_ONLY -extern float acosf _PARAMS((float)); -extern float asinf _PARAMS((float)); -extern float atan2f _PARAMS((float, float)); -extern float coshf _PARAMS((float)); -extern float sinhf _PARAMS((float)); -extern float expf _PARAMS((float)); -extern float ldexpf _PARAMS((float, int)); -extern float logf _PARAMS((float)); -extern float log10f _PARAMS((float)); -extern float powf _PARAMS((float, float)); -extern float sqrtf _PARAMS((float)); -extern float fmodf _PARAMS((float, float)); -#endif /* ! defined (_REENT_ONLY) */ - -/* Other single precision functions. */ - -extern float exp2f _PARAMS((float)); -extern float scalblnf _PARAMS((float, long int)); -extern float tgammaf _PARAMS((float)); -extern float nearbyintf _PARAMS((float)); -extern long int lrintf _PARAMS((float)); -extern long long int llrintf _PARAMS((float)); -extern float roundf _PARAMS((float)); -extern long int lroundf _PARAMS((float)); -extern long long int llroundf _PARAMS((float)); -extern float truncf _PARAMS((float)); -extern float remquof _PARAMS((float, float, int *)); -extern float fdimf _PARAMS((float, float)); -extern float fmaxf _PARAMS((float, float)); -extern float fminf _PARAMS((float, float)); -extern float fmaf _PARAMS((float, float, float)); - -extern float infinityf _PARAMS((void)); -extern float nanf _PARAMS((const char *)); -extern int finitef _PARAMS((float)); -extern float copysignf _PARAMS((float, float)); -extern float logbf _PARAMS((float)); -extern int ilogbf _PARAMS((float)); - -extern float asinhf _PARAMS((float)); -extern float cbrtf _PARAMS((float)); -extern float nextafterf _PARAMS((float, float)); -extern float rintf _PARAMS((float)); -extern float scalbnf _PARAMS((float, int)); -extern float log1pf _PARAMS((float)); -extern float expm1f _PARAMS((float)); - -#ifndef _REENT_ONLY -extern float acoshf _PARAMS((float)); -extern float atanhf _PARAMS((float)); -extern float remainderf _PARAMS((float, float)); -extern float gammaf _PARAMS((float)); -extern float lgammaf _PARAMS((float)); -extern float erff _PARAMS((float)); -extern float erfcf _PARAMS((float)); -extern float log2f _PARAMS((float)); -extern float hypotf _PARAMS((float, float)); -#endif /* ! defined (_REENT_ONLY) */ - -/* On platforms where long double equals double. */ -#ifdef _LDBL_EQ_DBL -/* Reentrant ANSI C functions. */ -#ifndef __math_68881 -extern long double atanl _PARAMS((long double)); -extern long double cosl _PARAMS((long double)); -extern long double sinl _PARAMS((long double)); -extern long double tanl _PARAMS((long double)); -extern long double tanhl _PARAMS((long double)); -extern long double frexpl _PARAMS((long double, int *)); -extern long double modfl _PARAMS((long double, long double *)); -extern long double ceill _PARAMS((long double)); -extern long double fabsl _PARAMS((long double)); -extern long double floorl _PARAMS((long double)); -extern long double log1pl _PARAMS((long double)); -extern long double expm1l _PARAMS((long double)); -#endif /* ! defined (__math_68881) */ -/* Non reentrant ANSI C functions. */ -#ifndef _REENT_ONLY -#ifndef __math_68881 -extern long double acosl _PARAMS((long double)); -extern long double asinl _PARAMS((long double)); -extern long double atan2l _PARAMS((long double, long double)); -extern long double coshl _PARAMS((long double)); -extern long double sinhl _PARAMS((long double)); -extern long double expl _PARAMS((long double)); -extern long double ldexpl _PARAMS((long double, int)); -extern long double logl _PARAMS((long double)); -extern long double log10l _PARAMS((long double)); -extern long double powl _PARAMS((long double, long double)); -extern long double sqrtl _PARAMS((long double)); -extern long double fmodl _PARAMS((long double, long double)); -extern long double hypotl _PARAMS((long double, long double)); -#endif /* ! defined (__math_68881) */ -#endif /* ! defined (_REENT_ONLY) */ -extern long double copysignl _PARAMS((long double, long double)); -extern long double nanl _PARAMS((const char *)); -extern int ilogbl _PARAMS((long double)); -extern long double asinhl _PARAMS((long double)); -extern long double cbrtl _PARAMS((long double)); -extern long double nextafterl _PARAMS((long double, long double)); -extern float nexttowardf _PARAMS((float, long double)); -extern double nexttoward _PARAMS((double, long double)); -extern long double nexttowardl _PARAMS((long double, long double)); -extern long double logbl _PARAMS((long double)); -extern long double log2l _PARAMS((long double)); -extern long double rintl _PARAMS((long double)); -extern long double scalbnl _PARAMS((long double, int)); -extern long double exp2l _PARAMS((long double)); -extern long double scalblnl _PARAMS((long double, long)); -extern long double tgammal _PARAMS((long double)); -extern long double nearbyintl _PARAMS((long double)); -extern long int lrintl _PARAMS((long double)); -extern long long int llrintl _PARAMS((long double)); -extern long double roundl _PARAMS((long double)); -extern long lroundl _PARAMS((long double)); -extern long long int llroundl _PARAMS((long double)); -extern long double truncl _PARAMS((long double)); -extern long double remquol _PARAMS((long double, long double, int *)); -extern long double fdiml _PARAMS((long double, long double)); -extern long double fmaxl _PARAMS((long double, long double)); -extern long double fminl _PARAMS((long double, long double)); -extern long double fmal _PARAMS((long double, long double, long double)); -#ifndef _REENT_ONLY -extern long double acoshl _PARAMS((long double)); -extern long double atanhl _PARAMS((long double)); -extern long double remainderl _PARAMS((long double, long double)); -extern long double lgammal _PARAMS((long double)); -extern long double erfl _PARAMS((long double)); -extern long double erfcl _PARAMS((long double)); -#endif /* ! defined (_REENT_ONLY) */ -#else /* !_LDBL_EQ_DBL */ -#ifdef __i386__ -/* Other long double precision functions. */ -extern _LONG_DOUBLE rintl _PARAMS((_LONG_DOUBLE)); -extern long int lrintl _PARAMS((_LONG_DOUBLE)); -extern long long int llrintl _PARAMS((_LONG_DOUBLE)); -#endif /* __i386__ */ -#endif /* !_LDBL_EQ_DBL */ - -#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) */ - -#if !defined (__STRICT_ANSI__) || defined(__cplusplus) - -extern double drem _PARAMS((double, double)); -extern void sincos _PARAMS((double, double *, double *)); -extern double gamma_r _PARAMS((double, int *)); -extern double lgamma_r _PARAMS((double, int *)); - -extern double y0 _PARAMS((double)); -extern double y1 _PARAMS((double)); -extern double yn _PARAMS((int, double)); -extern double j0 _PARAMS((double)); -extern double j1 _PARAMS((double)); -extern double jn _PARAMS((int, double)); - -extern float dremf _PARAMS((float, float)); -extern void sincosf _PARAMS((float, float *, float *)); -extern float gammaf_r _PARAMS((float, int *)); -extern float lgammaf_r _PARAMS((float, int *)); - -extern float y0f _PARAMS((float)); -extern float y1f _PARAMS((float)); -extern float ynf _PARAMS((int, float)); -extern float j0f _PARAMS((float)); -extern float j1f _PARAMS((float)); -extern float jnf _PARAMS((int, float)); - -/* GNU extensions */ -# ifndef exp10 -extern double exp10 _PARAMS((double)); -# endif -# ifndef pow10 -extern double pow10 _PARAMS((double)); -# endif -# ifndef exp10f -extern float exp10f _PARAMS((float)); -# endif -# ifndef pow10f -extern float pow10f _PARAMS((float)); -# endif - -#endif /* !defined (__STRICT_ANSI__) || defined(__cplusplus) */ - -#ifndef __STRICT_ANSI__ - -/* The gamma functions use a global variable, signgam. */ -#ifndef _REENT_ONLY -#define signgam (*__signgam()) -extern int *__signgam _PARAMS((void)); -#endif /* ! defined (_REENT_ONLY) */ - -#define __signgam_r(ptr) _REENT_SIGNGAM(ptr) - -/* The exception structure passed to the matherr routine. */ -/* We have a problem when using C++ since `exception' is a reserved - name in C++. */ -#ifdef __cplusplus -struct __exception -#else -struct exception -#endif -{ - int type; - char *name; - double arg1; - double arg2; - double retval; - int err; -}; - -#ifdef __cplusplus -extern int matherr _PARAMS((struct __exception *e)); -#else -extern int matherr _PARAMS((struct exception *e)); -#endif - -/* Values for the type field of struct exception. */ - -#define DOMAIN 1 -#define SING 2 -#define OVERFLOW 3 -#define UNDERFLOW 4 -#define TLOSS 5 -#define PLOSS 6 - -#endif /* ! defined (__STRICT_ANSI__) */ - -/* Useful constants. */ - -#if !defined(__STRICT_ANSI__) || ((_XOPEN_SOURCE - 0) >= 500) - -#define MAXFLOAT 3.40282347e+38F - -#define M_E 2.7182818284590452354 -#define M_LOG2E 1.4426950408889634074 -#define M_LOG10E 0.43429448190325182765 -#define M_LN2 _M_LN2 -#define M_LN10 2.30258509299404568402 -#define M_PI 3.14159265358979323846 -#define M_PI_2 1.57079632679489661923 -#define M_PI_4 0.78539816339744830962 -#define M_1_PI 0.31830988618379067154 -#define M_2_PI 0.63661977236758134308 -#define M_2_SQRTPI 1.12837916709551257390 -#define M_SQRT2 1.41421356237309504880 -#define M_SQRT1_2 0.70710678118654752440 - -#endif - -#ifndef __STRICT_ANSI__ - -#define M_TWOPI (M_PI * 2.0) -#define M_3PI_4 2.3561944901923448370E0 -#define M_SQRTPI 1.77245385090551602792981 -#define M_LN2LO 1.9082149292705877000E-10 -#define M_LN2HI 6.9314718036912381649E-1 -#define M_SQRT3 1.73205080756887719000 -#define M_IVLN10 0.43429448190325182765 /* 1 / log(10) */ -#define M_LOG2_E _M_LN2 -#define M_INVLN2 1.4426950408889633870E0 /* 1 / log(2) */ - -/* Global control over fdlibm error handling. */ - -enum __fdlibm_version -{ - __fdlibm_ieee = -1, - __fdlibm_svid, - __fdlibm_xopen, - __fdlibm_posix -}; - -#define _LIB_VERSION_TYPE enum __fdlibm_version -#define _LIB_VERSION __fdlib_version - -extern __IMPORT _LIB_VERSION_TYPE _LIB_VERSION; - -#define _IEEE_ __fdlibm_ieee -#define _SVID_ __fdlibm_svid -#define _XOPEN_ __fdlibm_xopen -#define _POSIX_ __fdlibm_posix - -#endif /* ! defined (__STRICT_ANSI__) */ - -_END_STD_C - -#ifdef __FAST_MATH__ -#include -#endif - -#endif /* _MATH_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/newlib.h b/tools/sdk/libc/xtensa-lx106-elf/include/newlib.h deleted file mode 100644 index e9bf56645..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/newlib.h +++ /dev/null @@ -1,201 +0,0 @@ -/* newlib.h. Generated from newlib.hin by configure. */ -/* newlib.hin. Manually edited from the output of autoheader to - remove all PACKAGE_ macros which will collide with any user - package using newlib header files and having its own package name, - version, etc... */ -#ifndef __NEWLIB_H__ - -#define __NEWLIB_H__ 1 - -/* EL/IX level */ -/* #undef _ELIX_LEVEL */ - -/* Newlib version */ -#define _NEWLIB_VERSION "2.2.0" - -/* C99 formats support (such as %a, %zu, ...) in IO functions like - * printf/scanf enabled */ -/* #undef _WANT_IO_C99_FORMATS */ - -/* long long type support in IO functions like printf/scanf enabled */ -/* #undef _WANT_IO_LONG_LONG */ - -/* Register application finalization function using atexit. */ -/* #undef _WANT_REGISTER_FINI */ - -/* long double type support in IO functions like printf/scanf enabled */ -/* #undef _WANT_IO_LONG_DOUBLE */ - -/* Positional argument support in printf functions enabled. */ -/* #undef _WANT_IO_POS_ARGS */ - -/* Optional reentrant struct support. Used mostly on platforms with - very restricted storage. */ -#define _WANT_REENT_SMALL 1 - -/* Multibyte supported */ -/* #undef _MB_CAPABLE */ - -/* MB_LEN_MAX */ -#define _MB_LEN_MAX 1 - -/* ICONV enabled */ -/* #undef _ICONV_ENABLED */ - -/* Enable ICONV external CCS files loading capabilities */ -/* #undef _ICONV_ENABLE_EXTERNAL_CCS */ - -/* Define if the linker supports .preinit_array/.init_array/.fini_array - * sections. */ -#define HAVE_INITFINI_ARRAY 1 - -/* True if atexit() may dynamically allocate space for cleanup - functions. */ -#define _ATEXIT_DYNAMIC_ALLOC 1 - -/* True if long double supported. */ -#define _HAVE_LONG_DOUBLE 1 - -/* Define if compiler supports -fno-tree-loop-distribute-patterns. */ -#define _HAVE_CC_INHIBIT_LOOP_TO_LIBCALL 1 - -/* True if long double supported and it is equal to double. */ -#define _LDBL_EQ_DBL 1 - -/* Define if uintptr_t is unsigned long on this architecture */ -/* #undef _UINTPTR_EQ_ULONG */ - -/* Define if uintptr_t is unsigned long long on this architecture */ -/* #undef _UINTPTR_EQ_ULONGLONG */ - -/* Define if ivo supported in streamio. */ -#define _FVWRITE_IN_STREAMIO 1 - -/* Define if fseek functions support seek optimization. */ -#define _FSEEK_OPTIMIZATION 1 - -/* Define if wide char orientation is supported. */ -#define _WIDE_ORIENT 1 - -/* Define if unbuffered stream file optimization is supported. */ -#define _UNBUF_STREAM_OPT 1 - -/* Define if lite version of exit supported. */ -/* #undef _LITE_EXIT */ - -/* Define if declare atexit data as global. */ -/* #undef _REENT_GLOBAL_ATEXIT */ - -/* Define if small footprint nano-formatted-IO implementation used. */ -#define _NANO_FORMATTED_IO 1 - -/* - * Iconv encodings enabled ("to" direction) - */ -/* #undef _ICONV_TO_ENCODING_BIG5 */ -/* #undef _ICONV_TO_ENCODING_CP775 */ -/* #undef _ICONV_TO_ENCODING_CP850 */ -/* #undef _ICONV_TO_ENCODING_CP852 */ -/* #undef _ICONV_TO_ENCODING_CP855 */ -/* #undef _ICONV_TO_ENCODING_CP866 */ -/* #undef _ICONV_TO_ENCODING_EUC_JP */ -/* #undef _ICONV_TO_ENCODING_EUC_TW */ -/* #undef _ICONV_TO_ENCODING_EUC_KR */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_1 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_10 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_11 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_13 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_14 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_15 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_2 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_3 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_4 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_5 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_6 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_7 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_8 */ -/* #undef _ICONV_TO_ENCODING_ISO_8859_9 */ -/* #undef _ICONV_TO_ENCODING_ISO_IR_111 */ -/* #undef _ICONV_TO_ENCODING_KOI8_R */ -/* #undef _ICONV_TO_ENCODING_KOI8_RU */ -/* #undef _ICONV_TO_ENCODING_KOI8_U */ -/* #undef _ICONV_TO_ENCODING_KOI8_UNI */ -/* #undef _ICONV_TO_ENCODING_UCS_2 */ -/* #undef _ICONV_TO_ENCODING_UCS_2_INTERNAL */ -/* #undef _ICONV_TO_ENCODING_UCS_2BE */ -/* #undef _ICONV_TO_ENCODING_UCS_2LE */ -/* #undef _ICONV_TO_ENCODING_UCS_4 */ -/* #undef _ICONV_TO_ENCODING_UCS_4_INTERNAL */ -/* #undef _ICONV_TO_ENCODING_UCS_4BE */ -/* #undef _ICONV_TO_ENCODING_UCS_4LE */ -/* #undef _ICONV_TO_ENCODING_US_ASCII */ -/* #undef _ICONV_TO_ENCODING_UTF_16 */ -/* #undef _ICONV_TO_ENCODING_UTF_16BE */ -/* #undef _ICONV_TO_ENCODING_UTF_16LE */ -/* #undef _ICONV_TO_ENCODING_UTF_8 */ -/* #undef _ICONV_TO_ENCODING_WIN_1250 */ -/* #undef _ICONV_TO_ENCODING_WIN_1251 */ -/* #undef _ICONV_TO_ENCODING_WIN_1252 */ -/* #undef _ICONV_TO_ENCODING_WIN_1253 */ -/* #undef _ICONV_TO_ENCODING_WIN_1254 */ -/* #undef _ICONV_TO_ENCODING_WIN_1255 */ -/* #undef _ICONV_TO_ENCODING_WIN_1256 */ -/* #undef _ICONV_TO_ENCODING_WIN_1257 */ -/* #undef _ICONV_TO_ENCODING_WIN_1258 */ - -/* - * Iconv encodings enabled ("from" direction) - */ -/* #undef _ICONV_FROM_ENCODING_BIG5 */ -/* #undef _ICONV_FROM_ENCODING_CP775 */ -/* #undef _ICONV_FROM_ENCODING_CP850 */ -/* #undef _ICONV_FROM_ENCODING_CP852 */ -/* #undef _ICONV_FROM_ENCODING_CP855 */ -/* #undef _ICONV_FROM_ENCODING_CP866 */ -/* #undef _ICONV_FROM_ENCODING_EUC_JP */ -/* #undef _ICONV_FROM_ENCODING_EUC_TW */ -/* #undef _ICONV_FROM_ENCODING_EUC_KR */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_1 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_10 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_11 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_13 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_14 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_15 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_2 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_3 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_4 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_5 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_6 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_7 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_8 */ -/* #undef _ICONV_FROM_ENCODING_ISO_8859_9 */ -/* #undef _ICONV_FROM_ENCODING_ISO_IR_111 */ -/* #undef _ICONV_FROM_ENCODING_KOI8_R */ -/* #undef _ICONV_FROM_ENCODING_KOI8_RU */ -/* #undef _ICONV_FROM_ENCODING_KOI8_U */ -/* #undef _ICONV_FROM_ENCODING_KOI8_UNI */ -/* #undef _ICONV_FROM_ENCODING_UCS_2 */ -/* #undef _ICONV_FROM_ENCODING_UCS_2_INTERNAL */ -/* #undef _ICONV_FROM_ENCODING_UCS_2BE */ -/* #undef _ICONV_FROM_ENCODING_UCS_2LE */ -/* #undef _ICONV_FROM_ENCODING_UCS_4 */ -/* #undef _ICONV_FROM_ENCODING_UCS_4_INTERNAL */ -/* #undef _ICONV_FROM_ENCODING_UCS_4BE */ -/* #undef _ICONV_FROM_ENCODING_UCS_4LE */ -/* #undef _ICONV_FROM_ENCODING_US_ASCII */ -/* #undef _ICONV_FROM_ENCODING_UTF_16 */ -/* #undef _ICONV_FROM_ENCODING_UTF_16BE */ -/* #undef _ICONV_FROM_ENCODING_UTF_16LE */ -/* #undef _ICONV_FROM_ENCODING_UTF_8 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1250 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1251 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1252 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1253 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1254 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1255 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1256 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1257 */ -/* #undef _ICONV_FROM_ENCODING_WIN_1258 */ - -#endif /* !__NEWLIB_H__ */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/paths.h b/tools/sdk/libc/xtensa-lx106-elf/include/paths.h deleted file mode 100644 index b1c70f588..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/paths.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef _PATHS_H_ -#define _PATHS_H_ - -#define _PATH_DEV "/dev/" -#define _PATH_DEVNULL "/dev/null" -#define _PATH_DEVZERO "/dev/zero" -#define _PATH_BSHELL "/bin/sh" - -#endif /* _PATHS_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/pthread.h b/tools/sdk/libc/xtensa-lx106-elf/include/pthread.h deleted file mode 100644 index db1f9c1ca..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/pthread.h +++ /dev/null @@ -1,431 +0,0 @@ -/* pthread.h - * - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2013. - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef __PTHREAD_h -#define __PTHREAD_h - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#if defined(_POSIX_THREADS) - -#include -#include -#include -#include - -struct _pthread_cleanup_context { - void (*_routine)(void *); - void *_arg; - int _canceltype; - struct _pthread_cleanup_context *_previous; -}; - -/* Register Fork Handlers */ -int _EXFUN(pthread_atfork,(void (*prepare)(void), void (*parent)(void), - void (*child)(void))); - -/* Mutex Initialization Attributes, P1003.1c/Draft 10, p. 81 */ - -int _EXFUN(pthread_mutexattr_init, (pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutexattr_destroy, (pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutexattr_getpshared, - (_CONST pthread_mutexattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_mutexattr_setpshared, - (pthread_mutexattr_t *__attr, int __pshared)); - -#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) - -/* Single UNIX Specification 2 Mutex Attributes types */ - -int _EXFUN(pthread_mutexattr_gettype, - (_CONST pthread_mutexattr_t *__attr, int *__kind)); -int _EXFUN(pthread_mutexattr_settype, - (pthread_mutexattr_t *__attr, int __kind)); - -#endif - -/* Initializing and Destroying a Mutex, P1003.1c/Draft 10, p. 87 */ - -int _EXFUN(pthread_mutex_init, - (pthread_mutex_t *__mutex, _CONST pthread_mutexattr_t *__attr)); -int _EXFUN(pthread_mutex_destroy, (pthread_mutex_t *__mutex)); - -/* This is used to statically initialize a pthread_mutex_t. Example: - - pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; - */ - -#define PTHREAD_MUTEX_INITIALIZER ((pthread_mutex_t) 0xFFFFFFFF) - -/* Locking and Unlocking a Mutex, P1003.1c/Draft 10, p. 93 - NOTE: P1003.4b/D8 adds pthread_mutex_timedlock(), p. 29 */ - -int _EXFUN(pthread_mutex_lock, (pthread_mutex_t *__mutex)); -int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex)); -int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex)); - -#if defined(_POSIX_TIMEOUTS) - -int _EXFUN(pthread_mutex_timedlock, - (pthread_mutex_t *__mutex, _CONST struct timespec *__timeout)); - -#endif /* _POSIX_TIMEOUTS */ - -/* Condition Variable Initialization Attributes, P1003.1c/Draft 10, p. 96 */ - -int _EXFUN(pthread_condattr_init, (pthread_condattr_t *__attr)); -int _EXFUN(pthread_condattr_destroy, (pthread_condattr_t *__attr)); -int _EXFUN(pthread_condattr_getpshared, - (_CONST pthread_condattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_condattr_setpshared, - (pthread_condattr_t *__attr, int __pshared)); - -/* Initializing and Destroying a Condition Variable, P1003.1c/Draft 10, p. 87 */ - -int _EXFUN(pthread_cond_init, - (pthread_cond_t *__cond, _CONST pthread_condattr_t *__attr)); -int _EXFUN(pthread_cond_destroy, (pthread_cond_t *__mutex)); - -/* This is used to statically initialize a pthread_cond_t. Example: - - pthread_cond_t cond = PTHREAD_COND_INITIALIZER; - */ - -#define PTHREAD_COND_INITIALIZER ((pthread_cond_t) 0xFFFFFFFF) - -/* Broadcasting and Signaling a Condition, P1003.1c/Draft 10, p. 101 */ - -int _EXFUN(pthread_cond_signal, (pthread_cond_t *__cond)); -int _EXFUN(pthread_cond_broadcast, (pthread_cond_t *__cond)); - -/* Waiting on a Condition, P1003.1c/Draft 10, p. 105 */ - -int _EXFUN(pthread_cond_wait, - (pthread_cond_t *__cond, pthread_mutex_t *__mutex)); - -int _EXFUN(pthread_cond_timedwait, - (pthread_cond_t *__cond, pthread_mutex_t *__mutex, - _CONST struct timespec *__abstime)); - -#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) - -/* Thread Creation Scheduling Attributes, P1003.1c/Draft 10, p. 120 */ - -int _EXFUN(pthread_attr_setscope, - (pthread_attr_t *__attr, int __contentionscope)); -int _EXFUN(pthread_attr_getscope, - (_CONST pthread_attr_t *__attr, int *__contentionscope)); -int _EXFUN(pthread_attr_setinheritsched, - (pthread_attr_t *__attr, int __inheritsched)); -int _EXFUN(pthread_attr_getinheritsched, - (_CONST pthread_attr_t *__attr, int *__inheritsched)); -int _EXFUN(pthread_attr_setschedpolicy, - (pthread_attr_t *__attr, int __policy)); -int _EXFUN(pthread_attr_getschedpolicy, - (_CONST pthread_attr_t *__attr, int *__policy)); - -#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ - -int _EXFUN(pthread_attr_setschedparam, - (pthread_attr_t *__attr, _CONST struct sched_param *__param)); -int _EXFUN(pthread_attr_getschedparam, - (_CONST pthread_attr_t *__attr, struct sched_param *__param)); - -#if defined(_POSIX_THREAD_PRIORITY_SCHEDULING) - -/* Dynamic Thread Scheduling Parameters Access, P1003.1c/Draft 10, p. 124 */ - -int _EXFUN(pthread_getschedparam, - (pthread_t __pthread, int *__policy, struct sched_param *__param)); -int _EXFUN(pthread_setschedparam, - (pthread_t __pthread, int __policy, struct sched_param *__param)); - -#endif /* defined(_POSIX_THREAD_PRIORITY_SCHEDULING) */ - -#if defined(_POSIX_THREAD_PRIO_INHERIT) || defined(_POSIX_THREAD_PRIO_PROTECT) - -/* Mutex Initialization Scheduling Attributes, P1003.1c/Draft 10, p. 128 */ - -int _EXFUN(pthread_mutexattr_setprotocol, - (pthread_mutexattr_t *__attr, int __protocol)); -int _EXFUN(pthread_mutexattr_getprotocol, - (_CONST pthread_mutexattr_t *__attr, int *__protocol)); -int _EXFUN(pthread_mutexattr_setprioceiling, - (pthread_mutexattr_t *__attr, int __prioceiling)); -int _EXFUN(pthread_mutexattr_getprioceiling, - (_CONST pthread_mutexattr_t *__attr, int *__prioceiling)); - -#endif /* _POSIX_THREAD_PRIO_INHERIT || _POSIX_THREAD_PRIO_PROTECT */ - -#if defined(_POSIX_THREAD_PRIO_PROTECT) - -/* Change the Priority Ceiling of a Mutex, P1003.1c/Draft 10, p. 131 */ - -int _EXFUN(pthread_mutex_setprioceiling, - (pthread_mutex_t *__mutex, int __prioceiling, int *__old_ceiling)); -int _EXFUN(pthread_mutex_getprioceiling, - (pthread_mutex_t *__mutex, int *__prioceiling)); - -#endif /* _POSIX_THREAD_PRIO_PROTECT */ - -/* Thread Creation Attributes, P1003.1c/Draft 10, p, 140 */ - -int _EXFUN(pthread_attr_init, (pthread_attr_t *__attr)); -int _EXFUN(pthread_attr_destroy, (pthread_attr_t *__attr)); -int _EXFUN(pthread_attr_setstack, (pthread_attr_t *attr, - void *__stackaddr, size_t __stacksize)); -int _EXFUN(pthread_attr_getstack, (_CONST pthread_attr_t *attr, - void **__stackaddr, size_t *__stacksize)); -int _EXFUN(pthread_attr_getstacksize, - (_CONST pthread_attr_t *__attr, size_t *__stacksize)); -int _EXFUN(pthread_attr_setstacksize, - (pthread_attr_t *__attr, size_t __stacksize)); -int _EXFUN(pthread_attr_getstackaddr, - (_CONST pthread_attr_t *__attr, void **__stackaddr)); -int _EXFUN(pthread_attr_setstackaddr, - (pthread_attr_t *__attr, void *__stackaddr)); -int _EXFUN(pthread_attr_getdetachstate, - (_CONST pthread_attr_t *__attr, int *__detachstate)); -int _EXFUN(pthread_attr_setdetachstate, - (pthread_attr_t *__attr, int __detachstate)); -int _EXFUN(pthread_attr_getguardsize, - (_CONST pthread_attr_t *__attr, size_t *__guardsize)); -int _EXFUN(pthread_attr_setguardsize, - (pthread_attr_t *__attr, size_t __guardsize)); - -/* POSIX thread APIs beyond the POSIX standard but provided - * in GNU/Linux. They may be provided by other OSes for - * compatibility. - */ -#if defined(__GNU_VISIBLE) -#if defined(__rtems__) -int _EXFUN(pthread_attr_setaffinity_np, - (pthread_attr_t *__attr, size_t __cpusetsize, - const cpu_set_t *__cpuset)); -int _EXFUN(pthread_attr_getaffinity_np, - (const pthread_attr_t *__attr, size_t __cpusetsize, - cpu_set_t *__cpuset)); - -int _EXFUN(pthread_setaffinity_np, - (pthread_t __id, size_t __cpusetsize, const cpu_set_t *__cpuset)); -int _EXFUN(pthread_getaffinity_np, - (const pthread_t __id, size_t __cpusetsize, cpu_set_t *__cpuset)); - -int _EXFUN(pthread_getattr_np, - (pthread_t __id, pthread_attr_t *__attr)); -#endif /* defined(__rtems__) */ -#endif /* defined(__GNU_VISIBLE) */ - -/* Thread Creation, P1003.1c/Draft 10, p. 144 */ - -int _EXFUN(pthread_create, - (pthread_t *__pthread, _CONST pthread_attr_t *__attr, - void *(*__start_routine)( void * ), void *__arg)); - -/* Wait for Thread Termination, P1003.1c/Draft 10, p. 147 */ - -int _EXFUN(pthread_join, (pthread_t __pthread, void **__value_ptr)); - -/* Detaching a Thread, P1003.1c/Draft 10, p. 149 */ - -int _EXFUN(pthread_detach, (pthread_t __pthread)); - -/* Thread Termination, p1003.1c/Draft 10, p. 150 */ - -void _EXFUN(pthread_exit, (void *__value_ptr)); - -/* Get Calling Thread's ID, p1003.1c/Draft 10, p. XXX */ - -pthread_t _EXFUN(pthread_self, (void)); - -/* Compare Thread IDs, p1003.1c/Draft 10, p. 153 */ - -int _EXFUN(pthread_equal, (pthread_t __t1, pthread_t __t2)); - -/* Dynamic Package Initialization */ - -/* This is used to statically initialize a pthread_once_t. Example: - - pthread_once_t once = PTHREAD_ONCE_INIT; - - NOTE: This is named inconsistently -- it should be INITIALIZER. */ - -#define PTHREAD_ONCE_INIT { 1, 0 } /* is initialized and not run */ - -int _EXFUN(pthread_once, - (pthread_once_t *__once_control, void (*__init_routine)(void))); - -/* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */ - -int _EXFUN(pthread_key_create, - (pthread_key_t *__key, void (*__destructor)( void * ))); - -/* Thread-Specific Data Management, P1003.1c/Draft 10, p. 165 */ - -int _EXFUN(pthread_setspecific, - (pthread_key_t __key, _CONST void *__value)); -void * _EXFUN(pthread_getspecific, (pthread_key_t __key)); - -/* Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 */ - -int _EXFUN(pthread_key_delete, (pthread_key_t __key)); - -/* Execution of a Thread, P1003.1c/Draft 10, p. 181 */ - -#define PTHREAD_CANCEL_ENABLE 0 -#define PTHREAD_CANCEL_DISABLE 1 - -#define PTHREAD_CANCEL_DEFERRED 0 -#define PTHREAD_CANCEL_ASYNCHRONOUS 1 - -#define PTHREAD_CANCELED ((void *) -1) - -int _EXFUN(pthread_cancel, (pthread_t __pthread)); - -/* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ - -int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); -int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); -void _EXFUN(pthread_testcancel, (void)); - -/* Establishing Cancellation Handlers, P1003.1c/Draft 10, p. 184 */ - -void _EXFUN(_pthread_cleanup_push, - (struct _pthread_cleanup_context *_context, - void (*_routine)(void *), void *_arg)); - -void _EXFUN(_pthread_cleanup_pop, - (struct _pthread_cleanup_context *_context, - int _execute)); - -/* It is intentional to open and close the scope in two different macros */ -#define pthread_cleanup_push(_routine, _arg) \ - do { \ - struct _pthread_cleanup_context _pthread_clup_ctx; \ - _pthread_cleanup_push(&_pthread_clup_ctx, (_routine), (_arg)) - -#define pthread_cleanup_pop(_execute) \ - _pthread_cleanup_pop(&_pthread_clup_ctx, (_execute)); \ - } while (0) - -#if defined(_GNU_SOURCE) -void _EXFUN(_pthread_cleanup_push_defer, - (struct _pthread_cleanup_context *_context, - void (*_routine)(void *), void *_arg)); - -void _EXFUN(_pthread_cleanup_pop_restore, - (struct _pthread_cleanup_context *_context, - int _execute)); - -/* It is intentional to open and close the scope in two different macros */ -#define pthread_cleanup_push_defer_np(_routine, _arg) \ - do { \ - struct _pthread_cleanup_context _pthread_clup_ctx; \ - _pthread_cleanup_push_defer(&_pthread_clup_ctx, (_routine), (_arg)) - -#define pthread_cleanup_pop_restore_np(_execute) \ - _pthread_cleanup_pop_restore(&_pthread_clup_ctx, (_execute)); \ - } while (0) -#endif /* defined(_GNU_SOURCE) */ - -#if defined(_POSIX_THREAD_CPUTIME) - -/* Accessing a Thread CPU-time Clock, P1003.4b/D8, p. 58 */ - -int _EXFUN(pthread_getcpuclockid, - (pthread_t __pthread_id, clockid_t *__clock_id)); - -#endif /* defined(_POSIX_THREAD_CPUTIME) */ - - -#endif /* defined(_POSIX_THREADS) */ - -#if defined(_POSIX_BARRIERS) - -int _EXFUN(pthread_barrierattr_init, (pthread_barrierattr_t *__attr)); -int _EXFUN(pthread_barrierattr_destroy, (pthread_barrierattr_t *__attr)); -int _EXFUN(pthread_barrierattr_getpshared, - (_CONST pthread_barrierattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_barrierattr_setpshared, - (pthread_barrierattr_t *__attr, int __pshared)); - -#define PTHREAD_BARRIER_SERIAL_THREAD -1 - -int _EXFUN(pthread_barrier_init, - (pthread_barrier_t *__barrier, - _CONST pthread_barrierattr_t *__attr, unsigned __count)); -int _EXFUN(pthread_barrier_destroy, (pthread_barrier_t *__barrier)); -int _EXFUN(pthread_barrier_wait,(pthread_barrier_t *__barrier)); - -#endif /* defined(_POSIX_BARRIERS) */ - -#if defined(_POSIX_SPIN_LOCKS) - -int _EXFUN(pthread_spin_init, - (pthread_spinlock_t *__spinlock, int __pshared)); -int _EXFUN(pthread_spin_destroy, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_lock, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_trylock, (pthread_spinlock_t *__spinlock)); -int _EXFUN(pthread_spin_unlock, (pthread_spinlock_t *__spinlock)); - -#endif /* defined(_POSIX_SPIN_LOCKS) */ - -#if defined(_POSIX_READER_WRITER_LOCKS) - -/* This is used to statically initialize a pthread_rwlock_t. Example: - - pthread_mutex_t mutex = PTHREAD_RWLOCK_INITIALIZER; - */ - -#define PTHREAD_RWLOCK_INITIALIZER ((pthread_rwlock_t) 0xFFFFFFFF) - -int _EXFUN(pthread_rwlockattr_init, (pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlockattr_destroy, (pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlockattr_getpshared, - (_CONST pthread_rwlockattr_t *__attr, int *__pshared)); -int _EXFUN(pthread_rwlockattr_setpshared, - (pthread_rwlockattr_t *__attr, int __pshared)); - -int _EXFUN(pthread_rwlock_init, - (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); -int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_timedrdlock, - (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); -int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); -int _EXFUN(pthread_rwlock_timedwrlock, - (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); - -#endif /* defined(_POSIX_READER_WRITER_LOCKS) */ - - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/pwd.h b/tools/sdk/libc/xtensa-lx106-elf/include/pwd.h deleted file mode 100644 index 3dea4ee2d..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/pwd.h +++ /dev/null @@ -1,87 +0,0 @@ -/*- - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)pwd.h 5.13 (Berkeley) 5/28/91 - */ - -#ifndef _PWD_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _PWD_H_ - -#include -#include - -#if __BSD_VISIBLE -#define _PATH_PASSWD "/etc/passwd" - -#define _PASSWORD_LEN 128 /* max length, not counting NULL */ -#endif - -struct passwd { - char *pw_name; /* user name */ - char *pw_passwd; /* encrypted password */ - uid_t pw_uid; /* user uid */ - gid_t pw_gid; /* user gid */ - char *pw_comment; /* comment */ - char *pw_gecos; /* Honeywell login info */ - char *pw_dir; /* home directory */ - char *pw_shell; /* default shell */ -}; - -#ifndef __INSIDE_CYGWIN__ -struct passwd *getpwuid (uid_t); -struct passwd *getpwnam (const char *); - -#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE >= 500 -int getpwnam_r (const char *, struct passwd *, - char *, size_t , struct passwd **); -int getpwuid_r (uid_t, struct passwd *, char *, - size_t, struct passwd **); -#endif - -#if __XSI_VISIBLE >= 500 -struct passwd *getpwent (void); -void setpwent (void); -void endpwent (void); -#endif - -#if __BSD_VISIBLE -int setpassent (int); -#endif -#endif /*!__INSIDE_CYGWIN__*/ - -#ifdef __cplusplus -} -#endif -#endif /* _PWD_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/reent.h b/tools/sdk/libc/xtensa-lx106-elf/include/reent.h deleted file mode 100644 index 861be71d3..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/reent.h +++ /dev/null @@ -1,189 +0,0 @@ -/* This header file provides the reentrancy. */ - -/* The reentrant system calls here serve two purposes: - - 1) Provide reentrant versions of the system calls the ANSI C library - requires. - 2) Provide these system calls in a namespace clean way. - - It is intended that *all* system calls that the ANSI C library needs - be declared here. It documents them all in one place. All library access - to the system is via some form of these functions. - - The target may provide the needed syscalls by any of the following: - - 1) Define the reentrant versions of the syscalls directly. - (eg: _open_r, _close_r, etc.). Please keep the namespace clean. - When you do this, set "syscall_dir" to "syscalls" and add - -DREENTRANT_SYSCALLS_PROVIDED to newlib_cflags in configure.host. - - 2) Define namespace clean versions of the system calls by prefixing - them with '_' (eg: _open, _close, etc.). Technically, there won't be - true reentrancy at the syscall level, but the library will be namespace - clean. - When you do this, set "syscall_dir" to "syscalls" in configure.host. - - 3) Define or otherwise provide the regular versions of the syscalls - (eg: open, close, etc.). The library won't be reentrant nor namespace - clean, but at least it will work. - When you do this, add -DMISSING_SYSCALL_NAMES to newlib_cflags in - configure.host. - - 4) Define or otherwise provide the regular versions of the syscalls, - and do not supply functional interfaces for any of the reentrant - calls. With this method, the reentrant syscalls are redefined to - directly call the regular system call without the reentrancy argument. - When you do this, specify both -DREENTRANT_SYSCALLS_PROVIDED and - -DMISSING_SYSCALL_NAMES via newlib_cflags in configure.host and do - not specify "syscall_dir". - - Stubs of the reentrant versions of the syscalls exist in the libc/reent - source directory and are provided if REENTRANT_SYSCALLS_PROVIDED isn't - defined. These stubs call the native system calls: _open, _close, etc. - if MISSING_SYSCALL_NAMES is *not* defined, otherwise they call the - non-underscored versions: open, close, etc. when MISSING_SYSCALL_NAMES - *is* defined. - - By default, newlib functions call the reentrant syscalls internally, - passing a reentrancy structure as an argument. This reentrancy structure - contains data that is thread-specific. For example, the errno value is - kept in the reentrancy structure. If multiple threads exist, each will - keep a separate errno value which is intuitive since the application flow - cannot check for failure reliably otherwise. - - The reentrant syscalls are either provided by the platform, by the - libc/reent stubs, or in the case of both MISSING_SYSCALL_NAMES and - REENTRANT_SYSCALLS_PROVIDED being defined, the calls are redefined to - simply call the regular syscalls with no reentrancy struct argument. - - A single-threaded application does not need to worry about the reentrancy - structure. It is used internally. - - A multi-threaded application needs either to manually manage reentrancy - structures or use dynamic reentrancy. - - Manually managing reentrancy structures entails calling special reentrant - versions of newlib functions that have an additional reentrancy argument. - For example, _printf_r. By convention, the first argument is the - reentrancy structure. By default, the normal version of the function - uses the default reentrancy structure: _REENT. The reentrancy structure - is passed internally, eventually to the reentrant syscalls themselves. - How the structures are stored and accessed in this model is up to the - application. - - Dynamic reentrancy is specified by the __DYNAMIC_REENT__ flag. This - flag denotes setting up a macro to replace _REENT with a function call - to __getreent(). This function needs to be implemented by the platform - and it is meant to return the reentrancy structure for the current - thread. When the regular C functions (e.g. printf) go to call internal - routines with the default _REENT structure, they end up calling with - the reentrancy structure for the thread. Thus, application code does not - need to call the _r routines nor worry about reentrancy structures. */ - -/* WARNING: All identifiers here must begin with an underscore. This file is - included by stdio.h and others and we therefore must only use identifiers - in the namespace allotted to us. */ - -#ifndef _REENT_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _REENT_H_ - -#include -#include -#include - -#define __need_size_t -#define __need_ptrdiff_t -#include - -/* FIXME: not namespace clean */ -struct stat; -struct tms; -struct timeval; -struct timezone; - -#if defined(REENTRANT_SYSCALLS_PROVIDED) && defined(MISSING_SYSCALL_NAMES) - -#define _close_r(__reent, __fd) close(__fd) -#define _execve_r(__reent, __f, __arg, __env) execve(__f, __arg, __env) -#define _fcntl_r(__reent, __fd, __cmd, __arg) fcntl(__fd, __cmd, __arg) -#define _fork_r(__reent) fork() -#define _fstat_r(__reent, __fdes, __stat) fstat(__fdes, __stat) -#define _getpid_r(__reent) getpid() -#define _isatty_r(__reent, __desc) isatty(__desc) -#define _kill_r(__reent, __pid, __signal) kill(__pid, __signal) -#define _link_r(__reent, __oldpath, __newpath) link(__oldpath, __newpath) -#define _lseek_r(__reent, __fdes, __off, __w) lseek(__fdes, __off, __w) -#define _mkdir_r(__reent, __path, __m) mkdir(__path, __m) -#define _open_r(__reent, __path, __flag, __m) open(__path, __flag, __m) -#define _read_r(__reent, __fd, __buff, __cnt) read(__fd, __buff, __cnt) -#define _rename_r(__reent, __old, __new) rename(__old, __new) -#define _sbrk_r(__reent, __incr) sbrk(__incr) -#define _stat_r(__reent, __path, __buff) stat(__path, __buff) -#define _times_r(__reent, __time) times(__time) -#define _unlink_r(__reent, __path) unlink(__path) -#define _wait_r(__reent, __status) wait(__status) -#define _write_r(__reent, __fd, __buff, __cnt) write(__fd, __buff, __cnt) -#define _gettimeofday_r(__reent, __tp, __tzp) gettimeofday(__tp, __tzp) - -#ifdef __LARGE64_FILES -#define _lseek64_r(__reent, __fd, __off, __w) lseek64(__fd, __off, __w) -#define _fstat64_r(__reent, __fd, __buff) fstat64(__fd, __buff) -#define _open64_r(__reent, __path, __flag, __m) open64(__path, __flag, __m) -#endif - -#else -/* Reentrant versions of system calls. */ - -extern int _close_r _PARAMS ((struct _reent *, int)); -extern int _execve_r _PARAMS ((struct _reent *, const char *, char *const *, char *const *)); -extern int _fcntl_r _PARAMS ((struct _reent *, int, int, int)); -extern int _fork_r _PARAMS ((struct _reent *)); -extern int _fstat_r _PARAMS ((struct _reent *, int, struct stat *)); -extern int _getpid_r _PARAMS ((struct _reent *)); -extern int _isatty_r _PARAMS ((struct _reent *, int)); -extern int _kill_r _PARAMS ((struct _reent *, int, int)); -extern int _link_r _PARAMS ((struct _reent *, const char *, const char *)); -extern _off_t _lseek_r _PARAMS ((struct _reent *, int, _off_t, int)); -extern int _mkdir_r _PARAMS ((struct _reent *, const char *, int)); -extern int _open_r _PARAMS ((struct _reent *, const char *, int, int)); -extern _ssize_t _read_r _PARAMS ((struct _reent *, int, void *, size_t)); -extern int _rename_r _PARAMS ((struct _reent *, const char *, const char *)); -extern void *_sbrk_r _PARAMS ((struct _reent *, ptrdiff_t)); -extern int _stat_r _PARAMS ((struct _reent *, const char *, struct stat *)); -extern _CLOCK_T_ _times_r _PARAMS ((struct _reent *, struct tms *)); -extern int _unlink_r _PARAMS ((struct _reent *, const char *)); -extern int _wait_r _PARAMS ((struct _reent *, int *)); -extern _ssize_t _write_r _PARAMS ((struct _reent *, int, const void *, size_t)); - -/* This one is not guaranteed to be available on all targets. */ -extern int _gettimeofday_r _PARAMS ((struct _reent *, struct timeval *__tp, void *__tzp)); - -#ifdef __LARGE64_FILES - - -#if defined(__CYGWIN__) -#define stat64 stat -#endif -struct stat64; - -extern _off64_t _lseek64_r _PARAMS ((struct _reent *, int, _off64_t, int)); -extern int _fstat64_r _PARAMS ((struct _reent *, int, struct stat64 *)); -extern int _open64_r _PARAMS ((struct _reent *, const char *, int, int)); -extern int _stat64_r _PARAMS ((struct _reent *, const char *, struct stat64 *)); - -/* Don't pollute namespace if not building newlib. */ -#if defined (__CYGWIN__) && !defined (_COMPILING_NEWLIB) -#undef stat64 -#endif - -#endif - -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _REENT_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/regdef.h b/tools/sdk/libc/xtensa-lx106-elf/include/regdef.h deleted file mode 100644 index 8cf144b85..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/regdef.h +++ /dev/null @@ -1,7 +0,0 @@ -/* regdef.h -- define register names. */ - -/* This is a standard include file for MIPS targets. Other target - probably don't define it, and attempts to include this file will - fail. */ - -#include diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/regex.h b/tools/sdk/libc/xtensa-lx106-elf/include/regex.h deleted file mode 100644 index fa3e26879..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/regex.h +++ /dev/null @@ -1,103 +0,0 @@ -/*- - * Copyright (c) 1992 Henry Spencer. - * Copyright (c) 1992, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Henry Spencer of the University of Toronto. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)regex.h 8.2 (Berkeley) 1/3/94 - * $FreeBSD: src/include/regex.h,v 1.4 2002/03/23 17:24:53 imp Exp $ - */ - -#ifndef _REGEX_H_ -#define _REGEX_H_ - -#include - -/* types */ -typedef off_t regoff_t; - -typedef struct { - int re_magic; - size_t re_nsub; /* number of parenthesized subexpressions */ - __const char *re_endp; /* end pointer for REG_PEND */ - struct re_guts *re_g; /* none of your business :-) */ -} regex_t; - -typedef struct { - regoff_t rm_so; /* start of match */ - regoff_t rm_eo; /* end of match */ -} regmatch_t; - -/* regcomp() flags */ -#define REG_BASIC 0000 -#define REG_EXTENDED 0001 -#define REG_ICASE 0002 -#define REG_NOSUB 0004 -#define REG_NEWLINE 0010 -#define REG_NOSPEC 0020 -#define REG_PEND 0040 -#define REG_DUMP 0200 - -/* regerror() flags */ -#define REG_NOMATCH 1 -#define REG_BADPAT 2 -#define REG_ECOLLATE 3 -#define REG_ECTYPE 4 -#define REG_EESCAPE 5 -#define REG_ESUBREG 6 -#define REG_EBRACK 7 -#define REG_EPAREN 8 -#define REG_EBRACE 9 -#define REG_BADBR 10 -#define REG_ERANGE 11 -#define REG_ESPACE 12 -#define REG_BADRPT 13 -#define REG_EMPTY 14 -#define REG_ASSERT 15 -#define REG_INVARG 16 -#define REG_ATOI 255 /* convert name to number (!) */ -#define REG_ITOA 0400 /* convert number to name (!) */ - -/* regexec() flags */ -#define REG_NOTBOL 00001 -#define REG_NOTEOL 00002 -#define REG_STARTEND 00004 -#define REG_TRACE 00400 /* tracing of execution */ -#define REG_LARGE 01000 /* force large representation */ -#define REG_BACKR 02000 /* force use of backref code */ - -__BEGIN_DECLS -int regcomp(regex_t *__restrict, const char *__restrict, int); -size_t regerror(int, const regex_t *__restrict, char *__restrict, size_t); -int regexec(const regex_t *__restrict, const char *__restrict, - size_t, regmatch_t [__restrict], int); -void regfree(regex_t *); -__END_DECLS - -#endif /* !_REGEX_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sched.h b/tools/sdk/libc/xtensa-lx106-elf/include/sched.h deleted file mode 100644 index 504ad5274..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sched.h +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2010. - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef _SCHED_H_ -#define _SCHED_H_ - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_POSIX_PRIORITY_SCHEDULING) -/* - * XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1803 - */ -int sched_setparam( - pid_t __pid, - const struct sched_param *__param -); - -/* - * XBD 13 - Set Scheduling Parameters, P1003.1b-2008, p. 1800 - */ -int sched_getparam( - pid_t __pid, - struct sched_param *__param -); - -/* - * XBD 13 - Set Scheduling Policy and Scheduling Parameters, - * P1003.1b-2008, p. 1805 - */ -int sched_setscheduler( - pid_t __pid, - int __policy, - const struct sched_param *__param -); - -/* - * XBD 13 - Get Scheduling Policy, P1003.1b-2008, p. 1801 - */ -int sched_getscheduler( - pid_t __pid -); - -/* - * XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1799 - */ -int sched_get_priority_max( - int __policy -); - -int sched_get_priority_min( - int __policy -); - -/* - * XBD 13 - Get Scheduling Parameter Limits, P1003.1b-2008, p. 1802 - */ -int sched_rr_get_interval( - pid_t __pid, - struct timespec *__interval -); -#endif /* _POSIX_PRIORITY_SCHEDULING */ - -#if defined(_POSIX_THREADS) || defined(_POSIX_PRIORITY_SCHEDULING) - -/* - * XBD 13 - Yield Processor, P1003.1b-2008, p. 1807 - */ -int sched_yield( void ); - -#endif /* _POSIX_THREADS or _POSIX_PRIORITY_SCHEDULING */ - -#ifdef __cplusplus -} -#endif - -#endif /* _SCHED_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/search.h b/tools/sdk/libc/xtensa-lx106-elf/include/search.h deleted file mode 100644 index ed321b0f6..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/search.h +++ /dev/null @@ -1,64 +0,0 @@ -/* $NetBSD: search.h,v 1.12 1999/02/22 10:34:28 christos Exp $ */ -/* $FreeBSD: src/include/search.h,v 1.4 2002/03/23 17:24:53 imp Exp $ */ - -/* - * Written by J.T. Conklin - * Public domain. - */ - -#ifndef _SEARCH_H_ -#define _SEARCH_H_ - -#include -#include -#include - -typedef struct entry { - char *key; - void *data; -} ENTRY; - -typedef enum { - FIND, ENTER -} ACTION; - -typedef enum { - preorder, - postorder, - endorder, - leaf -} VISIT; - -#ifdef _SEARCH_PRIVATE -typedef struct node { - char *key; - struct node *llink, *rlink; -} node_t; -#endif - -struct hsearch_data -{ - struct internal_head *htable; - size_t htablesize; -}; - -#ifndef __compar_fn_t_defined -#define __compar_fn_t_defined -typedef int (*__compar_fn_t) (const void *, const void *); -#endif - -__BEGIN_DECLS -int hcreate(size_t); -void hdestroy(void); -ENTRY *hsearch(ENTRY, ACTION); -int hcreate_r(size_t, struct hsearch_data *); -void hdestroy_r(struct hsearch_data *); -int hsearch_r(ENTRY, ACTION, ENTRY **, struct hsearch_data *); -void *tdelete(const void *__restrict, void **__restrict, __compar_fn_t); -void tdestroy (void *, void (*)(void *)); -void *tfind(const void *, void **, __compar_fn_t); -void *tsearch(const void *, void **, __compar_fn_t); -void twalk(const void *, void (*)(const void *, VISIT, int)); -__END_DECLS - -#endif /* !_SEARCH_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/setjmp.h b/tools/sdk/libc/xtensa-lx106-elf/include/setjmp.h deleted file mode 100644 index 3d815d9b9..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/setjmp.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - setjmp.h - stubs for future use. -*/ - -#ifndef _SETJMP_H_ -#define _SETJMP_H_ - -#include "_ansi.h" -#include - -_BEGIN_STD_C - -#ifdef __GNUC__ -void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)) - __attribute__ ((__noreturn__)); -#else -void _EXFUN(longjmp,(jmp_buf __jmpb, int __retval)); -#endif -int _EXFUN(setjmp,(jmp_buf __jmpb)); -#define setjmp(env) setjmp(env) - - -_END_STD_C - -#endif /* _SETJMP_H_ */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/signal.h b/tools/sdk/libc/xtensa-lx106-elf/include/signal.h deleted file mode 100644 index 8c50a2eb3..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/signal.h +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef _SIGNAL_H_ -#define _SIGNAL_H_ - -#include "_ansi.h" -#include - -_BEGIN_STD_C - -typedef int sig_atomic_t; /* Atomic entity type (ANSI) */ -#ifndef _POSIX_SOURCE -typedef _sig_func_ptr sig_t; /* BSD naming */ -typedef _sig_func_ptr sighandler_t; /* glibc naming */ -#endif /* !_POSIX_SOURCE */ - -#define SIG_DFL ((_sig_func_ptr)0) /* Default action */ -#define SIG_IGN ((_sig_func_ptr)1) /* Ignore action */ -#define SIG_ERR ((_sig_func_ptr)-1) /* Error return */ - -struct _reent; - -_sig_func_ptr _EXFUN(_signal_r, (struct _reent *, int, _sig_func_ptr)); -int _EXFUN(_raise_r, (struct _reent *, int)); - -#ifndef _REENT_ONLY -_sig_func_ptr _EXFUN(signal, (int, _sig_func_ptr)); -int _EXFUN(raise, (int)); -void _EXFUN(psignal, (int, const char *)); -#endif - -_END_STD_C - -#endif /* _SIGNAL_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/spawn.h b/tools/sdk/libc/xtensa-lx106-elf/include/spawn.h deleted file mode 100644 index 5a6692f11..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/spawn.h +++ /dev/null @@ -1,119 +0,0 @@ -/*- - * Copyright (c) 2008 Ed Schouten - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -#ifndef _SPAWN_H_ -#define _SPAWN_H_ - -#include <_ansi.h> -#include -#include -#include -#define __need_sigset_t -#include - -struct sched_param; - -typedef struct __posix_spawnattr *posix_spawnattr_t; -typedef struct __posix_spawn_file_actions *posix_spawn_file_actions_t; - -#define POSIX_SPAWN_RESETIDS 0x01 -#define POSIX_SPAWN_SETPGROUP 0x02 -#define POSIX_SPAWN_SETSCHEDPARAM 0x04 -#define POSIX_SPAWN_SETSCHEDULER 0x08 -#define POSIX_SPAWN_SETSIGDEF 0x10 -#define POSIX_SPAWN_SETSIGMASK 0x20 - -_BEGIN_STD_C -/* - * Spawn routines - * - * XXX both arrays should be __restrict, but this does not work when GCC - * is invoked with -std=c99. - */ -int _EXFUN(posix_spawn, (pid_t * __restrict, const char * __restrict, - const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, - char * const [], char * const []) -); -int _EXFUN(posix_spawnp, (pid_t * __restrict, const char * __restrict, - const posix_spawn_file_actions_t *, const posix_spawnattr_t * __restrict, - char * const [], char * const []) -); - -/* - * File descriptor actions - */ -int _EXFUN(posix_spawn_file_actions_init, (posix_spawn_file_actions_t *)); -int _EXFUN(posix_spawn_file_actions_destroy, (posix_spawn_file_actions_t *)); - -int _EXFUN(posix_spawn_file_actions_addopen, - (posix_spawn_file_actions_t * __restrict, int, const char * __restrict, int, mode_t) -); -int _EXFUN(posix_spawn_file_actions_adddup2, - (posix_spawn_file_actions_t *, int, int) -); -int _EXFUN(posix_spawn_file_actions_addclose, - (posix_spawn_file_actions_t *, int) -); - -/* - * Spawn attributes - */ -int _EXFUN(posix_spawnattr_init, (posix_spawnattr_t *)); -int _EXFUN(posix_spawnattr_destroy, (posix_spawnattr_t *)); - -int _EXFUN(posix_spawnattr_getflags, - (const posix_spawnattr_t * __restrict, short * __restrict) -); -int _EXFUN(posix_spawnattr_getpgroup, - (const posix_spawnattr_t * __restrict, pid_t * __restrict)); -int _EXFUN(posix_spawnattr_getschedparam, - (const posix_spawnattr_t * __restrict, struct sched_param * __restrict) -); -int _EXFUN(posix_spawnattr_getschedpolicy, - (const posix_spawnattr_t * __restrict, int * __restrict) -); -int _EXFUN(posix_spawnattr_getsigdefault, - (const posix_spawnattr_t * __restrict, sigset_t * __restrict) -); -int _EXFUN(posix_spawnattr_getsigmask, - (const posix_spawnattr_t * __restrict, sigset_t * __restrict) -); - -int _EXFUN(posix_spawnattr_setflags, (posix_spawnattr_t *, short)); -int _EXFUN(posix_spawnattr_setpgroup, (posix_spawnattr_t *, pid_t)); -int _EXFUN(posix_spawnattr_setschedparam, - (posix_spawnattr_t * __restrict, const struct sched_param * __restrict) -); -int _EXFUN(posix_spawnattr_setschedpolicy, (posix_spawnattr_t *, int)); -int _EXFUN(posix_spawnattr_setsigdefault, - (posix_spawnattr_t * __restrict, const sigset_t * __restrict) -); -int _EXFUN(posix_spawnattr_setsigmask, - (posix_spawnattr_t * __restrict, const sigset_t * __restrict) -); -_END_STD_C - -#endif /* !_SPAWN_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/stdatomic.h b/tools/sdk/libc/xtensa-lx106-elf/include/stdatomic.h deleted file mode 100644 index 09c0cf73e..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/stdatomic.h +++ /dev/null @@ -1,413 +0,0 @@ -/*- - * Copyright (c) 2011 Ed Schouten - * David Chisnall - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * $FreeBSD$ - */ - -#ifndef _STDATOMIC_H_ -#define _STDATOMIC_H_ - -#include -#include - -#if __has_extension(c_atomic) || __has_extension(cxx_atomic) -#define __CLANG_ATOMICS -#elif __GNUC_PREREQ__(4, 7) -#define __GNUC_ATOMICS -#elif defined(__GNUC__) -#define __SYNC_ATOMICS -#else -#error "stdatomic.h does not support your compiler" -#endif - -/* - * 7.17.1 Atomic lock-free macros. - */ - -#ifdef __GCC_ATOMIC_BOOL_LOCK_FREE -#define ATOMIC_BOOL_LOCK_FREE __GCC_ATOMIC_BOOL_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_CHAR_LOCK_FREE -#define ATOMIC_CHAR_LOCK_FREE __GCC_ATOMIC_CHAR_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_CHAR16_T_LOCK_FREE -#define ATOMIC_CHAR16_T_LOCK_FREE __GCC_ATOMIC_CHAR16_T_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_CHAR32_T_LOCK_FREE -#define ATOMIC_CHAR32_T_LOCK_FREE __GCC_ATOMIC_CHAR32_T_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_WCHAR_T_LOCK_FREE -#define ATOMIC_WCHAR_T_LOCK_FREE __GCC_ATOMIC_WCHAR_T_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_SHORT_LOCK_FREE -#define ATOMIC_SHORT_LOCK_FREE __GCC_ATOMIC_SHORT_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_INT_LOCK_FREE -#define ATOMIC_INT_LOCK_FREE __GCC_ATOMIC_INT_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_LONG_LOCK_FREE -#define ATOMIC_LONG_LOCK_FREE __GCC_ATOMIC_LONG_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_LLONG_LOCK_FREE -#define ATOMIC_LLONG_LOCK_FREE __GCC_ATOMIC_LLONG_LOCK_FREE -#endif -#ifdef __GCC_ATOMIC_POINTER_LOCK_FREE -#define ATOMIC_POINTER_LOCK_FREE __GCC_ATOMIC_POINTER_LOCK_FREE -#endif - -/* - * 7.17.2 Initialization. - */ - -#if defined(__CLANG_ATOMICS) -#define ATOMIC_VAR_INIT(value) (value) -#define atomic_init(obj, value) __c11_atomic_init(obj, value) -#else -#define ATOMIC_VAR_INIT(value) { .__val = (value) } -#define atomic_init(obj, value) ((void)((obj)->__val = (value))) -#endif - -/* - * Clang and recent GCC both provide predefined macros for the memory - * orderings. If we are using a compiler that doesn't define them, use the - * clang values - these will be ignored in the fallback path. - */ - -#ifndef __ATOMIC_RELAXED -#define __ATOMIC_RELAXED 0 -#endif -#ifndef __ATOMIC_CONSUME -#define __ATOMIC_CONSUME 1 -#endif -#ifndef __ATOMIC_ACQUIRE -#define __ATOMIC_ACQUIRE 2 -#endif -#ifndef __ATOMIC_RELEASE -#define __ATOMIC_RELEASE 3 -#endif -#ifndef __ATOMIC_ACQ_REL -#define __ATOMIC_ACQ_REL 4 -#endif -#ifndef __ATOMIC_SEQ_CST -#define __ATOMIC_SEQ_CST 5 -#endif - -/* - * 7.17.3 Order and consistency. - * - * The memory_order_* constants that denote the barrier behaviour of the - * atomic operations. - */ - -typedef enum { - memory_order_relaxed = __ATOMIC_RELAXED, - memory_order_consume = __ATOMIC_CONSUME, - memory_order_acquire = __ATOMIC_ACQUIRE, - memory_order_release = __ATOMIC_RELEASE, - memory_order_acq_rel = __ATOMIC_ACQ_REL, - memory_order_seq_cst = __ATOMIC_SEQ_CST -} memory_order; - -/* - * 7.17.4 Fences. - */ - -static __inline void -atomic_thread_fence(memory_order __order __unused) -{ - -#ifdef __CLANG_ATOMICS - __c11_atomic_thread_fence(__order); -#elif defined(__GNUC_ATOMICS) - __atomic_thread_fence(__order); -#else - __sync_synchronize(); -#endif -} - -static __inline void -atomic_signal_fence(memory_order __order __unused) -{ - -#ifdef __CLANG_ATOMICS - __c11_atomic_signal_fence(__order); -#elif defined(__GNUC_ATOMICS) - __atomic_signal_fence(__order); -#else - __asm volatile ("" ::: "memory"); -#endif -} - -/* - * 7.17.5 Lock-free property. - */ - -#if defined(_KERNEL) -/* Atomics in kernelspace are always lock-free. */ -#define atomic_is_lock_free(obj) \ - ((void)(obj), (_Bool)1) -#elif defined(__CLANG_ATOMICS) -#define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof(*(obj)), obj) -#elif defined(__GNUC_ATOMICS) -#define atomic_is_lock_free(obj) \ - __atomic_is_lock_free(sizeof((obj)->__val), &(obj)->__val) -#else -#define atomic_is_lock_free(obj) \ - ((void)(obj), sizeof((obj)->__val) <= sizeof(void *)) -#endif - -/* - * 7.17.6 Atomic integer types. - */ - -typedef _Atomic(_Bool) atomic_bool; -typedef _Atomic(char) atomic_char; -typedef _Atomic(signed char) atomic_schar; -typedef _Atomic(unsigned char) atomic_uchar; -typedef _Atomic(short) atomic_short; -typedef _Atomic(unsigned short) atomic_ushort; -typedef _Atomic(int) atomic_int; -typedef _Atomic(unsigned int) atomic_uint; -typedef _Atomic(long) atomic_long; -typedef _Atomic(unsigned long) atomic_ulong; -typedef _Atomic(long long) atomic_llong; -typedef _Atomic(unsigned long long) atomic_ullong; -#if 0 -typedef _Atomic(__char16_t) atomic_char16_t; -typedef _Atomic(__char32_t) atomic_char32_t; -#endif -typedef _Atomic(wchar_t) atomic_wchar_t; -typedef _Atomic(int_least8_t) atomic_int_least8_t; -typedef _Atomic(uint_least8_t) atomic_uint_least8_t; -typedef _Atomic(int_least16_t) atomic_int_least16_t; -typedef _Atomic(uint_least16_t) atomic_uint_least16_t; -typedef _Atomic(int_least32_t) atomic_int_least32_t; -typedef _Atomic(uint_least32_t) atomic_uint_least32_t; -typedef _Atomic(int_least64_t) atomic_int_least64_t; -typedef _Atomic(uint_least64_t) atomic_uint_least64_t; -typedef _Atomic(int_fast8_t) atomic_int_fast8_t; -typedef _Atomic(uint_fast8_t) atomic_uint_fast8_t; -typedef _Atomic(int_fast16_t) atomic_int_fast16_t; -typedef _Atomic(uint_fast16_t) atomic_uint_fast16_t; -typedef _Atomic(int_fast32_t) atomic_int_fast32_t; -typedef _Atomic(uint_fast32_t) atomic_uint_fast32_t; -typedef _Atomic(int_fast64_t) atomic_int_fast64_t; -typedef _Atomic(uint_fast64_t) atomic_uint_fast64_t; -typedef _Atomic(intptr_t) atomic_intptr_t; -typedef _Atomic(uintptr_t) atomic_uintptr_t; -typedef _Atomic(size_t) atomic_size_t; -typedef _Atomic(ptrdiff_t) atomic_ptrdiff_t; -typedef _Atomic(intmax_t) atomic_intmax_t; -typedef _Atomic(uintmax_t) atomic_uintmax_t; - -/* - * 7.17.7 Operations on atomic types. - */ - -/* - * Compiler-specific operations. - */ - -#if defined(__CLANG_ATOMICS) -#define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) \ - __c11_atomic_compare_exchange_strong(object, expected, desired, \ - success, failure) -#define atomic_compare_exchange_weak_explicit(object, expected, \ - desired, success, failure) \ - __c11_atomic_compare_exchange_weak(object, expected, desired, \ - success, failure) -#define atomic_exchange_explicit(object, desired, order) \ - __c11_atomic_exchange(object, desired, order) -#define atomic_fetch_add_explicit(object, operand, order) \ - __c11_atomic_fetch_add(object, operand, order) -#define atomic_fetch_and_explicit(object, operand, order) \ - __c11_atomic_fetch_and(object, operand, order) -#define atomic_fetch_or_explicit(object, operand, order) \ - __c11_atomic_fetch_or(object, operand, order) -#define atomic_fetch_sub_explicit(object, operand, order) \ - __c11_atomic_fetch_sub(object, operand, order) -#define atomic_fetch_xor_explicit(object, operand, order) \ - __c11_atomic_fetch_xor(object, operand, order) -#define atomic_load_explicit(object, order) \ - __c11_atomic_load(object, order) -#define atomic_store_explicit(object, desired, order) \ - __c11_atomic_store(object, desired, order) -#elif defined(__GNUC_ATOMICS) -#define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ - desired, 0, success, failure) -#define atomic_compare_exchange_weak_explicit(object, expected, \ - desired, success, failure) \ - __atomic_compare_exchange_n(&(object)->__val, expected, \ - desired, 1, success, failure) -#define atomic_exchange_explicit(object, desired, order) \ - __atomic_exchange_n(&(object)->__val, desired, order) -#define atomic_fetch_add_explicit(object, operand, order) \ - __atomic_fetch_add(&(object)->__val, operand, order) -#define atomic_fetch_and_explicit(object, operand, order) \ - __atomic_fetch_and(&(object)->__val, operand, order) -#define atomic_fetch_or_explicit(object, operand, order) \ - __atomic_fetch_or(&(object)->__val, operand, order) -#define atomic_fetch_sub_explicit(object, operand, order) \ - __atomic_fetch_sub(&(object)->__val, operand, order) -#define atomic_fetch_xor_explicit(object, operand, order) \ - __atomic_fetch_xor(&(object)->__val, operand, order) -#define atomic_load_explicit(object, order) \ - __atomic_load_n(&(object)->__val, order) -#define atomic_store_explicit(object, desired, order) \ - __atomic_store_n(&(object)->__val, desired, order) -#else -#define __atomic_apply_stride(object, operand) \ - (((__typeof__((object)->__val))0) + (operand)) -#define atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) __extension__ ({ \ - __typeof__(expected) __ep = (expected); \ - __typeof__(*__ep) __e = *__ep; \ - (void)(success); (void)(failure); \ - (_Bool)((*__ep = __sync_val_compare_and_swap(&(object)->__val, \ - __e, desired)) == __e); \ -}) -#define atomic_compare_exchange_weak_explicit(object, expected, \ - desired, success, failure) \ - atomic_compare_exchange_strong_explicit(object, expected, \ - desired, success, failure) -#if __has_builtin(__sync_swap) -/* Clang provides a full-barrier atomic exchange - use it if available. */ -#define atomic_exchange_explicit(object, desired, order) \ - ((void)(order), __sync_swap(&(object)->__val, desired)) -#else -/* - * __sync_lock_test_and_set() is only an acquire barrier in theory (although in - * practice it is usually a full barrier) so we need an explicit barrier before - * it. - */ -#define atomic_exchange_explicit(object, desired, order) \ -__extension__ ({ \ - __typeof__(object) __o = (object); \ - __typeof__(desired) __d = (desired); \ - (void)(order); \ - __sync_synchronize(); \ - __sync_lock_test_and_set(&(__o)->__val, __d); \ -}) -#endif -#define atomic_fetch_add_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_add(&(object)->__val, \ - __atomic_apply_stride(object, operand))) -#define atomic_fetch_and_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_and(&(object)->__val, operand)) -#define atomic_fetch_or_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_or(&(object)->__val, operand)) -#define atomic_fetch_sub_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_sub(&(object)->__val, \ - __atomic_apply_stride(object, operand))) -#define atomic_fetch_xor_explicit(object, operand, order) \ - ((void)(order), __sync_fetch_and_xor(&(object)->__val, operand)) -#define atomic_load_explicit(object, order) \ - ((void)(order), __sync_fetch_and_add(&(object)->__val, 0)) -#define atomic_store_explicit(object, desired, order) \ - ((void)atomic_exchange_explicit(object, desired, order)) -#endif - -/* - * Convenience functions. - * - * Don't provide these in kernel space. In kernel space, we should be - * disciplined enough to always provide explicit barriers. - */ - -#ifndef _KERNEL -#define atomic_compare_exchange_strong(object, expected, desired) \ - atomic_compare_exchange_strong_explicit(object, expected, \ - desired, memory_order_seq_cst, memory_order_seq_cst) -#define atomic_compare_exchange_weak(object, expected, desired) \ - atomic_compare_exchange_weak_explicit(object, expected, \ - desired, memory_order_seq_cst, memory_order_seq_cst) -#define atomic_exchange(object, desired) \ - atomic_exchange_explicit(object, desired, memory_order_seq_cst) -#define atomic_fetch_add(object, operand) \ - atomic_fetch_add_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_and(object, operand) \ - atomic_fetch_and_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_or(object, operand) \ - atomic_fetch_or_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_sub(object, operand) \ - atomic_fetch_sub_explicit(object, operand, memory_order_seq_cst) -#define atomic_fetch_xor(object, operand) \ - atomic_fetch_xor_explicit(object, operand, memory_order_seq_cst) -#define atomic_load(object) \ - atomic_load_explicit(object, memory_order_seq_cst) -#define atomic_store(object, desired) \ - atomic_store_explicit(object, desired, memory_order_seq_cst) -#endif /* !_KERNEL */ - -/* - * 7.17.8 Atomic flag type and operations. - * - * XXX: Assume atomic_bool can be used as an atomic_flag. Is there some - * kind of compiler built-in type we could use? - */ - -typedef struct { - atomic_bool __flag; -} atomic_flag; - -#define ATOMIC_FLAG_INIT { ATOMIC_VAR_INIT(0) } - -static __inline _Bool -atomic_flag_test_and_set_explicit(volatile atomic_flag *__object, - memory_order __order) -{ - return (atomic_exchange_explicit(&__object->__flag, 1, __order)); -} - -static __inline void -atomic_flag_clear_explicit(volatile atomic_flag *__object, memory_order __order) -{ - - atomic_store_explicit(&__object->__flag, 0, __order); -} - -#ifndef _KERNEL -static __inline _Bool -atomic_flag_test_and_set(volatile atomic_flag *__object) -{ - - return (atomic_flag_test_and_set_explicit(__object, - memory_order_seq_cst)); -} - -static __inline void -atomic_flag_clear(volatile atomic_flag *__object) -{ - - atomic_flag_clear_explicit(__object, memory_order_seq_cst); -} -#endif /* !_KERNEL */ - -#endif /* !_STDATOMIC_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/stdint.h b/tools/sdk/libc/xtensa-lx106-elf/include/stdint.h deleted file mode 100644 index 7386164b9..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/stdint.h +++ /dev/null @@ -1,511 +0,0 @@ -/* - * Copyright (c) 2004, 2005 by - * Ralf Corsepius, Ulm/Germany. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#ifndef _STDINT_H -#define _STDINT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef ___int8_t_defined -typedef __int8_t int8_t ; -typedef __uint8_t uint8_t ; -#define __int8_t_defined 1 -#endif - -#ifdef ___int_least8_t_defined -typedef __int_least8_t int_least8_t; -typedef __uint_least8_t uint_least8_t; -#define __int_least8_t_defined 1 -#endif - -#ifdef ___int16_t_defined -typedef __int16_t int16_t ; -typedef __uint16_t uint16_t ; -#define __int16_t_defined 1 -#endif - -#ifdef ___int_least16_t_defined -typedef __int_least16_t int_least16_t; -typedef __uint_least16_t uint_least16_t; -#define __int_least16_t_defined 1 -#endif - -#ifdef ___int32_t_defined -typedef __int32_t int32_t ; -typedef __uint32_t uint32_t ; -#define __int32_t_defined 1 -#endif - -#ifdef ___int_least32_t_defined -typedef __int_least32_t int_least32_t; -typedef __uint_least32_t uint_least32_t; -#define __int_least32_t_defined 1 -#endif - -#ifdef ___int64_t_defined -typedef __int64_t int64_t ; -typedef __uint64_t uint64_t ; -#define __int64_t_defined 1 -#endif - -#ifdef ___int_least64_t_defined -typedef __int_least64_t int_least64_t; -typedef __uint_least64_t uint_least64_t; -#define __int_least64_t_defined 1 -#endif - -/* - * Fastest minimum-width integer types - * - * Assume int to be the fastest type for all types with a width - * less than __INT_MAX__ rsp. INT_MAX - */ -#ifdef __INT_FAST8_TYPE__ - typedef __INT_FAST8_TYPE__ int_fast8_t; - typedef __UINT_FAST8_TYPE__ uint_fast8_t; -#define __int_fast8_t_defined 1 -#elif __STDINT_EXP(INT_MAX) >= 0x7f - typedef signed int int_fast8_t; - typedef unsigned int uint_fast8_t; -#define __int_fast8_t_defined 1 -#endif - -#ifdef __INT_FAST16_TYPE__ - typedef __INT_FAST16_TYPE__ int_fast16_t; - typedef __UINT_FAST16_TYPE__ uint_fast16_t; -#define __int_fast16_t_defined 1 -#elif __STDINT_EXP(INT_MAX) >= 0x7fff - typedef signed int int_fast16_t; - typedef unsigned int uint_fast16_t; -#define __int_fast16_t_defined 1 -#endif - -#ifdef __INT_FAST32_TYPE__ - typedef __INT_FAST32_TYPE__ int_fast32_t; - typedef __UINT_FAST32_TYPE__ uint_fast32_t; -#define __int_fast32_t_defined 1 -#elif __STDINT_EXP(INT_MAX) >= 0x7fffffff - typedef signed int int_fast32_t; - typedef unsigned int uint_fast32_t; -#define __int_fast32_t_defined 1 -#endif - -#ifdef __INT_FAST64_TYPE__ - typedef __INT_FAST64_TYPE__ int_fast64_t; - typedef __UINT_FAST64_TYPE__ uint_fast64_t; -#define __int_fast64_t_defined 1 -#elif __STDINT_EXP(INT_MAX) > 0x7fffffff - typedef signed int int_fast64_t; - typedef unsigned int uint_fast64_t; -#define __int_fast64_t_defined 1 -#endif - -/* - * Fall back to [u]int_least_t for [u]int_fast_t types - * not having been defined, yet. - * Leave undefined, if [u]int_least_t should not be available. - */ -#if !__int_fast8_t_defined -#if __int_least8_t_defined - typedef int_least8_t int_fast8_t; - typedef uint_least8_t uint_fast8_t; -#define __int_fast8_t_defined 1 -#endif -#endif - -#if !__int_fast16_t_defined -#if __int_least16_t_defined - typedef int_least16_t int_fast16_t; - typedef uint_least16_t uint_fast16_t; -#define __int_fast16_t_defined 1 -#endif -#endif - -#if !__int_fast32_t_defined -#if __int_least32_t_defined - typedef int_least32_t int_fast32_t; - typedef uint_least32_t uint_fast32_t; -#define __int_fast32_t_defined 1 -#endif -#endif - -#if !__int_fast64_t_defined -#if __int_least64_t_defined - typedef int_least64_t int_fast64_t; - typedef uint_least64_t uint_fast64_t; -#define __int_fast64_t_defined 1 -#endif -#endif - -/* Greatest-width integer types */ -/* Modern GCCs provide __INTMAX_TYPE__ */ -#if defined(__INTMAX_TYPE__) - typedef __INTMAX_TYPE__ intmax_t; -#elif __have_longlong64 - typedef signed long long intmax_t; -#else - typedef signed long intmax_t; -#endif - -/* Modern GCCs provide __UINTMAX_TYPE__ */ -#if defined(__UINTMAX_TYPE__) - typedef __UINTMAX_TYPE__ uintmax_t; -#elif __have_longlong64 - typedef unsigned long long uintmax_t; -#else - typedef unsigned long uintmax_t; -#endif - -typedef __intptr_t intptr_t; -typedef __uintptr_t uintptr_t; - -#ifdef __INTPTR_TYPE__ -#define INTPTR_MIN (-__INTPTR_MAX__ - 1) -#define INTPTR_MAX __INTPTR_MAX__ -#define UINTPTR_MAX __UINTPTR_MAX__ -#elif defined(__PTRDIFF_TYPE__) -#define INTPTR_MAX PTRDIFF_MAX -#define INTPTR_MIN PTRDIFF_MIN -#ifdef __UINTPTR_MAX__ -#define UINTPTR_MAX __UINTPTR_MAX__ -#else -#define UINTPTR_MAX (2UL * PTRDIFF_MAX + 1) -#endif -#else -/* - * Fallback to hardcoded values, - * should be valid on cpu's with 32bit int/32bit void* - */ -#define INTPTR_MAX __STDINT_EXP(LONG_MAX) -#define INTPTR_MIN (-__STDINT_EXP(LONG_MAX) - 1) -#define UINTPTR_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) -#endif - -/* Limits of Specified-Width Integer Types */ - -#ifdef __INT8_MAX__ -#define INT8_MIN (-__INT8_MAX__ - 1) -#define INT8_MAX __INT8_MAX__ -#define UINT8_MAX __UINT8_MAX__ -#elif defined(__int8_t_defined) -#define INT8_MIN -128 -#define INT8_MAX 127 -#define UINT8_MAX 255 -#endif - -#ifdef __INT_LEAST8_MAX__ -#define INT_LEAST8_MIN (-__INT_LEAST8_MAX__ - 1) -#define INT_LEAST8_MAX __INT_LEAST8_MAX__ -#define UINT_LEAST8_MAX __UINT_LEAST8_MAX__ -#elif defined(__int_least8_t_defined) -#define INT_LEAST8_MIN -128 -#define INT_LEAST8_MAX 127 -#define UINT_LEAST8_MAX 255 -#else -#error required type int_least8_t missing -#endif - -#ifdef __INT16_MAX__ -#define INT16_MIN (-__INT16_MAX__ - 1) -#define INT16_MAX __INT16_MAX__ -#define UINT16_MAX __UINT16_MAX__ -#elif defined(__int16_t_defined) -#define INT16_MIN -32768 -#define INT16_MAX 32767 -#define UINT16_MAX 65535 -#endif - -#ifdef __INT_LEAST16_MAX__ -#define INT_LEAST16_MIN (-__INT_LEAST16_MAX__ - 1) -#define INT_LEAST16_MAX __INT_LEAST16_MAX__ -#define UINT_LEAST16_MAX __UINT_LEAST16_MAX__ -#elif defined(__int_least16_t_defined) -#define INT_LEAST16_MIN -32768 -#define INT_LEAST16_MAX 32767 -#define UINT_LEAST16_MAX 65535 -#else -#error required type int_least16_t missing -#endif - -#ifdef __INT32_MAX__ -#define INT32_MIN (-__INT32_MAX__ - 1) -#define INT32_MAX __INT32_MAX__ -#define UINT32_MAX __UINT32_MAX__ -#elif defined(__int32_t_defined) -#if __have_long32 -#define INT32_MIN (-2147483647L-1) -#define INT32_MAX 2147483647L -#define UINT32_MAX 4294967295UL -#else -#define INT32_MIN (-2147483647-1) -#define INT32_MAX 2147483647 -#define UINT32_MAX 4294967295U -#endif -#endif - -#ifdef __INT_LEAST32_MAX__ -#define INT_LEAST32_MIN (-__INT_LEAST32_MAX__ - 1) -#define INT_LEAST32_MAX __INT_LEAST32_MAX__ -#define UINT_LEAST32_MAX __UINT_LEAST32_MAX__ -#elif defined(__int_least32_t_defined) -#if __have_long32 -#define INT_LEAST32_MIN (-2147483647L-1) -#define INT_LEAST32_MAX 2147483647L -#define UINT_LEAST32_MAX 4294967295UL -#else -#define INT_LEAST32_MIN (-2147483647-1) -#define INT_LEAST32_MAX 2147483647 -#define UINT_LEAST32_MAX 4294967295U -#endif -#else -#error required type int_least32_t missing -#endif - -#ifdef __INT64_MAX__ -#define INT64_MIN (-__INT64_MAX__ - 1) -#define INT64_MAX __INT64_MAX__ -#define UINT64_MAX __UINT64_MAX__ -#elif defined(__int64_t_defined) -#if __have_long64 -#define INT64_MIN (-9223372036854775807L-1L) -#define INT64_MAX 9223372036854775807L -#define UINT64_MAX 18446744073709551615U -#elif __have_longlong64 -#define INT64_MIN (-9223372036854775807LL-1LL) -#define INT64_MAX 9223372036854775807LL -#define UINT64_MAX 18446744073709551615ULL -#endif -#endif - -#ifdef __INT_LEAST64_MAX__ -#define INT_LEAST64_MIN (-__INT_LEAST64_MAX__ - 1) -#define INT_LEAST64_MAX __INT_LEAST64_MAX__ -#define UINT_LEAST64_MAX __UINT_LEAST64_MAX__ -#elif defined(__int_least64_t_defined) -#if __have_long64 -#define INT_LEAST64_MIN (-9223372036854775807L-1L) -#define INT_LEAST64_MAX 9223372036854775807L -#define UINT_LEAST64_MAX 18446744073709551615U -#elif __have_longlong64 -#define INT_LEAST64_MIN (-9223372036854775807LL-1LL) -#define INT_LEAST64_MAX 9223372036854775807LL -#define UINT_LEAST64_MAX 18446744073709551615ULL -#endif -#endif - -#ifdef __INT_FAST8_MAX__ -#define INT_FAST8_MIN (-__INT_FAST8_MAX__ - 1) -#define INT_FAST8_MAX __INT_FAST8_MAX__ -#define UINT_FAST8_MAX __UINT_FAST8_MAX__ -#elif defined(__int_fast8_t_defined) -#if __STDINT_EXP(INT_MAX) >= 0x7f -#define INT_FAST8_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST8_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST8_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST8_MIN INT_LEAST8_MIN -#define INT_FAST8_MAX INT_LEAST8_MAX -#define UINT_FAST8_MAX UINT_LEAST8_MAX -#endif -#endif - -#ifdef __INT_FAST16_MAX__ -#define INT_FAST16_MIN (-__INT_FAST16_MAX__ - 1) -#define INT_FAST16_MAX __INT_FAST16_MAX__ -#define UINT_FAST16_MAX __UINT_FAST16_MAX__ -#elif defined(__int_fast16_t_defined) -#if __STDINT_EXP(INT_MAX) >= 0x7fff -#define INT_FAST16_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST16_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST16_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST16_MIN INT_LEAST16_MIN -#define INT_FAST16_MAX INT_LEAST16_MAX -#define UINT_FAST16_MAX UINT_LEAST16_MAX -#endif -#endif - -#ifdef __INT_FAST32_MAX__ -#define INT_FAST32_MIN (-__INT_FAST32_MAX__ - 1) -#define INT_FAST32_MAX __INT_FAST32_MAX__ -#define UINT_FAST32_MAX __UINT_FAST32_MAX__ -#elif defined(__int_fast32_t_defined) -#if __STDINT_EXP(INT_MAX) >= 0x7fffffff -#define INT_FAST32_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST32_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST32_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST32_MIN INT_LEAST32_MIN -#define INT_FAST32_MAX INT_LEAST32_MAX -#define UINT_FAST32_MAX UINT_LEAST32_MAX -#endif -#endif - -#ifdef __INT_FAST64_MAX__ -#define INT_FAST64_MIN (-__INT_FAST64_MAX__ - 1) -#define INT_FAST64_MAX __INT_FAST64_MAX__ -#define UINT_FAST64_MAX __UINT_FAST64_MAX__ -#elif defined(__int_fast64_t_defined) -#if __STDINT_EXP(INT_MAX) > 0x7fffffff -#define INT_FAST64_MIN (-__STDINT_EXP(INT_MAX)-1) -#define INT_FAST64_MAX __STDINT_EXP(INT_MAX) -#define UINT_FAST64_MAX (__STDINT_EXP(INT_MAX)*2U+1U) -#else -#define INT_FAST64_MIN INT_LEAST64_MIN -#define INT_FAST64_MAX INT_LEAST64_MAX -#define UINT_FAST64_MAX UINT_LEAST64_MAX -#endif -#endif - -#ifdef __INTMAX_MAX__ -#define INTMAX_MAX __INTMAX_MAX__ -#define INTMAX_MIN (-INTMAX_MAX - 1) -#elif defined(__INTMAX_TYPE__) -/* All relevant GCC versions prefer long to long long for intmax_t. */ -#define INTMAX_MAX INT64_MAX -#define INTMAX_MIN INT64_MIN -#endif - -#ifdef __UINTMAX_MAX__ -#define UINTMAX_MAX __UINTMAX_MAX__ -#elif defined(__UINTMAX_TYPE__) -/* All relevant GCC versions prefer long to long long for intmax_t. */ -#define UINTMAX_MAX UINT64_MAX -#endif - -/* This must match size_t in stddef.h, currently long unsigned int */ -#ifdef __SIZE_MAX__ -#define SIZE_MAX __SIZE_MAX__ -#else -#define SIZE_MAX (__STDINT_EXP(LONG_MAX) * 2UL + 1) -#endif - -/* This must match sig_atomic_t in (currently int) */ -#define SIG_ATOMIC_MIN (-__STDINT_EXP(INT_MAX) - 1) -#define SIG_ATOMIC_MAX __STDINT_EXP(INT_MAX) - -/* This must match ptrdiff_t in (currently long int) */ -#ifdef __PTRDIFF_MAX__ -#define PTRDIFF_MAX __PTRDIFF_MAX__ -#else -#define PTRDIFF_MAX __STDINT_EXP(LONG_MAX) -#endif -#define PTRDIFF_MIN (-PTRDIFF_MAX - 1) - -/* This must match definition in */ -#ifndef WCHAR_MIN -#ifdef __WCHAR_MIN__ -#define WCHAR_MIN __WCHAR_MIN__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MIN (0 + L'\0') -#else -#define WCHAR_MIN (-0x7fffffff - 1 + L'\0') -#endif -#endif - -/* This must match definition in */ -#ifndef WCHAR_MAX -#ifdef __WCHAR_MAX__ -#define WCHAR_MAX __WCHAR_MAX__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MAX (0xffffffffu + L'\0') -#else -#define WCHAR_MAX (0x7fffffff + L'\0') -#endif -#endif - -/* wint_t is unsigned int on almost all GCC targets. */ -#ifdef __WINT_MAX__ -#define WINT_MAX __WINT_MAX__ -#else -#define WINT_MAX (__STDINT_EXP(INT_MAX) * 2U + 1U) -#endif -#ifdef __WINT_MIN__ -#define WINT_MIN __WINT_MIN__ -#else -#define WINT_MIN 0U -#endif - -/** Macros for minimum-width integer constant expressions */ -#ifdef __INT8_C -#define INT8_C(x) __INT8_C(x) -#define UINT8_C(x) __UINT8_C(x) -#else -#define INT8_C(x) x -#if __STDINT_EXP(INT_MAX) > 0x7f -#define UINT8_C(x) x -#else -#define UINT8_C(x) x##U -#endif -#endif - -#ifdef __INT16_C -#define INT16_C(x) __INT16_C(x) -#define UINT16_C(x) __UINT16_C(x) -#else -#define INT16_C(x) x -#if __STDINT_EXP(INT_MAX) > 0x7fff -#define UINT16_C(x) x -#else -#define UINT16_C(x) x##U -#endif -#endif - -#ifdef __INT32_C -#define INT32_C(x) __INT32_C(x) -#define UINT32_C(x) __UINT32_C(x) -#else -#if __have_long32 -#define INT32_C(x) x##L -#define UINT32_C(x) x##UL -#else -#define INT32_C(x) x -#define UINT32_C(x) x##U -#endif -#endif - -#ifdef __INT64_C -#define INT64_C(x) __INT64_C(x) -#define UINT64_C(x) __UINT64_C(x) -#else -#if __int64_t_defined -#if __have_long64 -#define INT64_C(x) x##L -#define UINT64_C(x) x##UL -#else -#define INT64_C(x) x##LL -#define UINT64_C(x) x##ULL -#endif -#endif -#endif - -/** Macros for greatest-width integer constant expression */ -#ifdef __INTMAX_C -#define INTMAX_C(x) __INTMAX_C(x) -#define UINTMAX_C(x) __UINTMAX_C(x) -#else -#if __have_long64 -#define INTMAX_C(x) x##L -#define UINTMAX_C(x) x##UL -#else -#define INTMAX_C(x) x##LL -#define UINTMAX_C(x) x##ULL -#endif -#endif - - -#ifdef __cplusplus -} -#endif - -#endif /* _STDINT_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/stdio.h b/tools/sdk/libc/xtensa-lx106-elf/include/stdio.h deleted file mode 100644 index e336ee6eb..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/stdio.h +++ /dev/null @@ -1,727 +0,0 @@ -/* - * Copyright (c) 1990 The Regents of the University of California. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that the above copyright notice and this paragraph are - * duplicated in all such forms and that any documentation, - * advertising materials, and other materials related to such - * distribution and use acknowledge that the software was developed - * by the University of California, Berkeley. The name of the - * University may not be used to endorse or promote products derived - * from this software without specific prior written permission. - * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. - * - * @(#)stdio.h 5.3 (Berkeley) 3/15/86 - */ - -/* - * NB: to fit things in six character monocase externals, the - * stdio code uses the prefix `__s' for stdio objects, typically - * followed by a three-character attempt at a mnemonic. - */ - -#ifndef _STDIO_H_ -#define _STDIO_H_ - -#include "_ansi.h" - -#define _FSTDIO /* ``function stdio'' */ - -#define __need_size_t -#define __need_NULL -#include -#include - -#define __need___va_list -#include - -/* - * defines __FILE, _fpos_t. - * They must be defined there because struct _reent needs them (and we don't - * want reent.h to include this file. - */ - -#include -#include - -_BEGIN_STD_C - -typedef __FILE FILE; - -#ifdef __CYGWIN__ -typedef _fpos64_t fpos_t; -#else -typedef _fpos_t fpos_t; -#ifdef __LARGE64_FILES -typedef _fpos64_t fpos64_t; -#endif -#endif /* !__CYGWIN__ */ - -#include - -#define __SLBF 0x0001 /* line buffered */ -#define __SNBF 0x0002 /* unbuffered */ -#define __SRD 0x0004 /* OK to read */ -#define __SWR 0x0008 /* OK to write */ - /* RD and WR are never simultaneously asserted */ -#define __SRW 0x0010 /* open for reading & writing */ -#define __SEOF 0x0020 /* found EOF */ -#define __SERR 0x0040 /* found error */ -#define __SMBF 0x0080 /* _buf is from malloc */ -#define __SAPP 0x0100 /* fdopen()ed in append mode - so must write to end */ -#define __SSTR 0x0200 /* this is an sprintf/snprintf string */ -#define __SOPT 0x0400 /* do fseek() optimisation */ -#define __SNPT 0x0800 /* do not do fseek() optimisation */ -#define __SOFF 0x1000 /* set iff _offset is in fact correct */ -#define __SORD 0x2000 /* true => stream orientation (byte/wide) decided */ -#if defined(__CYGWIN__) -# define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */ -#endif -#define __SL64 0x8000 /* is 64-bit offset large file */ - -/* _flags2 flags */ -#define __SNLK 0x0001 /* stdio functions do not lock streams themselves */ -#define __SWID 0x2000 /* true => stream orientation wide, false => byte, only valid if __SORD in _flags is true */ - -/* - * The following three definitions are for ANSI C, which took them - * from System V, which stupidly took internal interface macros and - * made them official arguments to setvbuf(), without renaming them. - * Hence, these ugly _IOxxx names are *supposed* to appear in user code. - * - * Although these happen to match their counterparts above, the - * implementation does not rely on that (so these could be renumbered). - */ -#define _IOFBF 0 /* setvbuf should set fully buffered */ -#define _IOLBF 1 /* setvbuf should set line buffered */ -#define _IONBF 2 /* setvbuf should set unbuffered */ - -#define EOF (-1) - -#ifdef __BUFSIZ__ -#define BUFSIZ __BUFSIZ__ -#else -#define BUFSIZ 1024 -#endif - -#ifdef __FOPEN_MAX__ -#define FOPEN_MAX __FOPEN_MAX__ -#else -#define FOPEN_MAX 20 -#endif - -#ifdef __FILENAME_MAX__ -#define FILENAME_MAX __FILENAME_MAX__ -#else -#define FILENAME_MAX 1024 -#endif - -#ifdef __L_tmpnam__ -#define L_tmpnam __L_tmpnam__ -#else -#define L_tmpnam FILENAME_MAX -#endif - -#ifndef __STRICT_ANSI__ -#define P_tmpdir "/tmp" -#endif - -#ifndef SEEK_SET -#define SEEK_SET 0 /* set file offset to offset */ -#endif -#ifndef SEEK_CUR -#define SEEK_CUR 1 /* set file offset to current plus offset */ -#endif -#ifndef SEEK_END -#define SEEK_END 2 /* set file offset to EOF plus offset */ -#endif - -#define TMP_MAX 26 - -#define stdin (_REENT->_stdin) -#define stdout (_REENT->_stdout) -#define stderr (_REENT->_stderr) - -#define _stdin_r(x) ((x)->_stdin) -#define _stdout_r(x) ((x)->_stdout) -#define _stderr_r(x) ((x)->_stderr) - -/* - * Functions defined in ANSI C standard. - */ - -#ifndef __VALIST -#ifdef __GNUC__ -#define __VALIST __gnuc_va_list -#else -#define __VALIST char* -#endif -#endif - -FILE * _EXFUN(tmpfile, (void)); -char * _EXFUN(tmpnam, (char *)); -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -char * _EXFUN(tempnam, (const char *, const char *)); -#endif -int _EXFUN(fclose, (FILE *)); -int _EXFUN(fflush, (FILE *)); -FILE * _EXFUN(freopen, (const char *__restrict, const char *__restrict, FILE *__restrict)); -void _EXFUN(setbuf, (FILE *__restrict, char *__restrict)); -int _EXFUN(setvbuf, (FILE *__restrict, char *__restrict, int, size_t)); -int _EXFUN(fprintf, (FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(fscanf, (FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(printf, (const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 1, 2)))); -int _EXFUN(scanf, (const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 1, 2)))); -int _EXFUN(sscanf, (const char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(vfprintf, (FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vprintf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 1, 0)))); -int _EXFUN(vsprintf, (char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(fgetc, (FILE *)); -char * _EXFUN(fgets, (char *__restrict, int, FILE *__restrict)); -int _EXFUN(fputc, (int, FILE *)); -int _EXFUN(fputs, (const char *__restrict, FILE *__restrict)); -int _EXFUN(getc, (FILE *)); -int _EXFUN(getchar, (void)); -char * _EXFUN(gets, (char *)); -int _EXFUN(putc, (int, FILE *)); -int _EXFUN(putchar, (int)); -int _EXFUN(puts, (const char *)); -int _EXFUN(ungetc, (int, FILE *)); -size_t _EXFUN(fread, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(fwrite, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(fgetpos, (FILE *, _fpos_t *)); -#else -int _EXFUN(fgetpos, (FILE *__restrict, fpos_t *__restrict)); -#endif -int _EXFUN(fseek, (FILE *, long, int)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(fsetpos, (FILE *, const _fpos_t *)); -#else -int _EXFUN(fsetpos, (FILE *, const fpos_t *)); -#endif -long _EXFUN(ftell, ( FILE *)); -void _EXFUN(rewind, (FILE *)); -void _EXFUN(clearerr, (FILE *)); -int _EXFUN(feof, (FILE *)); -int _EXFUN(ferror, (FILE *)); -void _EXFUN(perror, (const char *)); -#ifndef _REENT_ONLY -FILE * _EXFUN(fopen, (const char *__restrict _name, const char *__restrict _type)); -int _EXFUN(sprintf, (char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(remove, (const char *)); -int _EXFUN(rename, (const char *, const char *)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(_rename, (const char *, const char *)); -#endif -#endif -#if !defined(__STRICT_ANSI__) || defined(__USE_XOPEN2K) -#ifdef _COMPILING_NEWLIB -int _EXFUN(fseeko, (FILE *, _off_t, int)); -_off_t _EXFUN(ftello, ( FILE *)); -#else -int _EXFUN(fseeko, (FILE *, off_t, int)); -off_t _EXFUN(ftello, ( FILE *)); -#endif -#endif -#if __GNU_VISIBLE -int _EXFUN(fcloseall, (_VOID)); -#endif -#if !defined(__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) || (__cplusplus >= 201103L) -#ifndef _REENT_ONLY -int _EXFUN(asiprintf, (char **, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -char * _EXFUN(asniprintf, (char *, size_t *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -char * _EXFUN(asnprintf, (char *__restrict, size_t *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(asprintf, (char **__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -#ifndef diprintf -int _EXFUN(diprintf, (int, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -#endif -int _EXFUN(fiprintf, (FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(fiscanf, (FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(iprintf, (const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 1, 2)))); -int _EXFUN(iscanf, (const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 1, 2)))); -int _EXFUN(siprintf, (char *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(siscanf, (const char *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(snprintf, (char *__restrict, size_t, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(sniprintf, (char *, size_t, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(vasiprintf, (char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -char * _EXFUN(vasniprintf, (char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -char * _EXFUN(vasnprintf, (char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vasprintf, (char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vdiprintf, (int, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vfiprintf, (FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vfiscanf, (FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(vfscanf, (FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(viprintf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 1, 0)))); -int _EXFUN(viscanf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 1, 0)))); -int _EXFUN(vscanf, (const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 1, 0)))); -int _EXFUN(vsiprintf, (char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(vsiscanf, (const char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(vsniprintf, (char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vsnprintf, (char *__restrict, size_t, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(vsscanf, (const char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -#endif /* !_REENT_ONLY */ -#endif /* !__STRICT_ANSI__ */ - -/* - * Routines in POSIX 1003.1:2001. - */ - -#ifndef __STRICT_ANSI__ -#ifndef _REENT_ONLY -FILE * _EXFUN(fdopen, (int, const char *)); -#endif -int _EXFUN(fileno, (FILE *)); -int _EXFUN(getw, (FILE *)); -int _EXFUN(pclose, (FILE *)); -FILE * _EXFUN(popen, (const char *, const char *)); -int _EXFUN(putw, (int, FILE *)); -void _EXFUN(setbuffer, (FILE *, char *, int)); -int _EXFUN(setlinebuf, (FILE *)); -int _EXFUN(getc_unlocked, (FILE *)); -int _EXFUN(getchar_unlocked, (void)); -void _EXFUN(flockfile, (FILE *)); -int _EXFUN(ftrylockfile, (FILE *)); -void _EXFUN(funlockfile, (FILE *)); -int _EXFUN(putc_unlocked, (int, FILE *)); -int _EXFUN(putchar_unlocked, (int)); -#endif /* ! __STRICT_ANSI__ */ - -/* - * Routines in POSIX 1003.1:200x. - */ - -#ifndef __STRICT_ANSI__ -# ifndef _REENT_ONLY -# ifndef dprintf -int _EXFUN(dprintf, (int, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -# endif -FILE * _EXFUN(fmemopen, (void *__restrict, size_t, const char *__restrict)); -/* getdelim - see __getdelim for now */ -/* getline - see __getline for now */ -FILE * _EXFUN(open_memstream, (char **, size_t *)); -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 -int _EXFUN(renameat, (int, const char *, int, const char *)); -#endif -int _EXFUN(vdprintf, (int, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -# endif -#endif - -/* - * Recursive versions of the above. - */ - -int _EXFUN(_asiprintf_r, (struct _reent *, char **, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -char * _EXFUN(_asniprintf_r, (struct _reent *, char *, size_t *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -char * _EXFUN(_asnprintf_r, (struct _reent *, char *__restrict, size_t *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_asprintf_r, (struct _reent *, char **__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_diprintf_r, (struct _reent *, int, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_dprintf_r, (struct _reent *, int, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fclose_r, (struct _reent *, FILE *)); -int _EXFUN(_fcloseall_r, (struct _reent *)); -FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); -int _EXFUN(_fflush_r, (struct _reent *, FILE *)); -int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); -int _EXFUN(_fgetc_unlocked_r, (struct _reent *, FILE *)); -char * _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); -char * _EXFUN(_fgets_unlocked_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); -#ifdef _COMPILING_NEWLIB -int _EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict)); -int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); -#else -int _EXFUN(_fgetpos_r, (struct _reent *, FILE *, fpos_t *)); -int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const fpos_t *)); -#endif -int _EXFUN(_fiprintf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fiscanf_r, (struct _reent *, FILE *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -FILE * _EXFUN(_fmemopen_r, (struct _reent *, void *__restrict, size_t, const char *__restrict)); -FILE * _EXFUN(_fopen_r, (struct _reent *, const char *__restrict, const char *__restrict)); -FILE * _EXFUN(_freopen_r, (struct _reent *, const char *__restrict, const char *__restrict, FILE *__restrict)); -int _EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_fpurge_r, (struct _reent *, FILE *)); -int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_fputc_unlocked_r, (struct _reent *, int, FILE *)); -int _EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict)); -int _EXFUN(_fputs_unlocked_r, (struct _reent *, const char *__restrict, FILE *__restrict)); -size_t _EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(_fread_unlocked_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -int _EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int)); -int _EXFUN(_fseeko_r,(struct _reent *, FILE *, _off_t, int)); -long _EXFUN(_ftell_r, (struct _reent *, FILE *)); -_off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); -void _EXFUN(_rewind_r, (struct _reent *, FILE *)); -size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(_fwrite_unlocked_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -int _EXFUN(_getc_r, (struct _reent *, FILE *)); -int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); -int _EXFUN(_getchar_r, (struct _reent *)); -int _EXFUN(_getchar_unlocked_r, (struct _reent *)); -char * _EXFUN(_gets_r, (struct _reent *, char *)); -int _EXFUN(_iprintf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(_iscanf_r, (struct _reent *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -FILE * _EXFUN(_open_memstream_r, (struct _reent *, char **, size_t *)); -void _EXFUN(_perror_r, (struct _reent *, const char *)); -int _EXFUN(_printf_r, (struct _reent *, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 2, 3)))); -int _EXFUN(_putc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_putc_unlocked_r, (struct _reent *, int, FILE *)); -int _EXFUN(_putchar_unlocked_r, (struct _reent *, int)); -int _EXFUN(_putchar_r, (struct _reent *, int)); -int _EXFUN(_puts_r, (struct _reent *, const char *)); -int _EXFUN(_remove_r, (struct _reent *, const char *)); -int _EXFUN(_rename_r, (struct _reent *, - const char *_old, const char *_new)); -int _EXFUN(_scanf_r, (struct _reent *, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 2, 3)))); -int _EXFUN(_siprintf_r, (struct _reent *, char *, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_siscanf_r, (struct _reent *, const char *, const char *, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -int _EXFUN(_sniprintf_r, (struct _reent *, char *, size_t, const char *, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_snprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 4, 5)))); -int _EXFUN(_sprintf_r, (struct _reent *, char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); -int _EXFUN(_sscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, ...) - _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); -char * _EXFUN(_tempnam_r, (struct _reent *, const char *, const char *)); -FILE * _EXFUN(_tmpfile_r, (struct _reent *)); -char * _EXFUN(_tmpnam_r, (struct _reent *, char *)); -int _EXFUN(_ungetc_r, (struct _reent *, int, FILE *)); -int _EXFUN(_vasiprintf_r, (struct _reent *, char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -char * _EXFUN(_vasniprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -char * _EXFUN(_vasnprintf_r, (struct _reent*, char *, size_t *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vasprintf_r, (struct _reent *, char **, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vdiprintf_r, (struct _reent *, int, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vdprintf_r, (struct _reent *, int, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfiprintf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfiscanf_r, (struct _reent *, FILE *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_vfprintf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vfscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_viprintf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(_viscanf_r, (struct _reent *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(_vprintf_r, (struct _reent *, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 2, 0)))); -int _EXFUN(_vscanf_r, (struct _reent *, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 2, 0)))); -int _EXFUN(_vsiprintf_r, (struct _reent *, char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vsiscanf_r, (struct _reent *, const char *, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); -int _EXFUN(_vsniprintf_r, (struct _reent *, char *, size_t, const char *, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsnprintf_r, (struct _reent *, char *__restrict, size_t, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 4, 0)))); -int _EXFUN(_vsprintf_r, (struct _reent *, char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__printf__, 3, 0)))); -int _EXFUN(_vsscanf_r, (struct _reent *, const char *__restrict, const char *__restrict, __VALIST) - _ATTRIBUTE ((__format__ (__scanf__, 3, 0)))); - -/* Other extensions. */ - -int _EXFUN(fpurge, (FILE *)); -ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); -ssize_t _EXFUN(__getline, (char **, size_t *, FILE *)); - -#if __BSD_VISIBLE -void _EXFUN(clearerr_unlocked, (FILE *)); -int _EXFUN(feof_unlocked, (FILE *)); -int _EXFUN(ferror_unlocked, (FILE *)); -int _EXFUN(fileno_unlocked, (FILE *)); -int _EXFUN(fflush_unlocked, (FILE *)); -int _EXFUN(fgetc_unlocked, (FILE *)); -int _EXFUN(fputc_unlocked, (int, FILE *)); -size_t _EXFUN(fread_unlocked, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); -size_t _EXFUN(fwrite_unlocked, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); -#endif - -#if __GNU_VISIBLE -char * _EXFUN(fgets_unlocked, (char *__restrict, int, FILE *__restrict)); -int _EXFUN(fputs_unlocked, (const char *__restrict, FILE *__restrict)); -#endif - -#ifdef __LARGE64_FILES -#if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) -FILE * _EXFUN(fdopen64, (int, const char *)); -FILE * _EXFUN(fopen64, (const char *, const char *)); -FILE * _EXFUN(freopen64, (_CONST char *, _CONST char *, FILE *)); -_off64_t _EXFUN(ftello64, (FILE *)); -_off64_t _EXFUN(fseeko64, (FILE *, _off64_t, int)); -int _EXFUN(fgetpos64, (FILE *, _fpos64_t *)); -int _EXFUN(fsetpos64, (FILE *, const _fpos64_t *)); -FILE * _EXFUN(tmpfile64, (void)); - -FILE * _EXFUN(_fdopen64_r, (struct _reent *, int, const char *)); -FILE * _EXFUN(_fopen64_r, (struct _reent *,const char *, const char *)); -FILE * _EXFUN(_freopen64_r, (struct _reent *, _CONST char *, _CONST char *, FILE *)); -_off64_t _EXFUN(_ftello64_r, (struct _reent *, FILE *)); -_off64_t _EXFUN(_fseeko64_r, (struct _reent *, FILE *, _off64_t, int)); -int _EXFUN(_fgetpos64_r, (struct _reent *, FILE *, _fpos64_t *)); -int _EXFUN(_fsetpos64_r, (struct _reent *, FILE *, const _fpos64_t *)); -FILE * _EXFUN(_tmpfile64_r, (struct _reent *)); -#endif /* !__CYGWIN__ */ -#endif /* __LARGE64_FILES */ - -/* - * Routines internal to the implementation. - */ - -int _EXFUN(__srget_r, (struct _reent *, FILE *)); -int _EXFUN(__swbuf_r, (struct _reent *, int, FILE *)); - -/* - * Stdio function-access interface. - */ - -#ifndef __STRICT_ANSI__ -# ifdef __LARGE64_FILES -FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __c, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), - int (*__closefn)(_PTR __c))); -FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __c, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __c, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - _fpos64_t (*__seekfn)(_PTR __c, _fpos64_t __off, int __whence), - int (*__closefn)(_PTR __c))); -# else -FILE *_EXFUN(funopen,(const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __cookie, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), - int (*__closefn)(_PTR __cookie))); -FILE *_EXFUN(_funopen_r,(struct _reent *, const _PTR __cookie, - int (*__readfn)(_PTR __cookie, char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - int (*__writefn)(_PTR __cookie, const char *__buf, - _READ_WRITE_BUFSIZE_TYPE __n), - fpos_t (*__seekfn)(_PTR __cookie, fpos_t __off, int __whence), - int (*__closefn)(_PTR __cookie))); -# endif /* !__LARGE64_FILES */ - -# define fropen(__cookie, __fn) funopen(__cookie, __fn, (int (*)())0, \ - (fpos_t (*)())0, (int (*)())0) -# define fwopen(__cookie, __fn) funopen(__cookie, (int (*)())0, __fn, \ - (fpos_t (*)())0, (int (*)())0) - -typedef ssize_t cookie_read_function_t(void *__cookie, char *__buf, size_t __n); -typedef ssize_t cookie_write_function_t(void *__cookie, const char *__buf, - size_t __n); -# ifdef __LARGE64_FILES -typedef int cookie_seek_function_t(void *__cookie, _off64_t *__off, - int __whence); -# else -typedef int cookie_seek_function_t(void *__cookie, off_t *__off, int __whence); -# endif /* !__LARGE64_FILES */ -typedef int cookie_close_function_t(void *__cookie); -typedef struct -{ - /* These four struct member names are dictated by Linux; hopefully, - they don't conflict with any macros. */ - cookie_read_function_t *read; - cookie_write_function_t *write; - cookie_seek_function_t *seek; - cookie_close_function_t *close; -} cookie_io_functions_t; -FILE *_EXFUN(fopencookie,(void *__cookie, - const char *__mode, cookie_io_functions_t __functions)); -FILE *_EXFUN(_fopencookie_r,(struct _reent *, void *__cookie, - const char *__mode, cookie_io_functions_t __functions)); -#endif /* ! __STRICT_ANSI__ */ - -#ifndef __CUSTOM_FILE_IO__ -/* - * The __sfoo macros are here so that we can - * define function versions in the C library. - */ -#define __sgetc_raw_r(__ptr, __f) (--(__f)->_r < 0 ? __srget_r(__ptr, __f) : (int)(*(__f)->_p++)) - -#ifdef __SCLE -/* For a platform with CR/LF, additional logic is required by - __sgetc_r which would otherwise simply be a macro; therefore we - use an inlined function. The function is only meant to be inlined - in place as used and the function body should never be emitted. - - There are two possible means to this end when compiling with GCC, - one when compiling with a standard C99 compiler, and for other - compilers we're just stuck. At the moment, this issue only - affects the Cygwin target, so we'll most likely be using GCC. */ - -_ELIDABLE_INLINE int __sgetc_r(struct _reent *__ptr, FILE *__p); - -_ELIDABLE_INLINE int __sgetc_r(struct _reent *__ptr, FILE *__p) - { - int __c = __sgetc_raw_r(__ptr, __p); - if ((__p->_flags & __SCLE) && (__c == '\r')) - { - int __c2 = __sgetc_raw_r(__ptr, __p); - if (__c2 == '\n') - __c = __c2; - else - ungetc(__c2, __p); - } - return __c; - } -#else -#define __sgetc_r(__ptr, __p) __sgetc_raw_r(__ptr, __p) -#endif - -#ifdef _never /* __GNUC__ */ -/* If this inline is actually used, then systems using coff debugging - info get hopelessly confused. 21sept93 rich@cygnus.com. */ -_ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) { - if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n')) - return (*_p->_p++ = _c); - else - return (__swbuf_r(_ptr, _c, _p)); -} -#else -/* - * This has been tuned to generate reasonable code on the vax using pcc - */ -#define __sputc_raw_r(__ptr, __c, __p) \ - (--(__p)->_w < 0 ? \ - (__p)->_w >= (__p)->_lbfsize ? \ - (*(__p)->_p = (__c)), *(__p)->_p != '\n' ? \ - (int)*(__p)->_p++ : \ - __swbuf_r(__ptr, '\n', __p) : \ - __swbuf_r(__ptr, (int)(__c), __p) : \ - (*(__p)->_p = (__c), (int)*(__p)->_p++)) -#ifdef __SCLE -#define __sputc_r(__ptr, __c, __p) \ - ((((__p)->_flags & __SCLE) && ((__c) == '\n')) \ - ? __sputc_raw_r(__ptr, '\r', (__p)) : 0 , \ - __sputc_raw_r((__ptr), (__c), (__p))) -#else -#define __sputc_r(__ptr, __c, __p) __sputc_raw_r(__ptr, __c, __p) -#endif -#endif - -#define __sfeof(p) ((int)(((p)->_flags & __SEOF) != 0)) -#define __sferror(p) ((int)(((p)->_flags & __SERR) != 0)) -#define __sclearerr(p) ((void)((p)->_flags &= ~(__SERR|__SEOF))) -#define __sfileno(p) ((p)->_file) - -#ifndef _REENT_SMALL -#define feof(p) __sfeof(p) -#define ferror(p) __sferror(p) -#define clearerr(p) __sclearerr(p) - -#if __BSD_VISIBLE -#define feof_unlocked(p) __sfeof(p) -#define ferror_unlocked(p) __sferror(p) -#define clearerr_unlocked(p) __sclearerr(p) -#endif /* __BSD_VISIBLE */ -#endif /* _REENT_SMALL */ - -#if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */ -#define fileno(p) __sfileno(p) -#endif - -#ifndef __CYGWIN__ -#ifndef lint -#define getc(fp) __sgetc_r(_REENT, fp) -#define putc(x, fp) __sputc_r(_REENT, x, fp) -#endif /* lint */ -#endif /* __CYGWIN__ */ - -#ifndef __STRICT_ANSI__ -/* fast always-buffered version, true iff error */ -#define fast_putc(x,p) (--(p)->_w < 0 ? \ - __swbuf_r(_REENT, (int)(x), p) == EOF : (*(p)->_p = (x), (p)->_p++, 0)) - -#define L_cuserid 9 /* posix says it goes in stdio.h :( */ -#ifdef __CYGWIN__ -#define L_ctermid 16 -#endif -#endif - -#endif /* !__CUSTOM_FILE_IO__ */ - -#define getchar() getc(stdin) -#define putchar(x) putc(x, stdout) - -#ifndef __STRICT_ANSI__ -#define getchar_unlocked() getc_unlocked(stdin) -#define putchar_unlocked(x) putc_unlocked(x, stdout) -#endif - -_END_STD_C - -#endif /* _STDIO_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/stdio_ext.h b/tools/sdk/libc/xtensa-lx106-elf/include/stdio_ext.h deleted file mode 100644 index 029ab0253..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/stdio_ext.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * stdio_ext.h - * - * Definitions for I/O internal operations, originally from Solaris. - */ - -#ifndef _STDIO_EXT_H_ -#define _STDIO_EXT_H_ - -#ifdef __rtems__ -#error " not supported" -#endif - -#include - -#define FSETLOCKING_QUERY 0 -#define FSETLOCKING_INTERNAL 1 -#define FSETLOCKING_BYCALLER 2 - -_BEGIN_STD_C - -void _EXFUN(__fpurge,(FILE *)); -int _EXFUN(__fsetlocking,(FILE *, int)); - -/* TODO: - - void _flushlbf (void); -*/ - -#ifdef __GNUC__ - -_ELIDABLE_INLINE size_t -__fbufsize (FILE *__fp) { return (size_t) __fp->_bf._size; } - -_ELIDABLE_INLINE int -__freading (FILE *__fp) { return (__fp->_flags & __SRD) != 0; } - -_ELIDABLE_INLINE int -__fwriting (FILE *__fp) { return (__fp->_flags & __SWR) != 0; } - -_ELIDABLE_INLINE int -__freadable (FILE *__fp) { return (__fp->_flags & (__SRD | __SRW)) != 0; } - -_ELIDABLE_INLINE int -__fwritable (FILE *__fp) { return (__fp->_flags & (__SWR | __SRW)) != 0; } - -_ELIDABLE_INLINE int -__flbf (FILE *__fp) { return (__fp->_flags & __SLBF) != 0; } - -_ELIDABLE_INLINE size_t -__fpending (FILE *__fp) { return __fp->_p - __fp->_bf._base; } - -#else - -size_t _EXFUN(__fbufsize,(FILE *)); -int _EXFUN(__freading,(FILE *)); -int _EXFUN(__fwriting,(FILE *)); -int _EXFUN(__freadable,(FILE *)); -int _EXFUN(__fwritable,(FILE *)); -int _EXFUN(__flbf,(FILE *)); -size_t _EXFUN(__fpending,(FILE *)); - -#ifndef __cplusplus - -#define __fbufsize(__fp) ((size_t) (__fp)->_bf._size) -#define __freading(__fp) (((__fp)->_flags & __SRD) != 0) -#define __fwriting(__fp) (((__fp)->_flags & __SWR) != 0) -#define __freadable(__fp) (((__fp)->_flags & (__SRD | __SRW)) != 0) -#define __fwritable(__fp) (((__fp)->_flags & (__SWR | __SRW)) != 0) -#define __flbf(__fp) (((__fp)->_flags & __SLBF) != 0) -#define __fpending(__fp) ((size_t) ((__fp)->_p - (__fp)->_bf._base)) - -#endif /* __cplusplus */ - -#endif /* __GNUC__ */ - -_END_STD_C - -#endif /* _STDIO_EXT_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h b/tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h deleted file mode 100644 index 254ddd71f..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/stdlib.h +++ /dev/null @@ -1,297 +0,0 @@ -/* - * stdlib.h - * - * Definitions for common types, variables, and functions. - */ - -#ifndef _STDLIB_H_ -#define _STDLIB_H_ - -#include -#include "_ansi.h" - -#define __need_size_t -#define __need_wchar_t -#define __need_NULL -#include - -#include -#include -#include -#ifndef __STRICT_ANSI__ -#include -#endif - -#ifdef __CYGWIN__ -#include -#endif - -_BEGIN_STD_C - -typedef struct -{ - int quot; /* quotient */ - int rem; /* remainder */ -} div_t; - -typedef struct -{ - long quot; /* quotient */ - long rem; /* remainder */ -} ldiv_t; - -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -typedef struct -{ - long long int quot; /* quotient */ - long long int rem; /* remainder */ -} lldiv_t; -#endif - -#ifndef __compar_fn_t_defined -#define __compar_fn_t_defined -typedef int (*__compar_fn_t) (const _PTR, const _PTR); -#endif - -#ifndef NULL -#define NULL 0 -#endif - -#define EXIT_FAILURE 1 -#define EXIT_SUCCESS 0 - -#define RAND_MAX __RAND_MAX - -int _EXFUN(__locale_mb_cur_max,(_VOID)); - -#define MB_CUR_MAX __locale_mb_cur_max() - -_VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((__noreturn__))); -int _EXFUN(abs,(int)); -int _EXFUN(atexit,(_VOID (*__func)(_VOID))); -double _EXFUN(atof,(const char *__nptr)); -#ifndef __STRICT_ANSI__ -float _EXFUN(atoff,(const char *__nptr)); -#endif -int _EXFUN(atoi,(const char *__nptr)); -int _EXFUN(_atoi_r,(struct _reent *, const char *__nptr)); -long _EXFUN(atol,(const char *__nptr)); -long _EXFUN(_atol_r,(struct _reent *, const char *__nptr)); -_PTR _EXFUN(bsearch,(const _PTR __key, - const _PTR __base, - size_t __nmemb, - size_t __size, - __compar_fn_t _compar)); -_PTR _EXFUN_NOTHROW(calloc,(size_t __nmemb, size_t __size)); -div_t _EXFUN(div,(int __numer, int __denom)); -_VOID _EXFUN(exit,(int __status) _ATTRIBUTE ((__noreturn__))); -_VOID _EXFUN_NOTHROW(free,(_PTR)); -char * _EXFUN(getenv,(const char *__string)); -char * _EXFUN(_getenv_r,(struct _reent *, const char *__string)); -char * _EXFUN(_findenv,(_CONST char *, int *)); -char * _EXFUN(_findenv_r,(struct _reent *, _CONST char *, int *)); -#ifndef __STRICT_ANSI__ -extern char *suboptarg; /* getsubopt(3) external variable */ -int _EXFUN(getsubopt,(char **, char * const *, char **)); -#endif -long _EXFUN(labs,(long)); -ldiv_t _EXFUN(ldiv,(long __numer, long __denom)); -_PTR _EXFUN_NOTHROW(malloc,(size_t __size)); -int _EXFUN(mblen,(const char *, size_t)); -int _EXFUN(_mblen_r,(struct _reent *, const char *, size_t, _mbstate_t *)); -int _EXFUN(mbtowc,(wchar_t *__restrict, const char *__restrict, size_t)); -int _EXFUN(_mbtowc_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); -int _EXFUN(wctomb,(char *, wchar_t)); -int _EXFUN(_wctomb_r,(struct _reent *, char *, wchar_t, _mbstate_t *)); -size_t _EXFUN(mbstowcs,(wchar_t *__restrict, const char *__restrict, size_t)); -size_t _EXFUN(_mbstowcs_r,(struct _reent *, wchar_t *__restrict, const char *__restrict, size_t, _mbstate_t *)); -size_t _EXFUN(wcstombs,(char *__restrict, const wchar_t *__restrict, size_t)); -size_t _EXFUN(_wcstombs_r,(struct _reent *, char *__restrict, const wchar_t *__restrict, size_t, _mbstate_t *)); -#ifndef __STRICT_ANSI__ -#ifndef _REENT_ONLY -char * _EXFUN(mkdtemp,(char *)); -int _EXFUN(mkostemp,(char *, int)); -int _EXFUN(mkostemps,(char *, int, int)); -int _EXFUN(mkstemp,(char *)); -int _EXFUN(mkstemps,(char *, int)); -#if (__GNUC__ < 4) || defined(__XTENSA__) -char * _EXFUN(mktemp,(char *)); -#else -char * _EXFUN(mktemp,(char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead")))); -#endif -#endif -char * _EXFUN(_mkdtemp_r, (struct _reent *, char *)); -int _EXFUN(_mkostemp_r, (struct _reent *, char *, int)); -int _EXFUN(_mkostemps_r, (struct _reent *, char *, int, int)); -int _EXFUN(_mkstemp_r, (struct _reent *, char *)); -int _EXFUN(_mkstemps_r, (struct _reent *, char *, int)); -#if (__GNUC__ < 4) || defined(__XTENSA__) -char * _EXFUN(_mktemp_r, (struct _reent *, char *)); -#else -char * _EXFUN(_mktemp_r, (struct _reent *, char *) _ATTRIBUTE ((__warning__ ("the use of `mktemp' is dangerous; use `mkstemp' instead")))); -#endif -#endif -_VOID _EXFUN(qsort,(_PTR __base, size_t __nmemb, size_t __size, __compar_fn_t _compar)); -int _EXFUN(rand,(_VOID)); -_PTR _EXFUN_NOTHROW(realloc,(_PTR __r, size_t __size)); -#ifndef __STRICT_ANSI__ -_PTR _EXFUN(reallocf,(_PTR __r, size_t __size)); -char * _EXFUN(realpath, (const char *__restrict path, char *__restrict resolved_path)); -#endif -_VOID _EXFUN(srand,(unsigned __seed)); -double _EXFUN(strtod,(const char *__restrict __n, char **__restrict __end_PTR)); -double _EXFUN(_strtod_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR)); -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -float _EXFUN(strtof,(const char *__restrict __n, char **__restrict __end_PTR)); -#endif -#ifndef __STRICT_ANSI__ -/* the following strtodf interface is deprecated...use strtof instead */ -# ifndef strtodf -# define strtodf strtof -# endif -#endif -long _EXFUN(strtol,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -long _EXFUN(_strtol_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); -unsigned long _EXFUN(strtoul,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -unsigned long _EXFUN(_strtoul_r,(struct _reent *,const char *__restrict __n, char **__restrict __end_PTR, int __base)); - -int _EXFUN(system,(const char *__string)); - -#ifndef __STRICT_ANSI__ -long _EXFUN(a64l,(const char *__input)); -char * _EXFUN(l64a,(long __input)); -char * _EXFUN(_l64a_r,(struct _reent *,long __input)); -int _EXFUN(on_exit,(_VOID (*__func)(int, _PTR),_PTR __arg)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -_VOID _EXFUN(_Exit,(int __status) _ATTRIBUTE ((__noreturn__))); -#endif -#ifndef __STRICT_ANSI__ -int _EXFUN(putenv,(char *__string)); -int _EXFUN(_putenv_r,(struct _reent *, char *__string)); -_PTR _EXFUN(_reallocf_r,(struct _reent *, _PTR, size_t)); -int _EXFUN(setenv,(const char *__string, const char *__value, int __overwrite)); -int _EXFUN(_setenv_r,(struct _reent *, const char *__string, const char *__value, int __overwrite)); - -char * _EXFUN(gcvt,(double,int,char *)); -char * _EXFUN(gcvtf,(float,int,char *)); -char * _EXFUN(fcvt,(double,int,int *,int *)); -char * _EXFUN(fcvtf,(float,int,int *,int *)); -char * _EXFUN(ecvt,(double,int,int *,int *)); -char * _EXFUN(ecvtbuf,(double, int, int*, int*, char *)); -char * _EXFUN(fcvtbuf,(double, int, int*, int*, char *)); -char * _EXFUN(ecvtf,(float,int,int *,int *)); -char * _EXFUN(dtoa,(double, int, int, int *, int*, char**)); -#endif -char * _EXFUN(__itoa,(int, char *, int)); -char * _EXFUN(__utoa,(unsigned, char *, int)); -#ifndef __STRICT_ANSI__ -char * _EXFUN(itoa,(int, char *, int)); -char * _EXFUN(utoa,(unsigned, char *, int)); -int _EXFUN(rand_r,(unsigned *__seed)); - -double _EXFUN(drand48,(_VOID)); -double _EXFUN(_drand48_r,(struct _reent *)); -double _EXFUN(erand48,(unsigned short [3])); -double _EXFUN(_erand48_r,(struct _reent *, unsigned short [3])); -long _EXFUN(jrand48,(unsigned short [3])); -long _EXFUN(_jrand48_r,(struct _reent *, unsigned short [3])); -_VOID _EXFUN(lcong48,(unsigned short [7])); -_VOID _EXFUN(_lcong48_r,(struct _reent *, unsigned short [7])); -long _EXFUN(lrand48,(_VOID)); -long _EXFUN(_lrand48_r,(struct _reent *)); -long _EXFUN(mrand48,(_VOID)); -long _EXFUN(_mrand48_r,(struct _reent *)); -long _EXFUN(nrand48,(unsigned short [3])); -long _EXFUN(_nrand48_r,(struct _reent *, unsigned short [3])); -unsigned short * - _EXFUN(seed48,(unsigned short [3])); -unsigned short * - _EXFUN(_seed48_r,(struct _reent *, unsigned short [3])); -_VOID _EXFUN(srand48,(long)); -_VOID _EXFUN(_srand48_r,(struct _reent *, long)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -long long _EXFUN(atoll,(const char *__nptr)); -#endif -#ifndef __STRICT_ANSI__ -long long _EXFUN(_atoll_r,(struct _reent *, const char *__nptr)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -long long _EXFUN(llabs,(long long)); -lldiv_t _EXFUN(lldiv,(long long __numer, long long __denom)); -long long _EXFUN(strtoll,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -#endif -#ifndef __STRICT_ANSI__ -long long _EXFUN(_strtoll_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); -#endif /* ! __STRICT_ANSI__ */ -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -unsigned long long _EXFUN(strtoull,(const char *__restrict __n, char **__restrict __end_PTR, int __base)); -#endif -#ifndef __STRICT_ANSI__ -unsigned long long _EXFUN(_strtoull_r,(struct _reent *, const char *__restrict __n, char **__restrict __end_PTR, int __base)); - -#ifndef __CYGWIN__ -_VOID _EXFUN(cfree,(_PTR)); -int _EXFUN(unsetenv,(const char *__string)); -int _EXFUN(_unsetenv_r,(struct _reent *, const char *__string)); -#endif - -#ifdef __rtems__ -int _EXFUN(posix_memalign,(void **, size_t, size_t)); -#endif - -#endif /* ! __STRICT_ANSI__ */ - -char * _EXFUN(_dtoa_r,(struct _reent *, double, int, int, int *, int*, char**)); -#ifndef __CYGWIN__ -_PTR _EXFUN_NOTHROW(_malloc_r,(struct _reent *, size_t)); -_PTR _EXFUN_NOTHROW(_calloc_r,(struct _reent *, size_t, size_t)); -_VOID _EXFUN_NOTHROW(_free_r,(struct _reent *, _PTR)); -_PTR _EXFUN_NOTHROW(_realloc_r,(struct _reent *, _PTR, size_t)); -_VOID _EXFUN(_mstats_r,(struct _reent *, char *)); -#endif -int _EXFUN(_system_r,(struct _reent *, const char *)); - -_VOID _EXFUN(__eprintf,(const char *, const char *, unsigned int, const char *)); - -/* There are two common qsort_r variants. If you request - _BSD_SOURCE, you get the BSD version; otherwise you get the GNU - version. We want that #undef qsort_r will still let you - invoke the underlying function, but that requires gcc support. */ -#ifdef _BSD_SOURCE -# ifdef __GNUC__ -_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))) - __asm__ (__ASMNAME ("__bsd_qsort_r")); -# else -_VOID _EXFUN(__bsd_qsort_r,(_PTR __base, size_t __nmemb, size_t __size, _PTR __thunk, int (*_compar)(_PTR, const _PTR, const _PTR))); -# define qsort_r __bsd_qsort_r -# endif -#elif __GNU_VISIBLE -_VOID _EXFUN(qsort_r,(_PTR __base, size_t __nmemb, size_t __size, int (*_compar)(const _PTR, const _PTR, _PTR), _PTR __thunk)); -#endif - -/* On platforms where long double equals double. */ -#ifdef _HAVE_LONG_DOUBLE -#if !defined(__STRICT_ANSI__) || \ - (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) -extern long double strtold (const char *__restrict, char **__restrict); -#endif -#endif /* _HAVE_LONG_DOUBLE */ - -_END_STD_C - -#endif /* _STDLIB_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/string.h b/tools/sdk/libc/xtensa-lx106-elf/include/string.h deleted file mode 100644 index af5c9da4d..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/string.h +++ /dev/null @@ -1,167 +0,0 @@ -/* - * string.h - * - * Definitions for memory and string functions. - */ - -#ifndef _STRING_H_ -#define _STRING_H_ - -#include "_ansi.h" -#include -#include -#include - -#define __need_size_t -#define __need_NULL -#include - -_BEGIN_STD_C - -_PTR _EXFUN(memchr,(const _PTR, int, size_t)); -int _EXFUN(memcmp,(const _PTR, const _PTR, size_t)); -_PTR _EXFUN(memcpy,(_PTR __restrict, const _PTR __restrict, size_t)); -_PTR _EXFUN(memmove,(_PTR, const _PTR, size_t)); -_PTR _EXFUN(memset,(_PTR, int, size_t)); -char *_EXFUN(strcat,(char *__restrict, const char *__restrict)); -char *_EXFUN(strchr,(const char *, int)); -int _EXFUN(strcmp,(const char *, const char *)); -int _EXFUN(strcoll,(const char *, const char *)); -char *_EXFUN(strcpy,(char *__restrict, const char *__restrict)); -size_t _EXFUN(strcspn,(const char *, const char *)); -char *_EXFUN(strerror,(int)); -size_t _EXFUN(strlen,(const char *)); -char *_EXFUN(strncat,(char *__restrict, const char *__restrict, size_t)); -int _EXFUN(strncmp,(const char *, const char *, size_t)); -char *_EXFUN(strncpy,(char *__restrict, const char *__restrict, size_t)); -char *_EXFUN(strpbrk,(const char *, const char *)); -char *_EXFUN(strrchr,(const char *, int)); -size_t _EXFUN(strspn,(const char *, const char *)); -char *_EXFUN(strstr,(const char *, const char *)); -#ifndef _REENT_ONLY -char *_EXFUN(strtok,(char *__restrict, const char *__restrict)); -#endif -size_t _EXFUN(strxfrm,(char *__restrict, const char *__restrict, size_t)); - -#if __POSIX_VISIBLE -char *_EXFUN(strtok_r,(char *__restrict, const char *__restrict, char **__restrict)); -#endif -#if __BSD_VISIBLE -int _EXFUN(bcmp,(const void *, const void *, size_t)); -void _EXFUN(bcopy,(const void *, void *, size_t)); -void _EXFUN(bzero,(void *, size_t)); -int _EXFUN(ffs,(int)); -char *_EXFUN(index,(const char *, int)); -#endif -#if __BSD_VISIBLE || __XSI_VISIBLE -_PTR _EXFUN(memccpy,(_PTR __restrict, const _PTR __restrict, int, size_t)); -#endif -#if __GNU_VISIBLE -_PTR _EXFUN(mempcpy,(_PTR, const _PTR, size_t)); -_PTR _EXFUN(memmem, (const _PTR, size_t, const _PTR, size_t)); -#endif -_PTR _EXFUN(memrchr,(const _PTR, int, size_t)); -#if __GNU_VISIBLE -_PTR _EXFUN(rawmemchr,(const _PTR, int)); -#endif -#if __BSD_VISIBLE -char *_EXFUN(rindex,(const char *, int)); -#endif -char *_EXFUN(stpcpy,(char *__restrict, const char *__restrict)); -char *_EXFUN(stpncpy,(char *__restrict, const char *__restrict, size_t)); -#if __BSD_VISIBLE || __POSIX_VISIBLE -int _EXFUN(strcasecmp,(const char *, const char *)); -#endif -#if __GNU_VISIBLE -char *_EXFUN(strcasestr,(const char *, const char *)); -char *_EXFUN(strchrnul,(const char *, int)); -#endif -#if __XSI_VISIBLE >= 500 -char *_EXFUN(strdup,(const char *)); -#endif -#ifndef __STRICT_ANSI__ -char *_EXFUN(_strdup_r,(struct _reent *, const char *)); -#endif -#if __XSI_VISIBLE >= 700 -char *_EXFUN(strndup,(const char *, size_t)); -#endif - -#ifndef __STRICT_ANSI__ -char *_EXFUN(_strndup_r,(struct _reent *, const char *, size_t)); -#endif - -#if __GNU_VISIBLE -int _EXFUN(ffsl,(long)); -int _EXFUN(ffsll, (long long)); -#endif - -/* There are two common strerror_r variants. If you request - _GNU_SOURCE, you get the GNU version; otherwise you get the POSIX - version. POSIX requires that #undef strerror_r will still let you - invoke the underlying function, but that requires gcc support. */ -#if __GNU_VISIBLE -char *_EXFUN(strerror_r,(int, char *, size_t)); -#else -# ifdef __GNUC__ -int _EXFUN(strerror_r,(int, char *, size_t)) - __asm__ (__ASMNAME ("__xpg_strerror_r")); -# else -int _EXFUN(__xpg_strerror_r,(int, char *, size_t)); -# define strerror_r __xpg_strerror_r -# endif -#endif - -/* Reentrant version of strerror. */ -char * _EXFUN(_strerror_r, (struct _reent *, int, int, int *)); - -#if __BSD_VISIBLE -size_t _EXFUN(strlcat,(char *, const char *, size_t)); -size_t _EXFUN(strlcpy,(char *, const char *, size_t)); -#endif -#if __BSD_VISIBLE || __POSIX_VISIBLE -int _EXFUN(strncasecmp,(const char *, const char *, size_t)); -#endif -#if !defined(__STRICT_ANSI__) || __POSIX_VISIBLE >= 200809 || \ - __XSI_VISIBLE >= 700 -size_t _EXFUN(strnlen,(const char *, size_t)); -#endif -#if __BSD_VISIBLE -char *_EXFUN(strsep,(char **, const char *)); -#endif - -/* - * The origin of these is unknown to me so I am conditionalizing them - * on __STRICT_ANSI__. Finetuning this is definitely needed. --joel - */ -#if !defined(__STRICT_ANSI__) -char *_EXFUN(strlwr,(char *)); -char *_EXFUN(strupr,(char *)); -#endif - -#ifndef DEFS_H /* Kludge to work around problem compiling in gdb */ -char *_EXFUN(strsignal, (int __signo)); -#endif - -#ifdef __CYGWIN__ -int _EXFUN(strtosigno, (const char *__name)); -#endif - -#if defined _GNU_SOURCE && defined __GNUC__ -#define strdupa(__s) \ - (__extension__ ({const char *__in = (__s); \ - size_t __len = strlen (__in) + 1; \ - char * __out = (char *) __builtin_alloca (__len); \ - (char *) memcpy (__out, __in, __len);})) -#define strndupa(__s, __n) \ - (__extension__ ({const char *__in = (__s); \ - size_t __len = strnlen (__in, (__n)) + 1; \ - char *__out = (char *) __builtin_alloca (__len); \ - __out[__len-1] = '\0'; \ - (char *) memcpy (__out, __in, __len-1);})) -#endif /* _GNU_SOURCE && __GNUC__ */ - -#include - -_END_STD_C - -#endif /* _STRING_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/strings.h b/tools/sdk/libc/xtensa-lx106-elf/include/strings.h deleted file mode 100644 index 131d81d20..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/strings.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * strings.h - * - * Definitions for string operations. - */ - -#ifndef _STRINGS_H_ -#define _STRINGS_H_ - -#include "_ansi.h" -#include - -#include /* for size_t */ - -_BEGIN_STD_C - -#if !defined __STRICT_ANSI__ && _POSIX_VERSION < 200809L -/* - * Marked LEGACY in Open Group Base Specifications Issue 6/IEEE Std 1003.1-2004 - * Removed from Open Group Base Specifications Issue 7/IEEE Std 1003.1-2008 - */ -int _EXFUN(bcmp,(const void *, const void *, size_t)); -void _EXFUN(bcopy,(const void *, void *, size_t)); -void _EXFUN(bzero,(void *, size_t)); -char *_EXFUN(index,(const char *, int)); -char *_EXFUN(rindex,(const char *, int)); -#endif /* ! __STRICT_ANSI__ */ - -int _EXFUN(ffs,(int)); -int _EXFUN(strcasecmp,(const char *, const char *)); -int _EXFUN(strncasecmp,(const char *, const char *, size_t)); - -_END_STD_C - -#endif /* _STRINGS_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/_default_fcntl.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/_default_fcntl.h deleted file mode 100644 index eb674ae79..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/_default_fcntl.h +++ /dev/null @@ -1,213 +0,0 @@ - -#ifndef _SYS__DEFAULT_FCNTL_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS__DEFAULT_FCNTL_H_ -#include <_ansi.h> -#include -#define _FOPEN (-1) /* from sys/file.h, kernel use only */ -#define _FREAD 0x0001 /* read enabled */ -#define _FWRITE 0x0002 /* write enabled */ -#define _FAPPEND 0x0008 /* append (writes guaranteed at the end) */ -#define _FMARK 0x0010 /* internal; mark during gc() */ -#define _FDEFER 0x0020 /* internal; defer for next gc pass */ -#define _FASYNC 0x0040 /* signal pgrp when data ready */ -#define _FSHLOCK 0x0080 /* BSD flock() shared lock present */ -#define _FEXLOCK 0x0100 /* BSD flock() exclusive lock present */ -#define _FCREAT 0x0200 /* open with file create */ -#define _FTRUNC 0x0400 /* open with truncation */ -#define _FEXCL 0x0800 /* error on open if file exists */ -#define _FNBIO 0x1000 /* non blocking I/O (sys5 style) */ -#define _FSYNC 0x2000 /* do all writes synchronously */ -#define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ -#define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ -#define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ - -#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) - -/* - * Flag values for open(2) and fcntl(2) - * The kernel adds 1 to the open modes to turn it into some - * combination of FREAD and FWRITE. - */ -#define O_RDONLY 0 /* +1 == FREAD */ -#define O_WRONLY 1 /* +1 == FWRITE */ -#define O_RDWR 2 /* +1 == FREAD|FWRITE */ -#define O_APPEND _FAPPEND -#define O_CREAT _FCREAT -#define O_TRUNC _FTRUNC -#define O_EXCL _FEXCL -#define O_SYNC _FSYNC -/* O_NDELAY _FNDELAY set in include/fcntl.h */ -/* O_NDELAY _FNBIO set in include/fcntl.h */ -#define O_NONBLOCK _FNONBLOCK -#define O_NOCTTY _FNOCTTY -/* For machines which care - */ -#if defined (__CYGWIN__) -#define _FBINARY 0x10000 -#define _FTEXT 0x20000 -#define _FNOINHERIT 0x40000 -#define _FDIRECT 0x80000 -#define _FNOFOLLOW 0x100000 -#define _FDIRECTORY 0x200000 -#define _FEXECSRCH 0x400000 - -#define O_BINARY _FBINARY -#define O_TEXT _FTEXT -#define O_CLOEXEC _FNOINHERIT -#define O_DIRECT _FDIRECT -#define O_NOFOLLOW _FNOFOLLOW -#define O_DSYNC _FSYNC -#define O_RSYNC _FSYNC -#define O_DIRECTORY _FDIRECTORY -#define O_EXEC _FEXECSRCH -#define O_SEARCH _FEXECSRCH -#endif - -#ifndef _POSIX_SOURCE - -/* - * Flags that work for fcntl(fd, F_SETFL, FXXXX) - */ -#define FAPPEND _FAPPEND -#define FSYNC _FSYNC -#define FASYNC _FASYNC -#define FNBIO _FNBIO -#define FNONBIO _FNONBLOCK /* XXX fix to be NONBLOCK everywhere */ -#define FNDELAY _FNDELAY - -/* - * Flags that are disallowed for fcntl's (FCNTLCANT); - * used for opens, internal state, or locking. - */ -#define FREAD _FREAD -#define FWRITE _FWRITE -#define FMARK _FMARK -#define FDEFER _FDEFER -#define FSHLOCK _FSHLOCK -#define FEXLOCK _FEXLOCK - -/* - * The rest of the flags, used only for opens - */ -#define FOPEN _FOPEN -#define FCREAT _FCREAT -#define FTRUNC _FTRUNC -#define FEXCL _FEXCL -#define FNOCTTY _FNOCTTY - -#endif /* !_POSIX_SOURCE */ - -/* XXX close on exec request; must match UF_EXCLOSE in user.h */ -#define FD_CLOEXEC 1 /* posix */ - -/* fcntl(2) requests */ -#define F_DUPFD 0 /* Duplicate fildes */ -#define F_GETFD 1 /* Get fildes flags (close on exec) */ -#define F_SETFD 2 /* Set fildes flags (close on exec) */ -#define F_GETFL 3 /* Get file flags */ -#define F_SETFL 4 /* Set file flags */ -#ifndef _POSIX_SOURCE -#define F_GETOWN 5 /* Get owner - for ASYNC */ -#define F_SETOWN 6 /* Set owner - for ASYNC */ -#endif /* !_POSIX_SOURCE */ -#define F_GETLK 7 /* Get record-locking information */ -#define F_SETLK 8 /* Set or Clear a record-lock (Non-Blocking) */ -#define F_SETLKW 9 /* Set or Clear a record-lock (Blocking) */ -#ifndef _POSIX_SOURCE -#define F_RGETLK 10 /* Test a remote lock to see if it is blocked */ -#define F_RSETLK 11 /* Set or unlock a remote lock */ -#define F_CNVT 12 /* Convert a fhandle to an open fd */ -#define F_RSETLKW 13 /* Set or Clear remote record-lock(Blocking) */ -#endif /* !_POSIX_SOURCE */ -#ifdef __CYGWIN__ -#define F_DUPFD_CLOEXEC 14 /* As F_DUPFD, but set close-on-exec flag */ -#endif - -/* fcntl(2) flags (l_type field of flock structure) */ -#define F_RDLCK 1 /* read lock */ -#define F_WRLCK 2 /* write lock */ -#define F_UNLCK 3 /* remove lock(s) */ -#ifndef _POSIX_SOURCE -#define F_UNLKSYS 4 /* remove remote locks for a given system */ -#endif /* !_POSIX_SOURCE */ - -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__) -/* Special descriptor value to denote the cwd in calls to openat(2) etc. */ -#define AT_FDCWD -2 - -/* Flag values for faccessat2) et al. */ -#define AT_EACCESS 1 -#define AT_SYMLINK_NOFOLLOW 2 -#define AT_SYMLINK_FOLLOW 4 -#define AT_REMOVEDIR 8 -#endif - -#if __BSD_VISIBLE -/* lock operations for flock(2) */ -#define LOCK_SH 0x01 /* shared file lock */ -#define LOCK_EX 0x02 /* exclusive file lock */ -#define LOCK_NB 0x04 /* don't block when locking */ -#define LOCK_UN 0x08 /* unlock file */ -#endif - -/*#include */ - -#ifndef __CYGWIN__ -/* file segment locking set data type - information passed to system by user */ -struct flock { - short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ - short l_whence; /* flag to choose starting offset */ - long l_start; /* relative offset, in bytes */ - long l_len; /* length, in bytes; 0 means lock to EOF */ - short l_pid; /* returned with F_GETLK */ - short l_xxx; /* reserved for future use */ -}; -#endif /* __CYGWIN__ */ - -#ifndef _POSIX_SOURCE -/* extended file segment locking set data type */ -struct eflock { - short l_type; /* F_RDLCK, F_WRLCK, or F_UNLCK */ - short l_whence; /* flag to choose starting offset */ - long l_start; /* relative offset, in bytes */ - long l_len; /* length, in bytes; 0 means lock to EOF */ - short l_pid; /* returned with F_GETLK */ - short l_xxx; /* reserved for future use */ - long l_rpid; /* Remote process id wanting this lock */ - long l_rsys; /* Remote system id wanting this lock */ -}; -#endif /* !_POSIX_SOURCE */ - -#include -#include /* sigh. for the mode bits for open/creat */ - -extern int open _PARAMS ((const char *, int, ...)); -#if __BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined(__CYGWIN__) -extern int openat _PARAMS ((int, const char *, int, ...)); -#endif -extern int creat _PARAMS ((const char *, mode_t)); -extern int fcntl _PARAMS ((int, int, ...)); -#if __BSD_VISIBLE -extern int flock _PARAMS ((int, int)); -#endif -#ifdef __CYGWIN__ -#include -extern int futimesat _PARAMS ((int, const char *, const struct timeval *)); -#endif - -/* Provide _ prototypes for functions provided by some versions - of newlib. */ -#ifdef _COMPILING_NEWLIB -extern int _open _PARAMS ((const char *, int, ...)); -extern int _fcntl _PARAMS ((int, int, ...)); -#ifdef __LARGE64_FILES -extern int _open64 _PARAMS ((const char *, int, ...)); -#endif -#endif - -#ifdef __cplusplus -} -#endif -#endif /* !_SYS__DEFAULT_FCNTL_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/_intsup.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/_intsup.h deleted file mode 100644 index fa78426c5..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/_intsup.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (c) 2004, 2005 by - * Ralf Corsepius, Ulm/Germany. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - * - * Modified for xtensa arch & non-long int32_t, removes automatic setting of __have_long32. - */ - -#ifndef _SYS__INTSUP_H -#define _SYS__INTSUP_H - -#include - -#define __STDINT_EXP(x) __##x##__ - -#define __have_longlong64 1 - -#endif /* _SYS__INTSUP_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/_types.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/_types.h deleted file mode 100644 index 07bc27675..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/_types.h +++ /dev/null @@ -1,91 +0,0 @@ -/* ANSI C namespace clean utility typedefs */ - -/* This file defines various typedefs needed by the system calls that support - the C library. Basically, they're just the POSIX versions with an '_' - prepended. This file lives in the `sys' directory so targets can provide - their own if desired (or they can put target dependant conditionals here). -*/ - -#ifndef _SYS__TYPES_H -#define _SYS__TYPES_H - -#include -#include - -#ifndef __off_t_defined -typedef long _off_t; -#endif - -#ifndef __dev_t_defined -typedef short __dev_t; -#endif - -#ifndef __uid_t_defined -typedef unsigned short __uid_t; -#endif -#ifndef __gid_t_defined -typedef unsigned short __gid_t; -#endif - -#ifndef __off64_t_defined -__extension__ typedef long long _off64_t; -#endif - -/* - * We need fpos_t for the following, but it doesn't have a leading "_", - * so we use _fpos_t instead. - */ -#ifndef __fpos_t_defined -typedef long _fpos_t; /* XXX must match off_t in */ - /* (and must be `long' for now) */ -#endif - -#ifdef __LARGE64_FILES -#ifndef __fpos64_t_defined -typedef _off64_t _fpos64_t; -#endif -#endif - -#ifndef __ssize_t_defined -#ifdef __SIZE_TYPE__ -/* If __SIZE_TYPE__ is defined (gcc) we define ssize_t based on size_t. - We simply change "unsigned" to "signed" for this single definition - to make sure ssize_t and size_t only differ by their signedness. */ -#define unsigned signed -typedef __SIZE_TYPE__ _ssize_t; -#undef unsigned -#else -#if defined(__INT_MAX__) && __INT_MAX__ == 2147483647 -typedef int _ssize_t; -#else -typedef long _ssize_t; -#endif -#endif -#endif - -#define __need_wint_t -#include - -#ifndef __mbstate_t_defined -/* Conversion state information. */ -typedef struct -{ - int __count; - union - { - wint_t __wch; - unsigned char __wchb[4]; - } __value; /* Value so far. */ -} _mbstate_t; -#endif - -#ifndef __flock_t_defined -typedef _LOCK_RECURSIVE_T _flock_t; -#endif - -#ifndef __iconv_t_defined -/* Iconv descriptor type */ -typedef void *_iconv_t; -#endif - -#endif /* _SYS__TYPES_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/cdefs.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/cdefs.h deleted file mode 100644 index a5e613c63..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/cdefs.h +++ /dev/null @@ -1,710 +0,0 @@ -/* libc/sys/linux/sys/cdefs.h - Helper macros for K&R vs. ANSI C compat. */ - -/* Written 2000 by Werner Almesberger */ - -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Berkeley Software Design, Inc. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)cdefs.h 8.8 (Berkeley) 1/9/95 - * $FreeBSD$ - */ - -#ifndef _SYS_CDEFS_H_ -#define _SYS_CDEFS_H_ - -#include -#include -#include - -#define __PMT(args) args -#define __DOTS , ... -#define __THROW - -#ifdef __GNUC__ -# define __ASMNAME(cname) __XSTRING (__USER_LABEL_PREFIX__) cname -#endif - -#define __ptr_t void * -#define __long_double_t long double - -#define __attribute_malloc__ -#define __attribute_pure__ -#define __attribute_format_strfmon__(a,b) -#define __flexarr [0] - -#ifndef __BOUNDED_POINTERS__ -# define __bounded /* nothing */ -# define __unbounded /* nothing */ -# define __ptrvalue /* nothing */ -#endif - -/* - * Testing against Clang-specific extensions. - */ - -#ifndef __has_extension -#define __has_extension __has_feature -#endif -#ifndef __has_feature -#define __has_feature(x) 0 -#endif -#ifndef __has_include -#define __has_include(x) 0 -#endif -#ifndef __has_builtin -#define __has_builtin(x) 0 -#endif - -#if defined(__cplusplus) -#define __BEGIN_DECLS extern "C" { -#define __END_DECLS } -#else -#define __BEGIN_DECLS -#define __END_DECLS -#endif - -/* - * This code has been put in place to help reduce the addition of - * compiler specific defines in FreeBSD code. It helps to aid in - * having a compiler-agnostic source tree. - */ - -#if defined(__GNUC__) || defined(__INTEL_COMPILER) - -#if __GNUC__ >= 3 || defined(__INTEL_COMPILER) -#define __GNUCLIKE_ASM 3 -#define __GNUCLIKE_MATH_BUILTIN_CONSTANTS -#else -#define __GNUCLIKE_ASM 2 -#endif -#define __GNUCLIKE___TYPEOF 1 -#define __GNUCLIKE___OFFSETOF 1 -#define __GNUCLIKE___SECTION 1 - -#ifndef __INTEL_COMPILER -# define __GNUCLIKE_CTOR_SECTION_HANDLING 1 -#endif - -#define __GNUCLIKE_BUILTIN_CONSTANT_P 1 -# if defined(__INTEL_COMPILER) && defined(__cplusplus) \ - && __INTEL_COMPILER < 800 -# undef __GNUCLIKE_BUILTIN_CONSTANT_P -# endif - -#if (__GNUC_MINOR__ > 95 || __GNUC__ >= 3) && !defined(__INTEL_COMPILER) -# define __GNUCLIKE_BUILTIN_VARARGS 1 -# define __GNUCLIKE_BUILTIN_STDARG 1 -# define __GNUCLIKE_BUILTIN_VAALIST 1 -#endif - -#if defined(__GNUC__) -# define __GNUC_VA_LIST_COMPATIBILITY 1 -#endif - -/* - * Compiler memory barriers, specific to gcc and clang. - */ -#if defined(__GNUC__) -#define __compiler_membar() __asm __volatile(" " : : : "memory") -#endif - -#ifndef __INTEL_COMPILER -# define __GNUCLIKE_BUILTIN_NEXT_ARG 1 -# define __GNUCLIKE_MATH_BUILTIN_RELOPS -#endif - -#define __GNUCLIKE_BUILTIN_MEMCPY 1 - -/* XXX: if __GNUC__ >= 2: not tested everywhere originally, where replaced */ -#define __CC_SUPPORTS_INLINE 1 -#define __CC_SUPPORTS___INLINE 1 -#define __CC_SUPPORTS___INLINE__ 1 - -#define __CC_SUPPORTS___FUNC__ 1 -#define __CC_SUPPORTS_WARNING 1 - -#define __CC_SUPPORTS_VARADIC_XXX 1 /* see varargs.h */ - -#define __CC_SUPPORTS_DYNAMIC_ARRAY_INIT 1 - -#endif /* __GNUC__ || __INTEL_COMPILER */ - -/* - * The __CONCAT macro is used to concatenate parts of symbol names, e.g. - * with "#define OLD(foo) __CONCAT(old,foo)", OLD(foo) produces oldfoo. - * The __CONCAT macro is a bit tricky to use if it must work in non-ANSI - * mode -- there must be no spaces between its arguments, and for nested - * __CONCAT's, all the __CONCAT's must be at the left. __CONCAT can also - * concatenate double-quoted strings produced by the __STRING macro, but - * this only works with ANSI C. - * - * __XSTRING is like __STRING, but it expands any macros in its argument - * first. It is only available with ANSI C. - */ -#if defined(__STDC__) || defined(__cplusplus) -#define __P(protos) protos /* full-blown ANSI C */ -#define __CONCAT1(x,y) x ## y -#define __CONCAT(x,y) __CONCAT1(x,y) -#define __STRING(x) #x /* stringify without expanding x */ -#define __XSTRING(x) __STRING(x) /* expand x, then stringify */ - -#define __const const /* define reserved names to standard */ -#define __signed signed -#define __volatile volatile -#if defined(__cplusplus) -#define __inline inline /* convert to C++ keyword */ -#else -#if !(defined(__CC_SUPPORTS___INLINE)) -#define __inline /* delete GCC keyword */ -#endif /* ! __CC_SUPPORTS___INLINE */ -#endif /* !__cplusplus */ - -#else /* !(__STDC__ || __cplusplus) */ -#define __P(protos) () /* traditional C preprocessor */ -#define __CONCAT(x,y) x/**/y -#define __STRING(x) "x" - -#if !defined(__CC_SUPPORTS___INLINE) -#define __const /* delete pseudo-ANSI C keywords */ -#define __inline -#define __signed -#define __volatile -/* - * In non-ANSI C environments, new programs will want ANSI-only C keywords - * deleted from the program and old programs will want them left alone. - * When using a compiler other than gcc, programs using the ANSI C keywords - * const, inline etc. as normal identifiers should define -DNO_ANSI_KEYWORDS. - * When using "gcc -traditional", we assume that this is the intent; if - * __GNUC__ is defined but __STDC__ is not, we leave the new keywords alone. - */ -#ifndef NO_ANSI_KEYWORDS -#define const /* delete ANSI C keywords */ -#define inline -#define signed -#define volatile -#endif /* !NO_ANSI_KEYWORDS */ -#endif /* !__CC_SUPPORTS___INLINE */ -#endif /* !(__STDC__ || __cplusplus) */ - -/* - * Compiler-dependent macros to help declare dead (non-returning) and - * pure (no side effects) functions, and unused variables. They are - * null except for versions of gcc that are known to support the features - * properly (old versions of gcc-2 supported the dead and pure features - * in a different (wrong) way). If we do not provide an implementation - * for a given compiler, let the compile fail if it is told to use - * a feature that we cannot live without. - */ -#ifdef lint -#define __dead2 -#define __pure2 -#define __unused -#define __packed -#define __aligned(x) -#define __section(x) -#else -#if !__GNUC_PREREQ__(2, 5) && !defined(__INTEL_COMPILER) -#define __dead2 -#define __pure2 -#define __unused -#endif -#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 && __GNUC_MINOR__ < 7 && !defined(__INTEL_COMPILER) -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused -/* XXX Find out what to do for __packed, __aligned and __section */ -#endif -#if __GNUC_PREREQ__(2, 7) -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused __attribute__((__unused__)) -#define __used __attribute__((__used__)) -#define __packed __attribute__((__packed__)) -#define __aligned(x) __attribute__((__aligned__(x))) -#define __section(x) __attribute__((__section__(x))) -#endif -#if defined(__INTEL_COMPILER) -#define __dead2 __attribute__((__noreturn__)) -#define __pure2 __attribute__((__const__)) -#define __unused __attribute__((__unused__)) -#define __used __attribute__((__used__)) -#define __packed __attribute__((__packed__)) -#define __aligned(x) __attribute__((__aligned__(x))) -#define __section(x) __attribute__((__section__(x))) -#endif -#endif - -#if !__GNUC_PREREQ__(2, 95) -#define __alignof(x) __offsetof(struct { char __a; x __b; }, __b) -#endif - -/* - * Keywords added in C11. - */ - -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 201112L - -#if !__has_extension(c_alignas) -#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ - __has_extension(cxx_alignas) -#define _Alignas(x) alignas(x) -#else -/* XXX: Only emulates _Alignas(constant-expression); not _Alignas(type-name). */ -#define _Alignas(x) __aligned(x) -#endif -#endif - -#if defined(__cplusplus) && __cplusplus >= 201103L -#define _Alignof(x) alignof(x) -#else -#define _Alignof(x) __alignof(x) -#endif - -#if !__has_extension(c_atomic) && !__has_extension(cxx_atomic) -/* - * No native support for _Atomic(). Place object in structure to prevent - * most forms of direct non-atomic access. - */ -#define _Atomic(T) struct { T volatile __val; } -#endif - -#if defined(__cplusplus) && __cplusplus >= 201103L -#define _Noreturn [[noreturn]] -#else -#define _Noreturn __dead2 -#endif - -#if __GNUC_PREREQ__(4, 6) && !defined(__cplusplus) -/* Do nothing: _Static_assert() works as per C11 */ -#elif !__has_extension(c_static_assert) -#if (defined(__cplusplus) && __cplusplus >= 201103L) || \ - __has_extension(cxx_static_assert) -#define _Static_assert(x, y) static_assert(x, y) -#elif defined(__COUNTER__) -#define _Static_assert(x, y) __Static_assert(x, __COUNTER__) -#define __Static_assert(x, y) ___Static_assert(x, y) -#define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] -#else -#define _Static_assert(x, y) struct __hack -#endif -#endif - -#if !__has_extension(c_thread_local) -/* XXX: Change this to test against C++11 when clang in base supports it. */ -#if /* (defined(__cplusplus) && __cplusplus >= 201103L) || */ \ - __has_extension(cxx_thread_local) -#define _Thread_local thread_local -#else -#define _Thread_local __thread -#endif -#endif - -#endif /* __STDC_VERSION__ || __STDC_VERSION__ < 201112L */ - -/* - * Emulation of C11 _Generic(). Unlike the previously defined C11 - * keywords, it is not possible to implement this using exactly the same - * syntax. Therefore implement something similar under the name - * __generic(). Unlike _Generic(), this macro can only distinguish - * between a single type, so it requires nested invocations to - * distinguish multiple cases. - */ - -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L -#define __generic(expr, t, yes, no) \ - _Generic(expr, t: yes, default: no) -#elif __GNUC_PREREQ__(3, 1) && !defined(__cplusplus) -#define __generic(expr, t, yes, no) \ - __builtin_choose_expr( \ - __builtin_types_compatible_p(__typeof(expr), t), yes, no) -#endif - -#if __GNUC_PREREQ__(2, 96) -#define __malloc_like __attribute__((__malloc__)) -#define __pure __attribute__((__pure__)) -#else -#define __malloc_like -#define __pure -#endif - -#if __GNUC_PREREQ__(3, 1) || (defined(__INTEL_COMPILER) && __INTEL_COMPILER >= 800) -#define __always_inline __attribute__((__always_inline__)) -#else -#define __always_inline -#endif - -#if __GNUC_PREREQ__(3, 1) -#define __noinline __attribute__ ((__noinline__)) -#else -#define __noinline -#endif - -#if __GNUC_PREREQ__(3, 3) -#define __nonnull(x) __attribute__((__nonnull__(x))) -#else -#define __nonnull(x) -#endif - -#if __GNUC_PREREQ__(3, 4) -#define __fastcall __attribute__((__fastcall__)) -#else -#define __fastcall -#endif - -#if __GNUC_PREREQ__(4, 1) -#define __returns_twice __attribute__((__returns_twice__)) -#else -#define __returns_twice -#endif - -/* XXX: should use `#if __STDC_VERSION__ < 199901'. */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) -#define __func__ NULL -#endif - -/* - * GCC 2.95 provides `__restrict' as an extension to C90 to support the - * C99-specific `restrict' type qualifier. We happen to use `__restrict' as - * a way to define the `restrict' type qualifier without disturbing older - * software that is unaware of C99 keywords. - */ -#if !(__GNUC__ == 2 && __GNUC_MINOR__ == 95) -#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901 || defined(lint) -#define __restrict -#else -#define __restrict restrict -#endif -#endif - -/* - * GNU C version 2.96 adds explicit branch prediction so that - * the CPU back-end can hint the processor and also so that - * code blocks can be reordered such that the predicted path - * sees a more linear flow, thus improving cache behavior, etc. - * - * The following two macros provide us with a way to utilize this - * compiler feature. Use __predict_true() if you expect the expression - * to evaluate to true, and __predict_false() if you expect the - * expression to evaluate to false. - * - * A few notes about usage: - * - * * Generally, __predict_false() error condition checks (unless - * you have some _strong_ reason to do otherwise, in which case - * document it), and/or __predict_true() `no-error' condition - * checks, assuming you want to optimize for the no-error case. - * - * * Other than that, if you don't know the likelihood of a test - * succeeding from empirical or other `hard' evidence, don't - * make predictions. - * - * * These are meant to be used in places that are run `a lot'. - * It is wasteful to make predictions in code that is run - * seldomly (e.g. at subsystem initialization time) as the - * basic block reordering that this affects can often generate - * larger code. - */ -#if __GNUC_PREREQ__(2, 96) -#define __predict_true(exp) __builtin_expect((exp), 1) -#define __predict_false(exp) __builtin_expect((exp), 0) -#else -#define __predict_true(exp) (exp) -#define __predict_false(exp) (exp) -#endif - -#if __GNUC_PREREQ__(4, 2) -#define __hidden __attribute__((__visibility__("hidden"))) -#define __exported __attribute__((__visibility__("default"))) -#else -#define __hidden -#define __exported -#endif - -#define __offsetof(type, field) offsetof(type, field) -#define __rangeof(type, start, end) \ - (__offsetof(type, end) - __offsetof(type, start)) - -/* - * Given the pointer x to the member m of the struct s, return - * a pointer to the containing structure. When using GCC, we first - * assign pointer x to a local variable, to check that its type is - * compatible with member m. - */ -#if __GNUC_PREREQ__(3, 1) -#define __containerof(x, s, m) ({ \ - const volatile __typeof__(((s *)0)->m) *__x = (x); \ - __DEQUALIFY(s *, (const volatile char *)__x - __offsetof(s, m));\ -}) -#else -#define __containerof(x, s, m) \ - __DEQUALIFY(s *, (const volatile char *)(x) - __offsetof(s, m)) -#endif - -/* - * Compiler-dependent macros to declare that functions take printf-like - * or scanf-like arguments. They are null except for versions of gcc - * that are known to support the features properly (old versions of gcc-2 - * didn't permit keeping the keywords out of the application namespace). - */ -#if !__GNUC_PREREQ__(2, 7) && !defined(__INTEL_COMPILER) -#define __printflike(fmtarg, firstvararg) -#define __scanflike(fmtarg, firstvararg) -#define __format_arg(fmtarg) -#define __strfmonlike(fmtarg, firstvararg) -#define __strftimelike(fmtarg, firstvararg) -#else -#define __printflike(fmtarg, firstvararg) \ - __attribute__((__format__ (__printf__, fmtarg, firstvararg))) -#define __scanflike(fmtarg, firstvararg) \ - __attribute__((__format__ (__scanf__, fmtarg, firstvararg))) -#define __format_arg(fmtarg) __attribute__((__format_arg__ (fmtarg))) -#define __strfmonlike(fmtarg, firstvararg) \ - __attribute__((__format__ (__strfmon__, fmtarg, firstvararg))) -#define __strftimelike(fmtarg, firstvararg) \ - __attribute__((__format__ (__strftime__, fmtarg, firstvararg))) -#endif - -/* Compiler-dependent macros that rely on FreeBSD-specific extensions. */ -#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version >= 300001 && \ - defined(__GNUC__) && !defined(__INTEL_COMPILER) -#define __printf0like(fmtarg, firstvararg) \ - __attribute__((__format__ (__printf0__, fmtarg, firstvararg))) -#else -#define __printf0like(fmtarg, firstvararg) -#endif - -#if defined(__GNUC__) || defined(__INTEL_COMPILER) -#ifndef __INTEL_COMPILER -#define __strong_reference(sym,aliassym) \ - extern __typeof (sym) aliassym __attribute__ ((__alias__ (#sym))) -#endif -#ifdef __ELF__ -#ifdef __STDC__ -#define __weak_reference(sym,alias) \ - __asm__(".weak " #alias); \ - __asm__(".equ " #alias ", " #sym) -#define __warn_references(sym,msg) \ - __asm__(".section .gnu.warning." #sym); \ - __asm__(".asciz \"" msg "\""); \ - __asm__(".previous") -#define __sym_compat(sym,impl,verid) \ - __asm__(".symver " #impl ", " #sym "@" #verid) -#define __sym_default(sym,impl,verid) \ - __asm__(".symver " #impl ", " #sym "@@" #verid) -#else -#define __weak_reference(sym,alias) \ - __asm__(".weak alias"); \ - __asm__(".equ alias, sym") -#define __warn_references(sym,msg) \ - __asm__(".section .gnu.warning.sym"); \ - __asm__(".asciz \"msg\""); \ - __asm__(".previous") -#define __sym_compat(sym,impl,verid) \ - __asm__(".symver impl, sym@verid") -#define __sym_default(impl,sym,verid) \ - __asm__(".symver impl, sym@@verid") -#endif /* __STDC__ */ -#else /* !__ELF__ */ -#ifdef __STDC__ -#define __weak_reference(sym,alias) \ - __asm__(".stabs \"_" #alias "\",11,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs \"" msg "\",30,0,0,0"); \ - __asm__(".stabs \"_" #sym "\",1,0,0,0") -#else -#define __weak_reference(sym,alias) \ - __asm__(".stabs \"_/**/alias\",11,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#define __warn_references(sym,msg) \ - __asm__(".stabs msg,30,0,0,0"); \ - __asm__(".stabs \"_/**/sym\",1,0,0,0") -#endif /* __STDC__ */ -#endif /* __ELF__ */ -#endif /* __GNUC__ || __INTEL_COMPILER */ - -#ifndef __FBSDID -#define __FBSDID(s) struct __hack -#endif - -#ifndef __RCSID -#define __RCSID(s) struct __hack -#endif - -#ifndef __RCSID_SOURCE -#define __RCSID_SOURCE(s) struct __hack -#endif - -#ifndef __SCCSID -#define __SCCSID(s) struct __hack -#endif - -#ifndef __COPYRIGHT -#define __COPYRIGHT(s) struct __hack -#endif - -#ifndef __DECONST -#define __DECONST(type, var) ((type)(__uintptr_t)(const void *)(var)) -#endif - -#ifndef __DEVOLATILE -#define __DEVOLATILE(type, var) ((type)(__uintptr_t)(volatile void *)(var)) -#endif - -#ifndef __DEQUALIFY -#define __DEQUALIFY(type, var) ((type)(__uintptr_t)(const volatile void *)(var)) -#endif - -/*- - * The following definitions are an extension of the behavior originally - * implemented in , but with a different level of granularity. - * POSIX.1 requires that the macros we test be defined before any standard - * header file is included. - * - * Here's a quick run-down of the versions: - * defined(_POSIX_SOURCE) 1003.1-1988 - * _POSIX_C_SOURCE == 1 1003.1-1990 - * _POSIX_C_SOURCE == 2 1003.2-1992 C Language Binding Option - * _POSIX_C_SOURCE == 199309 1003.1b-1993 - * _POSIX_C_SOURCE == 199506 1003.1c-1995, 1003.1i-1995, - * and the omnibus ISO/IEC 9945-1: 1996 - * _POSIX_C_SOURCE == 200112 1003.1-2001 - * _POSIX_C_SOURCE == 200809 1003.1-2008 - * - * In addition, the X/Open Portability Guide, which is now the Single UNIX - * Specification, defines a feature-test macro which indicates the version of - * that specification, and which subsumes _POSIX_C_SOURCE. - * - * Our macros begin with two underscores to avoid namespace screwage. - */ - -/* Deal with IEEE Std. 1003.1-1990, in which _POSIX_C_SOURCE == 1. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 1 -#undef _POSIX_C_SOURCE /* Probably illegal, but beyond caring now. */ -#define _POSIX_C_SOURCE 199009 -#endif - -/* Deal with IEEE Std. 1003.2-1992, in which _POSIX_C_SOURCE == 2. */ -#if defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE == 2 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199209 -#endif - -/* Deal with various X/Open Portability Guides and Single UNIX Spec. */ -#ifdef _XOPEN_SOURCE -#if _XOPEN_SOURCE - 0 >= 700 -#define __XSI_VISIBLE 700 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200809 -#elif _XOPEN_SOURCE - 0 >= 600 -#define __XSI_VISIBLE 600 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 200112 -#elif _XOPEN_SOURCE - 0 >= 500 -#define __XSI_VISIBLE 500 -#undef _POSIX_C_SOURCE -#define _POSIX_C_SOURCE 199506 -#endif -#endif - -/* - * Deal with all versions of POSIX. The ordering relative to the tests above is - * important. - */ -#if defined(_POSIX_SOURCE) && !defined(_POSIX_C_SOURCE) -#define _POSIX_C_SOURCE 198808 -#endif -#ifdef _POSIX_C_SOURCE -#if _POSIX_C_SOURCE >= 200809 -#define __POSIX_VISIBLE 200809 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 200112 -#define __POSIX_VISIBLE 200112 -#define __ISO_C_VISIBLE 1999 -#elif _POSIX_C_SOURCE >= 199506 -#define __POSIX_VISIBLE 199506 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199309 -#define __POSIX_VISIBLE 199309 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199209 -#define __POSIX_VISIBLE 199209 -#define __ISO_C_VISIBLE 1990 -#elif _POSIX_C_SOURCE >= 199009 -#define __POSIX_VISIBLE 199009 -#define __ISO_C_VISIBLE 1990 -#else -#define __POSIX_VISIBLE 198808 -#define __ISO_C_VISIBLE 0 -#endif /* _POSIX_C_SOURCE */ -#else -/*- - * Deal with _ANSI_SOURCE: - * If it is defined, and no other compilation environment is explicitly - * requested, then define our internal feature-test macros to zero. This - * makes no difference to the preprocessor (undefined symbols in preprocessing - * expressions are defined to have value zero), but makes it more convenient for - * a test program to print out the values. - * - * If a program mistakenly defines _ANSI_SOURCE and some other macro such as - * _POSIX_C_SOURCE, we will assume that it wants the broader compilation - * environment (and in fact we will never get here). - */ -#if defined(_ANSI_SOURCE) /* Hide almost everything. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1990 -#elif defined(_C99_SOURCE) /* Localism to specify strict C99 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 1999 -#elif defined(_C11_SOURCE) /* Localism to specify strict C11 env. */ -#define __POSIX_VISIBLE 0 -#define __XSI_VISIBLE 0 -#define __BSD_VISIBLE 0 -#define __ISO_C_VISIBLE 2011 -#elif defined(_GNU_SOURCE) /* Everything and the kitchen sink. */ -#define __POSIX_VISIBLE 200809 -#define __XSI_VISIBLE 700 -#define __BSD_VISIBLE 1 -#define __ISO_C_VISIBLE 2011 -#define __GNU_VISIBLE 1 -#else /* Default: everything except __GNU_VISIBLE. */ -#define __POSIX_VISIBLE 200809 -#define __XSI_VISIBLE 700 -#define __BSD_VISIBLE 1 -#define __ISO_C_VISIBLE 2011 -#endif -#endif - -#endif /* !_SYS_CDEFS_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/config.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/config.h deleted file mode 100644 index f6f923ecb..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/config.h +++ /dev/null @@ -1,293 +0,0 @@ -#ifndef __SYS_CONFIG_H__ -#define __SYS_CONFIG_H__ - -#include /* floating point macros */ -#include /* POSIX defs */ - -#ifdef __aarch64__ -#define MALLOC_ALIGNMENT 16 -#endif - -/* exceptions first */ -#if defined(__H8500__) || defined(__W65__) -#define __SMALL_BITFIELDS -/* ??? This conditional is true for the h8500 and the w65, defining H8300 - in those cases probably isn't the right thing to do. */ -#define H8300 1 -#endif - -/* 16 bit integer machines */ -#if defined(__Z8001__) || defined(__Z8002__) || defined(__H8500__) || defined(__W65__) || defined (__mn10200__) || defined (__AVR__) - -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX 32767 -#define UINT_MAX 65535 -#endif - -#if defined (__H8300__) || defined (__H8300H__) || defined(__H8300S__) || defined (__H8300SX__) -#define __SMALL_BITFIELDS -#define H8300 1 -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#endif - -#if (defined(__CR16__) || defined(__CR16C__) ||defined(__CR16CP__)) -#ifndef __INT32__ -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX 32767 -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#else /* INT32 */ -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX 2147483647 -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#endif /* INT32 */ - -#endif /* CR16C */ - -#if defined (__xc16x__) || defined (__xc16xL__) || defined (__xc16xS__) -#define __SMALL_BITFIELDS -#endif - -#ifdef __W65__ -#define __SMALL_BITFIELDS -#endif - -#if defined(__D10V__) -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define _POINTER_INT short -#endif - -#if defined(__mc68hc11__) || defined(__mc68hc12__) || defined(__mc68hc1x__) -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define _POINTER_INT short -#endif - -#if defined(__m68k__) || defined(__mc68000__) -#define _READ_WRITE_RETURN_TYPE _ssize_t -#endif - -#ifdef ___AM29K__ -#define _FLOAT_RET double -#endif - -#ifdef __i386__ -#ifndef __unix__ -/* in other words, go32 */ -#define _FLOAT_RET double -#endif -#if defined(__linux__) || defined(__RDOS__) -/* we want the reentrancy structure to be returned by a function */ -#define __DYNAMIC_REENT__ -#define HAVE_GETDATE -#define _HAVE_SYSTYPES -#define _READ_WRITE_RETURN_TYPE _ssize_t -#define __LARGE64_FILES 1 -/* we use some glibc header files so turn on glibc large file feature */ -#define _LARGEFILE64_SOURCE 1 -#endif -#endif - -#ifdef __mn10200__ -#define __SMALL_BITFIELDS -#endif - -#ifdef __AVR__ -#define __SMALL_BITFIELDS -#define _POINTER_INT short -#endif - -#ifdef __v850 -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__sda__)) -#endif - -/* For the PowerPC eabi, force the _impure_ptr to be in .sdata */ -#if defined(__PPC__) -#if defined(_CALL_SYSV) -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -#endif -#ifdef __SPE__ -#define _LONG_DOUBLE double -#endif -#endif - -/* Configure small REENT structure for Xilinx MicroBlaze platforms */ -#if defined (__MICROBLAZE__) -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif -/* Xilinx XMK uses Unix98 mutex */ -#ifdef __XMK__ -#define _UNIX98_THREAD_MUTEX_ATTRIBUTES -#endif -#endif - -#if defined(__mips__) && !defined(__rtems__) -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -#endif - -#ifdef __xstormy16__ -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define MALLOC_ALIGNMENT 8 -#define _POINTER_INT short -#define __BUFSIZ__ 16 -#define _REENT_SMALL -#endif - -#if defined __MSP430__ -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif - -#define __SMALL_BITFIELDS - -#ifdef __MSP430X_LARGE__ -#define _POINTER_INT long -#else -#define _POINTER_INT int -#endif -#endif - -#ifdef __m32c__ -#define __SMALL_BITFIELDS -#undef INT_MAX -#undef UINT_MAX -#define INT_MAX __INT_MAX__ -#define UINT_MAX (__INT_MAX__ * 2U + 1) -#define MALLOC_ALIGNMENT 8 -#if defined(__r8c_cpu__) || defined(__m16c_cpu__) -#define _POINTER_INT short -#else -#define _POINTER_INT long -#endif -#define __BUFSIZ__ 16 -#define _REENT_SMALL -#endif /* __m32c__ */ - -#ifdef __SPU__ -#define MALLOC_ALIGNMENT 16 -#define __CUSTOM_FILE_IO__ -#endif - -#ifdef __XTENSA__ -#include -#define MALLOC_ALIGNMENT ((XCHAL_DATA_WIDTH) < 16 ? 16 : (XCHAL_DATA_WIDTH)) -/* esp8266-specific: shrink the default fd buffer size */ -#define __BUFSIZ__ 128 -#endif - -/* This block should be kept in sync with GCC's limits.h. The point - of having these definitions here is to not include limits.h, which - would pollute the user namespace, while still using types of the - the correct widths when deciding how to define __int32_t and - __int64_t. */ -#ifndef __INT_MAX__ -# ifdef INT_MAX -# define __INT_MAX__ INT_MAX -# else -# define __INT_MAX__ 2147483647 -# endif -#endif - -#ifndef __LONG_MAX__ -# ifdef LONG_MAX -# define __LONG_MAX__ LONG_MAX -# else -# if defined (__alpha__) || (defined (__sparc__) && defined(__arch64__)) \ - || defined (__sparcv9) -# define __LONG_MAX__ 9223372036854775807L -# else -# define __LONG_MAX__ 2147483647L -# endif /* __alpha__ || sparc64 */ -# endif -#endif -/* End of block that should be kept in sync with GCC's limits.h. */ - -#ifndef _POINTER_INT -#define _POINTER_INT long -#endif - -#ifdef __frv__ -#define __ATTRIBUTE_IMPURE_PTR__ __attribute__((__section__(".sdata"))) -#endif -#undef __RAND_MAX -#if __INT_MAX__ == 32767 -#define __RAND_MAX 32767 -#else -#define __RAND_MAX 0x7fffffff -#endif - -#if defined(__CYGWIN__) -#include -#if !defined (__STRICT_ANSI__) || (__STDC_VERSION__ >= 199901L) -#define __USE_XOPEN2K 1 -#endif -#endif - -#if defined(__rtems__) -#define __FILENAME_MAX__ 255 -#define _READ_WRITE_RETURN_TYPE _ssize_t -#define __DYNAMIC_REENT__ -#define _REENT_GLOBAL_ATEXIT -#endif - -#ifndef __EXPORT -#define __EXPORT -#endif - -#ifndef __IMPORT -#define __IMPORT -#endif - -/* Define return type of read/write routines. In POSIX, the return type - for read()/write() is "ssize_t" but legacy newlib code has been using - "int" for some time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_RETURN_TYPE -#define _READ_WRITE_RETURN_TYPE int -#endif -/* Define `count' parameter of read/write routines. In POSIX, the `count' - parameter is "size_t" but legacy newlib code has been using "int" for some - time. If not specified, "int" is defaulted. */ -#ifndef _READ_WRITE_BUFSIZE_TYPE -#define _READ_WRITE_BUFSIZE_TYPE int -#endif - -#ifndef __WCHAR_MAX__ -#if __INT_MAX__ == 32767 || defined (_WIN32) -#define __WCHAR_MAX__ 0xffffu -#endif -#endif - -/* See if small reent asked for at configuration time and - is not chosen by the platform by default. */ -#ifdef _WANT_REENT_SMALL -#ifndef _REENT_SMALL -#define _REENT_SMALL -#endif -#endif - -/* If _MB_EXTENDED_CHARSETS_ALL is set, we want all of the extended - charsets. The extended charsets add a few functions and a couple - of tables of a few K each. */ -#ifdef _MB_EXTENDED_CHARSETS_ALL -#define _MB_EXTENDED_CHARSETS_ISO 1 -#define _MB_EXTENDED_CHARSETS_WINDOWS 1 -#endif - -#endif /* __SYS_CONFIG_H__ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/ctype.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/ctype.h deleted file mode 100644 index 8527d7356..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/ctype.h +++ /dev/null @@ -1,9 +0,0 @@ -/* sys/ctype.h - PROGMEM ctype handlers */ - -#ifndef _SYS_CTYPE_H_ -#define _SYS_CTYPE_H_ - -// Will cause pgm_read_byte to be defined and be used by ctype macros -#include - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/custom_file.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/custom_file.h deleted file mode 100644 index 96314fb91..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/custom_file.h +++ /dev/null @@ -1,2 +0,0 @@ -#error System-specific custom_file.h is missing. - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/dir.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/dir.h deleted file mode 100644 index 220150dc9..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/dir.h +++ /dev/null @@ -1,10 +0,0 @@ -/* BSD predecessor of POSIX.1 and struct dirent */ - -#ifndef _SYS_DIR_H_ -#define _SYS_DIR_H_ - -#include - -#define direct dirent - -#endif /*_SYS_DIR_H_*/ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/dirent.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/dirent.h deleted file mode 100644 index a3fb5c02c..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/dirent.h +++ /dev/null @@ -1,13 +0,0 @@ -/* includes , which is this file. On a - system which supports , this file is overridden by - dirent.h in the libc/sys/.../sys directory. On a system which does - not support , we will get this file which uses #error to force - an error. */ - -#ifdef __cplusplus -extern "C" { -#endif -#error " not supported" -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/errno.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/errno.h deleted file mode 100644 index a72c37320..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/errno.h +++ /dev/null @@ -1,192 +0,0 @@ -/* errno is not a global variable, because that would make using it - non-reentrant. Instead, its address is returned by the function - __errno. */ - -#ifndef _SYS_ERRNO_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS_ERRNO_H_ - -#include - -#ifndef _REENT_ONLY -#define errno (*__errno()) -extern int *__errno _PARAMS ((void)); -#endif - -/* Please don't use these variables directly. - Use strerror instead. */ -extern __IMPORT _CONST char * _CONST _sys_errlist[]; -extern __IMPORT int _sys_nerr; -#ifdef __CYGWIN__ -extern __IMPORT const char * const sys_errlist[]; -extern __IMPORT int sys_nerr; -extern __IMPORT char *program_invocation_name; -extern __IMPORT char *program_invocation_short_name; -#endif - -#define __errno_r(ptr) ((ptr)->_errno) - -#define EPERM 1 /* Not owner */ -#define ENOENT 2 /* No such file or directory */ -#define ESRCH 3 /* No such process */ -#define EINTR 4 /* Interrupted system call */ -#define EIO 5 /* I/O error */ -#define ENXIO 6 /* No such device or address */ -#define E2BIG 7 /* Arg list too long */ -#define ENOEXEC 8 /* Exec format error */ -#define EBADF 9 /* Bad file number */ -#define ECHILD 10 /* No children */ -#define EAGAIN 11 /* No more processes */ -#define ENOMEM 12 /* Not enough space */ -#define EACCES 13 /* Permission denied */ -#define EFAULT 14 /* Bad address */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENOTBLK 15 /* Block device required */ -#endif -#define EBUSY 16 /* Device or resource busy */ -#define EEXIST 17 /* File exists */ -#define EXDEV 18 /* Cross-device link */ -#define ENODEV 19 /* No such device */ -#define ENOTDIR 20 /* Not a directory */ -#define EISDIR 21 /* Is a directory */ -#define EINVAL 22 /* Invalid argument */ -#define ENFILE 23 /* Too many open files in system */ -#define EMFILE 24 /* File descriptor value too large */ -#define ENOTTY 25 /* Not a character device */ -#define ETXTBSY 26 /* Text file busy */ -#define EFBIG 27 /* File too large */ -#define ENOSPC 28 /* No space left on device */ -#define ESPIPE 29 /* Illegal seek */ -#define EROFS 30 /* Read-only file system */ -#define EMLINK 31 /* Too many links */ -#define EPIPE 32 /* Broken pipe */ -#define EDOM 33 /* Mathematics argument out of domain of function */ -#define ERANGE 34 /* Result too large */ -#define ENOMSG 35 /* No message of desired type */ -#define EIDRM 36 /* Identifier removed */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ECHRNG 37 /* Channel number out of range */ -#define EL2NSYNC 38 /* Level 2 not synchronized */ -#define EL3HLT 39 /* Level 3 halted */ -#define EL3RST 40 /* Level 3 reset */ -#define ELNRNG 41 /* Link number out of range */ -#define EUNATCH 42 /* Protocol driver not attached */ -#define ENOCSI 43 /* No CSI structure available */ -#define EL2HLT 44 /* Level 2 halted */ -#endif -#define EDEADLK 45 /* Deadlock */ -#define ENOLCK 46 /* No lock */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define EBADE 50 /* Invalid exchange */ -#define EBADR 51 /* Invalid request descriptor */ -#define EXFULL 52 /* Exchange full */ -#define ENOANO 53 /* No anode */ -#define EBADRQC 54 /* Invalid request code */ -#define EBADSLT 55 /* Invalid slot */ -#define EDEADLOCK 56 /* File locking deadlock error */ -#define EBFONT 57 /* Bad font file fmt */ -#endif -#define ENOSTR 60 /* Not a stream */ -#define ENODATA 61 /* No data (for no delay io) */ -#define ETIME 62 /* Stream ioctl timeout */ -#define ENOSR 63 /* No stream resources */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENONET 64 /* Machine is not on the network */ -#define ENOPKG 65 /* Package not installed */ -#define EREMOTE 66 /* The object is remote */ -#endif -#define ENOLINK 67 /* Virtual circuit is gone */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define EADV 68 /* Advertise error */ -#define ESRMNT 69 /* Srmount error */ -#define ECOMM 70 /* Communication error on send */ -#endif -#define EPROTO 71 /* Protocol error */ -#define EMULTIHOP 74 /* Multihop attempted */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ELBIN 75 /* Inode is remote (not really error) */ -#define EDOTDOT 76 /* Cross mount point (not really error) */ -#endif -#define EBADMSG 77 /* Bad message */ -#define EFTYPE 79 /* Inappropriate file type or format */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENOTUNIQ 80 /* Given log. name not unique */ -#define EBADFD 81 /* f.d. invalid for this operation */ -#define EREMCHG 82 /* Remote address changed */ -#define ELIBACC 83 /* Can't access a needed shared lib */ -#define ELIBBAD 84 /* Accessing a corrupted shared lib */ -#define ELIBSCN 85 /* .lib section in a.out corrupted */ -#define ELIBMAX 86 /* Attempting to link in too many libs */ -#define ELIBEXEC 87 /* Attempting to exec a shared library */ -#endif -#define ENOSYS 88 /* Function not implemented */ -#ifdef __CYGWIN__ -#define ENMFILE 89 /* No more files */ -#endif -#define ENOTEMPTY 90 /* Directory not empty */ -#define ENAMETOOLONG 91 /* File or path name too long */ -#define ELOOP 92 /* Too many symbolic links */ -#define EOPNOTSUPP 95 /* Operation not supported on socket */ -#define EPFNOSUPPORT 96 /* Protocol family not supported */ -#define ECONNRESET 104 /* Connection reset by peer */ -#define ENOBUFS 105 /* No buffer space available */ -#define EAFNOSUPPORT 106 /* Address family not supported by protocol family */ -#define EPROTOTYPE 107 /* Protocol wrong type for socket */ -#define ENOTSOCK 108 /* Socket operation on non-socket */ -#define ENOPROTOOPT 109 /* Protocol not available */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ESHUTDOWN 110 /* Can't send after socket shutdown */ -#endif -#define ECONNREFUSED 111 /* Connection refused */ -#define EADDRINUSE 112 /* Address already in use */ -#define ECONNABORTED 113 /* Software caused connection abort */ -#define ENETUNREACH 114 /* Network is unreachable */ -#define ENETDOWN 115 /* Network interface is not configured */ -#define ETIMEDOUT 116 /* Connection timed out */ -#define EHOSTDOWN 117 /* Host is down */ -#define EHOSTUNREACH 118 /* Host is unreachable */ -#define EINPROGRESS 119 /* Connection already in progress */ -#define EALREADY 120 /* Socket already connected */ -#define EDESTADDRREQ 121 /* Destination address required */ -#define EMSGSIZE 122 /* Message too long */ -#define EPROTONOSUPPORT 123 /* Unknown protocol */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ESOCKTNOSUPPORT 124 /* Socket type not supported */ -#endif -#define EADDRNOTAVAIL 125 /* Address not available */ -#define ENETRESET 126 /* Connection aborted by network */ -#define EISCONN 127 /* Socket is already connected */ -#define ENOTCONN 128 /* Socket is not connected */ -#define ETOOMANYREFS 129 -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define EPROCLIM 130 -#define EUSERS 131 -#endif -#define EDQUOT 132 -#define ESTALE 133 -#define ENOTSUP 134 /* Not supported */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ENOMEDIUM 135 /* No medium (in tape drive) */ -#endif -#ifdef __CYGWIN__ -#define ENOSHARE 136 /* No such host or network path */ -#define ECASECLASH 137 /* Filename exists with different case */ -#endif -#define EILSEQ 138 /* Illegal byte sequence */ -#define EOVERFLOW 139 /* Value too large for defined data type */ -#define ECANCELED 140 /* Operation canceled */ -#define ENOTRECOVERABLE 141 /* State not recoverable */ -#define EOWNERDEAD 142 /* Previous owner died */ -#ifdef __LINUX_ERRNO_EXTENSIONS__ -#define ESTRPIPE 143 /* Streams pipe error */ -#endif -#define EWOULDBLOCK EAGAIN /* Operation would block */ - -#define __ELASTERROR 2000 /* Users can add values starting here */ - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_ERRNO_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/fcntl.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/fcntl.h deleted file mode 100644 index be85f40c1..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/fcntl.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef _SYS_FCNTL_H_ -#define _SYS_FCNTL_H_ -#include -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/features.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/features.h deleted file mode 100644 index 1d90921af..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/features.h +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2000. - * - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - -#ifndef _SYS_FEATURES_H -#define _SYS_FEATURES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* Macros to determine that newlib is being used. Put in this header to - * be similar to where glibc stores its version of these macros. - */ -#define __NEWLIB__ 2 -#define __NEWLIB_MINOR__ 1 - -/* Macro to test version of GCC. Returns 0 for non-GCC or too old GCC. */ -#ifndef __GNUC_PREREQ -# if defined __GNUC__ && defined __GNUC_MINOR__ -# define __GNUC_PREREQ(maj, min) \ - ((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min)) -# else -# define __GNUC_PREREQ(maj, min) 0 -# endif -#endif /* __GNUC_PREREQ */ -/* Version with trailing underscores for BSD compatibility. */ -#define __GNUC_PREREQ__(ma, mi) __GNUC_PREREQ(ma, mi) - -/* RTEMS adheres to POSIX -- 1003.1b with some features from annexes. */ - -#ifdef __rtems__ -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_VERSION 199309L -#define _POSIX_ASYNCHRONOUS_IO 1 -#define _POSIX_FSYNC 1 -#define _POSIX_MAPPED_FILES 1 -#define _POSIX_MEMLOCK 1 -#define _POSIX_MEMLOCK_RANGE 1 -#define _POSIX_MEMORY_PROTECTION 1 -#define _POSIX_MESSAGE_PASSING 1 -#define _POSIX_MONOTONIC_CLOCK 200112L -#define _POSIX_PRIORITIZED_IO 1 -#define _POSIX_PRIORITY_SCHEDULING 1 -#define _POSIX_REALTIME_SIGNALS 1 -#define _POSIX_SEMAPHORES 1 -/* #define _POSIX_SHARED_MEMORY_OBJECTS 1 */ -#define _POSIX_SYNCHRONIZED_IO 1 -#define _POSIX_TIMERS 1 -#define _POSIX_BARRIERS 200112L -#define _POSIX_READER_WRITER_LOCKS 200112L -#define _POSIX_SPIN_LOCKS 200112L - - -/* In P1003.1b but defined by drafts at least as early as P1003.1c/D10 */ -#define _POSIX_THREADS 1 -#define _POSIX_THREAD_ATTR_STACKADDR 1 -#define _POSIX_THREAD_ATTR_STACKSIZE 1 -#define _POSIX_THREAD_PRIORITY_SCHEDULING 1 -#define _POSIX_THREAD_PRIO_INHERIT 1 -#define _POSIX_THREAD_PRIO_PROTECT 1 -#define _POSIX_THREAD_PROCESS_SHARED 1 -#define _POSIX_THREAD_SAFE_FUNCTIONS 1 - -/* P1003.4b/D8 defines the constants below this comment. */ -#define _POSIX_SPAWN 1 -#define _POSIX_TIMEOUTS 1 -#define _POSIX_CPUTIME 1 -#define _POSIX_THREAD_CPUTIME 1 -#define _POSIX_SPORADIC_SERVER 1 -#define _POSIX_THREAD_SPORADIC_SERVER 1 -#define _POSIX_DEVICE_CONTROL 1 -#define _POSIX_DEVCTL_DIRECTION 1 -#define _POSIX_INTERRUPT_CONTROL 1 -#define _POSIX_ADVISORY_INFO 1 - -/* UNIX98 added some new pthread mutex attributes */ -#define _UNIX98_THREAD_MUTEX_ATTRIBUTES 1 - -#endif - -/* XMK loosely adheres to POSIX -- 1003.1 */ -#ifdef __XMK__ -#define _POSIX_THREADS 1 -#define _POSIX_THREAD_PRIORITY_SCHEDULING 1 -#endif - - -#ifdef __svr4__ -# define _POSIX_JOB_CONTROL 1 -# define _POSIX_SAVED_IDS 1 -# define _POSIX_VERSION 199009L -#endif - -#ifdef __CYGWIN__ - -#if !defined(__STRICT_ANSI__) || defined(__cplusplus) || __STDC_VERSION__ >= 199901L -#define _POSIX_VERSION 200112L -#define _POSIX2_VERSION 200112L -#define _XOPEN_VERSION 600 - -#define _POSIX_ADVISORY_INFO 200112L -/* #define _POSIX_ASYNCHRONOUS_IO -1 */ -/* #define _POSIX_BARRIERS -1 */ -#define _POSIX_CHOWN_RESTRICTED 1 -#define _POSIX_CLOCK_SELECTION 200112L -#define _POSIX_CPUTIME 200112L -#define _POSIX_FSYNC 200112L -#define _POSIX_IPV6 200112L -#define _POSIX_JOB_CONTROL 1 -#define _POSIX_MAPPED_FILES 200112L -/* #define _POSIX_MEMLOCK -1 */ -#define _POSIX_MEMLOCK_RANGE 200112L -#define _POSIX_MEMORY_PROTECTION 200112L -#define _POSIX_MESSAGE_PASSING 200112L -#define _POSIX_MONOTONIC_CLOCK 200112L -#define _POSIX_NO_TRUNC 1 -/* #define _POSIX_PRIORITIZED_IO -1 */ -#define _POSIX_PRIORITY_SCHEDULING 200112L -#define _POSIX_RAW_SOCKETS 200112L -#define _POSIX_READER_WRITER_LOCKS 200112L -#define _POSIX_REALTIME_SIGNALS 200112L -#define _POSIX_REGEXP 1 -#define _POSIX_SAVED_IDS 1 -#define _POSIX_SEMAPHORES 200112L -#define _POSIX_SHARED_MEMORY_OBJECTS 200112L -#define _POSIX_SHELL 1 -/* #define _POSIX_SPAWN -1 */ -#define _POSIX_SPIN_LOCKS 200112L -/* #define _POSIX_SPORADIC_SERVER -1 */ -#define _POSIX_SYNCHRONIZED_IO 200112L -#define _POSIX_THREAD_ATTR_STACKADDR 200112L -#define _POSIX_THREAD_ATTR_STACKSIZE 200112L -#define _POSIX_THREAD_CPUTIME 200112L -/* #define _POSIX_THREAD_PRIO_INHERIT -1 */ -/* #define _POSIX_THREAD_PRIO_PROTECT -1 */ -#define _POSIX_THREAD_PRIORITY_SCHEDULING 200112L -#define _POSIX_THREAD_PROCESS_SHARED 200112L -#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L -/* #define _POSIX_THREAD_SPORADIC_SERVER -1 */ -#define _POSIX_THREADS 200112L -/* #define _POSIX_TIMEOUTS -1 */ -#define _POSIX_TIMERS 1 -/* #define _POSIX_TRACE -1 */ -/* #define _POSIX_TRACE_EVENT_FILTER -1 */ -/* #define _POSIX_TRACE_INHERIT -1 */ -/* #define _POSIX_TRACE_LOG -1 */ -/* #define _POSIX_TYPED_MEMORY_OBJECTS -1 */ -#define _POSIX_VDISABLE '\0' -#define _POSIX2_C_BIND 200112L -#define _POSIX2_C_DEV 200112L -#define _POSIX2_CHAR_TERM 200112L -/* #define _POSIX2_FORT_DEV -1 */ -/* #define _POSIX2_FORT_RUN -1 */ -/* #define _POSIX2_LOCALEDEF -1 */ -/* #define _POSIX2_PBS -1 */ -/* #define _POSIX2_PBS_ACCOUNTING -1 */ -/* #define _POSIX2_PBS_CHECKPOINT -1 */ -/* #define _POSIX2_PBS_LOCATE -1 */ -/* #define _POSIX2_PBS_MESSAGE -1 */ -/* #define _POSIX2_PBS_TRACK -1 */ -#define _POSIX2_SW_DEV 200112L -#define _POSIX2_UPE 200112L -#define _POSIX_V6_ILP32_OFF32 -1 -#ifdef __LP64__ -#define _POSIX_V6_ILP32_OFFBIG -1 -#define _POSIX_V6_LP64_OFF64 1 -#define _POSIX_V6_LPBIG_OFFBIG 1 -#else -#define _POSIX_V6_ILP32_OFFBIG 1 -#define _POSIX_V6_LP64_OFF64 -1 -#define _POSIX_V6_LPBIG_OFFBIG -1 -#endif -#define _XBS5_ILP32_OFF32 _POSIX_V6_ILP32_OFF32 -#define _XBS5_ILP32_OFFBIG _POSIX_V6_ILP32_OFFBIG -#define _XBS5_LP64_OFF64 _POSIX_V6_LP64_OFF64 -#define _XBS5_LPBIG_OFFBIG _POSIX_V6_LPBIG_OFFBIG -#define _XOPEN_CRYPT 1 -#define _XOPEN_ENH_I18N 1 -/* #define _XOPEN_LEGACY -1 */ -/* #define _XOPEN_REALTIME -1 */ -/* #define _XOPEN_REALTIME_THREADS -1 */ -#define _XOPEN_SHM 1 -/* #define _XOPEN_STREAMS -1 */ -/* #define _XOPEN_UNIX -1 */ - -#endif /* !__STRICT_ANSI__ || __cplusplus || __STDC_VERSION__ >= 199901L */ - -/* The value corresponds to UNICODE version 4.0, which is the version - supported by XP. Newlib supports 5.2 (2011) but so far Cygwin needs - the MS conversions for double-byte charsets. */ -#define __STDC_ISO_10646__ 200305L - -#endif /* __CYGWIN__ */ - -/* Per the permission given in POSIX.1-2008 section 2.2.1, define - * _POSIX_C_SOURCE if _XOPEN_SOURCE is defined and _POSIX_C_SOURCE is not. - * (_XOPEN_SOURCE indicates that XSI extensions are desired by an application.) - * This permission is first granted in 2008, but use it for older ones, also. - * Allow for _XOPEN_SOURCE to be empty (from the earliest form of it, before it - * was required to have specific values). - */ -#if !defined(_POSIX_C_SOURCE) && defined(_XOPEN_SOURCE) - #if (_XOPEN_SOURCE - 0) == 700 /* POSIX.1-2008 */ - #define _POSIX_C_SOURCE 200809L - #elif (_XOPEN_SOURCE - 0) == 600 /* POSIX.1-2001 or 2004 */ - #define _POSIX_C_SOURCE 200112L - #elif (_XOPEN_SOURCE - 0) == 500 /* POSIX.1-1995 */ - #define _POSIX_C_SOURCE 199506L - #elif (_XOPEN_SOURCE - 0) < 500 /* really old */ - #define _POSIX_C_SOURCE 2 - #endif -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_FEATURES_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/file.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/file.h deleted file mode 100644 index be88c6a5a..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/file.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Copyright (c) 2005-2006 Tensilica Inc. ALL RIGHTS RESERVED. - - 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. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "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 TENSILICA - INCORPORATED 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. */ - -#include - -/* Alternate names for values for the WHENCE argument to `lseek'. - These are the same as SEEK_SET, SEEK_CUR, and SEEK_END, respectively. */ -#ifndef L_SET -#define L_SET 0 /* Seek from beginning of file. */ -#define L_INCR 1 /* Seek from current position. */ -#define L_XTND 2 /* Seek from end of file. */ -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/iconvnls.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/iconvnls.h deleted file mode 100644 index 09ea18316..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/iconvnls.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2003-2004, Artem B. Bityuckiy. - * Rights transferred to Franklin Electronic Publishers. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - */ - -/* - * Funtions, macros, etc implimented in iconv library but used by other - * NLS-related subsystems too. - */ -#ifndef __SYS_ICONVNLS_H__ -#define __SYS_ICONVNLS_H__ - -#include <_ansi.h> -#include -#include -#include - -/* Iconv data path environment variable name */ -#define NLS_ENVVAR_NAME "NLSPATH" -/* Default NLSPATH value */ -#define ICONV_DEFAULT_NLSPATH "/usr/locale" -/* Direction markers */ -#define ICONV_NLS_FROM 0 -#define ICONV_NLS_TO 1 - -_VOID -_EXFUN(_iconv_nls_get_state, (iconv_t cd, mbstate_t *ps, int direction)); - -int -_EXFUN(_iconv_nls_set_state, (iconv_t cd, mbstate_t *ps, int direction)); - -int -_EXFUN(_iconv_nls_is_stateful, (iconv_t cd, int direction)); - -int -_EXFUN(_iconv_nls_get_mb_cur_max, (iconv_t cd, int direction)); - -size_t -_EXFUN(_iconv_nls_conv, (struct _reent *rptr, iconv_t cd, - _CONST char **inbuf, size_t *inbytesleft, - char **outbuf, size_t *outbytesleft)); - -_CONST char * -_EXFUN(_iconv_nls_construct_filename, (struct _reent *rptr, _CONST char *file, - _CONST char *dir, _CONST char *ext)); - - -int -_EXFUN(_iconv_nls_open, (struct _reent *rptr, _CONST char *encoding, - iconv_t *towc, iconv_t *fromwc, int flag)); - -char * -_EXFUN(_iconv_resolve_encoding_name, (struct _reent *rptr, _CONST char *ca)); - -#endif /* __SYS_ICONVNLS_H__ */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/lock.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/lock.h deleted file mode 100644 index 0ff347583..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/lock.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef _XTENSA_LOCK_H__ -#define _XTENSA_LOCK_H__ - -/* generic lock implementation. - - Weak linked stub _lock functions in lock.c, can be - replaced with a lock implementation at link time. - - */ - -typedef int _lock_t; -typedef _lock_t _LOCK_RECURSIVE_T; -typedef _lock_t _LOCK_T; - -#include <_ansi.h> - -/* NOTE: some parts of newlib statically initialise locks via - __LOCK_INIT, some initialise at runtime via __lock_init. So need to - support possibility that a _lock_t is null during first call to - _lock_acquire or _lock_try_acquire. - - Lock functions all take a pointer to the _lock_t entry, so the - value stored there can be manipulated. -*/ -#define __LOCK_INIT(CLASS,NAME) CLASS _lock_t NAME = 0; -#define __LOCK_INIT_RECURSIVE(CLASS,NAME) CLASS _lock_t NAME = 0; - -void _lock_init(_lock_t *lock); -void _lock_init_recursive(_lock_t *lock); -void _lock_close(_lock_t *lock); -void _lock_close_recursive(_lock_t *lock); -void _lock_acquire(_lock_t *lock); -void _lock_acquire_recursive(_lock_t *lock); -int _lock_try_acquire(_lock_t *lock); -int _lock_try_acquire_recursive(_lock_t *lock); -void _lock_release(_lock_t *lock); -void _lock_release_recursive(_lock_t *lock); - -#define __lock_init(lock) _lock_init(&(lock)) -#define __lock_init_recursive(lock) _lock_init_recursive(&(lock)) -#define __lock_close(lock) _lock_close(&(lock)) -#define __lock_close_recursive(lock) _lock_close_recursive(&(lock)) -#define __lock_acquire(lock) _lock_acquire(&(lock)) -#define __lock_acquire_recursive(lock) _lock_acquire_recursive(&(lock)) -#define __lock_try_acquire(lock) _lock_try_acquire(&(lock)) -#define __lock_try_acquire_recursive(lock) _lock_try_acquire_recursive(&(lock)) -#define __lock_release(lock) _lock_release(&(lock)) -#define __lock_release_recursive(lock) _lock_release_recursive(&(lock)) - -#endif /* _XTENSA_LOCK_H__ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/param.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/param.h deleted file mode 100644 index ef203d3ec..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/param.h +++ /dev/null @@ -1,28 +0,0 @@ -/* This is a dummy file, not customized for any - particular system. If there is a param.h in libc/sys/SYSDIR/sys, - it will override this one. */ - -#ifndef _SYS_PARAM_H -# define _SYS_PARAM_H - -#include -#include -#include -#include - -#ifndef HZ -# define HZ (60) -#endif -#ifndef NOFILE -# define NOFILE (60) -#endif -#ifndef PATHSIZE -# define PATHSIZE (1024) -#endif - -#define MAXPATHLEN PATH_MAX - -#define MAX(a,b) ((a) > (b) ? (a) : (b)) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h deleted file mode 100644 index 9ba444718..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/pgmspace.h +++ /dev/null @@ -1,177 +0,0 @@ -/* PGMSPACE.H - Accessor utilities/types for accessing PROGMEM data */ - -#ifndef _PGMSPACE_H_ -#define _PGMSPACE_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef ICACHE_RODATA_ATTR - #define ICACHE_RODATA_ATTR __attribute__((section(".irom.text"))) -#endif -#ifndef PROGMEM - // The following two macros cause a parameter to be enclosed in quotes - // by the preopressor (i.e. for concatenating ints to strings) - #define __STRINGIZE_NX(A) #A - #define __STRINGIZE(A) __STRINGIZE_NX(A) - // Since __section__ is supposed to be only use for global variables, - // there could be conflicts when a static/inlined function has them in the - // same file as a non-static PROGMEM object. - // Ref: https://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Variable-Attributes.html - // Place each progmem object into its own named section, avoiding conflicts - #define PROGMEM __attribute__((section( "\".irom.text." __FILE__ "." __STRINGIZE(__LINE__) "." __STRINGIZE(__COUNTER__) "\""))) -#endif -#ifndef PGM_P - #define PGM_P const char * -#endif -#ifndef PGM_VOID_P - #define PGM_VOID_P const void * -#endif - -#ifndef PSTR_ALIGN - // PSTR() macro starts by default on a 32-bit boundary. This adds on average - // 1.5 bytes/string, but in return memcpy_P and strcpy_P will work 4~8x faster - // Allow users to override the alignment with PSTR_ALIGN - #define PSTR_ALIGN 4 -#endif -#ifndef PSTRN - // Multi-alignment variant of PSTR, n controls the alignment and should typically be 1 or 4 - // Adapted from AVR-specific code at https://forum.arduino.cc/index.php?topic=194603.0 - // Uses C attribute section instead of ASM block to allow for C language string concatenation ("x" "y" === "xy") - #define PSTRN(s,n) (__extension__({static const char __pstr__[] __attribute__((__aligned__(n))) __attribute__((section( "\".irom0.pstr." __FILE__ "." __STRINGIZE(__LINE__) "." __STRINGIZE(__COUNTER__) "\", \"aSM\", @progbits, 1 #"))) = (s); &__pstr__[0];})) -#endif -#ifndef PSTR - // PSTR() uses the default alignment defined by PSTR_ALIGN - #define PSTR(s) PSTRN(s,PSTR_ALIGN) -#endif -#ifndef PSTR4 - // PSTR4() enforces 4-bytes alignment whatever the value of PSTR_ALIGN - // as required by functions like ets_strlen() or ets_memcpy() - #define PSTR4(s) PSTRN(s,4) -#endif - -// Flash memory must be read using 32 bit aligned addresses else a processor -// exception will be triggered. -// The order within the 32 bit values are: -// -------------- -// b3, b2, b1, b0 -// w1, w0 - -#define pgm_read_with_offset(addr, res) \ - __asm__( \ - "extui\t%0, %1, 0, 2\n\t" /* Extract offset within word (in bytes) */ \ - "sub\t%1, %1, %0\n\t" /* Subtract offset from addr, yielding an aligned address */ \ - "l32i.n\t%1, %1, 0\n\t" /* Load word from aligned address */ \ - "ssa8l\t%0\n\t" /* Prepare to shift by offset (in bits) */ \ - "src\t%0, %1, %1" /* Shift right; now the requested byte is the first one */ \ - : "=r"(res), "+r"(addr)) - -#define pgm_read_dword_with_offset(addr, res) \ - do { \ - uint32_t temp; \ - __asm__( \ - "extui\t%0, %1, 0, 2\n\t" /* Extract offset within word (in bytes) */ \ - "sub\t%1, %1, %0\n\t" /* Subtract offset from addr, yielding an aligned address */ \ - "l32i.n\t%2, %1, 0\n\t" /* Load 2 words */ \ - "l32i.n\t%1, %1, 4\n\t" /* from aligned address */ \ - "ssa8l\t%0\n\t" /* Prepare to shift by offset (in bits) */ \ - "src\t%0, %1, %2" /* Shift right in order to extract the requested dword */ \ - : "=r"(res), "+r"(addr), "=r"(temp)); \ - } while(0) - -static inline uint8_t pgm_read_byte_inlined(const void* addr) { - uint32_t res; - pgm_read_with_offset(addr, res); - return res; /* Implicit cast to uint8_t 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) { - uint32_t res; - pgm_read_with_offset(addr, res); - return res; /* Implicit cast to uint16_t masks the lower half-word from the returned word */ -} - -/* Can't legally cast bits of uint32_t to a float w/o conversion or std::memcpy, which is inefficient. */ -/* The ASM block doesn't care the type, so just pass in what C thinks is a float and return in custom fcn. */ -static inline float pgm_read_float_unaligned(const void* addr) { - float res; - pgm_read_with_offset(addr, res); - return res; -} - -#define pgm_read_byte(addr) pgm_read_byte_inlined(addr) -#define pgm_read_word_aligned(addr) pgm_read_word_inlined(addr) -#ifdef __cplusplus - #define pgm_read_dword_aligned(addr) (*reinterpret_cast(addr)) - #define pgm_read_float_aligned(addr) (*reinterpret_cast(addr)) - #define pgm_read_ptr_aligned(addr) (*reinterpret_cast(addr)) -#else - #define pgm_read_dword_aligned(addr) (*(const uint32_t*)(addr)) - #define pgm_read_float_aligned(addr) (*(const float*)(addr)) - #define pgm_read_ptr_aligned(addr) (*(const void* const*)(addr)) -#endif - -static inline uint32_t pgm_read_dword_unaligned(const void *addr) { - uint32_t res; - pgm_read_dword_with_offset(addr, res); - return res; -} - -#define pgm_read_ptr_unaligned(addr) ((void*)pgm_read_dword_unaligned(addr)) -#define pgm_read_word_unaligned(addr) ((uint16_t)pgm_read_dword_unaligned(addr)) - - -// Allow selection of _aligned or _unaligned, but default to _unaligned for Arduino compatibility -// Add -DPGM_READ_UNALIGNED=0 or "#define PGM_READ_UNALIGNED 0" to code to use aligned-only (faster) macros by default -#ifndef PGM_READ_UNALIGNED - #define PGM_READ_UNALIGNED 1 -#endif - -#if PGM_READ_UNALIGNED - #define pgm_read_word(a) pgm_read_word_unaligned(a) - #define pgm_read_dword(a) pgm_read_dword_unaligned(a) - #define pgm_read_float(a) pgm_read_float_unaligned(a) - #define pgm_read_ptr(a) pgm_read_ptr_unaligned(a) -#else - #define pgm_read_word(a) pgm_read_word_aligned(a) - #define pgm_read_dword(a) pgm_read_dword_aligned(a) - #define pgm_read_float(a) pgm_read_float_aligned(a) - #define pgm_read_ptr(a) pgm_read_ptr_aligned(a) -#endif - -#define pgm_read_byte_near(addr) pgm_read_byte(addr) -#define pgm_read_word_near(addr) pgm_read_word(addr) -#define pgm_read_dword_near(addr) pgm_read_dword(addr) -#define pgm_read_float_near(addr) pgm_read_float(addr) -#define pgm_read_ptr_near(addr) pgm_read_ptr(addr) -#define pgm_read_byte_far(addr) pgm_read_byte(addr) -#define pgm_read_word_far(addr) pgm_read_word(addr) -#define pgm_read_dword_far(addr) pgm_read_dword(addr) -#define pgm_read_float_far(addr) pgm_read_float(addr) -#define pgm_read_ptr_far(addr) pgm_read_ptr(addr) - -#define _SFR_BYTE(n) (n) - -#ifdef __PROG_TYPES_COMPAT__ - -typedef void prog_void; -typedef char prog_char; -typedef unsigned char prog_uchar; -typedef int8_t prog_int8_t; -typedef uint8_t prog_uint8_t; -typedef int16_t prog_int16_t; -typedef uint16_t prog_uint16_t; -typedef int32_t prog_int32_t; -typedef uint32_t prog_uint32_t; - -#endif // defined(__PROG_TYPES_COMPAT__) - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/queue.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/queue.h deleted file mode 100644 index 4bc7dac0e..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/queue.h +++ /dev/null @@ -1,691 +0,0 @@ -/*- - * Copyright (c) 1991, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)queue.h 8.5 (Berkeley) 8/20/94 - * $FreeBSD$ - */ - -#ifndef _SYS_QUEUE_H_ -#define _SYS_QUEUE_H_ - -#include - -/* - * This file defines four types of data structures: singly-linked lists, - * singly-linked tail queues, lists and tail queues. - * - * A singly-linked list is headed by a single forward pointer. The elements - * are singly linked for minimum space and pointer manipulation overhead at - * the expense of O(n) removal for arbitrary elements. New elements can be - * added to the list after an existing element or at the head of the list. - * Elements being removed from the head of the list should use the explicit - * macro for this purpose for optimum efficiency. A singly-linked list may - * only be traversed in the forward direction. Singly-linked lists are ideal - * for applications with large datasets and few or no removals or for - * implementing a LIFO queue. - * - * A singly-linked tail queue is headed by a pair of pointers, one to the - * head of the list and the other to the tail of the list. The elements are - * singly linked for minimum space and pointer manipulation overhead at the - * expense of O(n) removal for arbitrary elements. New elements can be added - * to the list after an existing element, at the head of the list, or at the - * end of the list. Elements being removed from the head of the tail queue - * should use the explicit macro for this purpose for optimum efficiency. - * A singly-linked tail queue may only be traversed in the forward direction. - * Singly-linked tail queues are ideal for applications with large datasets - * and few or no removals or for implementing a FIFO queue. - * - * A list is headed by a single forward pointer (or an array of forward - * pointers for a hash table header). The elements are doubly linked - * so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before - * or after an existing element or at the head of the list. A list - * may be traversed in either direction. - * - * A tail queue is headed by a pair of pointers, one to the head of the - * list and the other to the tail of the list. The elements are doubly - * linked so that an arbitrary element can be removed without a need to - * traverse the list. New elements can be added to the list before or - * after an existing element, at the head of the list, or at the end of - * the list. A tail queue may be traversed in either direction. - * - * For details on the use of these macros, see the queue(3) manual page. - * - * - * SLIST LIST STAILQ TAILQ - * _HEAD + + + + - * _HEAD_INITIALIZER + + + + - * _ENTRY + + + + - * _INIT + + + + - * _EMPTY + + + + - * _FIRST + + + + - * _NEXT + + + + - * _PREV - + - + - * _LAST - - + + - * _FOREACH + + + + - * _FOREACH_SAFE + + + + - * _FOREACH_REVERSE - - - + - * _FOREACH_REVERSE_SAFE - - - + - * _INSERT_HEAD + + + + - * _INSERT_BEFORE - + - + - * _INSERT_AFTER + + + + - * _INSERT_TAIL - - + + - * _CONCAT - - + + - * _REMOVE_AFTER + - + - - * _REMOVE_HEAD + - + - - * _REMOVE + + + + - * _SWAP + + + + - * - */ -#ifdef QUEUE_MACRO_DEBUG -/* Store the last 2 places the queue element or head was altered */ -struct qm_trace { - unsigned long lastline; - unsigned long prevline; - const char *lastfile; - const char *prevfile; -}; - -#define TRACEBUF struct qm_trace trace; -#define TRACEBUF_INITIALIZER { __FILE__, __LINE__, NULL, 0 } , -#define TRASHIT(x) do {(x) = (void *)-1;} while (0) -#define QMD_SAVELINK(name, link) void **name = (void *)&(link) - -#define QMD_TRACE_HEAD(head) do { \ - (head)->trace.prevline = (head)->trace.lastline; \ - (head)->trace.prevfile = (head)->trace.lastfile; \ - (head)->trace.lastline = __LINE__; \ - (head)->trace.lastfile = __FILE__; \ -} while (0) - -#define QMD_TRACE_ELEM(elem) do { \ - (elem)->trace.prevline = (elem)->trace.lastline; \ - (elem)->trace.prevfile = (elem)->trace.lastfile; \ - (elem)->trace.lastline = __LINE__; \ - (elem)->trace.lastfile = __FILE__; \ -} while (0) - -#else -#define QMD_TRACE_ELEM(elem) -#define QMD_TRACE_HEAD(head) -#define QMD_SAVELINK(name, link) -#define TRACEBUF -#define TRACEBUF_INITIALIZER -#define TRASHIT(x) -#endif /* QUEUE_MACRO_DEBUG */ - -/* - * Singly-linked List declarations. - */ -#define SLIST_HEAD(name, type) \ -struct name { \ - struct type *slh_first; /* first element */ \ -} - -#define SLIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define SLIST_ENTRY(type) \ -struct { \ - struct type *sle_next; /* next element */ \ -} - -/* - * Singly-linked List functions. - */ -#define SLIST_EMPTY(head) ((head)->slh_first == NULL) - -#define SLIST_FIRST(head) ((head)->slh_first) - -#define SLIST_FOREACH(var, head, field) \ - for ((var) = SLIST_FIRST((head)); \ - (var); \ - (var) = SLIST_NEXT((var), field)) - -#define SLIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = SLIST_FIRST((head)); \ - (var) && ((tvar) = SLIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \ - for ((varp) = &SLIST_FIRST((head)); \ - ((var) = *(varp)) != NULL; \ - (varp) = &SLIST_NEXT((var), field)) - -#define SLIST_INIT(head) do { \ - SLIST_FIRST((head)) = NULL; \ -} while (0) - -#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \ - SLIST_NEXT((slistelm), field) = (elm); \ -} while (0) - -#define SLIST_INSERT_HEAD(head, elm, field) do { \ - SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \ - SLIST_FIRST((head)) = (elm); \ -} while (0) - -#define SLIST_NEXT(elm, field) ((elm)->field.sle_next) - -#define SLIST_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.sle_next); \ - if (SLIST_FIRST((head)) == (elm)) { \ - SLIST_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = SLIST_FIRST((head)); \ - while (SLIST_NEXT(curelm, field) != (elm)) \ - curelm = SLIST_NEXT(curelm, field); \ - SLIST_REMOVE_AFTER(curelm, field); \ - } \ - TRASHIT(*oldnext); \ -} while (0) - -#define SLIST_REMOVE_AFTER(elm, field) do { \ - SLIST_NEXT(elm, field) = \ - SLIST_NEXT(SLIST_NEXT(elm, field), field); \ -} while (0) - -#define SLIST_REMOVE_HEAD(head, field) do { \ - SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ -} while (0) - -#define SLIST_SWAP(head1, head2, type) do { \ - struct type *swap_first = SLIST_FIRST(head1); \ - SLIST_FIRST(head1) = SLIST_FIRST(head2); \ - SLIST_FIRST(head2) = swap_first; \ -} while (0) - -/* - * Singly-linked Tail queue declarations. - */ -#define STAILQ_HEAD(name, type) \ -struct name { \ - struct type *stqh_first;/* first element */ \ - struct type **stqh_last;/* addr of last next element */ \ -} - -#define STAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).stqh_first } - -#define STAILQ_ENTRY(type) \ -struct { \ - struct type *stqe_next; /* next element */ \ -} - -/* - * Singly-linked Tail queue functions. - */ -#define STAILQ_CONCAT(head1, head2) do { \ - if (!STAILQ_EMPTY((head2))) { \ - *(head1)->stqh_last = (head2)->stqh_first; \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_INIT((head2)); \ - } \ -} while (0) - -#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL) - -#define STAILQ_FIRST(head) ((head)->stqh_first) - -#define STAILQ_FOREACH(var, head, field) \ - for((var) = STAILQ_FIRST((head)); \ - (var); \ - (var) = STAILQ_NEXT((var), field)) - - -#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = STAILQ_FIRST((head)); \ - (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define STAILQ_INIT(head) do { \ - STAILQ_FIRST((head)) = NULL; \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_NEXT((tqelm), field) = (elm); \ -} while (0) - -#define STAILQ_INSERT_HEAD(head, elm, field) do { \ - if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ - STAILQ_FIRST((head)) = (elm); \ -} while (0) - -#define STAILQ_INSERT_TAIL(head, elm, field) do { \ - STAILQ_NEXT((elm), field) = NULL; \ - *(head)->stqh_last = (elm); \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define STAILQ_LAST(head, type, field) \ - (STAILQ_EMPTY((head)) ? NULL : \ - __containerof((head)->stqh_last, struct type, field.stqe_next)) - -#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next) - -#define STAILQ_REMOVE(head, elm, type, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \ - if (STAILQ_FIRST((head)) == (elm)) { \ - STAILQ_REMOVE_HEAD((head), field); \ - } \ - else { \ - struct type *curelm = STAILQ_FIRST((head)); \ - while (STAILQ_NEXT(curelm, field) != (elm)) \ - curelm = STAILQ_NEXT(curelm, field); \ - STAILQ_REMOVE_AFTER(head, curelm, field); \ - } \ - TRASHIT(*oldnext); \ -} while (0) - -#define STAILQ_REMOVE_AFTER(head, elm, field) do { \ - if ((STAILQ_NEXT(elm, field) = \ - STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \ - (head)->stqh_last = &STAILQ_NEXT((elm), field); \ -} while (0) - -#define STAILQ_REMOVE_HEAD(head, field) do { \ - if ((STAILQ_FIRST((head)) = \ - STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \ - if ((STAILQ_FIRST((head)) = STAILQ_NEXT((elm), field)) == NULL) \ - (head)->stqh_last = &STAILQ_FIRST((head)); \ -} while (0) - -#define STAILQ_SWAP(head1, head2, type) do { \ - struct type *swap_first = STAILQ_FIRST(head1); \ - struct type **swap_last = (head1)->stqh_last; \ - STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \ - (head1)->stqh_last = (head2)->stqh_last; \ - STAILQ_FIRST(head2) = swap_first; \ - (head2)->stqh_last = swap_last; \ - if (STAILQ_EMPTY(head1)) \ - (head1)->stqh_last = &STAILQ_FIRST(head1); \ - if (STAILQ_EMPTY(head2)) \ - (head2)->stqh_last = &STAILQ_FIRST(head2); \ -} while (0) - - -/* - * List declarations. - */ -#define LIST_HEAD(name, type) \ -struct name { \ - struct type *lh_first; /* first element */ \ -} - -#define LIST_HEAD_INITIALIZER(head) \ - { NULL } - -#define LIST_ENTRY(type) \ -struct { \ - struct type *le_next; /* next element */ \ - struct type **le_prev; /* address of previous next element */ \ -} - -/* - * List functions. - */ - -#if (defined(_KERNEL) && defined(INVARIANTS)) -#define QMD_LIST_CHECK_HEAD(head, field) do { \ - if (LIST_FIRST((head)) != NULL && \ - LIST_FIRST((head))->field.le_prev != \ - &LIST_FIRST((head))) \ - panic("Bad list head %p first->prev != head", (head)); \ -} while (0) - -#define QMD_LIST_CHECK_NEXT(elm, field) do { \ - if (LIST_NEXT((elm), field) != NULL && \ - LIST_NEXT((elm), field)->field.le_prev != \ - &((elm)->field.le_next)) \ - panic("Bad link elm %p next->prev != elm", (elm)); \ -} while (0) - -#define QMD_LIST_CHECK_PREV(elm, field) do { \ - if (*(elm)->field.le_prev != (elm)) \ - panic("Bad link elm %p prev->next != elm", (elm)); \ -} while (0) -#else -#define QMD_LIST_CHECK_HEAD(head, field) -#define QMD_LIST_CHECK_NEXT(elm, field) -#define QMD_LIST_CHECK_PREV(elm, field) -#endif /* (_KERNEL && INVARIANTS) */ - -#define LIST_EMPTY(head) ((head)->lh_first == NULL) - -#define LIST_FIRST(head) ((head)->lh_first) - -#define LIST_FOREACH(var, head, field) \ - for ((var) = LIST_FIRST((head)); \ - (var); \ - (var) = LIST_NEXT((var), field)) - -#define LIST_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = LIST_FIRST((head)); \ - (var) && ((tvar) = LIST_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define LIST_INIT(head) do { \ - LIST_FIRST((head)) = NULL; \ -} while (0) - -#define LIST_INSERT_AFTER(listelm, elm, field) do { \ - QMD_LIST_CHECK_NEXT(listelm, field); \ - if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\ - LIST_NEXT((listelm), field)->field.le_prev = \ - &LIST_NEXT((elm), field); \ - LIST_NEXT((listelm), field) = (elm); \ - (elm)->field.le_prev = &LIST_NEXT((listelm), field); \ -} while (0) - -#define LIST_INSERT_BEFORE(listelm, elm, field) do { \ - QMD_LIST_CHECK_PREV(listelm, field); \ - (elm)->field.le_prev = (listelm)->field.le_prev; \ - LIST_NEXT((elm), field) = (listelm); \ - *(listelm)->field.le_prev = (elm); \ - (listelm)->field.le_prev = &LIST_NEXT((elm), field); \ -} while (0) - -#define LIST_INSERT_HEAD(head, elm, field) do { \ - QMD_LIST_CHECK_HEAD((head), field); \ - if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \ - LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\ - LIST_FIRST((head)) = (elm); \ - (elm)->field.le_prev = &LIST_FIRST((head)); \ -} while (0) - -#define LIST_NEXT(elm, field) ((elm)->field.le_next) - -#define LIST_PREV(elm, head, type, field) \ - ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \ - __containerof((elm)->field.le_prev, struct type, field.le_next)) - -#define LIST_REMOVE(elm, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.le_next); \ - QMD_SAVELINK(oldprev, (elm)->field.le_prev); \ - QMD_LIST_CHECK_NEXT(elm, field); \ - QMD_LIST_CHECK_PREV(elm, field); \ - if (LIST_NEXT((elm), field) != NULL) \ - LIST_NEXT((elm), field)->field.le_prev = \ - (elm)->field.le_prev; \ - *(elm)->field.le_prev = LIST_NEXT((elm), field); \ - TRASHIT(*oldnext); \ - TRASHIT(*oldprev); \ -} while (0) - -#define LIST_SWAP(head1, head2, type, field) do { \ - struct type *swap_tmp = LIST_FIRST((head1)); \ - LIST_FIRST((head1)) = LIST_FIRST((head2)); \ - LIST_FIRST((head2)) = swap_tmp; \ - if ((swap_tmp = LIST_FIRST((head1))) != NULL) \ - swap_tmp->field.le_prev = &LIST_FIRST((head1)); \ - if ((swap_tmp = LIST_FIRST((head2))) != NULL) \ - swap_tmp->field.le_prev = &LIST_FIRST((head2)); \ -} while (0) - -/* - * Tail queue declarations. - */ -#define TAILQ_HEAD(name, type) \ -struct name { \ - struct type *tqh_first; /* first element */ \ - struct type **tqh_last; /* addr of last next element */ \ - TRACEBUF \ -} - -#define TAILQ_HEAD_INITIALIZER(head) \ - { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER } - -#define TAILQ_ENTRY(type) \ -struct { \ - struct type *tqe_next; /* next element */ \ - struct type **tqe_prev; /* address of previous next element */ \ - TRACEBUF \ -} - -/* - * Tail queue functions. - */ -#if (defined(_KERNEL) && defined(INVARIANTS)) -#define QMD_TAILQ_CHECK_HEAD(head, field) do { \ - if (!TAILQ_EMPTY(head) && \ - TAILQ_FIRST((head))->field.tqe_prev != \ - &TAILQ_FIRST((head))) \ - panic("Bad tailq head %p first->prev != head", (head)); \ -} while (0) - -#define QMD_TAILQ_CHECK_TAIL(head, field) do { \ - if (*(head)->tqh_last != NULL) \ - panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \ -} while (0) - -#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \ - if (TAILQ_NEXT((elm), field) != NULL && \ - TAILQ_NEXT((elm), field)->field.tqe_prev != \ - &((elm)->field.tqe_next)) \ - panic("Bad link elm %p next->prev != elm", (elm)); \ -} while (0) - -#define QMD_TAILQ_CHECK_PREV(elm, field) do { \ - if (*(elm)->field.tqe_prev != (elm)) \ - panic("Bad link elm %p prev->next != elm", (elm)); \ -} while (0) -#else -#define QMD_TAILQ_CHECK_HEAD(head, field) -#define QMD_TAILQ_CHECK_TAIL(head, headname) -#define QMD_TAILQ_CHECK_NEXT(elm, field) -#define QMD_TAILQ_CHECK_PREV(elm, field) -#endif /* (_KERNEL && INVARIANTS) */ - -#define TAILQ_CONCAT(head1, head2, field) do { \ - if (!TAILQ_EMPTY(head2)) { \ - *(head1)->tqh_last = (head2)->tqh_first; \ - (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \ - (head1)->tqh_last = (head2)->tqh_last; \ - TAILQ_INIT((head2)); \ - QMD_TRACE_HEAD(head1); \ - QMD_TRACE_HEAD(head2); \ - } \ -} while (0) - -#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL) - -#define TAILQ_FIRST(head) ((head)->tqh_first) - -#define TAILQ_FOREACH(var, head, field) \ - for ((var) = TAILQ_FIRST((head)); \ - (var); \ - (var) = TAILQ_NEXT((var), field)) - -#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \ - for ((var) = TAILQ_FIRST((head)); \ - (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \ - (var) = (tvar)) - -#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var); \ - (var) = TAILQ_PREV((var), headname, field)) - -#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \ - for ((var) = TAILQ_LAST((head), headname); \ - (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \ - (var) = (tvar)) - -#define TAILQ_INIT(head) do { \ - TAILQ_FIRST((head)) = NULL; \ - (head)->tqh_last = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ -} while (0) - -#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \ - QMD_TAILQ_CHECK_NEXT(listelm, field); \ - if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else { \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - } \ - TAILQ_NEXT((listelm), field) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \ - QMD_TAILQ_CHECK_PREV(listelm, field); \ - (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \ - TAILQ_NEXT((elm), field) = (listelm); \ - *(listelm)->field.tqe_prev = (elm); \ - (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_ELEM(&(elm)->field); \ - QMD_TRACE_ELEM(&listelm->field); \ -} while (0) - -#define TAILQ_INSERT_HEAD(head, elm, field) do { \ - QMD_TAILQ_CHECK_HEAD(head, field); \ - if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \ - TAILQ_FIRST((head))->field.tqe_prev = \ - &TAILQ_NEXT((elm), field); \ - else \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - TAILQ_FIRST((head)) = (elm); \ - (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_INSERT_TAIL(head, elm, field) do { \ - QMD_TAILQ_CHECK_TAIL(head, field); \ - TAILQ_NEXT((elm), field) = NULL; \ - (elm)->field.tqe_prev = (head)->tqh_last; \ - *(head)->tqh_last = (elm); \ - (head)->tqh_last = &TAILQ_NEXT((elm), field); \ - QMD_TRACE_HEAD(head); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_LAST(head, headname) \ - (*(((struct headname *)((head)->tqh_last))->tqh_last)) - -#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next) - -#define TAILQ_PREV(elm, headname, field) \ - (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last)) - -#define TAILQ_REMOVE(head, elm, field) do { \ - QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \ - QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \ - QMD_TAILQ_CHECK_NEXT(elm, field); \ - QMD_TAILQ_CHECK_PREV(elm, field); \ - if ((TAILQ_NEXT((elm), field)) != NULL) \ - TAILQ_NEXT((elm), field)->field.tqe_prev = \ - (elm)->field.tqe_prev; \ - else { \ - (head)->tqh_last = (elm)->field.tqe_prev; \ - QMD_TRACE_HEAD(head); \ - } \ - *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \ - TRASHIT(*oldnext); \ - TRASHIT(*oldprev); \ - QMD_TRACE_ELEM(&(elm)->field); \ -} while (0) - -#define TAILQ_SWAP(head1, head2, type, field) do { \ - struct type *swap_first = (head1)->tqh_first; \ - struct type **swap_last = (head1)->tqh_last; \ - (head1)->tqh_first = (head2)->tqh_first; \ - (head1)->tqh_last = (head2)->tqh_last; \ - (head2)->tqh_first = swap_first; \ - (head2)->tqh_last = swap_last; \ - if ((swap_first = (head1)->tqh_first) != NULL) \ - swap_first->field.tqe_prev = &(head1)->tqh_first; \ - else \ - (head1)->tqh_last = &(head1)->tqh_first; \ - if ((swap_first = (head2)->tqh_first) != NULL) \ - swap_first->field.tqe_prev = &(head2)->tqh_first; \ - else \ - (head2)->tqh_last = &(head2)->tqh_first; \ -} while (0) - -#ifdef _KERNEL - -/* - * XXX insque() and remque() are an old way of handling certain queues. - * They bogusly assumes that all queue heads look alike. - */ - -struct quehead { - struct quehead *qh_link; - struct quehead *qh_rlink; -}; - -#ifdef __GNUC__ - -static __inline void -insque(void *a, void *b) -{ - struct quehead *element = (struct quehead *)a, - *head = (struct quehead *)b; - - element->qh_link = head->qh_link; - element->qh_rlink = head; - head->qh_link = element; - element->qh_link->qh_rlink = element; -} - -static __inline void -remque(void *a) -{ - struct quehead *element = (struct quehead *)a; - - element->qh_link->qh_rlink = element->qh_rlink; - element->qh_rlink->qh_link = element->qh_link; - element->qh_rlink = 0; -} - -#else /* !__GNUC__ */ - -void insque(void *a, void *b); -void remque(void *a); - -#endif /* __GNUC__ */ - -#endif /* _KERNEL */ - -#endif /* !_SYS_QUEUE_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h deleted file mode 100644 index 37ab5b6e8..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/reent.h +++ /dev/null @@ -1,790 +0,0 @@ -/* This header file provides the reentrancy. */ - -/* WARNING: All identifiers here must begin with an underscore. This file is - included by stdio.h and others and we therefore must only use identifiers - in the namespace allotted to us. */ - -#ifndef _SYS_REENT_H_ -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS_REENT_H_ - -#include <_ansi.h> -#include -#include - -#define _NULL 0 - -#ifndef __Long -#if __LONG_MAX__ == 2147483647L -#define __Long long -typedef unsigned __Long __ULong; -#elif __INT_MAX__ == 2147483647 -#define __Long int -typedef unsigned __Long __ULong; -#endif -#endif - -#if !defined( __Long) -#include -#endif - -#ifndef __Long -#define __Long __int32_t -typedef __uint32_t __ULong; -#endif - -struct _reent; - -/* - * If _REENT_SMALL is defined, we make struct _reent as small as possible, - * by having nearly everything possible allocated at first use. - */ - -struct _Bigint -{ - struct _Bigint *_next; - int _k, _maxwds, _sign, _wds; - __ULong _x[1]; -}; - -/* needed by reentrant structure */ -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; -}; - -/* - * atexit() support. - */ - -#define _ATEXIT_SIZE 32 /* must be at least 32 to guarantee ANSI conformance */ - -struct _on_exit_args { - void * _fnargs[_ATEXIT_SIZE]; /* user fn args */ - void * _dso_handle[_ATEXIT_SIZE]; - /* Bitmask is set if user function takes arguments. */ - __ULong _fntypes; /* type of exit routine - - Must have at least _ATEXIT_SIZE bits */ - /* Bitmask is set if function was registered via __cxa_atexit. */ - __ULong _is_cxa; -}; - -#ifdef _REENT_SMALL -struct _atexit { - struct _atexit *_next; /* next in list */ - int _ind; /* next index in this table */ - void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */ - struct _on_exit_args * _on_exit_args_ptr; -}; -# define _ATEXIT_INIT {_NULL, 0, {_NULL}, _NULL} -#else -struct _atexit { - struct _atexit *_next; /* next in list */ - int _ind; /* next index in this table */ - /* Some entries may already have been called, and will be NULL. */ - void (*_fns[_ATEXIT_SIZE])(void); /* the table itself */ - struct _on_exit_args _on_exit_args; -}; -# define _ATEXIT_INIT {_NULL, 0, {_NULL}, {{_NULL}, {_NULL}, 0, 0}} -#endif - -#ifdef _REENT_GLOBAL_ATEXIT -# define _REENT_INIT_ATEXIT -#else -# define _REENT_INIT_ATEXIT \ - _NULL, _ATEXIT_INIT, -#endif - -/* - * Stdio buffers. - * - * This and __FILE are defined here because we need them for struct _reent, - * but we don't want stdio.h included when stdlib.h is. - */ - -struct __sbuf { - unsigned char *_base; - int _size; -}; - -/* - * Stdio state variables. - * - * The following always hold: - * - * if (_flags&(__SLBF|__SWR)) == (__SLBF|__SWR), - * _lbfsize is -_bf._size, else _lbfsize is 0 - * if _flags&__SRD, _w is 0 - * if _flags&__SWR, _r is 0 - * - * This ensures that the getc and putc macros (or inline functions) never - * try to write or read from a file that is in `read' or `write' mode. - * (Moreover, they can, and do, automatically switch from read mode to - * write mode, and back, on "r+" and "w+" files.) - * - * _lbfsize is used only to make the inline line-buffered output stream - * code as compact as possible. - * - * _ub, _up, and _ur are used when ungetc() pushes back more characters - * than fit in the current _bf, or when ungetc() pushes back a character - * that does not match the previous one in _bf. When this happens, - * _ub._base becomes non-nil (i.e., a stream has ungetc() data iff - * _ub._base!=NULL) and _up and _ur save the current values of _p and _r. - */ - -#ifdef _REENT_SMALL -/* - * struct __sFILE_fake is the start of a struct __sFILE, with only the - * minimal fields allocated. In __sinit() we really allocate the 3 - * standard streams, etc., and point away from this fake. - */ -struct __sFILE_fake { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - - struct _reent *_data; -}; - -/* Following is needed both in libc/stdio and libc/stdlib so we put it - * here instead of libc/stdio/local.h where it was previously. */ - -extern _VOID _EXFUN(__sinit,(struct _reent *)); - -# define _REENT_SMALL_CHECK_INIT(ptr) \ - do \ - { \ - if ((ptr) && !(ptr)->__sdidinit) \ - __sinit (ptr); \ - } \ - while (0) -#else -# define _REENT_SMALL_CHECK_INIT(ptr) /* nothing */ -#endif - -struct __sFILE { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - -#ifdef _REENT_SMALL - struct _reent *_data; -#endif - - /* operations */ - _PTR _cookie; /* cookie passed to io functions */ - - _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR, - char *, _READ_WRITE_BUFSIZE_TYPE)); - _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, _PTR, - const char *, - _READ_WRITE_BUFSIZE_TYPE)); - _fpos_t _EXFNPTR(_seek, (struct _reent *, _PTR, _fpos_t, int)); - int _EXFNPTR(_close, (struct _reent *, _PTR)); - - /* separate buffer for long sequences of ungetc() */ - struct __sbuf _ub; /* ungetc buffer */ - unsigned char *_up; /* saved _p when _p is doing ungetc data */ - int _ur; /* saved _r when _r is counting ungetc data */ - - /* tricks to meet minimum requirements even when malloc() fails */ - unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ - unsigned char _nbuf[1]; /* guarantee a getc() buffer */ - - /* separate buffer for fgetline() when line crosses buffer boundary */ - struct __sbuf _lb; /* buffer for fgetline() */ - - /* Unix stdio files get aligned to block boundaries on fseek() */ - int _blksize; /* stat.st_blksize (may be != _bf._size) */ - _off_t _offset; /* current lseek offset */ - -#ifndef _REENT_SMALL - struct _reent *_data; /* Here for binary compatibility? Remove? */ -#endif - -#ifndef __SINGLE_THREAD__ - _flock_t _lock; /* for thread-safety locking */ -#endif - _mbstate_t _mbstate; /* for wide char stdio functions. */ - int _flags2; /* for future use */ -}; - -#ifdef __CUSTOM_FILE_IO__ - -/* Get custom _FILE definition. */ -#include - -#else /* !__CUSTOM_FILE_IO__ */ -#ifdef __LARGE64_FILES -struct __sFILE64 { - unsigned char *_p; /* current position in (some) buffer */ - int _r; /* read space left for getc() */ - int _w; /* write space left for putc() */ - short _flags; /* flags, below; this FILE is free if 0 */ - short _file; /* fileno, if Unix descriptor, else -1 */ - struct __sbuf _bf; /* the buffer (at least 1 byte, if !NULL) */ - int _lbfsize; /* 0 or -_bf._size, for inline putc */ - - struct _reent *_data; - - /* operations */ - _PTR _cookie; /* cookie passed to io functions */ - - _READ_WRITE_RETURN_TYPE _EXFNPTR(_read, (struct _reent *, _PTR, - char *, _READ_WRITE_BUFSIZE_TYPE)); - _READ_WRITE_RETURN_TYPE _EXFNPTR(_write, (struct _reent *, _PTR, - const char *, - _READ_WRITE_BUFSIZE_TYPE)); - _fpos_t _EXFNPTR(_seek, (struct _reent *, _PTR, _fpos_t, int)); - int _EXFNPTR(_close, (struct _reent *, _PTR)); - - /* separate buffer for long sequences of ungetc() */ - struct __sbuf _ub; /* ungetc buffer */ - unsigned char *_up; /* saved _p when _p is doing ungetc data */ - int _ur; /* saved _r when _r is counting ungetc data */ - - /* tricks to meet minimum requirements even when malloc() fails */ - unsigned char _ubuf[3]; /* guarantee an ungetc() buffer */ - unsigned char _nbuf[1]; /* guarantee a getc() buffer */ - - /* separate buffer for fgetline() when line crosses buffer boundary */ - struct __sbuf _lb; /* buffer for fgetline() */ - - /* Unix stdio files get aligned to block boundaries on fseek() */ - int _blksize; /* stat.st_blksize (may be != _bf._size) */ - int _flags2; /* for future use */ - - _off64_t _offset; /* current lseek offset */ - _fpos64_t _EXFNPTR(_seek64, (struct _reent *, _PTR, _fpos64_t, int)); - -#ifndef __SINGLE_THREAD__ - _flock_t _lock; /* for thread-safety locking */ -#endif - _mbstate_t _mbstate; /* for wide char stdio functions. */ -}; -typedef struct __sFILE64 __FILE; -#else -typedef struct __sFILE __FILE; -#endif /* __LARGE64_FILES */ -#endif /* !__CUSTOM_FILE_IO__ */ - -struct _glue -{ - struct _glue *_next; - int _niobs; - __FILE *_iobs; -}; - -/* - * rand48 family support - * - * Copyright (c) 1993 Martin Birgmeier - * All rights reserved. - * - * You may redistribute unmodified or modified versions of this source - * code provided that the above copyright notice and this and the - * following conditions are retained. - * - * This software is provided ``as is'', and comes with no warranties - * of any kind. I shall in no event be liable for anything that happens - * to anyone/anything when using this software. - */ -#define _RAND48_SEED_0 (0x330e) -#define _RAND48_SEED_1 (0xabcd) -#define _RAND48_SEED_2 (0x1234) -#define _RAND48_MULT_0 (0xe66d) -#define _RAND48_MULT_1 (0xdeec) -#define _RAND48_MULT_2 (0x0005) -#define _RAND48_ADD (0x000b) -struct _rand48 { - unsigned short _seed[3]; - unsigned short _mult[3]; - unsigned short _add; -#ifdef _REENT_SMALL - /* Put this in here as well, for good luck. */ - __extension__ unsigned long long _rand_next; -#endif -}; - -/* How big the some arrays are. */ -#define _REENT_EMERGENCY_SIZE 25 -#define _REENT_ASCTIME_SIZE 26 -#define _REENT_SIGNAL_SIZE 24 - -/* - * struct _reent - * - * This structure contains *all* globals needed by the library. - * It's raison d'etre is to facilitate threads by making all library routines - * reentrant. IE: All state information is contained here. - */ - -#ifdef _REENT_SMALL - -struct _mprec -{ - /* used by mprec routines */ - struct _Bigint *_result; - int _result_k; - struct _Bigint *_p5s; - struct _Bigint **_freelist; -}; - - -struct _misc_reent -{ - /* miscellaneous reentrant data */ - char *_strtok_last; - _mbstate_t _mblen_state; - _mbstate_t _wctomb_state; - _mbstate_t _mbtowc_state; - char _l64a_buf[8]; - int _getdate_err; - _mbstate_t _mbrlen_state; - _mbstate_t _mbrtowc_state; - _mbstate_t _mbsrtowcs_state; - _mbstate_t _wcrtomb_state; - _mbstate_t _wcsrtombs_state; -}; - -/* This version of _reent is laid out with "int"s in pairs, to help - * ports with 16-bit int's but 32-bit pointers, align nicely. */ -struct _reent -{ - /* As an exception to the above put _errno first for binary - compatibility with non _REENT_SMALL targets. */ - int _errno; /* local copy of errno */ - - /* FILE is a big struct and may change over time. To try to achieve binary - compatibility with future versions, put stdin,stdout,stderr here. - These are pointers into member __sf defined below. */ - __FILE *_stdin, *_stdout, *_stderr; /* XXX */ - - int _inc; /* used by tmpnam */ - - char *_emergency; - - int __sdidinit; /* 1 means stdio has been init'd */ - - int _current_category; /* unused */ - _CONST char *_current_locale; /* unused */ - - struct _mprec *_mp; - - void _EXFNPTR(__cleanup, (struct _reent *)); - - int _gamma_signgam; - - /* used by some fp conversion routines */ - int _cvtlen; /* should be size_t */ - char *_cvtbuf; - - struct _rand48 *_r48; - struct __tm *_localtime_buf; - char *_asctime_buf; - - /* signal info */ - void (**_sig_func)(int); - -# ifndef _REENT_GLOBAL_ATEXIT - /* atexit stuff */ - struct _atexit *_atexit; - struct _atexit _atexit0; -# endif - - struct _glue __sglue; /* root of glue chain */ - __FILE *__sf; /* file descriptors */ - struct _misc_reent *_misc; /* strtok, multibyte states */ - char *_signal_buf; /* strsignal */ -}; - -extern const struct __sFILE_fake __sf_fake_stdin; -extern const struct __sFILE_fake __sf_fake_stdout; -extern const struct __sFILE_fake __sf_fake_stderr; - -# define _REENT_INIT(var) \ - { 0, \ - (__FILE *)&__sf_fake_stdin, \ - (__FILE *)&__sf_fake_stdout, \ - (__FILE *)&__sf_fake_stderr, \ - 0, \ - _NULL, \ - 0, \ - 0, \ - "C", \ - _NULL, \ - _NULL, \ - 0, \ - 0, \ - _NULL, \ - _NULL, \ - _NULL, \ - _NULL, \ - _NULL, \ - _REENT_INIT_ATEXIT \ - {_NULL, 0, _NULL}, \ - _NULL, \ - _NULL, \ - _NULL \ - } - -#define _REENT_INIT_PTR(var) \ - { memset((var), 0, sizeof(*(var))); \ - (var)->_stdin = (__FILE *)&__sf_fake_stdin; \ - (var)->_stdout = (__FILE *)&__sf_fake_stdout; \ - (var)->_stderr = (__FILE *)&__sf_fake_stderr; \ - (var)->_current_locale = "C"; \ - } - -/* Only built the assert() calls if we are built with debugging. */ -#if DEBUG -#include -#define __reent_assert(x) assert(x) -#else -#define __reent_assert(x) ((void)0) -#endif - -#ifdef __CUSTOM_FILE_IO__ -#error Custom FILE I/O and _REENT_SMALL not currently supported. -#endif - -/* Generic _REENT check macro. */ -#define _REENT_CHECK(var, what, type, size, init) do { \ - struct _reent *_r = (var); \ - if (_r->what == NULL) { \ - _r->what = (type)malloc(size); \ - __reent_assert(_r->what); \ - init; \ - } \ -} while (0) - -#define _REENT_CHECK_TM(var) \ - _REENT_CHECK(var, _localtime_buf, struct __tm *, sizeof *((var)->_localtime_buf), \ - /* nothing */) - -#define _REENT_CHECK_ASCTIME_BUF(var) \ - _REENT_CHECK(var, _asctime_buf, char *, _REENT_ASCTIME_SIZE, \ - memset((var)->_asctime_buf, 0, _REENT_ASCTIME_SIZE)) - -/* Handle the dynamically allocated rand48 structure. */ -#define _REENT_INIT_RAND48(var) do { \ - struct _reent *_r = (var); \ - _r->_r48->_seed[0] = _RAND48_SEED_0; \ - _r->_r48->_seed[1] = _RAND48_SEED_1; \ - _r->_r48->_seed[2] = _RAND48_SEED_2; \ - _r->_r48->_mult[0] = _RAND48_MULT_0; \ - _r->_r48->_mult[1] = _RAND48_MULT_1; \ - _r->_r48->_mult[2] = _RAND48_MULT_2; \ - _r->_r48->_add = _RAND48_ADD; \ - _r->_r48->_rand_next = 1; \ -} while (0) -#define _REENT_CHECK_RAND48(var) \ - _REENT_CHECK(var, _r48, struct _rand48 *, sizeof *((var)->_r48), _REENT_INIT_RAND48((var))) - -#define _REENT_INIT_MP(var) do { \ - struct _reent *_r = (var); \ - _r->_mp->_result_k = 0; \ - _r->_mp->_result = _r->_mp->_p5s = _NULL; \ - _r->_mp->_freelist = _NULL; \ -} while (0) -#define _REENT_CHECK_MP(var) \ - _REENT_CHECK(var, _mp, struct _mprec *, sizeof *((var)->_mp), _REENT_INIT_MP(var)) - -#define _REENT_CHECK_EMERGENCY(var) \ - _REENT_CHECK(var, _emergency, char *, _REENT_EMERGENCY_SIZE, /* nothing */) - -#define _REENT_INIT_MISC(var) do { \ - struct _reent *_r = (var); \ - _r->_misc->_strtok_last = _NULL; \ - _r->_misc->_mblen_state.__count = 0; \ - _r->_misc->_mblen_state.__value.__wch = 0; \ - _r->_misc->_wctomb_state.__count = 0; \ - _r->_misc->_wctomb_state.__value.__wch = 0; \ - _r->_misc->_mbtowc_state.__count = 0; \ - _r->_misc->_mbtowc_state.__value.__wch = 0; \ - _r->_misc->_mbrlen_state.__count = 0; \ - _r->_misc->_mbrlen_state.__value.__wch = 0; \ - _r->_misc->_mbrtowc_state.__count = 0; \ - _r->_misc->_mbrtowc_state.__value.__wch = 0; \ - _r->_misc->_mbsrtowcs_state.__count = 0; \ - _r->_misc->_mbsrtowcs_state.__value.__wch = 0; \ - _r->_misc->_wcrtomb_state.__count = 0; \ - _r->_misc->_wcrtomb_state.__value.__wch = 0; \ - _r->_misc->_wcsrtombs_state.__count = 0; \ - _r->_misc->_wcsrtombs_state.__value.__wch = 0; \ - _r->_misc->_l64a_buf[0] = '\0'; \ - _r->_misc->_getdate_err = 0; \ -} while (0) -#define _REENT_CHECK_MISC(var) \ - _REENT_CHECK(var, _misc, struct _misc_reent *, sizeof *((var)->_misc), _REENT_INIT_MISC(var)) - -#define _REENT_CHECK_SIGNAL_BUF(var) \ - _REENT_CHECK(var, _signal_buf, char *, _REENT_SIGNAL_SIZE, /* nothing */) - -#define _REENT_SIGNGAM(ptr) ((ptr)->_gamma_signgam) -#define _REENT_RAND_NEXT(ptr) ((ptr)->_r48->_rand_next) -#define _REENT_RAND48_SEED(ptr) ((ptr)->_r48->_seed) -#define _REENT_RAND48_MULT(ptr) ((ptr)->_r48->_mult) -#define _REENT_RAND48_ADD(ptr) ((ptr)->_r48->_add) -#define _REENT_MP_RESULT(ptr) ((ptr)->_mp->_result) -#define _REENT_MP_RESULT_K(ptr) ((ptr)->_mp->_result_k) -#define _REENT_MP_P5S(ptr) ((ptr)->_mp->_p5s) -#define _REENT_MP_FREELIST(ptr) ((ptr)->_mp->_freelist) -#define _REENT_ASCTIME_BUF(ptr) ((ptr)->_asctime_buf) -#define _REENT_TM(ptr) ((ptr)->_localtime_buf) -#define _REENT_EMERGENCY(ptr) ((ptr)->_emergency) -#define _REENT_STRTOK_LAST(ptr) ((ptr)->_misc->_strtok_last) -#define _REENT_MBLEN_STATE(ptr) ((ptr)->_misc->_mblen_state) -#define _REENT_MBTOWC_STATE(ptr)((ptr)->_misc->_mbtowc_state) -#define _REENT_WCTOMB_STATE(ptr)((ptr)->_misc->_wctomb_state) -#define _REENT_MBRLEN_STATE(ptr) ((ptr)->_misc->_mbrlen_state) -#define _REENT_MBRTOWC_STATE(ptr) ((ptr)->_misc->_mbrtowc_state) -#define _REENT_MBSRTOWCS_STATE(ptr) ((ptr)->_misc->_mbsrtowcs_state) -#define _REENT_WCRTOMB_STATE(ptr) ((ptr)->_misc->_wcrtomb_state) -#define _REENT_WCSRTOMBS_STATE(ptr) ((ptr)->_misc->_wcsrtombs_state) -#define _REENT_L64A_BUF(ptr) ((ptr)->_misc->_l64a_buf) -#define _REENT_GETDATE_ERR_P(ptr) (&((ptr)->_misc->_getdate_err)) -#define _REENT_SIGNAL_BUF(ptr) ((ptr)->_signal_buf) - -#else /* !_REENT_SMALL */ - -struct _reent -{ - int _errno; /* local copy of errno */ - - /* FILE is a big struct and may change over time. To try to achieve binary - compatibility with future versions, put stdin,stdout,stderr here. - These are pointers into member __sf defined below. */ - __FILE *_stdin, *_stdout, *_stderr; - - int _inc; /* used by tmpnam */ - char _emergency[_REENT_EMERGENCY_SIZE]; - - int _current_category; /* used by setlocale */ - _CONST char *_current_locale; - - int __sdidinit; /* 1 means stdio has been init'd */ - - void _EXFNPTR(__cleanup, (struct _reent *)); - - /* used by mprec routines */ - struct _Bigint *_result; - int _result_k; - struct _Bigint *_p5s; - struct _Bigint **_freelist; - - /* used by some fp conversion routines */ - int _cvtlen; /* should be size_t */ - char *_cvtbuf; - - union - { - struct - { - unsigned int _unused_rand; - char * _strtok_last; - char _asctime_buf[_REENT_ASCTIME_SIZE]; - struct __tm _localtime_buf; - int _gamma_signgam; - __extension__ unsigned long long _rand_next; - struct _rand48 _r48; - _mbstate_t _mblen_state; - _mbstate_t _mbtowc_state; - _mbstate_t _wctomb_state; - char _l64a_buf[8]; - char _signal_buf[_REENT_SIGNAL_SIZE]; - int _getdate_err; - _mbstate_t _mbrlen_state; - _mbstate_t _mbrtowc_state; - _mbstate_t _mbsrtowcs_state; - _mbstate_t _wcrtomb_state; - _mbstate_t _wcsrtombs_state; - int _h_errno; - } _reent; - /* Two next two fields were once used by malloc. They are no longer - used. They are used to preserve the space used before so as to - allow addition of new reent fields and keep binary compatibility. */ - struct - { -#define _N_LISTS 30 - unsigned char * _nextf[_N_LISTS]; - unsigned int _nmalloc[_N_LISTS]; - } _unused; - } _new; - -# ifndef _REENT_GLOBAL_ATEXIT - /* atexit stuff */ - struct _atexit *_atexit; /* points to head of LIFO stack */ - struct _atexit _atexit0; /* one guaranteed table, required by ANSI */ -# endif - - /* signal info */ - void (**(_sig_func))(int); - - /* These are here last so that __FILE can grow without changing the offsets - of the above members (on the off chance that future binary compatibility - would be broken otherwise). */ - struct _glue __sglue; /* root of glue chain */ - __FILE __sf[3]; /* first three file descriptors */ -}; - -#define _REENT_INIT(var) \ - { 0, \ - &(var).__sf[0], \ - &(var).__sf[1], \ - &(var).__sf[2], \ - 0, \ - "", \ - 0, \ - "C", \ - 0, \ - _NULL, \ - _NULL, \ - 0, \ - _NULL, \ - _NULL, \ - 0, \ - _NULL, \ - { \ - { \ - 0, \ - _NULL, \ - "", \ - {0, 0, 0, 0, 0, 0, 0, 0, 0}, \ - 0, \ - 1, \ - { \ - {_RAND48_SEED_0, _RAND48_SEED_1, _RAND48_SEED_2}, \ - {_RAND48_MULT_0, _RAND48_MULT_1, _RAND48_MULT_2}, \ - _RAND48_ADD \ - }, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}}, \ - "", \ - "", \ - 0, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}}, \ - {0, {0}} \ - } \ - }, \ - _REENT_INIT_ATEXIT \ - _NULL, \ - {_NULL, 0, _NULL} \ - } - -#define _REENT_INIT_PTR(var) \ - { memset((var), 0, sizeof(*(var))); \ - (var)->_stdin = &(var)->__sf[0]; \ - (var)->_stdout = &(var)->__sf[1]; \ - (var)->_stderr = &(var)->__sf[2]; \ - (var)->_current_locale = "C"; \ - (var)->_new._reent._rand_next = 1; \ - (var)->_new._reent._r48._seed[0] = _RAND48_SEED_0; \ - (var)->_new._reent._r48._seed[1] = _RAND48_SEED_1; \ - (var)->_new._reent._r48._seed[2] = _RAND48_SEED_2; \ - (var)->_new._reent._r48._mult[0] = _RAND48_MULT_0; \ - (var)->_new._reent._r48._mult[1] = _RAND48_MULT_1; \ - (var)->_new._reent._r48._mult[2] = _RAND48_MULT_2; \ - (var)->_new._reent._r48._add = _RAND48_ADD; \ - } - -#define _REENT_CHECK_RAND48(ptr) /* nothing */ -#define _REENT_CHECK_MP(ptr) /* nothing */ -#define _REENT_CHECK_TM(ptr) /* nothing */ -#define _REENT_CHECK_ASCTIME_BUF(ptr) /* nothing */ -#define _REENT_CHECK_EMERGENCY(ptr) /* nothing */ -#define _REENT_CHECK_MISC(ptr) /* nothing */ -#define _REENT_CHECK_SIGNAL_BUF(ptr) /* nothing */ - -#define _REENT_SIGNGAM(ptr) ((ptr)->_new._reent._gamma_signgam) -#define _REENT_RAND_NEXT(ptr) ((ptr)->_new._reent._rand_next) -#define _REENT_RAND48_SEED(ptr) ((ptr)->_new._reent._r48._seed) -#define _REENT_RAND48_MULT(ptr) ((ptr)->_new._reent._r48._mult) -#define _REENT_RAND48_ADD(ptr) ((ptr)->_new._reent._r48._add) -#define _REENT_MP_RESULT(ptr) ((ptr)->_result) -#define _REENT_MP_RESULT_K(ptr) ((ptr)->_result_k) -#define _REENT_MP_P5S(ptr) ((ptr)->_p5s) -#define _REENT_MP_FREELIST(ptr) ((ptr)->_freelist) -#define _REENT_ASCTIME_BUF(ptr) ((ptr)->_new._reent._asctime_buf) -#define _REENT_TM(ptr) (&(ptr)->_new._reent._localtime_buf) -#define _REENT_EMERGENCY(ptr) ((ptr)->_emergency) -#define _REENT_STRTOK_LAST(ptr) ((ptr)->_new._reent._strtok_last) -#define _REENT_MBLEN_STATE(ptr) ((ptr)->_new._reent._mblen_state) -#define _REENT_MBTOWC_STATE(ptr)((ptr)->_new._reent._mbtowc_state) -#define _REENT_WCTOMB_STATE(ptr)((ptr)->_new._reent._wctomb_state) -#define _REENT_MBRLEN_STATE(ptr)((ptr)->_new._reent._mbrlen_state) -#define _REENT_MBRTOWC_STATE(ptr)((ptr)->_new._reent._mbrtowc_state) -#define _REENT_MBSRTOWCS_STATE(ptr)((ptr)->_new._reent._mbsrtowcs_state) -#define _REENT_WCRTOMB_STATE(ptr)((ptr)->_new._reent._wcrtomb_state) -#define _REENT_WCSRTOMBS_STATE(ptr)((ptr)->_new._reent._wcsrtombs_state) -#define _REENT_L64A_BUF(ptr) ((ptr)->_new._reent._l64a_buf) -#define _REENT_SIGNAL_BUF(ptr) ((ptr)->_new._reent._signal_buf) -#define _REENT_GETDATE_ERR_P(ptr) (&((ptr)->_new._reent._getdate_err)) - -#endif /* !_REENT_SMALL */ - -/* This value is used in stdlib/misc.c. reent/reent.c has to know it - as well to make sure the freelist is correctly free'd. Therefore - we define it here, rather than in stdlib/misc.c, as before. */ -#define _Kmax (sizeof (size_t) << 3) - -/* - * All references to struct _reent are via this pointer. - * Internally, newlib routines that need to reference it should use _REENT. - */ - -#ifndef __ATTRIBUTE_IMPURE_PTR__ -#define __ATTRIBUTE_IMPURE_PTR__ -#endif - -extern struct _reent *_impure_ptr __ATTRIBUTE_IMPURE_PTR__; -extern struct _reent *_CONST _global_impure_ptr __ATTRIBUTE_IMPURE_PTR__; - -void _reclaim_reent _PARAMS ((struct _reent *)); - -/* #define _REENT_ONLY define this to get only reentrant routines */ - -#if defined(__DYNAMIC_REENT__) && !defined(__SINGLE_THREAD__) -#ifndef __getreent - struct _reent * _EXFUN(__getreent, (void)); -#endif -# define _REENT (__getreent()) -#else /* __SINGLE_THREAD__ || !__DYNAMIC_REENT__ */ -# define _REENT _impure_ptr -#endif /* __SINGLE_THREAD__ || !__DYNAMIC_REENT__ */ - -#define _GLOBAL_REENT _global_impure_ptr - -#ifdef _REENT_GLOBAL_ATEXIT -extern struct _atexit *_global_atexit; /* points to head of LIFO stack */ -# define _GLOBAL_ATEXIT _global_atexit -#else -# define _GLOBAL_ATEXIT (_GLOBAL_REENT->_atexit) -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_REENT_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/resource.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/resource.h deleted file mode 100644 index c35ac2a46..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/resource.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _SYS_RESOURCE_H_ -#define _SYS_RESOURCE_H_ - -#include - -#define RUSAGE_SELF 0 /* calling process */ -#define RUSAGE_CHILDREN -1 /* terminated child processes */ - -struct rusage { - struct timeval ru_utime; /* user time used */ - struct timeval ru_stime; /* system time used */ -}; - -int _EXFUN(getrusage, (int, struct rusage*)); - -#endif - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/sched.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/sched.h deleted file mode 100644 index 58f99d682..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/sched.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Written by Joel Sherrill . - * - * COPYRIGHT (c) 1989-2010. - * On-Line Applications Research Corporation (OAR). - * - * Permission to use, copy, modify, and distribute this software for any - * purpose without fee is hereby granted, provided that this entire notice - * is included in all copies of any software which is or includes a copy - * or modification of this software. - * - * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED - * WARRANTY. IN PARTICULAR, THE AUTHOR MAKES NO REPRESENTATION - * OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY OF THIS - * SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. - * - * $Id$ - */ - - -#ifndef _SYS_SCHED_H_ -#define _SYS_SCHED_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* Scheduling Policies */ -/* Open Group Specifications Issue 6 */ -#if defined(__CYGWIN__) -#define SCHED_OTHER 3 -#else -#define SCHED_OTHER 0 -#endif - -#define SCHED_FIFO 1 -#define SCHED_RR 2 - -#if defined(_POSIX_SPORADIC_SERVER) -#define SCHED_SPORADIC 4 -#endif - -/* Scheduling Parameters */ -/* Open Group Specifications Issue 6 */ - -struct sched_param { - int sched_priority; /* Process execution scheduling priority */ - -#if defined(_POSIX_SPORADIC_SERVER) || defined(_POSIX_THREAD_SPORADIC_SERVER) - int sched_ss_low_priority; /* Low scheduling priority for sporadic */ - /* server */ - struct timespec sched_ss_repl_period; - /* Replenishment period for sporadic server */ - struct timespec sched_ss_init_budget; - /* Initial budget for sporadic server */ - int sched_ss_max_repl; /* Maximum pending replenishments for */ - /* sporadic server */ -#endif -}; - -#ifdef __cplusplus -} -#endif - -#endif -/* end of include file */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/signal.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/signal.h deleted file mode 100644 index a29f525c1..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/signal.h +++ /dev/null @@ -1,357 +0,0 @@ -/* sys/signal.h */ - -#ifndef _SYS_SIGNAL_H -#define _SYS_SIGNAL_H -#ifdef __cplusplus -extern "C" { -#endif - -#include "_ansi.h" -#include -#include - -/* #ifndef __STRICT_ANSI__*/ - -/* Cygwin defines it's own sigset_t in include/cygwin/signal.h */ -#ifndef __CYGWIN__ -typedef unsigned long sigset_t; -#endif - -#if defined(__rtems__) - -#if defined(_POSIX_REALTIME_SIGNALS) - -/* sigev_notify values - NOTE: P1003.1c/D10, p. 34 adds SIGEV_THREAD. */ - -#define SIGEV_NONE 1 /* No asynchronous notification shall be delivered */ - /* when the event of interest occurs. */ -#define SIGEV_SIGNAL 2 /* A queued signal, with an application defined */ - /* value, shall be delivered when the event of */ - /* interest occurs. */ -#define SIGEV_THREAD 3 /* A notification function shall be called to */ - /* perform notification. */ - -/* Signal Generation and Delivery, P1003.1b-1993, p. 63 - NOTE: P1003.1c/D10, p. 34 adds sigev_notify_function and - sigev_notify_attributes to the sigevent structure. */ - -union sigval { - int sival_int; /* Integer signal value */ - void *sival_ptr; /* Pointer signal value */ -}; - -struct sigevent { - int sigev_notify; /* Notification type */ - int sigev_signo; /* Signal number */ - union sigval sigev_value; /* Signal value */ - -#if defined(_POSIX_THREADS) - void (*sigev_notify_function)( union sigval ); - /* Notification function */ - pthread_attr_t *sigev_notify_attributes; /* Notification Attributes */ -#endif -}; - -/* Signal Actions, P1003.1b-1993, p. 64 */ -/* si_code values, p. 66 */ - -#define SI_USER 1 /* Sent by a user. kill(), abort(), etc */ -#define SI_QUEUE 2 /* Sent by sigqueue() */ -#define SI_TIMER 3 /* Sent by expiration of a timer_settime() timer */ -#define SI_ASYNCIO 4 /* Indicates completion of asycnhronous IO */ -#define SI_MESGQ 5 /* Indicates arrival of a message at an empty queue */ - -typedef struct { - int si_signo; /* Signal number */ - int si_code; /* Cause of the signal */ - union sigval si_value; /* Signal value */ -} siginfo_t; -#endif - -/* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 */ - -#define SA_NOCLDSTOP 0x1 /* Do not generate SIGCHLD when children stop */ -#define SA_SIGINFO 0x2 /* Invoke the signal catching function with */ - /* three arguments instead of one. */ -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -#define SA_ONSTACK 0x4 /* Signal delivery will be on a separate stack. */ -#endif - -/* struct sigaction notes from POSIX: - * - * (1) Routines stored in sa_handler should take a single int as - * their argument although the POSIX standard does not require this. - * This is not longer true since at least POSIX.1-2008 - * (2) The fields sa_handler and sa_sigaction may overlap, and a conforming - * application should not use both simultaneously. - */ - -typedef void (*_sig_func_ptr)(int); - -struct sigaction { - int sa_flags; /* Special flags to affect behavior of signal */ - sigset_t sa_mask; /* Additional set of signals to be blocked */ - /* during execution of signal-catching */ - /* function. */ - union { - _sig_func_ptr _handler; /* SIG_DFL, SIG_IGN, or pointer to a function */ -#if defined(_POSIX_REALTIME_SIGNALS) - void (*_sigaction)( int, siginfo_t *, void * ); -#endif - } _signal_handlers; -}; - -#define sa_handler _signal_handlers._handler -#if defined(_POSIX_REALTIME_SIGNALS) -#define sa_sigaction _signal_handlers._sigaction -#endif - -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -/* - * Minimum and default signal stack constants. Allow for target overrides - * from . - */ -#ifndef MINSIGSTKSZ -#define MINSIGSTKSZ 2048 -#endif -#ifndef SIGSTKSZ -#define SIGSTKSZ 8192 -#endif - -/* - * Possible values for ss_flags in stack_t below. - */ -#define SS_ONSTACK 0x1 -#define SS_DISABLE 0x2 - -/* - * Structure used in sigaltstack call. - */ -typedef struct sigaltstack { - void *ss_sp; /* Stack base or pointer. */ - int ss_flags; /* Flags. */ - size_t ss_size; /* Stack size. */ -} stack_t; -#endif - -#elif defined(__CYGWIN__) -#include -#else -#define SA_NOCLDSTOP 1 /* only value supported now for sa_flags */ - -typedef void (*_sig_func_ptr)(int); - -struct sigaction -{ - _sig_func_ptr sa_handler; - sigset_t sa_mask; - int sa_flags; -}; -#endif /* defined(__rtems__) */ - -#define SIG_SETMASK 0 /* set mask with sigprocmask() */ -#define SIG_BLOCK 1 /* set of signals to block */ -#define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ - -/* These depend upon the type of sigset_t, which right now - is always a long.. They're in the POSIX namespace, but - are not ANSI. */ -#define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0) -#define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0) -#define sigemptyset(what) (*(what) = 0, 0) -#define sigfillset(what) (*(what) = ~(0), 0) -#define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) - -int _EXFUN(sigprocmask, (int how, const sigset_t *set, sigset_t *oset)); - -#if defined(_POSIX_THREADS) -int _EXFUN(pthread_sigmask, (int how, const sigset_t *set, sigset_t *oset)); -#endif - -#if defined(__CYGWIN__) || defined(__rtems__) -#undef sigaddset -#undef sigdelset -#undef sigemptyset -#undef sigfillset -#undef sigismember - -#ifdef _COMPILING_NEWLIB -int _EXFUN(_kill, (pid_t, int)); -#endif /* _COMPILING_NEWLIB */ -#endif /* __CYGWIN__ || __rtems__ */ -#if defined(__CYGWIN__) || defined(__rtems__) || defined(__SPU__) -int _EXFUN(kill, (pid_t, int)); -#endif /* __CYGWIN__ || __rtems__ || __SPU__ */ -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(killpg, (pid_t, int)); -int _EXFUN(sigaction, (int, const struct sigaction *, struct sigaction *)); -int _EXFUN(sigaddset, (sigset_t *, const int)); -int _EXFUN(sigdelset, (sigset_t *, const int)); -int _EXFUN(sigismember, (const sigset_t *, int)); -int _EXFUN(sigfillset, (sigset_t *)); -int _EXFUN(sigemptyset, (sigset_t *)); -int _EXFUN(sigpending, (sigset_t *)); -int _EXFUN(sigsuspend, (const sigset_t *)); -int _EXFUN(sigpause, (int)); - -#ifdef __rtems__ -#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112 -int _EXFUN(sigaltstack, (const stack_t *__restrict, stack_t *__restrict)); -#endif -#endif - -#if defined(_POSIX_THREADS) -#ifdef __CYGWIN__ -# ifndef _CYGWIN_TYPES_H -# error You need the winsup sources or a cygwin installation to compile the cygwin version of newlib. -# endif -#endif -int _EXFUN(pthread_kill, (pthread_t thread, int sig)); -#endif - -#if defined(_POSIX_REALTIME_SIGNALS) - -/* 3.3.8 Synchronously Accept a Signal, P1003.1b-1993, p. 76 - NOTE: P1003.1c/D10, p. 39 adds sigwait(). */ - -int _EXFUN(sigwaitinfo, (const sigset_t *set, siginfo_t *info)); -int _EXFUN(sigtimedwait, - (const sigset_t *set, siginfo_t *info, const struct timespec *timeout) -); -int _EXFUN(sigwait, (const sigset_t *set, int *sig)); - -/* 3.3.9 Queue a Signal to a Process, P1003.1b-1993, p. 78 */ -int _EXFUN(sigqueue, (pid_t pid, int signo, const union sigval value)); - -#endif /* defined(_POSIX_REALTIME_SIGNALS) */ - -#endif /* defined(__CYGWIN__) || defined(__rtems__) */ - -/* #endif __STRICT_ANSI__ */ - -#if defined(___AM29K__) -/* These all need to be defined for ANSI C, but I don't think they are - meaningful. */ -#define SIGABRT 1 -#define SIGFPE 1 -#define SIGILL 1 -#define SIGINT 1 -#define SIGSEGV 1 -#define SIGTERM 1 -/* These need to be defined for POSIX, and some others do too. */ -#define SIGHUP 1 -#define SIGQUIT 1 -#define NSIG 2 -#elif defined(__GO32__) -#define SIGINT 1 -#define SIGKILL 2 -#define SIGPIPE 3 -#define SIGFPE 4 -#define SIGHUP 5 -#define SIGTERM 6 -#define SIGSEGV 7 -#define SIGTSTP 8 -#define SIGQUIT 9 -#define SIGTRAP 10 -#define SIGILL 11 -#define SIGEMT 12 -#define SIGALRM 13 -#define SIGBUS 14 -#define SIGLOST 15 -#define SIGSTOP 16 -#define SIGABRT 17 -#define SIGUSR1 18 -#define SIGUSR2 19 -#define NSIG 20 -#elif !defined(SIGTRAP) -#define SIGHUP 1 /* hangup */ -#define SIGINT 2 /* interrupt */ -#define SIGQUIT 3 /* quit */ -#define SIGILL 4 /* illegal instruction (not reset when caught) */ -#define SIGTRAP 5 /* trace trap (not reset when caught) */ -#define SIGIOT 6 /* IOT instruction */ -#define SIGABRT 6 /* used by abort, replace SIGIOT in the future */ -#define SIGEMT 7 /* EMT instruction */ -#define SIGFPE 8 /* floating point exception */ -#define SIGKILL 9 /* kill (cannot be caught or ignored) */ -#define SIGBUS 10 /* bus error */ -#define SIGSEGV 11 /* segmentation violation */ -#define SIGSYS 12 /* bad argument to system call */ -#define SIGPIPE 13 /* write on a pipe with no one to read it */ -#define SIGALRM 14 /* alarm clock */ -#define SIGTERM 15 /* software termination signal from kill */ - -#if defined(__rtems__) -#define SIGURG 16 /* urgent condition on IO channel */ -#define SIGSTOP 17 /* sendable stop signal not from tty */ -#define SIGTSTP 18 /* stop signal from tty */ -#define SIGCONT 19 /* continue a stopped process */ -#define SIGCHLD 20 /* to parent on child stop or exit */ -#define SIGCLD 20 /* System V name for SIGCHLD */ -#define SIGTTIN 21 /* to readers pgrp upon background tty read */ -#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ -#define SIGIO 23 /* input/output possible signal */ -#define SIGPOLL SIGIO /* System V name for SIGIO */ -#define SIGWINCH 24 /* window changed */ -#define SIGUSR1 25 /* user defined signal 1 */ -#define SIGUSR2 26 /* user defined signal 2 */ - -/* Real-Time Signals Range, P1003.1b-1993, p. 61 - NOTE: By P1003.1b-1993, this should be at least RTSIG_MAX - (which is a minimum of 8) signals. - */ -#define SIGRTMIN 27 -#define SIGRTMAX 31 -#define __SIGFIRSTNOTRT SIGHUP -#define __SIGLASTNOTRT SIGUSR2 - -#define NSIG 32 /* signal 0 implied */ - -#elif defined(__svr4__) -/* svr4 specifics. different signals above 15, and sigaction. */ -#define SIGUSR1 16 -#define SIGUSR2 17 -#define SIGCLD 18 -#define SIGPWR 19 -#define SIGWINCH 20 -#define SIGPOLL 22 /* 20 for x.out binaries!!!! */ -#define SIGSTOP 23 /* sendable stop signal not from tty */ -#define SIGTSTP 24 /* stop signal from tty */ -#define SIGCONT 25 /* continue a stopped process */ -#define SIGTTIN 26 /* to readers pgrp upon background tty read */ -#define SIGTTOU 27 /* like TTIN for output if (tp->t_local<OSTOP) */ -#define NSIG 28 -#else -#define SIGURG 16 /* urgent condition on IO channel */ -#define SIGSTOP 17 /* sendable stop signal not from tty */ -#define SIGTSTP 18 /* stop signal from tty */ -#define SIGCONT 19 /* continue a stopped process */ -#define SIGCHLD 20 /* to parent on child stop or exit */ -#define SIGCLD 20 /* System V name for SIGCHLD */ -#define SIGTTIN 21 /* to readers pgrp upon background tty read */ -#define SIGTTOU 22 /* like TTIN for output if (tp->t_local<OSTOP) */ -#define SIGIO 23 /* input/output possible signal */ -#define SIGPOLL SIGIO /* System V name for SIGIO */ -#define SIGXCPU 24 /* exceeded CPU time limit */ -#define SIGXFSZ 25 /* exceeded file size limit */ -#define SIGVTALRM 26 /* virtual time alarm */ -#define SIGPROF 27 /* profiling time alarm */ -#define SIGWINCH 28 /* window changed */ -#define SIGLOST 29 /* resource lost (eg, record-lock lost) */ -#define SIGUSR1 30 /* user defined signal 1 */ -#define SIGUSR2 31 /* user defined signal 2 */ -#define NSIG 32 /* signal 0 implied */ -#endif -#endif - -#ifdef __cplusplus -} -#endif - -#ifndef _SIGNAL_H_ -/* Some applications take advantage of the fact that - * and are equivalent in glibc. Allow for that here. */ -#include -#endif -#endif /* _SYS_SIGNAL_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/stat.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/stat.h deleted file mode 100644 index 11b9d8080..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/stat.h +++ /dev/null @@ -1,192 +0,0 @@ -#ifndef _SYS_STAT_H -#define _SYS_STAT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> -#include -#include -#include - -/* dj's stat defines _STAT_H_ */ -#ifndef _STAT_H_ - -/* It is intended that the layout of this structure not change when the - sizes of any of the basic types change (short, int, long) [via a compile - time option]. */ - -#ifdef __CYGWIN__ -#include -#ifdef _COMPILING_NEWLIB -#define stat64 stat -#endif -#else -struct stat -{ - dev_t st_dev; - ino_t st_ino; - mode_t st_mode; - nlink_t st_nlink; - uid_t st_uid; - gid_t st_gid; - dev_t st_rdev; - off_t st_size; -#if defined(__rtems__) - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - blksize_t st_blksize; - blkcnt_t st_blocks; -#else - /* SysV/sco doesn't have the rest... But Solaris, eabi does. */ -#if defined(__svr4__) && !defined(__PPC__) && !defined(__sun__) - time_t st_atime; - time_t st_mtime; - time_t st_ctime; -#else - time_t st_atime; - long st_spare1; - time_t st_mtime; - long st_spare2; - time_t st_ctime; - long st_spare3; - long st_blksize; - long st_blocks; - long st_spare4[2]; -#endif -#endif -}; - -#if defined(__rtems__) -#define st_atime st_atim.tv_sec -#define st_ctime st_ctim.tv_sec -#define st_mtime st_mtim.tv_sec -#endif - -#endif - -#define _IFMT 0170000 /* type of file */ -#define _IFDIR 0040000 /* directory */ -#define _IFCHR 0020000 /* character special */ -#define _IFBLK 0060000 /* block special */ -#define _IFREG 0100000 /* regular */ -#define _IFLNK 0120000 /* symbolic link */ -#define _IFSOCK 0140000 /* socket */ -#define _IFIFO 0010000 /* fifo */ - -#define S_BLKSIZE 1024 /* size of a block */ - -#define S_ISUID 0004000 /* set user id on execution */ -#define S_ISGID 0002000 /* set group id on execution */ -#define S_ISVTX 0001000 /* save swapped text even after use */ -#ifndef _POSIX_SOURCE -#define S_IREAD 0000400 /* read permission, owner */ -#define S_IWRITE 0000200 /* write permission, owner */ -#define S_IEXEC 0000100 /* execute/search permission, owner */ -#define S_ENFMT 0002000 /* enforcement-mode locking */ -#endif /* !_POSIX_SOURCE */ - -#define S_IFMT _IFMT -#define S_IFDIR _IFDIR -#define S_IFCHR _IFCHR -#define S_IFBLK _IFBLK -#define S_IFREG _IFREG -#define S_IFLNK _IFLNK -#define S_IFSOCK _IFSOCK -#define S_IFIFO _IFIFO - -#ifdef _WIN32 -/* The Windows header files define _S_ forms of these, so we do too - for easier portability. */ -#define _S_IFMT _IFMT -#define _S_IFDIR _IFDIR -#define _S_IFCHR _IFCHR -#define _S_IFIFO _IFIFO -#define _S_IFREG _IFREG -#define _S_IREAD 0000400 -#define _S_IWRITE 0000200 -#define _S_IEXEC 0000100 -#endif - -#define S_IRWXU (S_IRUSR | S_IWUSR | S_IXUSR) -#define S_IRUSR 0000400 /* read permission, owner */ -#define S_IWUSR 0000200 /* write permission, owner */ -#define S_IXUSR 0000100/* execute/search permission, owner */ -#define S_IRWXG (S_IRGRP | S_IWGRP | S_IXGRP) -#define S_IRGRP 0000040 /* read permission, group */ -#define S_IWGRP 0000020 /* write permission, grougroup */ -#define S_IXGRP 0000010/* execute/search permission, group */ -#define S_IRWXO (S_IROTH | S_IWOTH | S_IXOTH) -#define S_IROTH 0000004 /* read permission, other */ -#define S_IWOTH 0000002 /* write permission, other */ -#define S_IXOTH 0000001/* execute/search permission, other */ - -#ifndef _POSIX_SOURCE -#define ACCESSPERMS (S_IRWXU | S_IRWXG | S_IRWXO) /* 0777 */ -#define ALLPERMS (S_ISUID | S_ISGID | S_ISVTX | S_IRWXU | S_IRWXG | S_IRWXO) /* 07777 */ -#define DEFFILEMODE (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH) /* 0666 */ -#endif - -#define S_ISBLK(m) (((m)&_IFMT) == _IFBLK) -#define S_ISCHR(m) (((m)&_IFMT) == _IFCHR) -#define S_ISDIR(m) (((m)&_IFMT) == _IFDIR) -#define S_ISFIFO(m) (((m)&_IFMT) == _IFIFO) -#define S_ISREG(m) (((m)&_IFMT) == _IFREG) -#define S_ISLNK(m) (((m)&_IFMT) == _IFLNK) -#define S_ISSOCK(m) (((m)&_IFMT) == _IFSOCK) - -#if defined(__CYGWIN__) -/* Special tv_nsec values for futimens(2) and utimensat(2). */ -#define UTIME_NOW -2L -#define UTIME_OMIT -1L -#endif - -int _EXFUN(chmod,( const char *__path, mode_t __mode )); -int _EXFUN(fchmod,(int __fd, mode_t __mode)); -int _EXFUN(fstat,( int __fd, struct stat *__sbuf )); -int _EXFUN(mkdir,( const char *_path, mode_t __mode )); -int _EXFUN(mkfifo,( const char *__path, mode_t __mode )); -int _EXFUN(stat,( const char *__restrict __path, struct stat *__restrict __sbuf )); -mode_t _EXFUN(umask,( mode_t __mask )); - -#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(lstat,( const char *__restrict __path, struct stat *__restrict __buf )); -int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev )); -#endif - -#if (__POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(fchmodat, (int, const char *, mode_t, int)); -#endif -#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(fstatat, (int, const char *__restrict , struct stat *__restrict, int)); -int _EXFUN(mkdirat, (int, const char *, mode_t)); -int _EXFUN(mkfifoat, (int, const char *, mode_t)); -#endif -#if (__BSD_VISIBLE || __XSI_VISIBLE >= 700 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(mknodat, (int, const char *, mode_t, dev_t)); -#endif -#if (__BSD_VISIBLE || __POSIX_VISIBLE >= 200809 || defined (__CYGWIN__)) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(utimensat, (int, const char *, const struct timespec *, int)); -int _EXFUN(futimens, (int, const struct timespec *)); -#endif - -/* Provide prototypes for most of the _ names that are - provided in newlib for some compilers. */ -#ifdef _COMPILING_NEWLIB -int _EXFUN(_fstat,( int __fd, struct stat *__sbuf )); -int _EXFUN(_stat,( const char *__restrict __path, struct stat *__restrict __sbuf )); -int _EXFUN(_mkdir,( const char *_path, mode_t __mode )); -#ifdef __LARGE64_FILES -struct stat64; -int _EXFUN(_stat64,( const char *__restrict __path, struct stat64 *__restrict __sbuf )); -int _EXFUN(_fstat64,( int __fd, struct stat64 *__sbuf )); -#endif -#endif - -#endif /* !_STAT_H_ */ -#ifdef __cplusplus -} -#endif -#endif /* _SYS_STAT_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/stdio.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/stdio.h deleted file mode 100644 index cafc3e25f..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/stdio.h +++ /dev/null @@ -1,50 +0,0 @@ -/* sys/stdio.h - #defines for legacy PROGMEM _P functions (no longer needed) */ - -#ifndef _SYS_STDIO_H_ -#define _SYS_STDIO_H_ - -#include -#include - -#ifndef _NEWLIB_STDIO_H -#define _NEWLIB_STDIO_H - -#include -#include - -/* Internal locking macros, used to protect stdio functions. In the - general case, expand to nothing. Use __SSTR flag in FILE _flags to - detect if FILE is private to sprintf/sscanf class of functions; if - set then do nothing as lock is not initialised. */ -#if !defined(_flockfile) -#ifndef __SINGLE_THREAD__ -# define _flockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_acquire_recursive((fp)->_lock)) -#else -# define _flockfile(fp) (_CAST_VOID 0) -#endif -#endif - -#if !defined(_funlockfile) -#ifndef __SINGLE_THREAD__ -# define _funlockfile(fp) (((fp)->_flags & __SSTR) ? 0 : __lock_release_recursive((fp)->_lock)) -#else -# define _funlockfile(fp) (_CAST_VOID 0) -#endif -#endif - -#endif /* _NEWLIB_STDIO_H */ - -#ifdef __cplusplus -extern "C" { -#endif - -int printf_P(PGM_P formatP, ...) __attribute__((format(printf, 1, 2))); -int sprintf_P(char *str, PGM_P formatP, ...) __attribute__((format(printf, 2, 3))); -int snprintf_P(char *str, size_t strSize, PGM_P formatP, ...) __attribute__((format(printf, 3, 4))); -int vsnprintf_P(char *str, size_t strSize, PGM_P formatP, va_list ap) __attribute__((format(printf, 3, 0))); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h deleted file mode 100644 index e19c3d843..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/string.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * sys/string.h - * - * Xtensa custom PROGMEM string function definitions - */ - -#ifndef _SYS_STRING_H_ -#define _SYS_STRING_H_ - -#include "_ansi.h" -#include -#include -#include - -#define __need_size_t -#define __need_NULL -#include - -#define SIZE_IRRELEVANT 0x7fffffff - -#ifdef __cplusplus -extern "C" { -#endif - -int _EXFUN(memcmp_P,(const _PTR, const _PTR, size_t)); -_PTR _EXFUN(memmem_P, (const _PTR, size_t, const _PTR, size_t)); -_PTR _EXFUN(memcpy_P,(_PTR __restrict, const _PTR __restrict, size_t)); -_PTR _EXFUN(memmove_P,(_PTR __restrict, const _PTR __restrict, size_t)); -_PTR _EXFUN(memccpy_P,(_PTR __restrict, const _PTR __restrict, int, size_t)); -_PTR _EXFUN(memchr_P,(const _PTR, int, size_t)); - -char *_EXFUN(strncpy_P,(char *__restrict, const char *__restrict, size_t)); -#define strcpy_P(dest, src) strncpy_P((dest), (src), SIZE_IRRELEVANT) - -char *_EXFUN(strncat_P,(char *__restrict, const char *__restrict, size_t)); -#define strcat_P(dest, src) strncat_P((dest), (src), SIZE_IRRELEVANT) - -int _EXFUN(strncmp_P,(const char *, const char *, size_t)); -#define strcmp_P(str1, str2P) strncmp_P((str1), (str2P), SIZE_IRRELEVANT) - -int _EXFUN(strncasecmp_P,(const char *, const char *, size_t)); -#define strcasecmp_P(str1, str2P) strncasecmp_P((str1), (str2P), SIZE_IRRELEVANT) - -size_t _EXFUN(strnlen_P,(const char *, size_t)); -#define strlen_P(strP) strnlen_P((strP), SIZE_IRRELEVANT) - -char *_EXFUN(strstr_P,(const char *, const char *)); - -#ifdef __cplusplus -} -#endif - - -#endif /* _SYS_STRING_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/syslimits.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/syslimits.h deleted file mode 100644 index ba9dbd667..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/syslimits.h +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 1988, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - * - * @(#)syslimits.h 8.1 (Berkeley) 6/2/93 - * $FreeBSD: src/sys/sys/syslimits.h,v 1.10 2001/06/18 20:24:54 wollman Exp $ - */ - -#ifndef _SYS_SYSLIMITS_H_ -#define _SYS_SYSLIMITS_H_ - -#define ARG_MAX 65536 /* max bytes for an exec function */ -#ifndef CHILD_MAX -#define CHILD_MAX 40 /* max simultaneous processes */ -#endif -#define LINK_MAX 32767 /* max file link count */ -#define MAX_CANON 255 /* max bytes in term canon input line */ -#define MAX_INPUT 255 /* max bytes in terminal input */ -#define NAME_MAX 255 /* max bytes in a file name */ -#define NGROUPS_MAX 16 /* max supplemental group id's */ -#ifndef OPEN_MAX -#define OPEN_MAX 64 /* max open files per process */ -#endif -#define PATH_MAX 1024 /* max bytes in pathname */ -#define PIPE_BUF 512 /* max bytes for atomic pipe writes */ -#define IOV_MAX 1024 /* max elements in i/o vector */ - -#define BC_BASE_MAX 99 /* max ibase/obase values in bc(1) */ -#define BC_DIM_MAX 2048 /* max array elements in bc(1) */ -#define BC_SCALE_MAX 99 /* max scale value in bc(1) */ -#define BC_STRING_MAX 1000 /* max const string length in bc(1) */ -#define COLL_WEIGHTS_MAX 0 /* max weights for order keyword */ -#define EXPR_NEST_MAX 32 /* max expressions nested in expr(1) */ -#define LINE_MAX 2048 /* max bytes in an input line */ -#define RE_DUP_MAX 255 /* max RE's in interval notation */ - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/time.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/time.h deleted file mode 100644 index be16497fc..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/time.h +++ /dev/null @@ -1,91 +0,0 @@ -/* time.h -- An implementation of the standard Unix file. - Written by Geoffrey Noer - Public domain; no rights reserved. */ - -#ifndef _SYS_TIME_H_ -#define _SYS_TIME_H_ - -#include <_ansi.h> -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef _TIMEVAL_DEFINED -#define _TIMEVAL_DEFINED -struct timeval { - time_t tv_sec; - suseconds_t tv_usec; -}; - -/* BSD time macros used by RTEMS code */ -#if defined (__rtems__) || defined (__CYGWIN__) - -/* Convenience macros for operations on timevals. - NOTE: `timercmp' does not work for >= or <=. */ -#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) -#define timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) -#define timercmp(a, b, CMP) \ - (((a)->tv_sec == (b)->tv_sec) ? \ - ((a)->tv_usec CMP (b)->tv_usec) : \ - ((a)->tv_sec CMP (b)->tv_sec)) -#define timeradd(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec + (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec + (b)->tv_usec; \ - if ((result)->tv_usec >= 1000000) \ - { \ - ++(result)->tv_sec; \ - (result)->tv_usec -= 1000000; \ - } \ - } while (0) -#define timersub(a, b, result) \ - do { \ - (result)->tv_sec = (a)->tv_sec - (b)->tv_sec; \ - (result)->tv_usec = (a)->tv_usec - (b)->tv_usec; \ - if ((result)->tv_usec < 0) { \ - --(result)->tv_sec; \ - (result)->tv_usec += 1000000; \ - } \ - } while (0) -#endif /* defined (__rtems__) || defined (__CYGWIN__) */ -#endif /* !_TIMEVAL_DEFINED */ - -struct timezone { - int tz_minuteswest; - int tz_dsttime; -}; - -#ifdef __CYGWIN__ -#include -#endif /* __CYGWIN__ */ - -#define ITIMER_REAL 0 -#define ITIMER_VIRTUAL 1 -#define ITIMER_PROF 2 - -struct itimerval { - struct timeval it_interval; - struct timeval it_value; -}; - -#ifdef _COMPILING_NEWLIB -int _EXFUN(_gettimeofday, (struct timeval *__p, void *__tz)); -#endif - -int _EXFUN(gettimeofday, (struct timeval *__restrict __p, - void *__restrict __tz)); -#if __BSD_VISIBLE -int _EXFUN(settimeofday, (const struct timeval *, const struct timezone *)); -int _EXFUN(adjtime, (const struct timeval *, struct timeval *)); -#endif -int _EXFUN(utimes, (const char *__path, const struct timeval *__tvp)); -int _EXFUN(getitimer, (int __which, struct itimerval *__value)); -int _EXFUN(setitimer, (int __which, const struct itimerval *__restrict __value, - struct itimerval *__restrict __ovalue)); - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_TIME_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/timeb.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/timeb.h deleted file mode 100644 index 0a2c3de8b..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/timeb.h +++ /dev/null @@ -1,39 +0,0 @@ -/* timeb.h -- An implementation of the standard Unix file. - Written by Ian Lance Taylor - Public domain; no rights reserved. - - declares the structure used by the ftime function, as - well as the ftime function itself. Newlib does not provide an - implementation of ftime. */ - -#ifndef _SYS_TIMEB_H - -#ifdef __cplusplus -extern "C" { -#endif - -#define _SYS_TIMEB_H - -#include <_ansi.h> -#include - -#ifndef __time_t_defined -typedef _TIME_T_ time_t; -#define __time_t_defined -#endif - -struct timeb -{ - time_t time; - unsigned short millitm; - short timezone; - short dstflag; -}; - -extern int ftime _PARAMS ((struct timeb *)); - -#ifdef __cplusplus -} -#endif - -#endif /* ! defined (_SYS_TIMEB_H) */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/times.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/times.h deleted file mode 100644 index 927812cb8..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/times.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef _SYS_TIMES_H -#ifdef __cplusplus -extern "C" { -#endif -#define _SYS_TIMES_H - -#include <_ansi.h> -#include - -#ifndef __clock_t_defined -typedef _CLOCK_T_ clock_t; -#define __clock_t_defined -#endif - -/* Get Process Times, P1003.1b-1993, p. 92 */ -struct tms { - clock_t tms_utime; /* user time */ - clock_t tms_stime; /* system time */ - clock_t tms_cutime; /* user time, children */ - clock_t tms_cstime; /* system time, children */ -}; - -clock_t _EXFUN(times,(struct tms *)); -#ifdef _COMPILING_NEWLIB -clock_t _EXFUN(_times,(struct tms *)); -#endif - -#ifdef __cplusplus -} -#endif -#endif /* !_SYS_TIMES_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/types.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/types.h deleted file mode 100644 index ed33e0a61..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/types.h +++ /dev/null @@ -1,521 +0,0 @@ -/* unified sys/types.h: - start with sef's sysvi386 version. - merge go32 version -- a few ifdefs. - h8300hms, h8300xray, and sysvnecv70 disagree on the following types: - - typedef int gid_t; - typedef int uid_t; - typedef int dev_t; - typedef int ino_t; - typedef int mode_t; - typedef int caddr_t; - - however, these aren't "reasonable" values, the sysvi386 ones make far - more sense, and should work sufficiently well (in particular, h8300 - doesn't have a stat, and the necv70 doesn't matter.) -- eichin - */ - -#ifndef _SYS_TYPES_H - -#include <_ansi.h> - -#ifndef __INTTYPES_DEFINED__ -#define __INTTYPES_DEFINED__ - -#include - -#if defined(__rtems__) || defined(__XMK__) -/* - * The following section is RTEMS specific and is needed to more - * closely match the types defined in the BSD sys/types.h. - * This is needed to let the RTEMS/BSD TCP/IP stack compile. - */ - -/* deprecated */ -#if ___int8_t_defined -typedef __uint8_t u_int8_t; -#endif -#if ___int16_t_defined -typedef __uint16_t u_int16_t; -#endif -#if ___int32_t_defined -typedef __uint32_t u_int32_t; -#endif - -#if ___int64_t_defined -typedef __uint64_t u_int64_t; - -/* deprecated */ -typedef __uint64_t u_quad_t; -typedef __int64_t quad_t; -typedef quad_t * qaddr_t; -#endif - -#endif - -#endif /* ! __INTTYPES_DEFINED */ - -#ifndef __need_inttypes - -#define _SYS_TYPES_H -#include - -#ifdef __i386__ -#if defined (GO32) || defined (__MSDOS__) -#define __MS_types__ -#endif -#endif - -# include -# include - -/* To ensure the stat struct's layout doesn't change when sizeof(int), etc. - changes, we assume sizeof short and long never change and have all types - used to define struct stat use them and not int where possible. - Where not possible, _ST_INTxx are used. It would be preferable to not have - such assumptions, but until the extra fluff is necessary, it's avoided. - No 64 bit targets use stat yet. What to do about them is postponed - until necessary. */ -#ifdef __GNUC__ -#define _ST_INT32 __attribute__ ((__mode__ (__SI__))) -#else -#define _ST_INT32 -#endif - -# ifndef _POSIX_SOURCE - -# define physadr physadr_t -# define quad quad_t - -#ifndef _BSDTYPES_DEFINED -/* also defined in mingw/gmon.h and in w32api/winsock[2].h */ -#ifndef __u_char_defined -typedef unsigned char u_char; -#define __u_char_defined -#endif -#ifndef __u_short_defined -typedef unsigned short u_short; -#define __u_short_defined -#endif -#ifndef __u_int_defined -typedef unsigned int u_int; -#define __u_int_defined -#endif -#ifndef __u_long_defined -typedef unsigned long u_long; -#define __u_long_defined -#endif -#define _BSDTYPES_DEFINED -#endif - -typedef unsigned short ushort; /* System V compatibility */ -typedef unsigned int uint; /* System V compatibility */ -typedef unsigned long ulong; /* System V compatibility */ -# endif /*!_POSIX_SOURCE */ - -#ifndef __clock_t_defined -typedef _CLOCK_T_ clock_t; -#define __clock_t_defined -#endif - -#ifndef __time_t_defined -typedef _TIME_T_ time_t; -#define __time_t_defined -#endif - -#ifndef __timespec_defined -#define __timespec_defined -/* Time Value Specification Structures, P1003.1b-1993, p. 261 */ - -struct timespec { - time_t tv_sec; /* Seconds */ - long tv_nsec; /* Nanoseconds */ -}; -#endif - -struct itimerspec { - struct timespec it_interval; /* Timer period */ - struct timespec it_value; /* Timer expiration */ -}; - -#ifndef __daddr_t_defined -typedef long daddr_t; -#define __daddr_t_defined -#endif -#ifndef __caddr_t_defined -typedef char * caddr_t; -#define __caddr_t_defined -#endif - -#ifndef __CYGWIN__ -#if defined(__MS_types__) || defined(__rtems__) || \ - defined(__sparc__) || defined(__SPU__) -typedef unsigned long ino_t; -#else -typedef unsigned short ino_t; -#endif -#endif /*__CYGWIN__*/ - -#ifdef __MS_types__ -typedef unsigned long vm_offset_t; -typedef unsigned long vm_size_t; - -#define __BIT_TYPES_DEFINED__ - -typedef signed char int8_t; -typedef unsigned char u_int8_t; -typedef short int16_t; -typedef unsigned short u_int16_t; -typedef int int32_t; -typedef unsigned int u_int32_t; -typedef long long int64_t; -typedef unsigned long long u_int64_t; -typedef int32_t register_t; -#endif /* __MS_types__ */ - -/* - * All these should be machine specific - right now they are all broken. - * However, for all of Cygnus' embedded targets, we want them to all be - * the same. Otherwise things like sizeof (struct stat) might depend on - * how the file was compiled (e.g. -mint16 vs -mint32, etc.). - */ - -#ifndef __CYGWIN__ /* which defines these types in it's own types.h. */ -typedef _off_t off_t; -typedef __dev_t dev_t; -typedef __uid_t uid_t; -typedef __gid_t gid_t; -#endif - -#if defined(__XMK__) -typedef signed char pid_t; -#else -typedef int pid_t; -#endif - -#if defined(__rtems__) -typedef _mode_t mode_t; -#endif - -#ifndef __CYGWIN__ -typedef long key_t; -#endif -typedef _ssize_t ssize_t; - -#if !defined(__CYGWIN__) && !defined(__rtems__) -#ifdef __MS_types__ -typedef char * addr_t; -typedef int mode_t; -#else -#if defined (__sparc__) && !defined (__sparc_v9__) -#ifdef __svr4__ -typedef unsigned long mode_t; -#else -typedef unsigned short mode_t; -#endif -#else -typedef unsigned int mode_t _ST_INT32; -#endif -#endif /* ! __MS_types__ */ -#endif /*__CYGWIN__*/ - -typedef unsigned short nlink_t; - -/* We don't define fd_set and friends if we are compiling POSIX - source, or if we have included (or may include as indicated - by __USE_W32_SOCKETS) the W32api winsock[2].h header which - defines Windows versions of them. Note that a program which - includes the W32api winsock[2].h header must know what it is doing; - it must not call the cygwin32 select function. -*/ -# if !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) -# define _SYS_TYPES_FD_SET -# define NBBY 8 /* number of bits in a byte */ -/* - * Select uses bit masks of file descriptors in longs. - * These macros manipulate such bit fields (the filesystem macros use chars). - * FD_SETSIZE may be defined by the user, but the default here - * should be >= NOFILE (param.h). - */ -# ifndef FD_SETSIZE -# define FD_SETSIZE 64 -# endif - -typedef long fd_mask; -# define NFDBITS (sizeof (fd_mask) * NBBY) /* bits per mask */ -# ifndef howmany -# define howmany(x,y) (((x)+((y)-1))/(y)) -# endif - -/* We use a macro for fd_set so that including Sockets.h afterwards - can work. */ -typedef struct _types_fd_set { - fd_mask fds_bits[howmany(FD_SETSIZE, NFDBITS)]; -} _types_fd_set; - -#define fd_set _types_fd_set - -# define FD_SET(n, p) ((p)->fds_bits[(n)/NFDBITS] |= (1L << ((n) % NFDBITS))) -# define FD_CLR(n, p) ((p)->fds_bits[(n)/NFDBITS] &= ~(1L << ((n) % NFDBITS))) -# define FD_ISSET(n, p) ((p)->fds_bits[(n)/NFDBITS] & (1L << ((n) % NFDBITS))) -# define FD_ZERO(p) (__extension__ (void)({ \ - size_t __i; \ - char *__tmp = (char *)p; \ - for (__i = 0; __i < sizeof (*(p)); ++__i) \ - *__tmp++ = 0; \ -})) - -# endif /* !(defined (_POSIX_SOURCE) || defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) */ - -#undef __MS_types__ -#undef _ST_INT32 - - -#ifndef __clockid_t_defined -typedef _CLOCKID_T_ clockid_t; -#define __clockid_t_defined -#endif - -#ifndef __timer_t_defined -typedef _TIMER_T_ timer_t; -#define __timer_t_defined -#endif - -typedef unsigned long useconds_t; -typedef long suseconds_t; - -#include - - -/* Cygwin will probably never have full posix compliance due to little things - * like an inability to set the stackaddress. Cygwin is also using void * - * pointers rather than structs to ensure maximum binary compatability with - * previous releases. - * This means that we don't use the types defined here, but rather in - * - */ -#if defined(_POSIX_THREADS) && !defined(__CYGWIN__) - -#include - -/* - * 2.5 Primitive System Data Types, P1003.1c/D10, p. 19. - */ - -#if defined(__XMK__) -typedef unsigned int pthread_t; /* identify a thread */ -#else -typedef __uint32_t pthread_t; /* identify a thread */ -#endif - -/* P1003.1c/D10, p. 118-119 */ -#define PTHREAD_SCOPE_PROCESS 0 -#define PTHREAD_SCOPE_SYSTEM 1 - -/* P1003.1c/D10, p. 111 */ -#define PTHREAD_INHERIT_SCHED 1 /* scheduling policy and associated */ - /* attributes are inherited from */ - /* the calling thread. */ -#define PTHREAD_EXPLICIT_SCHED 2 /* set from provided attribute object */ - -/* P1003.1c/D10, p. 141 */ -#define PTHREAD_CREATE_DETACHED 0 -#define PTHREAD_CREATE_JOINABLE 1 - -#if defined(__rtems__) - #include -#endif - -#if defined(__XMK__) -typedef struct pthread_attr_s { - int contentionscope; - struct sched_param schedparam; - int detachstate; - void *stackaddr; - size_t stacksize; -} pthread_attr_t; - -#define PTHREAD_STACK_MIN 200 - -#else /* !defined(__XMK__) */ -typedef struct { - int is_initialized; - void *stackaddr; - int stacksize; - int contentionscope; - int inheritsched; - int schedpolicy; - struct sched_param schedparam; -#if defined(__rtems__) - size_t guardsize; -#endif - - /* P1003.4b/D8, p. 54 adds cputime_clock_allowed attribute. */ -#if defined(_POSIX_THREAD_CPUTIME) - int cputime_clock_allowed; /* see time.h */ -#endif - int detachstate; -#if defined(__rtems__) - size_t affinitysetsize; - cpu_set_t *affinityset; - cpu_set_t affinitysetpreallocated; -#endif -} pthread_attr_t; - -#endif /* !defined(__XMK__) */ - -#if defined(_POSIX_THREAD_PROCESS_SHARED) -/* NOTE: P1003.1c/D10, p. 81 defines following values for process_shared. */ - -#define PTHREAD_PROCESS_PRIVATE 0 /* visible within only the creating process */ -#define PTHREAD_PROCESS_SHARED 1 /* visible too all processes with access to */ - /* the memory where the resource is */ - /* located */ -#endif - -#if defined(_POSIX_THREAD_PRIO_PROTECT) -/* Mutexes */ - -/* Values for blocking protocol. */ - -#define PTHREAD_PRIO_NONE 0 -#define PTHREAD_PRIO_INHERIT 1 -#define PTHREAD_PRIO_PROTECT 2 -#endif - -#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) - -/* Values for mutex type */ - -/* The following defines are part of the X/Open System Interface (XSI). */ - -/* - * This type of mutex does not detect deadlock. A thread attempting to - * relock this mutex without first unlocking it shall deadlock. Attempting - * to unlock a mutex locked by a different thread results in undefined - * behavior. Attempting to unlock an unlocked mutex results in undefined - * behavior. - */ -#define PTHREAD_MUTEX_NORMAL 0 - -/* - * A thread attempting to relock this mutex without first unlocking - * it shall succeed in locking the mutex. The relocking deadlock which - * can occur with mutexes of type PTHREAD_MUTEX_NORMAL cannot occur with - * this type of mutex. Multiple locks of this mutex shall require the - * same number of unlocks to release the mutex before another thread can - * acquire the mutex. A thread attempting to unlock a mutex which another - * thread has locked shall return with an error. A thread attempting to - * unlock an unlocked mutex shall return with an error. - */ -#define PTHREAD_MUTEX_RECURSIVE 1 - -/* - * This type of mutex provides error checking. A thread attempting - * to relock this mutex without first unlocking it shall return with an - * error. A thread attempting to unlock a mutex which another thread has - * locked shall return with an error. A thread attempting to unlock an - * unlocked mutex shall return with an error. - */ -#define PTHREAD_MUTEX_ERRORCHECK 2 - -/* - * Attempting to recursively lock a mutex of this type results - * in undefined behavior. Attempting to unlock a mutex of this type - * which was not locked by the calling thread results in undefined - * behavior. Attempting to unlock a mutex of this type which is not locked - * results in undefined behavior. An implementation may map this mutex to - * one of the other mutex types. - */ -#define PTHREAD_MUTEX_DEFAULT 3 - -#endif /* !defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) */ - -#if defined(__XMK__) -typedef unsigned int pthread_mutex_t; /* identify a mutex */ - -typedef struct { - int type; -} pthread_mutexattr_t; - -#else /* !defined(__XMK__) */ -typedef __uint32_t pthread_mutex_t; /* identify a mutex */ - -typedef struct { - int is_initialized; -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow mutex to be shared amongst processes */ -#endif -#if defined(_POSIX_THREAD_PRIO_PROTECT) - int prio_ceiling; - int protocol; -#endif -#if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) - int type; -#endif - int recursive; -} pthread_mutexattr_t; -#endif /* !defined(__XMK__) */ - -/* Condition Variables */ - -typedef __uint32_t pthread_cond_t; /* identify a condition variable */ - -typedef struct { - int is_initialized; -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow this to be shared amongst processes */ -#endif -} pthread_condattr_t; /* a condition attribute object */ - -/* Keys */ - -typedef __uint32_t pthread_key_t; /* thread-specific data keys */ - -typedef struct { - int is_initialized; /* is this structure initialized? */ - int init_executed; /* has the initialization routine been run? */ -} pthread_once_t; /* dynamic package initialization */ -#else -#if defined (__CYGWIN__) -#include -#endif -#endif /* defined(_POSIX_THREADS) */ - -/* POSIX Barrier Types */ - -#if defined(_POSIX_BARRIERS) -typedef __uint32_t pthread_barrier_t; /* POSIX Barrier Object */ -typedef struct { - int is_initialized; /* is this structure initialized? */ -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow this to be shared amongst processes */ -#endif -} pthread_barrierattr_t; -#endif /* defined(_POSIX_BARRIERS) */ - -/* POSIX Spin Lock Types */ - -#if !defined (__CYGWIN__) -#if defined(_POSIX_SPIN_LOCKS) -typedef __uint32_t pthread_spinlock_t; /* POSIX Spin Lock Object */ -#endif /* defined(_POSIX_SPIN_LOCKS) */ - -/* POSIX Reader/Writer Lock Types */ - -#if defined(_POSIX_READER_WRITER_LOCKS) -typedef __uint32_t pthread_rwlock_t; /* POSIX RWLock Object */ -typedef struct { - int is_initialized; /* is this structure initialized? */ -#if defined(_POSIX_THREAD_PROCESS_SHARED) - int process_shared; /* allow this to be shared amongst processes */ -#endif -} pthread_rwlockattr_t; -#endif /* defined(_POSIX_READER_WRITER_LOCKS) */ -#endif /* __CYGWIN__ */ - -#endif /* !__need_inttypes */ - -#undef __need_inttypes - -#endif /* _SYS_TYPES_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/unistd.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/unistd.h deleted file mode 100644 index a741383d0..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/unistd.h +++ /dev/null @@ -1,516 +0,0 @@ -#ifndef _SYS_UNISTD_H -#define _SYS_UNISTD_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> -#define __need_size_t -#define __need_ptrdiff_t -#include -#include -#include -#include - -extern char **environ; - -void _EXFUN(_exit, (int __status ) _ATTRIBUTE ((__noreturn__))); - -int _EXFUN(access,(const char *__path, int __amode )); -unsigned _EXFUN(alarm, (unsigned __secs )); -int _EXFUN(chdir, (const char *__path )); -int _EXFUN(chmod, (const char *__path, mode_t __mode )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(chown, (const char *__path, uid_t __owner, gid_t __group )); -#endif -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(chroot, (const char *__path )); -#endif -int _EXFUN(close, (int __fildes )); -#if defined(__CYGWIN__) -size_t _EXFUN(confstr, (int __name, char *__buf, size_t __len)); -#endif -char * _EXFUN(ctermid, (char *__s )); -char * _EXFUN(cuserid, (char *__s )); -#if defined(__CYGWIN__) -int _EXFUN(daemon, (int nochdir, int noclose)); -#endif -int _EXFUN(dup, (int __fildes )); -int _EXFUN(dup2, (int __fildes, int __fildes2 )); -#if defined(__CYGWIN__) -int _EXFUN(dup3, (int __fildes, int __fildes2, int flags)); -int _EXFUN(eaccess, (const char *__path, int __mode)); -void _EXFUN(endusershell, (void)); -int _EXFUN(euidaccess, (const char *__path, int __mode)); -#endif -int _EXFUN(execl, (const char *__path, const char *, ... )); -int _EXFUN(execle, (const char *__path, const char *, ... )); -int _EXFUN(execlp, (const char *__file, const char *, ... )); -#if defined(__CYGWIN__) -int _EXFUN(execlpe, (const char *__file, const char *, ... )); -#endif -int _EXFUN(execv, (const char *__path, char * const __argv[] )); -int _EXFUN(execve, (const char *__path, char * const __argv[], char * const __envp[] )); -int _EXFUN(execvp, (const char *__file, char * const __argv[] )); -#if defined(__CYGWIN__) -int _EXFUN(execvpe, (const char *__file, char * const __argv[], char * const __envp[] )); -#endif -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(faccessat, (int __dirfd, const char *__path, int __mode, int __flags)); -#endif -#if defined(__CYGWIN__) || defined(__rtems__) || defined(__SPU__) -int _EXFUN(fchdir, (int __fildes)); -#endif -int _EXFUN(fchmod, (int __fildes, mode_t __mode )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(fchown, (int __fildes, uid_t __owner, gid_t __group )); -#endif -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(fchownat, (int __dirfd, const char *__path, uid_t __owner, gid_t __group, int __flags)); -#endif -#if defined(__CYGWIN__) -int _EXFUN(fexecve, (int __fd, char * const __argv[], char * const __envp[] )); -#endif -pid_t _EXFUN(fork, (void )); -long _EXFUN(fpathconf, (int __fd, int __name )); -int _EXFUN(fsync, (int __fd)); -int _EXFUN(fdatasync, (int __fd)); -#if defined(__CYGWIN__) -char * _EXFUN(get_current_dir_name, (void)); -#endif -char * _EXFUN(getcwd, (char *__buf, size_t __size )); -#if defined(__CYGWIN__) -int _EXFUN(getdomainname ,(char *__name, size_t __len)); -#endif -#if !defined(__INSIDE_CYGWIN__) -gid_t _EXFUN(getegid, (void )); -uid_t _EXFUN(geteuid, (void )); -gid_t _EXFUN(getgid, (void )); -#endif -int _EXFUN(getgroups, (int __gidsetsize, gid_t __grouplist[] )); -#if defined(__CYGWIN__) -long _EXFUN(gethostid, (void)); -#endif -char * _EXFUN(getlogin, (void )); -#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) -int _EXFUN(getlogin_r, (char *name, size_t namesize) ); -#endif -char * _EXFUN(getpass, (const char *__prompt)); -int _EXFUN(getpagesize, (void)); -#if defined(__CYGWIN__) -int _EXFUN(getpeereid, (int, uid_t *, gid_t *)); -#endif -pid_t _EXFUN(getpgid, (pid_t)); -pid_t _EXFUN(getpgrp, (void )); -pid_t _EXFUN(getpid, (void )); -pid_t _EXFUN(getppid, (void )); -#if defined(__CYGWIN__) || defined(__rtems__) -pid_t _EXFUN(getsid, (pid_t)); -#endif -#if !defined(__INSIDE_CYGWIN__) -uid_t _EXFUN(getuid, (void )); -#endif -#ifdef __CYGWIN__ -char * _EXFUN(getusershell, (void)); -char * _EXFUN(getwd, (char *__buf )); -int _EXFUN(iruserok, (unsigned long raddr, int superuser, const char *ruser, const char *luser)); -#endif -int _EXFUN(isatty, (int __fildes )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(lchown, (const char *__path, uid_t __owner, gid_t __group )); -#endif -int _EXFUN(link, (const char *__path1, const char *__path2 )); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(linkat, (int __dirfd1, const char *__path1, int __dirfd2, const char *__path2, int __flags )); -#endif -int _EXFUN(nice, (int __nice_value )); -#if !defined(__INSIDE_CYGWIN__) -off_t _EXFUN(lseek, (int __fildes, off_t __offset, int __whence )); -#endif -#if defined(__SPU__) || defined(__CYGWIN__) -#define F_ULOCK 0 -#define F_LOCK 1 -#define F_TLOCK 2 -#define F_TEST 3 -int _EXFUN(lockf, (int __fd, int __cmd, off_t __len)); -#endif -long _EXFUN(pathconf, (const char *__path, int __name )); -int _EXFUN(pause, (void )); -#ifdef __CYGWIN__ -int _EXFUN(pthread_atfork, (void (*)(void), void (*)(void), void (*)(void))); -#endif -int _EXFUN(pipe, (int __fildes[2] )); -#ifdef __CYGWIN__ -int _EXFUN(pipe2, (int __fildes[2], int flags)); -#endif -ssize_t _EXFUN(pread, (int __fd, void *__buf, size_t __nbytes, off_t __offset)); -ssize_t _EXFUN(pwrite, (int __fd, const void *__buf, size_t __nbytes, off_t __offset)); -_READ_WRITE_RETURN_TYPE _EXFUN(read, (int __fd, void *__buf, size_t __nbyte )); -#if defined(__CYGWIN__) -int _EXFUN(rresvport, (int *__alport)); -int _EXFUN(revoke, (char *__path)); -#endif -int _EXFUN(rmdir, (const char *__path )); -#if defined(__CYGWIN__) -int _EXFUN(ruserok, (const char *rhost, int superuser, const char *ruser, const char *luser)); -#endif -void * _EXFUN(sbrk, (ptrdiff_t __incr)); -#if !defined(__INSIDE_CYGWIN__) -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(setegid, (gid_t __gid )); -int _EXFUN(seteuid, (uid_t __uid )); -#endif -int _EXFUN(setgid, (gid_t __gid )); -#endif -#if defined(__CYGWIN__) -int _EXFUN(setgroups, (int ngroups, const gid_t *grouplist )); -#endif -#if __BSD_VISIBLE || (defined(_XOPEN_SOURCE) && __XSI_VISIBLE < 500) -int _EXFUN(sethostname, (const char *, size_t)); -#endif -int _EXFUN(setpgid, (pid_t __pid, pid_t __pgid )); -int _EXFUN(setpgrp, (void )); -#if defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__) -int _EXFUN(setregid, (gid_t __rgid, gid_t __egid)); -int _EXFUN(setreuid, (uid_t __ruid, uid_t __euid)); -#endif -pid_t _EXFUN(setsid, (void )); -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(setuid, (uid_t __uid )); -#endif -#if defined(__CYGWIN__) -void _EXFUN(setusershell, (void)); -#endif -unsigned _EXFUN(sleep, (unsigned int __seconds )); -void _EXFUN(swab, (const void *__restrict, void *__restrict, ssize_t)); -long _EXFUN(sysconf, (int __name )); -pid_t _EXFUN(tcgetpgrp, (int __fildes )); -int _EXFUN(tcsetpgrp, (int __fildes, pid_t __pgrp_id )); -char * _EXFUN(ttyname, (int __fildes )); -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(ttyname_r, (int, char *, size_t)); -#endif -int _EXFUN(unlink, (const char *__path )); -int _EXFUN(usleep, (useconds_t __useconds)); -int _EXFUN(vhangup, (void )); -_READ_WRITE_RETURN_TYPE _EXFUN(write, (int __fd, const void *__buf, size_t __nbyte )); - -#ifdef __CYGWIN__ -# define __UNISTD_GETOPT__ -# include -# undef __UNISTD_GETOPT__ -#else -extern char *optarg; /* getopt(3) external variables */ -extern int optind, opterr, optopt; -int getopt(int, char * const [], const char *); -extern int optreset; /* getopt(3) external variable */ -#endif - -#ifndef _POSIX_SOURCE -pid_t _EXFUN(vfork, (void )); -#endif /* _POSIX_SOURCE */ - -#ifdef _COMPILING_NEWLIB -/* Provide prototypes for most of the _ names that are - provided in newlib for some compilers. */ -int _EXFUN(_close, (int __fildes )); -pid_t _EXFUN(_fork, (void )); -pid_t _EXFUN(_getpid, (void )); -int _EXFUN(_isatty, (int __fildes )); -int _EXFUN(_link, (const char *__path1, const char *__path2 )); -_off_t _EXFUN(_lseek, (int __fildes, _off_t __offset, int __whence )); -#ifdef __LARGE64_FILES -_off64_t _EXFUN(_lseek64, (int __filedes, _off64_t __offset, int __whence )); -#endif -_READ_WRITE_RETURN_TYPE _EXFUN(_read, (int __fd, void *__buf, size_t __nbyte )); -void * _EXFUN(_sbrk, (ptrdiff_t __incr)); -int _EXFUN(_unlink, (const char *__path )); -_READ_WRITE_RETURN_TYPE _EXFUN(_write, (int __fd, const void *__buf, size_t __nbyte )); -int _EXFUN(_execve, (const char *__path, char * const __argv[], char * const __envp[] )); -#endif - -#if defined(__CYGWIN__) || defined(__rtems__) || defined(__aarch64__) || defined (__arm__) || defined(__sh__) || defined(__SPU__) -#if !defined(__INSIDE_CYGWIN__) -int _EXFUN(ftruncate, (int __fd, off_t __length)); -int _EXFUN(truncate, (const char *, off_t __length)); -#endif -#endif - -#if defined(__CYGWIN__) || defined(__rtems__) -int _EXFUN(getdtablesize, (void)); -int _EXFUN(setdtablesize, (int)); -useconds_t _EXFUN(ualarm, (useconds_t __useconds, useconds_t __interval)); -#if !(defined (_WINSOCK_H) || defined (_WINSOCKAPI_) || defined (__USE_W32_SOCKETS)) -/* winsock[2].h defines as __stdcall, and with int as 2nd arg */ - int _EXFUN(gethostname, (char *__name, size_t __len)); -#endif -char * _EXFUN(mktemp, (char *)); -#endif - -#if defined(__CYGWIN__) || defined(__SPU__) || defined(__rtems__) -void _EXFUN(sync, (void)); -#endif - -ssize_t _EXFUN(readlink, (const char *__restrict __path, - char *__restrict __buf, size_t __buflen)); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -ssize_t _EXFUN(readlinkat, (int __dirfd1, const char *__restrict __path, - char *__restrict __buf, size_t __buflen)); -#endif -int _EXFUN(symlink, (const char *__name1, const char *__name2)); -#if __POSIX_VISIBLE >= 200809 || __BSD_VISIBLE || defined(__CYGWIN__) -int _EXFUN(symlinkat, (const char *, int, const char *)); -int _EXFUN(unlinkat, (int, const char *, int)); -#endif - -#define F_OK 0 -#define R_OK 4 -#define W_OK 2 -#define X_OK 1 - -# define SEEK_SET 0 -# define SEEK_CUR 1 -# define SEEK_END 2 - -#include - -#define STDIN_FILENO 0 /* standard input file descriptor */ -#define STDOUT_FILENO 1 /* standard output file descriptor */ -#define STDERR_FILENO 2 /* standard error file descriptor */ - -/* - * sysconf values per IEEE Std 1003.1, 2008 Edition - */ - -#define _SC_ARG_MAX 0 -#define _SC_CHILD_MAX 1 -#define _SC_CLK_TCK 2 -#define _SC_NGROUPS_MAX 3 -#define _SC_OPEN_MAX 4 -#define _SC_JOB_CONTROL 5 -#define _SC_SAVED_IDS 6 -#define _SC_VERSION 7 -#define _SC_PAGESIZE 8 -#define _SC_PAGE_SIZE _SC_PAGESIZE -/* These are non-POSIX values we accidentally introduced in 2000 without - guarding them. Keeping them unguarded for backward compatibility. */ -#define _SC_NPROCESSORS_CONF 9 -#define _SC_NPROCESSORS_ONLN 10 -#define _SC_PHYS_PAGES 11 -#define _SC_AVPHYS_PAGES 12 -/* End of non-POSIX values. */ -#define _SC_MQ_OPEN_MAX 13 -#define _SC_MQ_PRIO_MAX 14 -#define _SC_RTSIG_MAX 15 -#define _SC_SEM_NSEMS_MAX 16 -#define _SC_SEM_VALUE_MAX 17 -#define _SC_SIGQUEUE_MAX 18 -#define _SC_TIMER_MAX 19 -#define _SC_TZNAME_MAX 20 -#define _SC_ASYNCHRONOUS_IO 21 -#define _SC_FSYNC 22 -#define _SC_MAPPED_FILES 23 -#define _SC_MEMLOCK 24 -#define _SC_MEMLOCK_RANGE 25 -#define _SC_MEMORY_PROTECTION 26 -#define _SC_MESSAGE_PASSING 27 -#define _SC_PRIORITIZED_IO 28 -#define _SC_REALTIME_SIGNALS 29 -#define _SC_SEMAPHORES 30 -#define _SC_SHARED_MEMORY_OBJECTS 31 -#define _SC_SYNCHRONIZED_IO 32 -#define _SC_TIMERS 33 -#define _SC_AIO_LISTIO_MAX 34 -#define _SC_AIO_MAX 35 -#define _SC_AIO_PRIO_DELTA_MAX 36 -#define _SC_DELAYTIMER_MAX 37 -#define _SC_THREAD_KEYS_MAX 38 -#define _SC_THREAD_STACK_MIN 39 -#define _SC_THREAD_THREADS_MAX 40 -#define _SC_TTY_NAME_MAX 41 -#define _SC_THREADS 42 -#define _SC_THREAD_ATTR_STACKADDR 43 -#define _SC_THREAD_ATTR_STACKSIZE 44 -#define _SC_THREAD_PRIORITY_SCHEDULING 45 -#define _SC_THREAD_PRIO_INHERIT 46 -/* _SC_THREAD_PRIO_PROTECT was _SC_THREAD_PRIO_CEILING in early drafts */ -#define _SC_THREAD_PRIO_PROTECT 47 -#define _SC_THREAD_PRIO_CEILING _SC_THREAD_PRIO_PROTECT -#define _SC_THREAD_PROCESS_SHARED 48 -#define _SC_THREAD_SAFE_FUNCTIONS 49 -#define _SC_GETGR_R_SIZE_MAX 50 -#define _SC_GETPW_R_SIZE_MAX 51 -#define _SC_LOGIN_NAME_MAX 52 -#define _SC_THREAD_DESTRUCTOR_ITERATIONS 53 -#define _SC_ADVISORY_INFO 54 -#define _SC_ATEXIT_MAX 55 -#define _SC_BARRIERS 56 -#define _SC_BC_BASE_MAX 57 -#define _SC_BC_DIM_MAX 58 -#define _SC_BC_SCALE_MAX 59 -#define _SC_BC_STRING_MAX 60 -#define _SC_CLOCK_SELECTION 61 -#define _SC_COLL_WEIGHTS_MAX 62 -#define _SC_CPUTIME 63 -#define _SC_EXPR_NEST_MAX 64 -#define _SC_HOST_NAME_MAX 65 -#define _SC_IOV_MAX 66 -#define _SC_IPV6 67 -#define _SC_LINE_MAX 68 -#define _SC_MONOTONIC_CLOCK 69 -#define _SC_RAW_SOCKETS 70 -#define _SC_READER_WRITER_LOCKS 71 -#define _SC_REGEXP 72 -#define _SC_RE_DUP_MAX 73 -#define _SC_SHELL 74 -#define _SC_SPAWN 75 -#define _SC_SPIN_LOCKS 76 -#define _SC_SPORADIC_SERVER 77 -#define _SC_SS_REPL_MAX 78 -#define _SC_SYMLOOP_MAX 79 -#define _SC_THREAD_CPUTIME 80 -#define _SC_THREAD_SPORADIC_SERVER 81 -#define _SC_TIMEOUTS 82 -#define _SC_TRACE 83 -#define _SC_TRACE_EVENT_FILTER 84 -#define _SC_TRACE_EVENT_NAME_MAX 85 -#define _SC_TRACE_INHERIT 86 -#define _SC_TRACE_LOG 87 -#define _SC_TRACE_NAME_MAX 88 -#define _SC_TRACE_SYS_MAX 89 -#define _SC_TRACE_USER_EVENT_MAX 90 -#define _SC_TYPED_MEMORY_OBJECTS 91 -#define _SC_V7_ILP32_OFF32 92 -#define _SC_V6_ILP32_OFF32 _SC_V7_ILP32_OFF32 -#define _SC_XBS5_ILP32_OFF32 _SC_V7_ILP32_OFF32 -#define _SC_V7_ILP32_OFFBIG 93 -#define _SC_V6_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG -#define _SC_XBS5_ILP32_OFFBIG _SC_V7_ILP32_OFFBIG -#define _SC_V7_LP64_OFF64 94 -#define _SC_V6_LP64_OFF64 _SC_V7_LP64_OFF64 -#define _SC_XBS5_LP64_OFF64 _SC_V7_LP64_OFF64 -#define _SC_V7_LPBIG_OFFBIG 95 -#define _SC_V6_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG -#define _SC_XBS5_LPBIG_OFFBIG _SC_V7_LPBIG_OFFBIG -#define _SC_XOPEN_CRYPT 96 -#define _SC_XOPEN_ENH_I18N 97 -#define _SC_XOPEN_LEGACY 98 -#define _SC_XOPEN_REALTIME 99 -#define _SC_STREAM_MAX 100 -#define _SC_PRIORITY_SCHEDULING 101 -#define _SC_XOPEN_REALTIME_THREADS 102 -#define _SC_XOPEN_SHM 103 -#define _SC_XOPEN_STREAMS 104 -#define _SC_XOPEN_UNIX 105 -#define _SC_XOPEN_VERSION 106 -#define _SC_2_CHAR_TERM 107 -#define _SC_2_C_BIND 108 -#define _SC_2_C_DEV 109 -#define _SC_2_FORT_DEV 110 -#define _SC_2_FORT_RUN 111 -#define _SC_2_LOCALEDEF 112 -#define _SC_2_PBS 113 -#define _SC_2_PBS_ACCOUNTING 114 -#define _SC_2_PBS_CHECKPOINT 115 -#define _SC_2_PBS_LOCATE 116 -#define _SC_2_PBS_MESSAGE 117 -#define _SC_2_PBS_TRACK 118 -#define _SC_2_SW_DEV 119 -#define _SC_2_UPE 120 -#define _SC_2_VERSION 121 -#define _SC_THREAD_ROBUST_PRIO_INHERIT 122 -#define _SC_THREAD_ROBUST_PRIO_PROTECT 123 -#define _SC_XOPEN_UUCP 124 - -/* - * pathconf values per IEEE Std 1003.1, 2008 Edition - */ - -#define _PC_LINK_MAX 0 -#define _PC_MAX_CANON 1 -#define _PC_MAX_INPUT 2 -#define _PC_NAME_MAX 3 -#define _PC_PATH_MAX 4 -#define _PC_PIPE_BUF 5 -#define _PC_CHOWN_RESTRICTED 6 -#define _PC_NO_TRUNC 7 -#define _PC_VDISABLE 8 -#define _PC_ASYNC_IO 9 -#define _PC_PRIO_IO 10 -#define _PC_SYNC_IO 11 -#define _PC_FILESIZEBITS 12 -#define _PC_2_SYMLINKS 13 -#define _PC_SYMLINK_MAX 14 -#define _PC_ALLOC_SIZE_MIN 15 -#define _PC_REC_INCR_XFER_SIZE 16 -#define _PC_REC_MAX_XFER_SIZE 17 -#define _PC_REC_MIN_XFER_SIZE 18 -#define _PC_REC_XFER_ALIGN 19 -#define _PC_TIMESTAMP_RESOLUTION 20 -#ifdef __CYGWIN__ -/* Ask for POSIX permission bits support. */ -#define _PC_POSIX_PERMISSIONS 90 -/* Ask for full POSIX permission support including uid/gid settings. */ -#define _PC_POSIX_SECURITY 91 -#endif - -/* - * confstr values per IEEE Std 1003.1, 2004 Edition - */ - -#ifdef __CYGWIN__ /* Only defined on Cygwin for now. */ -#define _CS_PATH 0 -#define _CS_POSIX_V7_ILP32_OFF32_CFLAGS 1 -#define _CS_POSIX_V6_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS -#define _CS_XBS5_ILP32_OFF32_CFLAGS _CS_POSIX_V7_ILP32_OFF32_CFLAGS -#define _CS_POSIX_V7_ILP32_OFF32_LDFLAGS 2 -#define _CS_POSIX_V6_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS -#define _CS_XBS5_ILP32_OFF32_LDFLAGS _CS_POSIX_V7_ILP32_OFF32_LDFLAGS -#define _CS_POSIX_V7_ILP32_OFF32_LIBS 3 -#define _CS_POSIX_V6_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS -#define _CS_XBS5_ILP32_OFF32_LIBS _CS_POSIX_V7_ILP32_OFF32_LIBS -#define _CS_XBS5_ILP32_OFF32_LINTFLAGS 4 -#define _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS 5 -#define _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS -#define _CS_XBS5_ILP32_OFFBIG_CFLAGS _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS -#define _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS 6 -#define _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS -#define _CS_XBS5_ILP32_OFFBIG_LDFLAGS _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS -#define _CS_POSIX_V7_ILP32_OFFBIG_LIBS 7 -#define _CS_POSIX_V6_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS -#define _CS_XBS5_ILP32_OFFBIG_LIBS _CS_POSIX_V7_ILP32_OFFBIG_LIBS -#define _CS_XBS5_ILP32_OFFBIG_LINTFLAGS 8 -#define _CS_POSIX_V7_LP64_OFF64_CFLAGS 9 -#define _CS_POSIX_V6_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS -#define _CS_XBS5_LP64_OFF64_CFLAGS _CS_POSIX_V7_LP64_OFF64_CFLAGS -#define _CS_POSIX_V7_LP64_OFF64_LDFLAGS 10 -#define _CS_POSIX_V6_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS -#define _CS_XBS5_LP64_OFF64_LDFLAGS _CS_POSIX_V7_LP64_OFF64_LDFLAGS -#define _CS_POSIX_V7_LP64_OFF64_LIBS 11 -#define _CS_POSIX_V6_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS -#define _CS_XBS5_LP64_OFF64_LIBS _CS_POSIX_V7_LP64_OFF64_LIBS -#define _CS_XBS5_LP64_OFF64_LINTFLAGS 12 -#define _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS 13 -#define _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS -#define _CS_XBS5_LPBIG_OFFBIG_CFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS -#define _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS 14 -#define _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS -#define _CS_XBS5_LPBIG_OFFBIG_LDFLAGS _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS -#define _CS_POSIX_V7_LPBIG_OFFBIG_LIBS 15 -#define _CS_POSIX_V6_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS -#define _CS_XBS5_LPBIG_OFFBIG_LIBS _CS_POSIX_V7_LPBIG_OFFBIG_LIBS -#define _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS 16 -#define _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS 17 -#define _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS -#define _CS_XBS5_WIDTH_RESTRICTED_ENVS _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS -#define _CS_POSIX_V7_THREADS_CFLAGS 18 -#define _CS_POSIX_V7_THREADS_LDFLAGS 19 -#define _CS_V7_ENV 20 -#define _CS_V6_ENV _CS_V7_ENV -#endif - -#ifdef __cplusplus -} -#endif -#endif /* _SYS_UNISTD_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/utime.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/utime.h deleted file mode 100644 index 5e937f103..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/utime.h +++ /dev/null @@ -1,22 +0,0 @@ -#ifndef _SYS_UTIME_H -#define _SYS_UTIME_H - -/* This is a dummy file, not customized for any - particular system. If there is a utime.h in libc/sys/SYSDIR/sys, - it will override this one. */ - -#ifdef __cplusplus -extern "C" { -#endif - -struct utimbuf -{ - time_t actime; - time_t modtime; -}; - -#ifdef __cplusplus -}; -#endif - -#endif /* _SYS_UTIME_H */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/sys/wait.h b/tools/sdk/libc/xtensa-lx106-elf/include/sys/wait.h deleted file mode 100644 index 73fe37202..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/sys/wait.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef _SYS_WAIT_H -#define _SYS_WAIT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#define WNOHANG 1 -#define WUNTRACED 2 - -/* A status looks like: - <2 bytes info> <2 bytes code> - - == 0, child has exited, info is the exit value - == 1..7e, child has exited, info is the signal number. - == 7f, child has stopped, info was the signal number. - == 80, there was a core dump. -*/ - -#define WIFEXITED(w) (((w) & 0xff) == 0) -#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) -#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) -#define WEXITSTATUS(w) (((w) >> 8) & 0xff) -#define WTERMSIG(w) ((w) & 0x7f) -#define WSTOPSIG WEXITSTATUS - -pid_t wait (int *); -pid_t waitpid (pid_t, int *, int); - -#ifdef _COMPILING_NEWLIB -pid_t _wait (int *); -#endif - -/* Provide prototypes for most of the _ names that are - provided in newlib for some compilers. */ -pid_t _wait (int *); - -#ifdef __cplusplus -}; -#endif - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/tar.h b/tools/sdk/libc/xtensa-lx106-elf/include/tar.h deleted file mode 100644 index 07b06dd7f..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/tar.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * tar.h - */ - -#ifndef _TAR_H -#define _TAR_H - -/* General definitions */ -#define TMAGIC "ustar" /* ustar plus null byte. */ -#define TMAGLEN 6 /* Length of the above. */ -#define TVERSION "00" /* 00 without a null byte. */ -#define TVERSLEN 2 /* Length of the above. */ - -/* Typeflag field definitions */ -#define REGTYPE '0' /* Regular file. */ -#define AREGTYPE '\0' /* Regular file. */ -#define LNKTYPE '1' /* Link. */ -#define SYMTYPE '2' /* Symbolic link. */ -#define CHRTYPE '3' /* Character special. */ -#define BLKTYPE '4' /* Block special. */ -#define DIRTYPE '5' /* Directory. */ -#define FIFOTYPE '6' /* FIFO special. */ -#define CONTTYPE '7' /* Reserved. */ - -/* Mode field bit definitions (octal) */ -#define TSUID 04000 /* Set UID on execution. */ -#define TSGID 02000 /* Set GID on execution. */ -#define TSVTX 01000 /* On directories, restricted deletion flag. */ -#define TUREAD 00400 /* Read by owner. */ -#define TUWRITE 00200 /* Write by owner. */ -#define TUEXEC 00100 /* Execute/search by owner. */ -#define TGREAD 00040 /* Read by group. */ -#define TGWRITE 00020 /* Write by group. */ -#define TGEXEC 00010 /* Execute/search by group. */ -#define TOREAD 00004 /* Read by other. */ -#define TOWRITE 00002 /* Write by other. */ -#define TOEXEC 00001 /* Execute/search by other. */ - -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/termios.h b/tools/sdk/libc/xtensa-lx106-elf/include/termios.h deleted file mode 100644 index ee1820ce0..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/termios.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/tgmath.h b/tools/sdk/libc/xtensa-lx106-elf/include/tgmath.h deleted file mode 100644 index f9c8311cc..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/tgmath.h +++ /dev/null @@ -1,184 +0,0 @@ -/* http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/tgmath.h.html */ -/*- - * Copyright (c) 2004 Stefan Farfeleder. - * All rights reserved. - * - * 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. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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. - * - * $FreeBSD$ - */ - -#ifndef _TGMATH_H_ -#define _TGMATH_H_ - -#include -#include - -#ifdef log2 -#undef log2 -#endif - -/* - * This implementation of requires two implementation-dependent - * macros to be defined: - * __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) - * Invokes fnl() if the corresponding real type of x, y or z is long - * double, fn() if it is double or any has an integer type, and fnf() - * otherwise. - * __tg_impl_full(x, y, z, fn, fnf, fnl, cfn, cfnf, cfnl, ...) - * Invokes [c]fnl() if the corresponding real type of x, y or z is long - * double, [c]fn() if it is double or any has an integer type, and - * [c]fnf() otherwise. The function with the 'c' prefix is called if - * any of x, y or z is a complex number. - * Both macros call the chosen function with all additional arguments passed - * to them, as given by __VA_ARGS__. - * - * Note that these macros cannot be implemented with C's ?: operator, - * because the return type of the whole expression would incorrectly be long - * double complex regardless of the argument types. - */ - -/* requires GCC >= 3.1 */ -#if !__GNUC_PREREQ (3, 1) -#error " not implemented for this compiler" -#endif - -#define __tg_type(__e, __t) \ - __builtin_types_compatible_p(__typeof__(__e), __t) -#define __tg_type3(__e1, __e2, __e3, __t) \ - (__tg_type(__e1, __t) || __tg_type(__e2, __t) || \ - __tg_type(__e3, __t)) -#define __tg_type_corr(__e1, __e2, __e3, __t) \ - (__tg_type3(__e1, __e2, __e3, __t) || \ - __tg_type3(__e1, __e2, __e3, __t _Complex)) -#define __tg_integer(__e1, __e2, __e3) \ - (((__typeof__(__e1))1.5 == 1) || ((__typeof__(__e2))1.5 == 1) || \ - ((__typeof__(__e3))1.5 == 1)) -#define __tg_is_complex(__e1, __e2, __e3) \ - (__tg_type3(__e1, __e2, __e3, float _Complex) || \ - __tg_type3(__e1, __e2, __e3, double _Complex) || \ - __tg_type3(__e1, __e2, __e3, long double _Complex) || \ - __tg_type3(__e1, __e2, __e3, __typeof__(_Complex_I))) - -#ifdef _LDBL_EQ_DBL -#define __tg_impl_simple(x, y, z, fn, fnf, fnl, ...) \ - __builtin_choose_expr(__tg_type_corr(x, y, z, long double), \ - fnl(__VA_ARGS__), __builtin_choose_expr( \ - __tg_type_corr(x, y, z, double) || __tg_integer(x, y, z),\ - fn(__VA_ARGS__), fnf(__VA_ARGS__))) -#else -#define __tg_impl_simple(__x, __y, __z, __fn, __fnf, __fnl, ...) \ - (__tg_type_corr(__x, __y, __z, double) || __tg_integer(__x, __y, __z)) \ - ? __fn(__VA_ARGS__) : __fnf(__VA_ARGS__) -#endif - -#define __tg_impl_full(__x, __y, __z, __fn, __fnf, __fnl, __cfn, __cfnf, __cfnl, ...) \ - __builtin_choose_expr(__tg_is_complex(__x, __y, __z), \ - __tg_impl_simple(__x, __y, __z, __cfn, __cfnf, __cfnl, __VA_ARGS__), \ - __tg_impl_simple(__x, __y, __z, __fn, __fnf, __fnl, __VA_ARGS__)) - -/* Macros to save lots of repetition below */ -#define __tg_simple(__x, __fn) \ - __tg_impl_simple(__x, __x, __x, __fn, __fn##f, __fn##l, __x) -#define __tg_simple2(__x, __y, __fn) \ - __tg_impl_simple(__x, __x, __y, __fn, __fn##f, __fn##l, __x, __y) -#define __tg_simplev(__x, __fn, ...) \ - __tg_impl_simple(__x, __x, __x, __fn, __fn##f, __fn##l, __VA_ARGS__) -#define __tg_full(__x, __fn) \ - __tg_impl_full(__x, __x, __x, __fn, __fn##f, __fn##l, c##__fn, c##__fn##f, c##__fn##l, __x) - -/* 7.22#4 -- These macros expand to real or complex functions, depending on - * the type of their arguments. */ -#define acos(__x) __tg_full(__x, acos) -#define asin(__x) __tg_full(__x, asin) -#define atan(__x) __tg_full(__x, atan) -#define acosh(__x) __tg_full(__x, acosh) -#define asinh(__x) __tg_full(__x, asinh) -#define atanh(__x) __tg_full(__x, atanh) -#define cos(__x) __tg_full(__x, cos) -#define sin(__x) __tg_full(__x, sin) -#define tan(__x) __tg_full(__x, tan) -#define cosh(__x) __tg_full(__x, cosh) -#define sinh(__x) __tg_full(__x, sinh) -#define tanh(__x) __tg_full(__x, tanh) -#define exp(__x) __tg_full(__x, exp) -#define log(__x) __tg_full(__x, log) -#define pow(__x, __y) __tg_impl_full(__x, __x, __y, pow, powf, powl, \ - cpow, cpowf, cpowl, __x, __y) -#define sqrt(__x) __tg_full(__x, sqrt) - -/* "The corresponding type-generic macro for fabs and cabs is fabs." */ -#define fabs(__x) __tg_impl_full(__x, __x, __x, fabs, fabsf, fabsl, \ - cabs, cabsf, cabsl, __x) - -/* 7.22#5 -- These macros are only defined for arguments with real type. */ -#define atan2(__x, __y) __tg_simple2(__x, __y, atan2) -#define cbrt(__x) __tg_simple(__x, cbrt) -#define ceil(__x) __tg_simple(__x, ceil) -#define copysign(__x, __y) __tg_simple2(__x, __y, copysign) -#define erf(__x) __tg_simple(__x, erf) -#define erfc(__x) __tg_simple(__x, erfc) -#define exp2(__x) __tg_simple(__x, exp2) -#define expm1(__x) __tg_simple(__x, expm1) -#define fdim(__x, __y) __tg_simple2(__x, __y, fdim) -#define floor(__x) __tg_simple(__x, floor) -#define fma(__x, __y, __z) __tg_impl_simple(__x, __y, __z, fma, fmaf, fmal, \ - __x, __y, __z) -#define fmax(__x, __y) __tg_simple2(__x, __y, fmax) -#define fmin(__x, __y) __tg_simple2(__x, __y, fmin) -#define fmod(__x, __y) __tg_simple2(__x, __y, fmod) -#define frexp(__x, __y) __tg_simplev(__x, frexp, __x, __y) -#define hypot(__x, __y) __tg_simple2(__x, __y, hypot) -#define ilogb(__x) __tg_simple(__x, ilogb) -#define ldexp(__x, __y) __tg_simplev(__x, ldexp, __x, __y) -#define lgamma(__x) __tg_simple(__x, lgamma) -#define llrint(__x) __tg_simple(__x, llrint) -#define llround(__x) __tg_simple(__x, llround) -#define log10(__x) __tg_simple(__x, log10) -#define log1p(__x) __tg_simple(__x, log1p) -#define log2(__x) __tg_simple(__x, log2) -#define logb(__x) __tg_simple(__x, logb) -#define lrint(__x) __tg_simple(__x, lrint) -#define lround(__x) __tg_simple(__x, lround) -#define nearbyint(__x) __tg_simple(__x, nearbyint) -#define nextafter(__x, __y) __tg_simple2(__x, __y, nextafter) -/* not yet implemented even for _LDBL_EQ_DBL platforms -#define nexttoward(__x, __y) __tg_simplev(__x, nexttoward, __x, __y) -*/ -#define remainder(__x, __y) __tg_simple2(__x, __y, remainder) -#define remquo(__x, __y, __z) __tg_impl_simple(__x, __x, __y, remquo, remquof, \ - remquol, __x, __y, __z) -#define rint(__x) __tg_simple(__x, rint) -#define round(__x) __tg_simple(__x, round) -#define scalbn(__x, __y) __tg_simplev(__x, scalbn, __x, __y) -#define scalbln(__x, __y) __tg_simplev(__x, scalbln, __x, __y) -#define tgamma(__x) __tg_simple(__x, tgamma) -#define trunc(__x) __tg_simple(__x, trunc) - -/* 7.22#6 -- These macros always expand to complex functions. */ -#define carg(__x) __tg_simple(__x, carg) -#define cimag(__x) __tg_simple(__x, cimag) -#define conj(__x) __tg_simple(__x, conj) -#define cproj(__x) __tg_simple(__x, cproj) -#define creal(__x) __tg_simple(__x, creal) - -#endif /* !_TGMATH_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/time.h b/tools/sdk/libc/xtensa-lx106-elf/include/time.h deleted file mode 100644 index d7b6612db..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/time.h +++ /dev/null @@ -1,291 +0,0 @@ -/* - * time.h - * - * Struct and function declarations for dealing with time. - */ - -#ifndef _TIME_H_ -#define _TIME_H_ - -#include "_ansi.h" -#include - -#define __need_size_t -#define __need_NULL -#include - -/* Get _CLOCKS_PER_SEC_ */ -#include - -#ifndef _CLOCKS_PER_SEC_ -#define _CLOCKS_PER_SEC_ 1000 -#endif - -#define CLOCKS_PER_SEC _CLOCKS_PER_SEC_ -#define CLK_TCK CLOCKS_PER_SEC - -#include - -_BEGIN_STD_C - -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; -#ifdef __TM_GMTOFF - long __TM_GMTOFF; -#endif -#ifdef __TM_ZONE - const char *__TM_ZONE; -#endif -}; - -clock_t _EXFUN(clock, (void)); -double _EXFUN(difftime, (time_t _time2, time_t _time1)); -time_t _EXFUN(mktime, (struct tm *_timeptr)); -time_t _EXFUN(time, (time_t *_timer)); -#ifndef _REENT_ONLY -char *_EXFUN(asctime, (const struct tm *_tblock)); -char *_EXFUN(ctime, (const time_t *_time)); -struct tm *_EXFUN(gmtime, (const time_t *_timer)); -struct tm *_EXFUN(localtime,(const time_t *_timer)); -#endif -size_t _EXFUN(strftime, (char *__restrict _s, - size_t _maxsize, const char *__restrict _fmt, - const struct tm *__restrict _t)); - -char *_EXFUN(asctime_r, (const struct tm *__restrict, - char *__restrict)); -char *_EXFUN(ctime_r, (const time_t *, char *)); -struct tm *_EXFUN(gmtime_r, (const time_t *__restrict, - struct tm *__restrict)); -struct tm *_EXFUN(localtime_r, (const time_t *__restrict, - struct tm *__restrict)); - -_END_STD_C - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef __STRICT_ANSI__ -char *_EXFUN(strptime, (const char *__restrict, - const char *__restrict, - struct tm *__restrict)); -_VOID _EXFUN(tzset, (_VOID)); -_VOID _EXFUN(_tzset_r, (struct _reent *)); - -typedef struct __tzrule_struct -{ - char ch; - int m; - int n; - int d; - int s; - time_t change; - long offset; /* Match type of _timezone. */ -} __tzrule_type; - -typedef struct __tzinfo_struct -{ - int __tznorth; - int __tzyear; - __tzrule_type __tzrule[2]; -} __tzinfo_type; - -__tzinfo_type *_EXFUN (__gettzinfo, (_VOID)); - -/* getdate functions */ - -#ifdef HAVE_GETDATE -#ifndef _REENT_ONLY -#define getdate_err (*__getdate_err()) -int *_EXFUN(__getdate_err,(_VOID)); - -struct tm * _EXFUN(getdate, (const char *)); -/* getdate_err is set to one of the following values to indicate the error. - 1 the DATEMSK environment variable is null or undefined, - 2 the template file cannot be opened for reading, - 3 failed to get file status information, - 4 the template file is not a regular file, - 5 an error is encountered while reading the template file, - 6 memory allication failed (not enough memory available), - 7 there is no line in the template that matches the input, - 8 invalid input specification */ -#endif /* !_REENT_ONLY */ - -/* getdate_r returns the error code as above */ -int _EXFUN(getdate_r, (const char *, struct tm *)); -#endif /* HAVE_GETDATE */ - -/* defines for the opengroup specifications Derived from Issue 1 of the SVID. */ -extern __IMPORT long _timezone; -extern __IMPORT int _daylight; -extern __IMPORT char *_tzname[2]; - -/* POSIX defines the external tzname being defined in time.h */ -#ifndef tzname -#define tzname _tzname -#endif -#endif /* !__STRICT_ANSI__ */ - -#ifdef __cplusplus -} -#endif - -#include - -#ifdef __CYGWIN__ -#include -#endif /*__CYGWIN__*/ - -#if defined(_POSIX_TIMERS) - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -/* Clocks, P1003.1b-1993, p. 263 */ - -int _EXFUN(clock_settime, (clockid_t clock_id, const struct timespec *tp)); -int _EXFUN(clock_gettime, (clockid_t clock_id, struct timespec *tp)); -int _EXFUN(clock_getres, (clockid_t clock_id, struct timespec *res)); - -/* Create a Per-Process Timer, P1003.1b-1993, p. 264 */ - -int _EXFUN(timer_create, - (clockid_t clock_id, - struct sigevent *__restrict evp, - timer_t *__restrict timerid)); - -/* Delete a Per_process Timer, P1003.1b-1993, p. 266 */ - -int _EXFUN(timer_delete, (timer_t timerid)); - -/* Per-Process Timers, P1003.1b-1993, p. 267 */ - -int _EXFUN(timer_settime, - (timer_t timerid, int flags, - const struct itimerspec *__restrict value, - struct itimerspec *__restrict ovalue)); -int _EXFUN(timer_gettime, (timer_t timerid, struct itimerspec *value)); -int _EXFUN(timer_getoverrun, (timer_t timerid)); - -/* High Resolution Sleep, P1003.1b-1993, p. 269 */ - -int _EXFUN(nanosleep, (const struct timespec *rqtp, struct timespec *rmtp)); - -#ifdef __cplusplus -} -#endif -#endif /* _POSIX_TIMERS */ - -#if defined(_POSIX_CLOCK_SELECTION) - -#ifdef __cplusplus -extern "C" { -#endif - -int _EXFUN(clock_nanosleep, - (clockid_t clock_id, int flags, const struct timespec *rqtp, - struct timespec *rmtp)); - -#ifdef __cplusplus -} -#endif - -#endif /* _POSIX_CLOCK_SELECTION */ - -#ifdef __cplusplus -extern "C" { -#endif - -/* CPU-time Clock Attributes, P1003.4b/D8, p. 54 */ - -/* values for the clock enable attribute */ - -#define CLOCK_ENABLED 1 /* clock is enabled, i.e. counting execution time */ -#define CLOCK_DISABLED 0 /* clock is disabled */ - -/* values for the pthread cputime_clock_allowed attribute */ - -#define CLOCK_ALLOWED 1 /* If a thread is created with this value a */ - /* CPU-time clock attached to that thread */ - /* shall be accessible. */ -#define CLOCK_DISALLOWED 0 /* If a thread is created with this value, the */ - /* thread shall not have a CPU-time clock */ - /* accessible. */ - -/* Manifest Constants, P1003.1b-1993, p. 262 */ - -#define CLOCK_REALTIME (clockid_t)1 - -/* Flag indicating time is "absolute" with respect to the clock - associated with a time. */ - -#define TIMER_ABSTIME 4 - -/* Manifest Constants, P1003.4b/D8, p. 55 */ - -#if defined(_POSIX_CPUTIME) - -/* When used in a clock or timer function call, this is interpreted as - the identifier of the CPU_time clock associated with the PROCESS - making the function call. */ - -#define CLOCK_PROCESS_CPUTIME_ID (clockid_t)2 - -#endif - -#if defined(_POSIX_THREAD_CPUTIME) - -/* When used in a clock or timer function call, this is interpreted as - the identifier of the CPU_time clock associated with the THREAD - making the function call. */ - -#define CLOCK_THREAD_CPUTIME_ID (clockid_t)3 - -#endif - -#if defined(_POSIX_MONOTONIC_CLOCK) - -/* The identifier for the system-wide monotonic clock, which is defined - * as a clock whose value cannot be set via clock_settime() and which - * cannot have backward clock jumps. */ - -#define CLOCK_MONOTONIC (clockid_t)4 - -#endif - -#if defined(_POSIX_CPUTIME) - -/* Accessing a Process CPU-time CLock, P1003.4b/D8, p. 55 */ - -int _EXFUN(clock_getcpuclockid, (pid_t pid, clockid_t *clock_id)); - -#endif /* _POSIX_CPUTIME */ - -#if defined(_POSIX_CPUTIME) || defined(_POSIX_THREAD_CPUTIME) - -/* CPU-time Clock Attribute Access, P1003.4b/D8, p. 56 */ - -int _EXFUN(clock_setenable_attr, (clockid_t clock_id, int attr)); -int _EXFUN(clock_getenable_attr, (clockid_t clock_id, int *attr)); - -#endif /* _POSIX_CPUTIME or _POSIX_THREAD_CPUTIME */ - -#ifdef __cplusplus -} -#endif - -#endif /* _TIME_H_ */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/unctrl.h b/tools/sdk/libc/xtensa-lx106-elf/include/unctrl.h deleted file mode 100644 index 004075232..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/unctrl.h +++ /dev/null @@ -1,46 +0,0 @@ -/* From curses.h. */ -/* - * Copyright (c) 1981, 1993 - * The Regents of the University of California. All rights reserved. - * - * 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. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``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 REGENTS OR CONTRIBUTORS 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. - */ - -#ifndef _UNCTRL_H_ -#define _UNCTRL_H_ - -#include <_ansi.h> - -#define unctrl(c) __unctrl[(c) & 0xff] -#define unctrllen(ch) __unctrllen[(ch) & 0xff] - -extern __IMPORT _CONST char * _CONST __unctrl[256]; /* Control strings. */ -extern __IMPORT _CONST char __unctrllen[256]; /* Control strings length. */ - -#endif /* _UNCTRL_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/unistd.h b/tools/sdk/libc/xtensa-lx106-elf/include/unistd.h deleted file mode 100644 index 4f6fd29a4..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/unistd.h +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef _UNISTD_H_ -#define _UNISTD_H_ - -# include - -#ifndef L_SET -/* Old BSD names for the same constants; just for compatibility. */ -#define L_SET SEEK_SET -#define L_INCR SEEK_CUR -#define L_XTND SEEK_END -#endif - -#endif /* _UNISTD_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/utime.h b/tools/sdk/libc/xtensa-lx106-elf/include/utime.h deleted file mode 100644 index 652891aab..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/utime.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -#include <_ansi.h> - -/* The utime function is defined in libc/sys//sys if it exists. */ -#include - -#ifdef __cplusplus -} -#endif diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/utmp.h b/tools/sdk/libc/xtensa-lx106-elf/include/utmp.h deleted file mode 100644 index 88cf6f852..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/utmp.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif -#include -#ifdef __cplusplus -} -#endif - diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/wchar.h b/tools/sdk/libc/xtensa-lx106-elf/include/wchar.h deleted file mode 100644 index 810a6c0e3..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/wchar.h +++ /dev/null @@ -1,254 +0,0 @@ -#ifndef _WCHAR_H_ -#define _WCHAR_H_ - -#include <_ansi.h> - -#include - -#define __need_size_t -#define __need_wchar_t -#define __need_wint_t -#define __need_NULL -#include - -#define __need___va_list -#include - -/* For _mbstate_t definition. */ -#include -#include -/* For __STDC_ISO_10646__ */ -#include - -#ifndef WEOF -# define WEOF ((wint_t)-1) -#endif - -/* This must match definition in */ -#ifndef WCHAR_MIN -#ifdef __WCHAR_MIN__ -#define WCHAR_MIN __WCHAR_MIN__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MIN (0 + L'\0') -#else -#define WCHAR_MIN (-0x7fffffff - 1 + L'\0') -#endif -#endif - -/* This must match definition in */ -#ifndef WCHAR_MAX -#ifdef __WCHAR_MAX__ -#define WCHAR_MAX __WCHAR_MAX__ -#elif defined(__WCHAR_UNSIGNED__) || (L'\0' - 1 > 0) -#define WCHAR_MAX (0xffffffffu + L'\0') -#else -#define WCHAR_MAX (0x7fffffff + L'\0') -#endif -#endif - -_BEGIN_STD_C - -/* As in stdio.h, defines __FILE. */ -typedef __FILE FILE; - -/* As required by POSIX.1-2008, declare tm as incomplete type. - The actual definition is in time.h. */ -struct tm; - -#ifndef _MBSTATE_T -#define _MBSTATE_T -typedef _mbstate_t mbstate_t; -#endif /* _MBSTATE_T */ - -wint_t _EXFUN(btowc, (int)); -int _EXFUN(wctob, (wint_t)); -size_t _EXFUN(mbrlen, (const char *__restrict, size_t, mbstate_t *__restrict)); -size_t _EXFUN(mbrtowc, (wchar_t *__restrict, const char *__restrict, size_t, - mbstate_t *__restrict)); -size_t _EXFUN(_mbrtowc_r, (struct _reent *, wchar_t * , const char * , - size_t, mbstate_t *)); -int _EXFUN(mbsinit, (const mbstate_t *)); -size_t _EXFUN(mbsnrtowcs, (wchar_t *__restrict, const char **__restrict, - size_t, size_t, mbstate_t *__restrict)); -size_t _EXFUN(_mbsnrtowcs_r, (struct _reent *, wchar_t * , const char ** , - size_t, size_t, mbstate_t *)); -size_t _EXFUN(mbsrtowcs, (wchar_t *__restrict, const char **__restrict, size_t, - mbstate_t *__restrict)); -size_t _EXFUN(_mbsrtowcs_r, (struct _reent *, wchar_t * , const char ** , size_t, mbstate_t *)); -size_t _EXFUN(wcrtomb, (char *__restrict, wchar_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcrtomb_r, (struct _reent *, char * , wchar_t, mbstate_t *)); -size_t _EXFUN(wcsnrtombs, (char *__restrict, const wchar_t **__restrict, - size_t, size_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcsnrtombs_r, (struct _reent *, char * , const wchar_t ** , - size_t, size_t, mbstate_t *)); -size_t _EXFUN(wcsrtombs, (char *__restrict, const wchar_t **__restrict, - size_t, mbstate_t *__restrict)); -size_t _EXFUN(_wcsrtombs_r, (struct _reent *, char * , const wchar_t ** , - size_t, mbstate_t *)); -int _EXFUN(wcscasecmp, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcscat, (wchar_t *__restrict, const wchar_t *__restrict)); -wchar_t *_EXFUN(wcschr, (const wchar_t *, wchar_t)); -int _EXFUN(wcscmp, (const wchar_t *, const wchar_t *)); -int _EXFUN(wcscoll, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcscpy, (wchar_t *__restrict, const wchar_t *__restrict)); -wchar_t *_EXFUN(wcpcpy, (wchar_t *__restrict, - const wchar_t *__restrict)); -wchar_t *_EXFUN(wcsdup, (const wchar_t *)); -wchar_t *_EXFUN(_wcsdup_r, (struct _reent *, const wchar_t * )); -size_t _EXFUN(wcscspn, (const wchar_t *, const wchar_t *)); -size_t _EXFUN(wcsftime, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, const struct tm *__restrict)); -size_t _EXFUN(wcslcat, (wchar_t *, const wchar_t *, size_t)); -size_t _EXFUN(wcslcpy, (wchar_t *, const wchar_t *, size_t)); -size_t _EXFUN(wcslen, (const wchar_t *)); -int _EXFUN(wcsncasecmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wcsncat, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -int _EXFUN(wcsncmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wcsncpy, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -wchar_t *_EXFUN(wcpncpy, (wchar_t *__restrict, - const wchar_t *__restrict, size_t)); -size_t _EXFUN(wcsnlen, (const wchar_t *, size_t)); -wchar_t *_EXFUN(wcspbrk, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcsrchr, (const wchar_t *, wchar_t)); -size_t _EXFUN(wcsspn, (const wchar_t *, const wchar_t *)); -wchar_t *_EXFUN(wcsstr, (const wchar_t *__restrict, - const wchar_t *__restrict)); -wchar_t *_EXFUN(wcstok, (wchar_t *__restrict, const wchar_t *__restrict, - wchar_t **__restrict)); -double _EXFUN(wcstod, (const wchar_t *__restrict, wchar_t **__restrict)); -double _EXFUN(_wcstod_r, (struct _reent *, const wchar_t *, wchar_t **)); -float _EXFUN(wcstof, (const wchar_t *__restrict, wchar_t **__restrict)); -float _EXFUN(_wcstof_r, (struct _reent *, const wchar_t *, wchar_t **)); -#ifdef _LDBL_EQ_DBL -long double _EXFUN(wcstold, (const wchar_t *, wchar_t **)); -#endif /* _LDBL_EQ_DBL */ -int _EXFUN(wcswidth, (const wchar_t *, size_t)); -size_t _EXFUN(wcsxfrm, (wchar_t *__restrict, const wchar_t *__restrict, - size_t)); -int _EXFUN(wcwidth, (const wchar_t)); -wchar_t *_EXFUN(wmemchr, (const wchar_t *, wchar_t, size_t)); -int _EXFUN(wmemcmp, (const wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wmemcpy, (wchar_t *__restrict, const wchar_t *__restrict, - size_t)); -wchar_t *_EXFUN(wmemmove, (wchar_t *, const wchar_t *, size_t)); -wchar_t *_EXFUN(wmemset, (wchar_t *, wchar_t, size_t)); - -long _EXFUN(wcstol, (const wchar_t *__restrict, wchar_t **__restrict, int)); -long long _EXFUN(wcstoll, (const wchar_t *__restrict, wchar_t **__restrict, - int)); -unsigned long _EXFUN(wcstoul, (const wchar_t *__restrict, wchar_t **__restrict, - int)); -unsigned long long _EXFUN(wcstoull, (const wchar_t *__restrict, - wchar_t **__restrict, int)); -long _EXFUN(_wcstol_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -long long _EXFUN(_wcstoll_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -unsigned long _EXFUN(_wcstoul_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -unsigned long long _EXFUN(_wcstoull_r, (struct _reent *, const wchar_t *, wchar_t **, int)); -/* On platforms where long double equals double. */ -#ifdef _LDBL_EQ_DBL -long double _EXFUN(wcstold, (const wchar_t *, wchar_t **)); -#endif /* _LDBL_EQ_DBL */ - -wint_t _EXFUN(fgetwc, (__FILE *)); -wchar_t *_EXFUN(fgetws, (wchar_t *__restrict, int, __FILE *__restrict)); -wint_t _EXFUN(fputwc, (wchar_t, __FILE *)); -int _EXFUN(fputws, (const wchar_t *__restrict, __FILE *__restrict)); -int _EXFUN (fwide, (__FILE *, int)); -wint_t _EXFUN (getwc, (__FILE *)); -wint_t _EXFUN (getwchar, (void)); -wint_t _EXFUN(putwc, (wchar_t, __FILE *)); -wint_t _EXFUN(putwchar, (wchar_t)); -wint_t _EXFUN (ungetwc, (wint_t wc, __FILE *)); - -wint_t _EXFUN(_fgetwc_r, (struct _reent *, __FILE *)); -wint_t _EXFUN(_fgetwc_unlocked_r, (struct _reent *, __FILE *)); -wchar_t *_EXFUN(_fgetws_r, (struct _reent *, wchar_t *, int, __FILE *)); -wchar_t *_EXFUN(_fgetws_unlocked_r, (struct _reent *, wchar_t *, int, __FILE *)); -wint_t _EXFUN(_fputwc_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_fputwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); -int _EXFUN(_fputws_r, (struct _reent *, const wchar_t *, __FILE *)); -int _EXFUN(_fputws_unlocked_r, (struct _reent *, const wchar_t *, __FILE *)); -int _EXFUN (_fwide_r, (struct _reent *, __FILE *, int)); -wint_t _EXFUN (_getwc_r, (struct _reent *, __FILE *)); -wint_t _EXFUN (_getwc_unlocked_r, (struct _reent *, __FILE *)); -wint_t _EXFUN (_getwchar_r, (struct _reent *ptr)); -wint_t _EXFUN (_getwchar_unlocked_r, (struct _reent *ptr)); -wint_t _EXFUN(_putwc_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_putwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); -wint_t _EXFUN(_putwchar_r, (struct _reent *, wchar_t)); -wint_t _EXFUN(_putwchar_unlocked_r, (struct _reent *, wchar_t)); -wint_t _EXFUN (_ungetwc_r, (struct _reent *, wint_t wc, __FILE *)); - -#if __GNU_VISIBLE -wint_t _EXFUN(fgetwc_unlocked, (__FILE *)); -wchar_t *_EXFUN(fgetws_unlocked, (wchar_t *__restrict, int, __FILE *__restrict)); -wint_t _EXFUN(fputwc_unlocked, (wchar_t, __FILE *)); -int _EXFUN(fputws_unlocked, (const wchar_t *__restrict, __FILE *__restrict)); -wint_t _EXFUN(getwc_unlocked, (__FILE *)); -wint_t _EXFUN(getwchar_unlocked, (void)); -wint_t _EXFUN(putwc_unlocked, (wchar_t, __FILE *)); -wint_t _EXFUN(putwchar_unlocked, (wchar_t)); -#endif - -__FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *)); -__FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *)); - -#ifndef __VALIST -#ifdef __GNUC__ -#define __VALIST __gnuc_va_list -#else -#define __VALIST char* -#endif -#endif - -int _EXFUN(fwprintf, (__FILE *__restrict, const wchar_t *__restrict, ...)); -int _EXFUN(swprintf, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, ...)); -int _EXFUN(vfwprintf, (__FILE *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vswprintf, (wchar_t *__restrict, size_t, - const wchar_t *__restrict, __VALIST)); -int _EXFUN(vwprintf, (const wchar_t *__restrict, __VALIST)); -int _EXFUN(wprintf, (const wchar_t *__restrict, ...)); - -int _EXFUN(_fwprintf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); -int _EXFUN(_swprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, ...)); -int _EXFUN(_vfwprintf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); -int _EXFUN(_vswprintf_r, (struct _reent *, wchar_t *, size_t, const wchar_t *, __VALIST)); -int _EXFUN(_vwprintf_r, (struct _reent *, const wchar_t *, __VALIST)); -int _EXFUN(_wprintf_r, (struct _reent *, const wchar_t *, ...)); - -int _EXFUN(fwscanf, (__FILE *__restrict, const wchar_t *__restrict, ...)); -int _EXFUN(swscanf, (const wchar_t *__restrict, - const wchar_t *__restrict, ...)); -int _EXFUN(vfwscanf, (__FILE *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vswscanf, (const wchar_t *__restrict, const wchar_t *__restrict, - __VALIST)); -int _EXFUN(vwscanf, (const wchar_t *__restrict, __VALIST)); -int _EXFUN(wscanf, (const wchar_t *__restrict, ...)); - -int _EXFUN(_fwscanf_r, (struct _reent *, __FILE *, const wchar_t *, ...)); -int _EXFUN(_swscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, ...)); -int _EXFUN(_vfwscanf_r, (struct _reent *, __FILE *, const wchar_t *, __VALIST)); -int _EXFUN(_vswscanf_r, (struct _reent *, const wchar_t *, const wchar_t *, __VALIST)); -int _EXFUN(_vwscanf_r, (struct _reent *, const wchar_t *, __VALIST)); -int _EXFUN(_wscanf_r, (struct _reent *, const wchar_t *, ...)); - -#define getwc(fp) fgetwc(fp) -#define putwc(wc,fp) fputwc((wc), (fp)) -#define getwchar() fgetwc(_REENT->_stdin) -#define putwchar(wc) fputwc((wc), _REENT->_stdout) - -#if __GNU_VISIBLE -#define getwc_unlocked(fp) fgetwc_unlocked(fp) -#define putwc_unlocked(wc,fp) fputwc_unlocked((wc), (fp)) -#define getwchar_unlocked() fgetwc_unlocked(_REENT->_stdin) -#define putwchar_unlocked(wc) fputwc_unlocked((wc), _REENT->_stdout) -#endif - -_END_STD_C - -#endif /* _WCHAR_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/wctype.h b/tools/sdk/libc/xtensa-lx106-elf/include/wctype.h deleted file mode 100644 index c72c9decf..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/wctype.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _WCTYPE_H_ -#define _WCTYPE_H_ - -#include <_ansi.h> -#include - -#define __need_wint_t -#include - -#ifndef WEOF -# define WEOF ((wint_t)-1) -#endif - -_BEGIN_STD_C - -#ifndef _WCTYPE_T -#define _WCTYPE_T -typedef int wctype_t; -#endif - -#ifndef _WCTRANS_T -#define _WCTRANS_T -typedef int wctrans_t; -#endif - -int _EXFUN(iswalpha, (wint_t)); -int _EXFUN(iswalnum, (wint_t)); -int _EXFUN(iswblank, (wint_t)); -int _EXFUN(iswcntrl, (wint_t)); -int _EXFUN(iswctype, (wint_t, wctype_t)); -int _EXFUN(iswdigit, (wint_t)); -int _EXFUN(iswgraph, (wint_t)); -int _EXFUN(iswlower, (wint_t)); -int _EXFUN(iswprint, (wint_t)); -int _EXFUN(iswpunct, (wint_t)); -int _EXFUN(iswspace, (wint_t)); -int _EXFUN(iswupper, (wint_t)); -int _EXFUN(iswxdigit, (wint_t)); -wint_t _EXFUN(towctrans, (wint_t, wctrans_t)); -wint_t _EXFUN(towupper, (wint_t)); -wint_t _EXFUN(towlower, (wint_t)); -wctrans_t _EXFUN(wctrans, (const char *)); -wctype_t _EXFUN(wctype, (const char *)); - -_END_STD_C - -#endif /* _WCTYPE_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/wordexp.h b/tools/sdk/libc/xtensa-lx106-elf/include/wordexp.h deleted file mode 100644 index 1f09a64c5..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/wordexp.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Copyright (C) 2002, 2010 by Red Hat, Incorporated. All rights reserved. - * - * Permission to use, copy, modify, and distribute this software - * is freely granted, provided that this notice is preserved. - */ - -#ifndef _WORDEXP_H_ -#define _WORDEXP_H_ - -#include - -#ifdef __cplusplus -extern "C" { -#endif - -struct _wordexp_t -{ - size_t we_wordc; /* Count of words matched by words. */ - char **we_wordv; /* Pointer to list of expanded words. */ - size_t we_offs; /* Slots to reserve at the beginning of we_wordv. */ -}; - -typedef struct _wordexp_t wordexp_t; - -#define WRDE_DOOFFS 0x0001 /* Use we_offs. */ -#define WRDE_APPEND 0x0002 /* Append to output from previous call. */ -#define WRDE_NOCMD 0x0004 /* Don't perform command substitution. */ -#define WRDE_REUSE 0x0008 /* pwordexp points to a wordexp_t struct returned from - a previous successful call to wordexp. */ -#define WRDE_SHOWERR 0x0010 /* Print error messages to stderr. */ -#define WRDE_UNDEF 0x0020 /* Report attempt to expand undefined shell variable. */ - -enum { - WRDE_SUCCESS, - WRDE_NOSPACE, - WRDE_BADCHAR, - WRDE_BADVAL, - WRDE_CMDSUB, - WRDE_SYNTAX, - WRDE_NOSYS -}; - -/* Note: This implementation of wordexp requires a version of bash - that supports the --wordexp and --protected arguments to be present - on the system. It does not support the WRDE_UNDEF flag. */ -int wordexp(const char *__restrict, wordexp_t *__restrict, int); -void wordfree(wordexp_t *); - -#ifdef __cplusplus -} -#endif - -#endif /* _WORDEXP_H_ */ diff --git a/tools/sdk/libc/xtensa-lx106-elf/include/xtensa/config/core-isa.h b/tools/sdk/libc/xtensa-lx106-elf/include/xtensa/config/core-isa.h deleted file mode 100644 index 612fbf840..000000000 --- a/tools/sdk/libc/xtensa-lx106-elf/include/xtensa/config/core-isa.h +++ /dev/null @@ -1,459 +0,0 @@ -/* - * xtensa/config/core-isa.h -- HAL definitions that are dependent on Xtensa - * processor CORE configuration - * - * See , which includes this file, for more details. - */ - -/* Xtensa processor core configuration information. - - Copyright (c) 1999-2010 Tensilica Inc. - - 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 the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY - CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifndef _XTENSA_CORE_CONFIGURATION_H -#define _XTENSA_CORE_CONFIGURATION_H - - -/**************************************************************************** - Parameters Useful for Any Code, USER or PRIVILEGED - ****************************************************************************/ - -/* - * Note: Macros of the form XCHAL_HAVE_*** have a value of 1 if the option is - * configured, and a value of 0 otherwise. These macros are always defined. - */ - - -/*---------------------------------------------------------------------- - ISA - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_BE 0 /* big-endian byte ordering */ -#define XCHAL_HAVE_WINDOWED 0 /* windowed registers option */ -#define XCHAL_NUM_AREGS 16 /* num of physical addr regs */ -#define XCHAL_NUM_AREGS_LOG2 4 /* log2(XCHAL_NUM_AREGS) */ -#define XCHAL_MAX_INSTRUCTION_SIZE 3 /* max instr bytes (3..8) */ -#define XCHAL_HAVE_DEBUG 1 /* debug option */ -#define XCHAL_HAVE_DENSITY 1 /* 16-bit instructions */ -#define XCHAL_HAVE_LOOPS 0 /* zero-overhead loops */ -#define XCHAL_HAVE_NSA 1 /* NSA/NSAU instructions */ -#define XCHAL_HAVE_MINMAX 0 /* MIN/MAX instructions */ -#define XCHAL_HAVE_SEXT 0 /* SEXT instruction */ -#define XCHAL_HAVE_CLAMPS 0 /* CLAMPS instruction */ -#define XCHAL_HAVE_MUL16 1 /* MUL16S/MUL16U instructions */ -#define XCHAL_HAVE_MUL32 1 /* MULL instruction */ -#define XCHAL_HAVE_MUL32_HIGH 0 /* MULUH/MULSH instructions */ -#define XCHAL_HAVE_DIV32 0 /* QUOS/QUOU/REMS/REMU instructions */ -#define XCHAL_HAVE_L32R 1 /* L32R instruction */ -#define XCHAL_HAVE_ABSOLUTE_LITERALS 1 /* non-PC-rel (extended) L32R */ -#define XCHAL_HAVE_CONST16 0 /* CONST16 instruction */ -#define XCHAL_HAVE_ADDX 1 /* ADDX#/SUBX# instructions */ -#define XCHAL_HAVE_WIDE_BRANCHES 0 /* B*.W18 or B*.W15 instr's */ -#define XCHAL_HAVE_PREDICTED_BRANCHES 0 /* B[EQ/EQZ/NE/NEZ]T instr's */ -#define XCHAL_HAVE_CALL4AND12 0 /* (obsolete option) */ -#define XCHAL_HAVE_ABS 1 /* ABS instruction */ -/*#define XCHAL_HAVE_POPC 0*/ /* POPC instruction */ -/*#define XCHAL_HAVE_CRC 0*/ /* CRC instruction */ -#define XCHAL_HAVE_RELEASE_SYNC 0 /* L32AI/S32RI instructions */ -#define XCHAL_HAVE_S32C1I 0 /* S32C1I instruction */ -#define XCHAL_HAVE_SPECULATION 0 /* speculation */ -#define XCHAL_HAVE_FULL_RESET 1 /* all regs/state reset */ -#define XCHAL_NUM_CONTEXTS 1 /* */ -#define XCHAL_NUM_MISC_REGS 0 /* num of scratch regs (0..4) */ -#define XCHAL_HAVE_TAP_MASTER 0 /* JTAG TAP control instr's */ -#define XCHAL_HAVE_PRID 1 /* processor ID register */ -#define XCHAL_HAVE_EXTERN_REGS 1 /* WER/RER instructions */ -#define XCHAL_HAVE_MP_INTERRUPTS 0 /* interrupt distributor port */ -#define XCHAL_HAVE_MP_RUNSTALL 0 /* core RunStall control port */ -#define XCHAL_HAVE_THREADPTR 0 /* THREADPTR register */ -#define XCHAL_HAVE_BOOLEANS 0 /* boolean registers */ -#define XCHAL_HAVE_CP 0 /* CPENABLE reg (coprocessor) */ -#define XCHAL_CP_MAXCFG 0 /* max allowed cp id plus one */ -#define XCHAL_HAVE_MAC16 0 /* MAC16 package */ -#define XCHAL_HAVE_VECTORFPU2005 0 /* vector floating-point pkg */ -#define XCHAL_HAVE_FP 0 /* floating point pkg */ -#define XCHAL_HAVE_DFP 0 /* double precision FP pkg */ -#define XCHAL_HAVE_DFP_accel 0 /* double precision FP acceleration pkg */ -#define XCHAL_HAVE_VECTRA1 0 /* Vectra I pkg */ -#define XCHAL_HAVE_VECTRALX 0 /* Vectra LX pkg */ -#define XCHAL_HAVE_HIFIPRO 0 /* HiFiPro Audio Engine pkg */ -#define XCHAL_HAVE_HIFI2 0 /* HiFi2 Audio Engine pkg */ -#define XCHAL_HAVE_CONNXD2 0 /* ConnX D2 pkg */ - - -/*---------------------------------------------------------------------- - MISC - ----------------------------------------------------------------------*/ - -#define XCHAL_NUM_WRITEBUFFER_ENTRIES 1 /* size of write buffer */ -#define XCHAL_INST_FETCH_WIDTH 4 /* instr-fetch width in bytes */ -#define XCHAL_DATA_WIDTH 4 /* data width in bytes */ -/* In T1050, applies to selected core load and store instructions (see ISA): */ -#define XCHAL_UNALIGNED_LOAD_EXCEPTION 1 /* unaligned loads cause exc. */ -#define XCHAL_UNALIGNED_STORE_EXCEPTION 1 /* unaligned stores cause exc.*/ -#define XCHAL_UNALIGNED_LOAD_HW 0 /* unaligned loads work in hw */ -#define XCHAL_UNALIGNED_STORE_HW 0 /* unaligned stores work in hw*/ - -#define XCHAL_SW_VERSION 800001 /* sw version of this header */ - -#define XCHAL_CORE_ID "lx106" /* alphanum core name - (CoreID) set in the Xtensa - Processor Generator */ - -#define XCHAL_BUILD_UNIQUE_ID 0x0002B6F6 /* 22-bit sw build ID */ - -/* - * These definitions describe the hardware targeted by this software. - */ -#define XCHAL_HW_CONFIGID0 0xC28CDAFA /* ConfigID hi 32 bits*/ -#define XCHAL_HW_CONFIGID1 0x1082B6F6 /* ConfigID lo 32 bits*/ -#define XCHAL_HW_VERSION_NAME "LX3.0.1" /* full version name */ -#define XCHAL_HW_VERSION_MAJOR 2300 /* major ver# of targeted hw */ -#define XCHAL_HW_VERSION_MINOR 1 /* minor ver# of targeted hw */ -#define XCHAL_HW_VERSION 230001 /* major*100+minor */ -#define XCHAL_HW_REL_LX3 1 -#define XCHAL_HW_REL_LX3_0 1 -#define XCHAL_HW_REL_LX3_0_1 1 -#define XCHAL_HW_CONFIGID_RELIABLE 1 -/* If software targets a *range* of hardware versions, these are the bounds: */ -#define XCHAL_HW_MIN_VERSION_MAJOR 2300 /* major v of earliest tgt hw */ -#define XCHAL_HW_MIN_VERSION_MINOR 1 /* minor v of earliest tgt hw */ -#define XCHAL_HW_MIN_VERSION 230001 /* earliest targeted hw */ -#define XCHAL_HW_MAX_VERSION_MAJOR 2300 /* major v of latest tgt hw */ -#define XCHAL_HW_MAX_VERSION_MINOR 1 /* minor v of latest tgt hw */ -#define XCHAL_HW_MAX_VERSION 230001 /* latest targeted hw */ - - -/*---------------------------------------------------------------------- - CACHE - ----------------------------------------------------------------------*/ - -#define XCHAL_ICACHE_LINESIZE 4 /* I-cache line size in bytes */ -#define XCHAL_DCACHE_LINESIZE 4 /* D-cache line size in bytes */ -#define XCHAL_ICACHE_LINEWIDTH 2 /* log2(I line size in bytes) */ -#define XCHAL_DCACHE_LINEWIDTH 2 /* log2(D line size in bytes) */ - -#define XCHAL_ICACHE_SIZE 0 /* I-cache size in bytes or 0 */ -#define XCHAL_DCACHE_SIZE 0 /* D-cache size in bytes or 0 */ - -#define XCHAL_DCACHE_IS_WRITEBACK 0 /* writeback feature */ -#define XCHAL_DCACHE_IS_COHERENT 0 /* MP coherence feature */ - -#define XCHAL_HAVE_PREFETCH 0 /* PREFCTL register */ - - - - -/**************************************************************************** - Parameters Useful for PRIVILEGED (Supervisory or Non-Virtualized) Code - ****************************************************************************/ - - -#ifndef XTENSA_HAL_NON_PRIVILEGED_ONLY - -/*---------------------------------------------------------------------- - CACHE - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_PIF 1 /* any outbound PIF present */ - -/* If present, cache size in bytes == (ways * 2^(linewidth + setwidth)). */ - -/* Number of cache sets in log2(lines per way): */ -#define XCHAL_ICACHE_SETWIDTH 0 -#define XCHAL_DCACHE_SETWIDTH 0 - -/* Cache set associativity (number of ways): */ -#define XCHAL_ICACHE_WAYS 1 -#define XCHAL_DCACHE_WAYS 1 - -/* Cache features: */ -#define XCHAL_ICACHE_LINE_LOCKABLE 0 -#define XCHAL_DCACHE_LINE_LOCKABLE 0 -#define XCHAL_ICACHE_ECC_PARITY 0 -#define XCHAL_DCACHE_ECC_PARITY 0 - -/* Cache access size in bytes (affects operation of SICW instruction): */ -#define XCHAL_ICACHE_ACCESS_SIZE 1 -#define XCHAL_DCACHE_ACCESS_SIZE 1 - -/* Number of encoded cache attr bits (see for decoded bits): */ -#define XCHAL_CA_BITS 4 - - -/*---------------------------------------------------------------------- - INTERNAL I/D RAM/ROMs and XLMI - ----------------------------------------------------------------------*/ - -#define XCHAL_NUM_INSTROM 1 /* number of core instr. ROMs */ -#define XCHAL_NUM_INSTRAM 2 /* number of core instr. RAMs */ -#define XCHAL_NUM_DATAROM 1 /* number of core data ROMs */ -#define XCHAL_NUM_DATARAM 2 /* number of core data RAMs */ -#define XCHAL_NUM_URAM 0 /* number of core unified RAMs*/ -#define XCHAL_NUM_XLMI 1 /* number of core XLMI ports */ - -/* Instruction ROM 0: */ -#define XCHAL_INSTROM0_VADDR 0x40200000 -#define XCHAL_INSTROM0_PADDR 0x40200000 -#define XCHAL_INSTROM0_SIZE 1048576 -#define XCHAL_INSTROM0_ECC_PARITY 0 - -/* Instruction RAM 0: */ -#define XCHAL_INSTRAM0_VADDR 0x40000000 -#define XCHAL_INSTRAM0_PADDR 0x40000000 -#define XCHAL_INSTRAM0_SIZE 1048576 -#define XCHAL_INSTRAM0_ECC_PARITY 0 - -/* Instruction RAM 1: */ -#define XCHAL_INSTRAM1_VADDR 0x40100000 -#define XCHAL_INSTRAM1_PADDR 0x40100000 -#define XCHAL_INSTRAM1_SIZE 1048576 -#define XCHAL_INSTRAM1_ECC_PARITY 0 - -/* Data ROM 0: */ -#define XCHAL_DATAROM0_VADDR 0x3FF40000 -#define XCHAL_DATAROM0_PADDR 0x3FF40000 -#define XCHAL_DATAROM0_SIZE 262144 -#define XCHAL_DATAROM0_ECC_PARITY 0 - -/* Data RAM 0: */ -#define XCHAL_DATARAM0_VADDR 0x3FFC0000 -#define XCHAL_DATARAM0_PADDR 0x3FFC0000 -#define XCHAL_DATARAM0_SIZE 262144 -#define XCHAL_DATARAM0_ECC_PARITY 0 - -/* Data RAM 1: */ -#define XCHAL_DATARAM1_VADDR 0x3FF80000 -#define XCHAL_DATARAM1_PADDR 0x3FF80000 -#define XCHAL_DATARAM1_SIZE 262144 -#define XCHAL_DATARAM1_ECC_PARITY 0 - -/* XLMI Port 0: */ -#define XCHAL_XLMI0_VADDR 0x3FF00000 -#define XCHAL_XLMI0_PADDR 0x3FF00000 -#define XCHAL_XLMI0_SIZE 262144 -#define XCHAL_XLMI0_ECC_PARITY 0 - - -/*---------------------------------------------------------------------- - INTERRUPTS and TIMERS - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_INTERRUPTS 1 /* interrupt option */ -#define XCHAL_HAVE_HIGHPRI_INTERRUPTS 1 /* med/high-pri. interrupts */ -#define XCHAL_HAVE_NMI 1 /* non-maskable interrupt */ -#define XCHAL_HAVE_CCOUNT 1 /* CCOUNT reg. (timer option) */ -#define XCHAL_NUM_TIMERS 1 /* number of CCOMPAREn regs */ -#define XCHAL_NUM_INTERRUPTS 15 /* number of interrupts */ -#define XCHAL_NUM_INTERRUPTS_LOG2 4 /* ceil(log2(NUM_INTERRUPTS)) */ -#define XCHAL_NUM_EXTINTERRUPTS 13 /* num of external interrupts */ -#define XCHAL_NUM_INTLEVELS 2 /* number of interrupt levels - (not including level zero) */ -#define XCHAL_EXCM_LEVEL 1 /* level masked by PS.EXCM */ - /* (always 1 in XEA1; levels 2 .. EXCM_LEVEL are "medium priority") */ - -/* Masks of interrupts at each interrupt level: */ -#define XCHAL_INTLEVEL1_MASK 0x00003FFF -#define XCHAL_INTLEVEL2_MASK 0x00000000 -#define XCHAL_INTLEVEL3_MASK 0x00004000 -#define XCHAL_INTLEVEL4_MASK 0x00000000 -#define XCHAL_INTLEVEL5_MASK 0x00000000 -#define XCHAL_INTLEVEL6_MASK 0x00000000 -#define XCHAL_INTLEVEL7_MASK 0x00000000 - -/* Masks of interrupts at each range 1..n of interrupt levels: */ -#define XCHAL_INTLEVEL1_ANDBELOW_MASK 0x00003FFF -#define XCHAL_INTLEVEL2_ANDBELOW_MASK 0x00003FFF -#define XCHAL_INTLEVEL3_ANDBELOW_MASK 0x00007FFF -#define XCHAL_INTLEVEL4_ANDBELOW_MASK 0x00007FFF -#define XCHAL_INTLEVEL5_ANDBELOW_MASK 0x00007FFF -#define XCHAL_INTLEVEL6_ANDBELOW_MASK 0x00007FFF -#define XCHAL_INTLEVEL7_ANDBELOW_MASK 0x00007FFF - -/* Level of each interrupt: */ -#define XCHAL_INT0_LEVEL 1 -#define XCHAL_INT1_LEVEL 1 -#define XCHAL_INT2_LEVEL 1 -#define XCHAL_INT3_LEVEL 1 -#define XCHAL_INT4_LEVEL 1 -#define XCHAL_INT5_LEVEL 1 -#define XCHAL_INT6_LEVEL 1 -#define XCHAL_INT7_LEVEL 1 -#define XCHAL_INT8_LEVEL 1 -#define XCHAL_INT9_LEVEL 1 -#define XCHAL_INT10_LEVEL 1 -#define XCHAL_INT11_LEVEL 1 -#define XCHAL_INT12_LEVEL 1 -#define XCHAL_INT13_LEVEL 1 -#define XCHAL_INT14_LEVEL 3 -#define XCHAL_DEBUGLEVEL 2 /* debug interrupt level */ -#define XCHAL_HAVE_DEBUG_EXTERN_INT 1 /* OCD external db interrupt */ -#define XCHAL_NMILEVEL 3 /* NMI "level" (for use with - EXCSAVE/EPS/EPC_n, RFI n) */ - -/* Type of each interrupt: */ -#define XCHAL_INT0_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT1_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT2_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT3_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT4_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT5_TYPE XTHAL_INTTYPE_EXTERN_LEVEL -#define XCHAL_INT6_TYPE XTHAL_INTTYPE_TIMER -#define XCHAL_INT7_TYPE XTHAL_INTTYPE_SOFTWARE -#define XCHAL_INT8_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT9_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT10_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT11_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT12_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT13_TYPE XTHAL_INTTYPE_EXTERN_EDGE -#define XCHAL_INT14_TYPE XTHAL_INTTYPE_NMI - -/* Masks of interrupts for each type of interrupt: */ -#define XCHAL_INTTYPE_MASK_UNCONFIGURED 0xFFFF8000 -#define XCHAL_INTTYPE_MASK_SOFTWARE 0x00000080 -#define XCHAL_INTTYPE_MASK_EXTERN_EDGE 0x00003F00 -#define XCHAL_INTTYPE_MASK_EXTERN_LEVEL 0x0000003F -#define XCHAL_INTTYPE_MASK_TIMER 0x00000040 -#define XCHAL_INTTYPE_MASK_NMI 0x00004000 -#define XCHAL_INTTYPE_MASK_WRITE_ERROR 0x00000000 - -/* Interrupt numbers assigned to specific interrupt sources: */ -#define XCHAL_TIMER0_INTERRUPT 6 /* CCOMPARE0 */ -#define XCHAL_TIMER1_INTERRUPT XTHAL_TIMER_UNCONFIGURED -#define XCHAL_TIMER2_INTERRUPT XTHAL_TIMER_UNCONFIGURED -#define XCHAL_TIMER3_INTERRUPT XTHAL_TIMER_UNCONFIGURED -#define XCHAL_NMI_INTERRUPT 14 /* non-maskable interrupt */ - -/* Interrupt numbers for levels at which only one interrupt is configured: */ -#define XCHAL_INTLEVEL3_NUM 14 -/* (There are many interrupts each at level(s) 1.) */ - - -/* - * External interrupt vectors/levels. - * These macros describe how Xtensa processor interrupt numbers - * (as numbered internally, eg. in INTERRUPT and INTENABLE registers) - * map to external BInterrupt pins, for those interrupts - * configured as external (level-triggered, edge-triggered, or NMI). - * See the Xtensa processor databook for more details. - */ - -/* Core interrupt numbers mapped to each EXTERNAL interrupt number: */ -#define XCHAL_EXTINT0_NUM 0 /* (intlevel 1) */ -#define XCHAL_EXTINT1_NUM 1 /* (intlevel 1) */ -#define XCHAL_EXTINT2_NUM 2 /* (intlevel 1) */ -#define XCHAL_EXTINT3_NUM 3 /* (intlevel 1) */ -#define XCHAL_EXTINT4_NUM 4 /* (intlevel 1) */ -#define XCHAL_EXTINT5_NUM 5 /* (intlevel 1) */ -#define XCHAL_EXTINT6_NUM 8 /* (intlevel 1) */ -#define XCHAL_EXTINT7_NUM 9 /* (intlevel 1) */ -#define XCHAL_EXTINT8_NUM 10 /* (intlevel 1) */ -#define XCHAL_EXTINT9_NUM 11 /* (intlevel 1) */ -#define XCHAL_EXTINT10_NUM 12 /* (intlevel 1) */ -#define XCHAL_EXTINT11_NUM 13 /* (intlevel 1) */ -#define XCHAL_EXTINT12_NUM 14 /* (intlevel 3) */ - - -/*---------------------------------------------------------------------- - EXCEPTIONS and VECTORS - ----------------------------------------------------------------------*/ - -#define XCHAL_XEA_VERSION 2 /* Xtensa Exception Architecture - number: 1 == XEA1 (old) - 2 == XEA2 (new) - 0 == XEAX (extern) */ -#define XCHAL_HAVE_XEA1 0 /* Exception Architecture 1 */ -#define XCHAL_HAVE_XEA2 1 /* Exception Architecture 2 */ -#define XCHAL_HAVE_XEAX 0 /* External Exception Arch. */ -#define XCHAL_HAVE_EXCEPTIONS 1 /* exception option */ -#define XCHAL_HAVE_MEM_ECC_PARITY 0 /* local memory ECC/parity */ -#define XCHAL_HAVE_VECTOR_SELECT 1 /* relocatable vectors */ -#define XCHAL_HAVE_VECBASE 1 /* relocatable vectors */ -#define XCHAL_VECBASE_RESET_VADDR 0x40000000 /* VECBASE reset value */ -#define XCHAL_VECBASE_RESET_PADDR 0x40000000 -#define XCHAL_RESET_VECBASE_OVERLAP 0 - -#define XCHAL_RESET_VECTOR0_VADDR 0x50000000 -#define XCHAL_RESET_VECTOR0_PADDR 0x50000000 -#define XCHAL_RESET_VECTOR1_VADDR 0x40000080 -#define XCHAL_RESET_VECTOR1_PADDR 0x40000080 -#define XCHAL_RESET_VECTOR_VADDR 0x50000000 -#define XCHAL_RESET_VECTOR_PADDR 0x50000000 -#define XCHAL_USER_VECOFS 0x00000050 -#define XCHAL_USER_VECTOR_VADDR 0x40000050 -#define XCHAL_USER_VECTOR_PADDR 0x40000050 -#define XCHAL_KERNEL_VECOFS 0x00000030 -#define XCHAL_KERNEL_VECTOR_VADDR 0x40000030 -#define XCHAL_KERNEL_VECTOR_PADDR 0x40000030 -#define XCHAL_DOUBLEEXC_VECOFS 0x00000070 -#define XCHAL_DOUBLEEXC_VECTOR_VADDR 0x40000070 -#define XCHAL_DOUBLEEXC_VECTOR_PADDR 0x40000070 -#define XCHAL_INTLEVEL2_VECOFS 0x00000010 -#define XCHAL_INTLEVEL2_VECTOR_VADDR 0x40000010 -#define XCHAL_INTLEVEL2_VECTOR_PADDR 0x40000010 -#define XCHAL_DEBUG_VECOFS XCHAL_INTLEVEL2_VECOFS -#define XCHAL_DEBUG_VECTOR_VADDR XCHAL_INTLEVEL2_VECTOR_VADDR -#define XCHAL_DEBUG_VECTOR_PADDR XCHAL_INTLEVEL2_VECTOR_PADDR -#define XCHAL_NMI_VECOFS 0x00000020 -#define XCHAL_NMI_VECTOR_VADDR 0x40000020 -#define XCHAL_NMI_VECTOR_PADDR 0x40000020 -#define XCHAL_INTLEVEL3_VECOFS XCHAL_NMI_VECOFS -#define XCHAL_INTLEVEL3_VECTOR_VADDR XCHAL_NMI_VECTOR_VADDR -#define XCHAL_INTLEVEL3_VECTOR_PADDR XCHAL_NMI_VECTOR_PADDR - - -/*---------------------------------------------------------------------- - DEBUG - ----------------------------------------------------------------------*/ - -#define XCHAL_HAVE_OCD 1 /* OnChipDebug option */ -#define XCHAL_NUM_IBREAK 1 /* number of IBREAKn regs */ -#define XCHAL_NUM_DBREAK 1 /* number of DBREAKn regs */ -#define XCHAL_HAVE_OCD_DIR_ARRAY 0 /* faster OCD option */ - - -/*---------------------------------------------------------------------- - MMU - ----------------------------------------------------------------------*/ - -/* See core-matmap.h header file for more details. */ - -#define XCHAL_HAVE_TLBS 1 /* inverse of HAVE_CACHEATTR */ -#define XCHAL_HAVE_SPANNING_WAY 1 /* one way maps I+D 4GB vaddr */ -#define XCHAL_SPANNING_WAY 0 /* TLB spanning way number */ -#define XCHAL_HAVE_IDENTITY_MAP 1 /* vaddr == paddr always */ -#define XCHAL_HAVE_CACHEATTR 0 /* CACHEATTR register present */ -#define XCHAL_HAVE_MIMIC_CACHEATTR 1 /* region protection */ -#define XCHAL_HAVE_XLT_CACHEATTR 0 /* region prot. w/translation */ -#define XCHAL_HAVE_PTP_MMU 0 /* full MMU (with page table - [autorefill] and protection) - usable for an MMU-based OS */ -/* If none of the above last 4 are set, it's a custom TLB configuration. */ - -#define XCHAL_MMU_ASID_BITS 0 /* number of bits in ASIDs */ -#define XCHAL_MMU_RINGS 1 /* number of rings (1..4) */ -#define XCHAL_MMU_RING_BITS 0 /* num of bits in RING field */ - -#endif /* !XTENSA_HAL_NON_PRIVILEGED_ONLY */ - - -#endif /* _XTENSA_CORE_CONFIGURATION_H */ - diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/crt0.o b/tools/sdk/libc/xtensa-lx106-elf/lib/crt0.o deleted file mode 100644 index 9e0d1fef3..000000000 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/crt0.o and /dev/null differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a b/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a deleted file mode 100644 index 5d82b0321..000000000 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/libc.a and /dev/null differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/libg.a b/tools/sdk/libc/xtensa-lx106-elf/lib/libg.a deleted file mode 100644 index 5d82b0321..000000000 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/libg.a and /dev/null differ diff --git a/tools/sdk/libc/xtensa-lx106-elf/lib/libm.a b/tools/sdk/libc/xtensa-lx106-elf/lib/libm.a deleted file mode 100644 index cf427e2d9..000000000 Binary files a/tools/sdk/libc/xtensa-lx106-elf/lib/libm.a and /dev/null differ diff --git a/tools/sdk/lwip2/builder b/tools/sdk/lwip2/builder index f56e795ee..742125823 160000 --- a/tools/sdk/lwip2/builder +++ b/tools/sdk/lwip2/builder @@ -1 +1 @@ -Subproject commit f56e795ee8a770a8b9ccfb868f8e806c10505e70 +Subproject commit 7421258237b7c8f61629226961af498a0a6e0096 diff --git a/tools/sdk/lwip2/include/arch/cc.h b/tools/sdk/lwip2/include/arch/cc.h index 961c51aa3..1b879c84c 100644 --- a/tools/sdk/lwip2/include/arch/cc.h +++ b/tools/sdk/lwip2/include/arch/cc.h @@ -63,6 +63,7 @@ typedef uint32_t sys_prot_t; #define SYS_ARCH_DECL_PROTECT(lev) sys_prot_t lev #define SYS_ARCH_PROTECT(lev) lev = lwip_xt_rsil(15) #define SYS_ARCH_UNPROTECT(lev) lwip_xt_wsr_ps(lev) +#define sys_jiffies() (0) // only used for increased randomness in PPP #define LWIP_NO_CTYPE_H 1 diff --git a/tools/sdk/lwip2/include/lwip-git-hash.h b/tools/sdk/lwip2/include/lwip-git-hash.h index 2fecf7225..146c0d311 100644 --- a/tools/sdk/lwip2/include/lwip-git-hash.h +++ b/tools/sdk/lwip2/include/lwip-git-hash.h @@ -1,5 +1,5 @@ // generated by makefiles/make-lwip2-hash #ifndef LWIP_HASH_H #define LWIP_HASH_H -#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.2-34-gf56e795" +#define LWIP_HASH_STR "STABLE-2_1_2_RELEASE/glue:1.2-48-g7421258" #endif // LWIP_HASH_H diff --git a/tools/sdk/lwip2/include/lwipopts.h b/tools/sdk/lwip2/include/lwipopts.h index 1b26f3525..d4dc17955 100644 --- a/tools/sdk/lwip2/include/lwipopts.h +++ b/tools/sdk/lwip2/include/lwipopts.h @@ -3139,7 +3139,7 @@ * u8_t *ptr = (u8_t*)pbuf_get_contiguous(p, buf, sizeof(buf), LWIP_MIN(option_len, sizeof(buf)), offset); */ #ifdef __DOXYGEN__ -#define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) +//#define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, offset) #endif /** @@ -3551,6 +3551,12 @@ #error LWIP_FEATURES must be defined #endif +#define PPPOS_SUPPORT IP_NAPT // because we don't have proxyarp yet +#define PPP_SUPPORT PPPOS_SUPPORT +#define PPP_SERVER 1 +#define PPP_DEBUG ULWIPDEBUG +#define PRINTPKT_SUPPORT ULWIPDEBUG + #ifdef __cplusplus extern "C" { #endif @@ -3560,6 +3566,24 @@ extern "C" { */ #define TCP_RANDOM_PORT 1 +/* + -------------------------------------------------- + ------------------ DHCP options ------------------ + -------------------------------------------------- +*/ + +#define LWIP_HOOK_DHCP_PARSE_OPTION(netif, dhcp, state, msg, msg_type, option, len, pbuf, option_value_offset) \ + lwip_hook_dhcp_parse_option(netif, dhcp, state, msg, msg_type, option, len, pbuf, option_value_offset) + +// search for LWIP_HOOK_DHCP_PARSE_OPTION above for an arguments explanation +struct netif; +struct dhcp; +struct dhcp_msg; +struct pbuf; +extern void lwip_hook_dhcp_parse_option(struct netif *netif, struct dhcp *dhcp, int state, struct dhcp_msg *msg, + int msg_type, int option, int option_len, struct pbuf *pbuf, + int option_value_offset); + /* -------------------------------------------------- ------------------ SNTP options ------------------ @@ -3574,7 +3598,7 @@ extern "C" { #define SNTP_SERVER_DNS 1 // enable SNTP support DNS names through sntp_setservername / sntp_getservername -#define SNTP_SET_SYSTEM_TIME_US(t,us) do { struct timeval tv = { t, us }; settimeofday(&tv, NULL); } while (0) +#define SNTP_SET_SYSTEM_TIME_US(t,us) do { struct timeval tv = { t, us }; settimeofday(&tv, (struct timezone*)0xFeedC0de); } while (0) #define SNTP_SUPPRESS_DELAY_CHECK 1 #define SNTP_UPDATE_DELAY_DEFAULT 3600000 // update delay defined by a default weak function @@ -3652,6 +3676,16 @@ void tcp_kill_timewait (void); #define MEMP_NUM_TCP_PCB_TIME_WAIT 5 #endif +/* + -------------------------------------------------- + ----------------- Alloc functions ---------------- + -------------------------------------------------- +*/ + +#define mem_clib_free(p) vPortFree(p, NULL, -1) +#define mem_clib_malloc(s) pvPortMalloc(s, NULL, -1) +#define mem_clib_calloc(n,s) pvPortZalloc(n*s, NULL, -1) + #ifdef __cplusplus } // extern "C" #endif diff --git a/tools/sdk/lwip2/include/netif/ppp/fsm.h b/tools/sdk/lwip2/include/netif/ppp/fsm.h new file mode 100644 index 000000000..8dec700e0 --- /dev/null +++ b/tools/sdk/lwip2/include/netif/ppp/fsm.h @@ -0,0 +1,182 @@ +/* + * fsm.h - {Link, IP} Control Protocol Finite State Machine definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. + * + * 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 "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: fsm.h,v 1.10 2004/11/13 02:28:15 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef FSM_H +#define FSM_H + +#include "ppp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Packet header = Code, id, length. + */ +#define HEADERLEN 4 + + +/* + * CP (LCP, IPCP, etc.) codes. + */ +#define CONFREQ 1 /* Configuration Request */ +#define CONFACK 2 /* Configuration Ack */ +#define CONFNAK 3 /* Configuration Nak */ +#define CONFREJ 4 /* Configuration Reject */ +#define TERMREQ 5 /* Termination Request */ +#define TERMACK 6 /* Termination Ack */ +#define CODEREJ 7 /* Code Reject */ + + +/* + * Each FSM is described by an fsm structure and fsm callbacks. + */ +typedef struct fsm { + ppp_pcb *pcb; /* PPP Interface */ + const struct fsm_callbacks *callbacks; /* Callback routines */ + const char *term_reason; /* Reason for closing protocol */ + u8_t seen_ack; /* Have received valid Ack/Nak/Rej to Req */ + /* -- This is our only flag, we might use u_int :1 if we have more flags */ + u16_t protocol; /* Data Link Layer Protocol field value */ + u8_t state; /* State */ + u8_t flags; /* Contains option bits */ + u8_t id; /* Current id */ + u8_t reqid; /* Current request id */ + u8_t retransmits; /* Number of retransmissions left */ + u8_t nakloops; /* Number of nak loops since last ack */ + u8_t rnakloops; /* Number of naks received */ + u8_t maxnakloops; /* Maximum number of nak loops tolerated + (necessary because IPCP require a custom large max nak loops value) */ + u8_t term_reason_len; /* Length of term_reason */ +} fsm; + + +typedef struct fsm_callbacks { + void (*resetci) /* Reset our Configuration Information */ + (fsm *); + int (*cilen) /* Length of our Configuration Information */ + (fsm *); + void (*addci) /* Add our Configuration Information */ + (fsm *, u_char *, int *); + int (*ackci) /* ACK our Configuration Information */ + (fsm *, u_char *, int); + int (*nakci) /* NAK our Configuration Information */ + (fsm *, u_char *, int, int); + int (*rejci) /* Reject our Configuration Information */ + (fsm *, u_char *, int); + int (*reqci) /* Request peer's Configuration Information */ + (fsm *, u_char *, int *, int); + void (*up) /* Called when fsm reaches PPP_FSM_OPENED state */ + (fsm *); + void (*down) /* Called when fsm leaves PPP_FSM_OPENED state */ + (fsm *); + void (*starting) /* Called when we want the lower layer */ + (fsm *); + void (*finished) /* Called when we don't want the lower layer */ + (fsm *); + void (*protreject) /* Called when Protocol-Reject received */ + (int); + void (*retransmit) /* Retransmission is necessary */ + (fsm *); + int (*extcode) /* Called when unknown code received */ + (fsm *, int, int, u_char *, int); + const char *proto_name; /* String name for protocol (for messages) */ +} fsm_callbacks; + + +/* + * Link states. + */ +#define PPP_FSM_INITIAL 0 /* Down, hasn't been opened */ +#define PPP_FSM_STARTING 1 /* Down, been opened */ +#define PPP_FSM_CLOSED 2 /* Up, hasn't been opened */ +#define PPP_FSM_STOPPED 3 /* Open, waiting for down event */ +#define PPP_FSM_CLOSING 4 /* Terminating the connection, not open */ +#define PPP_FSM_STOPPING 5 /* Terminating, but open */ +#define PPP_FSM_REQSENT 6 /* We've sent a Config Request */ +#define PPP_FSM_ACKRCVD 7 /* We've received a Config Ack */ +#define PPP_FSM_ACKSENT 8 /* We've sent a Config Ack */ +#define PPP_FSM_OPENED 9 /* Connection available */ + + +/* + * Flags - indicate options controlling FSM operation + */ +#define OPT_PASSIVE 1 /* Don't die if we don't get a response */ +#define OPT_RESTART 2 /* Treat 2nd OPEN as DOWN, UP */ +#define OPT_SILENT 4 /* Wait for peer to speak first */ + + +/* + * Timeouts. + */ +#if 0 /* moved to ppp_opts.h */ +#define DEFTIMEOUT 3 /* Timeout time in seconds */ +#define DEFMAXTERMREQS 2 /* Maximum Terminate-Request transmissions */ +#define DEFMAXCONFREQS 10 /* Maximum Configure-Request transmissions */ +#define DEFMAXNAKLOOPS 5 /* Maximum number of nak loops */ +#endif /* moved to ppp_opts.h */ + + +/* + * Prototypes + */ +void fsm_init(fsm *f); +void fsm_lowerup(fsm *f); +void fsm_lowerdown(fsm *f); +void fsm_open(fsm *f); +void fsm_close(fsm *f, const char *reason); +void fsm_input(fsm *f, u_char *inpacket, int l); +void fsm_protreject(fsm *f); +void fsm_sdata(fsm *f, u_char code, u_char id, const u_char *data, int datalen); + +#ifdef __cplusplus +} +#endif + +#endif /* FSM_H */ +#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/lwip2/include/netif/ppp/ipcp.h b/tools/sdk/lwip2/include/netif/ppp/ipcp.h new file mode 100644 index 000000000..32fdd1c64 --- /dev/null +++ b/tools/sdk/lwip2/include/netif/ppp/ipcp.h @@ -0,0 +1,134 @@ +/* + * ipcp.h - IP Control Protocol definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. + * + * 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 "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: ipcp.h,v 1.14 2002/12/04 23:03:32 paulus Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPP_IPV4_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef IPCP_H +#define IPCP_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Options. + */ +#define CI_ADDRS 1 /* IP Addresses */ +#if VJ_SUPPORT +#define CI_COMPRESSTYPE 2 /* Compression Type */ +#endif /* VJ_SUPPORT */ +#define CI_ADDR 3 + +#if LWIP_DNS +#define CI_MS_DNS1 129 /* Primary DNS value */ +#define CI_MS_DNS2 131 /* Secondary DNS value */ +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ +#define CI_MS_WINS1 130 /* Primary WINS value */ +#define CI_MS_WINS2 132 /* Secondary WINS value */ +#endif /* UNUSED - WINS */ + +#if VJ_SUPPORT +#define MAX_STATES 16 /* from slcompress.h */ + +#define IPCP_VJMODE_OLD 1 /* "old" mode (option # = 0x0037) */ +#define IPCP_VJMODE_RFC1172 2 /* "old-rfc"mode (option # = 0x002d) */ +#define IPCP_VJMODE_RFC1332 3 /* "new-rfc"mode (option # = 0x002d, */ + /* maxslot and slot number compression) */ + +#define IPCP_VJ_COMP 0x002d /* current value for VJ compression option*/ +#define IPCP_VJ_COMP_OLD 0x0037 /* "old" (i.e, broken) value for VJ */ + /* compression option*/ +#endif /* VJ_SUPPORT */ + +typedef struct ipcp_options { + unsigned int neg_addr :1; /* Negotiate IP Address? */ + unsigned int old_addrs :1; /* Use old (IP-Addresses) option? */ + unsigned int req_addr :1; /* Ask peer to send IP address? */ +#if 0 /* UNUSED */ + unsigned int default_route :1; /* Assign default route through interface? */ + unsigned int replace_default_route :1; /* Replace default route through interface? */ +#endif /* UNUSED */ +#if 0 /* UNUSED - PROXY ARP */ + unsigned int proxy_arp :1; /* Make proxy ARP entry for peer? */ +#endif /* UNUSED - PROXY ARP */ +#if VJ_SUPPORT + unsigned int neg_vj :1; /* Van Jacobson Compression? */ + unsigned int old_vj :1; /* use old (short) form of VJ option? */ + unsigned int cflag :1; +#endif /* VJ_SUPPORT */ + unsigned int accept_local :1; /* accept peer's value for ouraddr */ + unsigned int accept_remote :1; /* accept peer's value for hisaddr */ +#if LWIP_DNS + unsigned int req_dns1 :1; /* Ask peer to send primary DNS address? */ + unsigned int req_dns2 :1; /* Ask peer to send secondary DNS address? */ +#endif /* LWIP_DNS */ + + u32_t ouraddr, hisaddr; /* Addresses in NETWORK BYTE ORDER */ +#if LWIP_DNS + u32_t dnsaddr[2]; /* Primary and secondary MS DNS entries */ +#endif /* LWIP_DNS */ +#if 0 /* UNUSED - WINS */ + u32_t winsaddr[2]; /* Primary and secondary MS WINS entries */ +#endif /* UNUSED - WINS */ + +#if VJ_SUPPORT + u16_t vj_protocol; /* protocol value to use in VJ option */ + u8_t maxslotindex; /* values for RFC1332 VJ compression neg. */ +#endif /* VJ_SUPPORT */ +} ipcp_options; + +#if 0 /* UNUSED, already defined by lwIP */ +char *ip_ntoa (u32_t); +#endif /* UNUSED, already defined by lwIP */ + +extern const struct protent ipcp_protent; + +#ifdef __cplusplus +} +#endif + +#endif /* IPCP_H */ +#endif /* PPP_SUPPORT && PPP_IPV4_SUPPORT */ diff --git a/tools/sdk/lwip2/include/netif/ppp/lcp.h b/tools/sdk/lwip2/include/netif/ppp/lcp.h new file mode 100644 index 000000000..18ad1cb23 --- /dev/null +++ b/tools/sdk/lwip2/include/netif/ppp/lcp.h @@ -0,0 +1,179 @@ +/* + * lcp.h - Link Control Protocol definitions. + * + * Copyright (c) 1984-2000 Carnegie Mellon University. All rights reserved. + * + * 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 "Carnegie Mellon University" must not be used to + * endorse or promote products derived from this software without + * prior written permission. For permission or any legal + * details, please contact + * Office of Technology Transfer + * Carnegie Mellon University + * 5000 Forbes Avenue + * Pittsburgh, PA 15213-3890 + * (412) 268-4387, fax: (412) 268-7395 + * tech-transfer@andrew.cmu.edu + * + * 4. Redistributions of any form whatsoever must retain the following + * acknowledgment: + * "This product includes software developed by Computing Services + * at Carnegie Mellon University (http://www.cmu.edu/computing/)." + * + * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO + * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE + * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN + * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * $Id: lcp.h,v 1.20 2004/11/14 22:53:42 carlsonj Exp $ + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef LCP_H +#define LCP_H + +#include "ppp.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Options. + */ +#define CI_VENDOR 0 /* Vendor Specific */ +#define CI_MRU 1 /* Maximum Receive Unit */ +#define CI_ASYNCMAP 2 /* Async Control Character Map */ +#define CI_AUTHTYPE 3 /* Authentication Type */ +#define CI_QUALITY 4 /* Quality Protocol */ +#define CI_MAGICNUMBER 5 /* Magic Number */ +#define CI_PCOMPRESSION 7 /* Protocol Field Compression */ +#define CI_ACCOMPRESSION 8 /* Address/Control Field Compression */ +#define CI_FCSALTERN 9 /* FCS-Alternatives */ +#define CI_SDP 10 /* Self-Describing-Pad */ +#define CI_NUMBERED 11 /* Numbered-Mode */ +#define CI_CALLBACK 13 /* callback */ +#define CI_MRRU 17 /* max reconstructed receive unit; multilink */ +#define CI_SSNHF 18 /* short sequence numbers for multilink */ +#define CI_EPDISC 19 /* endpoint discriminator */ +#define CI_MPPLUS 22 /* Multi-Link-Plus-Procedure */ +#define CI_LDISC 23 /* Link-Discriminator */ +#define CI_LCPAUTH 24 /* LCP Authentication */ +#define CI_COBS 25 /* Consistent Overhead Byte Stuffing */ +#define CI_PREFELIS 26 /* Prefix Elision */ +#define CI_MPHDRFMT 27 /* MP Header Format */ +#define CI_I18N 28 /* Internationalization */ +#define CI_SDL 29 /* Simple Data Link */ + +/* + * LCP-specific packet types (code numbers). + */ +#define PROTREJ 8 /* Protocol Reject */ +#define ECHOREQ 9 /* Echo Request */ +#define ECHOREP 10 /* Echo Reply */ +#define DISCREQ 11 /* Discard Request */ +#define IDENTIF 12 /* Identification */ +#define TIMEREM 13 /* Time Remaining */ + +/* Value used as data for CI_CALLBACK option */ +#define CBCP_OPT 6 /* Use callback control protocol */ + +#if 0 /* moved to ppp_opts.h */ +#define DEFMRU 1500 /* Try for this */ +#define MINMRU 128 /* No MRUs below this */ +#define MAXMRU 16384 /* Normally limit MRU to this */ +#endif /* moved to ppp_opts.h */ + +/* An endpoint discriminator, used with multilink. */ +#define MAX_ENDP_LEN 20 /* maximum length of discriminator value */ +struct epdisc { + unsigned char class_; /* -- The word "class" is reserved in C++. */ + unsigned char length; + unsigned char value[MAX_ENDP_LEN]; +}; + +/* + * The state of options is described by an lcp_options structure. + */ +typedef struct lcp_options { + unsigned int passive :1; /* Don't die if we don't get a response */ + unsigned int silent :1; /* Wait for the other end to start first */ +#if 0 /* UNUSED */ + unsigned int restart :1; /* Restart vs. exit after close */ +#endif /* UNUSED */ + unsigned int neg_mru :1; /* Negotiate the MRU? */ + unsigned int neg_asyncmap :1; /* Negotiate the async map? */ +#if PAP_SUPPORT + unsigned int neg_upap :1; /* Ask for UPAP authentication? */ +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + unsigned int neg_chap :1; /* Ask for CHAP authentication? */ +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT + unsigned int neg_eap :1; /* Ask for EAP authentication? */ +#endif /* EAP_SUPPORT */ + unsigned int neg_magicnumber :1; /* Ask for magic number? */ + unsigned int neg_pcompression :1; /* HDLC Protocol Field Compression? */ + unsigned int neg_accompression :1; /* HDLC Address/Control Field Compression? */ +#if LQR_SUPPORT + unsigned int neg_lqr :1; /* Negotiate use of Link Quality Reports */ +#endif /* LQR_SUPPORT */ + unsigned int neg_cbcp :1; /* Negotiate use of CBCP */ +#ifdef HAVE_MULTILINK + unsigned int neg_mrru :1; /* negotiate multilink MRRU */ +#endif /* HAVE_MULTILINK */ + unsigned int neg_ssnhf :1; /* negotiate short sequence numbers */ + unsigned int neg_endpoint :1; /* negotiate endpoint discriminator */ + + u16_t mru; /* Value of MRU */ +#ifdef HAVE_MULTILINK + u16_t mrru; /* Value of MRRU, and multilink enable */ +#endif /* MULTILINK */ +#if CHAP_SUPPORT + u8_t chap_mdtype; /* which MD types (hashing algorithm) */ +#endif /* CHAP_SUPPORT */ + u32_t asyncmap; /* Value of async map */ + u32_t magicnumber; + u8_t numloops; /* Number of loops during magic number neg. */ +#if LQR_SUPPORT + u32_t lqr_period; /* Reporting period for LQR 1/100ths second */ +#endif /* LQR_SUPPORT */ + struct epdisc endpoint; /* endpoint discriminator */ +} lcp_options; + +void lcp_open(ppp_pcb *pcb); +void lcp_close(ppp_pcb *pcb, const char *reason); +void lcp_lowerup(ppp_pcb *pcb); +void lcp_lowerdown(ppp_pcb *pcb); +void lcp_sprotrej(ppp_pcb *pcb, u_char *p, int len); /* send protocol reject */ + +extern const struct protent lcp_protent; + +#if 0 /* moved to ppp_opts.h */ +/* Default number of times we receive our magic number from the peer + before deciding the link is looped-back. */ +#define DEFLOOPBACKFAIL 10 +#endif /* moved to ppp_opts.h */ + +#ifdef __cplusplus +} +#endif + +#endif /* LCP_H */ +#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/lwip2/include/netif/ppp/ppp.h b/tools/sdk/lwip2/include/netif/ppp/ppp.h new file mode 100644 index 000000000..3d73c3657 --- /dev/null +++ b/tools/sdk/lwip2/include/netif/ppp/ppp.h @@ -0,0 +1,698 @@ +/***************************************************************************** +* ppp.h - Network Point to Point Protocol header file. +* +* Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc. +* portions Copyright (c) 1997 Global Election Systems Inc. +* +* The authors hereby grant permission to use, copy, modify, distribute, +* and license this software and its documentation for any purpose, provided +* that existing copyright notices are retained in all copies and that this +* notice and the following disclaimer are included verbatim in any +* distributions. No written agreement, license, or royalty fee is required +* for any of the authorized uses. +* +* THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *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 CONTRIBUTORS 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. +* +****************************************************************************** +* REVISION HISTORY +* +* 03-01-01 Marc Boucher +* Ported to lwIP. +* 97-11-05 Guy Lancaster , Global Election Systems Inc. +* Original derived from BSD codes. +*****************************************************************************/ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPP_H +#define PPP_H + +#include "lwip/def.h" +#include "lwip/stats.h" +#include "lwip/mem.h" +#include "lwip/netif.h" +#include "lwip/sys.h" +#include "lwip/timeouts.h" +#if PPP_IPV6_SUPPORT +#include "lwip/ip6_addr.h" +#endif /* PPP_IPV6_SUPPORT */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* Disable non-working or rarely used PPP feature, so rarely that we don't want to bloat ppp_opts.h with them */ +#ifndef PPP_OPTIONS +#define PPP_OPTIONS 0 +#endif + +#ifndef PPP_NOTIFY +#define PPP_NOTIFY 0 +#endif + +#ifndef PPP_REMOTENAME +#define PPP_REMOTENAME 0 +#endif + +#ifndef PPP_IDLETIMELIMIT +#define PPP_IDLETIMELIMIT 0 +#endif + +#ifndef PPP_LCP_ADAPTIVE +#define PPP_LCP_ADAPTIVE 0 +#endif + +#ifndef PPP_MAXCONNECT +#define PPP_MAXCONNECT 0 +#endif + +#ifndef PPP_ALLOWED_ADDRS +#define PPP_ALLOWED_ADDRS 0 +#endif + +#ifndef PPP_PROTOCOLNAME +#define PPP_PROTOCOLNAME 0 +#endif + +#ifndef PPP_STATS_SUPPORT +#define PPP_STATS_SUPPORT 0 +#endif + +#ifndef DEFLATE_SUPPORT +#define DEFLATE_SUPPORT 0 +#endif + +#ifndef BSDCOMPRESS_SUPPORT +#define BSDCOMPRESS_SUPPORT 0 +#endif + +#ifndef PREDICTOR_SUPPORT +#define PREDICTOR_SUPPORT 0 +#endif + +/************************* +*** PUBLIC DEFINITIONS *** +*************************/ + +/* + * The basic PPP frame. + */ +#define PPP_HDRLEN 4 /* octets for standard ppp header */ +#define PPP_FCSLEN 2 /* octets for FCS */ + +/* + * Values for phase. + */ +#define PPP_PHASE_DEAD 0 +#define PPP_PHASE_MASTER 1 +#define PPP_PHASE_HOLDOFF 2 +#define PPP_PHASE_INITIALIZE 3 +#define PPP_PHASE_SERIALCONN 4 +#define PPP_PHASE_DORMANT 5 +#define PPP_PHASE_ESTABLISH 6 +#define PPP_PHASE_AUTHENTICATE 7 +#define PPP_PHASE_CALLBACK 8 +#define PPP_PHASE_NETWORK 9 +#define PPP_PHASE_RUNNING 10 +#define PPP_PHASE_TERMINATE 11 +#define PPP_PHASE_DISCONNECT 12 + +/* Error codes. */ +#define PPPERR_NONE 0 /* No error. */ +#define PPPERR_PARAM 1 /* Invalid parameter. */ +#define PPPERR_OPEN 2 /* Unable to open PPP session. */ +#define PPPERR_DEVICE 3 /* Invalid I/O device for PPP. */ +#define PPPERR_ALLOC 4 /* Unable to allocate resources. */ +#define PPPERR_USER 5 /* User interrupt. */ +#define PPPERR_CONNECT 6 /* Connection lost. */ +#define PPPERR_AUTHFAIL 7 /* Failed authentication challenge. */ +#define PPPERR_PROTOCOL 8 /* Failed to meet protocol. */ +#define PPPERR_PEERDEAD 9 /* Connection timeout */ +#define PPPERR_IDLETIMEOUT 10 /* Idle Timeout */ +#define PPPERR_CONNECTTIME 11 /* Max connect time reached */ +#define PPPERR_LOOPBACK 12 /* Loopback detected */ + +/* Whether auth support is enabled at all */ +#define PPP_AUTH_SUPPORT (PAP_SUPPORT || CHAP_SUPPORT || EAP_SUPPORT) + +/************************ +*** PUBLIC DATA TYPES *** +************************/ + +/* + * Other headers require ppp_pcb definition for prototypes, but ppp_pcb + * require some structure definition from other headers as well, we are + * fixing the dependency loop here by declaring the ppp_pcb type then + * by including headers containing necessary struct definition for ppp_pcb + */ +typedef struct ppp_pcb_s ppp_pcb; + +/* Type definitions for BSD code. */ +#ifndef __u_char_defined +typedef unsigned long u_long; +typedef unsigned int u_int; +typedef unsigned short u_short; +typedef unsigned char u_char; +#endif + +#include "fsm.h" +#include "lcp.h" +#if CCP_SUPPORT +#include "ccp.h" +#endif /* CCP_SUPPORT */ +#if MPPE_SUPPORT +#include "mppe.h" +#endif /* MPPE_SUPPORT */ +#if PPP_IPV4_SUPPORT +#include "ipcp.h" +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT +#include "ipv6cp.h" +#endif /* PPP_IPV6_SUPPORT */ +#if PAP_SUPPORT +#include "upap.h" +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT +#include "chap-new.h" +#endif /* CHAP_SUPPORT */ +#if EAP_SUPPORT +#include "eap.h" +#endif /* EAP_SUPPORT */ +#if VJ_SUPPORT +#include "vj.h" +#endif /* VJ_SUPPORT */ + +/* Link status callback function prototype */ +typedef void (*ppp_link_status_cb_fn)(ppp_pcb *pcb, int err_code, void *ctx); + +/* + * PPP configuration. + */ +typedef struct ppp_settings_s { + +#if PPP_SERVER && PPP_AUTH_SUPPORT + unsigned int auth_required :1; /* Peer is required to authenticate */ + unsigned int null_login :1; /* Username of "" and a password of "" are acceptable */ +#endif /* PPP_SERVER && PPP_AUTH_SUPPORT */ +#if PPP_REMOTENAME + unsigned int explicit_remote :1; /* remote_name specified with remotename opt */ +#endif /* PPP_REMOTENAME */ +#if PAP_SUPPORT + unsigned int refuse_pap :1; /* Don't proceed auth. with PAP */ +#endif /* PAP_SUPPORT */ +#if CHAP_SUPPORT + unsigned int refuse_chap :1; /* Don't proceed auth. with CHAP */ +#endif /* CHAP_SUPPORT */ +#if MSCHAP_SUPPORT + unsigned int refuse_mschap :1; /* Don't proceed auth. with MS-CHAP */ + unsigned int refuse_mschap_v2 :1; /* Don't proceed auth. with MS-CHAPv2 */ +#endif /* MSCHAP_SUPPORT */ +#if EAP_SUPPORT + unsigned int refuse_eap :1; /* Don't proceed auth. with EAP */ +#endif /* EAP_SUPPORT */ +#if LWIP_DNS + unsigned int usepeerdns :1; /* Ask peer for DNS adds */ +#endif /* LWIP_DNS */ + unsigned int persist :1; /* Persist mode, always try to open the connection */ +#if PRINTPKT_SUPPORT + unsigned int hide_password :1; /* Hide password in dumped packets */ +#endif /* PRINTPKT_SUPPORT */ + unsigned int noremoteip :1; /* Let him have no IP address */ + unsigned int lax_recv :1; /* accept control chars in asyncmap */ + unsigned int noendpoint :1; /* don't send/accept endpoint discriminator */ +#if PPP_LCP_ADAPTIVE + unsigned int lcp_echo_adaptive :1; /* request echo only if the link was idle */ +#endif /* PPP_LCP_ADAPTIVE */ +#if MPPE_SUPPORT + unsigned int require_mppe :1; /* Require MPPE (Microsoft Point to Point Encryption) */ + unsigned int refuse_mppe_40 :1; /* Allow MPPE 40-bit mode? */ + unsigned int refuse_mppe_128 :1; /* Allow MPPE 128-bit mode? */ + unsigned int refuse_mppe_stateful :1; /* Allow MPPE stateful mode? */ +#endif /* MPPE_SUPPORT */ + + u16_t listen_time; /* time to listen first (ms), waiting for peer to send LCP packet */ + +#if PPP_IDLETIMELIMIT + u16_t idle_time_limit; /* Disconnect if idle for this many seconds */ +#endif /* PPP_IDLETIMELIMIT */ +#if PPP_MAXCONNECT + u32_t maxconnect; /* Maximum connect time (seconds) */ +#endif /* PPP_MAXCONNECT */ + +#if PPP_AUTH_SUPPORT + /* auth data */ + const char *user; /* Username for PAP */ + const char *passwd; /* Password for PAP, secret for CHAP */ +#if PPP_REMOTENAME + char remote_name[MAXNAMELEN + 1]; /* Peer's name for authentication */ +#endif /* PPP_REMOTENAME */ + +#if PAP_SUPPORT + u8_t pap_timeout_time; /* Timeout (seconds) for auth-req retrans. */ + u8_t pap_max_transmits; /* Number of auth-reqs sent */ +#if PPP_SERVER + u8_t pap_req_timeout; /* Time to wait for auth-req from peer */ +#endif /* PPP_SERVER */ +#endif /* PAP_SUPPPORT */ + +#if CHAP_SUPPORT + u8_t chap_timeout_time; /* Timeout (seconds) for retransmitting req */ + u8_t chap_max_transmits; /* max # times to send challenge */ +#if PPP_SERVER + u8_t chap_rechallenge_time; /* Time to wait for auth-req from peer */ +#endif /* PPP_SERVER */ +#endif /* CHAP_SUPPPORT */ + +#if EAP_SUPPORT + u8_t eap_req_time; /* Time to wait (for retransmit/fail) */ + u8_t eap_allow_req; /* Max Requests allowed */ +#if PPP_SERVER + u8_t eap_timeout_time; /* Time to wait (for retransmit/fail) */ + u8_t eap_max_transmits; /* Max Requests allowed */ +#endif /* PPP_SERVER */ +#endif /* EAP_SUPPORT */ + +#endif /* PPP_AUTH_SUPPORT */ + + u8_t fsm_timeout_time; /* Timeout time in seconds */ + u8_t fsm_max_conf_req_transmits; /* Maximum Configure-Request transmissions */ + u8_t fsm_max_term_transmits; /* Maximum Terminate-Request transmissions */ + u8_t fsm_max_nak_loops; /* Maximum number of nak loops tolerated */ + + u8_t lcp_loopbackfail; /* Number of times we receive our magic number from the peer + before deciding the link is looped-back. */ + u8_t lcp_echo_interval; /* Interval between LCP echo-requests */ + u8_t lcp_echo_fails; /* Tolerance to unanswered echo-requests */ + +} ppp_settings; + +#if PPP_SERVER +struct ppp_addrs { +#if PPP_IPV4_SUPPORT + ip4_addr_t our_ipaddr, his_ipaddr, netmask; +#if LWIP_DNS + ip4_addr_t dns1, dns2; +#endif /* LWIP_DNS */ +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + ip6_addr_t our6_ipaddr, his6_ipaddr; +#endif /* PPP_IPV6_SUPPORT */ +}; +#endif /* PPP_SERVER */ + +/* + * PPP interface control block. + */ +struct ppp_pcb_s { + ppp_settings settings; + const struct link_callbacks *link_cb; + void *link_ctx_cb; + void (*link_status_cb)(ppp_pcb *pcb, int err_code, void *ctx); /* Status change callback */ +#if PPP_NOTIFY_PHASE + void (*notify_phase_cb)(ppp_pcb *pcb, u8_t phase, void *ctx); /* Notify phase callback */ +#endif /* PPP_NOTIFY_PHASE */ + void *ctx_cb; /* Callbacks optional pointer */ + struct netif *netif; /* PPP interface */ + u8_t phase; /* where the link is at */ + u8_t err_code; /* Code indicating why interface is down. */ + + /* flags */ +#if PPP_IPV4_SUPPORT + unsigned int ask_for_local :1; /* request our address from peer */ + unsigned int ipcp_is_open :1; /* haven't called np_finished() */ + unsigned int ipcp_is_up :1; /* have called ipcp_up() */ + unsigned int if4_up :1; /* True when the IPv4 interface is up. */ +#if 0 /* UNUSED - PROXY ARP */ + unsigned int proxy_arp_set :1; /* Have created proxy arp entry */ +#endif /* UNUSED - PROXY ARP */ +#endif /* PPP_IPV4_SUPPORT */ +#if PPP_IPV6_SUPPORT + unsigned int ipv6cp_is_up :1; /* have called ip6cp_up() */ + unsigned int if6_up :1; /* True when the IPv6 interface is up. */ +#endif /* PPP_IPV6_SUPPORT */ + unsigned int lcp_echo_timer_running :1; /* set if a timer is running */ +#if VJ_SUPPORT + unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */ +#endif /* VJ_SUPPORT */ +#if CCP_SUPPORT + unsigned int ccp_all_rejected :1; /* we rejected all peer's options */ +#endif /* CCP_SUPPORT */ +#if MPPE_SUPPORT + unsigned int mppe_keys_set :1; /* Have the MPPE keys been set? */ +#endif /* MPPE_SUPPORT */ + +#if PPP_AUTH_SUPPORT + /* auth data */ +#if PPP_SERVER && defined(HAVE_MULTILINK) + char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */ +#endif /* PPP_SERVER && defined(HAVE_MULTILINK) */ + u16_t auth_pending; /* Records which authentication operations haven't completed yet. */ + u16_t auth_done; /* Records which authentication operations have been completed. */ + +#if PAP_SUPPORT + upap_state upap; /* PAP data */ +#endif /* PAP_SUPPORT */ + +#if CHAP_SUPPORT + chap_client_state chap_client; /* CHAP client data */ +#if PPP_SERVER + chap_server_state chap_server; /* CHAP server data */ +#endif /* PPP_SERVER */ +#endif /* CHAP_SUPPORT */ + +#if EAP_SUPPORT + eap_state eap; /* EAP data */ +#endif /* EAP_SUPPORT */ +#endif /* PPP_AUTH_SUPPORT */ + + fsm lcp_fsm; /* LCP fsm structure */ + lcp_options lcp_wantoptions; /* Options that we want to request */ + lcp_options lcp_gotoptions; /* Options that peer ack'd */ + lcp_options lcp_allowoptions; /* Options we allow peer to request */ + lcp_options lcp_hisoptions; /* Options that we ack'd */ + u16_t peer_mru; /* currently negotiated peer MRU */ + u8_t lcp_echos_pending; /* Number of outstanding echo msgs */ + u8_t lcp_echo_number; /* ID number of next echo frame */ + + u8_t num_np_open; /* Number of network protocols which we have opened. */ + u8_t num_np_up; /* Number of network protocols which have come up. */ + +#if VJ_SUPPORT + struct vjcompress vj_comp; /* Van Jacobson compression header. */ +#endif /* VJ_SUPPORT */ + +#if CCP_SUPPORT + fsm ccp_fsm; /* CCP fsm structure */ + ccp_options ccp_wantoptions; /* what to request the peer to use */ + ccp_options ccp_gotoptions; /* what the peer agreed to do */ + ccp_options ccp_allowoptions; /* what we'll agree to do */ + ccp_options ccp_hisoptions; /* what we agreed to do */ + u8_t ccp_localstate; /* Local state (mainly for handling reset-reqs and reset-acks). */ + u8_t ccp_receive_method; /* Method chosen on receive path */ + u8_t ccp_transmit_method; /* Method chosen on transmit path */ +#if MPPE_SUPPORT + ppp_mppe_state mppe_comp; /* MPPE "compressor" structure */ + ppp_mppe_state mppe_decomp; /* MPPE "decompressor" structure */ +#endif /* MPPE_SUPPORT */ +#endif /* CCP_SUPPORT */ + +#if PPP_IPV4_SUPPORT + fsm ipcp_fsm; /* IPCP fsm structure */ + ipcp_options ipcp_wantoptions; /* Options that we want to request */ + ipcp_options ipcp_gotoptions; /* Options that peer ack'd */ + ipcp_options ipcp_allowoptions; /* Options we allow peer to request */ + ipcp_options ipcp_hisoptions; /* Options that we ack'd */ +#endif /* PPP_IPV4_SUPPORT */ + +#if PPP_IPV6_SUPPORT + fsm ipv6cp_fsm; /* IPV6CP fsm structure */ + ipv6cp_options ipv6cp_wantoptions; /* Options that we want to request */ + ipv6cp_options ipv6cp_gotoptions; /* Options that peer ack'd */ + ipv6cp_options ipv6cp_allowoptions; /* Options we allow peer to request */ + ipv6cp_options ipv6cp_hisoptions; /* Options that we ack'd */ +#endif /* PPP_IPV6_SUPPORT */ +}; + +/************************ + *** PUBLIC FUNCTIONS *** + ************************/ + +/* + * WARNING: For multi-threads environment, all ppp_set_* functions most + * only be called while the PPP is in the dead phase (i.e. disconnected). + */ + +#if PPP_AUTH_SUPPORT +/* + * Set PPP authentication. + * + * Warning: Using PPPAUTHTYPE_ANY might have security consequences. + * RFC 1994 says: + * + * In practice, within or associated with each PPP server, there is a + * database which associates "user" names with authentication + * information ("secrets"). It is not anticipated that a particular + * named user would be authenticated by multiple methods. This would + * make the user vulnerable to attacks which negotiate the least secure + * method from among a set (such as PAP rather than CHAP). If the same + * secret was used, PAP would reveal the secret to be used later with + * CHAP. + * + * Instead, for each user name there should be an indication of exactly + * one method used to authenticate that user name. If a user needs to + * make use of different authentication methods under different + * circumstances, then distinct user names SHOULD be employed, each of + * which identifies exactly one authentication method. + * + * Default is none auth type, unset (NULL) user and passwd. + */ +#define PPPAUTHTYPE_NONE 0x00 +#define PPPAUTHTYPE_PAP 0x01 +#define PPPAUTHTYPE_CHAP 0x02 +#define PPPAUTHTYPE_MSCHAP 0x04 +#define PPPAUTHTYPE_MSCHAP_V2 0x08 +#define PPPAUTHTYPE_EAP 0x10 +#define PPPAUTHTYPE_ANY 0xff +void ppp_set_auth(ppp_pcb *pcb, u8_t authtype, const char *user, const char *passwd); + +/* + * If set, peer is required to authenticate. This is mostly necessary for PPP server support. + * + * Default is false. + */ +#define ppp_set_auth_required(ppp, boolval) (ppp->settings.auth_required = boolval) +#endif /* PPP_AUTH_SUPPORT */ + +#if PPP_IPV4_SUPPORT +/* + * Set PPP interface "our" and "his" IPv4 addresses. This is mostly necessary for PPP server + * support but it can also be used on a PPP link where each side choose its own IP address. + * + * Default is unset (0.0.0.0). + */ +#define ppp_set_ipcp_ouraddr(ppp, addr) do { ppp->ipcp_wantoptions.ouraddr = ip4_addr_get_u32(addr); \ + ppp->ask_for_local = ppp->ipcp_wantoptions.ouraddr != 0; } while(0) +#define ppp_set_ipcp_hisaddr(ppp, addr) (ppp->ipcp_wantoptions.hisaddr = ip4_addr_get_u32(addr)) +#if LWIP_DNS +/* + * Set DNS server addresses that are sent if the peer asks for them. This is mostly necessary + * for PPP server support. + * + * Default is unset (0.0.0.0). + */ +#define ppp_set_ipcp_dnsaddr(ppp, index, addr) (ppp->ipcp_allowoptions.dnsaddr[index] = ip4_addr_get_u32(addr)) + +/* + * If set, we ask the peer for up to 2 DNS server addresses. Received DNS server addresses are + * registered using the dns_setserver() function. + * + * Default is false. + */ +#define ppp_set_usepeerdns(ppp, boolval) (ppp->settings.usepeerdns = boolval) +#endif /* LWIP_DNS */ +#endif /* PPP_IPV4_SUPPORT */ + +#if MPPE_SUPPORT +/* Disable MPPE (Microsoft Point to Point Encryption). This parameter is exclusive. */ +#define PPP_MPPE_DISABLE 0x00 +/* Require the use of MPPE (Microsoft Point to Point Encryption). */ +#define PPP_MPPE_ENABLE 0x01 +/* Allow MPPE to use stateful mode. Stateless mode is still attempted first. */ +#define PPP_MPPE_ALLOW_STATEFUL 0x02 +/* Refuse the use of MPPE with 40-bit encryption. Conflict with PPP_MPPE_REFUSE_128. */ +#define PPP_MPPE_REFUSE_40 0x04 +/* Refuse the use of MPPE with 128-bit encryption. Conflict with PPP_MPPE_REFUSE_40. */ +#define PPP_MPPE_REFUSE_128 0x08 +/* + * Set MPPE configuration + * + * Default is disabled. + */ +void ppp_set_mppe(ppp_pcb *pcb, u8_t flags); +#endif /* MPPE_SUPPORT */ + +/* + * Wait for up to intval milliseconds for a valid PPP packet from the peer. + * At the end of this time, or when a valid PPP packet is received from the + * peer, we commence negotiation by sending our first LCP packet. + * + * Default is 0. + */ +#define ppp_set_listen_time(ppp, intval) (ppp->settings.listen_time = intval) + +/* + * If set, we will attempt to initiate a connection but if no reply is received from + * the peer, we will then just wait passively for a valid LCP packet from the peer. + * + * Default is false. + */ +#define ppp_set_passive(ppp, boolval) (ppp->lcp_wantoptions.passive = boolval) + +/* + * If set, we will not transmit LCP packets to initiate a connection until a valid + * LCP packet is received from the peer. This is what we usually call the server mode. + * + * Default is false. + */ +#define ppp_set_silent(ppp, boolval) (ppp->lcp_wantoptions.silent = boolval) + +/* + * If set, enable protocol field compression negotiation in both the receive and + * the transmit direction. + * + * Default is true. + */ +#define ppp_set_neg_pcomp(ppp, boolval) (ppp->lcp_wantoptions.neg_pcompression = \ + ppp->lcp_allowoptions.neg_pcompression = boolval) + +/* + * If set, enable Address/Control compression in both the receive and the transmit + * direction. + * + * Default is true. + */ +#define ppp_set_neg_accomp(ppp, boolval) (ppp->lcp_wantoptions.neg_accompression = \ + ppp->lcp_allowoptions.neg_accompression = boolval) + +/* + * If set, enable asyncmap negotiation. Otherwise forcing all control characters to + * be escaped for both the transmit and the receive direction. + * + * Default is true. + */ +#define ppp_set_neg_asyncmap(ppp, boolval) (ppp->lcp_wantoptions.neg_asyncmap = \ + ppp->lcp_allowoptions.neg_asyncmap = boolval) + +/* + * This option sets the Async-Control-Character-Map (ACCM) for this end of the link. + * The ACCM is a set of 32 bits, one for each of the ASCII control characters with + * values from 0 to 31, where a 1 bit indicates that the corresponding control + * character should not be used in PPP packets sent to this system. The map is + * an unsigned 32 bits integer where the least significant bit (00000001) represents + * character 0 and the most significant bit (80000000) represents character 31. + * We will then ask the peer to send these characters as a 2-byte escape sequence. + * + * Default is 0. + */ +#define ppp_set_asyncmap(ppp, intval) (ppp->lcp_wantoptions.asyncmap = intval) + +/* + * Set a PPP interface as the default network interface + * (used to output all packets for which no specific route is found). + */ +#define ppp_set_default(ppp) netif_set_default(ppp->netif) + +#if PPP_NOTIFY_PHASE +/* + * Set a PPP notify phase callback. + * + * This can be used for example to set a LED pattern depending on the + * current phase of the PPP session. + */ +typedef void (*ppp_notify_phase_cb_fn)(ppp_pcb *pcb, u8_t phase, void *ctx); +void ppp_set_notify_phase_callback(ppp_pcb *pcb, ppp_notify_phase_cb_fn notify_phase_cb); +#endif /* PPP_NOTIFY_PHASE */ + +/* + * Initiate a PPP connection. + * + * This can only be called if PPP is in the dead phase. + * + * Holdoff is the time to wait (in seconds) before initiating + * the connection. + * + * If this port connects to a modem, the modem connection must be + * established before calling this. + */ +err_t ppp_connect(ppp_pcb *pcb, u16_t holdoff); + +#if PPP_SERVER +/* + * Listen for an incoming PPP connection. + * + * This can only be called if PPP is in the dead phase. + * + * If this port connects to a modem, the modem connection must be + * established before calling this. + */ +err_t ppp_listen(ppp_pcb *pcb); +#endif /* PPP_SERVER */ + +/* + * Initiate the end of a PPP connection. + * Any outstanding packets in the queues are dropped. + * + * Setting nocarrier to 1 close the PPP connection without initiating the + * shutdown procedure. Always using nocarrier = 0 is still recommended, + * this is going to take a little longer time if your link is down, but + * is a safer choice for the PPP state machine. + * + * Return 0 on success, an error code on failure. + */ +err_t ppp_close(ppp_pcb *pcb, u8_t nocarrier); + +/* + * Release the control block. + * + * This can only be called if PPP is in the dead phase. + * + * You must use ppp_close() before if you wish to terminate + * an established PPP session. + * + * Return 0 on success, an error code on failure. + */ +err_t ppp_free(ppp_pcb *pcb); + +/* + * PPP IOCTL commands. + * + * Get the up status - 0 for down, non-zero for up. The argument must + * point to an int. + */ +#define PPPCTLG_UPSTATUS 0 + +/* + * Get the PPP error code. The argument must point to an int. + * Returns a PPPERR_* value. + */ +#define PPPCTLG_ERRCODE 1 + +/* + * Get the fd associated with a PPP over serial + */ +#define PPPCTLG_FD 2 + +/* + * Get and set parameters for the given connection. + * Return 0 on success, an error code on failure. + */ +err_t ppp_ioctl(ppp_pcb *pcb, u8_t cmd, void *arg); + +/* Get the PPP netif interface */ +#define ppp_netif(ppp) (ppp->netif) + +/* Set an lwIP-style status-callback for the selected PPP device */ +#define ppp_set_netif_statuscallback(ppp, status_cb) \ + netif_set_status_callback(ppp->netif, status_cb); + +/* Set an lwIP-style link-callback for the selected PPP device */ +#define ppp_set_netif_linkcallback(ppp, link_cb) \ + netif_set_link_callback(ppp->netif, link_cb); + +#ifdef __cplusplus +} +#endif + +#endif /* PPP_H */ + +#endif /* PPP_SUPPORT */ diff --git a/tools/sdk/lwip2/include/netif/ppp/ppp_opts.h b/tools/sdk/lwip2/include/netif/ppp/ppp_opts.h new file mode 100644 index 000000000..6702bec61 --- /dev/null +++ b/tools/sdk/lwip2/include/netif/ppp/ppp_opts.h @@ -0,0 +1,610 @@ +/* + * 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. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#ifndef LWIP_PPP_OPTS_H +#define LWIP_PPP_OPTS_H + +#include "lwip/opt.h" + +/** + * PPP_SUPPORT==1: Enable PPP. + */ +#ifndef PPP_SUPPORT +#define PPP_SUPPORT 0 +#endif + +/** + * PPPOE_SUPPORT==1: Enable PPP Over Ethernet + */ +#ifndef PPPOE_SUPPORT +#define PPPOE_SUPPORT 0 +#endif + +/** + * PPPOL2TP_SUPPORT==1: Enable PPP Over L2TP + */ +#ifndef PPPOL2TP_SUPPORT +#define PPPOL2TP_SUPPORT 0 +#endif + +/** + * PPPOL2TP_AUTH_SUPPORT==1: Enable PPP Over L2TP Auth (enable MD5 support) + */ +#ifndef PPPOL2TP_AUTH_SUPPORT +#define PPPOL2TP_AUTH_SUPPORT PPPOL2TP_SUPPORT +#endif + +/** + * PPPOS_SUPPORT==1: Enable PPP Over Serial + */ +#ifndef PPPOS_SUPPORT +#define PPPOS_SUPPORT PPP_SUPPORT +#endif + +/** + * LWIP_PPP_API==1: Enable PPP API (in pppapi.c) + */ +#ifndef LWIP_PPP_API +#define LWIP_PPP_API (PPP_SUPPORT && (NO_SYS == 0)) +#endif + +#if PPP_SUPPORT + +/** + * MEMP_NUM_PPP_PCB: the number of simultaneously active PPP + * connections (requires the PPP_SUPPORT option) + */ +#ifndef MEMP_NUM_PPP_PCB +#define MEMP_NUM_PPP_PCB 1 +#endif + +/** + * PPP_NUM_TIMEOUTS_PER_PCB: the number of sys_timeouts running in parallel per + * ppp_pcb. See the detailed explanation at the end of ppp_impl.h about simultaneous + * timers analysis. + */ +#ifndef PPP_NUM_TIMEOUTS_PER_PCB +#define PPP_NUM_TIMEOUTS_PER_PCB (1 + PPP_IPV4_SUPPORT + PPP_IPV6_SUPPORT + CCP_SUPPORT) +#endif + +/* The number of sys_timeouts required for the PPP module */ +#define PPP_NUM_TIMEOUTS (PPP_SUPPORT * PPP_NUM_TIMEOUTS_PER_PCB * MEMP_NUM_PPP_PCB) + +/** + * MEMP_NUM_PPPOS_INTERFACES: the number of concurrently active PPPoS + * interfaces (only used with PPPOS_SUPPORT==1) + */ +#ifndef MEMP_NUM_PPPOS_INTERFACES +#define MEMP_NUM_PPPOS_INTERFACES MEMP_NUM_PPP_PCB +#endif + +/** + * MEMP_NUM_PPPOE_INTERFACES: the number of concurrently active PPPoE + * interfaces (only used with PPPOE_SUPPORT==1) + */ +#ifndef MEMP_NUM_PPPOE_INTERFACES +#define MEMP_NUM_PPPOE_INTERFACES 1 +#endif + +/** + * MEMP_NUM_PPPOL2TP_INTERFACES: the number of concurrently active PPPoL2TP + * interfaces (only used with PPPOL2TP_SUPPORT==1) + */ +#ifndef MEMP_NUM_PPPOL2TP_INTERFACES +#define MEMP_NUM_PPPOL2TP_INTERFACES 1 +#endif + +/** + * MEMP_NUM_PPP_API_MSG: Number of concurrent PPP API messages (in pppapi.c) + */ +#ifndef MEMP_NUM_PPP_API_MSG +#define MEMP_NUM_PPP_API_MSG 5 +#endif + +/** + * PPP_DEBUG: Enable debugging for PPP. + */ +#ifndef PPP_DEBUG +#define PPP_DEBUG LWIP_DBG_OFF +#endif + +/** + * PPP_INPROC_IRQ_SAFE==1 call pppos_input() using tcpip_callback(). + * + * Please read the "PPPoS input path" chapter in the PPP documentation about this option. + */ +#ifndef PPP_INPROC_IRQ_SAFE +#define PPP_INPROC_IRQ_SAFE 0 +#endif + +/** + * PRINTPKT_SUPPORT==1: Enable PPP print packet support + * + * Mandatory for debugging, it displays exchanged packet content in debug trace. + */ +#ifndef PRINTPKT_SUPPORT +#define PRINTPKT_SUPPORT 0 +#endif + +/** + * PPP_IPV4_SUPPORT==1: Enable PPP IPv4 support + */ +#ifndef PPP_IPV4_SUPPORT +#define PPP_IPV4_SUPPORT (LWIP_IPV4) +#endif + +/** + * PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support + */ +#ifndef PPP_IPV6_SUPPORT +#define PPP_IPV6_SUPPORT (LWIP_IPV6) +#endif + +/** + * PPP_NOTIFY_PHASE==1: Support PPP notify phase support + * + * PPP notify phase support allows you to set a callback which is + * called on change of the internal PPP state machine. + * + * This can be used for example to set a LED pattern depending on the + * current phase of the PPP session. + */ +#ifndef PPP_NOTIFY_PHASE +#define PPP_NOTIFY_PHASE 0 +#endif + +/** + * pbuf_type PPP is using for LCP, PAP, CHAP, EAP, CCP, IPCP and IP6CP packets. + * + * Memory allocated must be single buffered for PPP to works, it requires pbuf + * that are not going to be chained when allocated. This requires setting + * PBUF_POOL_BUFSIZE to at least 512 bytes, which is quite huge for small systems. + * + * Setting PPP_USE_PBUF_RAM to 1 makes PPP use memory from heap where continuous + * buffers are required, allowing you to use a smaller PBUF_POOL_BUFSIZE. + */ +#ifndef PPP_USE_PBUF_RAM +#define PPP_USE_PBUF_RAM 0 +#endif + +/** + * PPP_FCS_TABLE: Keep a 256*2 byte table to speed up FCS calculation for PPPoS + */ +#ifndef PPP_FCS_TABLE +#define PPP_FCS_TABLE 1 +#endif + +/** + * PAP_SUPPORT==1: Support PAP. + */ +#ifndef PAP_SUPPORT +#define PAP_SUPPORT 0 +#endif + +/** + * CHAP_SUPPORT==1: Support CHAP. + */ +#ifndef CHAP_SUPPORT +#define CHAP_SUPPORT 0 +#endif + +/** + * MSCHAP_SUPPORT==1: Support MSCHAP. + */ +#ifndef MSCHAP_SUPPORT +#define MSCHAP_SUPPORT 0 +#endif +#if MSCHAP_SUPPORT +/* MSCHAP requires CHAP support */ +#undef CHAP_SUPPORT +#define CHAP_SUPPORT 1 +#endif /* MSCHAP_SUPPORT */ + +/** + * EAP_SUPPORT==1: Support EAP. + */ +#ifndef EAP_SUPPORT +#define EAP_SUPPORT 0 +#endif + +/** + * CCP_SUPPORT==1: Support CCP. + */ +#ifndef CCP_SUPPORT +#define CCP_SUPPORT 0 +#endif + +/** + * MPPE_SUPPORT==1: Support MPPE. + */ +#ifndef MPPE_SUPPORT +#define MPPE_SUPPORT 0 +#endif +#if MPPE_SUPPORT +/* MPPE requires CCP support */ +#undef CCP_SUPPORT +#define CCP_SUPPORT 1 +/* MPPE requires MSCHAP support */ +#undef MSCHAP_SUPPORT +#define MSCHAP_SUPPORT 1 +/* MSCHAP requires CHAP support */ +#undef CHAP_SUPPORT +#define CHAP_SUPPORT 1 +#endif /* MPPE_SUPPORT */ + +/** + * CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET! + */ +#ifndef CBCP_SUPPORT +#define CBCP_SUPPORT 0 +#endif + +/** + * ECP_SUPPORT==1: Support ECP. CURRENTLY NOT SUPPORTED! DO NOT SET! + */ +#ifndef ECP_SUPPORT +#define ECP_SUPPORT 0 +#endif + +/** + * DEMAND_SUPPORT==1: Support dial on demand. CURRENTLY NOT SUPPORTED! DO NOT SET! + */ +#ifndef DEMAND_SUPPORT +#define DEMAND_SUPPORT 0 +#endif + +/** + * LQR_SUPPORT==1: Support Link Quality Report. Do nothing except exchanging some LCP packets. + */ +#ifndef LQR_SUPPORT +#define LQR_SUPPORT 0 +#endif + +/** + * PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session). + * + * Currently only supported for PPPoS. + */ +#ifndef PPP_SERVER +#define PPP_SERVER 0 +#endif + +#if PPP_SERVER +/* + * PPP_OUR_NAME: Our name for authentication purposes + */ +#ifndef PPP_OUR_NAME +#define PPP_OUR_NAME "lwIP" +#endif +#endif /* PPP_SERVER */ + +/** + * VJ_SUPPORT==1: Support VJ header compression. + */ +#ifndef VJ_SUPPORT +#define VJ_SUPPORT 1 +#endif +/* VJ compression is only supported for TCP over IPv4 over PPPoS. */ +#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP +#undef VJ_SUPPORT +#define VJ_SUPPORT 0 +#endif /* !PPPOS_SUPPORT */ + +/** + * PPP_MD5_RANDM==1: Use MD5 for better randomness. + * Enabled by default if CHAP, EAP, or L2TP AUTH support is enabled. + */ +#ifndef PPP_MD5_RANDM +#define PPP_MD5_RANDM (CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT) +#endif + +/** + * PolarSSL embedded library + * + * + * lwIP contains some files fetched from the latest BSD release of + * the PolarSSL project (PolarSSL 0.10.1-bsd) for ciphers and encryption + * methods we need for lwIP PPP support. + * + * The PolarSSL files were cleaned to contain only the necessary struct + * fields and functions needed for lwIP. + * + * The PolarSSL API was not changed at all, so if you are already using + * PolarSSL you can choose to skip the compilation of the included PolarSSL + * library into lwIP. + * + * If you are not using the embedded copy you must include external + * libraries into your arch/cc.h port file. + * + * Beware of the stack requirements which can be a lot larger if you are not + * using our cleaned PolarSSL library. + */ + +/** + * LWIP_USE_EXTERNAL_POLARSSL: Use external PolarSSL library + */ +#ifndef LWIP_USE_EXTERNAL_POLARSSL +#define LWIP_USE_EXTERNAL_POLARSSL 0 +#endif + +/** + * LWIP_USE_EXTERNAL_MBEDTLS: Use external mbed TLS library + */ +#ifndef LWIP_USE_EXTERNAL_MBEDTLS +#define LWIP_USE_EXTERNAL_MBEDTLS 0 +#endif + +/* + * PPP Timeouts + */ + +/** + * FSM_DEFTIMEOUT: Timeout time in seconds + */ +#ifndef FSM_DEFTIMEOUT +#define FSM_DEFTIMEOUT 6 +#endif + +/** + * FSM_DEFMAXTERMREQS: Maximum Terminate-Request transmissions + */ +#ifndef FSM_DEFMAXTERMREQS +#define FSM_DEFMAXTERMREQS 2 +#endif + +/** + * FSM_DEFMAXCONFREQS: Maximum Configure-Request transmissions + */ +#ifndef FSM_DEFMAXCONFREQS +#define FSM_DEFMAXCONFREQS 10 +#endif + +/** + * FSM_DEFMAXNAKLOOPS: Maximum number of nak loops + */ +#ifndef FSM_DEFMAXNAKLOOPS +#define FSM_DEFMAXNAKLOOPS 5 +#endif + +/** + * UPAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req + */ +#ifndef UPAP_DEFTIMEOUT +#define UPAP_DEFTIMEOUT 6 +#endif + +/** + * UPAP_DEFTRANSMITS: Maximum number of auth-reqs to send + */ +#ifndef UPAP_DEFTRANSMITS +#define UPAP_DEFTRANSMITS 10 +#endif + +#if PPP_SERVER +/** + * UPAP_DEFREQTIME: Time to wait for auth-req from peer + */ +#ifndef UPAP_DEFREQTIME +#define UPAP_DEFREQTIME 30 +#endif +#endif /* PPP_SERVER */ + +/** + * CHAP_DEFTIMEOUT: Timeout (seconds) for retransmitting req + */ +#ifndef CHAP_DEFTIMEOUT +#define CHAP_DEFTIMEOUT 6 +#endif + +/** + * CHAP_DEFTRANSMITS: max # times to send challenge + */ +#ifndef CHAP_DEFTRANSMITS +#define CHAP_DEFTRANSMITS 10 +#endif + +#if PPP_SERVER +/** + * CHAP_DEFRECHALLENGETIME: If this option is > 0, rechallenge the peer every n seconds + */ +#ifndef CHAP_DEFRECHALLENGETIME +#define CHAP_DEFRECHALLENGETIME 0 +#endif +#endif /* PPP_SERVER */ + +/** + * EAP_DEFREQTIME: Time to wait for peer request + */ +#ifndef EAP_DEFREQTIME +#define EAP_DEFREQTIME 6 +#endif + +/** + * EAP_DEFALLOWREQ: max # times to accept requests + */ +#ifndef EAP_DEFALLOWREQ +#define EAP_DEFALLOWREQ 10 +#endif + +#if PPP_SERVER +/** + * EAP_DEFTIMEOUT: Timeout (seconds) for rexmit + */ +#ifndef EAP_DEFTIMEOUT +#define EAP_DEFTIMEOUT 6 +#endif + +/** + * EAP_DEFTRANSMITS: max # times to transmit + */ +#ifndef EAP_DEFTRANSMITS +#define EAP_DEFTRANSMITS 10 +#endif +#endif /* PPP_SERVER */ + +/** + * LCP_DEFLOOPBACKFAIL: Default number of times we receive our magic number from the peer + * before deciding the link is looped-back. + */ +#ifndef LCP_DEFLOOPBACKFAIL +#define LCP_DEFLOOPBACKFAIL 10 +#endif + +/** + * LCP_ECHOINTERVAL: Interval in seconds between keepalive echo requests, 0 to disable. + */ +#ifndef LCP_ECHOINTERVAL +#define LCP_ECHOINTERVAL 0 +#endif + +/** + * LCP_MAXECHOFAILS: Number of unanswered echo requests before failure. + */ +#ifndef LCP_MAXECHOFAILS +#define LCP_MAXECHOFAILS 3 +#endif + +/** + * PPP_MAXIDLEFLAG: Max Xmit idle time (in ms) before resend flag char. + */ +#ifndef PPP_MAXIDLEFLAG +#define PPP_MAXIDLEFLAG 100 +#endif + +/** + * PPP Packet sizes + */ + +/** + * PPP_MRU: Default MRU + */ +#ifndef PPP_MRU +#define PPP_MRU 1500 +#endif + +/** + * PPP_DEFMRU: Default MRU to try + */ +#ifndef PPP_DEFMRU +#define PPP_DEFMRU 1500 +#endif + +/** + * PPP_MAXMRU: Normally limit MRU to this (pppd default = 16384) + */ +#ifndef PPP_MAXMRU +#define PPP_MAXMRU 1500 +#endif + +/** + * PPP_MINMRU: No MRUs below this + */ +#ifndef PPP_MINMRU +#define PPP_MINMRU 128 +#endif + +/** + * PPPOL2TP_DEFMRU: Default MTU and MRU for L2TP + * Default = 1500 - PPPoE(6) - PPP Protocol(2) - IPv4 header(20) - UDP Header(8) + * - L2TP Header(6) - HDLC Header(2) - PPP Protocol(2) - MPPE Header(2) - PPP Protocol(2) + */ +#if PPPOL2TP_SUPPORT +#ifndef PPPOL2TP_DEFMRU +#define PPPOL2TP_DEFMRU 1450 +#endif +#endif /* PPPOL2TP_SUPPORT */ + +/** + * MAXNAMELEN: max length of hostname or name for auth + */ +#ifndef MAXNAMELEN +#define MAXNAMELEN 256 +#endif + +/** + * MAXSECRETLEN: max length of password or secret + */ +#ifndef MAXSECRETLEN +#define MAXSECRETLEN 256 +#endif + +/* ------------------------------------------------------------------------- */ + +/* + * Build triggers for embedded PolarSSL + */ +#if !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS + +/* CHAP, EAP, L2TP AUTH and MD5 Random require MD5 support */ +#if CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM +#define LWIP_INCLUDED_POLARSSL_MD5 1 +#endif /* CHAP_SUPPORT || EAP_SUPPORT || PPPOL2TP_AUTH_SUPPORT || PPP_MD5_RANDM */ + +#if MSCHAP_SUPPORT + +/* MSCHAP require MD4 support */ +#define LWIP_INCLUDED_POLARSSL_MD4 1 +/* MSCHAP require SHA1 support */ +#define LWIP_INCLUDED_POLARSSL_SHA1 1 +/* MSCHAP require DES support */ +#define LWIP_INCLUDED_POLARSSL_DES 1 + +/* MS-CHAP support is required for MPPE */ +#if MPPE_SUPPORT +/* MPPE require ARC4 support */ +#define LWIP_INCLUDED_POLARSSL_ARC4 1 +#endif /* MPPE_SUPPORT */ + +#endif /* MSCHAP_SUPPORT */ + +#endif /* !LWIP_USE_EXTERNAL_POLARSSL && !LWIP_USE_EXTERNAL_MBEDTLS */ + +/* Default value if unset */ +#ifndef LWIP_INCLUDED_POLARSSL_MD4 +#define LWIP_INCLUDED_POLARSSL_MD4 0 +#endif /* LWIP_INCLUDED_POLARSSL_MD4 */ +#ifndef LWIP_INCLUDED_POLARSSL_MD5 +#define LWIP_INCLUDED_POLARSSL_MD5 0 +#endif /* LWIP_INCLUDED_POLARSSL_MD5 */ +#ifndef LWIP_INCLUDED_POLARSSL_SHA1 +#define LWIP_INCLUDED_POLARSSL_SHA1 0 +#endif /* LWIP_INCLUDED_POLARSSL_SHA1 */ +#ifndef LWIP_INCLUDED_POLARSSL_DES +#define LWIP_INCLUDED_POLARSSL_DES 0 +#endif /* LWIP_INCLUDED_POLARSSL_DES */ +#ifndef LWIP_INCLUDED_POLARSSL_ARC4 +#define LWIP_INCLUDED_POLARSSL_ARC4 0 +#endif /* LWIP_INCLUDED_POLARSSL_ARC4 */ + +#endif /* PPP_SUPPORT */ + +/* Default value if unset */ +#ifndef PPP_NUM_TIMEOUTS +#define PPP_NUM_TIMEOUTS 0 +#endif /* PPP_NUM_TIMEOUTS */ + +#endif /* LWIP_PPP_OPTS_H */ diff --git a/tools/sdk/lwip2/include/netif/ppp/pppos.h b/tools/sdk/lwip2/include/netif/ppp/pppos.h new file mode 100644 index 000000000..380a965ce --- /dev/null +++ b/tools/sdk/lwip2/include/netif/ppp/pppos.h @@ -0,0 +1,126 @@ +/** + * @file + * Network Point to Point Protocol over Serial header file. + * + */ + +/* + * 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. + * + * This file is part of the lwIP TCP/IP stack. + * + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && PPPOS_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef PPPOS_H +#define PPPOS_H + +#include "lwip/sys.h" + +#include "ppp.h" +#include "vj.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* PPP packet parser states. Current state indicates operation yet to be + * completed. */ +enum { + PDIDLE = 0, /* Idle state - waiting. */ + PDSTART, /* Process start flag. */ + PDADDRESS, /* Process address field. */ + PDCONTROL, /* Process control field. */ + PDPROTOCOL1, /* Process protocol field 1. */ + PDPROTOCOL2, /* Process protocol field 2. */ + PDDATA /* Process data byte. */ +}; + +/* PPPoS serial output callback function prototype */ +typedef u32_t (*pppos_output_cb_fn)(ppp_pcb *pcb, u8_t *data, u32_t len, void *ctx); + +/* + * Extended asyncmap - allows any character to be escaped. + */ +typedef u8_t ext_accm[32]; + +/* + * PPPoS interface control block. + */ +typedef struct pppos_pcb_s pppos_pcb; +struct pppos_pcb_s { + /* -- below are data that will NOT be cleared between two sessions */ + ppp_pcb *ppp; /* PPP PCB */ + pppos_output_cb_fn output_cb; /* PPP serial output callback */ + + /* -- below are data that will be cleared between two sessions + * + * last_xmit must be the first member of cleared members, because it is + * used to know which part must not be cleared. + */ + u32_t last_xmit; /* Time of last transmission. */ + ext_accm out_accm; /* Async-Ctl-Char-Map for output. */ + + /* flags */ + unsigned int open :1; /* Set if PPPoS is open */ + unsigned int pcomp :1; /* Does peer accept protocol compression? */ + unsigned int accomp :1; /* Does peer accept addr/ctl compression? */ + + /* PPPoS rx */ + ext_accm in_accm; /* Async-Ctl-Char-Map for input. */ + struct pbuf *in_head, *in_tail; /* The input packet. */ + u16_t in_protocol; /* The input protocol code. */ + u16_t in_fcs; /* Input Frame Check Sequence value. */ + u8_t in_state; /* The input process state. */ + u8_t in_escaped; /* Escape next character. */ +}; + +/* Create a new PPPoS session. */ +ppp_pcb *pppos_create(struct netif *pppif, pppos_output_cb_fn output_cb, + ppp_link_status_cb_fn link_status_cb, void *ctx_cb); + +#if !NO_SYS && !PPP_INPROC_IRQ_SAFE +/* Pass received raw characters to PPPoS to be decoded through lwIP TCPIP thread. */ +err_t pppos_input_tcpip(ppp_pcb *ppp, u8_t *s, int l); +#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ + +/* PPP over Serial: this is the input function to be called for received data. */ +void pppos_input(ppp_pcb *ppp, u8_t* data, int len); + + +/* + * Functions called from lwIP + * DO NOT CALL FROM lwIP USER APPLICATION. + */ +#if !NO_SYS && !PPP_INPROC_IRQ_SAFE +err_t pppos_input_sys(struct pbuf *p, struct netif *inp); +#endif /* !NO_SYS && !PPP_INPROC_IRQ_SAFE */ + +#ifdef __cplusplus +} +#endif + +#endif /* PPPOS_H */ +#endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */ diff --git a/tools/sdk/lwip2/include/netif/ppp/vj.h b/tools/sdk/lwip2/include/netif/ppp/vj.h new file mode 100644 index 000000000..77d9976c5 --- /dev/null +++ b/tools/sdk/lwip2/include/netif/ppp/vj.h @@ -0,0 +1,169 @@ +/* + * Definitions for tcp compression routines. + * + * $Id: vj.h,v 1.7 2010/02/22 17:52:09 goldsimon Exp $ + * + * Copyright (c) 1989 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + * + * Van Jacobson (van@helios.ee.lbl.gov), Dec 31, 1989: + * - Initial distribution. + */ + +#include "netif/ppp/ppp_opts.h" +#if PPP_SUPPORT && VJ_SUPPORT /* don't build if not configured for use in lwipopts.h */ + +#ifndef VJ_H +#define VJ_H + +#include "lwip/ip.h" +#include "lwip/priv/tcp_priv.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define MAX_SLOTS 16 /* must be > 2 and < 256 */ +#define MAX_HDR 128 + +/* + * Compressed packet format: + * + * The first octet contains the packet type (top 3 bits), TCP + * 'push' bit, and flags that indicate which of the 4 TCP sequence + * numbers have changed (bottom 5 bits). The next octet is a + * conversation number that associates a saved IP/TCP header with + * the compressed packet. The next two octets are the TCP checksum + * from the original datagram. The next 0 to 15 octets are + * sequence number changes, one change per bit set in the header + * (there may be no changes and there are two special cases where + * the receiver implicitly knows what changed -- see below). + * + * There are 5 numbers which can change (they are always inserted + * in the following order): TCP urgent pointer, window, + * acknowlegement, sequence number and IP ID. (The urgent pointer + * is different from the others in that its value is sent, not the + * change in value.) Since typical use of SLIP links is biased + * toward small packets (see comments on MTU/MSS below), changes + * use a variable length coding with one octet for numbers in the + * range 1 - 255 and 3 octets (0, MSB, LSB) for numbers in the + * range 256 - 65535 or 0. (If the change in sequence number or + * ack is more than 65535, an uncompressed packet is sent.) + */ + +/* + * Packet types (must not conflict with IP protocol version) + * + * The top nibble of the first octet is the packet type. There are + * three possible types: IP (not proto TCP or tcp with one of the + * control flags set); uncompressed TCP (a normal IP/TCP packet but + * with the 8-bit protocol field replaced by an 8-bit connection id -- + * this type of packet syncs the sender & receiver); and compressed + * TCP (described above). + * + * LSB of 4-bit field is TCP "PUSH" bit (a worthless anachronism) and + * is logically part of the 4-bit "changes" field that follows. Top + * three bits are actual packet type. For backward compatibility + * and in the interest of conserving bits, numbers are chosen so the + * IP protocol version number (4) which normally appears in this nibble + * means "IP packet". + */ + +/* packet types */ +#define TYPE_IP 0x40 +#define TYPE_UNCOMPRESSED_TCP 0x70 +#define TYPE_COMPRESSED_TCP 0x80 +#define TYPE_ERROR 0x00 + +/* Bits in first octet of compressed packet */ +#define NEW_C 0x40 /* flag bits for what changed in a packet */ +#define NEW_I 0x20 +#define NEW_S 0x08 +#define NEW_A 0x04 +#define NEW_W 0x02 +#define NEW_U 0x01 + +/* reserved, special-case values of above */ +#define SPECIAL_I (NEW_S|NEW_W|NEW_U) /* echoed interactive traffic */ +#define SPECIAL_D (NEW_S|NEW_A|NEW_W|NEW_U) /* unidirectional data */ +#define SPECIALS_MASK (NEW_S|NEW_A|NEW_W|NEW_U) + +#define TCP_PUSH_BIT 0x10 + + +/* + * "state" data for each active tcp conversation on the wire. This is + * basically a copy of the entire IP/TCP header from the last packet + * we saw from the conversation together with a small identifier + * the transmit & receive ends of the line use to locate saved header. + */ +struct cstate { + struct cstate *cs_next; /* next most recently used state (xmit only) */ + u16_t cs_hlen; /* size of hdr (receive only) */ + u8_t cs_id; /* connection # associated with this state */ + u8_t cs_filler; + union { + char csu_hdr[MAX_HDR]; + struct ip_hdr csu_ip; /* ip/tcp hdr from most recent packet */ + } vjcs_u; +}; +#define cs_ip vjcs_u.csu_ip +#define cs_hdr vjcs_u.csu_hdr + + +struct vjstat { + u32_t vjs_packets; /* outbound packets */ + u32_t vjs_compressed; /* outbound compressed packets */ + u32_t vjs_searches; /* searches for connection state */ + u32_t vjs_misses; /* times couldn't find conn. state */ + u32_t vjs_uncompressedin; /* inbound uncompressed packets */ + u32_t vjs_compressedin; /* inbound compressed packets */ + u32_t vjs_errorin; /* inbound unknown type packets */ + u32_t vjs_tossed; /* inbound packets tossed because of error */ +}; + +/* + * all the state data for one serial line (we need one of these per line). + */ +struct vjcompress { + struct cstate *last_cs; /* most recently used tstate */ + u8_t last_recv; /* last rcvd conn. id */ + u8_t last_xmit; /* last sent conn. id */ + u16_t flags; + u8_t maxSlotIndex; + u8_t compressSlot; /* Flag indicating OK to compress slot ID. */ +#if LINK_STATS + struct vjstat stats; +#endif + struct cstate tstate[MAX_SLOTS]; /* xmit connection states */ + struct cstate rstate[MAX_SLOTS]; /* receive connection states */ +}; + +/* flag values */ +#define VJF_TOSS 1U /* tossing rcvd frames because of input err */ + +extern void vj_compress_init (struct vjcompress *comp); +extern u8_t vj_compress_tcp (struct vjcompress *comp, struct pbuf **pb); +extern void vj_uncompress_err (struct vjcompress *comp); +extern int vj_uncompress_uncomp(struct pbuf *nb, struct vjcompress *comp); +extern int vj_uncompress_tcp (struct pbuf **nb, struct vjcompress *comp); + +#ifdef __cplusplus +} +#endif + +#endif /* VJ_H */ + +#endif /* PPP_SUPPORT && VJ_SUPPORT */ diff --git a/tools/sdk/ssl/bearssl b/tools/sdk/ssl/bearssl index 149e5031f..c0b69dfb8 160000 --- a/tools/sdk/ssl/bearssl +++ b/tools/sdk/ssl/bearssl @@ -1 +1 @@ -Subproject commit 149e5031f1f97209b3ff99b8a4147808da855e2d +Subproject commit c0b69dfb837f0027180c72f13f7c90cfafb83c16 diff --git a/tools/sdk/uzlib b/tools/sdk/uzlib index 80765a42d..42398df66 160000 --- a/tools/sdk/uzlib +++ b/tools/sdk/uzlib @@ -1 +1 @@ -Subproject commit 80765a42d657fcd3a24e036ac9822f9dbf862449 +Subproject commit 42398df66c02da1cec387b634b6d2f285007a7af diff --git a/tools/sizes.py b/tools/sizes.py index f633f8a6a..470e526c7 100755 --- a/tools/sizes.py +++ b/tools/sizes.py @@ -23,10 +23,11 @@ import os import subprocess import sys -def get_segment_hints(): +def get_segment_hints(iram): hints = {} + hints['ICACHE'] = ' - flash instruction cache' hints['IROM'] = ' - code in flash (default or ICACHE_FLASH_ATTR)' - hints['IRAM'] = ' / 32768 - code in IRAM (ICACHE_RAM_ATTR, ISRs...)' + hints['IRAM'] = ' / ' + str(iram) + ' - code in IRAM (ICACHE_RAM_ATTR, ISRs...)' hints['DATA'] = ') - initialized variables (global, static) in RAM/HEAP' hints['RODATA'] = ') / 81920 - constants (global, static) in RAM/HEAP' hints['BSS'] = ') - zeroed variables (global, static) in RAM/HEAP' @@ -34,6 +35,7 @@ def get_segment_hints(): def get_segment_sizes(elf, path): sizes = {} + sizes['ICACHE'] = 0 sizes['IROM'] = 0 sizes['IRAM'] = 0 sizes['DATA'] = 0 @@ -55,14 +57,28 @@ def get_segment_sizes(elf, path): sizes['BSS'] = sizes['BSS'] + int(words[1]) return sizes +def get_mmu_sizes(mmu, sizes): + iram = 0x8000 + sizes['ICACHE'] = 0x8000 + lines = mmu.split(' ') + for line in lines: + words = line.split('=') + if line.startswith('-DMMU_IRAM_SIZE'): + iram = int(words[1], 16) + elif line.startswith('-DMMU_ICACHE_SIZE'): + sizes['ICACHE'] = int(words[1], 16) + return [iram, sizes] + def main(): parser = argparse.ArgumentParser(description='Report the different segment sizes of a compiled ELF file') parser.add_argument('-e', '--elf', action='store', required=True, help='Path to the Arduino sketch ELF') parser.add_argument('-p', '--path', action='store', required=True, help='Path to Xtensa toolchain binaries') + parser.add_argument('-i', '--mmu', action='store', required=False, help='MMU build options') args = parser.parse_args() sizes = get_segment_sizes(args.elf, args.path) - hints = get_segment_hints() + [iram, sizes] = get_mmu_sizes(args.mmu, sizes) + hints = get_segment_hints(iram) sys.stderr.write("Executable segment sizes:" + os.linesep) for k in sizes.keys(): diff --git a/tools/upload.py b/tools/upload.py index 48352de3a..2b7016cc9 100755 --- a/tools/upload.py +++ b/tools/upload.py @@ -51,6 +51,7 @@ while len(sys.argv): cmdline = cmdline + ['write_flash'] if len(write_option): cmdline = cmdline + [write_option] +cmdline = cmdline + ['--flash_size', 'detect'] cmdline = cmdline + [write_addr, binary] erase_file = ''