From 50b569ad1be86930ae968655ec574362a2b57aa6 Mon Sep 17 00:00:00 2001 From: hathach Date: Mon, 29 Jun 2020 16:52:08 +0700 Subject: [PATCH] added esp32s2 kaluga bsp --- docs/boards.md | 1 + examples/device/board_test/CMakeLists.txt | 2 +- examples/device/cdc_msc_freertos/CMakeLists.txt | 2 +- examples/device/hid_composite_freertos/CMakeLists.txt | 2 +- examples/rules.mk | 5 ++--- hw/bsp/esp32s2_saola_1/CMakeLists.txt | 2 +- hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c | 4 ++-- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/boards.md b/docs/boards.md index 202602d30..46d071853 100644 --- a/docs/boards.md +++ b/docs/boards.md @@ -11,6 +11,7 @@ This code base already had supported for a handful of following boards (sorted a ### Espressif ESP32-S2 +- [ESP32-S2-Kaluga-1](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-esp32-s2-kaluga-1-kit.html) - [ESP32-S2-Saola-1](https://docs.espressif.com/projects/esp-idf/en/latest/esp32s2/hw-reference/esp32s2/user-guide-saola-1-v1.2.html) ### MicroChip SAMD diff --git a/examples/device/board_test/CMakeLists.txt b/examples/device/board_test/CMakeLists.txt index 4f0359922..f0437dd04 100644 --- a/examples/device/board_test/CMakeLists.txt +++ b/examples/device/board_test/CMakeLists.txt @@ -7,7 +7,7 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Add example src and bsp directories -set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2_saola_1") +set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/${BOARD}") include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(SUPPORTED_TARGETS esp32s2) diff --git a/examples/device/cdc_msc_freertos/CMakeLists.txt b/examples/device/cdc_msc_freertos/CMakeLists.txt index b0e2c2cea..339f43a09 100644 --- a/examples/device/cdc_msc_freertos/CMakeLists.txt +++ b/examples/device/cdc_msc_freertos/CMakeLists.txt @@ -7,7 +7,7 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Add example src and bsp directories -set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2_saola_1") +set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/${BOARD}") include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(SUPPORTED_TARGETS esp32s2) diff --git a/examples/device/hid_composite_freertos/CMakeLists.txt b/examples/device/hid_composite_freertos/CMakeLists.txt index bfd0677e0..a429a1336 100644 --- a/examples/device/hid_composite_freertos/CMakeLists.txt +++ b/examples/device/hid_composite_freertos/CMakeLists.txt @@ -7,7 +7,7 @@ set(TOP "../../..") get_filename_component(TOP "${TOP}" REALPATH) # Add example src and bsp directories -set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/esp32s2_saola_1") +set(EXTRA_COMPONENT_DIRS "src" "${TOP}/hw/bsp/${BOARD}") include($ENV{IDF_PATH}/tools/cmake/project.cmake) set(SUPPORTED_TARGETS esp32s2) diff --git a/examples/rules.mk b/examples/rules.mk index 2f4c8b860..eeb548d08 100644 --- a/examples/rules.mk +++ b/examples/rules.mk @@ -12,11 +12,10 @@ all: idf.py -B$(BUILD) -DBOARD=$(BOARD) build clean: - idf.py -B$(BUILD) clean + idf.py -B$(BUILD) -DBOARD=$(BOARD) clean flash: - @:$(call check_defined, SERIAL, example: SERIAL=/dev/ttyUSB0) - idf.py -B$(BUILD) -p $(SERIAL) flash + idf.py -B$(BUILD) -DBOARD=$(BOARD) flash else # GNU Make build system diff --git a/hw/bsp/esp32s2_saola_1/CMakeLists.txt b/hw/bsp/esp32s2_saola_1/CMakeLists.txt index 379b2e3d0..629b3104a 100644 --- a/hw/bsp/esp32s2_saola_1/CMakeLists.txt +++ b/hw/bsp/esp32s2_saola_1/CMakeLists.txt @@ -1,4 +1,4 @@ -idf_component_register(SRCS "esp32s2_saola_1.c" "led_strip/src/led_strip_rmt_ws2812.c" +idf_component_register(SRCS "${BOARD}.c" "led_strip/src/led_strip_rmt_ws2812.c" INCLUDE_DIRS "led_strip/include" PRIV_REQUIRES "driver" REQUIRES freertos src) diff --git a/hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c b/hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c index bbcdab6d2..a30d3c81e 100644 --- a/hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c +++ b/hw/bsp/esp32s2_saola_1/esp32s2_saola_1.c @@ -39,8 +39,8 @@ // Note: On the production version (v1.2) WS2812 is connected to GPIO 18, // however earlier revision v1.1 WS2812 is connected to GPIO 17 -//#define LED_PIN 18 // v1.2 and later -#define LED_PIN 17 // v1.1 +//#define LED_PIN 17 // v1.1 +#define LED_PIN 18 // v1.2 and later #define BUTTON_PIN 0 #define BUTTON_STATE_ACTIVE 0