Skip to content
Permalink
Browse files

usb: device: Cancel all transfers on disconnect

Cancel all usb transfers when receiving USB_DC_DISCONNECTED.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
  • Loading branch information...
finikorg authored and carlescufi committed May 16, 2019
1 parent f206170 commit 437ee504fa22e0d80f680d7a68f32cf0dd9bfe06
Showing with 4 additions and 0 deletions.
  1. +4 −0 subsys/usb/usb_device.c
@@ -941,6 +941,10 @@ static void forward_status_cb(enum usb_dc_status_code status, const u8_t *param)
{
size_t size = (__usb_data_end - __usb_data_start);

if (status == USB_DC_DISCONNECTED) {
usb_cancel_transfers();
}

for (size_t i = 0; i < size; i++) {
struct usb_cfg_data *cfg = &__usb_data_start[i];

0 comments on commit 437ee50

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