mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-31 14:13:09 +00:00
system/uorb: using UORB_LOOP_MAX_EVENTS to config loop function
Disable loop events by default (not compile loop.c and epoll.c). Signed-off-by: dongjiuzhu1 <dongjiuzhu1@xiaomi.com>
This commit is contained in:
parent
f94bccf119
commit
84d4fe0bfd
3 changed files with 10 additions and 2 deletions
|
|
@ -28,7 +28,7 @@ config UORB_TESTS
|
|||
|
||||
config UORB_LOOP_MAX_EVENTS
|
||||
int "uorb loop max events"
|
||||
default 16
|
||||
default 0
|
||||
|
||||
if UORB_TESTS
|
||||
|
||||
|
|
|
|||
|
|
@ -22,9 +22,13 @@
|
|||
|
||||
include $(APPDIR)/Make.defs
|
||||
|
||||
CSRCS += $(wildcard uORB/*.c)
|
||||
CSRCS += uORB/uORB.c
|
||||
CSRCS += $(wildcard sensor/*.c)
|
||||
|
||||
ifneq ($(CONFIG_UORB_LOOP_MAX_EVENTS),0)
|
||||
CSRCS += uORB/loop.c uORB/epoll.c
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_UORB_LISTENER),)
|
||||
MAINSRC += listener.c
|
||||
PROGNAME += uorb_listener
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@ typedef CODE int (*orb_eventpri_cb_t)(FAR struct orb_handle_s *handle,
|
|||
typedef CODE int (*orb_eventerr_cb_t)(FAR struct orb_handle_s *handle,
|
||||
FAR void *arg);
|
||||
|
||||
#if CONFIG_UORB_LOOP_MAX_EVENTS
|
||||
enum orb_loop_type_e
|
||||
{
|
||||
ORB_EPOLL_TYPE = 0,
|
||||
|
|
@ -111,6 +112,7 @@ struct orb_handle_s
|
|||
orb_eventpri_cb_t eventpri_cb; /* User EPOLLPRI callback funtion. */
|
||||
orb_eventerr_cb_t eventerr_cb; /* User EPOLLERR callback funtion. */
|
||||
};
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
|
@ -896,6 +898,7 @@ int orb_fprintf(FAR FILE *stream, FAR const char *format,
|
|||
FAR const void *data);
|
||||
#endif
|
||||
|
||||
#if CONFIG_UORB_LOOP_MAX_EVENTS
|
||||
/****************************************************************************
|
||||
* Name: orb_loop_init
|
||||
*
|
||||
|
|
@ -1003,6 +1006,7 @@ int orb_handle_start(FAR struct orb_loop_s *loop,
|
|||
|
||||
int orb_handle_stop(FAR struct orb_loop_s *loop,
|
||||
FAR struct orb_handle_s *handle);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue