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 93
93
#include <stdint.h>
94
94
extern uint32_t SystemCoreClock ;
95
95
#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 */
96
99
97
100
#define configUSE_PREEMPTION 1
98
101
#define configUSE_IDLE_HOOK 1
99
102
#define configUSE_TICK_HOOK 1
100
103
#define configCPU_CLOCK_HZ (SystemCoreClock)
101
104
#define configTICK_RATE_HZ ((TickType_t)1000)
102
105
#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))
105
113
#define configMAX_TASK_NAME_LEN (16)
106
114
#define configUSE_TRACE_FACILITY 1
107
115
#define configUSE_16_BIT_TICKS 0
You can’t perform that action at this time.
0 commit comments