From 547688c58cce3436082cc9338929c2699410c0e1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Thu, 10 Sep 2020 20:43:07 +1000 Subject: [PATCH] stm32/usb: Don't nul pyb_hid_report_desc if MICROPY_HW_USB_HID disabled. So this code can be used if pyb_hid_report_desc is not included in the port's root pointer list. Signed-off-by: Damien George --- ports/stm32/usb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/stm32/usb.c b/ports/stm32/usb.c index 657d4cb6e..968b2999c 100644 --- a/ports/stm32/usb.c +++ b/ports/stm32/usb.c @@ -221,7 +221,9 @@ void pyb_usb_init0(void) { for (int i = 0; i < MICROPY_HW_USB_CDC_NUM; ++i) { usb_device.usbd_cdc_itf[i].attached_to_repl = false; } + #if MICROPY_HW_USB_HID MP_STATE_PORT(pyb_hid_report_desc) = MP_OBJ_NULL; + #endif pyb_usb_vcp_init0(); }