From f766ba47aac230819027d248813235171fc844ab Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sat, 13 Aug 2011 19:21:30 -0500 Subject: [PATCH] Increase the size of the eventdispatcher task and lower the maximum queue size. --- flight/CopterControl/System/inc/pios_config.h | 5 ++++- flight/UAVObjects/eventdispatcher.c | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/flight/CopterControl/System/inc/pios_config.h b/flight/CopterControl/System/inc/pios_config.h index 944fe38c8..8e09d71ca 100644 --- a/flight/CopterControl/System/inc/pios_config.h +++ b/flight/CopterControl/System/inc/pios_config.h @@ -99,10 +99,13 @@ #define PIOS_SYSTEM_STACK_SIZE 460 #define PIOS_STABILIZATION_STACK_SIZE 524 #define PIOS_TELEM_STACK_SIZE 500 -#define PIOS_EVENTDISPATCHER_STACK_SIZE 96 +#define PIOS_EVENTDISPATCHER_STACK_SIZE 130 #define IDLE_COUNTS_PER_SEC_AT_NO_LOAD 1995998 //#define PIOS_QUATERNION_STABILIZATION +// This can't be too high to stop eventdispatcher thread overflowing +#define PIOS_EVENTDISAPTCHER_QUEUE 10 + #endif /* PIOS_CONFIG_H */ /** * @} diff --git a/flight/UAVObjects/eventdispatcher.c b/flight/UAVObjects/eventdispatcher.c index 2d4bd2082..53a6e039d 100644 --- a/flight/UAVObjects/eventdispatcher.c +++ b/flight/UAVObjects/eventdispatcher.c @@ -27,7 +27,11 @@ #include "openpilot.h" // Private constants +#if defined(PIOS_EVENTDISAPTCHER_QUEUE) +#define MAX_QUEUE_SIZE PIOS_EVENTDISAPTCHER_QUEUE +#else #define MAX_QUEUE_SIZE 20 +#endif #if defined(PIOS_EVENTDISPATCHER_STACK_SIZE) #define STACK_SIZE PIOS_EVENTDISPATCHER_STACK_SIZE