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 <damien@micropython.org>
pull/6399/head
Damien George 2020-09-10 20:43:07 +10:00
rodzic 27e117307d
commit 547688c58c
1 zmienionych plików z 2 dodań i 0 usunięć

Wyświetl plik

@ -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();
}