usb:st usbfs-v2: fix disconnect polarity
Fixes issue #1482: Incorrect interpretation of disconnected parameter in st_usbfs_v2_disconnect The `disconnected` parameter was interpreted incorrectly: When set to true it connected but should disconnect. Reviewed-by: Karl Palsson <karlp@tweak.au>
This commit is contained in:
committed by
Karl Palsson
parent
10cfbd7652
commit
eaea8dc12c
@@ -90,9 +90,9 @@ static void st_usbfs_v2_disconnect(usbd_device *usbd_dev, bool disconnected)
|
|||||||
(void)usbd_dev;
|
(void)usbd_dev;
|
||||||
uint16_t reg = GET_REG(USB_BCDR_REG);
|
uint16_t reg = GET_REG(USB_BCDR_REG);
|
||||||
if (disconnected) {
|
if (disconnected) {
|
||||||
SET_REG(USB_BCDR_REG, reg | USB_BCDR_DPPU);
|
|
||||||
} else {
|
|
||||||
SET_REG(USB_BCDR_REG, reg & ~USB_BCDR_DPPU);
|
SET_REG(USB_BCDR_REG, reg & ~USB_BCDR_DPPU);
|
||||||
|
} else {
|
||||||
|
SET_REG(USB_BCDR_REG, reg | USB_BCDR_DPPU);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user