diff --git a/components/freertos/CMakeLists.txt b/components/freertos/CMakeLists.txt index 17e6749d1e..9ac34ce96a 100644 --- a/components/freertos/CMakeLists.txt +++ b/components/freertos/CMakeLists.txt @@ -99,13 +99,9 @@ endif() # Add ESP-additions source files list(APPEND srcs + "esp_additions/freertos_compatibility.c" "esp_additions/idf_additions.c") -if(kernel_impl STREQUAL "FreeRTOS-Kernel") - list(APPEND srcs - "esp_additions/freertos_compatibility.c") -endif() - if(arch STREQUAL "linux") # Check if we need to address the FreeRTOS EINTR coexistence with linux system calls if we're building without # lwIP, we need to use linux system select which will receive EINTR event on every FreeRTOS interrupt, we diff --git a/components/freertos/FreeRTOS-Kernel/tasks.c b/components/freertos/FreeRTOS-Kernel/tasks.c index 98de5987ff..26e27dcb28 100644 --- a/components/freertos/FreeRTOS-Kernel/tasks.c +++ b/components/freertos/FreeRTOS-Kernel/tasks.c @@ -1530,15 +1530,6 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) /*-----------------------------------------------------------*/ #if ( INCLUDE_xTaskDelayUntil == 1 ) - #ifdef ESP_PLATFORM - /* backward binary compatibility - remove later */ - #undef vTaskDelayUntil - void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, - const TickType_t xTimeIncrement ) - { - xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); - } - #endif // ESP_PLATFORM BaseType_t xTaskDelayUntil( TickType_t * const pxPreviousWakeTime, const TickType_t xTimeIncrement ) @@ -5633,16 +5624,6 @@ TickType_t uxTaskResetEventItemValue( void ) #if ( configUSE_TASK_NOTIFICATIONS == 1 ) - #ifdef ESP_PLATFORM /* IDF-3851 */ - /* included here for backward binary compatibility */ - #undef ulTaskNotifyTake - uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, - TickType_t xTicksToWait ) - { - return ulTaskGenericNotifyTake( tskDEFAULT_INDEX_TO_NOTIFY, xClearCountOnExit, xTicksToWait ); - } - #endif // ESP-PLATFORM - uint32_t ulTaskGenericNotifyTake( UBaseType_t uxIndexToWait, BaseType_t xClearCountOnExit, TickType_t xTicksToWait ) @@ -5715,18 +5696,6 @@ TickType_t uxTaskResetEventItemValue( void ) #if ( configUSE_TASK_NOTIFICATIONS == 1 ) - #ifdef ESP_PLATFORM /* IDF-3851 */ - /* included for backward compatibility */ - #undef xTaskNotifyWait - BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, - uint32_t ulBitsToClearOnExit, - uint32_t * pulNotificationValue, - TickType_t xTicksToWait ) - { - return xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ); - } - #endif // ESP-PLATFORM - BaseType_t xTaskGenericNotifyWait( UBaseType_t uxIndexToWait, uint32_t ulBitsToClearOnEntry, uint32_t ulBitsToClearOnExit, diff --git a/components/freertos/esp_additions/freertos_compatibility.c b/components/freertos/esp_additions/freertos_compatibility.c index 66211af185..d56ae4e2d5 100644 --- a/components/freertos/esp_additions/freertos_compatibility.c +++ b/components/freertos/esp_additions/freertos_compatibility.c @@ -35,3 +35,45 @@ BaseType_t xQueueGenericReceive( QueueHandle_t xQueue, return xQueueReceive( xQueue, pvBuffer, xTicksToWait ); } + +/* + * vTaskDelayUntil() was deprecated into a macro and replaced by xTaskDelayUntil(). + * This is added for pre-compiled libraries that depend on ulTaskNotifyTake() + * being a function. + * + * Todo: Remove this in v6.0 (IDF-3851) + */ +#undef vTaskDelayUntil +void vTaskDelayUntil( TickType_t * const pxPreviousWakeTime, + const TickType_t xTimeIncrement ) +{ + xTaskDelayUntil( pxPreviousWakeTime, xTimeIncrement ); +} + +/* + * ulTaskNotifyTake() was turned into a macro. This is added for pre-compiled + * libraries that depend on ulTaskNotifyTake() being a function. + * + * Todo: Remove this in v6.0 (IDF-3851) + */ +#undef ulTaskNotifyTake +uint32_t ulTaskNotifyTake( BaseType_t xClearCountOnExit, + TickType_t xTicksToWait ) +{ + return ulTaskGenericNotifyTake( tskDEFAULT_INDEX_TO_NOTIFY, xClearCountOnExit, xTicksToWait ); +} + +/* + * xTaskNotifyWait() was turned into a macro. This is added for pre-compiled + * libraries that depend on xTaskNotifyWait() being a function. + * + * Todo: Remove this in v6.0 (IDF-3851) + */ +#undef xTaskNotifyWait +BaseType_t xTaskNotifyWait( uint32_t ulBitsToClearOnEntry, + uint32_t ulBitsToClearOnExit, + uint32_t * pulNotificationValue, + TickType_t xTicksToWait ) +{ + return xTaskGenericNotifyWait( tskDEFAULT_INDEX_TO_NOTIFY, ulBitsToClearOnEntry, ulBitsToClearOnExit, pulNotificationValue, xTicksToWait ); +} diff --git a/components/freertos/linker.lf b/components/freertos/linker.lf index 5b2c149d18..d36885354e 100644 --- a/components/freertos/linker.lf +++ b/components/freertos/linker.lf @@ -114,7 +114,6 @@ entries: tasks:prvInitialiseNewTask (default) tasks:prvAddNewTaskToReadyList (default) tasks:vTaskDelete (default) - tasks:vTaskDelayUntil (default) tasks:xTaskDelayUntil (default) tasks:vTaskDelay (default) tasks:eTaskGetState (default) @@ -169,9 +168,7 @@ entries: tasks:vTaskGetRunTimeStats (default) tasks:uxTaskResetEventItemValue (default) tasks:pvTaskIncrementMutexHeldCount (default) - tasks:ulTaskNotifyTake (default) tasks:ulTaskGenericNotifyTake (default) - tasks:xTaskNotifyWait (default) tasks:xTaskGenericNotifyWait (default) tasks:xTaskGenericNotify (default) tasks:xTaskGenericNotifyStateClear (default) diff --git a/components/freertos/linker_common.lf b/components/freertos/linker_common.lf index 4a19d9764d..eedac43a07 100644 --- a/components/freertos/linker_common.lf +++ b/components/freertos/linker_common.lf @@ -42,6 +42,12 @@ entries: tasks:pxTaskGetNext (default) tasks:uxTaskGetSnapshotAll (default) + # ------------------------------------------------------------------------------------------------------------------ + # freertos_compatibility.c + # Placement Rules: Functions always in flash as they are never called from an ISR + # ------------------------------------------------------------------------------------------------------------------ + freertos_compatibility (default) + # ------------------------------------------------------------------------------------------------------------------ # idf_additions.c # Placement Rules: Functions always in flash as they are never called from an ISR