mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-06 21:25:00 -05:00
Merge 19e901e3e8 into 9736947af2
This commit is contained in:
commit
12df28e4ea
4 changed files with 159 additions and 16 deletions
20
tasks.c
20
tasks.c
|
|
@ -2448,7 +2448,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
|||
{
|
||||
configASSERT( uxSchedulerSuspended == 1U );
|
||||
|
||||
traceTASK_DELAY();
|
||||
traceTASK_DELAY_EXT( xTicksToDelay );
|
||||
|
||||
/* A task that is removed from the event list while the
|
||||
* scheduler is suspended will not get placed in the ready
|
||||
|
|
@ -7718,11 +7718,12 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
traceTASK_NOTIFY_TAKE( uxIndexToWaitOn );
|
||||
ulReturn = pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ];
|
||||
|
||||
if( ulReturn != 0U )
|
||||
{
|
||||
traceTASK_NOTIFY_TAKE_EXT( uxIndexToWaitOn, xClearCountOnExit );
|
||||
|
||||
if( xClearCountOnExit != pdFALSE )
|
||||
{
|
||||
pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] = ( uint32_t ) 0U;
|
||||
|
|
@ -7734,6 +7735,7 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
}
|
||||
else
|
||||
{
|
||||
traceTASK_NOTIFY_TAKE_FAILED( uxIndexToWaitOn );
|
||||
mtCOVERAGE_TEST_MARKER();
|
||||
}
|
||||
|
||||
|
|
@ -7775,6 +7777,8 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
/* Only block if a notification is not already pending. */
|
||||
if( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED )
|
||||
{
|
||||
traceTASK_NOTIFY_VALUE_CLEAR( pxCurrentTCB, uxIndexToWaitOn, ulBitsToClearOnEntry );
|
||||
|
||||
/* Clear bits in the task's notification value as bits may get
|
||||
* set by the notifying task or interrupt. This can be used
|
||||
* to clear the value to zero. */
|
||||
|
|
@ -7826,8 +7830,6 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
traceTASK_NOTIFY_WAIT( uxIndexToWaitOn );
|
||||
|
||||
if( pulNotificationValue != NULL )
|
||||
{
|
||||
/* Output the current notification value, which may or may not
|
||||
|
|
@ -7842,12 +7844,14 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
if( pxCurrentTCB->ucNotifyState[ uxIndexToWaitOn ] != taskNOTIFICATION_RECEIVED )
|
||||
{
|
||||
/* A notification was not received. */
|
||||
traceTASK_NOTIFY_WAIT_FAILED( uxIndexToWaitOn );
|
||||
xReturn = pdFALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A notification was already pending or a notification was
|
||||
* received while the task was waiting. */
|
||||
traceTASK_NOTIFY_WAIT_EXT( uxIndexToWaitOn, ulBitsToClearOnExit );
|
||||
pxCurrentTCB->ulNotifiedValue[ uxIndexToWaitOn ] &= ~ulBitsToClearOnExit;
|
||||
xReturn = pdTRUE;
|
||||
}
|
||||
|
|
@ -7937,7 +7941,7 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
break;
|
||||
}
|
||||
|
||||
traceTASK_NOTIFY( uxIndexToNotify );
|
||||
traceTASK_NOTIFY_EXT( pxTCB, uxIndexToNotify, eAction, xReturn );
|
||||
|
||||
/* If the task is in the blocked state specifically to wait for a
|
||||
* notification then unblock it now. */
|
||||
|
|
@ -8079,7 +8083,7 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
break;
|
||||
}
|
||||
|
||||
traceTASK_NOTIFY_FROM_ISR( uxIndexToNotify );
|
||||
traceTASK_NOTIFY_FROM_ISR_EXT( pxTCB, uxIndexToNotify, eAction, xReturn );
|
||||
|
||||
/* If the task is in the blocked state specifically to wait for a
|
||||
* notification then unblock it now. */
|
||||
|
|
@ -8315,6 +8319,8 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
pxTCB = prvGetTCBFromHandle( xTask );
|
||||
configASSERT( pxTCB != NULL );
|
||||
|
||||
traceTASK_NOTIFY_STATE_CLEAR( pxTCB, uxIndexToClear );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( pxTCB->ucNotifyState[ uxIndexToClear ] == taskNOTIFICATION_RECEIVED )
|
||||
|
|
@ -8355,6 +8361,8 @@ TickType_t uxTaskResetEventItemValue( void )
|
|||
pxTCB = prvGetTCBFromHandle( xTask );
|
||||
configASSERT( pxTCB != NULL );
|
||||
|
||||
traceTASK_NOTIFY_VALUE_CLEAR( pxTCB, uxIndexToClear, ulBitsToClear );
|
||||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
/* Return the notification as it was before the bits were cleared,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue