mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Add taskYIELD_WITHIN_API macro (#782)
Add taskYIELD_WITHIN_API macro for readability improvement.
This commit is contained in:
parent
5cdb1bc4e1
commit
830533d49e
|
@ -253,15 +253,7 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
|
||||||
{
|
{
|
||||||
if( xAlreadyYielded == pdFALSE )
|
if( xAlreadyYielded == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -417,15 +409,7 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
|
||||||
{
|
{
|
||||||
if( xAlreadyYielded == pdFALSE )
|
if( xAlreadyYielded == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -3330,6 +3330,12 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) PRIVILEGED_FUNCTION;
|
||||||
* SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
|
* SCHEDULER INTERNALS AVAILABLE FOR PORTING PURPOSES
|
||||||
*----------------------------------------------------------*/
|
*----------------------------------------------------------*/
|
||||||
|
|
||||||
|
#if ( configNUMBER_OF_CORES == 1 )
|
||||||
|
#define taskYIELD_WITHIN_API() portYIELD_WITHIN_API()
|
||||||
|
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||||
|
#define taskYIELD_WITHIN_API() vTaskYieldWithinAPI()
|
||||||
|
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
|
* THIS FUNCTION MUST NOT BE USED FROM APPLICATION CODE. IT IS ONLY
|
||||||
* INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
|
* INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
|
||||||
|
|
40
queue.c
40
queue.c
|
@ -1129,15 +1129,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
|
||||||
* is also a higher priority task in the pending ready list. */
|
* is also a higher priority task in the pending ready list. */
|
||||||
if( xTaskResumeAll() == pdFALSE )
|
if( xTaskResumeAll() == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1616,15 +1608,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,
|
||||||
|
|
||||||
if( xTaskResumeAll() == pdFALSE )
|
if( xTaskResumeAll() == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1817,15 +1801,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,
|
||||||
|
|
||||||
if( xTaskResumeAll() == pdFALSE )
|
if( xTaskResumeAll() == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2013,15 +1989,7 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,
|
||||||
|
|
||||||
if( xTaskResumeAll() == pdFALSE )
|
if( xTaskResumeAll() == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
32
tasks.c
32
tasks.c
|
@ -2195,11 +2195,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
||||||
* have put ourselves to sleep. */
|
* have put ourselves to sleep. */
|
||||||
if( xAlreadyYielded == pdFALSE )
|
if( xAlreadyYielded == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
#else
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2251,11 +2247,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
||||||
* have put ourselves to sleep. */
|
* have put ourselves to sleep. */
|
||||||
if( xAlreadyYielded == pdFALSE )
|
if( xAlreadyYielded == pdFALSE )
|
||||||
{
|
{
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
#else
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7253,15 +7245,7 @@ TickType_t uxTaskResetEventItemValue( void )
|
||||||
* section (some will yield immediately, others wait until the
|
* section (some will yield immediately, others wait until the
|
||||||
* critical section exits) - but it is not something that
|
* critical section exits) - but it is not something that
|
||||||
* application code should ever do. */
|
* application code should ever do. */
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -7344,15 +7328,7 @@ TickType_t uxTaskResetEventItemValue( void )
|
||||||
* section (some will yield immediately, others wait until the
|
* section (some will yield immediately, others wait until the
|
||||||
* critical section exits) - but it is not something that
|
* critical section exits) - but it is not something that
|
||||||
* application code should ever do. */
|
* application code should ever do. */
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
10
timers.c
10
timers.c
|
@ -771,15 +771,7 @@
|
||||||
* block time to expire. If a command arrived between the
|
* block time to expire. If a command arrived between the
|
||||||
* critical section being exited and this yield then the yield
|
* critical section being exited and this yield then the yield
|
||||||
* will not cause the task to block. */
|
* will not cause the task to block. */
|
||||||
#if ( configNUMBER_OF_CORES == 1 )
|
taskYIELD_WITHIN_API();
|
||||||
{
|
|
||||||
portYIELD_WITHIN_API();
|
|
||||||
}
|
|
||||||
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
{
|
|
||||||
vTaskYieldWithinAPI();
|
|
||||||
}
|
|
||||||
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue