Skip to content

Commit dce72d5

Browse files
Matthew ElseMatthew Else
authored andcommitted
Add RTOS configuration for default stack size
1 parent da3b07d commit dce72d5

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

rtos/mbed_lib.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"name": "rtos",
33
"config": {
4-
"present": 1
4+
"present": 1,
5+
"default_stack_size": "(WORDS_STACK_SIZE*4)"
56
}
67
}

rtos/rtx/TARGET_CORTEX_A/cmsis_os.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,11 @@ used throughout the whole project.
149149
# define WORDS_STACK_SIZE 128
150150
#endif
151151

152-
#define DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
152+
#ifndef MBED_CONF_RTOS_DEFAULT_STACK_SIZE
153+
#define MBED_CONF_RTOS_DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
154+
#endif
155+
156+
#define DEFAULT_STACK_SIZE MBED_CONF_RTOS_DEFAULT_STACK_SIZE
153157

154158
/// \note MUST REMAIN UNCHANGED: \b osFeature_xxx shall be consistent in every CMSIS-RTOS.
155159
#define osFeature_MainThread 1 ///< main thread 1=main can be thread, 0=not available

rtos/rtx/TARGET_CORTEX_M/cmsis_os.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,11 @@
8282

8383
#endif
8484

85-
#define DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
85+
#ifndef MBED_CONF_RTOS_DEFAULT_STACK_SIZE
86+
#define MBED_CONF_RTOS_DEFAULT_STACK_SIZE (WORDS_STACK_SIZE*4)
87+
#endif
88+
89+
#define DEFAULT_STACK_SIZE MBED_CONF_RTOS_DEFAULT_STACK_SIZE
8690

8791
#define osCMSIS 0x10002U ///< CMSIS-RTOS API version (main [31:16] .sub [15:0])
8892

0 commit comments

Comments
 (0)