File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,13 +41,13 @@ struct sketch_header_v1 {
4141
4242#define SKETCH_RAM_BUFFER_LEN 131072
4343
44- #define TARGET_HAS_USB_CDC \
45- DT_NODE_HAS_PROP(DT_PATH(zephyr_user), cdc_acm) && \
46- (CONFIG_USB_DEVICE_STACK || CONFIG_USB_DEVICE_STACK_NEXT)
47-
48- #if TARGET_HAS_USB_CDC
44+ /* Need to replicate logic from zephyrSerial.h to avoid C++ here */
45+ #define ZARD_FIRST_SERIAL_IS_SERIALUSB \
46+ DT_NODE_HAS_PROP(DT_PATH(zephyr_user), cdc_acm_serial) && \
47+ (CONFIG_USB_CDC_ACM || CONFIG_USBD_CDC_ACM_CLASS)
48+ #if ZARD_FIRST_SERIAL_IS_SERIALUSB
4949const struct device * const usb_dev =
50- DEVICE_DT_GET (DT_PHANDLE_BY_IDX (DT_PATH (zephyr_user ), cdc_acm , 0 ));
50+ DEVICE_DT_GET (DT_PHANDLE_BY_IDX (DT_PATH (zephyr_user ), cdc_acm_serial , 0 ));
5151
5252#if CONFIG_USB_DEVICE_STACK_NEXT
5353#include <zephyr/usb/usbd.h>
@@ -145,7 +145,7 @@ static int loader(const struct shell *sh) {
145145 // This is not a valid sketch, but try to start a shell anyway
146146 }
147147
148- #if TARGET_HAS_USB_CDC
148+ #if ZARD_FIRST_SERIAL_IS_SERIALUSB
149149 int debug = (!sketch_valid ) || (sketch_hdr -> flags & SKETCH_FLAG_DEBUG );
150150#if CONFIG_SHELL
151151 if (strcmp (k_thread_name_get (k_current_get ()), "main" ) == 0 ) {
You can’t perform that action at this time.
0 commit comments