Skip to content

Commit e628eee

Browse files
committed
HACK: avoid ARMmbed#10862 by not firing the assert
1 parent 52776df commit e628eee

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

drivers/usb/source/USBDevice.cpp

+10-8
Original file line numberDiff line numberDiff line change
@@ -980,10 +980,11 @@ void USBDevice::out(usb_ep_t endpoint)
980980

981981
endpoint_info_t *info = &_endpoint_info[EP_TO_INDEX(endpoint)];
982982

983-
MBED_ASSERT(info->pending >= 1);
984-
info->pending -= 1;
985-
if (info->callback) {
986-
info->callback();
983+
if (info->pending >= 1) {
984+
info->pending -= 1;
985+
if (info->callback) {
986+
info->callback();
987+
}
987988
}
988989
}
989990

@@ -1007,10 +1008,11 @@ void USBDevice::in(usb_ep_t endpoint)
10071008

10081009
endpoint_info_t *info = &_endpoint_info[EP_TO_INDEX(endpoint)];
10091010

1010-
MBED_ASSERT(info->pending >= 1);
1011-
info->pending -= 1;
1012-
if (info->callback) {
1013-
info->callback();
1011+
if (info->pending >= 1) {
1012+
info->pending -= 1;
1013+
if (info->callback) {
1014+
info->callback();
1015+
}
10141016
}
10151017
}
10161018

0 commit comments

Comments
 (0)