HID mouse: Don't include NAKs in error count. From Leo

This commit is contained in:
Gregory Nutt 2014-04-17 11:47:00 -06:00
parent 6d0863b657
commit b83702dd8a
3 changed files with 17 additions and 7 deletions

View File

@ -7196,3 +7196,5 @@
keyboard and mouse classes if so configured. From Leo (2014-4-17).
* include/nuttx/usb/usbhost: Fix some USB HID-related conditional
compilation. From Leo (2014-4-17).
* drivers/usbhost/usbhost_hidmouse.c: Don't include NAKs from the device
in the error count. From Leo (2014-4-17).

View File

@ -1083,14 +1083,22 @@ static int usbhost_mouse_poll(int argc, char *argv[])
if (ret != OK)
{
nerrors++;
udbg("ERROR: DRVR_TRANSFER returned: %d/%d\n",
ret, nerrors);
/* If DRVR_TRANSFER() returns EAGAIN, that simply means that
* the devices was not ready and has NAK'ed the transfer. That
* no be treated as an error (unless it persists for a long
* time).
*/
if (nerrors > 200)
udbg("ERROR: DRVR_TRANSFER returned: %d/%d\n", ret, nerrors);
if (ret != -EAGAIN)
{
udbg("Too many errors... aborting: %d\n", nerrors);
break;
nerrors++;
if (nerrors > 200)
{
udbg("Too many errors... aborting: %d\n", nerrors);
break;
}
}
}

View File

@ -1,7 +1,7 @@
/************************************************************************************
* include/nuttx/usb/usbhost.h
*
* Copyright (C) 2010-2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2010-2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References: