From: richardbarry Date: Fri, 7 Mar 2008 11:11:27 +0000 (+0000) Subject: Small optimisation by using constants for register addresses. X-Git-Tag: V4.8.0~41 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5bd98274c14de0c27c10fa299c79a68e32bef019;p=freertos 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 --- 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; } }