fix bmRequestType field - use of defines
Signed-off-by: Amir Hammad <amir.hammad@hotmail.com>
This commit is contained in:
parent
5615b9c938
commit
3493c1c087
4 changed files with 18 additions and 18 deletions
|
|
@ -337,7 +337,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
|
|||
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b10000000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_GET_DESCRIPTOR;
|
||||
setup_data.wValue = USB_DT_DEVICE << 8;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
@ -394,7 +394,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
|
|||
dev->packet_size_max0 = ddt->bMaxPacketSize0;
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b10000000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_GET_DESCRIPTOR;
|
||||
setup_data.wValue = USB_DT_CONFIGURATION << 8;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
@ -457,7 +457,7 @@ static void device_enumerate(usbh_device_t *dev, usbh_packet_callback_data_t cb_
|
|||
(struct usb_config_descriptor *)&usbh_buffer[USB_DT_DEVICE_SIZE];
|
||||
struct usb_setup_data setup_data;
|
||||
LOG_PRINTF("WRITE: LEN: %d", cdt->wTotalLength);
|
||||
setup_data.bmRequestType = 0b10000000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_GET_DESCRIPTOR;
|
||||
setup_data.wValue = USB_DT_CONFIGURATION << 8;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
@ -573,7 +573,7 @@ void device_enumeration_start(usbh_device_t *dev)
|
|||
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00000000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_SET_ADDRESS;
|
||||
setup_data.wValue = address;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
|
|||
|
|
@ -300,7 +300,7 @@ static void midi_poll(void *drvdata, uint32_t t_us)
|
|||
//~ LOG_PRINTF("CFGVAL: %d\n", dev->config_val);
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00000000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_SET_CONFIGURATION;
|
||||
setup_data.wValue = midi->buffer[0];
|
||||
setup_data.wIndex = 0;
|
||||
|
|
|
|||
|
|
@ -364,7 +364,7 @@ static void poll(void *drvdata, uint32_t time_curr_us)
|
|||
{
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00000000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_SET_CONFIGURATION;
|
||||
setup_data.wValue = gp_xbox->configuration_value;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
|
|||
|
|
@ -179,9 +179,9 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
struct usb_setup_data setup_data;
|
||||
// If regular port event, else hub event
|
||||
if (port) {
|
||||
setup_data.bmRequestType = 0b10100011;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT;
|
||||
} else {
|
||||
setup_data.bmRequestType = 0b10100000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE;
|
||||
}
|
||||
|
||||
setup_data.bRequest = USB_REQ_GET_STATUS;
|
||||
|
|
@ -246,7 +246,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
struct usb_setup_data setup_data;
|
||||
hub->desc_len = hub->device[0]->packet_size_max0;
|
||||
|
||||
setup_data.bmRequestType = 0b10100000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_GET_DESCRIPTOR;
|
||||
setup_data.wValue = 0x29<<8;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
@ -297,7 +297,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
struct usb_setup_data setup_data;
|
||||
hub->desc_len = hub_descriptor->head.bDescLength;
|
||||
|
||||
setup_data.bmRequestType = 0b10100000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_GET_DESCRIPTOR;
|
||||
setup_data.wValue = 0x29<<8;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
@ -361,7 +361,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
struct usb_setup_data setup_data;
|
||||
|
||||
LOG_PRINTF("[!%d!]",hub->index);
|
||||
setup_data.bmRequestType = 0b00100011;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT;
|
||||
setup_data.bRequest = HUB_REQ_SET_FEATURE;
|
||||
setup_data.wValue = HUB_FEATURE_PORT_POWER;
|
||||
setup_data.wIndex = hub->index;
|
||||
|
|
@ -400,7 +400,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
{
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b10100000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_GET_STATUS;
|
||||
setup_data.wValue = 0;
|
||||
setup_data.wIndex = 0;
|
||||
|
|
@ -445,7 +445,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
{
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b10100011;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_IN | USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT;
|
||||
setup_data.bRequest = USB_REQ_GET_STATUS;
|
||||
setup_data.wValue = 0;
|
||||
setup_data.wIndex = ++hub->index;
|
||||
|
|
@ -564,7 +564,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
// clear feature C_PORT_CONNECTION
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00100011;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT;
|
||||
setup_data.bRequest = HUB_REQ_CLEAR_FEATURE;
|
||||
setup_data.wValue = HUB_FEATURE_C_PORT_CONNECTION;
|
||||
setup_data.wIndex = port;
|
||||
|
|
@ -580,7 +580,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
// Reset processing is complete, enumerate device
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00100011;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT;
|
||||
setup_data.bRequest = HUB_REQ_CLEAR_FEATURE;
|
||||
setup_data.wValue = HUB_FEATURE_C_PORT_RESET;
|
||||
setup_data.wIndex = port;
|
||||
|
|
@ -622,7 +622,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
if ((stc) & (1<<HUB_FEATURE_PORT_CONNECTION)) {
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00100011;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT;
|
||||
setup_data.bRequest = HUB_REQ_SET_FEATURE;
|
||||
setup_data.wValue = HUB_FEATURE_PORT_RESET;
|
||||
setup_data.wIndex = port;
|
||||
|
|
@ -687,7 +687,7 @@ static void event(usbh_device_t *dev, usbh_packet_callback_data_t cb_data)
|
|||
// Disable Low speed device immediately
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00100011;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_CLASS | USB_REQ_TYPE_INTERFACE | USB_REQ_TYPE_ENDPOINT;
|
||||
setup_data.bRequest = HUB_REQ_CLEAR_FEATURE;
|
||||
setup_data.wValue = HUB_FEATURE_PORT_ENABLE;
|
||||
setup_data.wIndex = port;
|
||||
|
|
@ -782,7 +782,7 @@ static void poll(void *drvdata, uint32_t time_curr_us)
|
|||
LOG_PRINTF("CFGVAL: %d\n", hub->buffer[0]);
|
||||
struct usb_setup_data setup_data;
|
||||
|
||||
setup_data.bmRequestType = 0b00000000;
|
||||
setup_data.bmRequestType = USB_REQ_TYPE_STANDARD | USB_REQ_TYPE_DEVICE;
|
||||
setup_data.bRequest = USB_REQ_SET_CONFIGURATION;
|
||||
setup_data.wValue = hub->buffer[0];
|
||||
setup_data.wIndex = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue