Compare commits

...

11 Commits

Author SHA1 Message Date
80ea521940 Add support for 160MHz rated CPUs (#3135)
Some ESP32 chips are rated only to 160MHz. This change adds support for them and does not allow frequency to be switched to 240MHz
2019-09-05 12:30:43 +03:00
5c04de6f39 Fix packager 2019-09-05 11:22:40 +03:00
0d163a1ce2 Update IDF 3.2 to 7dd492319 + WiFi fix (#3177) 2019-09-05 11:08:45 +03:00
2a7e509978 Fix long Ticker period conversion: cast ms to uint64_t when calculating us (#3175)
* Fix long Ticker period conversion

* Simplify long Ticker period conversion fix by using 1000ULL
2019-09-05 10:34:47 +03:00
1b8c7e34f9 Try bash only examples build (#3164) 2019-09-01 18:45:55 +03:00
7a574399b1 Rework the sketch builder to match the IDE (#3146)
* Rework the sketch builder to match the IDE

* Link the board to the home folder

* Rename files for clarity

* move ci files to own subfolder

* Update Github CI to use the new script locations
2019-08-28 01:28:11 +03:00
fd089d8fd3 Pull in ESP8266 String::replace() fixes, others (#3143)
Pull in bugfixes from the ESP8266 repo for problems in the SSO
implementation of replace().  See the following patches for full
details:

54240d2cc5 (diff-8d9e71e16d437343017df828f0528f63)
78a1a66e6d (diff-8d9e71e16d437343017df828f0528f63)
4e9358445a (diff-8d9e71e16d437343017df828f0528f63)

Fixes #3140
2019-08-27 20:05:36 +03:00
f356ccd54a Added the pragma line to the top (#3139)
* Removed pragme in BLERemoteService.cpp

* Added the line at the top and changed to warning
2019-08-27 10:21:27 +03:00
6daf773464 Fix travis deploy generating bad json 2019-08-21 03:29:23 +03:00
70a896481d Update Both CIs to run parallel jobs (#3120) 2019-08-21 01:56:05 +03:00
390da0d090 bump CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM to improve RX performance (#3119) 2019-08-20 22:07:56 +03:00
97 changed files with 251 additions and 335 deletions

View File

@ -1,6 +1,11 @@
name: ESP32 Arduino CI
on: [pull_request]
on:
push:
branches:
- master
- release/*
pull_request:
jobs:
@ -13,18 +18,17 @@ jobs:
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
run: ./tools/ci/check-cmakelists.sh
- name: Install Arduino IDE
env:
ESP32_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
#ESP32_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 0 18
run: ./tools/ci/test-arduino-ide.sh 0 18
- name: Sketch Sizes
run: cat size.log
@ -36,17 +40,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 1 18
run: ./tools/ci/test-arduino-ide.sh 1 18
- name: Sketch Sizes
run: cat size.log
@ -58,17 +59,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 2 18
run: ./tools/ci/test-arduino-ide.sh 2 18
- name: Sketch Sizes
run: cat size.log
@ -80,17 +78,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 3 18
run: ./tools/ci/test-arduino-ide.sh 3 18
- name: Sketch Sizes
run: cat size.log
@ -102,17 +97,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 4 18
run: ./tools/ci/test-arduino-ide.sh 4 18
- name: Sketch Sizes
run: cat size.log
@ -124,17 +116,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 5 18
run: ./tools/ci/test-arduino-ide.sh 5 18
- name: Sketch Sizes
run: cat size.log
@ -146,17 +135,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 6 18
run: ./tools/ci/test-arduino-ide.sh 6 18
- name: Sketch Sizes
run: cat size.log
@ -168,17 +154,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 7 18
run: ./tools/ci/test-arduino-ide.sh 7 18
- name: Sketch Sizes
run: cat size.log
@ -190,17 +173,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 8 18
run: ./tools/ci/test-arduino-ide.sh 8 18
- name: Sketch Sizes
run: cat size.log
@ -212,17 +192,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 9 18
run: ./tools/ci/test-arduino-ide.sh 9 18
- name: Sketch Sizes
run: cat size.log
@ -234,17 +211,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 10 18
run: ./tools/ci/test-arduino-ide.sh 10 18
- name: Sketch Sizes
run: cat size.log
@ -256,17 +230,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 11 18
run: ./tools/ci/test-arduino-ide.sh 11 18
- name: Sketch Sizes
run: cat size.log
@ -278,17 +249,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 12 18
run: ./tools/ci/test-arduino-ide.sh 12 18
- name: Sketch Sizes
run: cat size.log
@ -300,17 +268,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 13 18
run: ./tools/ci/test-arduino-ide.sh 13 18
- name: Sketch Sizes
run: cat size.log
@ -322,17 +287,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 14 18
run: ./tools/ci/test-arduino-ide.sh 14 18
- name: Sketch Sizes
run: cat size.log
@ -344,17 +306,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 15 18
run: ./tools/ci/test-arduino-ide.sh 15 18
- name: Sketch Sizes
run: cat size.log
@ -366,17 +325,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 16 18
run: ./tools/ci/test-arduino-ide.sh 16 18
- name: Sketch Sizes
run: cat size.log
@ -388,17 +344,14 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-arduino-ide.sh
run: ./tools/ci/prep-arduino-ide.sh
- name: Test Arduino IDE
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/test-arduino-ide.sh 17 18
run: ./tools/ci/test-arduino-ide.sh 17 18
- name: Sketch Sizes
run: cat size.log
@ -411,9 +364,6 @@ jobs:
- uses: actions/checkout@v1
- name: Pull submodules
run: git submodule update --init --recursive
- name: Run CMake Check
run: ./tools/check_cmakelists.sh
- name: Install Python Wheel
run: pip install wheel
- name: Install GCC Toolchain
@ -421,6 +371,6 @@ jobs:
- name: Install PlatformIO
env:
TRAVIS_BUILD_DIR: ${{ github.workspace }}
run: ./tools/prep-platformio.sh
run: ./tools/ci/prep-platformio.sh
- name: Test PlatformIO
run: ./tools/test-platformio.sh
run: ./tools/ci/test-platformio.sh

View File

@ -1,8 +1,6 @@
sudo: false
language: python
python:
- "2.7"
os:
- linux
@ -10,22 +8,55 @@ os:
git:
depth: false
env:
global:
before_install:
- git submodule update --init --recursive
stages:
- build
- deploy
jobs:
include:
- name: "Build Arduino 0"
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
stage: build
script: $TRAVIS_BUILD_DIR/tools/ci/build-tests.sh 0 4
- name: "Build Arduino 1"
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
stage: build
script: $TRAVIS_BUILD_DIR/tools/ci/build-tests.sh 1 4
- name: "Build Arduino 2"
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
stage: build
script: $TRAVIS_BUILD_DIR/tools/ci/build-tests.sh 2 4
- name: "Build Arduino 3"
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
stage: build
script: $TRAVIS_BUILD_DIR/tools/ci/build-tests.sh 3 4
- name: "Build PlatformIO"
if: tag IS blank AND (type = pull_request OR (type = push AND branch = master))
stage: build
script: $TRAVIS_BUILD_DIR/tools/ci/build-tests.sh 4 4
- name: "Package & Deploy"
if: tag IS present
stage: deploy
env:
- 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:
- 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
script: bash $TRAVIS_BUILD_DIR/tools/ci/build-release.sh -a$ESP32_GITHUB_TOKEN
before_deploy: git submodule update --init
deploy:
- provider: script
skip_cleanup: true
script: bash $TRAVIS_BUILD_DIR/tools/ci/deploy-release.sh -t$TRAVIS_TAG -a$ESP32_GITHUB_TOKEN -s$TRAVIS_REPO_SLUG -drelease
on:
tags: true
notifications:
email:

View File

@ -31,7 +31,7 @@
String::String(const char *cstr) {
init();
if(cstr)
if (cstr)
copy(cstr, strlen(cstr));
}
@ -136,7 +136,7 @@ inline void String::init(void) {
}
void String::invalidate(void) {
if(!sso() && wbuffer())
if(!isSSO() && wbuffer())
free(wbuffer());
init();
}
@ -154,17 +154,21 @@ unsigned char String::reserve(unsigned int size) {
unsigned char String::changeBuffer(unsigned int maxStrLen) {
// Can we use SSO here to avoid allocation?
if (maxStrLen < sizeof(sso_buf)) {
if (sso() || !buffer()) {
if (maxStrLen < sizeof(sso.buff) - 1) {
if (isSSO() || !buffer()) {
// Already using SSO, nothing to do
uint16_t oldLen = len();
setSSO(true);
setLen(oldLen);
return 1;
} else { // if bufptr && !sso()
// Using bufptr, need to shrink into sso_buff
char temp[sizeof(sso_buf)];
} else { // if bufptr && !isSSO()
// Using bufptr, need to shrink into sso.buff
char temp[sizeof(sso.buff)];
memcpy(temp, buffer(), maxStrLen);
free(wbuffer());
uint16_t oldLen = len();
setSSO(true);
setLen(oldLen);
memcpy(wbuffer(), temp, maxStrLen);
return 1;
}
@ -176,12 +180,12 @@ unsigned char String::changeBuffer(unsigned int maxStrLen) {
return false;
}
uint16_t oldLen = len();
char *newbuffer = (char *) realloc(sso() ? nullptr : wbuffer(), newSize);
if(newbuffer) {
char *newbuffer = (char *) realloc(isSSO() ? nullptr : wbuffer(), newSize);
if (newbuffer) {
size_t oldSize = capacity() + 1; // include NULL.
if (sso()) {
if (isSSO()) {
// Copy the SSO buffer into allocated space
memcpy(newbuffer, sso_buf, sizeof(sso_buf));
memmove(newbuffer, sso.buff, sizeof(sso.buff));
}
if (newSize > oldSize)
{
@ -206,7 +210,7 @@ String & String::copy(const char *cstr, unsigned int length) {
return *this;
}
setLen(length);
strcpy(wbuffer(), cstr);
memmove(wbuffer(), cstr, length + 1);
return *this;
}
@ -216,7 +220,7 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length) {
return *this;
}
setLen(length);
strcpy_P(wbuffer(), (PGM_P)pstr);
memcpy_P(wbuffer(), (PGM_P)pstr, length + 1); // We know wbuffer() cannot ever be in PROGMEM, so memcpy safe here
return *this;
}
@ -224,20 +228,20 @@ String & String::copy(const __FlashStringHelper *pstr, unsigned int length) {
void String::move(String &rhs) {
if(buffer()) {
if(capacity() >= rhs.len()) {
strcpy(wbuffer(), rhs.buffer());
memmove(wbuffer(), rhs.buffer(), rhs.length() + 1);
setLen(rhs.len());
rhs.invalidate();
return;
} else {
if (!sso()) {
if (!isSSO()) {
free(wbuffer());
setBuffer(nullptr);
}
}
}
if (rhs.sso()) {
if (rhs.isSSO()) {
setSSO(true);
memmove(sso_buf, rhs.sso_buf, sizeof(sso_buf));
memmove(sso.buff, rhs.sso.buff, sizeof(sso.buff));
} else {
setSSO(false);
setBuffer(rhs.wbuffer());
@ -309,7 +313,7 @@ unsigned char String::concat(const String &s) {
return 1;
if (!reserve(newlen))
return 0;
memcpy(wbuffer() + len(), buffer(), len());
memmove(wbuffer() + len(), buffer(), len());
setLen(newlen);
wbuffer()[len()] = 0;
return 1;
@ -326,7 +330,12 @@ unsigned char String::concat(const char *cstr, unsigned int length) {
return 1;
if(!reserve(newlen))
return 0;
strcpy(wbuffer() + len(), cstr);
if (cstr >= wbuffer() && cstr < wbuffer() + len())
// compatible with SSO in ram #6155 (case "x += x.c_str()")
memmove(wbuffer() + len(), cstr, length + 1);
else
// compatible with source in flash #6367
memcpy_P(wbuffer() + len(), cstr, length + 1);
setLen(newlen);
return 1;
}
@ -392,7 +401,7 @@ unsigned char String::concat(const __FlashStringHelper * str) {
if (length == 0) return 1;
unsigned int newlen = len() + length;
if (!reserve(newlen)) return 0;
strcpy_P(wbuffer() + len(), (PGM_P)str);
memcpy_P(wbuffer() + len(), (PGM_P)str, length + 1);
setLen(newlen);
return 1;
}

View File

@ -83,6 +83,12 @@ class String {
return 0;
}
}
inline void clear(void) {
setLen(0);
}
inline bool isEmpty(void) const {
return length() == 0;
}
// creates a copy of the assigned value. if the value is null or
// invalid, or if the memory allocation fails, the string will be
@ -99,7 +105,7 @@ class String {
// returns true on success, false on failure (in which case, the string
// is left unchanged). if the argument is null or invalid, the
// concatenation is considered unsucessful.
// concatenation is considered unsuccessful.
unsigned char concat(const String &str);
unsigned char concat(const char *cstr);
unsigned char concat(char c);
@ -200,7 +206,7 @@ class String {
unsigned char startsWith(const String &prefix, unsigned int offset) const;
unsigned char endsWith(const String &suffix) const;
// character acccess
// character access
char charAt(unsigned int index) const;
void setCharAt(unsigned int index, char c);
char operator [](unsigned int index) const;
@ -251,27 +257,29 @@ class String {
uint16_t cap;
uint16_t len;
};
// SSO is handled by checking the last byte of sso_buff.
// When not in SSO mode, that byte is set to 0xff, while when in SSO mode it is always 0x00 (so it can serve as the string terminator as well as a flag)
// This allows strings up up to 12 (11 + \0 termination) without any extra space.
enum { SSOSIZE = sizeof(struct _ptr) + 4 }; // Characters to allocate space for SSO, must be 12 or more
enum { CAPACITY_MAX = 65535 }; // If size of capacity changed, be sure to update this enum
// This allows strings up up to 11 (10 + \0 termination) without any extra space.
enum { SSOSIZE = sizeof(struct _ptr) + 4 - 1 }; // Characters to allocate space for SSO, must be 12 or more
struct _sso {
char buff[SSOSIZE];
unsigned char len : 7; // Ensure only one byte is allocated by GCC for the bitfields
unsigned char isSSO : 1;
} __attribute__((packed)); // Ensure that GCC doesn't expand the flag byte to a 32-bit word for alignment issues
enum { CAPACITY_MAX = 65535 }; // If typeof(cap) changed from uint16_t, be sure to update this enum to the max value storable in the type
union {
struct _ptr ptr;
char sso_buf[SSOSIZE];
struct _sso sso;
};
// Accessor functions
inline bool sso() const { return sso_buf[SSOSIZE - 1] == 0; }
inline unsigned int len() const { return sso() ? strlen(sso_buf) : ptr.len; }
inline unsigned int capacity() const { return sso() ? SSOSIZE - 1 : ptr.cap; }
inline void setSSO(bool sso) { sso_buf[SSOSIZE - 1] = sso ? 0x00 : 0xff; }
inline void setLen(int len) { if (!sso()) ptr.len = len; }
inline void setCapacity(int cap) { if (!sso()) ptr.cap = cap; }
inline void setBuffer(char *buff) { if (!sso()) ptr.buff = buff; }
inline bool isSSO() const { return sso.isSSO; }
inline unsigned int len() const { return isSSO() ? sso.len : ptr.len; }
inline unsigned int capacity() const { return isSSO() ? (unsigned int)SSOSIZE - 1 : ptr.cap; } // Size of max string not including terminal NUL
inline void setSSO(bool set) { sso.isSSO = set; }
inline void setLen(int len) { if (isSSO()) sso.len = len; else ptr.len = len; }
inline void setCapacity(int cap) { if (!isSSO()) ptr.cap = cap; }
inline void setBuffer(char *buff) { if (!isSSO()) ptr.buff = buff; }
// Buffer accessor functions
inline const char *buffer() const { return (const char *)(sso() ? sso_buf : ptr.buff); }
inline char *wbuffer() const { return sso() ? const_cast<char *>(sso_buf) : ptr.buff; } // Writable version of buffer
inline const char *buffer() const { return (const char *)(isSSO() ? sso.buff : ptr.buff); }
inline char *wbuffer() const { return isSSO() ? const_cast<char *>(sso.buff) : ptr.buff; } // Writable version of buffer
protected:
void init(void);

View File

@ -23,6 +23,7 @@
#include "soc/rtc_cntl_reg.h"
#include "rom/rtc.h"
#include "soc/apb_ctrl_reg.h"
#include "soc/efuse_reg.h"
#include "esp32-hal.h"
#include "esp32-hal-cpu.h"
@ -150,6 +151,15 @@ bool setCpuFrequencyMhz(uint32_t cpu_freq_mhz){
}
return false;
}
//check if cpu supports the frequency
if(cpu_freq_mhz == 240){
//Check if ESP32 is rated for a CPU frequency of 160MHz only
if (REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_RATED) &&
REG_GET_BIT(EFUSE_BLK0_RDATA3_REG, EFUSE_RD_CHIP_CPU_FREQ_LOW)) {
log_e("Can not switch to 240 MHz! Chip CPU frequency rated for 160MHz.");
cpu_freq_mhz = 160;
}
}
//Get current CPU clock configuration
rtc_clk_cpu_freq_get_config(&cconf);
//return if frequency has not changed

View File

@ -14,6 +14,8 @@
#include <esp_err.h>
#include "esp32-hal-log.h"
#pragma GCC diagnostic warning "-Wunused-but-set-parameter"
BLERemoteService::BLERemoteService(
esp_gatt_id_t srvcId,
BLEClient* pClient,
@ -228,7 +230,6 @@ std::map<std::string, BLERemoteCharacteristic*>* BLERemoteService::getCharacteri
* @brief This function is designed to get characteristics map when we have multiple characteristics with the same UUID
*/
void BLERemoteService::getCharacteristics(std::map<uint16_t, BLERemoteCharacteristic*>* pCharacteristicMap) {
#pragma GCC diagnostic ignored "-Wunused-but-set-parameter"
pCharacteristicMap = &m_characteristicMapByHandle;
} // Get the characteristics map.

View File

@ -43,9 +43,9 @@ void Ticker::_attach_ms(uint32_t milliseconds, bool repeat, callback_with_arg_t
}
esp_timer_create(&_timerConfig, &_timer);
if (repeat) {
esp_timer_start_periodic(_timer, milliseconds * 1000);
esp_timer_start_periodic(_timer, milliseconds * 1000ULL);
} else {
esp_timer_start_once(_timer, milliseconds * 1000);
esp_timer_start_once(_timer, milliseconds * 1000ULL);
}
}

6
package/merge_packages.py Normal file → Executable file
View File

@ -36,7 +36,11 @@ def pkgVersionNormalized(versionString):
verParts = re.split('\.|-rc', verStr, flags=re.IGNORECASE)
if len(verParts) == 3:
verStr = str(versionString) + '-rc' + str(sys.maxint)
if (sys.version_info > (3, 0)): # Python 3
verStr = str(versionString) + '-rc' + str(sys.maxsize)
else: # Python 2
verStr = str(versionString) + '-rc' + str(sys.maxint)
elif len(verParts) != 4:
print("pkgVersionNormalized WARNING: unexpected version format: {0})".format(verStr), file=sys.stderr)

View File

@ -1,33 +0,0 @@
#!/bin/bash
# CMake Test
echo -e "travis_fold:start:check_cmakelists"
tools/check_cmakelists.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:check_cmakelists"
# ArduinoIDE Test
echo -e "travis_fold:start:prep_arduino_ide"
tools/prep-arduino-ide.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:prep_arduino_ide"
echo -e "travis_fold:start:test_arduino_ide"
tools/test-arduino-ide.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:test_arduino_ide"
echo -e "travis_fold:start:size_report"
cat size.log
echo -e "travis_fold:end:size_report"
# PlatformIO Test
echo -e "travis_fold:start:prep_platformio"
tools/prep-platformio.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:prep_platformio"
echo -e "travis_fold:start:test_platformio"
tools/test-platformio.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:test_platformio"

View File

@ -1,131 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# build.py — build a sketch using arduino-builder
#
# Wrapper script around arduino-builder which accepts some ESP8266-specific
# options and translates them into FQBN
#
# Copyright © 2016 Ivan Grokhotkov
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
#
from __future__ import print_function
import sys
import os
import argparse
import subprocess
import tempfile
import shutil
def compile(tmp_dir, sketch, tools_dir, hardware_dir, ide_path, f, args):
cmd = ide_path + '/arduino-builder '
cmd += '-compile -logger=human '
cmd += '-build-path "' + tmp_dir + '" '
cmd += '-tools "' + ide_path + '/tools-builder" '
if args.library_path:
for lib_dir in args.library_path:
cmd += '-libraries "' + lib_dir + '" '
cmd += '-hardware "' + ide_path + '/hardware" '
if args.hardware_dir:
for hw_dir in args.hardware_dir:
cmd += '-hardware "' + hw_dir + '" '
else:
cmd += '-hardware "' + hardware_dir + '" '
# Debug=Serial,DebugLevel=Core____
cmd += '-fqbn=espressif:esp32:{board_name}:' \
'FlashFreq={flash_freq},' \
'PartitionScheme=huge_app,' \
'UploadSpeed=921600'.format(**vars(args))
cmd += ' '
cmd += '-ide-version=10607 '
cmd += '-warnings={warnings} '.format(**vars(args))
if args.verbose:
cmd += '-verbose '
cmd += sketch
if args.verbose:
print('Building: ' + cmd, file=f)
cmds = cmd.split(' ')
p = subprocess.Popen(cmds, stdout=f, stderr=subprocess.STDOUT)
p.wait()
return p.returncode
def parse_args():
parser = argparse.ArgumentParser(description='Sketch build helper')
parser.add_argument('-v', '--verbose', help='Enable verbose output',
action='store_true')
parser.add_argument('-i', '--ide_path', help='Arduino IDE path')
parser.add_argument('-p', '--build_path', help='Build directory')
parser.add_argument('-l', '--library_path', help='Additional library path',
action='append')
parser.add_argument('-d', '--hardware_dir', help='Additional hardware path',
action='append')
parser.add_argument('-b', '--board_name', help='Board name', default='esp32')
parser.add_argument('-w', '--warnings', help='Compilation warnings level',
default='none', choices=['none', 'all', 'more'])
parser.add_argument('-o', '--output_binary', help='File name for output binary')
parser.add_argument('-k', '--keep', action='store_true',
help='Don\'t delete temporary build directory')
parser.add_argument('--flash_freq', help='Flash frequency', default=40,
type=int, choices=[40, 80])
parser.add_argument('sketch_path', help='Sketch file path')
return parser.parse_args()
def main():
args = parse_args()
ide_path = args.ide_path
if not ide_path:
ide_path = os.environ.get('ARDUINO_IDE_PATH')
if not ide_path:
print("Please specify Arduino IDE path via --ide_path option"
"or ARDUINO_IDE_PATH environment variable.", file=sys.stderr)
return 2
sketch_path = args.sketch_path
tmp_dir = args.build_path
created_tmp_dir = False
if not tmp_dir:
tmp_dir = tempfile.mkdtemp()
created_tmp_dir = True
tools_dir = os.path.dirname(os.path.realpath(__file__)) + '/../tools'
# this is not the correct hardware folder to add.
hardware_dir = os.path.dirname(os.path.realpath(__file__)) + '/../cores'
output_name = tmp_dir + '/' + os.path.basename(sketch_path) + '.bin'
if args.verbose:
print("Sketch: ", sketch_path)
print("Build dir: ", tmp_dir)
print("Output: ", output_name)
if args.verbose:
f = sys.stdout
else:
f = open(tmp_dir + '/build.log', 'w')
res = compile(tmp_dir, sketch_path, tools_dir, hardware_dir, ide_path, f, args)
if res != 0:
return res
if args.output_binary is not None:
shutil.copy(output_name, args.output_binary)
if created_tmp_dir and not args.keep:
shutil.rmtree(tmp_dir, ignore_errors=True)
if __name__ == '__main__':
sys.exit(main())

View File

@ -1,9 +0,0 @@
#!/bin/bash
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/build-tests.sh
fi

View File

@ -1,5 +1,10 @@
#!/bin/bash
if [ -z "$TRAVIS_TAG" ]; then
echo "Skipping Packaging: Regular build"
exit 0
fi
############################################################
# $1 - download link
# $2 - JSON output file

64
tools/ci/build-tests.sh Executable file
View File

@ -0,0 +1,64 @@
#!/bin/bash
if [ ! -z "$TRAVIS_TAG" ]; then
echo "Skipping Test: Tagged build"
exit 0
fi
CHUNK_INDEX=$1
CHUNKS_CNT=$2
BUILD_PIO=0
if [ "$#" -lt 2 ]; then
echo "Building all sketches"
CHUNK_INDEX=0
CHUNKS_CNT=1
BUILD_PIO=1
fi
if [ "$CHUNKS_CNT" -le 0 ]; then
CHUNK_INDEX=0
CHUNKS_CNT=1
BUILD_PIO=1
fi
if [ "$CHUNK_INDEX" -gt "$CHUNKS_CNT" ]; then
CHUNK_INDEX=$CHUNKS_CNT
fi
if [ "$CHUNK_INDEX" -eq "$CHUNKS_CNT" ]; then
BUILD_PIO=1
fi
# CMake Test
if [ "$CHUNK_INDEX" -eq 0 ]; then
echo -e "travis_fold:start:check_cmakelists"
tools/ci/check-cmakelists.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:check_cmakelists"
fi
if [ "$BUILD_PIO" -eq 0 ]; then
# ArduinoIDE Test
echo -e "travis_fold:start:prep_arduino_ide"
tools/ci/prep-arduino-ide.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:prep_arduino_ide"
echo -e "travis_fold:start:test_arduino_ide"
tools/ci/test-arduino-ide.sh $CHUNK_INDEX $CHUNKS_CNT
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:test_arduino_ide"
echo -e "travis_fold:start:size_report"
cat size.log
echo -e "travis_fold:end:size_report"
else
# PlatformIO Test
echo -e "travis_fold:start:prep_platformio"
cd tools && python get.py && cd ..
tools/ci/prep-platformio.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:prep_platformio"
echo -e "travis_fold:start:test_platformio"
tools/ci/test-platformio.sh
if [ $? -ne 0 ]; then exit 1; fi
echo -e "travis_fold:end:test_platformio"
fi

View File

@ -5,10 +5,9 @@ wget -O arduino.tar.xz https://www.arduino.cc/download.php?f=/arduino-nightly-li
tar xf arduino.tar.xz
mv arduino-nightly $HOME/arduino_ide
mkdir -p $HOME/Arduino/libraries
mkdir -p $HOME/Arduino/hardware/espressif
cd $HOME/Arduino/hardware/espressif
cd $HOME/arduino_ide/hardware
mkdir espressif
cd espressif
ln -s $TRAVIS_BUILD_DIR esp32
cd esp32/tools
python get.py

View File

@ -16,11 +16,15 @@ if [ "$CHUNK_INDEX" -ge "$CHUNKS_CNT" ]; then
exit 1
fi
export ARDUINO_BOARD_FQBN="espressif:esp32:esp32:PSRAM=enabled,PartitionScheme=huge_app,CPUFreq=240,FlashMode=qio,FlashFreq=80,FlashSize=4M,UploadSpeed=921600,DebugLevel=none"
export ARDUINO_IDE_PATH=$HOME/arduino_ide
export ARDUINO_LIB_PATH=$HOME/Arduino/libraries
export ARDUINO_USR_PATH=$HOME/Arduino
export EXAMPLES_PATH=$TRAVIS_BUILD_DIR/libraries
export EXAMPLES_BUILD_DIR=$TRAVIS_BUILD_DIR/build.tmp
export EXAMPLES_BUILD_CMD="python tools/build.py -b esp32 -v -k -p $EXAMPLES_BUILD_DIR -l $ARDUINO_LIB_PATH "
export EXAMPLES_BUILD_DIR=$HOME/build.tmp
export EXAMPLES_CACHE_DIR=$HOME/cache.tmp
export EXAMPLES_BUILD_CMD="$ARDUINO_IDE_PATH/arduino-builder -compile -logger=human -core-api-version=\"10810\" -hardware \"$ARDUINO_IDE_PATH/hardware\" -hardware \"$ARDUINO_USR_PATH/hardware\" -tools \"$ARDUINO_IDE_PATH/tools-builder\" -built-in-libraries \"$ARDUINO_IDE_PATH/libraries\" -libraries \"$ARDUINO_USR_PATH/libraries\" -fqbn=$ARDUINO_BOARD_FQBN -warnings=\"all\" -build-cache \"$EXAMPLES_CACHE_DIR\" -build-path \"$EXAMPLES_BUILD_DIR\" -verbose"
export EXAMPLES_SIZE_BIN=$TRAVIS_BUILD_DIR/tools/xtensa-esp32-elf/bin/xtensa-esp32-elf-size
function print_size_info()
@ -93,6 +97,10 @@ function count_sketches()
function build_sketches()
{
mkdir -p $EXAMPLES_BUILD_DIR
mkdir -p $EXAMPLES_CACHE_DIR
mkdir -p $ARDUINO_USR_PATH/libraries
mkdir -p $ARDUINO_USR_PATH/hardware
local chunk_idex=$1
local chunks_num=$2
count_sketches

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -60,7 +60,7 @@
#define CONFIG_SPIRAM_USE_CAPS_ALLOC 1
#define CONFIG_FRMN1_QUANT 1
#define CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE 1
#define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 10
#define CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM 16
#define CONFIG_MBEDTLS_SSL_ALPN 1
#define CONFIG_MBEDTLS_PEM_WRITE_C 1
#define CONFIG_BT_SPP_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.

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

@ -395,7 +395,7 @@ CONFIG_SW_COEXIST_PREFERENCE_WIFI=
CONFIG_SW_COEXIST_PREFERENCE_BT=
CONFIG_SW_COEXIST_PREFERENCE_BALANCE=y
CONFIG_SW_COEXIST_PREFERENCE_VALUE=2
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y