File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 9393 #include <stdint.h>
9494 extern uint32_t SystemCoreClock ;
9595#endif
96+ extern char _end ; /* Defined in the linker script */
97+ extern char _estack ; /* Defined in the linker script */
98+ extern char _Min_Stack_Size ; /* Defined in the linker script */
9699
97100#define configUSE_PREEMPTION 1
98101#define configUSE_IDLE_HOOK 1
99102#define configUSE_TICK_HOOK 1
100103#define configCPU_CLOCK_HZ (SystemCoreClock)
101104#define configTICK_RATE_HZ ((TickType_t)1000)
102105#define configMAX_PRIORITIES (7)
103- #define configMINIMAL_STACK_SIZE ((uint16_t)128)
104- #define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024))
106+ /*
107+ * _Min_Stack_Size is often set to 0x400 in the linker script
108+ * Use it divided by 8 to set minmimal stack size of a task to 128 by default.
109+ * End user will have to properly configure those value depending to their needs.
110+ */
111+ #define configMINIMAL_STACK_SIZE ((uint16_t)((uint32_t)&_Min_Stack_Size/8))
112+ #define configTOTAL_HEAP_SIZE ((size_t)(&_estack - _Min_Stack_Size - &_end))
105113#define configMAX_TASK_NAME_LEN (16)
106114#define configUSE_TRACE_FACILITY 1
107115#define configUSE_16_BIT_TICKS 0
You can’t perform that action at this time.
0 commit comments