diff --git a/embed/trezorhal/usb.c b/embed/trezorhal/usb.c index 692cb53b6..6f548a328 100644 --- a/embed/trezorhal/usb.c +++ b/embed/trezorhal/usb.c @@ -217,14 +217,14 @@ static const USBD_DescriptorsTypeDef usb_descriptors = { static uint8_t usb_class_init(USBD_HandleTypeDef *dev, uint8_t cfg_idx) { for (int i = 0; i < USBD_MAX_NUM_INTERFACES; i++) { switch (usb_ifaces[i].type) { - case USB_IFACE_TYPE_HID: - usb_hid_class_init(dev, &usb_ifaces[i].hid, cfg_idx); - break; - case USB_IFACE_TYPE_VCP: - usb_vcp_class_init(dev, &usb_ifaces[i].vcp, cfg_idx); - break; - default: - break; + case USB_IFACE_TYPE_HID: + usb_hid_class_init(dev, &usb_ifaces[i].hid, cfg_idx); + break; + case USB_IFACE_TYPE_VCP: + usb_vcp_class_init(dev, &usb_ifaces[i].vcp, cfg_idx); + break; + default: + break; } } return USBD_OK; diff --git a/embed/trezorhal/usb_hid-impl.h b/embed/trezorhal/usb_hid-impl.h index e50c9feff..d3bac4a2e 100644 --- a/embed/trezorhal/usb_hid-impl.h +++ b/embed/trezorhal/usb_hid-impl.h @@ -248,25 +248,25 @@ static int usb_hid_class_setup(USBD_HandleTypeDef *dev, usb_hid_state_t *state, case USB_REQ_TYPE_CLASS: switch (req->bRequest) { - case USB_HID_REQ_SET_PROTOCOL: - state->protocol = req->wValue; - break; + case USB_HID_REQ_SET_PROTOCOL: + state->protocol = req->wValue; + break; - case USB_HID_REQ_GET_PROTOCOL: - USBD_CtlSendData(dev, &state->protocol, sizeof(state->protocol)); - break; + case USB_HID_REQ_GET_PROTOCOL: + USBD_CtlSendData(dev, &state->protocol, sizeof(state->protocol)); + break; - case USB_HID_REQ_SET_IDLE: - state->idle_rate = req->wValue >> 8; - break; + case USB_HID_REQ_SET_IDLE: + state->idle_rate = req->wValue >> 8; + break; - case USB_HID_REQ_GET_IDLE: - USBD_CtlSendData(dev, &state->idle_rate, sizeof(state->idle_rate)); - break; + case USB_HID_REQ_GET_IDLE: + USBD_CtlSendData(dev, &state->idle_rate, sizeof(state->idle_rate)); + break; - default: - USBD_CtlError(dev, req); - return USBD_FAIL; + default: + USBD_CtlError(dev, req); + return USBD_FAIL; } break;