Skip to content

Commit 317fcf9

Browse files
committed
refactor(vbus_monitor_test): Added test for test VBUS with self_powered flag
- Added test cases for USB OTG 1.1 (all targets) - Added test cases for USB OTG 2.0 (esp32p4) - Enabled the ci test for emulation of VBUS swithing on ESP32P4 USB OTG 2.0
1 parent 0710a7d commit 317fcf9

File tree

10 files changed

+686
-170
lines changed

10 files changed

+686
-170
lines changed

device/esp_tinyusb/test_apps/dconn_detection/main/test_dconn_detection.c

Lines changed: 0 additions & 151 deletions
This file was deleted.

device/esp_tinyusb/test_apps/dconn_detection/pytest_dconn_detection.py

Lines changed: 0 additions & 13 deletions
This file was deleted.

device/esp_tinyusb/test_apps/dconn_detection/CMakeLists.txt renamed to device/esp_tinyusb/test_apps/vbus_monitor/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
66
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
77
set(COMPONENTS main)
88

9-
project(test_app_dconn_detection)
9+
project(test_app_vbus_monitor)

device/esp_tinyusb/test_apps/dconn_detection/main/test_app_main.c renamed to device/esp_tinyusb/test_apps/vbus_monitor/main/test_app_main.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
/*
2-
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

77
#include <stdio.h>
88
#include <string.h>
9+
#include "freertos/FreeRTOS.h"
10+
#include "freertos/task.h"
911
#include "unity.h"
1012
#include "unity_test_runner.h"
1113
#include "unity_test_utils_memory.h"
1214

15+
#include "test_vbus_monitor.h"
16+
1317
void app_main(void)
1418
{
1519
/*
@@ -53,10 +57,16 @@ void app_main(void)
5357
void setUp(void)
5458
{
5559
unity_utils_record_free_mem();
60+
test_device_event_queue_setup();
61+
test_vbus_monitor_control_setup();
5662
}
5763

5864
/* tearDown runs after every test */
5965
void tearDown(void)
6066
{
67+
// Short delay to allow task to be cleaned up
68+
vTaskDelay(10);
69+
test_vbus_monitor_control_teardown();
70+
test_device_event_queue_teardown();
6171
unity_utils_evaluate_leaks();
6272
}

0 commit comments

Comments
 (0)