diff options
author | richardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2> | 2008-04-12 23:34:13 +0000 |
---|---|---|
committer | richardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2> | 2008-04-12 23:34:13 +0000 |
commit | 5864b2ab0af8ee476b0ec085bad901899bc4d63b (patch) | |
tree | 3bf6b0efd0e21d7a0974e959e9190bfd0d1faaf1 | |
parent | ea2de2853378baeeef67c2a42e258564bb87a918 (diff) | |
download | freertos-5864b2ab0af8ee476b0ec085bad901899bc4d63b.tar.gz freertos-5864b2ab0af8ee476b0ec085bad901899bc4d63b.tar.bz2 freertos-5864b2ab0af8ee476b0ec085bad901899bc4d63b.tar.xz |
Update to use new xQueueSendFromISR() and xSemaphoreGiveFromISR() function semantics.
git-svn-id: https://freertos.svn.sourceforge.net/svnroot/freertos/trunk@308 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
-rw-r--r-- | Demo/CORTEX_LM3S102_GCC/Demo1/main.c | 17 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S102_GCC/main.c | 17 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S102_KEIL/Demo1/main.c | 17 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S102_KEIL/main.c | 17 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S102_Rowley/Demo1/main.c | 17 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S316_IAR/commstest.c | 17 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S811_GCC/main.c | 9 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S811_IAR/main.c | 8 | ||||
-rw-r--r-- | Demo/CORTEX_LM3S811_KEIL/main.c | 10 |
9 files changed, 56 insertions, 73 deletions
diff --git a/Demo/CORTEX_LM3S102_GCC/Demo1/main.c b/Demo/CORTEX_LM3S102_GCC/Demo1/main.c index 6e4ee274..e4ddc3f3 100644 --- a/Demo/CORTEX_LM3S102_GCC/Demo1/main.c +++ b/Demo/CORTEX_LM3S102_GCC/Demo1/main.c @@ -503,7 +503,7 @@ void vUART_ISR(void) {
unsigned portLONG ulStatus;
portCHAR cRxedChar;
-portBASE_TYPE xTaskWokenByPost = pdFALSE;
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt. */
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
@@ -520,7 +520,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE; Rxed chars. Posting the character should wake the task that is
blocked on the queue waiting for characters. */
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
- the currently executing task (i.e. the task that this interrupt
- interrupted.) */
- portEND_SWITCHING_ISR( 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
+ the currently executing task (i.e. the task that this interrupt
+ interrupted.) */
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S102_GCC/main.c b/Demo/CORTEX_LM3S102_GCC/main.c index 6e4ee274..e4ddc3f3 100644 --- a/Demo/CORTEX_LM3S102_GCC/main.c +++ b/Demo/CORTEX_LM3S102_GCC/main.c @@ -503,7 +503,7 @@ void vUART_ISR(void) {
unsigned portLONG ulStatus;
portCHAR cRxedChar;
-portBASE_TYPE xTaskWokenByPost = pdFALSE;
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt. */
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
@@ -520,7 +520,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE; Rxed chars. Posting the character should wake the task that is
blocked on the queue waiting for characters. */
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
- the currently executing task (i.e. the task that this interrupt
- interrupted.) */
- portEND_SWITCHING_ISR( 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
+ the currently executing task (i.e. the task that this interrupt
+ interrupted.) */
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S102_KEIL/Demo1/main.c b/Demo/CORTEX_LM3S102_KEIL/Demo1/main.c index 26c6551e..0f3c7ed6 100644 --- a/Demo/CORTEX_LM3S102_KEIL/Demo1/main.c +++ b/Demo/CORTEX_LM3S102_KEIL/Demo1/main.c @@ -496,7 +496,7 @@ void vUART_ISR(void) {
unsigned portLONG ulStatus;
portCHAR cRxedChar;
-portBASE_TYPE xTaskWokenByPost = pdFALSE;
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt. */
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
@@ -513,7 +513,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE; Rxed chars. Posting the character should wake the task that is
blocked on the queue waiting for characters. */
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
- the currently executing task (i.e. the task that this interrupt
- interrupted.) */
- portEND_SWITCHING_ISR( 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
+ the currently executing task (i.e. the task that this interrupt
+ interrupted.) */
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S102_KEIL/main.c b/Demo/CORTEX_LM3S102_KEIL/main.c index 26c6551e..0f3c7ed6 100644 --- a/Demo/CORTEX_LM3S102_KEIL/main.c +++ b/Demo/CORTEX_LM3S102_KEIL/main.c @@ -496,7 +496,7 @@ void vUART_ISR(void) {
unsigned portLONG ulStatus;
portCHAR cRxedChar;
-portBASE_TYPE xTaskWokenByPost = pdFALSE;
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt. */
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
@@ -513,7 +513,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE; Rxed chars. Posting the character should wake the task that is
blocked on the queue waiting for characters. */
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
- the currently executing task (i.e. the task that this interrupt
- interrupted.) */
- portEND_SWITCHING_ISR( 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
+ the currently executing task (i.e. the task that this interrupt
+ interrupted.) */
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c b/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c index bd8619b8..e46aa70b 100644 --- a/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c +++ b/Demo/CORTEX_LM3S102_Rowley/Demo1/main.c @@ -504,7 +504,7 @@ void vUART_ISR(void) {
unsigned portLONG ulStatus;
portCHAR cRxedChar;
-portBASE_TYPE xTaskWokenByPost = pdFALSE;
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt. */
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
@@ -521,7 +521,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE; Rxed chars. Posting the character should wake the task that is
blocked on the queue waiting for characters. */
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
- the currently executing task (i.e. the task that this interrupt
- interrupted.) */
- portEND_SWITCHING_ISR( 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
+ the currently executing task (i.e. the task that this interrupt
+ interrupted.) */
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S316_IAR/commstest.c b/Demo/CORTEX_LM3S316_IAR/commstest.c index 32f5dd1c..4213be7d 100644 --- a/Demo/CORTEX_LM3S316_IAR/commstest.c +++ b/Demo/CORTEX_LM3S316_IAR/commstest.c @@ -209,7 +209,7 @@ void vUART_ISR( void ) {
unsigned portLONG ulStatus;
portCHAR cRxedChar;
-portBASE_TYPE xTaskWokenByPost = pdFALSE;
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
/* What caused the interrupt. */
ulStatus = UARTIntStatus( UART0_BASE, pdTRUE );
@@ -226,7 +226,7 @@ portBASE_TYPE xTaskWokenByPost = pdFALSE; Rxed chars. Posting the character should wake the task that is
blocked on the queue waiting for characters. */
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
- the currently executing task (i.e. the task that this interrupt
- interrupted.) */
- portEND_SWITCHING_ISR( 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
+ the currently executing task (i.e. the task that this interrupt
+ interrupted.) */
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S811_GCC/main.c b/Demo/CORTEX_LM3S811_GCC/main.c index fc39bd13..5c581039 100644 --- a/Demo/CORTEX_LM3S811_GCC/main.c +++ b/Demo/CORTEX_LM3S811_GCC/main.c @@ -350,14 +350,15 @@ unsigned portLONG ulStatus; void vGPIO_ISR( void )
{
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
+
/* Clear the interrupt. */
GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
/* Wake the button handler task. */
- if( xSemaphoreGiveFromISR( xButtonSemaphore, pdFALSE ) )
- {
- portEND_SWITCHING_ISR( pdTRUE );
- }
+ xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
+
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S811_IAR/main.c b/Demo/CORTEX_LM3S811_IAR/main.c index 53bdd338..4441aa06 100644 --- a/Demo/CORTEX_LM3S811_IAR/main.c +++ b/Demo/CORTEX_LM3S811_IAR/main.c @@ -350,14 +350,14 @@ unsigned portLONG ulStatus; void vGPIO_ISR( void )
{
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
+
/* Clear the interrupt. */
GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
/* Wake the button handler task. */
- if( xSemaphoreGiveFromISR( xButtonSemaphore, pdFALSE ) )
- {
- portEND_SWITCHING_ISR( pdTRUE );
- }
+ xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
diff --git a/Demo/CORTEX_LM3S811_KEIL/main.c b/Demo/CORTEX_LM3S811_KEIL/main.c index 0481753f..0233d951 100644 --- a/Demo/CORTEX_LM3S811_KEIL/main.c +++ b/Demo/CORTEX_LM3S811_KEIL/main.c @@ -352,14 +352,14 @@ unsigned portLONG ulStatus; void vGPIO_ISR( void )
{
+portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
+
/* Clear the interrupt. */
- GPIOPinIntClear(GPIO_PORTC_BASE, mainPUSH_BUTTON);
+ GPIOPinIntClear( GPIO_PORTC_BASE, mainPUSH_BUTTON );
/* Wake the button handler task. */
- if( xSemaphoreGiveFromISR( xButtonSemaphore, pdFALSE ) )
- {
- portEND_SWITCHING_ISR( pdTRUE );
- }
+ xSemaphoreGiveFromISR( xButtonSemaphore, &xHigherPriorityTaskWoken );
+ portEND_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
/*-----------------------------------------------------------*/
|