From 4d317c5e33b92f0251c5bfe8e4a9e770ef1d0adf Mon Sep 17 00:00:00 2001 From: Raphael Coeffic Date: Mon, 26 Jul 2021 09:48:01 +0200 Subject: [PATCH] One notification index per task is enough Notification index 0 is only used by FreeRTOS when Streams or message buffers are used. --- radio/src/FreeRTOSConfig.h | 1 - radio/src/mixer_scheduler.cpp | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/radio/src/FreeRTOSConfig.h b/radio/src/FreeRTOSConfig.h index 1ca86aa84..023d5c49a 100644 --- a/radio/src/FreeRTOSConfig.h +++ b/radio/src/FreeRTOSConfig.h @@ -34,7 +34,6 @@ #define configUSE_16_BIT_TICKS 0 #define configIDLE_SHOULD_YIELD 1 // Use notifications -#define configTASK_NOTIFICATION_ARRAY_ENTRIES 2 #define configUSE_MUTEXES 0 #define configQUEUE_REGISTRY_SIZE 0 #define configUSE_RECURSIVE_MUTEXES 0 diff --git a/radio/src/mixer_scheduler.cpp b/radio/src/mixer_scheduler.cpp index ee0a7198a..a94b6b27e 100644 --- a/radio/src/mixer_scheduler.cpp +++ b/radio/src/mixer_scheduler.cpp @@ -75,9 +75,7 @@ bool mixerSchedulerWaitForTrigger(uint8_t timeoutMs) the first parameter is pdTRUE, which has the effect of clearing the task's notification value back to 0, making the notification value act like a binary (rather than a counting) semaphore. */ - ulNotificationValue = ulTaskNotifyTakeIndexed( 1 /* task notification index */, - pdTRUE, - xMaxBlockTime ); + ulNotificationValue = ulTaskNotifyTake( pdTRUE, xMaxBlockTime ); if( ulNotificationValue == 1 ) { /* The transmission ended as expected. */ @@ -98,9 +96,8 @@ void mixerSchedulerISRTrigger() configASSERT( mixerTaskId.rtos_handle != NULL ); /* Notify the task that the transmission is complete. */ - vTaskNotifyGiveIndexedFromISR( mixerTaskId.rtos_handle, - 1 /* task notification index */, - &xHigherPriorityTaskWoken ); + vTaskNotifyGiveFromISR( mixerTaskId.rtos_handle, + &xHigherPriorityTaskWoken ); /* If xHigherPriorityTaskWoken is now set to pdTRUE then a context switch should be performed to ensure the interrupt