From fcb1bbc53af2b6b56d9aa87362842f8062d7495f Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sat, 12 Apr 2008 23:34:49 +0000 Subject: [PATCH] Update to use new xQueueSendFromISR() and xSemaphoreGiveFromISR() function semantics. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@309 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/CORTEX_STM32F103_IAR/serial/serial.c | 8 ++++---- Demo/CORTEX_STM32F103_Primer_GCC/main.c | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Demo/CORTEX_STM32F103_IAR/serial/serial.c b/Demo/CORTEX_STM32F103_IAR/serial/serial.c index 383f68a06..07d838d29 100644 --- a/Demo/CORTEX_STM32F103_IAR/serial/serial.c +++ b/Demo/CORTEX_STM32F103_IAR/serial/serial.c @@ -215,14 +215,14 @@ void vSerialClose( xComPortHandle xPort ) void vUARTInterruptHandler( void ) { -portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByPost = pdFALSE; +portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; portCHAR cChar; if( USART_GetITStatus( USART1, USART_IT_TXE ) == SET ) { /* The interrupt was caused by the THR becoming empty. Are there any more characters to transmit? */ - if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWokenByTx ) == pdTRUE ) + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) { /* A character was retrieved from the queue so can be sent to the THR now. */ @@ -237,10 +237,10 @@ portCHAR cChar; if( USART_GetITStatus( USART1, USART_IT_RXNE ) == SET ) { cChar = USART_ReceiveData( USART1 ); - xTaskWokenByPost = xQueueSendFromISR( xRxedChars, &cChar, xTaskWokenByPost ); + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); } - portEND_SWITCHING_ISR( xTaskWokenByPost || xTaskWokenByTx ); + portEND_SWITCHING_ISR( xHigherPriorityTaskWoken ); } diff --git a/Demo/CORTEX_STM32F103_Primer_GCC/main.c b/Demo/CORTEX_STM32F103_Primer_GCC/main.c index c70da6b13..27dd74dbd 100644 --- a/Demo/CORTEX_STM32F103_Primer_GCC/main.c +++ b/Demo/CORTEX_STM32F103_Primer_GCC/main.c @@ -371,6 +371,7 @@ void vApplicationTickHook( void ) { static unsigned portLONG ulCallCount; static const xLCDMessage xMemsMessage = { mainUPDATE_BALL_MESSAGE, NULL }; +static portBASE_TYPE xHigherPriorityTaskWoken; /* Periodically send a message to the LCD task telling it to update the MEMS input, and then if necessary the LCD. */ @@ -378,7 +379,8 @@ static const xLCDMessage xMemsMessage = { mainUPDATE_BALL_MESSAGE, NULL }; if( ulCallCount >= mainMEMS_DELAY ) { ulCallCount = 0; - xQueueSendFromISR( xLCDQueue, &xMemsMessage, pdFALSE ); + xHigherPriorityTaskWoken = pdFALSE; + xQueueSendFromISR( xLCDQueue, &xMemsMessage, &xHigherPriorityTaskWoken ); } } /*-----------------------------------------------------------*/ -- 2.39.5