Skip to content
Snippets Groups Projects
Commit e3612be5 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski
Browse files

zephyr-kernel: don't call zephyr_library() twice


The patch enabling the ACM0 console adds a call to zephyr_library() that
with certain Kconfig option can be called twice leading to build failures.
Remove the duplicate.

Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@huawei.com>
Suggested-by: default avatarEilís Ní Fhlannagáin <elizabeth.flanagan@huawei.com>
parent 76609308
No related branches found
No related tags found
1 merge request!8enable the Adafruit 2.8 TFT display on Arduino Nano 33 BLE
From e64879dc1cc0c4f6999874a96c24c9272958fee8 Mon Sep 17 00:00:00 2001
From d644a7d002bd308926e5080a21101b057e2dbc27 Mon Sep 17 00:00:00 2001
From: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
Date: Thu, 27 Jan 2022 10:26:41 +0100
Subject: [PATCH] console: enable the USB ACM0 console by default
......@@ -6,27 +6,32 @@ Subject: [PATCH] console: enable the USB ACM0 console by default
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@huawei.com>
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
---
boards/arm/arduino_nano_33_ble/CMakeLists.txt | 3 +++
boards/arm/arduino_nano_33_ble/CMakeLists.txt | 3 ++-
.../arduino_nano_33_ble.dts | 9 +++++++
.../arduino_nano_33_ble_defconfig | 6 +++++
.../src/init_usb_cdc_acm.c | 25 +++++++++++++++++++
subsys/shell/backends/shell_uart.c | 2 +-
5 files changed, 44 insertions(+), 1 deletion(-)
5 files changed, 43 insertions(+), 2 deletions(-)
create mode 100644 boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c
diff --git a/boards/arm/arduino_nano_33_ble/CMakeLists.txt b/boards/arm/arduino_nano_33_ble/CMakeLists.txt
index 9e885f42ab8..37495cb885c 100644
index 9e885f42ab..a40f17b396 100644
--- a/boards/arm/arduino_nano_33_ble/CMakeLists.txt
+++ b/boards/arm/arduino_nano_33_ble/CMakeLists.txt
@@ -11,3 +11,6 @@ if(CONFIG_BOARD_ARDUINO_NANO_33_BLE_INIT_SENSORS)
@@ -5,9 +5,10 @@ add_library(arduino_nano_33_ble_pins INTERFACE)
target_include_directories(arduino_nano_33_ble_pins
INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/inc/")
+zephyr_library()
+zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/init_usb_cdc_acm.c")
if(CONFIG_BOARD_ARDUINO_NANO_33_BLE_INIT_SENSORS)
- zephyr_library()
zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/init_sensors.c")
target_link_libraries(${ZEPHYR_CURRENT_LIBRARY} PRIVATE arduino_nano_33_ble_pins)
endif()
+
+zephyr_library()
+zephyr_library_sources("${CMAKE_CURRENT_SOURCE_DIR}/src/init_usb_cdc_acm.c")
diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts
index 7e509086d27..aa769b87f0c 100644
index 7e509086d2..aa769b87f0 100644
--- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts
+++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble.dts
@@ -34,6 +34,10 @@
......@@ -53,7 +58,7 @@ index 7e509086d27..aa769b87f0c 100644
// All PWM's should be enaled
&pwm0 {
diff --git a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig
index 5fbe4ccdfb0..3e3c51635dc 100644
index 5fbe4ccdfb..3e3c51635d 100644
--- a/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig
+++ b/boards/arm/arduino_nano_33_ble/arduino_nano_33_ble_defconfig
@@ -18,3 +18,9 @@ CONFIG_BOOTLOADER_BOSSA_LEGACY=y
......@@ -68,7 +73,7 @@ index 5fbe4ccdfb0..3e3c51635dc 100644
+CONFIG_BOARD_ARDUINO_NANO_33_BLE_EN_USB_CONSOLE=y
diff --git a/boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c b/boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c
new file mode 100644
index 00000000000..a429cc5c8ca
index 0000000000..a429cc5c8c
--- /dev/null
+++ b/boards/arm/arduino_nano_33_ble/src/init_usb_cdc_acm.c
@@ -0,0 +1,25 @@
......@@ -98,7 +103,7 @@ index 00000000000..a429cc5c8ca
+}
+SYS_INIT(board_internal_usb_cdc_acm_init, APPLICATION, 99);
diff --git a/subsys/shell/backends/shell_uart.c b/subsys/shell/backends/shell_uart.c
index 18f26db7638..cda2baf3643 100644
index 18f26db763..cda2baf364 100644
--- a/subsys/shell/backends/shell_uart.c
+++ b/subsys/shell/backends/shell_uart.c
@@ -335,7 +335,7 @@ static int enable_shell_uart(const struct device *arg)
......@@ -111,5 +116,5 @@ index 18f26db7638..cda2baf3643 100644
const struct shell *shell_backend_uart_get_ptr(void)
--
2.25.1
2.34.1
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment