Skip to content

Commit

Permalink
usb: usb_device: fix set configuration request
Browse files Browse the repository at this point in the history
Fix set configuration request for a configuration without
specific endpoint like USB DFU class.

The changes introduced in commit 2b58594
("usb: device: Use set_endpoint helper for set_config")
does not take into account that a configuration could only
contain control endpoint.

Signed-off-by: Johann Fischer <j.fischer@phytec.de>
  • Loading branch information
jfischer-no authored and nashif committed May 3, 2019
1 parent 9915b4e commit 714c8ff
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions subsys/usb/usb_device.c
Expand Up @@ -519,6 +519,10 @@ static bool usb_set_configuration(u8_t config_index, u8_t alt_setting)
case DESC_CONFIGURATION: case DESC_CONFIGURATION:
/* remember current configuration index */ /* remember current configuration index */
cur_config = p[CONF_DESC_bConfigurationValue]; cur_config = p[CONF_DESC_bConfigurationValue];
if (cur_config == config_index) {
found = true;
}

break; break;


case DESC_INTERFACE: case DESC_INTERFACE:
Expand Down

0 comments on commit 714c8ff

Please sign in to comment.