Skip to content

Commit

Permalink
Use taskYIELD_WITHIN_API in all files
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot committed Sep 6, 2023
1 parent 3884ce6 commit ae48454
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 31 deletions.
10 changes: 2 additions & 8 deletions event_groups.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
* correct privileged Vs unprivileged linkage and placement. */
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE /*lint !e961 !e750 !e9021 See comment above. */

#if ( configNUMBER_OF_CORES == 1 )
#define eventgroupYIELD_WITHIN_API() portYIELD_WITHIN_API()
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
#define eventgroupYIELD_WITHIN_API() vTaskYieldWithinAPI()
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */

typedef struct EventGroupDef_t
{
EventBits_t uxEventBits;
Expand Down Expand Up @@ -249,7 +243,7 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
{
if( xAlreadyYielded == pdFALSE )
{
eventgroupYIELD_WITHIN_API();
taskYIELD_WITHIN_API();
}
else
{
Expand Down Expand Up @@ -401,7 +395,7 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
{
if( xAlreadyYielded == pdFALSE )
{
eventgroupYIELD_WITHIN_API();
taskYIELD_WITHIN_API();
}
else
{
Expand Down
6 changes: 6 additions & 0 deletions include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -3206,6 +3206,12 @@ BaseType_t xTaskCatchUpTicks( TickType_t xTicksToCatchUp ) PRIVILEGED_FUNCTION;
* 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
* INTENDED FOR USE WHEN IMPLEMENTING A PORT OF THE SCHEDULER AND IS
Expand Down
14 changes: 4 additions & 10 deletions queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ typedef struct SemaphoreData
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */
#endif

#if ( configNUMBER_OF_CORES == 1 )
#define queueYIELD_WITHIN_API() portYIELD_WITHIN_API()
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
#define queueYIELD_WITHIN_API() vTaskYieldWithinAPI()
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */

/*
* Definition of the queue used by the scheduler.
* Items are queued by copy, not reference. See the following link for the
Expand Down Expand Up @@ -1080,7 +1074,7 @@ BaseType_t xQueueGenericSend( QueueHandle_t xQueue,
* is also a higher priority task in the pending ready list. */
if( xTaskResumeAll() == pdFALSE )
{
queueYIELD_WITHIN_API();
taskYIELD_WITHIN_API();
}
}
else
Expand Down Expand Up @@ -1541,7 +1535,7 @@ BaseType_t xQueueReceive( QueueHandle_t xQueue,

if( xTaskResumeAll() == pdFALSE )
{
queueYIELD_WITHIN_API();
taskYIELD_WITHIN_API();
}
else
{
Expand Down Expand Up @@ -1724,7 +1718,7 @@ BaseType_t xQueueSemaphoreTake( QueueHandle_t xQueue,

if( xTaskResumeAll() == pdFALSE )
{
queueYIELD_WITHIN_API();
taskYIELD_WITHIN_API();
}
else
{
Expand Down Expand Up @@ -1902,7 +1896,7 @@ BaseType_t xQueuePeek( QueueHandle_t xQueue,

if( xTaskResumeAll() == pdFALSE )
{
queueYIELD_WITHIN_API();
taskYIELD_WITHIN_API();
}
else
{
Expand Down
6 changes: 0 additions & 6 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@
#endif
#endif /* if ( configNUMBER_OF_CORES == 1 ) */

#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 ) */

/* Values that can be assigned to the ucNotifyState member of the TCB. */
#define taskNOT_WAITING_NOTIFICATION ( ( uint8_t ) 0 ) /* Must be zero as it is the initialised value. */
#define taskWAITING_NOTIFICATION ( ( uint8_t ) 1 )
Expand Down
8 changes: 1 addition & 7 deletions timers.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,6 @@
#define tmrSTATUS_IS_STATICALLY_ALLOCATED ( 0x02U )
#define tmrSTATUS_IS_AUTORELOAD ( 0x04U )

#if ( configNUMBER_OF_CORES == 1 )
#define timerYIELD_WITHIN_API() portYIELD_WITHIN_API()
#else /* #if ( configNUMBER_OF_CORES == 1 ) */
#define timerYIELD_WITHIN_API() vTaskYieldWithinAPI()
#endif /* #if ( configNUMBER_OF_CORES == 1 ) */

/* The definition of the timers themselves. */
typedef struct tmrTimerControl /* The old naming convention is used to prevent breaking kernel aware debuggers. */
{
Expand Down Expand Up @@ -716,7 +710,7 @@
* block time to expire. If a command arrived between the
* critical section being exited and this yield then the yield
* will not cause the task to block. */
timerYIELD_WITHIN_API();
taskYIELD_WITHIN_API();
}
else
{
Expand Down

0 comments on commit ae48454

Please sign in to comment.