From 3ba9b671fc1eec23547d5a4314513c7dc6886cd9 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Sat, 24 Aug 2019 16:01:44 +0800 Subject: [PATCH] dont use composit for bootloader --- targets/stm32l432/src/init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/targets/stm32l432/src/init.c b/targets/stm32l432/src/init.c index a51e8b8..bdf42fa 100644 --- a/targets/stm32l432/src/init.c +++ b/targets/stm32l432/src/init.c @@ -706,7 +706,7 @@ void init_usb() // Enable USB Clock SET_BIT(RCC->APB1ENR1, RCC_APB1ENR1_USBFSEN); - +#ifndef IS_BOOTLOADER USBD_Composite_Set_Classes(&USBD_HID, &USBD_CCID, &USBD_CDC); in_endpoint_to_class[HID_EPIN_ADDR & 0x7F] = 0; out_endpoint_to_class[HID_EPOUT_ADDR & 0x7F] = 0; @@ -721,6 +721,10 @@ void init_usb() USBD_RegisterClass(&Solo_USBD_Device, &USBD_Composite); #if DEBUG_LEVEL > 0 USBD_CDC_RegisterInterface(&Solo_USBD_Device, &USBD_Interface_fops_FS); +#endif +#else + USBD_Init(&Solo_USBD_Device, &Solo_Desc, 0); + USBD_RegisterClass(&Solo_USBD_Device, &USBD_HID); #endif USBD_Start(&Solo_USBD_Device); }