Compare commits

...

38 Commits

Author SHA1 Message Date
ff90778173 Fix HTTP client returning disconnected when there is still data avalable 2018-07-10 21:06:20 +02:00
4e9d1ee237 Fix connected to be wrongly reported in WiFiClient 2018-07-10 21:05:44 +02:00
c1a94b5326 Fix wrong event description 2018-07-10 16:13:34 +02:00
3e160587f3 Fix WiFi Client not properly reporting connected state 2018-07-10 15:01:40 +02:00
79010b6498 Add XinaBox CW02 to supported boards (#1620)
* Create pins_arduino.h

* Update boards.txt

* Update pins_arduino.h
2018-07-10 13:43:21 +02:00
9925772db0 * update 'version' in platform.txt (#1619) 2018-07-10 11:26:19 +02:00
c77aed4ac4 Allow using argument with attachInterrupt (#1535)
* Allow using argument with attachInterrupt

* formatting

replace tabs with spaces

* fix bug more then 1 interrupt

* leftover

* add example

* make attachInterruptArg public

* update example

* leftover
2018-07-07 11:26:58 +02:00
901a341949 BluetoothSerial: set COD to be compatible with macOS (#1304) (#1556) 2018-07-07 11:25:10 +02:00
9f6d0d2958 EEPROM.readstring was returning an extra character (#1609) 2018-07-07 10:19:44 +02:00
9efecc1be0 Implement RX buffer for WiFi client to speed up small reads 2018-07-05 22:31:58 +02:00
b0c6991bcf Small adjustments to the web server 2018-07-05 22:31:19 +02:00
8afdd71b3a Add missing event string to WiFi events 2018-07-05 22:30:54 +02:00
871dd183d8 Print to debug the IP address obtained by DHCP 2018-07-05 16:04:07 +02:00
05111bbde7 fix case where library source subfolders are not compiled when used as component 2018-07-05 14:27:17 +02:00
bad53905e8 Prevent exceptions in WiFi if not yet started 2018-07-05 12:28:15 +02:00
95b87545e7 Make Stream functions if File to not wait for timeout
Fixes: https://github.com/espressif/arduino-esp32/issues/1597
2018-07-05 11:51:58 +02:00
9f8f05735b * relnotes handling update (#1592)
* script exec fails on curl error
2018-07-04 15:46:46 +02:00
a835bb26c4 Add missing flag to fix psram issues
Thanks @igrr
2018-07-04 12:11:25 +02:00
5e46c9bae6 Add Wrover Support and Option to enable SPIRAM 2018-07-03 23:03:50 +02:00
659c8ad528 Fix TelnetToSerial sketch 2018-07-03 21:51:24 +02:00
2fe965259a "fix" SPI 2018-07-03 21:23:04 +02:00
0161e28614 Added OTAWebUpdater Doc (#1583) 2018-07-03 20:43:18 +02:00
4e5cbdaa7f Add declarations for all Serial, SPI and Wire buses 2018-07-03 20:41:03 +02:00
12ca9e8b52 Port UART reset fix from ESP-IDF (#1408) 2018-07-03 17:54:08 +02:00
8b01b9e187 Change esptool version notation 2018-07-03 14:50:14 +02:00
c4c946a83d Broke HTTP_Method out into a separate library for reuse in ESPAsyncWebServer (#1562) 2018-07-02 18:24:08 +02:00
3967beb4fb Added WiPy 3.0 board (#1572) 2018-07-02 18:23:06 +02:00
6411ac4e3c Remove confusing Debug output. (#1574)
If Core Debug Level is at DEBUG, a confusing debug message will be emitted if the I2C transaction takes longer complete than the  calculated minimum time.  This original debug message was just to prove that this new i2c code could correctly handle SCL stretching or interrupt latency issues. This delay is not a problem, or an error.  Usually it is caused by a higher priory interrupt starving the i2c ISR.  Usually WiFi is the culprit.  As long of this delay is within the configured timeout (by default 50ms, or can be set with Wire.setTimeOut(milliseconds);) no problem will occur and the transaction will successfully complete.
Chuck.
2018-07-02 18:22:05 +02:00
184bb069f2 Fix io16 io17 and PSRAM support (#1564)
* Add PSRAM init and malloc funtions

* Rebuild IDF libs
2018-06-30 23:06:50 +02:00
b855eb23a7 * arduino-esp32 release mgmt. update (#1557) 2018-06-29 00:54:26 +02:00
eb4e891344 Update build.sh 2018-06-28 23:45:52 +02:00
47421b869f Added OTAWebupdated (#1544)
* added OTAWebUpdater

* added OTAWebUpdater

* Updated OTAWebUpdater
2018-06-28 21:19:22 +02:00
a8ccbd40a4 Update esptool to be compatible with the packager (#1554) 2018-06-28 21:07:59 +02:00
58bdebc565 * release deployment comprehensive update (#1548) 2018-06-28 13:58:01 +02:00
ed953a0d2e BluetoothSerial: check return value and return number of bytes written (#1538) 2018-06-27 23:00:31 +02:00
93566a4fad fix PR tests 2018-06-27 22:21:13 +02:00
873876d94c Fix peek, read and available logic in WiFiClientSecure 2018-06-27 22:09:21 +02:00
058645264c Adjust RAM size and calculator 2018-06-27 21:01:31 +02:00
88 changed files with 1391 additions and 284 deletions

View File

@ -9,6 +9,7 @@ set(CORE_SRCS
cores/esp32/esp32-hal-ledc.c
cores/esp32/esp32-hal-matrix.c
cores/esp32/esp32-hal-misc.c
cores/esp32/esp32-hal-psram.c
cores/esp32/esp32-hal-sigmadelta.c
cores/esp32/esp32-hal-spi.c
cores/esp32/esp32-hal-time.c

View File

@ -28,6 +28,7 @@ Most of the framework is implemented. Most noticable is the missing analogWrite.
- [Using PlatformIO](docs/platformio.md)
- [Building with make](docs/make.md)
- [Using as ESP-IDF component](docs/esp-idf_component.md)
- [Using OTAWebUpdater](docs/OTAWebUpdate/OTAWebUpdate.md)
#### Decoding exceptions

View File

@ -4,6 +4,7 @@ menu.FlashMode=Flash Mode
menu.FlashSize=Flash Size
menu.PartitionScheme=Partition Scheme
menu.DebugLevel=Core Debug Level
menu.PSRAM=PSRAM
##############################################################
@ -11,7 +12,7 @@ esp32.name=ESP32 Dev Module
esp32.upload.tool=esptool
esp32.upload.maximum_size=1310720
esp32.upload.maximum_data_size=294912
esp32.upload.maximum_data_size=327680
esp32.upload.wait_for_upload_port=true
esp32.serial.disableDTR=true
@ -28,6 +29,12 @@ esp32.build.flash_freq=40m
esp32.build.flash_mode=dio
esp32.build.boot=dio
esp32.build.partitions=default
esp32.build.defines=
esp32.menu.PSRAM.disabled=Disabled
esp32.menu.PSRAM.disabled.build.defines=
esp32.menu.PSRAM.enabled=Enabled
esp32.menu.PSRAM.enabled.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
esp32.menu.PartitionScheme.default=Default
esp32.menu.PartitionScheme.default.build.partitions=default
@ -94,11 +101,169 @@ esp32.menu.DebugLevel.verbose.build.code_debug=5
##############################################################
cw02.name=XinaBox CW02
cw02.upload.tool=esptool
cw02.upload.maximum_size=1310720
cw02.upload.maximum_data_size=294912
cw02.upload.wait_for_upload_port=true
cw02.serial.disableDTR=true
cw02.serial.disableRTS=true
cw02.build.mcu=esp32
cw02.build.core=esp32
cw02.build.variant=xinabox
cw02.build.board=ESP32_DEV
cw02.build.f_cpu=240000000L
cw02.build.flash_size=4MB
cw02.build.flash_freq=40m
cw02.build.flash_mode=dio
cw02.build.boot=dio
cw02.build.partitions=default
cw02.menu.FlashMode.qio=QIO
cw02.menu.FlashMode.qio.build.flash_mode=dio
cw02.menu.FlashMode.qio.build.boot=qio
cw02.menu.FlashMode.dio=DIO
cw02.menu.FlashMode.dio.build.flash_mode=dio
cw02.menu.FlashMode.dio.build.boot=dio
cw02.menu.FlashMode.qout=QOUT
cw02.menu.FlashMode.qout.build.flash_mode=dout
cw02.menu.FlashMode.qout.build.boot=qout
cw02.menu.FlashMode.dout=DOUT
cw02.menu.FlashMode.dout.build.flash_mode=dout
cw02.menu.FlashMode.dout.build.boot=dout
cw02.menu.FlashFreq.80=80MHz
cw02.menu.FlashFreq.80.build.flash_freq=80m
cw02.menu.FlashFreq.40=40MHz
cw02.menu.FlashFreq.40.build.flash_freq=40m
cw02.menu.FlashSize.4M=4MB (32Mb)
cw02.menu.FlashSize.4M.build.flash_size=4MB
cw02.menu.FlashSize.2M=2MB (16Mb)
cw02.menu.FlashSize.2M.build.flash_size=2MB
cw02.menu.FlashSize.2M.build.partitions=minimal
cw02.menu.UploadSpeed.921600=921600
cw02.menu.UploadSpeed.921600.upload.speed=921600
cw02.menu.UploadSpeed.115200=115200
cw02.menu.UploadSpeed.115200.upload.speed=115200
cw02.menu.UploadSpeed.256000.windows=256000
cw02.menu.UploadSpeed.256000.upload.speed=256000
cw02.menu.UploadSpeed.230400.windows.upload.speed=256000
cw02.menu.UploadSpeed.230400=230400
cw02.menu.UploadSpeed.230400.upload.speed=230400
cw02.menu.UploadSpeed.460800.linux=460800
cw02.menu.UploadSpeed.460800.macosx=460800
cw02.menu.UploadSpeed.460800.upload.speed=460800
cw02.menu.UploadSpeed.512000.windows=512000
cw02.menu.UploadSpeed.512000.upload.speed=512000
cw02.menu.DebugLevel.none=None
cw02.menu.DebugLevel.none.build.code_debug=0
cw02.menu.DebugLevel.error=Error
cw02.menu.DebugLevel.error.build.code_debug=1
cw02.menu.DebugLevel.warn=Warn
cw02.menu.DebugLevel.warn.build.code_debug=2
cw02.menu.DebugLevel.info=Info
cw02.menu.DebugLevel.info.build.code_debug=3
cw02.menu.DebugLevel.debug=Debug
cw02.menu.DebugLevel.debug.build.code_debug=4
cw02.menu.DebugLevel.verbose=Verbose
cw02.menu.DebugLevel.verbose.build.code_debug=5
##############################################################
esp32wrover.name=ESP32 Wrover Module
esp32wrover.upload.tool=esptool
esp32wrover.upload.maximum_size=1310720
esp32wrover.upload.maximum_data_size=327680
esp32wrover.upload.wait_for_upload_port=true
esp32wrover.serial.disableDTR=true
esp32wrover.serial.disableRTS=true
esp32wrover.build.mcu=esp32
esp32wrover.build.core=esp32
esp32wrover.build.variant=esp32
esp32wrover.build.board=ESP32_DEV
esp32wrover.build.f_cpu=240000000L
esp32wrover.build.flash_size=4MB
esp32wrover.build.flash_freq=40m
esp32wrover.build.flash_mode=dio
esp32wrover.build.boot=dio
esp32wrover.build.partitions=default
esp32wrover.build.defines=-DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue
esp32wrover.menu.PartitionScheme.default=Default
esp32wrover.menu.PartitionScheme.default.build.partitions=default
esp32wrover.menu.PartitionScheme.minimal=Minimal (2MB FLASH)
esp32wrover.menu.PartitionScheme.minimal.build.partitions=minimal
esp32wrover.menu.PartitionScheme.no_ota=No OTA (Large APP)
esp32wrover.menu.PartitionScheme.no_ota.build.partitions=no_ota
esp32wrover.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
esp32wrover.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (Large APPS with OTA)
esp32wrover.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
esp32wrover.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
esp32wrover.menu.FlashMode.qio=QIO
esp32wrover.menu.FlashMode.qio.build.flash_mode=dio
esp32wrover.menu.FlashMode.qio.build.boot=qio
esp32wrover.menu.FlashMode.dio=DIO
esp32wrover.menu.FlashMode.dio.build.flash_mode=dio
esp32wrover.menu.FlashMode.dio.build.boot=dio
esp32wrover.menu.FlashMode.qout=QOUT
esp32wrover.menu.FlashMode.qout.build.flash_mode=dout
esp32wrover.menu.FlashMode.qout.build.boot=qout
esp32wrover.menu.FlashMode.dout=DOUT
esp32wrover.menu.FlashMode.dout.build.flash_mode=dout
esp32wrover.menu.FlashMode.dout.build.boot=dout
esp32wrover.menu.FlashFreq.80=80MHz
esp32wrover.menu.FlashFreq.80.build.flash_freq=80m
esp32wrover.menu.FlashFreq.40=40MHz
esp32wrover.menu.FlashFreq.40.build.flash_freq=40m
esp32wrover.menu.UploadSpeed.921600=921600
esp32wrover.menu.UploadSpeed.921600.upload.speed=921600
esp32wrover.menu.UploadSpeed.115200=115200
esp32wrover.menu.UploadSpeed.115200.upload.speed=115200
esp32wrover.menu.UploadSpeed.256000.windows=256000
esp32wrover.menu.UploadSpeed.256000.upload.speed=256000
esp32wrover.menu.UploadSpeed.230400.windows.upload.speed=256000
esp32wrover.menu.UploadSpeed.230400=230400
esp32wrover.menu.UploadSpeed.230400.upload.speed=230400
esp32wrover.menu.UploadSpeed.460800.linux=460800
esp32wrover.menu.UploadSpeed.460800.macosx=460800
esp32wrover.menu.UploadSpeed.460800.upload.speed=460800
esp32wrover.menu.UploadSpeed.512000.windows=512000
esp32wrover.menu.UploadSpeed.512000.upload.speed=512000
esp32wrover.menu.DebugLevel.none=None
esp32wrover.menu.DebugLevel.none.build.code_debug=0
esp32wrover.menu.DebugLevel.error=Error
esp32wrover.menu.DebugLevel.error.build.code_debug=1
esp32wrover.menu.DebugLevel.warn=Warn
esp32wrover.menu.DebugLevel.warn.build.code_debug=2
esp32wrover.menu.DebugLevel.info=Info
esp32wrover.menu.DebugLevel.info.build.code_debug=3
esp32wrover.menu.DebugLevel.debug=Debug
esp32wrover.menu.DebugLevel.debug.build.code_debug=4
esp32wrover.menu.DebugLevel.verbose=Verbose
esp32wrover.menu.DebugLevel.verbose.build.code_debug=5
##############################################################
pico32.name=ESP32 Pico Kit
pico32.upload.tool=esptool
pico32.upload.maximum_size=1310720
pico32.upload.maximum_data_size=294912
pico32.upload.maximum_data_size=327680
pico32.upload.wait_for_upload_port=true
pico32.serial.disableDTR=true
@ -115,6 +280,7 @@ pico32.build.flash_freq=80m
pico32.build.flash_mode=dio
pico32.build.boot=dio
pico32.build.partitions=default
pico32.build.defines=
pico32.menu.UploadSpeed.921600=921600
pico32.menu.UploadSpeed.921600.upload.speed=921600
@ -150,7 +316,7 @@ esp32thing.name=SparkFun ESP32 Thing
esp32thing.upload.tool=esptool
esp32thing.upload.maximum_size=1310720
esp32thing.upload.maximum_data_size=294912
esp32thing.upload.maximum_data_size=327680
esp32thing.upload.wait_for_upload_port=true
esp32thing.serial.disableDTR=true
@ -166,6 +332,7 @@ esp32thing.build.flash_mode=dio
esp32thing.build.flash_size=4MB
esp32thing.build.boot=dio
esp32thing.build.partitions=default
esp32thing.build.defines=
esp32thing.menu.FlashFreq.80=80MHz
esp32thing.menu.FlashFreq.80.build.flash_freq=80m
@ -193,7 +360,7 @@ nina_w10.name=u-blox NINA-W10 series (ESP32)
nina_w10.upload.tool=esptool
nina_w10.upload.maximum_size=1310720
nina_w10.upload.maximum_data_size=294912
nina_w10.upload.maximum_data_size=327680
nina_w10.upload.wait_for_upload_port=true
nina_w10.serial.disableDTR=true
@ -209,6 +376,7 @@ nina_w10.build.partitions=minimal
nina_w10.build.flash_mode=dio
nina_w10.build.flash_size=2MB
nina_w10.build.flash_freq=40m
nina_w10.build.defines=
nina_w10.menu.UploadSpeed.921600=921600
nina_w10.menu.UploadSpeed.921600.upload.speed=921600
@ -231,7 +399,7 @@ widora-air.name=Widora AIR
widora-air.upload.tool=esptool
widora-air.upload.maximum_size=1310720
widora-air.upload.maximum_data_size=294912
widora-air.upload.maximum_data_size=327680
widora-air.upload.wait_for_upload_port=true
widora-air.serial.disableDTR=true
@ -247,6 +415,7 @@ widora-air.build.flash_mode=dio
widora-air.build.flash_size=16MB
widora-air.build.boot=dio
widora-air.build.partitions=default
widora-air.build.defines=
widora-air.menu.FlashFreq.80=80MHz
widora-air.menu.FlashFreq.80.build.flash_freq=80m
@ -274,7 +443,7 @@ esp320.name=Electronic SweetPeas - ESP320
esp320.upload.tool=esptool
esp320.upload.maximum_size=1310720
esp320.upload.maximum_data_size=294912
esp320.upload.maximum_data_size=327680
esp320.upload.wait_for_upload_port=true
esp320.serial.disableDTR=true
@ -290,6 +459,7 @@ esp320.build.flash_mode=qio
esp320.build.flash_size=4MB
esp320.build.boot=dio
esp320.build.partitions=default
esp320.build.defines=
esp320.menu.FlashFreq.80=80MHz
esp320.menu.FlashFreq.80.build.flash_freq=80m
@ -317,7 +487,7 @@ nano32.name=Nano32
nano32.upload.tool=esptool
nano32.upload.maximum_size=1310720
nano32.upload.maximum_data_size=294912
nano32.upload.maximum_data_size=327680
nano32.upload.wait_for_upload_port=true
nano32.serial.disableDTR=true
@ -333,6 +503,7 @@ nano32.build.flash_mode=dio
nano32.build.flash_size=4MB
nano32.build.boot=dio
nano32.build.partitions=default
nano32.build.defines=
nano32.menu.FlashFreq.80=80MHz
nano32.menu.FlashFreq.80.build.flash_freq=80m
@ -360,7 +531,7 @@ lolin32.name=WEMOS LOLIN32
lolin32.upload.tool=esptool
lolin32.upload.maximum_size=1310720
lolin32.upload.maximum_data_size=294912
lolin32.upload.maximum_data_size=327680
lolin32.upload.wait_for_upload_port=true
lolin32.serial.disableDTR=true
@ -376,6 +547,7 @@ lolin32.build.flash_mode=dio
lolin32.build.flash_size=4MB
lolin32.build.boot=dio
lolin32.build.partitions=default
lolin32.build.defines=
lolin32.menu.FlashFreq.80=80MHz
lolin32.menu.FlashFreq.80.build.flash_freq=80m
@ -412,7 +584,7 @@ pocket_32.name=Dongsen Tech Pocket 32
pocket_32.upload.tool=esptool
pocket_32.upload.maximum_size=1310720
pocket_32.upload.maximum_data_size=294912
pocket_32.upload.maximum_data_size=327680
pocket_32.upload.wait_for_upload_port=true
pocket_32.serial.disableDTR=true
@ -428,6 +600,7 @@ pocket_32.build.flash_mode=dio
pocket_32.build.flash_size=4MB
pocket_32.build.boot=dio
pocket_32.build.partitions=default
pocket_32.build.defines=
pocket_32.menu.FlashFreq.80=80MHz
pocket_32.menu.FlashFreq.80.build.flash_freq=80m
@ -455,7 +628,7 @@ WeMosBat.name="WeMos" WiFi&Bluetooth Battery
WeMosBat.upload.tool=esptool
WeMosBat.upload.maximum_size=1310720
WeMosBat.upload.maximum_data_size=294912
WeMosBat.upload.maximum_data_size=327680
WeMosBat.upload.wait_for_upload_port=true
WeMosBat.serial.disableDTR=true
@ -471,6 +644,7 @@ WeMosBat.build.flash_mode=dio
WeMosBat.build.flash_size=4MB
WeMosBat.build.boot=dio
WeMosBat.build.partitions=default
WeMosBat.build.defines=
WeMosBat.menu.FlashFreq.80=80MHz
WeMosBat.menu.FlashFreq.80.build.flash_freq=80m
@ -511,7 +685,7 @@ espea32.name=ESPea32
espea32.upload.tool=esptool
espea32.upload.maximum_size=1310720
espea32.upload.maximum_data_size=294912
espea32.upload.maximum_data_size=327680
espea32.upload.wait_for_upload_port=true
espea32.serial.disableDTR=true
@ -527,6 +701,7 @@ espea32.build.flash_mode=dio
espea32.build.flash_size=4MB
espea32.build.boot=dio
espea32.build.partitions=default
espea32.build.defines=
espea32.menu.FlashFreq.80=80MHz
espea32.menu.FlashFreq.80.build.flash_freq=80m
@ -554,7 +729,7 @@ quantum.name=Noduino Quantum
quantum.upload.tool=esptool
quantum.upload.maximum_size=1310720
quantum.upload.maximum_data_size=294912
quantum.upload.maximum_data_size=327680
quantum.upload.wait_for_upload_port=true
quantum.serial.disableDTR=true
@ -570,6 +745,7 @@ quantum.build.flash_mode=qio
quantum.build.flash_size=16MB
quantum.build.boot=dio
quantum.build.partitions=default
quantum.build.defines=
quantum.menu.FlashFreq.80=80MHz
quantum.menu.FlashFreq.80.build.flash_freq=80m
@ -597,7 +773,7 @@ node32s.name=Node32s
node32s.upload.tool=esptool
node32s.upload.maximum_size=1310720
node32s.upload.maximum_data_size=294912
node32s.upload.maximum_data_size=327680
node32s.upload.wait_for_upload_port=true
node32s.serial.disableDTR=true
@ -613,6 +789,7 @@ node32s.build.flash_mode=dio
node32s.build.flash_size=4MB
node32s.build.boot=dio
node32s.build.partitions=default
node32s.build.defines=
node32s.menu.FlashFreq.80=80MHz
node32s.menu.FlashFreq.80.build.flash_freq=80m
@ -640,7 +817,7 @@ hornbill32dev.name=Hornbill ESP32 Dev
hornbill32dev.upload.tool=esptool
hornbill32dev.upload.maximum_size=1310720
hornbill32dev.upload.maximum_data_size=294912
hornbill32dev.upload.maximum_data_size=327680
hornbill32dev.upload.wait_for_upload_port=true
hornbill32dev.serial.disableDTR=true
@ -656,6 +833,7 @@ hornbill32dev.build.flash_mode=dio
hornbill32dev.build.flash_size=4MB
hornbill32dev.build.boot=dio
hornbill32dev.build.partitions=default
hornbill32dev.build.defines=
hornbill32dev.menu.FlashFreq.80=80MHz
hornbill32dev.menu.FlashFreq.80.build.flash_freq=80m
@ -683,7 +861,7 @@ hornbill32minima.name=Hornbill ESP32 Minima
hornbill32minima.upload.tool=esptool
hornbill32minima.upload.maximum_size=1310720
hornbill32minima.upload.maximum_data_size=294912
hornbill32minima.upload.maximum_data_size=327680
hornbill32minima.upload.wait_for_upload_port=true
hornbill32minima.serial.disableDTR=true
@ -698,6 +876,7 @@ hornbill32minima.build.flash_mode=dio
hornbill32minima.build.flash_size=4MB
hornbill32minima.build.boot=dio
hornbill32minima.build.partitions=default
hornbill32minima.build.defines=
hornbill32minima.menu.FlashFreq.80=80MHz
hornbill32minima.menu.FlashFreq.80.build.flash_freq=80m
@ -725,7 +904,7 @@ firebeetle32.name=FireBeetle-ESP32
firebeetle32.upload.tool=esptool
firebeetle32.upload.maximum_size=1310720
firebeetle32.upload.maximum_data_size=294912
firebeetle32.upload.maximum_data_size=327680
firebeetle32.upload.wait_for_upload_port=true
firebeetle32.serial.disableDTR=true
@ -741,6 +920,7 @@ firebeetle32.build.flash_mode=dio
firebeetle32.build.flash_size=4MB
firebeetle32.build.boot=dio
firebeetle32.build.partitions=default
firebeetle32.build.defines=
firebeetle32.menu.FlashFreq.80=80MHz
firebeetle32.menu.FlashFreq.80.build.flash_freq=80m
@ -768,7 +948,7 @@ intorobot-fig.name=IntoRobot Fig
intorobot-fig.upload.tool=esptool
intorobot-fig.upload.maximum_size=1310720
intorobot-fig.upload.maximum_data_size=294912
intorobot-fig.upload.maximum_data_size=327680
intorobot-fig.upload.wait_for_upload_port=true
intorobot-fig.serial.disableDTR=true
@ -784,6 +964,7 @@ intorobot-fig.build.flash_mode=dio
intorobot-fig.build.flash_size=4MB
intorobot-fig.build.boot=dio
intorobot-fig.build.partitions=default
intorobot-fig.build.defines=
intorobot-fig.menu.FlashFreq.80=80MHz
intorobot-fig.menu.FlashFreq.80.build.flash_freq=80m
@ -811,7 +992,7 @@ onehorse32dev.name=Onehorse ESP32 Dev Module
onehorse32dev.upload.tool=esptool
onehorse32dev.upload.maximum_size=1310720
onehorse32dev.upload.maximum_data_size=294912
onehorse32dev.upload.maximum_data_size=327680
onehorse32dev.upload.wait_for_upload_port=true
onehorse32dev.serial.disableDTR=true
@ -827,6 +1008,7 @@ onehorse32dev.build.flash_mode=dout
onehorse32dev.build.flash_size=4MB
onehorse32dev.build.boot=dio
onehorse32dev.build.partitions=default
onehorse32dev.build.defines=
onehorse32dev.menu.FlashFreq.80=80MHz
onehorse32dev.menu.FlashFreq.80.build.flash_freq=80m
@ -854,7 +1036,7 @@ featheresp32.name=Adafruit ESP32 Feather
featheresp32.upload.tool=esptool
featheresp32.upload.maximum_size=1310720
featheresp32.upload.maximum_data_size=294912
featheresp32.upload.maximum_data_size=327680
featheresp32.upload.wait_for_upload_port=true
featheresp32.serial.disableDTR=true
@ -870,6 +1052,7 @@ featheresp32.build.flash_mode=dio
featheresp32.build.flash_size=4MB
featheresp32.build.boot=dio
featheresp32.build.partitions=default
featheresp32.build.defines=
featheresp32.menu.FlashFreq.80=80MHz
featheresp32.menu.FlashFreq.80.build.flash_freq=80m
@ -910,7 +1093,7 @@ nodemcu-32s.name=NodeMCU-32S
nodemcu-32s.upload.tool=esptool
nodemcu-32s.upload.maximum_size=1310720
nodemcu-32s.upload.maximum_data_size=294912
nodemcu-32s.upload.maximum_data_size=327680
nodemcu-32s.upload.wait_for_upload_port=true
nodemcu-32s.serial.disableDTR=true
@ -926,6 +1109,7 @@ nodemcu-32s.build.flash_mode=dio
nodemcu-32s.build.flash_size=4MB
nodemcu-32s.build.boot=dio
nodemcu-32s.build.partitions=default
nodemcu-32s.build.defines=
nodemcu-32s.menu.FlashFreq.80=80MHz
nodemcu-32s.menu.FlashFreq.80.build.flash_freq=80m
@ -953,7 +1137,7 @@ mhetesp32devkit.name=MH ET LIVE ESP32DevKIT
mhetesp32devkit.upload.tool=esptool
mhetesp32devkit.upload.maximum_size=1310720
mhetesp32devkit.upload.maximum_data_size=294912
mhetesp32devkit.upload.maximum_data_size=327680
mhetesp32devkit.upload.wait_for_upload_port=true
mhetesp32devkit.serial.disableDTR=true
@ -969,6 +1153,7 @@ mhetesp32devkit.build.flash_mode=dio
mhetesp32devkit.build.flash_size=4MB
mhetesp32devkit.build.boot=dio
mhetesp32devkit.build.partitions=default
mhetesp32devkit.build.defines=
mhetesp32devkit.menu.FlashFreq.80=80MHz
mhetesp32devkit.menu.FlashFreq.80.build.flash_freq=80m
@ -1018,7 +1203,7 @@ mhetesp32minikit.name=MH ET LIVE ESP32MiniKit
mhetesp32minikit.upload.tool=esptool
mhetesp32minikit.upload.maximum_size=1310720
mhetesp32minikit.upload.maximum_data_size=294912
mhetesp32minikit.upload.maximum_data_size=327680
mhetesp32minikit.upload.wait_for_upload_port=true
mhetesp32minikit.serial.disableDTR=true
@ -1034,6 +1219,7 @@ mhetesp32minikit.build.flash_mode=dio
mhetesp32minikit.build.flash_size=4MB
mhetesp32minikit.build.boot=dio
mhetesp32minikit.build.partitions=default
mhetesp32minikit.build.defines=
mhetesp32minikit.menu.FlashFreq.80=80MHz
mhetesp32minikit.menu.FlashFreq.80.build.flash_freq=80m
@ -1083,7 +1269,7 @@ esp32vn-iot-uno.name=ESP32vn IoT Uno
esp32vn-iot-uno.upload.tool=esptool
esp32vn-iot-uno.upload.maximum_size=1310720
esp32vn-iot-uno.upload.maximum_data_size=294912
esp32vn-iot-uno.upload.maximum_data_size=327680
esp32vn-iot-uno.upload.wait_for_upload_port=true
esp32vn-iot-uno.serial.disableDTR=true
@ -1099,6 +1285,7 @@ esp32vn-iot-uno.build.flash_mode=dio
esp32vn-iot-uno.build.flash_size=4MB
esp32vn-iot-uno.build.boot=dio
esp32vn-iot-uno.build.partitions=default
esp32vn-iot-uno.build.defines=
esp32vn-iot-uno.menu.FlashFreq.80=80MHz
esp32vn-iot-uno.menu.FlashFreq.80.build.flash_freq=80m
@ -1126,7 +1313,7 @@ esp32doit-devkit-v1.name=DOIT ESP32 DEVKIT V1
esp32doit-devkit-v1.upload.tool=esptool
esp32doit-devkit-v1.upload.maximum_size=1310720
esp32doit-devkit-v1.upload.maximum_data_size=294912
esp32doit-devkit-v1.upload.maximum_data_size=327680
esp32doit-devkit-v1.upload.wait_for_upload_port=true
esp32doit-devkit-v1.serial.disableDTR=true
@ -1142,6 +1329,7 @@ esp32doit-devkit-v1.build.flash_mode=dio
esp32doit-devkit-v1.build.flash_size=4MB
esp32doit-devkit-v1.build.boot=dio
esp32doit-devkit-v1.build.partitions=default
esp32doit-devkit-v1.build.defines=
esp32doit-devkit-v1.menu.FlashFreq.80=80MHz
esp32doit-devkit-v1.menu.FlashFreq.80.build.flash_freq=80m
@ -1180,7 +1368,7 @@ esp32-evb.name=OLIMEX ESP32-EVB
esp32-evb.upload.tool=esptool
esp32-evb.upload.maximum_size=1310720
esp32-evb.upload.maximum_data_size=294912
esp32-evb.upload.maximum_data_size=327680
esp32-evb.upload.wait_for_upload_port=true
esp32-evb.serial.disableDTR=true
@ -1196,6 +1384,7 @@ esp32-evb.build.flash_mode=dio
esp32-evb.build.flash_size=4MB
esp32-evb.build.boot=dio
esp32-evb.build.partitions=default
esp32-evb.build.defines=
esp32-evb.menu.FlashFreq.80=80MHz
esp32-evb.menu.FlashFreq.80.build.flash_freq=80m
@ -1212,7 +1401,7 @@ esp32-gateway.name=OLIMEX ESP32-GATEWAY
esp32-gateway.upload.tool=esptool
esp32-gateway.upload.maximum_size=1310720
esp32-gateway.upload.maximum_data_size=294912
esp32-gateway.upload.maximum_data_size=327680
esp32-gateway.upload.wait_for_upload_port=true
esp32-gateway.serial.disableDTR=true
@ -1228,6 +1417,7 @@ esp32-gateway.build.flash_mode=dio
esp32-gateway.build.flash_size=4MB
esp32-gateway.build.boot=dio
esp32-gateway.build.partitions=default
esp32-gateway.build.defines=
esp32-gateway.menu.FlashFreq.80=80MHz
esp32-gateway.menu.FlashFreq.80.build.flash_freq=80m
@ -1244,7 +1434,7 @@ espino32.name=ThaiEasyElec's ESPino32
espino32.upload.tool=esptool
espino32.upload.maximum_size=1310720
espino32.upload.maximum_data_size=294912
espino32.upload.maximum_data_size=327680
espino32.upload.wait_for_upload_port=true
espino32.serial.disableDTR=true
@ -1260,6 +1450,7 @@ espino32.build.flash_mode=dio
espino32.build.flash_size=4MB
espino32.build.boot=dio
espino32.build.partitions=default
espino32.build.defines=
espino32.menu.FlashFreq.80=80MHz
espino32.menu.FlashFreq.80.build.flash_freq=80m
@ -1287,7 +1478,7 @@ m5stack-core-esp32.name=M5Stack-Core-ESP32
m5stack-core-esp32.upload.tool=esptool
m5stack-core-esp32.upload.maximum_size=1310720
m5stack-core-esp32.upload.maximum_data_size=294912
m5stack-core-esp32.upload.maximum_data_size=327680
m5stack-core-esp32.upload.wait_for_upload_port=true
m5stack-core-esp32.serial.disableDTR=true
@ -1303,6 +1494,7 @@ m5stack-core-esp32.build.flash_size=4MB
m5stack-core-esp32.build.flash_mode=dio
m5stack-core-esp32.build.boot=dio
m5stack-core-esp32.build.partitions=default
m5stack-core-esp32.build.defines=
m5stack-core-esp32.menu.FlashMode.qio=QIO
m5stack-core-esp32.menu.FlashMode.qio.build.flash_mode=dio
@ -1365,7 +1557,7 @@ odroid_esp32.name=ODROID ESP32
odroid_esp32.upload.tool=esptool
odroid_esp32.upload.maximum_size=1310720
odroid_esp32.upload.maximum_data_size=294912
odroid_esp32.upload.maximum_data_size=327680
odroid_esp32.upload.wait_for_upload_port=true
odroid_esp32.serial.disableDTR=true
@ -1381,6 +1573,7 @@ odroid_esp32.build.flash_size=16MB
odroid_esp32.build.flash_mode=dio
odroid_esp32.build.boot=dio
odroid_esp32.build.partitions=default
odroid_esp32.build.defines=
odroid_esp32.menu.FlashMode.qio=QIO
odroid_esp32.menu.FlashMode.qio.build.flash_mode=dio
@ -1443,7 +1636,7 @@ heltec_wifi_kit_32.name=Heltec_WIFI_Kit_32
heltec_wifi_kit_32.upload.tool=esptool
heltec_wifi_kit_32.upload.maximum_size=1310720
heltec_wifi_kit_32.upload.maximum_data_size=294912
heltec_wifi_kit_32.upload.maximum_data_size=327680
heltec_wifi_kit_32.upload.wait_for_upload_port=true
heltec_wifi_kit_32.serial.disableDTR=true
@ -1459,6 +1652,7 @@ heltec_wifi_kit_32.build.flash_mode=dio
heltec_wifi_kit_32.build.flash_size=4MB
heltec_wifi_kit_32.build.boot=dio
heltec_wifi_kit_32.build.partitions=default
heltec_wifi_kit_32.build.defines=
heltec_wifi_kit_32.menu.FlashFreq.80=80MHz
heltec_wifi_kit_32.menu.FlashFreq.80.build.flash_freq=80m
@ -1486,7 +1680,7 @@ heltec_wifi_lora_32.name=Heltec_WIFI_LoRa_32
heltec_wifi_lora_32.upload.tool=esptool
heltec_wifi_lora_32.upload.maximum_size=1310720
heltec_wifi_lora_32.upload.maximum_data_size=294912
heltec_wifi_lora_32.upload.maximum_data_size=327680
heltec_wifi_lora_32.upload.wait_for_upload_port=true
heltec_wifi_lora_32.serial.disableDTR=true
@ -1502,6 +1696,7 @@ heltec_wifi_lora_32.build.flash_mode=dio
heltec_wifi_lora_32.build.flash_size=4MB
heltec_wifi_lora_32.build.boot=dio
heltec_wifi_lora_32.build.partitions=default
heltec_wifi_lora_32.build.defines=
heltec_wifi_lora_32.menu.FlashFreq.80=80MHz
heltec_wifi_lora_32.menu.FlashFreq.80.build.flash_freq=80m
@ -1529,7 +1724,7 @@ espectro32.name=ESPectro32
espectro32.upload.tool=esptool
espectro32.upload.maximum_size=1310720
espectro32.upload.maximum_data_size=294912
espectro32.upload.maximum_data_size=327680
espectro32.upload.wait_for_upload_port=true
espectro32.serial.disableDTR=true
@ -1545,6 +1740,7 @@ espectro32.build.flash_size=4MB
espectro32.build.flash_mode=dio
espectro32.build.boot=dio
espectro32.build.partitions=default
espectro32.build.defines=
espectro32.menu.FlashMode.qio=QIO
espectro32.menu.FlashMode.qio.build.flash_mode=dio
@ -1604,7 +1800,7 @@ CoreESP32.name=Microduino-CoreESP32
CoreESP32.upload.tool=esptool
CoreESP32.upload.maximum_size=1310720
CoreESP32.upload.maximum_data_size=294912
CoreESP32.upload.maximum_data_size=327680
CoreESP32.upload.wait_for_upload_port=true
CoreESP32.serial.disableDTR=true
@ -1620,6 +1816,7 @@ CoreESP32.build.flash_mode=dio
CoreESP32.build.flash_size=4MB
CoreESP32.build.boot=dio
CoreESP32.build.partitions=default
CoreESP32.build.defines=
CoreESP32.menu.FlashFreq.80=80MHz
CoreESP32.menu.FlashFreq.80.build.flash_freq=80m
@ -1640,3 +1837,61 @@ CoreESP32.menu.UploadSpeed.460800.macosx=460800
CoreESP32.menu.UploadSpeed.460800.upload.speed=460800
CoreESP32.menu.UploadSpeed.512000.windows=512000
CoreESP32.menu.UploadSpeed.512000.upload.speed=512000
##############################################################
wipy3.name=WiPy 3.0
wipy3.upload.tool=esptool
wipy3.upload.maximum_size=1310720
wipy3.upload.maximum_data_size=294912
wipy3.upload.wait_for_upload_port=true
wipy3.serial.disableDTR=true
wipy3.serial.disableRTS=true
wipy3.build.mcu=esp32
wipy3.build.core=esp32
wipy3.build.variant=wipy3
wipy3.build.board=WIPY3
wipy3.build.f_cpu=240000000L
wipy3.build.flash_mode=dio
wipy3.build.flash_size=8MB
wipy3.build.boot=dio
wipy3.build.partitions=default
wipy3.build.defines=
wipy3.menu.FlashFreq.80=80MHz
wipy3.menu.FlashFreq.80.build.flash_freq=80m
wipy3.menu.FlashFreq.40=40MHz
wipy3.menu.FlashFreq.40.build.flash_freq=40m
wipy3.menu.UploadSpeed.921600=921600
wipy3.menu.UploadSpeed.921600.upload.speed=921600
wipy3.menu.UploadSpeed.115200=115200
wipy3.menu.UploadSpeed.115200.upload.speed=115200
wipy3.menu.UploadSpeed.256000.windows=256000
wipy3.menu.UploadSpeed.256000.upload.speed=256000
wipy3.menu.UploadSpeed.230400.windows.upload.speed=256000
wipy3.menu.UploadSpeed.230400=230400
wipy3.menu.UploadSpeed.230400.upload.speed=230400
wipy3.menu.UploadSpeed.460800.linux=460800
wipy3.menu.UploadSpeed.460800.macosx=460800
wipy3.menu.UploadSpeed.460800.upload.speed=460800
wipy3.menu.UploadSpeed.512000.windows=512000
wipy3.menu.UploadSpeed.512000.upload.speed=512000
wipy3.menu.DebugLevel.none=None
wipy3.menu.DebugLevel.none.build.code_debug=0
wipy3.menu.DebugLevel.error=Error
wipy3.menu.DebugLevel.error.build.code_debug=1
wipy3.menu.DebugLevel.warn=Warn
wipy3.menu.DebugLevel.warn.build.code_debug=2
wipy3.menu.DebugLevel.info=Info
wipy3.menu.DebugLevel.info.build.code_debug=3
wipy3.menu.DebugLevel.debug=Debug
wipy3.menu.DebugLevel.debug.build.code_debug=4
wipy3.menu.DebugLevel.verbose=Verbose
wipy3.menu.DebugLevel.verbose.build.code_debug=5

View File

@ -1,4 +1,4 @@
ARDUINO_CORE_LIBS := $(patsubst $(COMPONENT_PATH)/%,%,$(sort $(dir $(wildcard $(COMPONENT_PATH)/libraries/*/*/))))
ARDUINO_CORE_LIBS := $(patsubst $(COMPONENT_PATH)/%,%,$(sort $(dir $(wildcard $(COMPONENT_PATH)/libraries/*/*/)) $(dir $(wildcard $(COMPONENT_PATH)/libraries/*/*/*/))))
COMPONENT_ADD_INCLUDEDIRS := cores/esp32 variants/esp32 $(ARDUINO_CORE_LIBS)
COMPONENT_PRIV_INCLUDEDIRS := cores/esp32/libb64

View File

@ -7,6 +7,8 @@
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
HardwareSerial Serial(0);
HardwareSerial Serial1(1);
HardwareSerial Serial2(2);
#endif
HardwareSerial::HardwareSerial(int uart_nr) : _uart_nr(uart_nr), _uart(NULL) {}

View File

@ -79,6 +79,8 @@ protected:
#if !defined(NO_GLOBAL_INSTANCES) && !defined(NO_GLOBAL_SERIAL)
extern HardwareSerial Serial;
extern HardwareSerial Serial1;
extern HardwareSerial Serial2;
#endif
#endif

View File

@ -70,7 +70,12 @@ const DRAM_ATTR esp32_gpioMux_t esp32_gpioMux[GPIO_PIN_COUNT]={
};
typedef void (*voidFuncPtr)(void);
static voidFuncPtr __pinInterruptHandlers[GPIO_PIN_COUNT] = {0,};
typedef void (*voidFuncPtrArg)(void*);
typedef struct {
voidFuncPtr fn;
void* arg;
} InterruptHandle_t;
static InterruptHandle_t __pinInterruptHandlers[GPIO_PIN_COUNT] = {0,};
#include "driver/rtc_io.h"
@ -193,7 +198,7 @@ extern int IRAM_ATTR __digitalRead(uint8_t pin)
static intr_handle_t gpio_intr_handle = NULL;
static void IRAM_ATTR __onPinInterrupt(void *arg)
static void IRAM_ATTR __onPinInterrupt()
{
uint32_t gpio_intr_status_l=0;
uint32_t gpio_intr_status_h=0;
@ -207,8 +212,12 @@ static void IRAM_ATTR __onPinInterrupt(void *arg)
if(gpio_intr_status_l) {
do {
if(gpio_intr_status_l & ((uint32_t)1 << pin)) {
if(__pinInterruptHandlers[pin]) {
__pinInterruptHandlers[pin]();
if(__pinInterruptHandlers[pin].fn) {
if(__pinInterruptHandlers[pin].arg){
((voidFuncPtrArg)__pinInterruptHandlers[pin].fn)(__pinInterruptHandlers[pin].arg);
} else {
__pinInterruptHandlers[pin].fn();
}
}
}
} while(++pin<32);
@ -217,15 +226,19 @@ static void IRAM_ATTR __onPinInterrupt(void *arg)
pin=32;
do {
if(gpio_intr_status_h & ((uint32_t)1 << (pin - 32))) {
if(__pinInterruptHandlers[pin]) {
__pinInterruptHandlers[pin]();
if(__pinInterruptHandlers[pin].fn) {
if(__pinInterruptHandlers[pin].arg){
((voidFuncPtrArg)__pinInterruptHandlers[pin].fn)(__pinInterruptHandlers[pin].arg);
} else {
__pinInterruptHandlers[pin].fn();
}
}
}
} while(++pin<GPIO_PIN_COUNT);
}
}
extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type)
extern void __attachInterruptArg(uint8_t pin, voidFuncPtrArg userFunc, void * arg, int intr_type)
{
static bool interrupt_initialized = false;
@ -233,7 +246,8 @@ extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type)
interrupt_initialized = true;
esp_intr_alloc(ETS_GPIO_INTR_SOURCE, (int)ESP_INTR_FLAG_IRAM, __onPinInterrupt, NULL, &gpio_intr_handle);
}
__pinInterruptHandlers[pin] = userFunc;
__pinInterruptHandlers[pin].fn = (voidFuncPtr)userFunc;
__pinInterruptHandlers[pin].arg = arg;
esp_intr_disable(gpio_intr_handle);
if(esp_intr_get_cpu(gpio_intr_handle)) { //APP_CPU
GPIO.pin[pin].int_ena = 1;
@ -244,10 +258,15 @@ extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type)
esp_intr_enable(gpio_intr_handle);
}
extern void __attachInterrupt(uint8_t pin, voidFuncPtr userFunc, int intr_type) {
__attachInterruptArg(pin, (voidFuncPtrArg)userFunc, NULL, intr_type);
}
extern void __detachInterrupt(uint8_t pin)
{
esp_intr_disable(gpio_intr_handle);
__pinInterruptHandlers[pin] = NULL;
__pinInterruptHandlers[pin].fn = NULL;
__pinInterruptHandlers[pin].arg = NULL;
GPIO.pin[pin].int_ena = 0;
GPIO.pin[pin].int_type = 0;
esp_intr_enable(gpio_intr_handle);
@ -258,5 +277,6 @@ extern void pinMode(uint8_t pin, uint8_t mode) __attribute__ ((weak, alias("__pi
extern void digitalWrite(uint8_t pin, uint8_t val) __attribute__ ((weak, alias("__digitalWrite")));
extern int digitalRead(uint8_t pin) __attribute__ ((weak, alias("__digitalRead")));
extern void attachInterrupt(uint8_t pin, voidFuncPtr handler, int mode) __attribute__ ((weak, alias("__attachInterrupt")));
extern void attachInterruptArg(uint8_t pin, voidFuncPtr handler, void * arg, int mode) __attribute__ ((weak, alias("__attachInterruptArg")));
extern void detachInterrupt(uint8_t pin) __attribute__ ((weak, alias("__detachInterrupt")));

View File

@ -79,6 +79,7 @@ void digitalWrite(uint8_t pin, uint8_t val);
int digitalRead(uint8_t pin);
void attachInterrupt(uint8_t pin, void (*)(void), int mode);
void attachInterruptArg(uint8_t pin, void (*)(void), void * arg, int mode);
void detachInterrupt(uint8_t pin);
#ifdef __cplusplus

View File

@ -990,15 +990,6 @@ i2c_err_t i2cProcQueue(i2c_t * i2c, uint32_t *readCount, uint16_t timeOutMillis)
}
if(eBits&EVENT_DONE) { // no gross timeout
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
uint32_t expected =(totalBytes*10*1000)/i2cGetFrequency(i2c);
if((tAfter-tBefore)>(expected+1)) { //used some of the timeout Period
// expected can be zero due to small packets
log_e("TimeoutRecovery: expected=%ums, actual=%ums",expected,(tAfter-tBefore));
i2cDumpI2c(i2c);
i2cDumpInts(i2c->num);
}
#endif
switch(i2c->error) {
case I2C_OK :
reason = I2C_ERROR_OK;

View File

@ -12,7 +12,6 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include "esp32-hal.h"
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
@ -24,6 +23,7 @@
#include "esp_timer.h"
#include "esp_bt.h"
#include <sys/time.h>
#include "esp32-hal.h"
//Undocumented!!! Get chip temperature in Farenheit
//Source: https://github.com/pcbreflux/espressif/blob/master/esp32/arduino/sketchbook/ESP32_int_temp_sensor/ESP32_int_temp_sensor.ino
@ -84,6 +84,9 @@ bool btInUse(){ return false; }
void initArduino()
{
#if CONFIG_SPIRAM_SUPPORT
psramInit();
#endif
esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL);
esp_err_t err = nvs_flash_init();
if(err == ESP_ERR_NVS_NO_FREE_PAGES){

View File

@ -0,0 +1,98 @@
#include "esp32-hal.h"
#if CONFIG_SPIRAM_SUPPORT
#include "esp_spiram.h"
#include "soc/efuse_reg.h"
#include "esp_heap_caps.h"
static volatile bool spiramDetected = false;
static volatile bool spiramFailed = false;
bool psramInit(){
if (spiramDetected) {
return true;
}
#ifndef CONFIG_SPIRAM_BOOT_INIT
if (spiramFailed) {
return false;
}
uint32_t chip_ver = REG_GET_FIELD(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_VER_PKG);
uint32_t pkg_ver = chip_ver & 0x7;
if (pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32D2WDQ5 || pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD2 || pkg_ver == EFUSE_RD_CHIP_VER_PKG_ESP32PICOD4) {
spiramFailed = true;
log_w("PSRAM not supported!");
return false;
}
esp_spiram_init_cache();
if (esp_spiram_init() != ESP_OK) {
spiramFailed = true;
log_w("PSRAM init failed!");
pinMatrixOutDetach(16, false, false);
pinMatrixOutDetach(17, false, false);
return false;
}
if (!esp_spiram_test()) {
spiramFailed = true;
log_e("PSRAM test failed!");
return false;
}
if (esp_spiram_add_to_heapalloc() != ESP_OK) {
spiramFailed = true;
log_e("PSRAM could not be added to the heap!");
return false;
}
#endif
spiramDetected = true;
log_d("PSRAM enabled");
return true;
}
bool IRAM_ATTR psramFound(){
return spiramDetected;
}
void IRAM_ATTR *ps_malloc(size_t size){
if(!spiramDetected){
return NULL;
}
return heap_caps_malloc(size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
}
void IRAM_ATTR *ps_calloc(size_t n, size_t size){
if(!spiramDetected){
return NULL;
}
return heap_caps_calloc(n, size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
}
void IRAM_ATTR *ps_realloc(void *ptr, size_t size){
if(!spiramDetected){
return NULL;
}
return heap_caps_realloc(ptr, size, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
}
#else
bool psramInit(){
return false;
}
bool IRAM_ATTR psramFound(){
return false;
}
void IRAM_ATTR *ps_malloc(size_t size){
return NULL;
}
void IRAM_ATTR *ps_calloc(size_t n, size_t size){
return NULL;
}
void IRAM_ATTR *ps_realloc(void *ptr, size_t size){
return NULL;
}
#endif

View File

@ -0,0 +1,33 @@
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// 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 _ESP32_HAL_PSRAM_H_
#define _ESP32_HAL_PSRAM_H_
#ifdef __cplusplus
extern "C" {
#endif
bool psramInit();
bool psramFound();
void *ps_malloc(size_t size);
void *ps_calloc(size_t n, size_t size);
void *ps_realloc(void *ptr, size_t size);
#ifdef __cplusplus
}
#endif
#endif /* _ESP32_HAL_PSRAM_H_ */

View File

@ -315,11 +315,14 @@ void uartFlush(uart_t* uart)
UART_MUTEX_LOCK();
while(uart->dev->status.txfifo_cnt);
uart->dev->conf0.txfifo_rst = 1;
uart->dev->conf0.txfifo_rst = 0;
//Due to hardware issue, we can not use fifo_rst to reset uart fifo.
//See description about UART_TXFIFO_RST and UART_RXFIFO_RST in <<esp32_technical_reference_manual>> v2.6 or later.
// we read the data out and make `fifo_len == 0 && rd_addr == wr_addr`.
while(uart->dev->status.rxfifo_cnt != 0 || (uart->dev->mem_rx_status.wr_addr != uart->dev->mem_rx_status.rd_addr)) {
READ_PERI_REG(UART_FIFO_REG(uart->num));
}
uart->dev->conf0.rxfifo_rst = 1;
uart->dev->conf0.rxfifo_rst = 0;
UART_MUTEX_UNLOCK();
}

View File

@ -33,6 +33,7 @@ extern "C" {
#include <string.h>
#include <math.h>
#include "sdkconfig.h"
#include "esp_system.h"
#ifndef F_CPU
#define F_CPU (CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ * 1000000U)
@ -59,7 +60,13 @@ void yield(void);
#include "esp32-hal-sigmadelta.h"
#include "esp32-hal-timer.h"
#include "esp32-hal-bt.h"
#include "esp_system.h"
#include "esp32-hal-psram.h"
#ifndef BOARD_HAS_PSRAM
#ifdef CONFIG_SPIRAM_SUPPORT
#undef CONFIG_SPIRAM_SUPPORT
#endif
#endif
//returns chip temperature in Celsius
float temperatureRead();

View File

@ -0,0 +1,59 @@
# Over the Air through Web browser
OTAWebUpdate is done with a web browser that can be useful in the following typical scenarios:
- Once the application developed and loading directly from Arduino IDE is inconvenient or not possible
- after deployment if user is unable to expose Firmware for OTA from external update server
- provide updates after deployment to small quantity of modules when setting an update server is not practicable
## Requirements
- The ESP and the computer must be connected to the same network
## Implementation
The sample implementation has been done using:
- example sketch OTAWebUpdater.ino
- ESP32 (Dev Module)
You can use another module also if it meets Flash chip size of the sketch
1-Before you begin, please make sure that you have the following software installed:
- Arduino IDE
- Host software depending on O/S you use:
- Avahi http://avahi.org/ for Linux
- Bonjour http://www.apple.com/support/bonjour/ for Windows
- Mac OSX and iOS - support is already built in / no any extra s/w is required
Prepare the sketch and configuration for initial upload with a serial port
- Start Arduino IDE and load sketch OTAWebUpdater.ino available under File > Examples > OTAWebUpdater.ino
- Update ssid and pass in the sketch so the module can join your Wi-Fi network
- Open File > Preferences, look for “Show verbose output during:” and check out “compilation” option
![verbrose](esp32verbose.PNG)
- Upload sketch (Ctrl+U)
- Now open web browser and enter the url, i.e. http://esp32.local. Once entered, browser should display a form
![login](esp32login.PNG)
> username= admin
> password= admin
**Note**-*If entering “http://ESP32.local” does not work, try replacing “ESP32” with modules IP address.This workaround is useful in case the host software installed does not work*.
Now click on Login button and browser will display a upload form
![upload](esp32upload.PNG)
For Uploading the New Firmware you need to provide the Binary File of your Code.
Exporting Binary file of the Firmware (Code)
- Open up the Arduino IDE
- Open up the Code, for Exporting up Binary file
- Now go to Sketch > export compiled Binary
![export](exportTobinary.PNG)
- Binary file is exported to the same Directory where your code is present
Once you are comfortable with this procedure go ahead and modify OTAWebUpdater.ino sketch to print some additional messages, compile it, Export new binary file and upload it using web browser to see entered changes on a Serial Monitor

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -0,0 +1,168 @@
#include <WiFi.h>
#include <WiFiClient.h>
#include <WebServer.h>
#include <ESPmDNS.h>
#include <Update.h>
const char* host = "esp32";
const char* ssid = "xxx";
const char* password = "xxxx";
WebServer server(80);
/*
* Login page
*/
const char* loginIndex =
"<form name='loginForm'>"
"<table width='20%' bgcolor='A09F9F' align='center'>"
"<tr>"
"<td colspan=2>"
"<center><font size=4><b>ESP32 Login Page</b></font></center>"
"<br>"
"</td>"
"<br>"
"<br>"
"</tr>"
"<td>Username:</td>"
"<td><input type='text' size=25 name='userid'><br></td>"
"</tr>"
"<br>"
"<br>"
"<tr>"
"<td>Password:</td>"
"<td><input type='Password' size=25 name='pwd'><br></td>"
"<br>"
"<br>"
"</tr>"
"<tr>"
"<td><input type='submit' onclick='check(this.form)' value='Login'></td>"
"</tr>"
"</table>"
"</form>"
"<script>"
"function check(form)"
"{"
"if(form.userid.value=='admin' && form.pwd.value=='admin')"
"{"
"window.open('/serverIndex')"
"}"
"else"
"{"
" alert('Error Password or Username')/*displays error message*/"
"}"
"}"
"</script>";
/*
* Server Index Page
*/
const char* serverIndex =
"<script src='https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js'></script>"
"<form method='POST' action='#' enctype='multipart/form-data' id='upload_form'>"
"<input type='file' name='update'>"
"<input type='submit' value='Update'>"
"</form>"
"<div id='prg'>progress: 0%</div>"
"<script>"
"$('form').submit(function(e){"
"e.preventDefault();"
"var form = $('#upload_form')[0];"
"var data = new FormData(form);"
" $.ajax({"
"url: '/update',"
"type: 'POST',"
"data: data,"
"contentType: false,"
"processData:false,"
"xhr: function() {"
"var xhr = new window.XMLHttpRequest();"
"xhr.upload.addEventListener('progress', function(evt) {"
"if (evt.lengthComputable) {"
"var per = evt.loaded / evt.total;"
"$('#prg').html('progress: ' + Math.round(per*100) + '%');"
"}"
"}, false);"
"return xhr;"
"},"
"success:function(d, s) {"
"console.log('success!')"
"},"
"error: function (a, b, c) {"
"}"
"});"
"});"
"</script>";
/*
* setup function
*/
void setup(void) {
Serial.begin(115200);
// Connect to WiFi network
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());
/*use mdns for host name resolution*/
if (!MDNS.begin(host)) { //http://esp32.local
Serial.println("Error setting up MDNS responder!");
while (1) {
delay(1000);
}
}
Serial.println("mDNS responder started");
/*return index page which is stored in serverIndex */
server.on("/", HTTP_GET, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/html", loginIndex);
});
server.on("/serverIndex", HTTP_GET, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/html", serverIndex);
});
/*handling uploading firmware file */
server.on("/update", HTTP_POST, []() {
server.sendHeader("Connection", "close");
server.send(200, "text/plain", (Update.hasError()) ? "FAIL" : "OK");
ESP.restart();
}, []() {
HTTPUpload& upload = server.upload();
if (upload.status == UPLOAD_FILE_START) {
Serial.printf("Update: %s\n", upload.filename.c_str());
if (!Update.begin(UPDATE_SIZE_UNKNOWN)) { //start with max available size
Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_WRITE) {
/* flashing firmware to ESP*/
if (Update.write(upload.buf, upload.currentSize) != upload.currentSize) {
Update.printError(Serial);
}
} else if (upload.status == UPLOAD_FILE_END) {
if (Update.end(true)) { //true to set the size to the current progress
Serial.printf("Update Success: %u\nRebooting...\n", upload.totalSize);
} else {
Update.printError(Serial);
}
}
});
server.begin();
}
void loop(void) {
server.handleClient();
delay(1);
}

View File

@ -136,6 +136,16 @@ static bool _init_bt(const char *deviceName)
}
esp_bt_dev_set_device_name(deviceName);
// the default BTA_DM_COD_LOUDSPEAKER does not work with the macOS BT stack
esp_bt_cod_t cod;
cod.major = 0b00001;
cod.minor = 0b000100;
cod.service = 0b00000010110;
if (esp_bt_gap_set_cod(cod, ESP_BT_INIT_COD) != ESP_OK) {
log_e("%s set cod failed\n", __func__);
return false;
}
return true;
}
@ -220,21 +230,24 @@ int BluetoothSerial::read(void)
size_t BluetoothSerial::write(uint8_t c)
{
if (_spp_client){
uint8_t buffer[1];
buffer[0] = c;
esp_spp_write(_spp_client, 1, buffer);
return 1;
if (!_spp_client){
return 0;
}
return -1;
uint8_t buffer[1];
buffer[0] = c;
esp_err_t err = esp_spp_write(_spp_client, 1, buffer);
return (err == ESP_OK) ? 1 : 0;
}
size_t BluetoothSerial::write(const uint8_t *buffer, size_t size)
{
if (_spp_client){
esp_spp_write(_spp_client, size, (uint8_t *)buffer);
if (!_spp_client){
return 0;
}
return size;
esp_err_t err = esp_spp_write(_spp_client, size, (uint8_t *)buffer);
return (err == ESP_OK) ? size : 0;
}
void BluetoothSerial::flush()

View File

@ -296,9 +296,9 @@ String EEPROMClass::readString (int address)
if (address + len > _size)
return String(0);
char value[len + 1];
char value[len];
memcpy((uint8_t*) value, _data + address, len);
value[len + 1] = 0;
value[len] = 0;
return String(value);
}

View File

@ -0,0 +1,45 @@
#include <Arduino.h>
struct Button {
const uint8_t PIN;
uint32_t numberKeyPresses;
bool pressed;
};
Button button1 = {23, 0, false};
Button button2 = {18, 0, false};
void IRAM_ATTR isr(void* arg) {
Button* s = static_cast<Button*>(arg);
s->numberKeyPresses += 1;
s->pressed = true;
}
void IRAM_ATTR isr() {
button2.numberKeyPresses += 1;
button2.pressed = true;
}
void setup() {
Serial.begin(115200);
pinMode(button1.PIN, INPUT_PULLUP);
attachInterruptArg(button1.PIN, isr, &button1, FALLING);
pinMode(button2.PIN, INPUT_PULLUP);
attachInterrupt(button2.PIN, isr, FALLING);
}
void loop() {
if (button1.pressed) {
Serial.printf("Button 1 has been pressed %u times\n", button1.numberKeyPresses);
button1.pressed = false;
}
if (button2.pressed) {
Serial.printf("Button 2 has been pressed %u times\n", button2.numberKeyPresses);
button2.pressed = false;
}
static uint32_t lastMillis = 0;
if (millis() - lastMillis > 10000) {
lastMillis = millis();
detachInterrupt(button1.PIN);
}
}

View File

@ -47,7 +47,9 @@ enum SeekMode {
class File : public Stream
{
public:
File(FileImplPtr p = FileImplPtr()) : _p(p) {}
File(FileImplPtr p = FileImplPtr()) : _p(p) {
_timeout = 0;
}
size_t write(uint8_t) override;
size_t write(const uint8_t *buf, size_t size) override;

View File

@ -252,7 +252,7 @@ void HTTPClient::end(void)
bool HTTPClient::connected()
{
if(_tcp) {
return (_tcp->connected() || (_tcp->available() > 0));
return ((_tcp->available() > 0) || _tcp->connected());
}
return false;
}

View File

@ -0,0 +1,15 @@
#ifndef _HTTP_Method_H_
#define _HTTP_Method_H_
typedef enum {
HTTP_GET = 0b00000001,
HTTP_POST = 0b00000010,
HTTP_DELETE = 0b00000100,
HTTP_PUT = 0b00001000,
HTTP_PATCH = 0b00010000,
HTTP_HEAD = 0b00100000,
HTTP_OPTIONS = 0b01000000,
HTTP_ANY = 0b01111111,
} HTTPMethod;
#endif /* _HTTP_Method_H_ */

View File

@ -359,7 +359,7 @@ uint8_t WebServer::_uploadReadByte(WiFiClient& client){
int res = client.read();
if(res == -1){
while(!client.available() && client.connected())
yield();
delay(2);
res = client.read();
}
return (uint8_t)res;

View File

@ -94,11 +94,13 @@ WebServer::~WebServer() {
void WebServer::begin() {
close();
_server.begin();
_server.setNoDelay(true);
}
void WebServer::begin(uint16_t port) {
close();
_server.begin(port);
_server.setNoDelay(true);
}
String WebServer::_extractParam(String& authReq,const String& param,const char delimit){

View File

@ -27,17 +27,17 @@
#include <functional>
#include <memory>
#include <WiFi.h>
#include "HTTP_Method.h"
enum HTTPMethod { HTTP_ANY, HTTP_GET, HTTP_POST, HTTP_PUT, HTTP_PATCH, HTTP_DELETE, HTTP_OPTIONS };
enum HTTPUploadStatus { UPLOAD_FILE_START, UPLOAD_FILE_WRITE, UPLOAD_FILE_END,
UPLOAD_FILE_ABORTED };
enum HTTPClientStatus { HC_NONE, HC_WAIT_READ, HC_WAIT_CLOSE };
enum HTTPAuthMethod { BASIC_AUTH, DIGEST_AUTH };
#define HTTP_DOWNLOAD_UNIT_SIZE 1460
#define HTTP_DOWNLOAD_UNIT_SIZE 1436
#ifndef HTTP_UPLOAD_BUFLEN
#define HTTP_UPLOAD_BUFLEN 2048
#define HTTP_UPLOAD_BUFLEN 1436
#endif
#define HTTP_MAX_DATA_WAIT 5000 //ms to wait for the client to send the request

View File

@ -31,8 +31,6 @@ const char* password = "**********";
WiFiServer server(23);
WiFiClient serverClients[MAX_SRV_CLIENTS];
HardwareSerial Serial1(2); // UART1/Serial1 pins 16,17
void setup() {
Serial.begin(115200);
Serial.println("\nConnecting");
@ -62,7 +60,7 @@ void setup() {
}
//start UART and the server
Serial1.begin(9600);
Serial2.begin(9600);
server.begin();
server.setNoDelay(true);
@ -98,7 +96,7 @@ void loop() {
if (serverClients[i] && serverClients[i].connected()){
if(serverClients[i].available()){
//get data from the telnet client and push it to the UART
while(serverClients[i].available()) Serial1.write(serverClients[i].read());
while(serverClients[i].available()) Serial2.write(serverClients[i].read());
}
}
else {
@ -108,10 +106,10 @@ void loop() {
}
}
//check UART for data
if(Serial1.available()){
size_t len = Serial1.available();
if(Serial2.available()){
size_t len = Serial2.available();
uint8_t sbuf[len];
Serial1.readBytes(sbuf, len);
Serial2.readBytes(sbuf, len);
//push UART data to all connected telnet clients
for(i = 0; i < MAX_SRV_CLIENTS; i++){
if (serverClients[i] && serverClients[i].connected()){

View File

@ -184,6 +184,11 @@ bool WiFiAPClass::softAPdisconnect(bool wifioff)
{
bool ret;
wifi_config_t conf;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return ESP_ERR_INVALID_STATE;
}
*conf.ap.ssid = 0;
*conf.ap.password = 0;
conf.ap.authmode = WIFI_AUTH_OPEN; // auth must be open if pass=0
@ -204,6 +209,9 @@ bool WiFiAPClass::softAPdisconnect(bool wifioff)
uint8_t WiFiAPClass::softAPgetStationNum()
{
wifi_sta_list_t clients;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return 0;
}
if(esp_wifi_ap_get_sta_list(&clients) == ESP_OK) {
return clients.num;
}
@ -217,6 +225,9 @@ uint8_t WiFiAPClass::softAPgetStationNum()
IPAddress WiFiAPClass::softAPIP()
{
tcpip_adapter_ip_info_t ip;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return IPAddress();
}
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_AP, &ip);
return IPAddress(ip.ip.addr);
}
@ -229,7 +240,9 @@ IPAddress WiFiAPClass::softAPIP()
*/
uint8_t* WiFiAPClass::softAPmacAddress(uint8_t* mac)
{
esp_wifi_get_mac(WIFI_IF_AP, mac);
if(WiFiGenericClass::getMode() != WIFI_MODE_NULL){
esp_wifi_get_mac(WIFI_IF_AP, mac);
}
return mac;
}
@ -241,6 +254,9 @@ String WiFiAPClass::softAPmacAddress(void)
{
uint8_t mac[6];
char macStr[18] = { 0 };
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return String();
}
esp_wifi_get_mac(WIFI_IF_AP, mac);
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
@ -253,9 +269,12 @@ String WiFiAPClass::softAPmacAddress(void)
*/
const char * WiFiAPClass::softAPgetHostname()
{
const char * hostname;
const char * hostname = NULL;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return hostname;
}
if(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_AP, &hostname)) {
return NULL;
return hostname;
}
return hostname;
}
@ -267,6 +286,9 @@ const char * WiFiAPClass::softAPgetHostname()
*/
bool WiFiAPClass::softAPsetHostname(const char * hostname)
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return false;
}
return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_AP, hostname) == ESP_OK;
}
@ -276,6 +298,9 @@ bool WiFiAPClass::softAPsetHostname(const char * hostname)
*/
bool WiFiAPClass::softAPenableIpV6()
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return false;
}
return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_AP) == ESP_OK;
}
@ -286,6 +311,9 @@ bool WiFiAPClass::softAPenableIpV6()
IPv6Address WiFiAPClass::softAPIPv6()
{
static ip6_addr_t addr;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return IPv6Address();
}
if(tcpip_adapter_get_ip6_linklocal(TCPIP_ADAPTER_IF_AP, &addr)) {
return IPv6Address();
}

View File

@ -31,6 +31,118 @@
#undef write
#undef read
class WiFiClientRxBuffer {
private:
size_t _size;
uint8_t *_buffer;
size_t _pos;
size_t _fill;
int _fd;
bool _failed;
size_t r_available()
{
if(_fd < 0){
return 0;
}
int count;
int res = lwip_ioctl_r(_fd, FIONREAD, &count);
if(res < 0) {
_failed = true;
return 0;
}
return count;
}
size_t fillBuffer()
{
if(!_buffer){
_buffer = (uint8_t *)malloc(_size);
}
if(_fill && _pos == _fill){
_fill = 0;
_pos = 0;
}
if(!_buffer || _size <= _fill || !r_available()) {
return 0;
}
int res = recv(_fd, _buffer + _fill, _size - _fill, MSG_DONTWAIT);
if(res < 0 && errno != EWOULDBLOCK) {
_failed = true;
return 0;
}
_fill += res;
return res;
}
public:
WiFiClientRxBuffer(int fd, size_t size=1436)
:_size(size)
,_buffer(NULL)
,_pos(0)
,_fill(0)
,_fd(fd)
,_failed(false)
{
//_buffer = (uint8_t *)malloc(_size);
}
~WiFiClientRxBuffer()
{
free(_buffer);
}
bool failed(){
return _failed;
}
int read(uint8_t * dst, size_t len){
if(!dst || !len || (_pos == _fill && !fillBuffer())){
return -1;
}
size_t a = _fill - _pos;
if(len <= a || ((len - a) <= (_size - _fill) && fillBuffer() >= (len - a))){
if(len == 1){
*dst = _buffer[_pos];
} else {
memcpy(dst, _buffer + _pos, len);
}
_pos += len;
return len;
}
size_t left = len;
size_t toRead = a;
uint8_t * buf = dst;
memcpy(buf, _buffer + _pos, toRead);
_pos += toRead;
left -= toRead;
buf += toRead;
while(left){
if(!fillBuffer()){
return len - left;
}
a = _fill - _pos;
toRead = (a > left)?left:a;
memcpy(buf, _buffer + _pos, toRead);
_pos += toRead;
left -= toRead;
buf += toRead;
}
return len;
}
int peek(){
if(_pos == _fill && !fillBuffer()){
return -1;
}
return _buffer[_pos];
}
size_t available(){
return _fill - _pos + r_available();
}
};
class WiFiClientSocketHandle {
private:
int sockfd;
@ -58,6 +170,7 @@ WiFiClient::WiFiClient():_connected(false),next(NULL)
WiFiClient::WiFiClient(int fd):_connected(true),next(NULL)
{
clientSocketHandle.reset(new WiFiClientSocketHandle(fd));
_rxBuffer.reset(new WiFiClientRxBuffer(fd));
}
WiFiClient::~WiFiClient()
@ -69,6 +182,7 @@ WiFiClient & WiFiClient::operator=(const WiFiClient &other)
{
stop();
clientSocketHandle = other.clientSocketHandle;
_rxBuffer = other._rxBuffer;
_connected = other._connected;
return *this;
}
@ -76,6 +190,7 @@ WiFiClient & WiFiClient::operator=(const WiFiClient &other)
void WiFiClient::stop()
{
clientSocketHandle = NULL;
_rxBuffer = NULL;
_connected = false;
}
@ -100,6 +215,7 @@ int WiFiClient::connect(IPAddress ip, uint16_t port)
return 0;
}
clientSocketHandle.reset(new WiFiClientSocketHandle(sockfd));
_rxBuffer.reset(new WiFiClientRxBuffer(sockfd));
_connected = true;
return 1;
}
@ -260,11 +376,9 @@ size_t WiFiClient::write(Stream &stream)
int WiFiClient::read(uint8_t *buf, size_t size)
{
if(!available()) {
return -1;
}
int res = recv(fd(), buf, size, MSG_DONTWAIT);
if(res < 0 && errno != EWOULDBLOCK) {
int res = -1;
res = _rxBuffer->read(buf, size);
if(_rxBuffer->failed()) {
log_e("%d", errno);
stop();
}
@ -273,16 +387,12 @@ int WiFiClient::read(uint8_t *buf, size_t size)
int WiFiClient::peek()
{
if(!available()) {
return -1;
}
uint8_t data = 0;
int res = recv(fd(), &data, 1, MSG_PEEK);
if(res < 0 && errno != EWOULDBLOCK) {
int res = _rxBuffer->peek();
if(_rxBuffer->failed()) {
log_e("%d", errno);
stop();
}
return data;
return res;
}
int WiFiClient::available()
@ -290,14 +400,12 @@ int WiFiClient::available()
if(!_connected) {
return 0;
}
int count;
int res = lwip_ioctl_r(fd(), FIONREAD, &count);
if(res < 0) {
int res = _rxBuffer->available();
if(_rxBuffer->failed()) {
log_e("%d", errno);
stop();
return 0;
}
return count;
return res;
}
// Though flushing means to send all pending data,
@ -330,22 +438,9 @@ uint8_t WiFiClient::connected()
if (_connected) {
uint8_t dummy;
int res = recv(fd(), &dummy, 0, MSG_DONTWAIT);
if (res < 0) {
switch (errno) {
case ENOTCONN:
case EPIPE:
case ECONNRESET:
case ECONNREFUSED:
case ECONNABORTED:
_connected = false;
break;
default:
_connected = true;
break;
}
}
else {
_connected = true;
if (res <= 0 && errno != EWOULDBLOCK) {
_connected = false;
log_i("Disconnected: RES: %d, ERR: %d", res, errno);
}
}
return _connected;

View File

@ -28,11 +28,13 @@
#include <memory>
class WiFiClientSocketHandle;
class WiFiClientRxBuffer;
class WiFiClient : public Client
{
protected:
std::shared_ptr<WiFiClientSocketHandle> clientSocketHandle;
std::shared_ptr<WiFiClientRxBuffer> _rxBuffer;
bool _connected;
public:

View File

@ -334,7 +334,7 @@ void WiFiGenericClass::removeEvent(wifi_event_id_t id)
* @param arg
*/
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_LOST_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_PROBEREQRECVED", "GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"};
const char * system_event_names[] = { "WIFI_READY", "SCAN_DONE", "STA_START", "STA_STOP", "STA_CONNECTED", "STA_DISCONNECTED", "STA_AUTHMODE_CHANGE", "STA_GOT_IP", "STA_LOST_IP", "STA_WPS_ER_SUCCESS", "STA_WPS_ER_FAILED", "STA_WPS_ER_TIMEOUT", "STA_WPS_ER_PIN", "AP_START", "AP_STOP", "AP_STACONNECTED", "AP_STADISCONNECTED", "AP_STAIPASSIGNED", "AP_PROBEREQRECVED", "GOT_IP6", "ETH_START", "ETH_STOP", "ETH_CONNECTED", "ETH_DISCONNECTED", "ETH_GOT_IP", "MAX"};
#endif
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_WARN
const char * system_event_reasons[] = { "UNSPECIFIED", "AUTH_EXPIRE", "AUTH_LEAVE", "ASSOC_EXPIRE", "ASSOC_TOOMANY", "NOT_AUTHED", "NOT_ASSOCED", "ASSOC_LEAVE", "ASSOC_NOT_AUTHED", "DISASSOC_PWRCAP_BAD", "DISASSOC_SUPCHAN_BAD", "UNSPECIFIED", "IE_INVALID", "MIC_FAILURE", "4WAY_HANDSHAKE_TIMEOUT", "GROUP_KEY_UPDATE_TIMEOUT", "IE_IN_4WAY_DIFFERS", "GROUP_CIPHER_INVALID", "PAIRWISE_CIPHER_INVALID", "AKMP_INVALID", "UNSUPP_RSN_IE_VERSION", "INVALID_RSN_IE_CAP", "802_1X_AUTH_FAILED", "CIPHER_SUITE_REJECTED", "BEACON_TIMEOUT", "NO_AP_FOUND", "AUTH_FAIL", "ASSOC_FAIL", "HANDSHAKE_TIMEOUT" };
@ -376,6 +376,15 @@ esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event)
WiFi.begin();
}
} else if(event->event_id == SYSTEM_EVENT_STA_GOT_IP) {
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
uint8_t * ip = (uint8_t *)&(event->event_info.got_ip.ip_info.ip.addr);
uint8_t * mask = (uint8_t *)&(event->event_info.got_ip.ip_info.netmask.addr);
uint8_t * gw = (uint8_t *)&(event->event_info.got_ip.ip_info.gw.addr);
log_d("STA IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u",
ip[0], ip[1], ip[2], ip[3],
mask[0], mask[1], mask[2], mask[3],
gw[0], gw[1], gw[2], gw[3]);
#endif
WiFiSTAClass::_setStatus(WL_CONNECTED);
setStatusBits(STA_HAS_IP_BIT | STA_CONNECTED_BIT);
} else if(event->event_id == SYSTEM_EVENT_STA_LOST_IP) {
@ -403,6 +412,15 @@ esp_err_t WiFiGenericClass::_eventCallback(void *arg, system_event_t *event)
} else if(event->event_id == SYSTEM_EVENT_ETH_DISCONNECTED) {
clearStatusBits(ETH_CONNECTED_BIT | ETH_HAS_IP_BIT | ETH_HAS_IP6_BIT);
} else if(event->event_id == SYSTEM_EVENT_ETH_GOT_IP) {
#if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_DEBUG
uint8_t * ip = (uint8_t *)&(event->event_info.got_ip.ip_info.ip.addr);
uint8_t * mask = (uint8_t *)&(event->event_info.got_ip.ip_info.netmask.addr);
uint8_t * gw = (uint8_t *)&(event->event_info.got_ip.ip_info.gw.addr);
log_d("ETH IP: %u.%u.%u.%u, MASK: %u.%u.%u.%u, GW: %u.%u.%u.%u",
ip[0], ip[1], ip[2], ip[3],
mask[0], mask[1], mask[2], mask[3],
gw[0], gw[1], gw[2], gw[3]);
#endif
setStatusBits(ETH_CONNECTED_BIT | ETH_HAS_IP_BIT);
} else if(event->event_id == SYSTEM_EVENT_GOT_IP6) {

View File

@ -399,6 +399,9 @@ uint8_t WiFiSTAClass::waitForConnectResult()
*/
IPAddress WiFiSTAClass::localIP()
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return IPAddress();
}
tcpip_adapter_ip_info_t ip;
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip);
return IPAddress(ip.ip.addr);
@ -412,7 +415,9 @@ IPAddress WiFiSTAClass::localIP()
*/
uint8_t* WiFiSTAClass::macAddress(uint8_t* mac)
{
esp_wifi_get_mac(WIFI_IF_STA, mac);
if(WiFiGenericClass::getMode() != WIFI_MODE_NULL){
esp_wifi_get_mac(WIFI_IF_STA, mac);
}
return mac;
}
@ -424,6 +429,9 @@ String WiFiSTAClass::macAddress(void)
{
uint8_t mac[6];
char macStr[18] = { 0 };
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return String();
}
esp_wifi_get_mac(WIFI_IF_STA, mac);
sprintf(macStr, "%02X:%02X:%02X:%02X:%02X:%02X", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
@ -436,6 +444,9 @@ String WiFiSTAClass::macAddress(void)
*/
IPAddress WiFiSTAClass::subnetMask()
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return IPAddress();
}
tcpip_adapter_ip_info_t ip;
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip);
return IPAddress(ip.netmask.addr);
@ -447,6 +458,9 @@ IPAddress WiFiSTAClass::subnetMask()
*/
IPAddress WiFiSTAClass::gatewayIP()
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return IPAddress();
}
tcpip_adapter_ip_info_t ip;
tcpip_adapter_get_ip_info(TCPIP_ADAPTER_IF_STA, &ip);
return IPAddress(ip.gw.addr);
@ -459,6 +473,9 @@ IPAddress WiFiSTAClass::gatewayIP()
*/
IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no)
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return IPAddress();
}
ip_addr_t dns_ip = dns_getserver(dns_no);
return IPAddress(dns_ip.u_addr.ip4.addr);
}
@ -469,6 +486,9 @@ IPAddress WiFiSTAClass::dnsIP(uint8_t dns_no)
*/
String WiFiSTAClass::SSID() const
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return String();
}
wifi_ap_record_t info;
if(!esp_wifi_sta_get_ap_info(&info)) {
return String(reinterpret_cast<char*>(info.ssid));
@ -482,6 +502,9 @@ String WiFiSTAClass::SSID() const
*/
String WiFiSTAClass::psk() const
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return String();
}
wifi_config_t conf;
esp_wifi_get_config(WIFI_IF_STA, &conf);
return String(reinterpret_cast<char*>(conf.sta.password));
@ -495,6 +518,9 @@ uint8_t* WiFiSTAClass::BSSID(void)
{
static uint8_t bssid[6];
wifi_ap_record_t info;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return NULL;
}
if(!esp_wifi_sta_get_ap_info(&info)) {
memcpy(bssid, info.bssid, 6);
return reinterpret_cast<uint8_t*>(bssid);
@ -523,6 +549,9 @@ String WiFiSTAClass::BSSIDstr(void)
*/
int8_t WiFiSTAClass::RSSI(void)
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return 0;
}
wifi_ap_record_t info;
if(!esp_wifi_sta_get_ap_info(&info)) {
return info.rssi;
@ -536,7 +565,10 @@ int8_t WiFiSTAClass::RSSI(void)
*/
const char * WiFiSTAClass::getHostname()
{
const char * hostname;
const char * hostname = NULL;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return hostname;
}
if(tcpip_adapter_get_hostname(TCPIP_ADAPTER_IF_STA, &hostname)){
return NULL;
}
@ -550,6 +582,9 @@ const char * WiFiSTAClass::getHostname()
*/
bool WiFiSTAClass::setHostname(const char * hostname)
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return false;
}
return tcpip_adapter_set_hostname(TCPIP_ADAPTER_IF_STA, hostname) == 0;
}
@ -559,6 +594,9 @@ bool WiFiSTAClass::setHostname(const char * hostname)
*/
bool WiFiSTAClass::enableIpV6()
{
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return false;
}
return tcpip_adapter_create_ip6_linklocal(TCPIP_ADAPTER_IF_STA) == 0;
}
@ -569,6 +607,9 @@ bool WiFiSTAClass::enableIpV6()
IPv6Address WiFiSTAClass::localIPv6()
{
static ip6_addr_t addr;
if(WiFiGenericClass::getMode() == WIFI_MODE_NULL){
return IPv6Address();
}
if(tcpip_adapter_get_ip6_linklocal(TCPIP_ADAPTER_IF_STA, &addr)){
return IPv6Address();
}

View File

@ -81,6 +81,7 @@ void WiFiClientSecure::stop()
close(sslclient->socket);
sslclient->socket = -1;
_connected = false;
_peek = -1;
}
stop_ssl_socket(sslclient, _CA_cert, _cert, _private_key);
}
@ -105,7 +106,7 @@ int WiFiClientSecure::connect(const char *host, uint16_t port, const char *_CA_c
int ret = start_ssl_client(sslclient, host, port, _CA_cert, _cert, _private_key);
_lastError = ret;
if (ret < 0) {
log_e("lwip_connect_r: %d", errno);
log_e("start_ssl_client: %d", ret);
stop();
return 0;
}
@ -117,7 +118,7 @@ int WiFiClientSecure::peek(){
if(_peek >= 0){
return _peek;
}
_peek = read();
_peek = timedRead();
return _peek;
}
@ -158,21 +159,30 @@ size_t WiFiClientSecure::write(const uint8_t *buf, size_t size)
int WiFiClientSecure::read(uint8_t *buf, size_t size)
{
if(_peek >= 0){
uint8_t data = -1;
data = _peek;
_peek = -1;
return data;
}
if (!available()) {
int peeked = 0;
if ((!buf && size) || (_peek < 0 && !available())) {
return -1;
}
if(!size){
return 0;
}
if(_peek >= 0){
buf[0] = _peek;
_peek = -1;
size--;
if(!size || !available()){
return 1;
}
buf++;
peeked = 1;
}
int res = get_ssl_receive(sslclient, buf, size);
if (res < 0) {
stop();
return res;
}
return res;
return res + peeked;
}
int WiFiClientSecure::available()
@ -183,7 +193,9 @@ int WiFiClientSecure::available()
int res = data_to_read(sslclient);
if (res < 0 ) {
stop();
}
} else if(_peek >= 0) {
res += 1;
}
return res;
}

View File

@ -364,3 +364,4 @@ void TwoWire::dumpI2C()
}
TwoWire Wire = TwoWire(0);
TwoWire Wire1 = TwoWire(1);

View File

@ -134,6 +134,7 @@ public:
};
extern TwoWire Wire;
extern TwoWire Wire1;
/*

View File

@ -38,7 +38,7 @@
{
"packager": "esp32",
"name": "esptool",
"version": "da31d9d"
"version": "2.3.1"
},
{
"packager": "esp32",
@ -85,21 +85,42 @@
},
{
"name": "esptool",
"version": "da31d9d",
"version": "2.3.1",
"systems": [
{
"host": "i686-mingw32",
"url": "https://dl.espressif.com/dl/esptool-da31d9d-windows.zip",
"archiveFileName": "esptool-da31d9d-windows.zip",
"checksum": "SHA-256:6476f4d6e33a59167dea364e177d97167316253d2c9ac75f81b469ecb3ed3875",
"size": "3395925"
"url": "https://dl.espressif.com/dl/esptool-2.3.1-windows.zip",
"archiveFileName": "esptool-2.3.1-windows.zip",
"checksum": "SHA-256:c187763d0faac7da7c30a292a23c759bbc256fcd084dc8846ed284000cb0fe29",
"size": "3396085"
},
{
"host": "x86_64-apple-darwin",
"url": "https://dl.espressif.com/dl/esptool-da31d9d-macos.tar.gz",
"archiveFileName": "esptool-da31d9d-macos.tar.gz",
"checksum": "SHA-256:76d53298366a294235356bb8d197a81b2afbfd62642851bfbaee252cc593faa9",
"size": "3810904"
"url": "https://dl.espressif.com/dl/esptool-2.3.1-macos.tar.gz",
"archiveFileName": "esptool-2.3.1-macos.tar.gz",
"checksum": "SHA-256:cd922418f02e0ca11dc066b36a22646a1b441da00d762b4464ca598c902c5ecb",
"size": "3810932"
},
{
"host": "x86_64-pc-linux-gnu",
"url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz",
"archiveFileName": "esptool-2.3.1-linux.tar.gz",
"checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e",
"size": "39563"
},
{
"host": "i686-pc-linux-gnu",
"url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz",
"archiveFileName": "esptool-2.3.1-linux.tar.gz",
"checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e",
"size": "39563"
},
{
"host": "arm-linux-gnueabihf",
"url": "https://dl.espressif.com/dl/esptool-2.3.1-linux.tar.gz",
"archiveFileName": "esptool-2.3.1-linux.tar.gz",
"checksum": "SHA-256:cff30841dad80ed5d7d2d58a31843b63afa57528979a9c839806568167691d8e",
"size": "39563"
}
]
},

View File

@ -3,7 +3,7 @@ version=0.0.1
runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}/tools/xtensa-esp32-elf
tools.esptool.path={runtime.platform.path}/tools
tools.esptool.path={runtime.platform.path}/tools/esptool
tools.esptool.cmd=esptool
tools.esptool.cmd.linux=esptool.py
tools.esptool.cmd.windows=esptool.exe
@ -49,7 +49,8 @@ build.flash_size=4MB
build.flash_mode=dio
build.boot=bootloader
build.code_debug=0
build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug}
build.defines=
build.extra_flags=-DESP32 -DCORE_DEBUG_LEVEL={build.code_debug} {build.defines}
# These can be overridden in platform.local.txt
compiler.c.extra_flags=
@ -88,8 +89,8 @@ recipe.output.save_file={build.project_name}.{build.variant}.bin
## Compute size
recipe.size.pattern="{compiler.path}{compiler.size.cmd}" -A "{build.path}/{build.project_name}.elf"
recipe.size.regex=^(?:\.iram0\.text|\.dram0\.text|\.flash\.text|\.dram0\.data|\.flash\.rodata|)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss)\s+([0-9]+).*
recipe.size.regex=^(?:\.iram0\.text|\.iram0\.vectors|\.dram0\.data|\.flash\.text|\.flash\.rodata|)\s+([0-9]+).*
recipe.size.regex.data=^(?:\.dram0\.data|\.dram0\.bss|\.noinit)\s+([0-9]+).*
# ------------------------------

View File

@ -5,15 +5,16 @@
# $2 - JSON output file
function downloadAndMergePackageJSON()
{
echo " --- Package JSON definition merge BEGIN ---"
echo
echo " ---Package JSON definition merge BEGIN--->"
jsonLink=$1
jsonOut=$2
curlAuthToken=$3
outDirectory=$4
echo "Remote package JSON: $jsonLink (source)"
echo "Current package JSON: $jsonOut (target)"
echo " - remote package JSON: $jsonLink (source)"
echo " - current package JSON: $jsonOut (target)"
old_json=$outDirectory/oldJson.json
merged_json=$outDirectory/mergedJson.json
@ -22,7 +23,7 @@ function downloadAndMergePackageJSON()
#echo " Local tmp for remote JSON: $old_json"
#echo " Merge output JSON: $merged_json"
echo "Downloading JSON package definition: $jsonLink ..."
echo " - downloading JSON package definition: $jsonLink ..."
# Authentication through HTTP headers might fail on redirection due to bug in cURL (https://curl.haxx.se/docs/adv_2018-b3bf.html - headers are resent to the target location including the original authentication)
# Notes:
@ -35,10 +36,12 @@ function downloadAndMergePackageJSON()
#curl --verbose -sH "Authorization: token $curlAuthToken" -L -o "$old_json" "$jsonLink"
curl -L -o "$old_json" "$jsonLink?access_token=$curlAuthToken"
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
#curl -L -o "$old_json" "$jsonLink"
echo "Merging $old_json into $jsonOut ..."
echo " - merging $old_json into $jsonOut ..."
echo
set +e
@ -49,16 +52,17 @@ function downloadAndMergePackageJSON()
set -v
if [ ! -s $merged_json ]; then
rm -f "$merged_json"
echo "Nothing to merge ($merged_json empty), $jsonOut unchanged"
echo " Done: nothing to merge ($merged_json empty) => $jsonOut remains unchanged"
else
rm -f "$jsonOut"
mv "$merged_json" "$jsonOut"
echo "Data successfully merged to $jsonOut"
echo " Done: JSON data successfully merged to $jsonOut"
fi
rm -f "$old_json"
set +v
echo " --- Package JSON definition merge END ---"
echo " <---Package JSON definition merge END---"
echo
}
############################################################
@ -73,58 +77,65 @@ echo "==================================================================="
echo "RELEASE PACKAGE PUBLISHING ARRANGEMENTS (GitHub/Arduino compliance)"
echo "==================================================================="
echo
cmdLine=`basename $0 $@`
echo "Cmdline: ${cmdLine}"
# cURL authentication token
while getopts ":a:,:d:" opt; do
case $opt in
a)
curlAuth=$OPTARG
echo "ACCESS TOKEN: $curlAuth" >&2
#echo " ACCESS TOKEN: $curlAuth" >&2
;;
d)
releaseDir=$OPTARG
echo "RELEASE OUTPUT DIRECTORY: $releaseDir" >&2
#echo " RELEASE OUTPUT DIRECTORY: $releaseDir" >&2
;;
\?)
echo "Invalid option: -$OPTARG" >&2
echo "Error: invalid option -$OPTARG => aborting" >&2
exit 1
;;
:)
echo "Option -$OPTARG requires an argument." >&2
echo "Error: option -$OPTARG requires an argument => aborting" >&2
exit 1
;;
esac
done
# where we at?
echo
echo "Prequisite check:"
if [ -z "$TRAVIS_BUILD_DIR" ]; then
echo "Non-TravisCI environment"
echo " - non-TravisCI environment"
cd "$( dirname ${BASH_SOURCE[0]} )"/..
bTravisRun=0
else
echo "TravisCI run"
echo " - TravisCI run"
cd $TRAVIS_BUILD_DIR
bTravisRun=1
fi
# no tag, no love
if [ -z "$TRAVIS_TAG" ] && [ $bTravisRun -eq 1 ]; then
echo "Non-tagged builds not supported in Travis CI environment, exiting"
echo "Warning: non-tagged builds not supported in Travis CI environment => exiting"
exit 0
fi
currentDir=`pwd`
echo "Current working directory: $currentDir"
echo
echo "Package build settings:"
echo "======================="
srcdir=$currentDir
# source directory
srcdir=`pwd`
echo "Current working directory: ${srcdir}"
# target directory for actual release fileset
if [ -z "$releaseDir" ]; then
releaseDir=release
fi
echo "Release output directory: $releaseDir"
# get current branch name and commit hash
# Git versions, branch names, tags
branch_name=""
verx=""
extent=""
@ -132,15 +143,18 @@ extent=""
if [ -z "$TRAVIS_TAG" ]; then
branch_name=`git rev-parse --abbrev-ref HEAD 2>/dev/null`
ver=`sed -n -E 's/version=([0-9.]+)/\1/p' platform.txt`
verx=`git rev-parse --short=8 HEAD 2>/dev/null`
else
ver=$TRAVIS_TAG
fi
verx=`git rev-parse --short=8 HEAD 2>/dev/null`
# Package name resolving (case-insensitive):
# - unknown branch, master branch or branch in detached state (HEAD revision) use only the tag's name as version string (esp32-$TAG_NAME, eg 'esp32-1.0.0-RC1')
# - all other branches use long-version string (esp32-$BRANCH_NAME-$GITREV_NUMBER_SHORT, eg 'esp32-idf_update-cde668da')
# Package name (case-insensitive)
shopt -s nocasematch
if [ ! -z "$branch_name" ] && [ "$branch_name" != "master" ]; then
if [ ! -z "$branch_name" ] && [ "$branch_name" != "master" ] && [ "$branch_name" != "head" ]; then
extent="-$branch_name-$verx"
fi
@ -148,54 +162,56 @@ package_name=esp32-$ver$extent
shopt -u nocasematch
echo "Version: $ver"
echo "Branch name: $branch_name"
echo "Git revision (8B): $verx"
echo "Extension: $extent"
echo "Package version: $ver"
echo "Git branch name: $branch_name"
echo "Git revision number: $verx"
echo "Package name extension: $extent"
echo "Travis CI tag: $TRAVIS_TAG"
echo "Package name: $package_name"
echo "Release package name: $package_name"
# Set REMOTE_URL environment variable to the address where the package will be
# available for download. This gets written into package json file.
if [ -z "$REMOTE_URL" ]; then
REMOTE_URL="http://localhost:8000"
echo "REMOTE_URL not defined, using default"
remoteEchoOut="${REMOTE_URL} (REMOTE_URL variable not defined, using default)"
else
remoteEchoOut="${REMOTE_URL}"
fi
echo "Remote: $REMOTE_URL"
echo "Target URL for download (JSON incl): ${remoteEchoOut}"
# Create directory for the package
outdir=$releaseDir/$package_name
echo "Temporary output directory: $outdir"
echo "Local temp directory: $outdir"
rm -rf $releaseDir
mkdir -p $outdir
# Copy package required stuff:
# Copy files required for the package release:
echo
echo "Package build processing:"
echo "========================="
echo
echo "Prepare files for the package main archive:"
echo " - copying neccessary files from current Git repository..."
# <package root>
# <PACKAGE ROOT>
cp -f $srcdir/boards.txt $outdir/
cp -f $srcdir/platform.txt $outdir/
cp -f $srcdir/programmers.txt $outdir/
# <complete dirs>
# <COMPLETE DIRS>
# cores/
# libraries/
# variants/
# tools/partitions/
cp -Rf $srcdir/cores $outdir/
cp -Rf $srcdir/libraries $outdir/
cp -Rf $srcdir/variants $outdir/
mkdir -p $outdir/tools
cp -Rf $srcdir/tools/partitions $outdir/tools/
# <dir & files>
# tools/partitions/
mkdir -p $outdir/tools/partitions
cp -f $srcdir/tools/partitions/boot_app0.bin $outdir/tools/partitions
cp -f $srcdir/tools/partitions/default.csv $outdir/tools/partitions
cp -f $srcdir/tools/partitions/minimal.csv $outdir/tools/partitions
cp -f $srcdir/tools/partitions/min_spiffs.csv $outdir/tools/partitions
cp -f $srcdir/tools/partitions/no_ota.csv $outdir/tools/partitions
# <DIR & FILES>
# tools/sdk/
cp -Rf $srcdir/tools/sdk $outdir/tools/
@ -206,50 +222,51 @@ cp -f $srcdir/tools/esptool.py $outdir/tools/
cp -f $srcdir/tools/gen_esp32part.py $outdir/tools/
cp -f $srcdir/tools/gen_esp32part.exe $outdir/tools/
echo " - cleaning *.DS_Store files..."
find $outdir -name '*.DS_Store' -exec rm -f {} \;
# Do some replacements in platform.txt file, which are required because IDE
# handles tool paths differently when package is installed in hardware folder
echo " - updating platform.txt..."
cat $srcdir/platform.txt | \
sed "s/version=.*/version=$ver$extent/g" | \
sed 's/runtime.tools.xtensa-esp32-elf-gcc.path={runtime.platform.path}\/tools\/xtensa-esp32-elf//g' | \
sed 's/tools.esptool.path={runtime.platform.path}\/tools\/esptool/tools.esptool.path=\{runtime.tools.esptool.path\}/g' \
> $outdir/platform.txt
# Put core version and short hash of git version into core_version.h
ver_define=`echo $plain_ver | tr "[:lower:].\055" "[:upper:]_"`
echo Ver define: $ver_define
echo \#define ARDUINO_ESP32_GIT_VER 0x`git rev-parse --short=8 HEAD 2>/dev/null` >$outdir/cores/esp32/core_version.h
ver_define=`echo $ver | tr "[:lower:].\055" "[:upper:]_"`
echo " - generating C/C++ header defines ($ver_define -> /cores/esp32/core_version.h)..."
echo \#define ARDUINO_ESP32_GIT_VER 0x$verx >$outdir/cores/esp32/core_version.h
echo \#define ARDUINO_ESP32_GIT_DESC `git describe --tags 2>/dev/null` >>$outdir/cores/esp32/core_version.h
echo \#define ARDUINO_ESP32_RELEASE_$ver_define >>$outdir/cores/esp32/core_version.h
echo \#define ARDUINO_ESP32_RELEASE \"$ver_define\" >>$outdir/cores/esp32/core_version.h
# Store submodules' current versions
echo " - getting submodule list (${releaseDir}/submodules.txt)..."
git submodule status > $releaseDir/submodules.txt
# remove all .git* files
echo " - removing *.git files possibly fetched to package tempdir..."
find $outdir -name '*.git*' -type f -delete
# Zip the package
package_name_zip=$package_name.zip
echo "----------------------------------------------------------"
echo "Making $package_name ZIP archive..."
echo
echo " - creating package ZIP archive (${package_name_zip})..."
pushd $releaseDir >/dev/null
zip -qr $package_name_zip $package_name
if [ $? -ne 0 ]; then echo " !error: failed to create ${package_name_zip} (ZIP errno: $?) => aborting"; exit 1; fi
echo "----------------------------------------------------------"
echo "Making $package_name JSON definition file(s)..."
echo
# Calculate SHA sum and size
# Calculate SHA sum and size of ZIP archive
sha=`shasum -a 256 $package_name_zip | cut -f 1 -d ' '`
size=`/bin/ls -l $package_name_zip | awk '{print $5}'`
echo Size: $size
echo SHA-256: $sha
echo " ${package_name_zip} creation OK (size: $size, sha2: $sha)"
echo
echo "Making $package_name JSON definition file(s):"
popd >/dev/null
@ -261,20 +278,47 @@ shopt -s nocasematch
if [[ $TRAVIS_TAG == *-RC* ]]; then
bIsPrerelease=1
package_name_json=$PACKAGE_JSON_DEV
echo "Package type: PRE-RELEASE, JSON def.file: $PACKAGE_JSON_DEV"
echo " - package type: PRE-RELEASE, JSON def.file: $PACKAGE_JSON_DEV"
else
bIsPrerelease=0
package_name_json=$PACKAGE_JSON_REL
echo "Package type: RELEASE, JSON def.files: $PACKAGE_JSON_REL, $PACKAGE_JSON_DEV"
echo " - package type: RELEASE, JSON def.files: $PACKAGE_JSON_REL, $PACKAGE_JSON_DEV"
fi
shopt -u nocasematch
# Generate JSON package definition
echo
echo "----------------------------------------------------------"
echo "Preparing current package definition ($package_name_json)..."
# Cleanup temporary work dir
rm -rf $outdir
# JSON contents
# Get all previously released versions
echo " - fetching previous (pre)release versions from GitHub..."
set +e
releasesJson=$releaseDir/releases.json
curl -sH "Authorization: token $curlAuth" https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases > $releasesJson
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
prev_release=$(jq -e -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
prev_any_release=$(jq -e -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
prev_pre_release=$(jq -e -r '. | map(select(.draft == false and .prerelease == true)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
shopt -s nocasematch
if [ "$prev_any_release" == "$TRAVIS_TAG" ]; then
prev_release=$(jq -e -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name' ${releasesJson})
prev_any_release=$(jq -e -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name' ${releasesJson})
prev_pre_release=$(jq -e -r '. | map(select(.draft == false and .prerelease == true)) | sort_by(.created_at | - fromdateiso8601) | .[1].tag_name' ${releasesJson})
fi
shopt -u nocasematch
set -e
rm -f "$releasesJson"
echo " previous Release: $prev_release"
echo " previous (?Pre-)release: $prev_any_release"
echo " previous Pre-release: $prev_pre_release"
# add generated items to JSON package-definition contents
jq_arg=".packages[0].platforms[0].version = \"$ver\" | \
.packages[0].platforms[0].url = \"$REMOTE_URL/$package_name_zip\" |\
.packages[0].platforms[0].archiveFileName = \"$package_name_zip\""
@ -283,42 +327,13 @@ jq_arg="$jq_arg |\
.packages[0].platforms[0].size = \"$size\" |\
.packages[0].platforms[0].checksum = \"SHA-256:$sha\""
# Cleanup temporary work dir
rm -rf $outdir
# Get previous release name
echo
echo "----------------------------------------------------------"
echo "Getting previous releases versions..."
releasesJson=$releaseDir/releases.json
curl -sH "Authorization: token $curlAuth" https://api.github.com/repos/$TRAVIS_REPO_SLUG/releases > $releasesJson
# Previous final release (prerelase == false)
prev_release=$(jq -r '. | map(select(.draft == false and .prerelease == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
# Previous release (possibly a pre-release)
prev_any_release=$(jq -r '. | map(select(.draft == false)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
# Previous pre-release
prev_pre_release=$(jq -r '. | map(select(.draft == false and .prerelease == true)) | sort_by(.created_at | - fromdateiso8601) | .[0].tag_name' ${releasesJson})
rm -f "$releasesJson"
echo "Previous release: $prev_release"
echo "Previous (pre-?)release: $prev_any_release"
echo "Previous pre-release: $prev_pre_release"
# always get DEV version of JSON (included in both RC/REL)
echo
echo "----------------------------------------------------------"
echo "Generating $PACKAGE_JSON_DEV..."
echo
pkgJsonDev=$releaseDir/$PACKAGE_JSON_DEV
echo " - generating/merging _DEV_ JSON file (${pkgJsonDev})..."
cat $srcdir/package/package_esp32_index.template.json | jq "$jq_arg" > $releaseDir/$PACKAGE_JSON_DEV
cat $srcdir/package/package_esp32_index.template.json | jq "$jq_arg" > $pkgJsonDev
if [ ! -z "$prev_any_release" ] && [ "$prev_any_release" != "null" ]; then
downloadAndMergePackageJSON "https://github.com/$TRAVIS_REPO_SLUG/releases/download/${prev_any_release}/${PACKAGE_JSON_DEV}" "$releaseDir/${PACKAGE_JSON_DEV}" "${curlAuth}" "$releaseDir"
downloadAndMergePackageJSON "https://github.com/$TRAVIS_REPO_SLUG/releases/download/${prev_any_release}/${PACKAGE_JSON_DEV}" "${pkgJsonDev}" "${curlAuth}" "$releaseDir"
# Release notes: GIT log comments (prev_any_release, current_release>
git log --oneline $prev_any_release.. > $releaseDir/commits.txt
@ -327,14 +342,12 @@ fi
# for RELEASE run update REL JSON as well
if [ $bIsPrerelease -eq 0 ]; then
echo
echo "----------------------------------------------------------"
echo "Generating $PACKAGE_JSON_REL..."
echo
pkgJsonRel=$releaseDir/$PACKAGE_JSON_REL
echo " - generating/merging _REL_ JSON file (${pkgJsonRel})..."
cat $srcdir/package/package_esp32_index.template.json | jq "$jq_arg" > $releaseDir/$PACKAGE_JSON_REL
cat $srcdir/package/package_esp32_index.template.json | jq "$jq_arg" > $pkgJsonRel
if [ ! -z "$prev_release" ] && [ "$prev_release" != "null" ]; then
downloadAndMergePackageJSON "https://github.com/$TRAVIS_REPO_SLUG/releases/download/${prev_release}/${PACKAGE_JSON_REL}" "$releaseDir/${PACKAGE_JSON_REL}" "${curlAuth}" "$releaseDir"
downloadAndMergePackageJSON "https://github.com/$TRAVIS_REPO_SLUG/releases/download/${prev_release}/${PACKAGE_JSON_REL}" "${pkgJsonRel}" "${curlAuth}" "$releaseDir"
# Release notes: GIT log comments (prev_release, current_release>
git log --oneline $prev_release.. > $releaseDir/commits.txt
@ -342,7 +355,17 @@ if [ $bIsPrerelease -eq 0 ]; then
fi
echo
echo "=============================================================="
echo "Package '$package_name' ready for publishing, script finished."
echo "=============================================================="
echo "JSON definition file(s) creation OK"
echo
echo "==================================================================="
echo "Package preparation done ('$releaseDir' contents):"
fileset=`ls -1 $releaseDir`
echo -e $fileset
echo
echo "==================================================================="
echo "==================================================================="
echo "'$package_name' ready for publishing, processing completed."
echo "==================================================================="
echo

View File

@ -1,12 +1,9 @@
#!/bin/bash
# run cmake tests
tools/check_cmakelists.sh
if [ $? -ne 0 ]; then exit 1; fi
# run sketch tests
tools/build-tests.sh
if [ $? -ne 0 ]; then exit 1; fi
# zip the package if tagged build, otherwise finish here
tools/build-release.sh -a$ESP32_GITHUB_TOKEN
if [ ! -z "$TRAVIS_TAG" ]; then
# zip the package if tagged build
tools/build-release.sh -a$ESP32_GITHUB_TOKEN
else
# run cmake and sketch tests
tools/check_cmakelists.sh && tools/build-tests.sh
fi

View File

@ -46,6 +46,16 @@ while getopts ":t:,:a:,:s:,:p:,:f:,:d:" opt; do
esac
done
# use TravisCI env as default, if available
if [ -z $varTagName ] && [ ! -z $TRAVIS_TAG ]; then
varTagName=$TRAVIS_TAG
fi
if [ -z $varTagName ]; then
echo "No tag name available => aborting"
exit 1
fi
#Check tag name for release/prerelease (prerelease tag contains '_RC' as for release-candidate. case-insensitive)
shopt -s nocasematch
if [ -z $varPrerelease ]; then
@ -67,6 +77,10 @@ shopt -u nocasematch
# other lines: converted to bullets
# empty lines ignored
# if '* ' found as a first char pair, it's converted to '- ' to keep bulleting unified
echo Preparing release notes
echo -----------------------
echo "Tag's message:"
relNotesRaw=`git show -s --format=%b $varTagName`
readarray -t msgArray <<<"$relNotesRaw"
@ -83,12 +97,19 @@ if [ $arrLen > 3 ]; then
if [ "${oneLine:0:2}" == "* " ]; then oneLine=$(echo ${oneLine/\*/-}); fi
if [ "${oneLine:0:2}" != "- " ]; then releaseNotes+="- "; fi
releaseNotes+="$oneLine\\n"
#debug output
echo " ${oneLine}"
fi
fi
let ind=$ind+1
done
echo "<tag's message end>"
else
releaseNotes="#### Release of $varTagName\\n"
#debug output
echo " Release of $varTagName"
fi
# - list of commits (commits.txt must exit in the output dir)
@ -97,23 +118,57 @@ if [ -e "$commitFile" ]; then
releaseNotes+="\\n##### Commits\\n"
#debug output
echo
echo "Commits:"
IFS=$'\n'
for next in `cat $commitFile`
do
IFS=' ' read -r commitId commitMsg <<< "$next"
releaseNotes+="- [$commitId](https://github.com/$varRepoSlug/commit/$commitId) $commitMsg\\n"
#debug output
echo " - [$commitId](https://github.com/$varRepoSlug/commit/$commitId) $commitMsg"
done
rm -f $commitFile
fi
releaseNotes=$(perl -pe 's/\r?\n/\\n/' <<< ${releaseNotes})
#JSON parameters to create a new release
curlData="{\"tag_name\": \"$varTagName\",\"target_commitish\": \"master\",\"name\": \"v$varTagName\",\"body\": \"$releaseNotes\",\"draft\": false,\"prerelease\": $varPrerelease}"
# Check possibly existing release for current tag
echo "Checking for possible releases of current tag $varTagName..."
# (eg build invoked by Create New Release GHUI button -> GH default release pack created immediatelly including default assests)
HTTP_RESPONSE=$(curl -L --silent --write-out "HTTPSTATUS:%{http_code}" https://api.github.com/repos/$varRepoSlug/releases/tags/$varTagName?access_token=$varAccessToken)
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')
echo " HTTP server response code: $HTTP_STATUS"
#Create the release (initial source file assets created by GitHub)
releaseId=$(curl --data "$curlData" https://api.github.com/repos/$varRepoSlug/releases?access_token=$varAccessToken | jq -r '.id')
echo Release ID: $releaseId
# if the release exists, append/update recent files to its assets vector
if [ $HTTP_STATUS -eq 200 ]; then
releaseId=$(echo $HTTP_BODY | jq -r '.id')
echo " - $varTagName release found (id $releaseId)"
#merge release notes and overwrite pre-release flag. all other attributes remain unchanged
releaseNotesGH=$(echo $HTTP_BODY | jq -r '.body')
releaseNotes="$releaseNotesGH\\n$releaseNotes"
echo " ... updating release notes and pre-release flag"
curlData="{\"body\": \"$releaseNotes\",\"prerelease\": $varPrerelease}"
curl --data "$curlData" https://api.github.com/repos/$varRepoSlug/releases/$releaseId?access_token=$varAccessToken
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
#... or create a new release record
else
curlData="{\"tag_name\": \"$varTagName\",\"target_commitish\": \"master\",\"name\": \"v$varTagName\",\"body\": \"$releaseNotes\",\"draft\": false,\"prerelease\": $varPrerelease}"
#echo "DEBUG: curl --data \"${curlData}\" https://api.github.com/repos/${varRepoSlug}/releases?access_token=$varAccessToken | jq -r '.id'"
releaseId=$(curl --data "$curlData" https://api.github.com/repos/$varRepoSlug/releases?access_token=$varAccessToken | jq -r '.id')
echo " - new release created for $varTagName (id $releaseId)"
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
fi
# Assets defined by dir contents
if [ ! -z $varAssetsDir ]; then
@ -130,14 +185,22 @@ echo varAssets: $varAssets
#Upload additional assets
if [ ! -z $varAssets ]; then
echo
echo "Uploading assets:"
echo "-----------------"
curlAuth="Authorization: token $varAccessToken"
for filename in $(echo $varAssets | tr ";" "\n")
do
echo
echo
echo Uploading $filename...
echo " - ${filename}..."
curl -X POST -sH "$curlAuth" -H "Content-Type: application/octet-stream" --data-binary @"$filename" https://uploads.github.com/repos/$varRepoSlug/releases/$releaseId/assets?name=$(basename $filename)
if [ $? -ne 0 ]; then echo "FAILED: $? => aborting"; exit 1; fi
echo
echo "OK"
echo
done
fi

Binary file not shown.

View File

@ -190,7 +190,6 @@
#define CONFIG_LOG_BOOTLOADER_LEVEL 0
#define CONFIG_MBEDTLS_TLS_ENABLED 1
#define CONFIG_LWIP_MAX_RAW_PCBS 16
#define CONFIG_SPIRAM_IGNORE_NOTFOUND 1
#define CONFIG_SMP_ENABLE 1
#define CONFIG_SPIRAM_SIZE 4194304
#define CONFIG_MBEDTLS_SSL_SESSION_TICKETS 1
@ -228,6 +227,7 @@
#define CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED 1
#define CONFIG_MONITOR_BAUD 115200
#define CONFIG_ESP32_DEBUG_STUBS_ENABLE 1
#define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST 1
#define CONFIG_FREERTOS_CORETIMER_0 1
#define CONFIG_PARTITION_TABLE_CUSTOM_FILENAME "partitions.csv"
#define CONFIG_MBEDTLS_HAVE_TIME 1
@ -238,12 +238,10 @@
#define CONFIG_ADC_CAL_EFUSE_VREF_ENABLE 1
#define CONFIG_MBEDTLS_TLS_SERVER 1
#define CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT 1
#define CONFIG_SPIRAM_BOOT_INIT 1
#define CONFIG_FREERTOS_ISR_STACKSIZE 1536
#define CONFIG_CLASSIC_BT_ENABLED 1
#define CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK 1
#define CONFIG_OPENSSL_ASSERT_DO_NOTHING 1
#define CONFIG_SPIRAM_MEMTEST 1
#define CONFIG_WL_SECTOR_SIZE_4096 1
#define CONFIG_OPTIMIZATION_LEVEL_DEBUG 1
#define CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED 1

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -217,17 +217,15 @@ CONFIG_SPIRAM_SUPPORT=y
#
# SPI RAM config
#
CONFIG_SPIRAM_BOOT_INIT=y
CONFIG_SPIRAM_IGNORE_NOTFOUND=y
CONFIG_SPIRAM_BOOT_INIT=
CONFIG_SPIRAM_USE_MEMMAP=
CONFIG_SPIRAM_USE_CAPS_ALLOC=y
CONFIG_SPIRAM_USE_MALLOC=
CONFIG_SPIRAM_TYPE_ESPPSRAM32=y
CONFIG_SPIRAM_SIZE=4194304
CONFIG_SPIRAM_SPEED_40M=y
CONFIG_SPIRAM_MEMTEST=y
CONFIG_SPIRAM_CACHE_WORKAROUND=y
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=
CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST=y
CONFIG_MEMMAP_TRACEMEM=
CONFIG_MEMMAP_TRACEMEM_TWOBANKS=
CONFIG_ESP32_TRAX=

View File

@ -0,0 +1,61 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 18
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
#define digitalPinHasPWM(p) (p < 34)
static const uint8_t LED_BUILTIN = 0; // ->2812 RGB !!!
#define BUILTIN_LED LED_BUILTIN // backward compatibility
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t SDA = 12;
static const uint8_t SCL = 13;
static const uint8_t SS = 2;
static const uint8_t MOSI = 22;
static const uint8_t MISO = 37;
static const uint8_t SCK = 13;
static const uint8_t A0 = 36;
static const uint8_t A1 = 37;
static const uint8_t A2 = 38;
static const uint8_t A3 = 39;
static const uint8_t A4 = 32;
static const uint8_t A5 = 33;
static const uint8_t A6 = 34;
static const uint8_t A7 = 35;
static const uint8_t A10 = 4;
static const uint8_t A11 = 0;
static const uint8_t A12 = 2;
static const uint8_t A13 = 15;
static const uint8_t A14 = 13;
static const uint8_t A15 = 12;
static const uint8_t A16 = 14;
static const uint8_t A17 = 27;
static const uint8_t A18 = 25;
static const uint8_t A19 = 26;
static const uint8_t T0 = 4;
static const uint8_t T1 = 0;
static const uint8_t T2 = 2;
static const uint8_t T3 = 15;
static const uint8_t T4 = 13;
static const uint8_t T5 = 12;
static const uint8_t T6 = 14;
static const uint8_t T7 = 27;
static const uint8_t T8 = 33;
static const uint8_t T9 = 32;
static const uint8_t DAC1 = 25;
static const uint8_t DAC2 = 26;
#endif /* Pins_Arduino_h */

View File

@ -0,0 +1,28 @@
#ifndef Pins_Arduino_h
#define Pins_Arduino_h
#include <stdint.h>
#define EXTERNAL_NUM_INTERRUPTS 16
#define NUM_DIGITAL_PINS 40
#define NUM_ANALOG_INPUTS 16
#define analogInputToDigitalPin(p) (((p)<20)?(esp32_adc2gpio[(p)]):-1)
#define digitalPinToInterrupt(p) (((p)<40)?(p):-1)
#define digitalPinHasPWM(p) (p < 34)
static const uint8_t LED_BUILTIN = 27;
#define BUILTIN_LED LED_BUILTIN // backward compatibility
static const uint8_t TX = 1;
static const uint8_t RX = 3;
static const uint8_t SDA = 21;
static const uint8_t SCL = 22;
static const uint8_t SS = 5;
static const uint8_t MOSI = 23;
static const uint8_t MISO = 19;
static const uint8_t SCK = 18;
#endif /* Pins_Arduino_h */