mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
trezorhal: more switch formatting
This commit is contained in:
parent
30ff61b588
commit
9d10a7a508
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user