File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed
Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ void yield( void ) ;
3939void setup ( void ) ;
4040void loop ( void ) ;
4141uint32_t get_isr_stack_hwm (void );
42+ uint32_t getMainTaskHwm (void );
4243
4344#include "WVariant.h"
4445
Original file line number Diff line number Diff line change 2222#include " freertos/task.h"
2323#include " Arduino.h"
2424
25- #ifdef CONFIG_MAIN_TASK_STACK_SIZE
26- #define MAIN_TASK_STACK_SIZE CONFIG_MAIN_TASK_STACK_SIZE
25+ #if defined(CONFIG_MAIN_TASK_STACK_SIZE)
26+ # define MAIN_TASK_STACK_SIZE CONFIG_MAIN_TASK_STACK_SIZE
27+ #elif defined(DEVICE_RAM_SIZE)
28+ # if DEVICE_RAM_SIZE < 32
29+ # define MAIN_TASK_STACK_SIZE 1024
30+ # else
31+ # define MAIN_TASK_STACK_SIZE 2048
32+ # endif
2733#else
28- #define MAIN_TASK_STACK_SIZE 1024
34+ # define MAIN_TASK_STACK_SIZE 2048
2935#endif
3036
3137// Weak empty variant initialization function.
@@ -72,3 +78,7 @@ int main( void )
7278
7379 return 0 ;
7480}
81+
82+ uint32_t getMainTaskHwm () {
83+ return uxTaskGetStackHighWaterMark (_loopTaskHandle);
84+ }
You can’t perform that action at this time.
0 commit comments