Skip to content

Commit f1194a5

Browse files
committed
In current configuration, the timer task (the one from FreeRTOS) has the lowest priority (0). Both display and system tasks are also set on priority 0.
In cases where any other task takes too much time to execute (it can happen in Display Task, see #825), the timer task does not have the opportunity to run fast enough to detect and debounce presses on the button. This commit sets the following priorities: - [0] : Display Task - [1] : Timer and System tasks - [2] : BLE Host - [3] : BLE LL This way, we ensure that button presses will always be detected, even if the rendering of the display takes a huge amount of time.
1 parent 88197b6 commit f1194a5

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/FreeRTOSConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#define configUSE_TICKLESS_IDLE_SIMPLE_DEBUG 0 /* See into vPortSuppressTicksAndSleep source code for explanation */
6161
#define configCPU_CLOCK_HZ (SystemCoreClock)
6262
#define configTICK_RATE_HZ 1024
63-
#define configMAX_PRIORITIES (3)
63+
#define configMAX_PRIORITIES (4)
6464
#define configMINIMAL_STACK_SIZE (120)
6565
#define configTOTAL_HEAP_SIZE (1024 * 17)
6666
#define configMAX_TASK_NAME_LEN (4)
@@ -93,7 +93,7 @@
9393

9494
/* Software timer definitions. */
9595
#define configUSE_TIMERS 1
96-
#define configTIMER_TASK_PRIORITY (0)
96+
#define configTIMER_TASK_PRIORITY (1)
9797
#define configTIMER_QUEUE_LENGTH 32
9898
#define configTIMER_TASK_STACK_DEPTH (300)
9999

src/systemtask/SystemTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ SystemTask::SystemTask(Drivers::SpiMaster& spi,
107107

108108
void SystemTask::Start() {
109109
systemTasksMsgQueue = xQueueCreate(10, 1);
110-
if (pdPASS != xTaskCreate(SystemTask::Process, "MAIN", 350, this, 0, &taskHandle)) {
110+
if (pdPASS != xTaskCreate(SystemTask::Process, "MAIN", 350, this, 1, &taskHandle)) {
111111
APP_ERROR_HANDLER(NRF_ERROR_NO_MEM);
112112
}
113113
}

0 commit comments

Comments
 (0)