mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Fix: Two one line fixes, xTaskCheckForTimeOut() and ulTaskGenericNotifyValueClear(). (#82)
ulTaskGenericNotifyValueClear() returned the notification value of the currently running task, not the target task. Now it returns the notification value of the target task. Some users expected xTaskCheckForTimeOut() to clear the 'last wake time' value each time a timeout occurred, whereas it only did that in one path. It now clears the last wake time in all paths that return that a timeout occurred.
This commit is contained in:
parent
287361091b
commit
55da9591c0
5
tasks.c
5
tasks.c
|
@ -3350,6 +3350,7 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
||||||
* around and gone past again. This passed since vTaskSetTimeout()
|
* around and gone past again. This passed since vTaskSetTimeout()
|
||||||
* was called. */
|
* was called. */
|
||||||
xReturn = pdTRUE;
|
xReturn = pdTRUE;
|
||||||
|
*pxTicksToWait = ( TickType_t ) 0;
|
||||||
}
|
}
|
||||||
else if( xElapsedTime < *pxTicksToWait ) /*lint !e961 Explicit casting is only redundant with some compilers, whereas others require it to prevent integer conversion errors. */
|
else if( xElapsedTime < *pxTicksToWait ) /*lint !e961 Explicit casting is only redundant with some compilers, whereas others require it to prevent integer conversion errors. */
|
||||||
{
|
{
|
||||||
|
@ -3360,7 +3361,7 @@ BaseType_t xTaskCheckForTimeOut( TimeOut_t * const pxTimeOut,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*pxTicksToWait = 0;
|
*pxTicksToWait = ( TickType_t ) 0;
|
||||||
xReturn = pdTRUE;
|
xReturn = pdTRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5245,7 +5246,7 @@ TickType_t uxTaskResetEventItemValue( void )
|
||||||
{
|
{
|
||||||
/* Return the notification as it was before the bits were cleared,
|
/* Return the notification as it was before the bits were cleared,
|
||||||
* then clear the bit mask. */
|
* then clear the bit mask. */
|
||||||
ulReturn = pxCurrentTCB->ulNotifiedValue[ uxIndexToClear ];
|
ulReturn = pxTCB->ulNotifiedValue[ uxIndexToClear ];
|
||||||
pxTCB->ulNotifiedValue[ uxIndexToClear ] &= ~ulBitsToClear;
|
pxTCB->ulNotifiedValue[ uxIndexToClear ] &= ~ulBitsToClear;
|
||||||
}
|
}
|
||||||
taskEXIT_CRITICAL();
|
taskEXIT_CRITICAL();
|
||||||
|
|
Loading…
Reference in a new issue