Skip to content

Commit 8c8766a

Browse files
committed
Add CI for ESP-IDF example
1 parent 392e870 commit 8c8766a

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,40 @@ jobs:
102102
103103
- run: PLATFORMIO_SRC_DIR=examples/Client PIO_BOARD=${{ matrix.board }} pio run -e ${{ matrix.env }}
104104
- run: PLATFORMIO_SRC_DIR=examples/FetchWebsite PIO_BOARD=${{ matrix.board }} pio run -e ${{ matrix.env }}
105+
106+
esp-idf:
107+
name: Build with ESP-IDF ${{ matrix.idf_ver }} for ${{ matrix.idf_target }}
108+
runs-on: ubuntu-latest
109+
strategy:
110+
fail-fast: false
111+
matrix:
112+
# The version names here correspond to the versions of espressif/idf Docker image.
113+
# See https://hub.docker.com/r/espressif/idf/tags and
114+
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-guides/tools/idf-docker-image.html
115+
# for details.
116+
idf_ver: ["release-v5.4"]
117+
idf_target:
118+
[
119+
"esp32",
120+
"esp32s2",
121+
"esp32s3",
122+
"esp32c2",
123+
"esp32c3",
124+
"esp32c6",
125+
"esp32h2",
126+
"esp32p4"
127+
]
128+
container: espressif/idf:${{ matrix.idf_ver }}
129+
steps:
130+
- name: Checkout
131+
uses: actions/checkout@v4
132+
with:
133+
path: components/asynctcp
134+
135+
- name: Build
136+
env:
137+
IDF_TARGET: ${{ matrix.idf_target }}
138+
shell: bash
139+
run: |
140+
. ${IDF_PATH}/export.sh
141+
idf.py -C ./components/asynctcp/idf_component_examples/client -DEXTRA_COMPONENT_DIRS=$PWD/components build
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
idf_component_register(SRCS "main.cpp"
2-
INCLUDE_DIRS ".")
2+
INCLUDE_DIRS "."
3+
PRIV_REQUIRES esp_timer)

idf_component_examples/client/main/idf_component.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ dependencies:
55
override_path: "../../../"
66
pre_release: true
77
espressif/arduino-esp32:
8-
version: "^3.1.1"
8+
version: ">=3.0.5"
99
require: public

src/AsyncTCP.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,15 @@
1212
#include <NetworkInterface.h>
1313
#endif
1414
#else
15+
#include "esp_timer.h"
1516
#define log_e(...) ESP_LOGE(__FILE__, __VA_ARGS__)
1617
#define log_w(...) ESP_LOGW(__FILE__, __VA_ARGS__)
1718
#define log_i(...) ESP_LOGI(__FILE__, __VA_ARGS__)
1819
#define log_d(...) ESP_LOGD(__FILE__, __VA_ARGS__)
1920
#define log_v(...) ESP_LOGV(__FILE__, __VA_ARGS__)
20-
#define millis() (esp_timer_get_time() / 1000ULL)
21+
static unsigned long millis() {
22+
return (unsigned long)(esp_timer_get_time() / 1000ULL);
23+
}
2124
#endif
2225

2326
extern "C" {

0 commit comments

Comments
 (0)