Skip to content

Commit

Permalink
Update IDF to aaf1239 (#1539)
Browse files Browse the repository at this point in the history
* 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 (#1365)

incorrect optimization for debugging tick markers.

* Fix some missing BT header

* Change BTSerial log calls

* Update BLE lib

* Arduino-ESP32 release management scripted (#1515)

* Calculate an absolute path for a custom partitions table (#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)
  • Loading branch information
me-no-dev committed Jun 27, 2018
1 parent 7abd586 commit a59eafb
Show file tree
Hide file tree
Showing 626 changed files with 39,590 additions and 16,692 deletions.
54 changes: 16 additions & 38 deletions .travis.yml
Expand Up @@ -7,52 +7,30 @@ python:
os:
- linux

env:
global:
- 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="
- REMOTE_URL=https://github.com/$TRAVIS_REPO_SLUG/releases/download/$TRAVIS_TAG

script:
#- set -e
- echo -e "travis_fold:start:sketch_test_env_prepare"
- pip install pyserial
- wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-linux64.tar.xz
- tar xf arduino.tar.xz
- mv arduino-nightly $HOME/arduino_ide
- mkdir -p $HOME/Arduino/libraries
- cd $HOME/arduino_ide/hardware
- mkdir espressif
- cd espressif
- ln -s $TRAVIS_BUILD_DIR esp32
- cd esp32
- git submodule update --init --recursive
- cd tools
- python get.py
- export PATH="$HOME/arduino_ide:$TRAVIS_BUILD_DIR/tools/xtensa-esp32-elf/bin:$PATH"
- which arduino
- cd $TRAVIS_BUILD_DIR
- source tools/common.sh
- echo -e "travis_fold:end:sketch_test_env_prepare"
- echo -e "travis_fold:start:sketch_test"
- build_sketches $HOME/arduino_ide $TRAVIS_BUILD_DIR/libraries "-l $HOME/Arduino/libraries"
- echo -e "travis_fold:end:sketch_test"
- echo -e "travis_fold:start:size_report"
- cat size.log
- echo -e "travis_fold:end:size_report"
- bash $TRAVIS_BUILD_DIR/tools/build.sh

deploy:
provider: script
skip_cleanup: true
script: bash $TRAVIS_BUILD_DIR/tools/deploy.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease

on:
tags: true

# test library examples with PlatformIO
- echo -e "travis_fold:start:platformio_test_env_prepare"
- pip install -U https://github.com/platformio/platformio/archive/develop.zip
- platformio platform install https://github.com/platformio/platform-espressif32.git#feature/stage
- sed -i 's/https:\/\/github\.com\/espressif\/arduino-esp32\.git/*/' ~/.platformio/platforms/espressif32/platform.json
- ln -s $TRAVIS_BUILD_DIR ~/.platformio/packages/framework-arduinoespressif32
- echo -e "travis_fold:end:platformio_test_env_prepare"
- echo -e "travis_fold:start:platformio_test"
- "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')]))\""
- echo -e "travis_fold:end:platformio_test"

notifications:
email:
on_success: change
on_failure: change
webhooks:
urls:
- https://webhooks.gitter.im/e/cb057279c430d91a47a8
- https://webhooks.gitter.im/e/cb057279c430d91a47a8
on_success: change # options: [always|never|change] default: always
on_failure: always # options: [always|never|change] default: always
on_start: false # default: false
on_start: never # options: [always|never|change] default: always
8 changes: 8 additions & 0 deletions CMakeLists.txt
Expand Up @@ -34,13 +34,15 @@ set(CORE_SRCS

set(LIBRARY_SRCS
libraries/ArduinoOTA/src/ArduinoOTA.cpp
libraries/AsyncUDP/src/AsyncUDP.cpp
libraries/BluetoothSerial/src/BluetoothSerial.cpp
libraries/DNSServer/src/DNSServer.cpp
libraries/EEPROM/EEPROM.cpp
libraries/ESPmDNS/src/ESPmDNS.cpp
libraries/FS/src/FS.cpp
libraries/FS/src/vfs_api.cpp
libraries/HTTPClient/src/HTTPClient.cpp
libraries/NetBIOS/src/NetBIOS.cpp
libraries/Preferences/src/Preferences.cpp
libraries/SD_MMC/src/SD_MMC.cpp
libraries/SD/src/SD.cpp
Expand All @@ -51,6 +53,9 @@ set(LIBRARY_SRCS
libraries/SPI/src/SPI.cpp
libraries/Ticker/src/Ticker.cpp
libraries/Update/src/Updater.cpp
libraries/WebServer/src/WebServer.cpp
libraries/WebServer/src/Parsing.cpp
libraries/WebServer/src/detail/mimetable.cpp
libraries/WiFiClientSecure/src/ssl_client.cpp
libraries/WiFiClientSecure/src/WiFiClientSecure.cpp
libraries/WiFi/src/ETH.cpp
Expand Down Expand Up @@ -162,6 +167,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
variants/esp32/
cores/esp32/
libraries/ArduinoOTA/src
libraries/AsyncUDP/src
libraries/AzureIoT/src
libraries/BLE/src
libraries/BluetoothSerial/src
Expand All @@ -170,6 +176,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
libraries/ESPmDNS/src
libraries/FS/src
libraries/HTTPClient/src
libraries/NetBIOS/src
libraries/Preferences/src
libraries/SD_MMC/src
libraries/SD/src
Expand All @@ -178,6 +185,7 @@ set(COMPONENT_ADD_INCLUDEDIRS
libraries/SPI/src
libraries/Ticker/src
libraries/Update/src
libraries/WebServer/src
libraries/WiFiClientSecure/src
libraries/WiFi/src
libraries/Wire/src
Expand Down
2 changes: 1 addition & 1 deletion cores/esp32/Server.h
Expand Up @@ -25,7 +25,7 @@
class Server: public Print
{
public:
virtual void begin() =0;
virtual void begin(uint16_t port=0) =0;
};

#endif
28 changes: 28 additions & 0 deletions cores/esp32/WString.cpp
Expand Up @@ -881,3 +881,31 @@ float String::toFloat(void) const
}
return 0;
}


unsigned char String::equalsConstantTime(const String &s2) const {
// To avoid possible time-based attacks present function
// compares given strings in a constant time.
if(len != s2.len)
return 0;
//at this point lengths are the same
if(len == 0)
return 1;
//at this point lenghts are the same and non-zero
const char *p1 = buffer;
const char *p2 = s2.buffer;
unsigned int equalchars = 0;
unsigned int diffchars = 0;
while(*p1) {
if(*p1 == *p2)
++equalchars;
else
++diffchars;
++p1;
++p2;
}
//the following should force a constant time eval of the condition without a compiler "logical shortcut"
unsigned char equalcond = (equalchars == len);
unsigned char diffcond = (diffchars == 0);
return (equalcond & diffcond); //bitwise AND
}
1 change: 1 addition & 0 deletions cores/esp32/WString.h
Expand Up @@ -212,6 +212,7 @@ class String
unsigned char operator <=(const String &rhs) const;
unsigned char operator >=(const String &rhs) const;
unsigned char equalsIgnoreCase(const String &s) const;
unsigned char equalsConstantTime(const String &s) const;
unsigned char startsWith(const String &prefix) const;
unsigned char startsWith(const String &prefix, unsigned int offset) const;
unsigned char endsWith(const String &suffix) const;
Expand Down
15 changes: 11 additions & 4 deletions cores/esp32/esp32-hal-bt.c
Expand Up @@ -14,12 +14,18 @@

#include "esp32-hal-bt.h"

#if defined(CONFIG_BT_ENABLED) && defined(CONFIG_BLUEDROID_ENABLED)
#ifdef CONFIG_BT_ENABLED

bool btInUse(){ return true; }

#ifdef CONFIG_BLUEDROID_ENABLED
#include "esp_bt.h"
#include "esp_bt_defs.h"
#include "esp_bt_main.h"

#ifdef CONFIG_CLASSIC_BT_ENABLED
#define BT_MODE ESP_BT_MODE_BTDM
#else
#define BT_MODE ESP_BT_MODE_BLE
#endif

bool btStarted(){
return (esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_ENABLED);
Expand All @@ -35,7 +41,7 @@ bool btStart(){
while(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_IDLE){}
}
if(esp_bt_controller_get_status() == ESP_BT_CONTROLLER_STATUS_INITED){
if (esp_bt_controller_enable(ESP_BT_MODE_BTDM)) {
if (esp_bt_controller_enable(BT_MODE)) {
log_e("BT Enable failed");
return false;
}
Expand Down Expand Up @@ -81,4 +87,5 @@ bool btStop()
return false;
}
#endif
#endif

0 comments on commit a59eafb

Please sign in to comment.