mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-01-29 14:52:12 +01:00
usbhook: add support in API for deactivating USB
This commit is contained in:
parent
cb9c3a9b7e
commit
c854c3f4a4
@ -86,6 +86,13 @@ void PIOS_USBHOOK_Activate(void)
|
||||
&user_callbacks);
|
||||
}
|
||||
|
||||
void PIOS_USBHOOK_Deactivate(void)
|
||||
{
|
||||
DCD_DevDisconnect(&pios_usb_otg_core_handle);
|
||||
USBD_DeInit(&pios_usb_otg_core_handle);
|
||||
USB_OTG_StopDevice(&pios_usb_otg_core_handle);
|
||||
}
|
||||
|
||||
void OTG_FS_IRQHandler(void)
|
||||
{
|
||||
if(!USBD_OTG_ISR_Handler(&pios_usb_otg_core_handle)) {
|
||||
|
@ -72,6 +72,7 @@ extern void PIOS_USBHOOK_CtrlRx(uint8_t *buf, uint16_t len);
|
||||
extern void PIOS_USBHOOK_EndpointTx(uint8_t epnum, const uint8_t *buf, uint16_t len);
|
||||
extern void PIOS_USBHOOK_EndpointRx(uint8_t epnum, uint8_t *buf, uint16_t len);
|
||||
extern void PIOS_USBHOOK_Activate(void);
|
||||
extern void PIOS_USBHOOK_Deactivate(void);
|
||||
|
||||
#endif /* PIOS_USBHOOK_H */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user