From 3a4cbacbff3a8d0c98e7fe075ab7917535ab5c07 Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Tue, 28 Mar 2017 00:42:06 +0200 Subject: [PATCH] trezorhal: fix missing rx_buffer --- micropython/firmware/main.c | 1 + micropython/trezorhal/usb_hid-impl.h | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/micropython/firmware/main.c b/micropython/firmware/main.c index 75df51050..514fccc44 100644 --- a/micropython/firmware/main.c +++ b/micropython/firmware/main.c @@ -40,6 +40,7 @@ int usb_init_all(void) { .ep_out = 0x01, .subclass = 0, .protocol = 0, + .rx_buffer = rx_buffer, .max_packet_len = sizeof(rx_buffer), .polling_interval = 1, .report_desc_len = 34, diff --git a/micropython/trezorhal/usb_hid-impl.h b/micropython/trezorhal/usb_hid-impl.h index a385122a6..9a8a963ff 100644 --- a/micropython/trezorhal/usb_hid-impl.h +++ b/micropython/trezorhal/usb_hid-impl.h @@ -18,7 +18,8 @@ int usb_hid_add(const usb_hid_info_t *info) { if ((info->iface_num < usb_config_desc->bNumInterfaces) || (info->iface_num >= USBD_MAX_NUM_INTERFACES) || ((info->ep_in & 0x80) == 0) || - ((info->ep_out & 0x80) != 0)) { + ((info->ep_out & 0x80) != 0) || + (info->rx_buffer == NULL)) { return 1; // Invalid configuration values }