From 04c7b1429f3d5c947c051f405846bd1fa72f2bf8 Mon Sep 17 00:00:00 2001 From: JF Date: Thu, 9 Jan 2020 22:00:54 +0100 Subject: [PATCH] Increase configMINIMAL_STACK_SIZE to fix crash issue caused by freertos timers. --- src/FreeRTOSConfig.h | 2 +- src/main.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/FreeRTOSConfig.h b/src/FreeRTOSConfig.h index 41e54133..b4aea161 100644 --- a/src/FreeRTOSConfig.h +++ b/src/FreeRTOSConfig.h @@ -62,7 +62,7 @@ #define configCPU_CLOCK_HZ ( SystemCoreClock ) #define configTICK_RATE_HZ 1024 #define configMAX_PRIORITIES ( 3 ) -#define configMINIMAL_STACK_SIZE ( 60 ) +#define configMINIMAL_STACK_SIZE ( 120 ) #define configTOTAL_HEAP_SIZE ( 24000 ) #define configMAX_TASK_NAME_LEN ( 4 ) #define configUSE_16_BIT_TICKS 0 diff --git a/src/main.cpp b/src/main.cpp index 420bb948..7f8bef8c 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -44,7 +44,7 @@ void nrfx_gpiote_evt_handler(nrfx_gpiote_pin_t pin, nrf_gpiote_polarity_t action BaseType_t xHigherPriorityTaskWoken = pdFALSE; xTimerStartFromISR(debounceTimer, &xHigherPriorityTaskWoken); - // TODO should I do something if xHigherPriorityTaskWoken == pdTRUE? + portYIELD_FROM_ISR(xHigherPriorityTaskWoken); } void DebounceTimerCallback(TimerHandle_t xTimer) {