Skip to content

Commit 43a09ad

Browse files
authored
Merge branch 'espressif:master' into master
2 parents f0282b7 + ea382df commit 43a09ad

File tree

9 files changed

+26
-41
lines changed

9 files changed

+26
-41
lines changed

.github/scripts/tests_run.sh

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,7 @@ function run_test {
8888
fi
8989

9090
if [ $platform == "wokwi" ]; then
91-
extra_args=("--target" "$target" "--embedded-services" "arduino,wokwi" "--wokwi-timeout=$wokwi_timeout")
92-
if [[ -f "$sketchdir/scenario.yaml" ]]; then
93-
extra_args+=("--wokwi-scenario" "$sketchdir/scenario.yaml")
94-
fi
91+
extra_args=("--target" "$target" "--embedded-services" "arduino,wokwi")
9592
if [[ -f "$sketchdir/diagram.$target.json" ]]; then
9693
extra_args+=("--wokwi-diagram" "$sketchdir/diagram.$target.json")
9794
fi
@@ -137,7 +134,6 @@ SCRIPTS_DIR="./.github/scripts"
137134
COUNT_SKETCHES="${SCRIPTS_DIR}/sketch_utils.sh count"
138135

139136
platform="hardware"
140-
wokwi_timeout=60000
141137
chunk_run=0
142138
options=0
143139
erase=0
@@ -156,7 +152,6 @@ while [ -n "$1" ]; do
156152
;;
157153
-W )
158154
shift
159-
wokwi_timeout=$1
160155
if [[ -z $WOKWI_CLI_TOKEN ]]; then
161156
echo "Wokwi CLI token is not set"
162157
exit 1

.github/workflows/tests_wokwi.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ on:
1010
permissions:
1111
contents: read
1212

13-
env:
14-
WOKWI_TIMEOUT: 600000 # Milliseconds
15-
1613
jobs:
1714
get-artifacts:
1815
name: Get required artifacts
@@ -271,10 +268,6 @@ jobs:
271268
pip install -U pip
272269
pip install -r tests/requirements.txt --extra-index-url https://dl.espressif.com/pypi
273270
274-
- name: Install Wokwi CLI
275-
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
276-
run: curl -L https://wokwi.com/ci/install.sh | sh
277-
278271
- name: Wokwi CI Server
279272
if: ${{ steps.check-tests.outputs.enabled == 'true' }}
280273
uses: wokwi/wokwi-ci-server-action@a6fabb5a49e080158c7a1d121ea5b789536a82c3 # v1
@@ -294,7 +287,7 @@ jobs:
294287
env:
295288
WOKWI_CLI_TOKEN: ${{ secrets.WOKWI_CLI_TOKEN }}
296289
run: |
297-
bash .github/scripts/tests_run.sh -c -type ${{ matrix.type }} -t ${{ matrix.chip }} -i 0 -m 1 -W ${{ env.WOKWI_TIMEOUT }}
290+
bash .github/scripts/tests_run.sh -c -type ${{ matrix.type }} -t ${{ matrix.chip }} -i 0 -m 1 -W
298291
299292
- name: Upload ${{ matrix.chip }} ${{ matrix.type }} Wokwi results as cache
300293
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3

boards.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52133,7 +52133,7 @@ fobe_quill_esp32s3_mesh.name=FoBE Quill ESP32S3 Mesh
5213352133
fobe_quill_esp32s3_mesh.vid.0=0x303a
5213452134
fobe_quill_esp32s3_mesh.pid.0=0x82f4
5213552135
fobe_quill_esp32s3_mesh.vid.1=0x303a
52136-
fobe_quill_esp32s3_mesh.vid.1=0x82f5
52136+
fobe_quill_esp32s3_mesh.pid.1=0x82f5
5213752137
fobe_quill_esp32s3_mesh.vid.2=0x303a
5213852138
fobe_quill_esp32s3_mesh.pid.2=0x82f6
5213952139

@@ -52353,6 +52353,8 @@ twinaiot.upload.tool.network=esp_ota
5235352353

5235452354
twinaiot.upload.maximum_size=1310720
5235552355
twinaiot.upload.maximum_data_size=327680
52356+
twinaiot.upload.flags=
52357+
twinaiot.upload.extra_flags=
5235652358
twinaiot.upload.use_1200bps_touch=false
5235752359
twinaiot.upload.wait_for_upload_port=false
5235852360

cores/esp32/esp32-hal-gpio.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,21 @@
3333
#include "soc/touch_sensor_periph.h"
3434

3535
int8_t digitalPinToTouchChannel(uint8_t pin) {
36-
int8_t ret = -1;
3736
if (pin < SOC_GPIO_PIN_COUNT) {
3837
for (uint8_t i = 0; i < SOC_TOUCH_SENSOR_NUM; i++) {
3938
if (touch_sensor_channel_io_map[i] == pin) {
40-
ret = i;
41-
break;
39+
return i;
4240
}
4341
}
4442
}
45-
return ret;
43+
44+
log_e("No touch pad on selected pin(%u)!", pin);
45+
return -1;
4646
}
4747
#else
4848
// No Touch Sensor available
4949
int8_t digitalPinToTouchChannel(uint8_t pin) {
50+
log_e("Touch sensor not available on this chip");
5051
return -1;
5152
}
5253
#endif

