usb: get_configuration should return bConfigurationValue
Rather than the index of the config. This happens to be the same thing if you have zero based sequential configurations.
This commit is contained in:
parent
7cd7212577
commit
53c1d2c8d9
|
@ -310,7 +310,8 @@ static int usb_standard_get_configuration(usbd_device *usbd_dev,
|
|||
if (*len > 1) {
|
||||
*len = 1;
|
||||
}
|
||||
(*buf)[0] = usbd_dev->current_config;
|
||||
const struct usb_config_descriptor *cfg = &usbd_dev->config[usbd_dev->current_config - 1];
|
||||
(*buf)[0] = cfg->bConfigurationValue;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue