]> git.sur5r.net Git - freertos/blobdiff - Demo/WizNET_DEMO_GCC_ARM7/i2cISR.c
Update lwIP port layer for the Microblaze Ethernet Lite IP.
[freertos] / Demo / WizNET_DEMO_GCC_ARM7 / i2cISR.c
index 08093017fbf709650e7874a937f5c2dc451b7994..320ba6021d8ef3eb12551155e61f3caa227703be 100644 (file)
@@ -1,52 +1,54 @@
 /*\r
-       FreeRTOS.org V5.2.0 - Copyright (C) 2003-2009 Richard Barry.\r
-\r
-       This file is part of the FreeRTOS.org distribution.\r
-\r
-       FreeRTOS.org is free software; you can redistribute it and/or modify it \r
-       under the terms of the GNU General Public License (version 2) as published\r
-       by the Free Software Foundation and modified by the FreeRTOS exception.\r
-\r
-       FreeRTOS.org is distributed in the hope that it will be useful, but WITHOUT\r
-       ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \r
-       FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for \r
-       more details.\r
-\r
-       You should have received a copy of the GNU General Public License along \r
-       with FreeRTOS.org; if not, write to the Free Software Foundation, Inc., 59 \r
-       Temple Place, Suite 330, Boston, MA  02111-1307  USA.\r
-\r
-       A special exception to the GPL is included to allow you to distribute a \r
-       combined work that includes FreeRTOS.org without being obliged to provide\r
-       the source code for any proprietary components.  See the licensing section\r
-       of http://www.FreeRTOS.org for full details.\r
-\r
-\r
-       ***************************************************************************\r
-       *                                                                         *\r
-       * Get the FreeRTOS eBook!  See http://www.FreeRTOS.org/Documentation      *\r
-       *                                                                         *\r
-       * This is a concise, step by step, 'hands on' guide that describes both   *\r
-       * general multitasking concepts and FreeRTOS specifics. It presents and   *\r
-       * explains numerous examples that are written using the FreeRTOS API.     *\r
-       * Full source code for all the examples is provided in an accompanying    *\r
-       * .zip file.                                                              *\r
-       *                                                                         *\r
-       ***************************************************************************\r
-\r
-       1 tab == 4 spaces!\r
-\r
-       Please ensure to read the configuration and relevant port sections of the\r
-       online documentation.\r
-\r
-       http://www.FreeRTOS.org - Documentation, latest information, license and\r
-       contact details.\r
-\r
-       http://www.SafeRTOS.com - A version that is certified for use in safety\r
-       critical systems.\r
-\r
-       http://www.OpenRTOS.com - Commercial support, development, porting,\r
-       licensing and training services.\r
+    FreeRTOS V7.0.1 - Copyright (C) 2011 Real Time Engineers Ltd.\r
+       \r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    FreeRTOS tutorial books are available in pdf and paperback.        *\r
+     *    Complete, revised, and edited pdf reference manuals are also       *\r
+     *    available.                                                         *\r
+     *                                                                       *\r
+     *    Purchasing FreeRTOS documentation will not only help you, by       *\r
+     *    ensuring you get running as quickly as possible and with an        *\r
+     *    in-depth knowledge of how to use FreeRTOS, it will also help       *\r
+     *    the FreeRTOS project to continue with its mission of providing     *\r
+     *    professional grade, cross platform, de facto standard solutions    *\r
+     *    for microcontrollers - completely free of charge!                  *\r
+     *                                                                       *\r
+     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\r
+     *                                                                       *\r
+     *    Thank you for using FreeRTOS, and thank you for your support!      *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+\r
+    This file is part of the FreeRTOS distribution.\r
+\r
+    FreeRTOS is free software; you can redistribute it and/or modify it under\r
+    the terms of the GNU General Public License (version 2) as published by the\r
+    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.\r
+    >>>NOTE<<< The modification to the GPL is included to allow you to\r
+    distribute a combined work that includes FreeRTOS without being obliged to\r
+    provide the source code for proprietary components outside of the FreeRTOS\r
+    kernel.  FreeRTOS is distributed in the hope that it will be useful, but\r
+    WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\r
+    or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for\r
+    more details. You should have received a copy of the GNU General Public\r
+    License and the FreeRTOS license exception along with FreeRTOS; if not it\r
+    can be viewed here: http://www.freertos.org/a00114.html and also obtained\r
+    by writing to Richard Barry, contact details for whom are available on the\r
+    FreeRTOS WEB site.\r
+\r
+    1 tab == 4 spaces!\r
+\r
+    http://www.FreeRTOS.org - Documentation, latest information, license and\r
+    contact details.\r
+\r
+    http://www.SafeRTOS.com - A version that is certified for use in safety\r
+    critical systems.\r
+\r
+    http://www.OpenRTOS.com - Commercial support, development, porting,\r
+    licensing and training services.\r
 */\r
 \r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 /* Bit definitions within the I2CONCLR register. */\r
