Skip to content

Commit 7492510

Browse files
committed
samples: sensortile_box: use generic CDC ACM shield
Remove CDC ACM UART devicetree overlay, and explicit USB support initialization in favor of generic CDC ACM shield. For console support via USB CDC ACM, this example is to be built as follows: west build -b sensortile_box samples/boards/sensortile_box -- -DSHIELD=cdc_acm_console Signed-off-by: Johann Fischer <[email protected]>
1 parent c839bde commit 7492510

File tree

5 files changed

+4
-23
lines changed

5 files changed

+4
-23
lines changed

samples/boards/sensortile_box/README.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Build and flash the sample in the following way:
3737
.. zephyr-app-commands::
3838
:zephyr-app: samples/boards/sensortile_box
3939
:board: sensortile_box
40+
:shield: cdc_acm_console
4041
:goals: build flash
4142

4243
Please note that flashing the board requires a few preliminary steps described

samples/boards/sensortile_box/app.overlay

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

samples/boards/sensortile_box/prj.conf

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,9 @@ CONFIG_STTS751_TRIGGER_NONE=y
1616
CONFIG_IIS3DHHC_TRIGGER_OWN_THREAD=y
1717
CONFIG_LIS2MDL_TRIGGER_NONE=y
1818

19-
# config USB and USB console
19+
# config USB device support
2020
CONFIG_USB_DEVICE_VID=0x0483
2121
CONFIG_USB_DEVICE_PID=0x1234
22-
CONFIG_USB_DEVICE_STACK=y
2322
CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC SensorTile.box"
2423

25-
CONFIG_UART_INTERRUPT_DRIVEN=y
26-
CONFIG_UART_LINE_CTRL=y
2724
CONFIG_CBPRINTF_FP_SUPPORT=y

samples/boards/sensortile_box/sample.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ tests:
77
platform_allow: sensortile_box
88
tags: sensors
99
depends_on: i2c spi gpio
10+
extra_args: SHIELD="cdc_acm_console"

samples/boards/sensortile_box/src/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,7 @@ void main(void)
256256
int cnt = 1;
257257
uint32_t dtr = 0;
258258

259-
/* Application must enable USB by itself */
260-
if (!device_is_ready(dev) || usb_enable(NULL)) {
259+
if (!device_is_ready(dev)) {
261260
return;
262261
}
263262

0 commit comments

Comments
 (0)