drivers: udc_stm32: set address only for standard device requests

Any request 5 did set the address even if it's a non standard
request like vendor specific requests.

Signed-off-by: David Schneider <schneidav81@gmail.com>
This commit is contained in:
David Schneider 2024-11-13 16:33:16 +01:00 committed by Anas Nashif
parent 8ac483fdd4
commit ded2e0ba4a

View file

@ -168,7 +168,8 @@ void HAL_PCD_SetupStageCallback(PCD_HandleTypeDef *hpcd)
return;
}
if (setup->bRequest == USB_SREQ_SET_ADDRESS) {
if ((setup->bmRequestType == 0) &&
(setup->bRequest == USB_SREQ_SET_ADDRESS)) {
/* HAL requires we set the address before submitting status */
HAL_PCD_SetAddress(&priv->pcd, setup->wValue);
}