|
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)
|
| 85 | +#endif |
| 86 | +#ifndef configTOTAL_HEAP_SIZE |
84 | 87 | #define configTOTAL_HEAP_SIZE ((size_t)(15 * 1024))
|
85 |
| -#define configISR_STACK_SIZE_WORDS (0x100) |
| 88 | +#endif |
86 | 89 | #else
|
| 90 | +#define configMAX_PRIORITIES (7) |
| 91 | +#endif /* configUSE_CMSIS_RTOS_V2 */ |
| 92 | + |
87 | 93 | extern char _end; /* Defined in the linker script */
|
88 | 94 | extern char _estack; /* Defined in the linker script */
|
89 | 95 | extern char _Min_Stack_Size; /* Defined in the linker script */
|
90 |
| - |
91 |
| -#define configMAX_PRIORITIES (7) |
92 |
| - |
93 | 96 | /*
|
94 | 97 | * _Min_Stack_Size is often set to 0x400 in the linker script
|
95 | 98 | * Use it divided by 8 to set minmimal stack size of a task to 128 by default.
|
96 | 99 | * End user will have to properly configure those value depending to their needs.
|
97 | 100 | */
|
| 101 | +#ifndef configMINIMAL_STACK_SIZE |
98 | 102 | #define configMINIMAL_STACK_SIZE ((uint16_t)((uint32_t)&_Min_Stack_Size/8))
|
| 103 | +#endif |
| 104 | +#ifndef configTOTAL_HEAP_SIZE |
99 | 105 | #define configTOTAL_HEAP_SIZE ((size_t)(&_estack - _Min_Stack_Size - &_end))
|
| 106 | +#endif |
| 107 | +#ifndef configISR_STACK_SIZE_WORDS |
100 | 108 | #define configISR_STACK_SIZE_WORDS ((uint32_t)&_Min_Stack_Size/4)
|
101 |
| -#endif /* configUSE_CMSIS_RTOS_V2 */ |
| 109 | +#endif |
102 | 110 |
|
103 | 111 | #define configUSE_PREEMPTION 1
|
104 | 112 | #define configUSE_IDLE_HOOK 1
|
|
0 commit comments