Add taskYIELD_WITHIN_API macro (#782)

Add taskYIELD_WITHIN_API macro for readability improvement.
This commit is contained in:
chinglee-iot 2023-10-04 17:38:27 +08:00 committed by GitHub
parent 5cdb1bc4e1
commit 830533d49e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 91 deletions

32
tasks.c
View file

@ -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
{