Fix USB init problems

Initialize the _transfer structure so the behavior is the same
regardless of prior memory contents. This fixes a hang during
USB testing when CI flags are used.
pull/9768/head
Russ Butler 2018-03-15 16:59:17 -05:00
parent de12bb57fa
commit 23f3c01633
1 changed files with 4 additions and 0 deletions

View File

@ -1140,6 +1140,8 @@ USBDevice::USBDevice(USBPhy *phy, uint16_t vendor_id, uint16_t product_id, uint1
this->product_release = product_release;
memset(_endpoint_info, 0, sizeof(_endpoint_info));
memset(&_transfer, 0, sizeof(_transfer));
_transfer.user_callback = None;
_setup_ready = false;
_abort_control = false;
@ -1163,6 +1165,8 @@ USBDevice::USBDevice(uint16_t vendor_id, uint16_t product_id, uint16_t product_r
this->product_release = product_release;
memset(_endpoint_info, 0, sizeof(_endpoint_info));
memset(&_transfer, 0, sizeof(_transfer));
_transfer.user_callback = None;
_setup_ready = false;
_abort_control = false;