From 40e20e2e9d393f0dbccb8be49326c3f344aac1e8 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Fri, 2 Feb 2018 20:06:25 +0100 Subject: [PATCH] trezorhal: fix usb class behaviour --- Makefile | 2 +- embed/trezorhal/usbd_core.c | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 02e223f3..f0190626 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ style: ## run code style check on application sources and tests ## build commands: -build: build_boardloader build_bootloader build_prodtest build_firmware build_unix build_cross ## build all +build: build_boardloader build_bootloader build_firmware build_prodtest build_unix ## build all build_boardloader: ## build boardloader $(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" $(BOARDLOADER_BUILD_DIR)/boardloader.bin diff --git a/embed/trezorhal/usbd_core.c b/embed/trezorhal/usbd_core.c index 265cf86c..2f62e497 100644 --- a/embed/trezorhal/usbd_core.c +++ b/embed/trezorhal/usbd_core.c @@ -271,6 +271,7 @@ USBD_StatusTypeDef USBD_LL_SetupStage(USBD_HandleTypeDef *pdev, uint8_t *psetup) switch (pdev->request.bmRequest & USB_REQ_TYPE_MASK) { case USB_REQ_TYPE_STANDARD: + case USB_REQ_TYPE_CLASS: switch (pdev->request.bmRequest & USB_REQ_RECIPIENT_MASK) { case USB_REQ_RECIPIENT_DEVICE: @@ -288,15 +289,6 @@ USBD_StatusTypeDef USBD_LL_SetupStage(USBD_HandleTypeDef *pdev, uint8_t *psetup) } break; - case USB_REQ_TYPE_CLASS: - if (pdev->dev_state == USBD_STATE_CONFIGURED) { - if (pdev->pClass->Setup != NULL) - pdev->pClass->Setup(pdev, &pdev->request); - } else { - USBD_CtlError(pdev, &pdev->request); - } - break; - case USB_REQ_TYPE_VENDOR: if (pdev->dev_state == USBD_STATE_CONFIGURED || pdev->dev_state == USBD_STATE_ADDRESSED) { if (pdev->pClass->Setup != NULL)