]> git.sur5r.net Git - freertos/commitdiff
Small optimisation by using constants for register addresses.
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 7 Mar 2008 11:11:27 +0000 (11:11 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Fri, 7 Mar 2008 11:11:27 +0000 (11:11 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@240 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Demo/PPC405_Xilinx_Virtex4_GCC/RTOSDemo/serial/serial.c

index 91127654988376e539b97448f1aec52aadea834d..6a17e59b8bce5a4199312e0d9e14e53e7e03aea4 100644 (file)
@@ -184,18 +184,18 @@ portCHAR cChar;
        {\r
                lDidSomething = pdFALSE;\r
 \r
-               ulISRStatus = XIo_In32( pxUART->RegBaseAddress + XUL_STATUS_REG_OFFSET );\r
+               ulISRStatus = XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_STATUS_REG_OFFSET );\r
 \r
-               if( ( ulISRStatus & (XUL_SR_RX_FIFO_FULL | XUL_SR_RX_FIFO_VALID_DATA ) ) != 0 )\r
+               if( ( ulISRStatus & XUL_SR_RX_FIFO_VALID_DATA ) != 0 )\r
                {\r
                        /* A character is available - place it in the queue of received\r
                        characters.  This might wake a task that was blocked waiting for \r
                        data. */\r
-                       cChar = ( portCHAR ) XIo_In32( pxUART->RegBaseAddress + XUL_RX_FIFO_OFFSET );\r
+                       cChar = ( portCHAR ) XIo_In32( XPAR_RS232_UART_BASEADDR + XUL_RX_FIFO_OFFSET );\r
                        xTaskWokenByRx = xQueueSendFromISR( xRxedChars, &cChar, xTaskWokenByRx );\r
                        lDidSomething = pdTRUE;\r
                }\r
-\r
+               \r
                if( ( ulISRStatus & XUL_SR_TX_FIFO_EMPTY ) != 0 )\r
                {\r
                        /* There is space in the FIFO - if there are any characters queue for\r
@@ -203,7 +203,7 @@ portCHAR cChar;
                        task that was waiting for space to become available on the Tx queue. */\r
                        if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xTaskWokenByTx ) == pdTRUE )\r
                        {\r
-                               XIo_Out32( pxUART->RegBaseAddress + XUL_TX_FIFO_OFFSET, cChar );\r
+                               XIo_Out32( XPAR_RS232_UART_BASEADDR + XUL_TX_FIFO_OFFSET, cChar );\r
                                lDidSomething = pdTRUE;\r
                        }                       \r
                }\r