cores/esp32/esp32-hal-touch-ng.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,6 @@ static void __touchChannelInit(int pad) {
332332
static touch_value_t __touchRead(uint8_t pin) {
333333
int8_t pad = digitalPinToTouchChannel(pin);
334334
if (pad < 0) {
335-
log_e(" No touch pad on selected pin!");
336335
return 0;
337336
}
338337

@@ -360,7 +359,6 @@ static touch_value_t __touchRead(uint8_t pin) {
360359
static void __touchConfigInterrupt(uint8_t pin, void (*userFunc)(void), void *Args, bool callWithArgs, touch_value_t threshold) {
361360
int8_t pad = digitalPinToTouchChannel(pin);
362361
if (pad < 0) {
363-
log_e(" No touch pad on selected pin!");
364362
return;
365363
}
366364

@@ -446,7 +444,6 @@ bool touchInterruptGetLastStatus(uint8_t pin) {
446444
void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold) {
447445
int8_t pad = digitalPinToTouchChannel(pin);
448446
if (pad < 0) {
449-
log_e(" No touch pad on selected pin!");
450447
return;
451448
}
452449

cores/esp32/esp32-hal-touch.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ static void __touchChannelInit(int pad) {
206206
static touch_value_t __touchRead(uint8_t pin) {
207207
int8_t pad = digitalPinToTouchChannel(pin);
208208
if (pad < 0) {
209-
log_e(" No touch pad on selected pin!");
210209
return 0;
211210
}
212211

@@ -233,7 +232,6 @@ static touch_value_t __touchRead(uint8_t pin) {
233232
static void __touchConfigInterrupt(uint8_t pin, void (*userFunc)(void), void *Args, touch_value_t threshold, bool callWithArgs) {
234233
int8_t pad = digitalPinToTouchChannel(pin);
235234
if (pad < 0) {
236-
log_e(" No touch pad on selected pin!");
237235
return;
238236
}
239237

@@ -295,7 +293,6 @@ bool touchInterruptGetLastStatus(uint8_t pin) {
295293
void touchSleepWakeUpEnable(uint8_t pin, touch_value_t threshold) {
296294
int8_t pad = digitalPinToTouchChannel(pin);
297295
if (pad < 0) {
298-
log_e(" No touch pad on selected pin!");
299296
return;
300297
}
301298

docs/en/contributing.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,15 @@ After the test is finished, you can check the output in the terminal and the gen
365365
Additionally, for performance tests, you can check the generated JSON file in the same folder.
366366

367367
You can also run the tests in `Wokwi <https://docs.wokwi.com/>`_ or `Espressif's QEMU <https://github.com/espressif/esp-toolchain-docs/tree/main/qemu>`_
368-
by using the ``-W <timeout_in_ms>`` and ``-Q`` flags respectively. You will need to have the Wokwi and/or QEMU installed in your system
368+
by using the ``-W`` and ``-Q`` flags respectively. You will need to have the Wokwi and/or QEMU installed in your system
369369
and set the ``WOKWI_CLI_TOKEN`` and/or ``QEMU_PATH`` environment variables. The ``WOKWI_CLI_TOKEN`` is the CI token that can be obtained from the
370370
`Wokwi website <https://wokwi.com/dashboard/ci>`_ and the ``QEMU_PATH`` is the path to the QEMU binary.
371371

372372
For example, to run the ``uart`` test using Wokwi, you would run:
373373

374374
.. code-block:: bash
375375
376-
WOKWI_CLI_TOKEN=<your_wokwi_token> ./.github/scripts/tests_run.sh -s uart -t esp32c3 -W <timeout_in_ms>
376+
WOKWI_CLI_TOKEN=<your_wokwi_token> ./.github/scripts/tests_run.sh -s uart -t esp32c3 -W
377377
378378
And to run the ``uart`` test using QEMU, you would run:
379379

@@ -398,7 +398,6 @@ A test suite contains the following files:
398398
* ``<test_name>.ino``: The sketch that will be tested. Required.
399399
* ``ci.json``: The file that specifies how the test suite will be run in the CI system. Optional.
400400
* ``diagram.<target>.json``: The diagram file that specifies the connections between the components in Wokwi. Optional.
401-
* ``scenario.yaml``: The scenario file that specifies how Wokwi will interact with the components. Optional.
402401
* Any other files that are needed for the test suite.
403402

404403
You can read more about the test python API in the `pytest-embedded documentation <https://docs.espressif.com/projects/pytest-embedded/en/latest/usages/expecting.html>`_.

tests/requirements.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
cryptography==44.0.1
22
--only-binary cryptography
33
pytest-cov==5.0.0
4-
pytest-embedded-serial-esp==1.12.0
5-
pytest-embedded-arduino==1.12.0
6-
pytest-embedded-wokwi==1.12.0
7-
pytest-embedded-qemu==1.12.0
8-
esptool==4.8.1
4+
pytest-embedded-serial-esp==2.0.0
5+
pytest-embedded-arduino==2.0.0
6+
pytest-embedded-wokwi==2.0.0
7+
pytest-embedded-qemu==2.0.0
8+
esptool==5.1.0

tests/validation/gpio/test_gpio.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
import logging
2+
from pytest_embedded_wokwi import Wokwi
3+
from pytest_embedded import Dut
24

35

4-
def test_gpio(dut):
6+
def test_gpio(dut: Dut, wokwi: Wokwi):
57
LOGGER = logging.getLogger(__name__)
68

9+
LOGGER.info("Waiting for Button test begin...")
710
dut.expect_exact("Button test")
811

9-
LOGGER.info("Expecting button press 1")
10-
dut.expect_exact("Button pressed 1 times")
12+
for i in range(3):
13+
LOGGER.info(f"Setting button pressed for {i + 1} seconds")
14+
wokwi.client.set_control("btn1", "pressed", 1)
1115

12-
LOGGER.info("Expecting button press 2")
13-
dut.expect_exact("Button pressed 2 times")
14-
15-
LOGGER.info("Expecting button press 3")
16-
dut.expect_exact("Button pressed 3 times")
16+
dut.expect_exact(f"Button pressed {i + 1} times")
17+
wokwi.client.set_control("btn1", "pressed", 0)

0 commit comments

Comments
 (0)