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). keyboard and mouse classes if so configured. From Leo (2014-4-17).
* include/nuttx/usb/usbhost: Fix some USB HID-related conditional * include/nuttx/usb/usbhost: Fix some USB HID-related conditional
compilation. From Leo (2014-4-17). 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

@ -1082,10 +1082,17 @@ static int usbhost_mouse_poll(int argc, char *argv[])
*/ */
if (ret != OK) if (ret != OK)
{
/* 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).
*/
udbg("ERROR: DRVR_TRANSFER returned: %d/%d\n", ret, nerrors);
if (ret != -EAGAIN)
{ {
nerrors++; nerrors++;
udbg("ERROR: DRVR_TRANSFER returned: %d/%d\n",
ret, nerrors);
if (nerrors > 200) if (nerrors > 200)
{ {
@ -1093,6 +1100,7 @@ static int usbhost_mouse_poll(int argc, char *argv[])
break; break;
} }
} }
}
/* The report was received correctly. But ignore the mouse data if no /* The report was received correctly. But ignore the mouse data if no
* task has opened the driver. * task has opened the driver.

View File

@ -1,7 +1,7 @@
/************************************************************************************ /************************************************************************************
* include/nuttx/usb/usbhost.h * 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> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* References: * References: