diff options
-rw-r--r-- | nuttx/ChangeLog | 2 | ||||
-rw-r--r-- | nuttx/drivers/usbhost/usbhost_hidmouse.c | 20 | ||||
-rw-r--r-- | nuttx/include/nuttx/usb/usbhost.h | 2 |
3 files changed, 17 insertions, 7 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7426dbf54..ed94972ac 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -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). diff --git a/nuttx/drivers/usbhost/usbhost_hidmouse.c b/nuttx/drivers/usbhost/usbhost_hidmouse.c index 0fa49c50b..5a9cff0a7 100644 --- a/nuttx/drivers/usbhost/usbhost_hidmouse.c +++ b/nuttx/drivers/usbhost/usbhost_hidmouse.c @@ -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; + } } } diff --git a/nuttx/include/nuttx/usb/usbhost.h b/nuttx/include/nuttx/usb/usbhost.h index 8c4b67828..d96a55d9a 100644 --- a/nuttx/include/nuttx/usb/usbhost.h +++ b/nuttx/include/nuttx/usb/usbhost.h @@ -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: |