summaryrefslogtreecommitdiff
path: root/nuttx/examples/hidkbd/hidkbd_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/examples/hidkbd/hidkbd_main.c')
-rw-r--r--nuttx/examples/hidkbd/hidkbd_main.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/nuttx/examples/hidkbd/hidkbd_main.c b/nuttx/examples/hidkbd/hidkbd_main.c
index 1c5e92098..0a082f67c 100644
--- a/nuttx/examples/hidkbd/hidkbd_main.c
+++ b/nuttx/examples/hidkbd/hidkbd_main.c
@@ -46,6 +46,7 @@
#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
+#include <errno.h>
#include <nuttx/usb/usbhost.h>
@@ -200,10 +201,11 @@ int user_start(int argc, char *argv[])
do
{
printf("Opening device %s\n", CONFIG_EXAMPLES_HIDKBD_DEVNAME);
- fflush(stdout);
fd = open(CONFIG_EXAMPLES_HIDKBD_DEVNAME, O_RDONLY);
if (fd < 0)
{
+ printf("Failed: %d\n", errno);
+ fflush(stdout);
sleep(3);
}
}
@@ -228,7 +230,7 @@ int user_start(int argc, char *argv[])
}
while (nbytes >= 0);
- printf("Closing device %s\n", CONFIG_EXAMPLES_HIDKBD_DEVNAME);
+ printf("Closing device %s: %d\n", CONFIG_EXAMPLES_HIDKBD_DEVNAME, (int)nbytes);
fflush(stdout);
close(fd);
}