|
79 | 79 | * which is not suitable for the new CMSIS-RTOS v2 priority range |
80 | 80 | */ |
81 | 81 | #define configUSE_PORT_OPTIMISED_TASK_SELECTION 0 |
82 | | - |
| 82 | +/* Require to be a value as used in cmsis_os2.c as array size */ |
| 83 | +#ifndef configMINIMAL_STACK_SIZE |
83 | 84 | #define configMINIMAL_STACK_SIZE ((uint16_t)128) |
84 | | -#define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024)) |
85 | | -#define configISR_STACK_SIZE_WORDS (0x100) |
| 85 | +#endif |
86 | 86 | #else |
| 87 | +#define configMAX_PRIORITIES (7) |
| 88 | +#endif /* configUSE_CMSIS_RTOS_V2 */ |
| 89 | + |
87 | 90 | extern char _end; /* Defined in the linker script */ |
88 | 91 | extern char _estack; /* Defined in the linker script */ |
89 | 92 | extern char _Min_Stack_Size; /* Defined in the linker script */ |
90 | | - |
91 | | -#define configMAX_PRIORITIES (7) |
92 | | - |
93 | 93 | /* |
94 | 94 | * _Min_Stack_Size is often set to 0x400 in the linker script |
95 | 95 | * Use it divided by 8 to set minmimal stack size of a task to 128 by default. |
96 | 96 | * End user will have to properly configure those value depending to their needs. |
97 | 97 | */ |
| 98 | +#ifndef configMINIMAL_STACK_SIZE |
98 | 99 | #define configMINIMAL_STACK_SIZE ((uint16_t)((uint32_t)&_Min_Stack_Size/8)) |
| 100 | +#endif |
| 101 | +#ifndef configTOTAL_HEAP_SIZE |
99 | 102 | #define configTOTAL_HEAP_SIZE ((size_t)(&_estack - _Min_Stack_Size - &_end)) |
| 103 | +#endif |
| 104 | +#ifndef configISR_STACK_SIZE_WORDS |
100 | 105 | #define configISR_STACK_SIZE_WORDS ((uint32_t)&_Min_Stack_Size/4) |
101 | | -#endif /* configUSE_CMSIS_RTOS_V2 */ |
| 106 | +#endif |
102 | 107 |
|
103 | 108 | #define configUSE_PREEMPTION 1 |
104 | 109 | #define configUSE_IDLE_HOOK 1 |
|
0 commit comments