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