Skip to content

Commit baedf16

Browse files
committed
Add support for ESP IDF v4.1-beta1.
1 parent acf0a66 commit baedf16

File tree

2 files changed

+42
-29
lines changed

2 files changed

+42
-29
lines changed

.travis.yml

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,36 @@
1+
os: linux
12
dist: bionic
23
language: python
34
python: "3.8"
45

5-
before_install:
6-
# Save path to the git respository
7-
- PROJECT_PATH=$(pwd)
6+
jobs:
7+
include:
8+
- stage: # IDF v3.3
9+
install:
10+
# Install ESP32 toochain following steps as described
11+
# in http://esp-idf.readthedocs.io/en/latest/linux-setup.html
12+
#
13+
# Download binary toolchain for the ESP32
14+
- pushd ~
15+
- wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
16+
- tar -xzf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
17+
# Make xtensa-esp32-elf available for all terminal sessions
18+
- export PATH=$PATH:$(pwd)/xtensa-esp32-elf/bin
19+
# Get ESP-IDF from github
20+
- git clone --recursive --branch v3.3 --single-branch --shallow-submodules https://github.com/espressif/esp-idf.git esp-idf
21+
# Set the path to ESP-IDF directory
22+
- export IDF_PATH=$(pwd)/esp-idf
23+
# Install python dependencies
24+
- pip install --requirement $IDF_PATH/requirements.txt
25+
- popd
26+
script:
27+
- $IDF_PATH/tools/idf.py build
828

9-
install:
10-
# Install ESP32 toochain following steps as desribed
11-
# in http://esp-idf.readthedocs.io/en/latest/linux-setup.html
12-
#
13-
# Get required packages - already done above, see addons: apt: packages:
14-
# - sudo apt-get install git wget make libncurses-dev flex bison gperf python python-serial
15-
# Prepare directory for the toolchain
16-
- mkdir -p ~/esp
17-
- cd ~/esp
18-
# Download binary toolchain for the ESP32
19-
- wget https://dl.espressif.com/dl/xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
20-
- tar -xzf xtensa-esp32-elf-linux64-1.22.0-80-g6c4433a-5.2.0.tar.gz
21-
# Make xtensa-esp32-elf available for all terminal sessions
22-
- export PATH=$PATH:$HOME/esp/xtensa-esp32-elf/bin
23-
# Get ESP-IDF from github
24-
- git clone --recursive --branch v3.3 --single-branch --shallow-submodules https://github.com/espressif/esp-idf.git
25-
# Set the path to ESP-IDF directory
26-
- export IDF_PATH=~/esp/esp-idf
27-
# Install python dependencies
28-
- pip install --requirement $IDF_PATH/requirements.txt
29-
30-
script:
31-
# Build project within the original repository
32-
- cd $PROJECT_PATH
33-
- $IDF_PATH/tools/idf.py build
29+
- stage: # IDF v4.1-beta1
30+
install:
31+
- pushd ~
32+
- git clone --recursive --branch v4.1-beta1 --single-branch --shallow-submodules https://github.com/espressif/esp-idf.git esp-idf
33+
- esp-idf/install.sh
34+
- popd
35+
script:
36+
- source ~/esp-idf/export.sh && idf.py build

CMakeLists.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,15 @@ cmake_minimum_required(VERSION 3.5)
55
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
66
project(esp32-i2c-lcd1602-example)
77

8+
if (NOT IDF_VERSION_MAJOR)
9+
set(IDF_VERSION_MAJOR 3)
10+
endif()
11+
12+
if (IDF_VERSION_MAJOR GREATER 3)
13+
set(PROJECT_ELF ${project_elf})
14+
else()
15+
set(PROJECT_ELF ${IDF_PROJECT_EXECUTABLE})
16+
endif()
17+
818
# Ignore false clang warnings about `struct foo = { 0 }`
9-
target_compile_options(${IDF_PROJECT_EXECUTABLE} PRIVATE -Wno-missing-braces -Wmissing-field-initializers)
19+
target_compile_options(${PROJECT_ELF} PRIVATE -Wno-missing-braces -Wmissing-field-initializers)

0 commit comments

Comments
 (0)