usb: usb_dc_kinetis: Fix setting address for not attached device
Add appropriate check. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
4c9ea1e370
commit
08f53a435c
1 changed files with 5 additions and 0 deletions
|
@ -256,6 +256,11 @@ int usb_dc_detach(void)
|
|||
int usb_dc_set_address(const u8_t addr)
|
||||
{
|
||||
LOG_DBG("");
|
||||
|
||||
if (!dev_data.attached) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/*
|
||||
* The device stack tries to set the address before
|
||||
* sending the ACK with ZLP, which is totally stupid,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue