Skip to content
Permalink
Browse files

usb: usb_device: fix set configuration request

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-phytec-iot authored and nashif committed Apr 26, 2019
1 parent 9915b4e commit 714c8ff28ef2655d14457528618c92bdbe2094b9
Showing with 4 additions and 0 deletions.
  1. +4 −0 subsys/usb/usb_device.c
@@ -519,6 +519,10 @@ static bool usb_set_configuration(u8_t config_index, u8_t alt_setting)
case DESC_CONFIGURATION:
/* remember current configuration index */
cur_config = p[CONF_DESC_bConfigurationValue];
if (cur_config == config_index) {
found = true;
}

break;

case DESC_INTERFACE:

0 comments on commit 714c8ff

Please sign in to comment.
You can’t perform that action at this time.