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

trezorhal: fix IN endpoint detection

This commit is contained in:
Jan Pochyla 2017-03-28 01:15:14 +02:00 committed by Pavol Rusnak
parent 33e5ad1ac9
commit a78221fd22

View File

@ -236,7 +236,7 @@ static int usb_hid_class_setup(USBD_HandleTypeDef *dev, usb_hid_state_t *state,
} }
static uint8_t usb_hid_class_data_in(USBD_HandleTypeDef *dev, usb_hid_state_t *state, uint8_t ep_num) { static uint8_t usb_hid_class_data_in(USBD_HandleTypeDef *dev, usb_hid_state_t *state, uint8_t ep_num) {
if (ep_num == state->ep_in) { if ((ep_num | 0x80) == state->ep_in) {
// Ensure that the FIFO is empty before a new transfer, // Ensure that the FIFO is empty before a new transfer,
// this condition could be caused by a new transfer // this condition could be caused by a new transfer
// before the end of the previous transfer. // before the end of the previous transfer.