From 5bd98274c14de0c27c10fa299c79a68e32bef019 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Fri, 7 Mar 2008 11:11:27 +0000 Subject: [PATCH] Small optimisation by using constants for register addresses. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@240 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c index 911276549..6a17e59b8 100644 --- a/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c +++ b/Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c @@ -184,18 +184,18 @@ portCHAR cChar; { lDidSomething = pdFALSE; - ulISRStatus = XIo_In32( pxUART->RegBaseAddress + XUL_STATUS_REG_OFFSET ); + ulISRStatus = XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_STATUS_REG_OFFSET ); - if( ( ulISRStatus & (XUL_SR_RX_FIFO_FULL | XUL_SR_RX_FIFO_VALID_DATA ) ) != 0 ) + if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 ) { /* A character is available - place it in the queue of received characters. This might wake a task that was blocked waiting for data. */ - cChar = ( portCHAR ) XIo_In32( pxUART->RegBaseAddress + XUL_RX_FIFO_OFFSET ); + cChar = ( portCHAR ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET ); xTaskWokenByRx = xQueueSendFromISR( xRxedChars, &cChar, xTaskWokenByRx ); lDidSomething = pdTRUE; } - + if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 ) { /* There is space in the FIFO - if there are any characters queue for @@ -203,7 +203,7 @@ portCHAR cChar; task that was waiting for space to become available on the Tx queue. */ if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWokenByTx ) == pdTRUE ) { - XIo_Out32( pxUART->RegBaseAddress + XUL_TX_FIFO_OFFSET, cChar ); + XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cChar ); lDidSomething = pdTRUE; } } -- 2.39.5