diff --git a/core/usb/device.h b/core/usb/device.h index 832db364..20b64902 100644 --- a/core/usb/device.h +++ b/core/usb/device.h @@ -51,7 +51,7 @@ typedef struct usb_transfer_info { uint16_t length, max_pkt_size; usb_transfer_status_t status : 8; uint8_t address : 7, : 1, endpoint : 4; - usb_transfer_type_t type : 3; + uint8_t type : 3; /* usb_transfer_type_t */ bool direction : 1; } usb_transfer_info_t; @@ -72,7 +72,7 @@ typedef struct usb_event { usb_progress_handler_t *progress_handler; void *progress_context, *context; bool host : 1; - usb_speed_t speed : 2; + uint8_t speed : 2; /* usb_speed_t */ usb_event_type_t type; union { usb_init_info_t init; diff --git a/core/usb/physical.c b/core/usb/physical.c index ffc42df9..876a9402 100644 --- a/core/usb/physical.c +++ b/core/usb/physical.c @@ -114,16 +114,18 @@ struct hub { port_t ports[]; }; +enum device_state { + DEVICE_STATE_ATTACHED, + DEVICE_STATE_POWERED, + DEVICE_STATE_DEFAULT_OR_ADDRESS, + DEVICE_STATE_CONFIGURED, +}; + struct device { node_t node; libusb_device_handle *handle; endpoint_t endpoints[0x20]; - enum device_state { - DEVICE_STATE_ATTACHED, - DEVICE_STATE_POWERED, - DEVICE_STATE_DEFAULT_OR_ADDRESS, - DEVICE_STATE_CONFIGURED, - } state : 2; + uint8_t state : 2; /* enum device_state */ uint8_t address : 7, numPorts : 7; hub_t hub; };