USB Host function address calculation needs to reset the 'next' address when an address is released

This commit is contained in:
Gregory Nutt 2015-05-05 14:59:03 -06:00
parent 47a112974d
commit 9296eca193
1 changed files with 7 additions and 0 deletions

View File

@ -164,6 +164,13 @@ static void usbhost_devaddr_free(FAR struct usbhost_devaddr_s *devgen,
DEBUGASSERT((devgen->alloctab[index] |= (1 << bitno)) != 0);
devgen->alloctab[index] &= ~(1 << bitno);
/* Reset the next pointer if the one just released has a lower value */
if (devaddr < devgen->next)
{
devgen->next = devaddr;
}
}
/*******************************************************************************