From 0c4facac469c11a16fe761cd3c38ccbaa4f129ff Mon Sep 17 00:00:00 2001 From: Stacey Sheldon Date: Tue, 5 Jul 2011 20:11:20 -0400 Subject: [PATCH] heap: reduce stack size on IDLE and Event tasks The FreeRTOS IDLE task was using 512 bytes of stack. The UAVObject Event task was also using 512 bytes of stack. Both have been reduced, recovering 400+ bytes of heap. --- flight/CopterControl/System/inc/FreeRTOSConfig.h | 2 +- flight/UAVObjects/eventdispatcher.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flight/CopterControl/System/inc/FreeRTOSConfig.h b/flight/CopterControl/System/inc/FreeRTOSConfig.h index c05f71ea5..109034ea8 100644 --- a/flight/CopterControl/System/inc/FreeRTOSConfig.h +++ b/flight/CopterControl/System/inc/FreeRTOSConfig.h @@ -29,7 +29,7 @@ #define configCPU_CLOCK_HZ ( ( unsigned long ) 72000000 ) #define configTICK_RATE_HZ ( ( portTickType ) 1000 ) #define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 128 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 48 ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 14 * 1024 ) ) #define configMAX_TASK_NAME_LEN ( 16 ) #define configUSE_TRACE_FACILITY 0 diff --git a/flight/UAVObjects/eventdispatcher.c b/flight/UAVObjects/eventdispatcher.c index 353739468..4de43cd25 100644 --- a/flight/UAVObjects/eventdispatcher.c +++ b/flight/UAVObjects/eventdispatcher.c @@ -28,7 +28,7 @@ // Private constants #define MAX_QUEUE_SIZE 20 -#define STACK_SIZE configMINIMAL_STACK_SIZE +#define STACK_SIZE 96 #define TASK_PRIORITY (tskIDLE_PRIORITY + 3) #define MAX_UPDATE_PERIOD_MS 1000