mirror of
https://github.com/espressif/esp-idf.git
synced 2026-09-22 13:01:16 +03:00
Merge branch 'fix/h4_s31_enable_multi_board_test' into 'master'
fix(ci): re-enable some LEDC/UART tests for H4, S31 Closes IDF-15610 and IDF-15619 See merge request espressif/esp-idf!51529
This commit is contained in:
@@ -388,10 +388,6 @@ examples/peripherals/lcd/tjpgd:
|
||||
examples/peripherals/ledc:
|
||||
disable:
|
||||
- if: SOC_LEDC_SUPPORTED != 1
|
||||
disable_test:
|
||||
- if: IDF_TARGET in ["esp32h4"]
|
||||
temporary: true
|
||||
reason: cannot pass # TODO: IDF-15610
|
||||
depends_components:
|
||||
- esp_driver_ledc
|
||||
- esp_hal_ledc
|
||||
|
||||
@@ -77,4 +77,5 @@ void app_main(void)
|
||||
ESP_ERROR_CHECK(ledc_set_duty(LEDC_MODE, LEDC_CHANNEL, LEDC_DUTY));
|
||||
// Update duty to apply the new value
|
||||
ESP_ERROR_CHECK(ledc_update_duty(LEDC_MODE, LEDC_CHANNEL));
|
||||
printf("Generated a %d Hz signal on GPIO %d\n", LEDC_FREQUENCY, LEDC_OUTPUT_IO);
|
||||
}
|
||||
|
||||
@@ -14,19 +14,24 @@ This example shows how to control intensity of LEDs using selected SoC's on-boar
|
||||
* A development board with any Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.)
|
||||
* A USB cable for power supply and programming
|
||||
|
||||
Connect four LEDs to the following LEDC channels / individual GPIOs:
|
||||
Connect four LEDs to the following LEDC channels / individual GPIOs (defaults):
|
||||
|
||||
| | Channel 0 | Channel 1 | Channel 2 | Channel 3 |
|
||||
| --------------- | --------- | --------- | --------- | --------- |
|
||||
| ESP32 | GPIO18 | GPIO19 | GPIO4 | GPIO5 |
|
||||
| ESP32 | GPIO18 | GPIO19 | GPIO4 | GPIO5 |
|
||||
| ESP32-H4 | GPIO18 | GPIO19 | GPIO2 | GPIO3 |
|
||||
| All other chips | GPIO8 | GPIO9 | GPIO2 | GPIO3 |
|
||||
|
||||
The GPIO numbers can be changed in menuconfig under `Example Configuration`.
|
||||
|
||||
### Configure the project
|
||||
|
||||
```
|
||||
idf.py menuconfig
|
||||
```
|
||||
|
||||
- `Example Configuration` → select GPIO numbers for LEDC channel 0–3
|
||||
|
||||
### Build and Flash
|
||||
|
||||
Build the project and flash it to the board, then run the monitor tool to view the serial output:
|
||||
|
||||
37
examples/peripherals/ledc/ledc_fade/main/Kconfig.projbuild
Normal file
37
examples/peripherals/ledc/ledc_fade/main/Kconfig.projbuild
Normal file
@@ -0,0 +1,37 @@
|
||||
menu "Example Configuration"
|
||||
|
||||
orsource "$IDF_PATH/examples/common_components/env_caps/$IDF_TARGET/Kconfig.env_caps"
|
||||
|
||||
config LEDC_CH0_GPIO
|
||||
int "LEDC channel 0 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
||||
default 18 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32H4
|
||||
default 8
|
||||
help
|
||||
GPIO pin number to be used as LEDC channel 0 output.
|
||||
|
||||
config LEDC_CH1_GPIO
|
||||
int "LEDC channel 1 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
||||
default 19 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32H4
|
||||
default 9
|
||||
help
|
||||
GPIO pin number to be used as LEDC channel 1 output.
|
||||
|
||||
config LEDC_CH2_GPIO
|
||||
int "LEDC channel 2 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
||||
default 4 if IDF_TARGET_ESP32
|
||||
default 2
|
||||
help
|
||||
GPIO pin number to be used as LEDC channel 2 output.
|
||||
|
||||
config LEDC_CH3_GPIO
|
||||
int "LEDC channel 3 GPIO number"
|
||||
range ENV_GPIO_RANGE_MIN ENV_GPIO_OUT_RANGE_MAX
|
||||
default 5 if IDF_TARGET_ESP32
|
||||
default 3
|
||||
help
|
||||
GPIO pin number to be used as LEDC channel 3 output.
|
||||
|
||||
endmenu
|
||||
@@ -27,39 +27,35 @@
|
||||
*
|
||||
* 3. You can also set a target duty directly without fading.
|
||||
*
|
||||
* 4. On ESP32, GPIO18/19/4/5 are used as the LEDC outputs:
|
||||
* GPIO18/19 are from the high speed channel group
|
||||
* GPIO4/5 are from the low speed channel group
|
||||
*
|
||||
* On other targets, GPIO8/9/4/5 are used as the LEDC outputs,
|
||||
* and they are all from the low speed channel group.
|
||||
* 4. LEDC channel GPIO numbers can be selected in menuconfig
|
||||
* (Example Configuration). See README for default pin mapping.
|
||||
* On ESP32, CH0/1 use the high speed channel group and CH2/3 use
|
||||
* the low speed channel group. On other targets, all channels use
|
||||
* the low speed channel group.
|
||||
*
|
||||
* 5. All the LEDC outputs change the duty repeatedly.
|
||||
*
|
||||
*/
|
||||
#define LEDC_CH0_GPIO CONFIG_LEDC_CH0_GPIO
|
||||
#define LEDC_CH1_GPIO CONFIG_LEDC_CH1_GPIO
|
||||
#define LEDC_CH2_GPIO CONFIG_LEDC_CH2_GPIO
|
||||
#define LEDC_CH3_GPIO CONFIG_LEDC_CH3_GPIO
|
||||
|
||||
#if CONFIG_IDF_TARGET_ESP32
|
||||
#define LEDC_HS_TIMER LEDC_TIMER_0
|
||||
#define LEDC_HS_MODE LEDC_HIGH_SPEED_MODE
|
||||
#define LEDC_HS_CH0_GPIO (18)
|
||||
#define LEDC_HS_CH0_CHANNEL LEDC_CHANNEL_0
|
||||
#define LEDC_HS_CH1_GPIO (19)
|
||||
#define LEDC_HS_CH1_CHANNEL LEDC_CHANNEL_1
|
||||
#define LEDC_LS_TIMER LEDC_TIMER_1
|
||||
#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE
|
||||
#define LEDC_LS_CH2_GPIO (4)
|
||||
#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2
|
||||
#define LEDC_LS_CH3_GPIO (5)
|
||||
#define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3
|
||||
#else
|
||||
#define LEDC_LS_TIMER LEDC_TIMER_1
|
||||
#define LEDC_LS_MODE LEDC_LOW_SPEED_MODE
|
||||
#define LEDC_LS_CH0_GPIO (8)
|
||||
#define LEDC_LS_CH0_CHANNEL LEDC_CHANNEL_0
|
||||
#define LEDC_LS_CH1_GPIO (9)
|
||||
#define LEDC_LS_CH1_CHANNEL LEDC_CHANNEL_1
|
||||
#define LEDC_LS_CH2_GPIO (2)
|
||||
#define LEDC_LS_CH2_CHANNEL LEDC_CHANNEL_2
|
||||
#define LEDC_LS_CH3_GPIO (3)
|
||||
#define LEDC_LS_CH3_CHANNEL LEDC_CHANNEL_3
|
||||
#endif
|
||||
|
||||
@@ -125,7 +121,7 @@ void app_main(void)
|
||||
{
|
||||
.channel = LEDC_HS_CH0_CHANNEL,
|
||||
.duty = 0,
|
||||
.gpio_num = LEDC_HS_CH0_GPIO,
|
||||
.gpio_num = LEDC_CH0_GPIO,
|
||||
.speed_mode = LEDC_HS_MODE,
|
||||
.hpoint = 0,
|
||||
.timer_sel = LEDC_HS_TIMER,
|
||||
@@ -134,7 +130,7 @@ void app_main(void)
|
||||
{
|
||||
.channel = LEDC_HS_CH1_CHANNEL,
|
||||
.duty = 0,
|
||||
.gpio_num = LEDC_HS_CH1_GPIO,
|
||||
.gpio_num = LEDC_CH1_GPIO,
|
||||
.speed_mode = LEDC_HS_MODE,
|
||||
.hpoint = 0,
|
||||
.timer_sel = LEDC_HS_TIMER,
|
||||
@@ -144,7 +140,7 @@ void app_main(void)
|
||||
{
|
||||
.channel = LEDC_LS_CH0_CHANNEL,
|
||||
.duty = 0,
|
||||
.gpio_num = LEDC_LS_CH0_GPIO,
|
||||
.gpio_num = LEDC_CH0_GPIO,
|
||||
.speed_mode = LEDC_LS_MODE,
|
||||
.hpoint = 0,
|
||||
.timer_sel = LEDC_LS_TIMER,
|
||||
@@ -153,7 +149,7 @@ void app_main(void)
|
||||
{
|
||||
.channel = LEDC_LS_CH1_CHANNEL,
|
||||
.duty = 0,
|
||||
.gpio_num = LEDC_LS_CH1_GPIO,
|
||||
.gpio_num = LEDC_CH1_GPIO,
|
||||
.speed_mode = LEDC_LS_MODE,
|
||||
.hpoint = 0,
|
||||
.timer_sel = LEDC_LS_TIMER,
|
||||
@@ -163,7 +159,7 @@ void app_main(void)
|
||||
{
|
||||
.channel = LEDC_LS_CH2_CHANNEL,
|
||||
.duty = 0,
|
||||
.gpio_num = LEDC_LS_CH2_GPIO,
|
||||
.gpio_num = LEDC_CH2_GPIO,
|
||||
.speed_mode = LEDC_LS_MODE,
|
||||
.hpoint = 0,
|
||||
.timer_sel = LEDC_LS_TIMER,
|
||||
@@ -172,7 +168,7 @@ void app_main(void)
|
||||
{
|
||||
.channel = LEDC_LS_CH3_CHANNEL,
|
||||
.duty = 0,
|
||||
.gpio_num = LEDC_LS_CH3_GPIO,
|
||||
.gpio_num = LEDC_CH3_GPIO,
|
||||
.speed_mode = LEDC_LS_MODE,
|
||||
.hpoint = 0,
|
||||
.timer_sel = LEDC_LS_TIMER,
|
||||
|
||||
@@ -8,7 +8,6 @@ from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize('target', soc_filtered_targets('SOC_LEDC_SUPPORTED == 1'), indirect=['target'])
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32h4'], reason='cannot pass') # TODO: IDF-15610
|
||||
def test_ledc_fade_example(dut: IdfDut) -> None:
|
||||
# repeat to test at least two rounds of fade
|
||||
dut.expect_exact('1. LEDC fade up to duty = 4000')
|
||||
|
||||
Reference in New Issue
Block a user