From c54de384c21ce75736f48d6986117d6a560c0dcf Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 29 Jan 2013 13:30:10 +0000 Subject: USB monitor daemon updates git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5579 42af7a65-404d-4744-a932-0658087f49c3 --- apps/system/usbmonitor/Makefile | 11 ++++++----- apps/system/usbmonitor/usbmonitor.c | 10 +++++++--- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'apps/system/usbmonitor') diff --git a/apps/system/usbmonitor/Makefile b/apps/system/usbmonitor/Makefile index b4c323eb7..56b6ccee1 100644 --- a/apps/system/usbmonitor/Makefile +++ b/apps/system/usbmonitor/Makefile @@ -41,8 +41,7 @@ ifeq ($(WINTOOL),y) INCDIROPT = -w endif -# Hello Application -# TODO: appname can be automatically extracted from the directory name +# USB Monitor Application PRIORITY = SCHED_PRIORITY_DEFAULT STACKSIZE = 768 @@ -88,11 +87,13 @@ $(COBJS): %$(OBJEXT): %.c # Register application ifeq ($(CONFIG_NSH_BUILTIN_APPS),y) -$(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat: $(DEPCONFIG) Makefile +$(BUILTIN_REGISTRY)$(DELIM)usbmonitor_start.bdat: $(DEPCONFIG) Makefile $(call REGISTER,"usbmon_start",$(PRIORITY),$(STACKSIZE),usbmonitor_start) - $(call REGISTER,"usbmon_stop",$(PRIORITY),$(STACKSIZE),usbmonintor_stop) -context: $(BUILTIN_REGISTRY)$(DELIM)$(APPNAME)_main.bdat +$(BUILTIN_REGISTRY)$(DELIM)usbmonitor_stop.bdat: $(DEPCONFIG) Makefile + $(call REGISTER,"usbmon_stop",$(PRIORITY),$(STACKSIZE),usbmonitor_stop) + +context: $(BUILTIN_REGISTRY)$(DELIM)usbmonitor_start.bdat $(BUILTIN_REGISTRY)$(DELIM)usbmonitor_stop.bdat else context: endif diff --git a/apps/system/usbmonitor/usbmonitor.c b/apps/system/usbmonitor/usbmonitor.c index b615b99f9..b386c3c2e 100644 --- a/apps/system/usbmonitor/usbmonitor.c +++ b/apps/system/usbmonitor/usbmonitor.c @@ -42,9 +42,12 @@ #include #include -#include +#include +#include +#include +#include -#include #ifdef CONFIG_SYSTEM_USBMONITOR @@ -89,7 +92,8 @@ static int usbmonitor_daemon(int argc, char **argv) while (!g_usbmonitor.stop) { - (void)usbmonitor_enumerate(nsh_tracecallback, NULL); + sleep(2); + (void)usbtrace_enumerate(usbmonitor_tracecallback, NULL); } /* Stopped */ -- cgit v1.2.3