usb: Return configuration = 0 in Addressed state.
This is as per USB 2.0 chapter 9 specifications, and enables passing of USB-IF Chapter 9 tests.
This commit is contained in:
parent
63fda0a231
commit
d7f09d1178
@ -312,9 +312,13 @@ static int usb_standard_get_configuration(usbd_device *usbd_dev,
|
||||
if (*len > 1) {
|
||||
*len = 1;
|
||||
}
|
||||
const struct usb_config_descriptor *cfg =
|
||||
&usbd_dev->config[usbd_dev->current_config - 1];
|
||||
(*buf)[0] = cfg->bConfigurationValue;
|
||||
if (usbd_dev->current_config > 0) {
|
||||
const struct usb_config_descriptor *cfg =
|
||||
&usbd_dev->config[usbd_dev->current_config - 1];
|
||||
(*buf)[0] = cfg->bConfigurationValue;
|
||||
} else {
|
||||
(*buf)[0] = 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user