Skip to content

Commit 3f39e1c

Browse files
jfischer-nocfriedt
authored andcommitted
samples: modbus: use new USB device stack
Use new USB device stack. Signed-off-by: Johann Fischer <[email protected]>
1 parent c2d00d5 commit 3f39e1c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
CONFIG_USB_DEVICE_STACK=y
2-
CONFIG_USB_DEVICE_PRODUCT="Zephyr CDC ACM MODBUS sample"
1+
CONFIG_USB_DEVICE_STACK_NEXT=y
2+
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=y
3+
CONFIG_CDC_ACM_SERIAL_PRODUCT_STRING="Zephyr CDC ACM MODBUS sample"
34
CONFIG_UART_LINE_CTRL=y
4-
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n

samples/subsys/modbus/rtu_server/sample.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ tests:
3333
extra_args:
3434
- EXTRA_CONF_FILE="overlay-cdc-acm.conf"
3535
- DTC_OVERLAY_FILE="cdc-acm.overlay"
36-
depends_on: usb_device
36+
depends_on: usbd

samples/subsys/modbus/rtu_server/src/main.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
#include <zephyr/sys/util.h>
1010
#include <zephyr/drivers/gpio.h>
1111
#include <zephyr/modbus/modbus.h>
12-
#include <zephyr/usb/usb_device.h>
1312

1413
#include <zephyr/logging/log.h>
1514
LOG_MODULE_REGISTER(mbs_sample, LOG_LEVEL_INF);
@@ -147,7 +146,7 @@ int main(void)
147146
const struct device *const dev = DEVICE_DT_GET(DT_PARENT(MODBUS_NODE));
148147
uint32_t dtr = 0;
149148

150-
if (!device_is_ready(dev) || usb_enable(NULL)) {
149+
if (!device_is_ready(dev)) {
151150
return 0;
152151
}
153152

0 commit comments

Comments
 (0)