sys_usbd: Fix emulated devices not being created without a physical device

This commit is contained in:
Sanjay Govind 2025-01-24 17:11:45 +13:00
parent fe02f9e2a6
commit 8752bdbc61

View file

@ -526,8 +526,8 @@ usb_handler_thread::usb_handler_thread()
{
if (entry.max_device_count && entry.make_instance)
{
const int count = emulate_device_check[entry];
for (int i = count; i < entry.max_device_count(); i++)
const int real_device_count = emulate_device_check[entry];
for (int i = real_device_count; i < entry.max_device_count(); i++)
{
sys_usbd.success("Emulating device: %s (%d)", std::basic_string(entry.device_name), i);
auto usb_dev = entry.make_instance(i, get_new_location());