From aaa2eca57d98f46429db6c7792658ba4e9dc507c Mon Sep 17 00:00:00 2001 From: morris Date: Sat, 7 May 2022 22:59:34 +0800 Subject: [PATCH] blink: support ESP8684-DevKitM board --- examples/common_components/led_strip/CMakeLists.txt | 8 +++++++- examples/get-started/blink/README.md | 4 ++-- examples/get-started/blink/main/CMakeLists.txt | 2 +- examples/get-started/blink/main/Kconfig.projbuild | 4 ++-- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/examples/common_components/led_strip/CMakeLists.txt b/examples/common_components/led_strip/CMakeLists.txt index a9c4b523a2..978fdf7111 100644 --- a/examples/common_components/led_strip/CMakeLists.txt +++ b/examples/common_components/led_strip/CMakeLists.txt @@ -1,3 +1,9 @@ -idf_component_register(SRCS "src/led_strip_rmt_dev.c" "src/led_strip_rmt_encoder.c" +set(srcs) + +if(CONFIG_SOC_RMT_SUPPORTED) + list(APPEND srcs "src/led_strip_rmt_dev.c" "src/led_strip_rmt_encoder.c") +endif() + +idf_component_register(SRCS ${srcs} INCLUDE_DIRS "include" "interface" PRIV_REQUIRES "driver") diff --git a/examples/get-started/blink/README.md b/examples/get-started/blink/README.md index ae6a65eff4..6a0d315606 100644 --- a/examples/get-started/blink/README.md +++ b/examples/get-started/blink/README.md @@ -12,7 +12,7 @@ Before project configuration and build, be sure to set the correct chip target u ### Hardware Required -* A development board with ESP32/ESP32-S2/ESP32-S3/ESP32-C3 SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.) +* A development board with Espressif SoC (e.g., ESP32-DevKitC, ESP-WROVER-KIT, etc.) * A USB cable for Power supply and programming Some development boards use an addressable LED instead of a regular one. These development boards include: @@ -48,7 +48,7 @@ See the [Getting Started Guide](https://docs.espressif.com/projects/esp-idf/en/l ## Example Output -As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the `led_strip_set_pixel(pStrip_a, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the `blink.c` file. +As you run the example, you will see the LED blinking, according to the previously defined period. For the addressable LED, you can also change the LED color by setting the `led_strip_set_pixel(led_strip, 0, 16, 16, 16);` (LED Strip, Pixel Number, Red, Green, Blue) with values from 0 to 255 in the [source file](main/blink_example_main.c). ``` I (315) example: Example configured to blink addressable LED! diff --git a/examples/get-started/blink/main/CMakeLists.txt b/examples/get-started/blink/main/CMakeLists.txt index 448f871365..a7f0baca81 100644 --- a/examples/get-started/blink/main/CMakeLists.txt +++ b/examples/get-started/blink/main/CMakeLists.txt @@ -1,2 +1,2 @@ idf_component_register(SRCS "blink_example_main.c" - INCLUDE_DIRS ".") + INCLUDE_DIRS ".") diff --git a/examples/get-started/blink/main/Kconfig.projbuild b/examples/get-started/blink/main/Kconfig.projbuild index 18b13a773d..b7699706d4 100644 --- a/examples/get-started/blink/main/Kconfig.projbuild +++ b/examples/get-started/blink/main/Kconfig.projbuild @@ -2,7 +2,7 @@ menu "Example Configuration" choice BLINK_LED prompt "Blink LED type" - default BLINK_LED_GPIO if IDF_TARGET_ESP32 + default BLINK_LED_GPIO if IDF_TARGET_ESP32 || IDF_TARGET_ESP32C2 default BLINK_LED_RMT help Defines the default peripheral for blink example @@ -16,7 +16,7 @@ menu "Example Configuration" config BLINK_GPIO int "Blink GPIO number" range 0 48 - default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2 + default 8 if IDF_TARGET_ESP32C3 || IDF_TARGET_ESP32H2 || IDF_TARGET_ESP32C2 default 18 if IDF_TARGET_ESP32S2 default 48 if IDF_TARGET_ESP32S3 default 5