Skip to content

Commit a59eafb

Browse files
authored
Update IDF to aaf1239 (espressif#1539)
* fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * Initial add of @stickbreaker i2c * Add log_n * fix warnings when log is off * i2c code clean up and reorganization * add flags to interrupt allocator * fix sdmmc config * Fix warnings in EEPROM from @Curclamas * remove leftover TAG in EEPROM * fix errors with latest IDF * fix debug optimization (espressif#1365) incorrect optimization for debugging tick markers. * Fix some missing BT header * Change BTSerial log calls * Update BLE lib * Arduino-ESP32 release management scripted (espressif#1515) * Calculate an absolute path for a custom partitions table (espressif#1452) * * Arduino-ESP32 release management scripted (ready-to-merge) * * secure env for espressif/arduino-esp32 * * build tests enabled * gitter webhook enabled * * gitter room link fixed * better comment * * filepaths fixed * BT Serial adjustments * * don't run sketch builds & tests for tagged builds * Return false from WiFi.hostByName() if hostname is not resolved * Free BT Memory when BT is not used * WIFI_MODE_NULL is not supported anymore * Select some key examples to build with PlatformIO to save some time * Update BLE lib * Fixed BLE lib * Major WiFi overhaul - auto reconnect on connection loss now works - moved to event groups - some code clean up and procedure optimizations - new methods to get a more elaborate system ststus * Add cmake tests to travis * Add initial AsyncUDP * Add NetBIOS lib and fix CMake includes * Add Initial WebServer * Fix WebServer and examples * travis not quiting on build fail * Try different travis build * Update IDF to aaf1239 * Fix WPS Example * fix script permission and add some fail tests to sketch builder * Add missing space in WiFiClient::write(Stream &stream)
1 parent 7abd586 commit a59eafb

File tree

626 files changed

+39590
-16692
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

626 files changed

+39590
-16692
lines changed

.travis.yml

+16-38
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,30 @@ python:
77
os:
88
- linux
99

10+
env:
11+
global:
12+
- secure: "l/4Dt+KQ/mACtGAHDUsPr66fUte840PZoQ4xpPikqWZI0uARu4l+Ym7+sHinnT6fBqrj8AJeBYGz4nFa8NK4LutZn9mSD40w+sxl0wSV4oHV8rzKe3Cd8+sMG3+o33yWoikMNjSvqa73Q0rm+SgrlInNdZbuAyixL+a2alaWSnGPm4F2xwUGj+S33TOy5P/Xp77CYtCV5S8vzyk/eEdNhoF0GYePJVdfuzCOUjXMyT5OWxORkzzQ7Hnn/Ka/RDfV8Si4HgujLQBrK5q6iPnNBFqBSqilYBepSMn4opnOBpIm0SCgePz7XQEFC83buA7GUcnCnfg38bf+dCwHaODf1d1PmqVRYt2QmfinexXtM4afAtL0iBUDtvrfnXHzwW9w82VeZhpbJSVh9DUQvB0IlsZeCz9J9PUBAi3N+SMX+9l+BomYwRUlPuKY+Ef2JKk9q6mxtUkky5R0daAlVxEhpVdQks1rT+T+NMoDMemxQ3SKEiqAHh6EgHecruszffmZ71uLX9MpERpew0qN+UFiafws+jkTjx+3yF9yut0Hf9sMbeAYzzkGzRqJTUEBJ6B29Cql8M0yRXCNN/8wuuTHhG8esstozga4ZQoIVrq7mEAgup376PTcNfr1+imbbWVQ7lJdYIuDe6OS5V3OX6np11vgK/DbhfyzvQv9Z1zAGnM="
13+
- REMOTE_URL=https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG
14+
1015
script:
11-
#- set -e
12-
- echo -e "travis_fold:start:sketch_test_env_prepare"
13-
- pip install pyserial
14-
- wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
15-
- tar xf arduino.tar.xz
16-
- mv arduino-nightly $HOME/arduino_ide
17-
- mkdir -p $HOME/Arduino/libraries
18-
- cd $HOME/arduino_ide/hardware
19-
- mkdir espressif
20-
- cd espressif
21-
- ln -s $TRAVIS_BUILD_DIR esp32
22-
- cd esp32
23-
- git submodule update --init --recursive
24-
- cd tools
25-
- python get.py
26-
- export PATH="$HOME/arduino_ide:$TRAVIS_BUILD_DIR/tools/xtensa-esp32-elf/bin:$PATH"
27-
- which arduino
28-
- cd $TRAVIS_BUILD_DIR
29-
- source tools/common.sh
30-
- echo -e "travis_fold:end:sketch_test_env_prepare"
31-
- echo -e "travis_fold:start:sketch_test"
32-
- build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries"
33-
- echo -e "travis_fold:end:sketch_test"
34-
- echo -e "travis_fold:start:size_report"
35-
- cat size.log
36-
- echo -e "travis_fold:end:size_report"
16+
- bash $TRAVIS_BUILD_DIR/tools/build.sh
17+
18+
deploy:
19+
provider: script
20+
skip_cleanup: true
21+
script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease
22+
23+
on:
24+
tags: true
3725

38-
# test library examples with PlatformIO
39-
- echo -e "travis_fold:start:platformio_test_env_prepare"
40-
- pip install -U https://github.com/platformio/platformio/archive/develop.zip
41-
- platformio platform install https://github.com/platformio/platform-espressif32.git#feature/stage
42-
- sed -i 's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/' ~/.platformio/platforms/espressif32/platform.json
43-
- ln -s $TRAVIS_BUILD_DIR ~/.platformio/packages/framework-arduinoespressif32
44-
- echo -e "travis_fold:end:platformio_test_env_prepare"
45-
- echo -e "travis_fold:start:platformio_test"
46-
- "python -c \"import glob,os,subprocess,sys; map(lambda p: (sys.stdout.write('Library example: %s\\n' % p), subprocess.call(['pio', 'ci', p, '--board', 'esp32dev'])), set([os.path.dirname(p) for p in glob.glob('libraries/*/examples/*/*.ino') + glob.glob('libraries/*/examples/*/*/*.ino')]))\""
47-
- echo -e "travis_fold:end:platformio_test"
4826

4927
notifications:
5028
email:
5129
on_success: change
5230
on_failure: change
5331
webhooks:
5432
urls:
55-
- https://webhooks.gitter.im/e/cb057279c430d91a47a8
33+
- https://webhooks.gitter.im/e/cb057279c430d91a47a8
5634
on_success: change # options: [always|never|change] default: always
5735
on_failure: always # options: [always|never|change] default: always
58-
on_start: false # default: false
36+
on_start: never # options: [always|never|change] default: always

CMakeLists.txt

+8
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ set(CORE_SRCS
3434

3535
set(LIBRARY_SRCS
3636
libraries/ArduinoOTA/src/ArduinoOTA.cpp
37+
libraries/AsyncUDP/src/AsyncUDP.cpp
3738
libraries/BluetoothSerial/src/BluetoothSerial.cpp
3839
libraries/DNSServer/src/DNSServer.cpp
3940
libraries/EEPROM/EEPROM.cpp
4041
libraries/ESPmDNS/src/ESPmDNS.cpp
4142
libraries/FS/src/FS.cpp
4243
libraries/FS/src/vfs_api.cpp
4344
libraries/HTTPClient/src/HTTPClient.cpp
45+
libraries/NetBIOS/src/NetBIOS.cpp
4446
libraries/Preferences/src/Preferences.cpp
4547
libraries/SD_MMC/src/SD_MMC.cpp
4648
libraries/SD/src/SD.cpp
@@ -51,6 +53,9 @@ set(LIBRARY_SRCS
5153
libraries/SPI/src/SPI.cpp
5254
libraries/Ticker/src/Ticker.cpp
5355
libraries/Update/src/Updater.cpp
56+
libraries/WebServer/src/WebServer.cpp
57+
libraries/WebServer/src/Parsing.cpp
58+
libraries/WebServer/src/detail/mimetable.cpp
5459
libraries/WiFiClientSecure/src/ssl_client.cpp
5560
libraries/WiFiClientSecure/src/WiFiClientSecure.cpp
5661
libraries/WiFi/src/ETH.cpp
@@ -162,6 +167,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
162167
variants/esp32/
163168
cores/esp32/
164169
libraries/ArduinoOTA/src
170+
libraries/AsyncUDP/src
165171
libraries/AzureIoT/src
166172
libraries/BLE/src
167173
libraries/BluetoothSerial/src
@@ -170,6 +176,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
170176
libraries/ESPmDNS/src
171177
libraries/FS/src
172178
libraries/HTTPClient/src
179+
libraries/NetBIOS/src
173180
libraries/Preferences/src
174181
libraries/SD_MMC/src
175182
libraries/SD/src
@@ -178,6 +185,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
178185
libraries/SPI/src
179186
libraries/Ticker/src
180187
libraries/Update/src
188+
libraries/WebServer/src
181189
libraries/WiFiClientSecure/src
182190
libraries/WiFi/src
183191
libraries/Wire/src

cores/esp32/Server.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
class Server: public Print
2626
{
2727
public:
28-
virtual void begin() =0;
28+
virtual void begin(uint16_t port=0) =0;
2929
};
3030

3131
#endif

cores/esp32/WString.cpp

+28
Original file line numberDiff line numberDiff line change
@@ -881,3 +881,31 @@ float String::toFloat(void) const
881881
}
882882
return 0;
883883
}
884+
885+
886+
unsigned char String::equalsConstantTime(const String &s2) const {
887+
// To avoid possible time-based attacks present function
888+
// compares given strings in a constant time.
889+
if(len != s2.len)
890+
return 0;
891+
//at this point lengths are the same
892+
if(len == 0)
893+
return 1;
894+
//at this point lenghts are the same and non-zero
895+
const char *p1 = buffer;
896+
const char *p2 = s2.buffer;
897+
unsigned int equalchars = 0;
898+
unsigned int diffchars = 0;
899+
while(*p1) {
900+
if(*p1 == *p2)
901+
++equalchars;
902+
else
903+
++diffchars;
904+
++p1;
905+
++p2;
906+
}
907+
//the following should force a constant time eval of the condition without a compiler "logical shortcut"
908+
unsigned char equalcond = (equalchars == len);
909+
unsigned char diffcond = (diffchars == 0);
910+
return (equalcond & diffcond); //bitwise AND
911+
}

cores/esp32/WString.h

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ class String
212212
unsigned char operator <=(const String &rhs) const;
213213
unsigned char operator >=(const String &rhs) const;
214214
unsigned char equalsIgnoreCase(const String &s) const;
215+
unsigned char equalsConstantTime(const String &s) const;
215216
unsigned char startsWith(const String &prefix) const;
216217
unsigned char startsWith(const String &prefix, unsigned int offset) const;
217218
unsigned char endsWith(const String &suffix) const;

cores/esp32/esp32-hal-bt.c

+11-4
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,18 @@
1414

1515
#include "esp32-hal-bt.h"
1616

17-
#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
17+
#ifdef CONFIG_BT_ENABLED
1818

19+
bool btInUse(){ return true; }
1920

21+
#ifdef CONFIG_BLUEDROID_ENABLED
2022
#include "esp_bt.h"
21-
#include "esp_bt_defs.h"
22-
#include "esp_bt_main.h"
23+
24+
#ifdef CONFIG_CLASSIC_BT_ENABLED
25+
#define BT_MODE ESP_BT_MODE_BTDM
26+
#else
27+
#define BT_MODE ESP_BT_MODE_BLE
28+
#endif
2329

2430
bool btStarted(){
2531
return (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED);
@@ -35,7 +41,7 @@ bool btStart(){
3541
while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){}
3642
}
3743
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){
38-
if (esp_bt_controller_enable(ESP_BT_MODE_BTDM)) {
44+
if (esp_bt_controller_enable(BT_MODE)) {
3945
log_e("BT Enable failed");
4046
return false;
4147
}
@@ -81,4 +87,5 @@ bool btStop()
8187
return false;
8288
}
8389
#endif
90+
#endif
8491

0 commit comments

Comments
 (0)