From f4762ff0128b6d856fd002f11064091b2eb34336 Mon Sep 17 00:00:00 2001 From: hathach Date: Thu, 23 May 2019 10:59:43 +0700 Subject: [PATCH] host fix address alloc when it reach max devices --- src/host/usbh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/host/usbh.c b/src/host/usbh.c index 7dcb5920..f370b62f 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)