From a78221fd222cab657db828f012a66b623c2dcc0e Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 28 Mar 2017 01:15:14 +0200 Subject: [PATCH] trezorhal: fix IN endpoint detection --- micropython/trezorhal/usb_hid-impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/micropython/trezorhal/usb_hid-impl.h b/micropython/trezorhal/usb_hid-impl.h index 0938dc97..c360ff4d 100644 --- a/micropython/trezorhal/usb_hid-impl.h +++ b/micropython/trezorhal/usb_hid-impl.h @@ -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) { - if (ep_num == state->ep_in) { + if ((ep_num | 0x80) == state->ep_in) { // Ensure that the FIFO is empty before a new transfer, // this condition could be caused by a new transfer // before the end of the previous transfer.