diff options
| author | hathach <[email protected]> | 2018-12-12 12:36:40 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-12-12 12:36:40 +0700 |
| commit | 5fd60e57617dab3afcb03d245c25b676ef4ab65f (patch) | |
| tree | e50d615f11348f686c54fb4ac6d43e41bbee6332 /src/host | |
| parent | 6c0b0917e15ca0acf7ce9bed0f3735a794abb807 (diff) | |
clean up
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/usbh.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index bbe60362a..39de4f7e7 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -438,7 +438,6 @@ bool enum_task(hcd_event_t* event) #endif
TU_ASSERT_ERR( usbh_pipe_control_open(0, 8) );
- dev0->state = TUSB_DEVICE_STATE_ADDRESSED;
//------------- Get first 8 bytes of device descriptor to get Control Endpoint Size -------------//
request = (tusb_control_request_t ) {
@@ -493,7 +492,6 @@ bool enum_task(hcd_event_t* event) new_dev->hub_addr = dev0->hub_addr;
new_dev->hub_port = dev0->hub_port;
new_dev->speed = dev0->speed;
- new_dev->state = TUSB_DEVICE_STATE_ADDRESSED;
hcd_device_close(dev0->rhport, 0); // close device 0
dev0->state = TUSB_DEVICE_STATE_UNPLUG;
@@ -655,13 +653,11 @@ void usbh_task(void* param) //--------------------------------------------------------------------+
static inline uint8_t get_new_address(void)
{
- uint8_t addr;
- for (addr=1; addr <= CFG_TUSB_HOST_DEVICE_MAX; addr++)
+ for (uint8_t addr=1; addr <= CFG_TUSB_HOST_DEVICE_MAX; addr++)
{
- if (_usbh_devices[addr].state == TUSB_DEVICE_STATE_UNPLUG)
- break;
+ if (_usbh_devices[addr].state == TUSB_DEVICE_STATE_UNPLUG) return addr;
}
- return addr;
+ return CFG_TUSB_HOST_DEVICE_MAX;
}
static inline uint8_t get_configure_number_for_device(tusb_desc_device_t* dev_desc)
|
