freertos: Restore xAlreadyYielded usage in event_groups

This commit restores xAlreadyYielded in various event_group functions to
synchronize with upstream v10.4.3.
This commit is contained in:
Darian Leung
2022-08-24 21:45:56 +08:00
parent 5352ba06fa
commit 15d8fc0722

View File

@@ -214,9 +214,7 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
{ {
EventBits_t uxOriginalBitValue, uxReturn; EventBits_t uxOriginalBitValue, uxReturn;
EventGroup_t * pxEventBits = xEventGroup; EventGroup_t * pxEventBits = xEventGroup;
#ifndef ESP_PLATFORM
BaseType_t xAlreadyYielded; BaseType_t xAlreadyYielded;
#endif // ESP_PLATFORM
BaseType_t xTimeoutOccurred = pdFALSE; BaseType_t xTimeoutOccurred = pdFALSE;
configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 ); configASSERT( ( uxBitsToWaitFor & eventEVENT_BITS_CONTROL_BYTES ) == 0 );
@@ -276,15 +274,13 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
} }
#ifdef ESP_PLATFORM // IDF-3755 #ifdef ESP_PLATFORM // IDF-3755
taskEXIT_CRITICAL( &( pxEventBits->xEventGroupLock ) ); taskEXIT_CRITICAL( &( pxEventBits->xEventGroupLock ) );
xAlreadyYielded = pdFALSE;
#else #else
xAlreadyYielded = xTaskResumeAll(); xAlreadyYielded = xTaskResumeAll();
#endif // ESP_PLATFORM #endif // ESP_PLATFORM
if( xTicksToWait != ( TickType_t ) 0 ) if( xTicksToWait != ( TickType_t ) 0 )
{ {
#ifdef ESP_PLATFORM
portYIELD_WITHIN_API();
#else
if( xAlreadyYielded == pdFALSE ) if( xAlreadyYielded == pdFALSE )
{ {
portYIELD_WITHIN_API(); portYIELD_WITHIN_API();
@@ -293,7 +289,6 @@ EventBits_t xEventGroupSync( EventGroupHandle_t xEventGroup,
{ {
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
#endif // ESP_PLATFORM
/* The task blocked to wait for its required bits to be set - at this /* The task blocked to wait for its required bits to be set - at this
* point either the required bits were set or the block time expired. If * point either the required bits were set or the block time expired. If
@@ -352,11 +347,7 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
{ {
EventGroup_t * pxEventBits = xEventGroup; EventGroup_t * pxEventBits = xEventGroup;
EventBits_t uxReturn, uxControlBits = 0; EventBits_t uxReturn, uxControlBits = 0;
#ifdef ESP_PLATFORM
BaseType_t xWaitConditionMet;
#else
BaseType_t xWaitConditionMet, xAlreadyYielded; BaseType_t xWaitConditionMet, xAlreadyYielded;
#endif // ESP_PLATFORM
BaseType_t xTimeoutOccurred = pdFALSE; BaseType_t xTimeoutOccurred = pdFALSE;
/* Check the user is not attempting to wait on the bits used by the kernel /* Check the user is not attempting to wait on the bits used by the kernel
@@ -444,15 +435,13 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
} }
#ifdef ESP_PLATFORM // IDF-3755 #ifdef ESP_PLATFORM // IDF-3755
taskEXIT_CRITICAL( &( pxEventBits->xEventGroupLock ) ); taskEXIT_CRITICAL( &( pxEventBits->xEventGroupLock ) );
xAlreadyYielded = pdFALSE;
#else #else
xAlreadyYielded = xTaskResumeAll(); xAlreadyYielded = xTaskResumeAll();
#endif // ESP_PLATFORM #endif // ESP_PLATFORM
if( xTicksToWait != ( TickType_t ) 0 ) if( xTicksToWait != ( TickType_t ) 0 )
{ {
#ifdef ESP_PLATFORM
portYIELD_WITHIN_API();
#else
if( xAlreadyYielded == pdFALSE ) if( xAlreadyYielded == pdFALSE )
{ {
portYIELD_WITHIN_API(); portYIELD_WITHIN_API();
@@ -461,7 +450,6 @@ EventBits_t xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
{ {
mtCOVERAGE_TEST_MARKER(); mtCOVERAGE_TEST_MARKER();
} }
#endif // ESP_PLATFORM
/* The task blocked to wait for its required bits to be set - at this /* The task blocked to wait for its required bits to be set - at this
* point either the required bits were set or the block time expired. If * point either the required bits were set or the block time expired. If