Commit 155ef4bd authored by Johann Fischer's avatar Johann Fischer Committed by Anas Nashif
Browse files

drivers: udc_stm32: disable control endpoints in udc_disable()

Disable control endpoints in udc_disable() implementation.

Signed-off-by: default avatarJohann Fischer <johann.fischer@nordicsemi.no>
parent a01ab796
Loading
Loading
Loading
Loading
+10 −0
Changes for drivers/usb/udc/udc_stm32.c: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -542,6 +542,16 @@ static int udc_stm32_disable(const struct device *dev)

	irq_disable(DT_INST_IRQN(0));

	if (udc_ep_disable_internal(dev, USB_CONTROL_EP_OUT)) {
		LOG_ERR("Failed to disable control endpoint");
		return -EIO;
	}

	if (udc_ep_disable_internal(dev, USB_CONTROL_EP_IN)) {
		LOG_ERR("Failed to disable control endpoint");
		return -EIO;
	}

	status = HAL_PCD_Stop(&priv->pcd);
	if (status != HAL_OK) {
		LOG_ERR("PCD_Stop failed, %d", (int)status);