Skip to content

Commit 21f4a7d

Browse files
jfischer-nokartben
authored andcommitted
usb: device_next: always reset endpoints to defaults on SetInterface
Disable/enable endpoints even if the new alternate is the same as the current one, forcing the endpoint to reset to defaults. Signed-off-by: Johann Fischer <[email protected]>
1 parent 87caef4 commit 21f4a7d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

subsys/usb/device_next/usbd_interface.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,10 @@ int usbd_interface_set(struct usbd_context *const uds_ctx,
184184
}
185185

186186
LOG_INF("Set Interfaces %u, alternate %u -> %u", iface, cur_alt, alt);
187-
if (alt == cur_alt) {
188-
return 0;
189-
}
187+
/*
188+
* Disable/enable endpoints even if the new alternate is the same as
189+
* the current one, forcing the endpoint to reset to defaults.
190+
*/
190191

191192
/* Test if interface or interface alternate exist */
192193
ret = usbd_interface_modify(uds_ctx, class, EP_OP_TEST, iface, alt);

0 commit comments

Comments
 (0)