mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -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
|
@ -409,7 +409,7 @@ static portBASE_TYPE xComPortISR( xComPort * const pxPort )
|
|||
{
|
||||
unsigned portSHORT usStatusRegister;
|
||||
portCHAR cChar;
|
||||
portBASE_TYPE xTaskWokenByPost = pdFALSE, xAnotherTaskWokenByPost = pdFALSE, xTaskWokenByTx = pdFALSE;
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
/* NOTE: THIS IS NOT AN EFFICIENT ISR AS IT IS DESIGNED SOLELY TO TEST
|
||||
THE SCHEDULER FUNCTIONALITY. REAL APPLICATIONS SHOULD NOT USE THIS
|
||||
|
@ -420,14 +420,14 @@ 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 );
|
||||
}
|
||||
else 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 );
|
||||
}
|
||||
|
@ -443,7 +443,7 @@ 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)
|
||||
if( xHigherPriorityTaskWoken )
|
||||
{
|
||||
return pdTRUE;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ portBASE_TYPE prvProcessISR( void )
|
|||
{
|
||||
unsigned char status;
|
||||
extern xSemaphoreHandle xTCPSemaphore;
|
||||
portBASE_TYPE xSwitchRequired = pdFALSE;
|
||||
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||
|
||||
#ifdef I2CHIP_WINDOW
|
||||
u_int current_window = i2chip_get_window();
|
||||
|
@ -91,7 +91,7 @@ status = READ_VALUE(INT_REG);
|
|||
|
||||
if (status)
|
||||
{
|
||||
xSwitchRequired = pdTRUE;
|
||||
xHigherPriorityTaskWoken = pdTRUE;
|
||||
// channel 0 interrupt(sysinit, sockinit, established, closed, timeout, send_ok, recv_ok)
|
||||
if (status & 0x01)
|
||||
{
|
||||
|
@ -178,12 +178,12 @@ WRITE_VALUE(INT_REG, 0xFF);
|
|||
i2chip_set_window(current_window);
|
||||
#endif
|
||||
|
||||
if( xSwitchRequired == pdTRUE )
|
||||
if( xHigherPriorityTaskWoken == pdTRUE )
|
||||
{
|
||||
xSwitchRequired = xSemaphoreGiveFromISR( xTCPSemaphore, pdFALSE );
|
||||
xSemaphoreGiveFromISR( xTCPSemaphore, &xHigherPriorityTaskWoken );
|
||||
}
|
||||
|
||||
return xSwitchRequired;
|
||||
return xHigherPriorityTaskWoken;
|
||||
}
|
||||
|
||||
void far interrupt in4_isr_i2chip(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue