mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-18 03:52:11 +01:00
usb: make sure USB device is off limits until it has been init'ed
USB device was being accessed prior to being initialized. This resulted in a hard-fault or NMI when using any endpoint beyond 0 or 1 which are init'ed by the BL. This broke VCP which is on endpoint 2 (control) and 3 (data). This bug was introduced in 5ad37e69 which stopped checking the transfer_possible variable.
This commit is contained in:
parent
7e6a222a8e
commit
d7d670036b
@ -222,7 +222,6 @@ bool PIOS_USB_CheckAvailable(uint8_t id)
|
||||
return 0;
|
||||
|
||||
usb_found = (usb_dev->cfg->vsense.gpio->IDR & usb_dev->cfg->vsense.init.GPIO_Pin);
|
||||
return usb_found;
|
||||
return usb_found != 0 && transfer_possible ? 1 : 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user