mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-20 01:58:32 -04:00
Update to use new xQueueSendFromISR() and xSemaphoreGiveFromISR() function semantics.
This commit is contained in:
parent
7eb7201b46
commit
f4dd20dffc
54 changed files with 266 additions and 251 deletions
|
@ -435,7 +435,7 @@ static portBASE_TYPE xComPortISR( xComPort * const pxPort )
|
|||
{
|
||||
unsigned portSHORT usStatusRegister;
|
||||
portCHAR cChar;
|
||||
portBASE_TYPE xTaskWokenByPost = pdFALSE, xAnotherTaskWokenByPost = pdFALSE, xTaskWokenByTx = pdFALSE, xContinue = pdTRUE;
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE, xContinue = pdTRUE;
|
||||
|
||||
/* NOTE: THIS IS NOT AN EFFICIENT ISR AS IT IS DESIGNED SOLELY TO TEST
|
||||
THE SCHEDULER FUNCTIONALITY. REAL APPLICATIONS SHOULD NOT USE THIS
|
||||
|
@ -450,10 +450,10 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE, xAnotherTaskWokenByPost = pdFALSE, xTa
|
|||
if( usStatusRegister & serRX_READY )
|
||||
{
|
||||
cChar = ( portCHAR ) portINPUT_WORD( pxPort->usRxReg );
|
||||
xTaskWokenByPost = xQueueSendFromISR( pxPort->xRxedChars, &cChar, xTaskWokenByPost );
|
||||
xQueueSendFromISR( pxPort->xRxedChars, &cChar, &xHigherPriorityTaskWoken );
|
||||
|
||||
/* Also release the semaphore - this does nothing interesting and is just a test. */
|
||||
xAnotherTaskWokenByPost = xSemaphoreGiveFromISR( pxPort->xTestSem, xAnotherTaskWokenByPost );
|
||||
xSemaphoreGiveFromISR( pxPort->xTestSem, &xHigherPriorityTaskWoken );
|
||||
|
||||
/* We have performed an action this cycle - there may be other to perform. */
|
||||
xContinue = pdTRUE;
|
||||
|
@ -461,7 +461,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE, xAnotherTaskWokenByPost = pdFALSE, xTa
|
|||
|
||||
if( pxPort->sTxInterruptOn && ( usStatusRegister & serTX_EMPTY ) )
|
||||
{
|
||||
if( xQueueReceiveFromISR( pxPort->xCharsForTx, &cChar, &xTaskWokenByTx ) == pdTRUE )
|
||||
if( xQueueReceiveFromISR( pxPort->xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE )
|
||||
{
|
||||
portOUTPUT_WORD( pxPort->usTxReg, ( unsigned portSHORT ) cChar );
|
||||
|
||||
|
@ -481,17 +481,11 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE, xAnotherTaskWokenByPost = pdFALSE, xTa
|
|||
/* If posting to the queue woke a task that was blocked on the queue we may
|
||||
want to switch to the woken task - depending on its priority relative to
|
||||
the task interrupted by this ISR. */
|
||||
if( xTaskWokenByPost || xAnotherTaskWokenByPost || xTaskWokenByTx)
|
||||
{
|
||||
return pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return pdFALSE;
|
||||
}
|
||||
return xHigherPriorityTaskWoken;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue