mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-20 05:21:59 -04:00
Update to use new xQueueSendFromISR() and xSemaphoreGiveFromISR() function semantics.
This commit is contained in:
parent
f4dd20dffc
commit
c1e9f859c8
|
@ -503,7 +503,7 @@ void vUART_ISR(void)
|
||||||
{
|
{
|
||||||
unsigned portLONG ulStatus;
|
unsigned portLONG ulStatus;
|
||||||
portCHAR cRxedChar;
|
portCHAR cRxedChar;
|
||||||
portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt. */
|
/* What caused the interrupt. */
|
||||||
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
||||||
|
@ -520,7 +520,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
Rxed chars. Posting the character should wake the task that is
|
Rxed chars. Posting the character should wake the task that is
|
||||||
blocked on the queue waiting for characters. */
|
blocked on the queue waiting for characters. */
|
||||||
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
||||||
xTaskWokenByPost = xQueueSendFromISR( xCommsQueue, &cRxedChar, xTaskWokenByPost );
|
xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,14 +538,11 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xTaskWokenByPost )
|
/* If a task was woken by the character being received then we force
|
||||||
{
|
a context switch to occur in case the task is of higher priority than
|
||||||
/* If a task was woken by the character being received then we force
|
the currently executing task (i.e. the task that this interrupt
|
||||||
a context switch to occur in case the task is of higher priority than
|
interrupted.) */
|
||||||
the currently executing task (i.e. the task that this interrupt
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
interrupted.) */
|
|
||||||
portEND_SWITCHING_ISR( xTaskWokenByPost );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -503,7 +503,7 @@ void vUART_ISR(void)
|
||||||
{
|
{
|
||||||
unsigned portLONG ulStatus;
|
unsigned portLONG ulStatus;
|
||||||
portCHAR cRxedChar;
|
portCHAR cRxedChar;
|
||||||
portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt. */
|
/* What caused the interrupt. */
|
||||||
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
||||||
|
@ -520,7 +520,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
Rxed chars. Posting the character should wake the task that is
|
Rxed chars. Posting the character should wake the task that is
|
||||||
blocked on the queue waiting for characters. */
|
blocked on the queue waiting for characters. */
|
||||||
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
||||||
xTaskWokenByPost = xQueueSendFromISR( xCommsQueue, &cRxedChar, xTaskWokenByPost );
|
xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -538,14 +538,11 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xTaskWokenByPost )
|
/* If a task was woken by the character being received then we force
|
||||||
{
|
a context switch to occur in case the task is of higher priority than
|
||||||
/* If a task was woken by the character being received then we force
|
the currently executing task (i.e. the task that this interrupt
|
||||||
a context switch to occur in case the task is of higher priority than
|
interrupted.) */
|
||||||
the currently executing task (i.e. the task that this interrupt
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
interrupted.) */
|
|
||||||
portEND_SWITCHING_ISR( xTaskWokenByPost );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -496,7 +496,7 @@ void vUART_ISR(void)
|
||||||
{
|
{
|
||||||
unsigned portLONG ulStatus;
|
unsigned portLONG ulStatus;
|
||||||
portCHAR cRxedChar;
|
portCHAR cRxedChar;
|
||||||
portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt. */
|
/* What caused the interrupt. */
|
||||||
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
||||||
|
@ -513,7 +513,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
Rxed chars. Posting the character should wake the task that is
|
Rxed chars. Posting the character should wake the task that is
|
||||||
blocked on the queue waiting for characters. */
|
blocked on the queue waiting for characters. */
|
||||||
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
||||||
xTaskWokenByPost = xQueueSendFromISR( xCommsQueue, &cRxedChar, xTaskWokenByPost );
|
xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -531,14 +531,11 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xTaskWokenByPost )
|
/* If a task was woken by the character being received then we force
|
||||||
{
|
a context switch to occur in case the task is of higher priority than
|
||||||
/* If a task was woken by the character being received then we force
|
the currently executing task (i.e. the task that this interrupt
|
||||||
a context switch to occur in case the task is of higher priority than
|
interrupted.) */
|
||||||
the currently executing task (i.e. the task that this interrupt
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
interrupted.) */
|
|
||||||
portEND_SWITCHING_ISR( xTaskWokenByPost );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -496,7 +496,7 @@ void vUART_ISR(void)
|
||||||
{
|
{
|
||||||
unsigned portLONG ulStatus;
|
unsigned portLONG ulStatus;
|
||||||
portCHAR cRxedChar;
|
portCHAR cRxedChar;
|
||||||
portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt. */
|
/* What caused the interrupt. */
|
||||||
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
||||||
|
@ -513,7 +513,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
Rxed chars. Posting the character should wake the task that is
|
Rxed chars. Posting the character should wake the task that is
|
||||||
blocked on the queue waiting for characters. */
|
blocked on the queue waiting for characters. */
|
||||||
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
||||||
xTaskWokenByPost = xQueueSendFromISR( xCommsQueue, &cRxedChar, xTaskWokenByPost );
|
xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -531,14 +531,11 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xTaskWokenByPost )
|
/* If a task was woken by the character being received then we force
|
||||||
{
|
a context switch to occur in case the task is of higher priority than
|
||||||
/* If a task was woken by the character being received then we force
|
the currently executing task (i.e. the task that this interrupt
|
||||||
a context switch to occur in case the task is of higher priority than
|
interrupted.) */
|
||||||
the currently executing task (i.e. the task that this interrupt
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
interrupted.) */
|
|
||||||
portEND_SWITCHING_ISR( xTaskWokenByPost );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -504,7 +504,7 @@ void vUART_ISR(void)
|
||||||
{
|
{
|
||||||
unsigned portLONG ulStatus;
|
unsigned portLONG ulStatus;
|
||||||
portCHAR cRxedChar;
|
portCHAR cRxedChar;
|
||||||
portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt. */
|
/* What caused the interrupt. */
|
||||||
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
||||||
|
@ -521,7 +521,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
Rxed chars. Posting the character should wake the task that is
|
Rxed chars. Posting the character should wake the task that is
|
||||||
blocked on the queue waiting for characters. */
|
blocked on the queue waiting for characters. */
|
||||||
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
||||||
xTaskWokenByPost = xQueueSendFromISR( xCommsQueue, &cRxedChar, xTaskWokenByPost );
|
xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,14 +539,11 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xTaskWokenByPost )
|
/* If a task was woken by the character being received then we force
|
||||||
{
|
a context switch to occur in case the task is of higher priority than
|
||||||
/* If a task was woken by the character being received then we force
|
the currently executing task (i.e. the task that this interrupt
|
||||||
a context switch to occur in case the task is of higher priority than
|
interrupted.) */
|
||||||
the currently executing task (i.e. the task that this interrupt
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
interrupted.) */
|
|
||||||
portEND_SWITCHING_ISR( xTaskWokenByPost );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -209,7 +209,7 @@ void vUART_ISR( void )
|
||||||
{
|
{
|
||||||
unsigned portLONG ulStatus;
|
unsigned portLONG ulStatus;
|
||||||
portCHAR cRxedChar;
|
portCHAR cRxedChar;
|
||||||
portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* What caused the interrupt. */
|
/* What caused the interrupt. */
|
||||||
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
|
||||||
|
@ -226,7 +226,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
Rxed chars. Posting the character should wake the task that is
|
Rxed chars. Posting the character should wake the task that is
|
||||||
blocked on the queue waiting for characters. */
|
blocked on the queue waiting for characters. */
|
||||||
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
cRxedChar = ( portCHAR ) HWREG( UART0_BASE + UART_O_DR );
|
||||||
xTaskWokenByPost = xQueueSendFromISR( xCommsQueue, &cRxedChar, xTaskWokenByPost );
|
xQueueSendFromISR( xCommsQueue, &cRxedChar, &xHigherPriorityTaskWoken );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -244,14 +244,11 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( xTaskWokenByPost )
|
/* If a task was woken by the character being received then we force
|
||||||
{
|
a context switch to occur in case the task is of higher priority than
|
||||||
/* If a task was woken by the character being received then we force
|
the currently executing task (i.e. the task that this interrupt
|
||||||
a context switch to occur in case the task is of higher priority than
|
interrupted.) */
|
||||||
the currently executing task (i.e. the task that this interrupt
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
interrupted.) */
|
|
||||||
portEND_SWITCHING_ISR( xTaskWokenByPost );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -350,14 +350,15 @@ unsigned portLONG ulStatus;
|
||||||
|
|
||||||
void vGPIO_ISR( void )
|
void vGPIO_ISR( void )
|
||||||
{
|
{
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* Clear the interrupt. */
|
/* Clear the interrupt. */
|
||||||
GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
|
GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
|
||||||
|
|
||||||
/* Wake the button handler task. */
|
/* Wake the button handler task. */
|
||||||
if( xSemaphoreGiveFromISR( xButtonSemaphore, pdFALSE ) )
|
xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
|
||||||
{
|
|
||||||
portEND_SWITCHING_ISR( pdTRUE );
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -350,14 +350,14 @@ unsigned portLONG ulStatus;
|
||||||
|
|
||||||
void vGPIO_ISR( void )
|
void vGPIO_ISR( void )
|
||||||
{
|
{
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* Clear the interrupt. */
|
/* Clear the interrupt. */
|
||||||
GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
|
GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
|
||||||
|
|
||||||
/* Wake the button handler task. */
|
/* Wake the button handler task. */
|
||||||
if( xSemaphoreGiveFromISR( xButtonSemaphore, pdFALSE ) )
|
xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
|
||||||
{
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
portEND_SWITCHING_ISR( pdTRUE );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
|
@ -352,14 +352,14 @@ unsigned portLONG ulStatus;
|
||||||
|
|
||||||
void vGPIO_ISR( void )
|
void vGPIO_ISR( void )
|
||||||
{
|
{
|
||||||
|
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
||||||
|
|
||||||
/* Clear the interrupt. */
|
/* Clear the interrupt. */
|
||||||
GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
|
GPIOPinIntClear( GPIO_PORTC_BASE, mainPUSH_BUTTON );
|
||||||
|
|
||||||
/* Wake the button handler task. */
|
/* Wake the button handler task. */
|
||||||
if( xSemaphoreGiveFromISR( xButtonSemaphore, pdFALSE ) )
|
xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
|
||||||
{
|
portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
|
||||||
portEND_SWITCHING_ISR( pdTRUE );
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
/*-----------------------------------------------------------*/
|
/*-----------------------------------------------------------*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue