39
39
#include "mgos_uart_internal.h"
40
40
#include "mgos_utils.h"
41
41
42
- #ifndef MGOS_TASK_STACK_SIZE_BYTES
43
- #define MGOS_TASK_STACK_SIZE_BYTES 8192
44
- #endif
45
-
46
- #ifndef MGOS_TASK_PRIORITY
47
- #define MGOS_TASK_PRIORITY 5
48
- #endif
49
-
50
- #ifndef MGOS_TASK_QUEUE_LENGTH
51
- #define MGOS_TASK_QUEUE_LENGTH 32
52
- #endif
53
-
54
- #ifndef MGOS_MONGOOSE_MAX_POLL_SLEEP_MS
55
- #define MGOS_MONGOOSE_MAX_POLL_SLEEP_MS 1000
56
- #endif
57
-
58
- #ifndef MGOS_EARLY_WDT_TIMEOUT
59
- #define MGOS_EARLY_WDT_TIMEOUT 30 /* seconds */
60
- #endif
61
-
62
42
extern const char * build_version , * build_id ;
63
43
extern const char * mg_build_version , * mg_build_id ;
64
44
@@ -82,7 +62,6 @@ static portMUX_TYPE s_poll_spinlock = portMUX_INITIALIZER_UNLOCKED;
82
62
{ \
83
63
if (should_yield) portYIELD_FROM_ISR(); \
84
64
}
85
- #define STACK_SIZE_UNIT 1
86
65
#else
87
66
#define ENTER_CRITICAL () portENTER_CRITICAL()
88
67
#define EXIT_CRITICAL () portEXIT_CRITICAL()
@@ -92,7 +71,6 @@ static portMUX_TYPE s_poll_spinlock = portMUX_INITIALIZER_UNLOCKED;
92
71
#define EXIT_CRITICAL_NO_ISR (from_isr ) \
93
72
if (!from_isr) portEXIT_CRITICAL()
94
73
#define YIELD_FROM_ISR (should_yield ) portYIELD_FROM_ISR(should_yield)
95
- #define STACK_SIZE_UNIT sizeof(portSTACK_TYPE)
96
74
#endif
97
75
98
76
static IRAM void mgos_mg_poll_cb (void * arg ) {
@@ -283,11 +261,11 @@ void mgos_freertos_run_mgos_task(bool start_scheduler) {
283
261
// This is to avoid difficulties with interrupt allocation / deallocation:
284
262
// https://docs.espressif.com/projects/esp-idf/en/stable/api-reference/system/intr_alloc.html#multicore-issues
285
263
xTaskCreateStaticPinnedToCore (
286
- mgos_task , "mgos" , MGOS_TASK_STACK_SIZE_BYTES / STACK_SIZE_UNIT , NULL ,
264
+ mgos_task , "mgos" , MGOS_TASK_STACK_SIZE_BYTES / MGOS_TASK_STACK_SIZE_UNIT , NULL ,
287
265
MGOS_TASK_PRIORITY , mgos_task_stack , & mgos_task_tcb , 1 );
288
266
#else
289
267
xTaskCreateStatic (mgos_task , "mgos" ,
290
- MGOS_TASK_STACK_SIZE_BYTES / STACK_SIZE_UNIT , NULL ,
268
+ MGOS_TASK_STACK_SIZE_BYTES / MGOS_TASK_STACK_SIZE_UNIT , NULL ,
291
269
MGOS_TASK_PRIORITY , mgos_task_stack , & mgos_task_tcb );
292
270
#endif
293
271
if (start_scheduler ) {
@@ -307,7 +285,7 @@ void mgos_freertos_run_mgos_task(bool start_scheduler) {
307
285
s_mgos_mux = xSemaphoreCreateRecursiveMutex ();
308
286
s_mg_poll_timer = xTimerCreate ("mg_poll" , 10 , pdFALSE /* reload */ , 0 ,
309
287
mgos_mg_poll_timer_cb );
310
- xTaskCreate (mgos_task , "mgos" , MGOS_TASK_STACK_SIZE_BYTES / STACK_SIZE_UNIT ,
288
+ xTaskCreate (mgos_task , "mgos" , MGOS_TASK_STACK_SIZE_BYTES / MGOS_TASK_STACK_SIZE_UNIT ,
311
289
NULL , MGOS_TASK_PRIORITY , NULL );
312
290
if (start_scheduler ) {
313
291
vTaskStartScheduler ();
0 commit comments