-#define i2cSTA_BIT             ( ( unsigned portCHAR ) 0x20 )\r
-#define i2cSI_BIT              ( ( unsigned portCHAR ) 0x08 )\r
-#define i2cSTO_BIT             ( ( unsigned portCHAR ) 0x10 )\r
-#define i2cAA_BIT              ( ( unsigned portCHAR ) 0x04 )\r
+#define i2cSTA_BIT             ( ( unsigned char ) 0x20 )\r
+#define i2cSI_BIT              ( ( unsigned char ) 0x08 )\r
+#define i2cSTO_BIT             ( ( unsigned char ) 0x10 )\r
+#define i2cAA_BIT              ( ( unsigned char ) 0x04 )\r
 \r
 /* Status codes for the I2STAT register. */\r
 #define i2cSTATUS_START_TXED                   ( 0x08 )\r
@@ -114,16 +116,16 @@ volatile xI2CMessage *pxCurrentMessage = NULL;
 static xQueueHandle xMessagesForTx;\r
 \r
 /* Flag used to indicate whether or not the ISR is amid sending a message. */\r
-unsigned portLONG ulBusFree = ( unsigned portLONG ) pdTRUE;\r
+unsigned long ulBusFree = ( unsigned long ) pdTRUE;\r
 \r
 /* Setting this to true will cause the TCP task to think a message is \r
 complete and thus restart.  It can therefore be used under error states\r
 to force a restart. */\r
-volatile portLONG lTransactionCompleted = pdTRUE;\r
+volatile long lTransactionCompleted = pdTRUE;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
-void vI2CISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxTxMessages, unsigned portLONG **ppulBusFree )\r
+void vI2CISRCreateQueues( unsigned portBASE_TYPE uxQueueLength, xQueueHandle *pxTxMessages, unsigned long **ppulBusFree )\r
 {\r
        /* Create the queues used to hold Rx and Tx characters. */\r
        xMessagesForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( xI2CMessage * ) );\r
@@ -162,9 +164,9 @@ void vI2C_ISR_Handler( void )
 {\r
 /* Holds the current transmission state. */                                                    \r
 static I2C_STATE eCurrentState = eSentStart;\r
-static portLONG lMessageIndex = -i2cBUFFER_ADDRESS_BYTES; /* There are two address bytes to send prior to the data. */\r
+static long lMessageIndex = -i2cBUFFER_ADDRESS_BYTES; /* There are two address bytes to send prior to the data. */\r
 portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
-portLONG lBytesLeft;\r
+long lBytesLeft;\r
 \r
        /* The action taken for this interrupt depends on our current state. */\r
        switch( eCurrentState )\r
@@ -260,7 +262,7 @@ portLONG lBytesLeft;
 \r
                                        /* How many more bytes are we expecting to receive? */\r
                                        lBytesLeft = pxCurrentMessage->lMessageLength - lMessageIndex;\r
-                                       if( lBytesLeft == ( unsigned portLONG ) 0 )\r
+                                       if( lBytesLeft == ( unsigned long ) 0 )\r
                                        {\r
                                                /* This was the last byte in the message. */\r
                                                i2cEND_TRANSMISSION( pdPASS );\r
@@ -284,7 +286,7 @@ portLONG lBytesLeft;
                                                {\r
                                                        /* No more messages were found to be waiting for\r
                                                        transaction so the bus is free. */\r
-                                                       ulBusFree = ( unsigned portLONG ) pdTRUE;                       \r
+                                                       ulBusFree = ( unsigned long ) pdTRUE;                   \r
                                                }                                               \r
                                        }\r
                                        else\r
@@ -351,7 +353,7 @@ portLONG lBytesLeft;
                                                {\r
                                                        /* No more message were queues for transaction so \r
                                                        the bus is free. */\r
-                                                       ulBusFree = ( unsigned portLONG ) pdTRUE;                       \r
+                                                       ulBusFree = ( unsigned long ) pdTRUE;                   \r
                                                }\r
                                        }\r
                                }\r