Allow transfer to start when configuring USB

Allow reads and writes to be started when entering the configured
state.
pull/9768/head
Russ Butler 2018-03-16 22:56:20 -05:00 committed by Russ Butler
parent 7c96e22fa7
commit 8e2361a6b5
1 changed files with 4 additions and 2 deletions

View File

@ -1256,7 +1256,8 @@ bool USBDevice::read(usb_ep_t endpoint, uint8_t *buffer, uint32_t max_size, uint
return false;
}
if (!configured()) {
bool configuring = _transfer.user_callback == SetConfiguration;
if (!configured() && !configuring) {
unlock();
return false;
}
@ -1295,7 +1296,8 @@ bool USBDevice::write(usb_ep_t endpoint, uint8_t *buffer, uint32_t size)
return false;
}
if (!configured()) {
bool configuring = _transfer.user_callback == SetConfiguration;
if (!configured() && !configuring) {
unlock();
return false;
}