Update to use new xQueueSendFromISR() and xSemaphoreGiveFromISR() function semantics.

This commit is contained in:
Richard Barry 2008-04-12 23:32:18 +00:00
parent 7eb7201b46
commit f4dd20dffc
54 changed files with 266 additions and 251 deletions

View file

@ -346,7 +346,7 @@ eth_input( struct netif *netif, struct pbuf *p )
void
mcf523xfec_rx_irq( void )
{
static portBASE_TYPE xNeedSwitch = pdFALSE;
static portBASE_TYPE xHigherPriorityTaskWoken;
/* Workaround GCC if frame pointers are enabled. This is an ISR and
* we must not modify the stack before portENTER_SWITCHING_ISR( )
@ -359,7 +359,7 @@ mcf523xfec_rx_irq( void )
* a call to the portENTER_SWITCHING_ISR() macro.
*/
portENTER_SWITCHING_ISR( );
xHigherPriorityTaskWoken = pdFALSE;
/* Set Debug PIN to high to measure RX latency. */
FEC_DEBUG_RX_TIMING( 1 );
@ -368,9 +368,9 @@ mcf523xfec_rx_irq( void )
{
/* Clear interrupt from EIR register immediately */
MCF_FEC_EIR = ( MCF_FEC_EIR_RXB | MCF_FEC_EIR_RXF );
xNeedSwitch = xSemaphoreGiveFromISR( fecif_g->rx_sem, pdFALSE );
xSemaphoreGiveFromISR( fecif_g->rx_sem, &xHigherPriorityTaskWoken );
}
portEXIT_SWITCHING_ISR( xNeedSwitch );
portEXIT_SWITCHING_ISR( xHigherPriorityTaskWoken );
}
void

View file

@ -270,7 +270,7 @@ void
prvSerialISR( void )
{
static signed portCHAR cChar;
static portBASE_TYPE xTaskWokenByTx = pdFALSE, xTaskWokenByRx = pdFALSE;
static portBASE_TYPE xHigherPriorityTaskWoken;
/* We have to remvoe the effect of the GCC. Please note that the
* __attribute__ ((interrupt_handler)) does not work here because we
@ -285,12 +285,13 @@ prvSerialISR( void )
* variable declarations.
*/
portENTER_SWITCHING_ISR();
xHigherPriorityTaskWoken = pdFALSE;
/* Ready to send a character from the buffer. */
if( MCF_UART_USR0 & MCF_UART_USR_TXRDY )
{
/* Transmit buffer is ready. Test if there are characters available. */
if( xQueueReceiveFromISR( xComPortIF[ 0 ].xTXChars, &cChar, &xTaskWokenByTx ) ==
if( xQueueReceiveFromISR( xComPortIF[ 0 ].xTXChars, &cChar, &xHigherPriorityTaskWoken ) ==
pdTRUE )
{
/* A character was retrieved from the queue so can be sent. */
@ -305,11 +306,10 @@ prvSerialISR( void )
if( MCF_UART_USR0 & MCF_UART_USR_RXRDY )
{
cChar = MCF_UART_URB0;
xTaskWokenByRx =
xQueueSendFromISR( xComPortIF[ 0].xRXChars, &cChar, xTaskWokenByRx );
xQueueSendFromISR( xComPortIF[ 0].xRXChars, &cChar, &xHigherPriorityTaskWoken );
}
/* Exit the ISR. If a task was woken by either a character being
* or transmitted then a context switch will occur.
*/
portEXIT_SWITCHING_ISR( ( xTaskWokenByTx || xTaskWokenByRx ) );
portEXIT_SWITCHING_ISR( xHigherPriorityTaskWoken );
}