mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-07-07 20:31:20 +08:00
USB monitor daemon updates
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5579 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
404bb36bbd
commit
ee9124d35d
@ -41,8 +41,7 @@ ifeq ($(WINTOOL),y)
|
|||||||
INCDIROPT = -w
|
INCDIROPT = -w
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Hello Application
|
# USB Monitor Application
|
||||||
# TODO: appname can be automatically extracted from the directory name
|
|
||||||
|
|
||||||
PRIORITY = SCHED_PRIORITY_DEFAULT
|
PRIORITY = SCHED_PRIORITY_DEFAULT
|
||||||
STACKSIZE = 768
|
STACKSIZE = 768
|
||||||
@ -88,11 +87,13 @@ $(COBJS): %$(OBJEXT): %.c
|
|||||||
# Register application
|
# Register application
|
||||||
|
|
||||||
ifeq ($(CONFIG_NSH_BUILTIN_APPS),y)
|
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_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
|
else
|
||||||
context:
|
context:
|
||||||
endif
|
endif
|
||||||
|
@ -42,9 +42,12 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <debug.h>
|
#include <unistd.h>
|
||||||
|
#include <sched.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
#include <errno.h>
|
||||||
|
|
||||||
#include <nuttx/usb/usbdev_trace.h"
|
#include <nuttx/usb/usbdev_trace.h>
|
||||||
|
|
||||||
#ifdef CONFIG_SYSTEM_USBMONITOR
|
#ifdef CONFIG_SYSTEM_USBMONITOR
|
||||||
|
|
||||||
@ -89,7 +92,8 @@ static int usbmonitor_daemon(int argc, char **argv)
|
|||||||
|
|
||||||
while (!g_usbmonitor.stop)
|
while (!g_usbmonitor.stop)
|
||||||
{
|
{
|
||||||
(void)usbmonitor_enumerate(nsh_tracecallback, NULL);
|
sleep(2);
|
||||||
|
(void)usbtrace_enumerate(usbmonitor_tracecallback, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Stopped */
|
/* Stopped */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user