File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -178,10 +178,12 @@ WEAK void mbed_main(void);
178
178
void pre_main (void );
179
179
180
180
osThreadAttr_t _main_thread_attr ;
181
- /* The main stack size is hardcoded on purpose, so it's less tempting to change it per platform. As usually it's not
182
- * the correct solution to the problem and it makes mbed OS behave differently on different targets.
183
- */
184
- MBED_ALIGN (8 ) char _main_stack [4096 ];
181
+
182
+ /** The main thread's stack size can be configured by the application, if not explicitly specified it'll default to 4K */
183
+ #ifndef MBED_CONF_APP_MAIN_STACK_SIZE
184
+ #define MBED_CONF_APP_MAIN_STACK_SIZE 4096
185
+ #endif
186
+ MBED_ALIGN (8 ) char _main_stack [MBED_CONF_APP_MAIN_STACK_SIZE ];
185
187
mbed_rtos_storage_thread_t _main_obj ;
186
188
187
189
osMutexId_t singleton_mutex_id ;
Original file line number Diff line number Diff line change 24
24
25
25
#include "mbed_rtx.h"
26
26
27
- #ifndef OS_STACK_SIZE
28
- #ifndef MBED_SMALL_TARGET
29
- #define OS_STACK_SIZE 4096
30
- #else
31
- #define OS_STACK_SIZE 2048
32
- #endif
27
+ /** The thread's stack size can be configured by the application, if not explicitly specified it'll default to 4K */
28
+ #ifndef MBED_CONF_APP_THREAD_STACK_SIZE
29
+ #define MBED_CONF_APP_THREAD_STACK_SIZE 4096
33
30
#endif
34
31
32
+ #define OS_STACK_SIZE MBED_CONF_APP_THREAD_STACK_SIZE
33
+
35
34
#define OS_TIMER_THREAD_STACK_SIZE 768
36
35
#define OS_IDLE_THREAD_STACK_SIZE 256
37
36
You can’t perform that action at this time.
0 commit comments