testing/irtest: Fix issue of failure to open multiple IR devices

Signed-off-by: chenwen@espressif.com <chenwen@espressif.com>
This commit is contained in:
chenwen@espressif.com 2022-06-14 16:36:11 +08:00 committed by Abdelatif Guettouche
parent ce7c9ae65b
commit 068905d07b

View File

@ -189,11 +189,13 @@ CMD1(open_device, const char *, file_name)
}
int index = 0;
for (; index < CONFIG_TESTING_IRTEST_MAX_NIRDEV &&
g_irdevs[index] == -1; index++)
for (; index < CONFIG_TESTING_IRTEST_MAX_NIRDEV; index++)
{
g_irdevs[index] = irdev;
break;
if (g_irdevs[index] == -1)
{
g_irdevs[index] = irdev;
break;
}
}
if (index == CONFIG_TESTING_IRTEST_MAX_NIRDEV)