summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhathach <[email protected]>2019-05-23 10:59:43 +0700
committerhathach <[email protected]>2019-05-23 10:59:43 +0700
commitf4762ff0128b6d856fd002f11064091b2eb34336 (patch)
tree9ff6dec54f03cac419979d22711997831aab4f66
parent3846645a284b81fa7b735e96911cdb9c696e7c52 (diff)
host fix address alloc when it reach max devices
-rw-r--r--src/host/usbh.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c
index 7dcb5920f..f370b62f4 100644
--- a/src/host/usbh.c
+++ b/src/host/usbh.c
@@ -636,7 +636,7 @@ static inline uint8_t get_new_address(void)
{
if (_usbh_devices[addr].state == TUSB_DEVICE_STATE_UNPLUG) return addr;
}
- return CFG_TUSB_HOST_DEVICE_MAX;
+ return CFG_TUSB_HOST_DEVICE_MAX+1;
}
static inline uint8_t get_configure_number_for_device(tusb_desc_device_t* dev_desc)