Skip to content

Commit 461b174

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 561c894 commit 461b174

File tree

5 files changed

+4
-26
lines changed

5 files changed

+4
-26
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 & 18 deletions
This file was deleted.

samples/boards/sensortile_box/prj.conf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@ CONFIG_IIS3DHHC_TRIGGER_OWN_THREAD=y
2323
CONFIG_LIS2MDL=y
2424
CONFIG_LIS2MDL_TRIGGER_NONE=y
2525

26-
# config USB and USB console
26+
# config USB device support
2727
CONFIG_USB_DEVICE_VID=0x0483
2828
CONFIG_USB_DEVICE_PID=0x1234
29-
CONFIG_USB_DEVICE_STACK=y
3029
CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC SensorTile.box"
3130

32-
CONFIG_USB_UART_CONSOLE=y
33-
CONFIG_UART_INTERRUPT_DRIVEN=y
34-
CONFIG_UART_LINE_CTRL=y
3531
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include <drivers/i2c.h>
1313
#include <drivers/spi.h>
1414
#include <drivers/sensor.h>
15-
#include <usb/usb_device.h>
1615
#include <drivers/uart.h>
1716

1817
#include <stdio.h>
@@ -255,8 +254,7 @@ void main(void)
255254
int cnt = 1;
256255
uint32_t dtr = 0;
257256

258-
/* Application must enable USB by itself */
259-
if (!device_is_ready(dev) || usb_enable(NULL)) {
257+
if (!device_is_ready(dev)) {
260258
return;
261259
}
262260

0 commit comments

Comments
 (0)