disable CDC ACM when not debugging
This commit is contained in:
parent
04a85db303
commit
e7f01f4e55
@ -114,15 +114,10 @@ USBD_ClassTypeDef USBD_HID =
|
|||||||
NULL,
|
NULL,
|
||||||
|
|
||||||
|
|
||||||
|
USBD_HID_GetFSCfgDesc,
|
||||||
NULL,
|
USBD_HID_GetFSCfgDesc,
|
||||||
NULL,
|
USBD_HID_GetFSCfgDesc,
|
||||||
NULL,
|
USBD_HID_GetDeviceQualifierDesc,
|
||||||
NULL,
|
|
||||||
// USBD_HID_GetFSCfgDesc,
|
|
||||||
// USBD_HID_GetFSCfgDesc,
|
|
||||||
// USBD_HID_GetFSCfgDesc,
|
|
||||||
// USBD_HID_GetDeviceQualifierDesc,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#define USBD_HID_CfgHSDesc USBD_HID_OtherSpeedCfgDesc
|
#define USBD_HID_CfgHSDesc USBD_HID_OtherSpeedCfgDesc
|
||||||
|
@ -208,7 +208,7 @@ void usb_init()
|
|||||||
// Enable USB Clock
|
// Enable USB Clock
|
||||||
SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN);
|
SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN);
|
||||||
|
|
||||||
|
#if DEBUG_LEVEL > 0
|
||||||
USBD_Composite_Set_Classes(&USBD_HID, &USBD_CDC);
|
USBD_Composite_Set_Classes(&USBD_HID, &USBD_CDC);
|
||||||
in_endpoint_to_class[HID_EPIN_ADDR & 0x7F] = 0;
|
in_endpoint_to_class[HID_EPIN_ADDR & 0x7F] = 0;
|
||||||
out_endpoint_to_class[HID_EPOUT_ADDR & 0x7F] = 0;
|
out_endpoint_to_class[HID_EPOUT_ADDR & 0x7F] = 0;
|
||||||
@ -222,6 +222,10 @@ void usb_init()
|
|||||||
//
|
//
|
||||||
// USBD_RegisterClass(&Solo_USBD_Device, &USBD_CDC);
|
// USBD_RegisterClass(&Solo_USBD_Device, &USBD_CDC);
|
||||||
USBD_CDC_RegisterInterface(&Solo_USBD_Device, &USBD_Interface_fops_FS);
|
USBD_CDC_RegisterInterface(&Solo_USBD_Device, &USBD_Interface_fops_FS);
|
||||||
|
#else
|
||||||
|
USBD_Init(&Solo_USBD_Device, &Solo_Desc, 0);
|
||||||
|
USBD_RegisterClass(&Solo_USBD_Device, &USBD_HID);
|
||||||
|
#endif
|
||||||
|
|
||||||
USBD_Start(&Solo_USBD_Device);
|
USBD_Start(&Solo_USBD_Device);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user