debug usb-cdc uart: disable it.

Currently unused.

Change-Id: I5f39c0fe82cbfa6f2bc4b84784a7142b461b64fb
This commit is contained in:
Eric Wild 2021-11-26 21:17:37 +01:00 committed by Hoernchen
parent 648f6309c6
commit 51b2facc66
4 changed files with 27 additions and 4 deletions

View File

@ -506,8 +506,10 @@ DWT->FUNCTION1 = (0b10 << DWT_FUNCTION_DATAVSIZE_Pos) | /* DATAVSIZE 10 - dw
usb_start();
board_init();
command_init("sysmoOCTSIM> ");
#ifdef WITH_DEBUG_CDC
command_init("sysmoOCTSIM> ");
#endif
/* boost uart priority by setting all other irqs to uartprio+1 */
for(int i = 0; i < PERIPH_COUNT_IRQn; i++)
NVIC_SetPriority(i, 2);

View File

@ -46,17 +46,24 @@ const struct usb_desc_collection usb_fs_descs = {
.bLength = sizeof(struct usb_config_desc),
.bDescriptorType = USB_DT_CONFIG,
.wTotalLength = sizeof(usb_fs_descs.cfg) +
#ifdef WITH_DEBUG_CDC
sizeof(usb_fs_descs.cdc) +
#endif
sizeof(usb_fs_descs.ccid) +
sizeof(usb_fs_descs.dfu_rt) +
sizeof(usb_fs_descs.func_dfu),
#ifdef WITH_DEBUG_CDC
.bNumInterfaces = 4,
#else
.bNumInterfaces = 2,
#endif
.bConfigurationValue = CONF_USB_CDCD_ACM_BCONFIGVAL,
.iConfiguration = STR_DESC_CONFIG,
.bmAttributes = CONF_USB_CDCD_ACM_BMATTRI,
/* FIXME: The device should offer at least one 100mA configuration. */
.bMaxPower = 250, /* request 500mA */
},
#ifdef WITH_DEBUG_CDC
.cdc = {
.comm = {
.iface = {
@ -139,6 +146,7 @@ const struct usb_desc_collection usb_fs_descs = {
},
},
},
#endif
.ccid = {
.iface = {
.bLength = sizeof(struct usb_iface_desc),
@ -208,7 +216,11 @@ const struct usb_desc_collection usb_fs_descs = {
},
},
},
#ifdef WITH_DEBUG_CDC
DFURT_IF_DESCRIPTOR(3, STR_DESC_INTF_DFURT),
#else
DFURT_IF_DESCRIPTOR(1, STR_DESC_INTF_DFURT),
#endif
.str = {
#if 0
CDCD_ACM_STR_DESCES

View File

@ -43,6 +43,7 @@ struct usb_desc_collection {
struct usb_dev_desc dev;
struct usb_config_desc cfg;
#ifdef WITH_DEBUG_CDC
/* CDC-ACM: Two interfaces, one with IRQ EP and one with BULK IN + OUT */
struct {
struct {
@ -59,6 +60,7 @@ struct usb_desc_collection {
} data;
} cdc;
#endif
/* CCID: One interface with CCID class descriptor and three endpoints */
struct {
struct usb_iface_desc iface;

View File

@ -132,14 +132,14 @@ void cdc_device_acm_init(void)
usbdc_init(ctrl_buffer);
usbdc_register_handler(USBDC_HDL_REQ, &string_req_h);
#ifdef WITH_DEBUG_CDC
/* usbdc_register_funcion inside */
cdcdf_acm_init();
#endif
dfudf_init();
printf("usb_descs_size=%u\r\n", usb_descs[0].eod - usb_descs[0].sod);
usbdc_start((struct usbd_descriptors *) usb_descs);
usbdc_attach();
}
/**
@ -147,15 +147,22 @@ void cdc_device_acm_init(void)
*/
void usb_start(void)
{
#ifdef WITH_DEBUG_CDC
while (!cdcdf_acm_is_enabled()) {
// wait cdc acm to be installed
};
cdcdf_acm_register_callback(CDCDF_ACM_CB_STATE_C, (FUNC_PTR)usb_device_cb_state_c);
#endif
while (!ccid_df_is_enabled());
}
void usb_init(void)
{
cdc_device_acm_init();
ccid_df_init();
usbdc_start((struct usbd_descriptors *) usb_descs);
usbdc_attach();
}