1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 15:38:11 +00:00

trezorhal: added calls to USBD_LL_FlushEP in deinit functions

This commit is contained in:
Pavol Rusnak 2017-10-24 19:19:57 +02:00
parent 9e31e0f4d4
commit 8bd258db6f
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 7 additions and 0 deletions

View File

@ -233,6 +233,9 @@ static void usb_hid_class_init(USBD_HandleTypeDef *dev, usb_hid_state_t *state,
} }
static void usb_hid_class_deinit(USBD_HandleTypeDef *dev, usb_hid_state_t *state, uint8_t cfg_idx) { static void usb_hid_class_deinit(USBD_HandleTypeDef *dev, usb_hid_state_t *state, uint8_t cfg_idx) {
// Flush endpoints
USBD_LL_FlushEP(dev, state->ep_in);
USBD_LL_FlushEP(dev, state->ep_out);
// Close endpoints // Close endpoints
USBD_LL_CloseEP(dev, state->ep_in); USBD_LL_CloseEP(dev, state->ep_in);
USBD_LL_CloseEP(dev, state->ep_out); USBD_LL_CloseEP(dev, state->ep_out);

View File

@ -331,6 +331,10 @@ static void usb_vcp_class_init(USBD_HandleTypeDef *dev, usb_vcp_state_t *state,
} }
static void usb_vcp_class_deinit(USBD_HandleTypeDef *dev, usb_vcp_state_t *state, uint8_t cfg_idx) { static void usb_vcp_class_deinit(USBD_HandleTypeDef *dev, usb_vcp_state_t *state, uint8_t cfg_idx) {
// Flush endpoints
USBD_LL_FlushEP(dev, state->ep_in);
USBD_LL_FlushEP(dev, state->ep_out);
USBD_LL_FlushEP(dev, state->ep_cmd);
// Close endpoints // Close endpoints
USBD_LL_CloseEP(dev, state->ep_in); USBD_LL_CloseEP(dev, state->ep_in);
USBD_LL_CloseEP(dev, state->ep_out); USBD_LL_CloseEP(dev, state->ep_out);