diff options
author | chinglee-iot <61685396+chinglee-iot@users.noreply.github.com> | 2023-10-04 12:38:27 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-04 12:38:27 +0300 |
commit | 830533d49e70806b4f46dade245c2f05f0c06b0f (patch) | |
tree | f22075d9464ea0a4eecdb015712631060d180391 /tasks.c | |
parent | 5cdb1bc4e1ed94468d8e81d6e70bce01a6180fbf (diff) |
Add taskYIELD_WITHIN_API macro (#782)
Add taskYIELD_WITHIN_API macro for readability improvement.
Diffstat (limited to 'tasks.c')
-rw-r--r-- | tasks.c | 32 |
1 files changed, 4 insertions, 28 deletions
@@ -2195,11 +2195,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, * have put ourselves to sleep. */ if( xAlreadyYielded == pdFALSE ) { - #if ( configNUMBER_OF_CORES == 1 ) - portYIELD_WITHIN_API(); - #else - vTaskYieldWithinAPI(); - #endif + taskYIELD_WITHIN_API(); } else { @@ -2251,11 +2247,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, * have put ourselves to sleep. */ if( xAlreadyYielded == pdFALSE ) { - #if ( configNUMBER_OF_CORES == 1 ) - portYIELD_WITHIN_API(); - #else - vTaskYieldWithinAPI(); - #endif + taskYIELD_WITHIN_API(); } else { @@ -7253,15 +7245,7 @@ TickType_t uxTaskResetEventItemValue( void ) * section (some will yield immediately, others wait until the * critical section exits) - but it is not something that * application code should ever do. */ - #if ( configNUMBER_OF_CORES == 1 ) - { - portYIELD_WITHIN_API(); - } - #else - { - vTaskYieldWithinAPI(); - } - #endif + taskYIELD_WITHIN_API(); } else { @@ -7344,15 +7328,7 @@ TickType_t uxTaskResetEventItemValue( void ) * section (some will yield immediately, others wait until the * critical section exits) - but it is not something that * application code should ever do. */ - #if ( configNUMBER_OF_CORES == 1 ) - { - portYIELD_WITHIN_API(); - } - #else - { - vTaskYieldWithinAPI(); - } - #endif + taskYIELD_WITHIN_API(); } else { |