Skip to content

Commit 1235382

Browse files
facchinmsoburi
authored andcommitted
SerialUSB: create SerialUSB object only if CONFIG_USB_CDC_ACM=y
1 parent 295ce15 commit 1235382

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cores/arduino/USB.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <zephyr/usb/usb_device.h>
1111
#include <SerialUSB.h>
1212

13-
#if (DT_NODE_HAS_PROP(DT_PATH(zephyr_user), cdc_acm) && CONFIG_USB_CDC_ACM)
13+
#if ((DT_NODE_HAS_PROP(DT_PATH(zephyr_user), cdc_acm)) && (CONFIG_USB_CDC_ACM || CONFIG_USBD_CDC_ACM_CLASS))
1414
const struct device *const usb_dev = DEVICE_DT_GET(DT_PHANDLE_BY_IDX(DT_PATH(zephyr_user), cdc_acm, 0));
1515

1616
void usb_status_cb(enum usb_dc_status_code cb_status, const uint8_t *param) {
@@ -67,4 +67,4 @@ arduino::SerialUSB_::operator bool() {
6767
}
6868

6969
arduino::SerialUSB_ Serial(usb_dev);
70-
#endif
70+
#endif

0 commit comments

Comments
 (0)