]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/main.c
Update version number ready for V8.2.1 release.
[freertos] / FreeRTOS / Demo / lwIP_Demo_Rowley_ARM7 / main.c
index afc5372b50991530fedca8ffa5dc4628765ecc88..23607f9f1df0850cfcc48c761abc2825af200f5e 100644 (file)
@@ -1,60 +1,64 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V8.2.1 - Copyright (C) 2015 Real Time Engineers Ltd.\r
     All rights reserved\r
 \r
     VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
 \r
-    ***************************************************************************\r
-     *                                                                       *\r
-     *    FreeRTOS provides completely free yet professionally developed,    *\r
-     *    robust, strictly quality controlled, supported, and cross          *\r
-     *    platform software that has become a de facto standard.             *\r
-     *                                                                       *\r
-     *    Help yourself get started quickly and support the FreeRTOS         *\r
-     *    project by purchasing a FreeRTOS tutorial book, reference          *\r
-     *    manual, or both from: http://www.FreeRTOS.org/Documentation        *\r
-     *                                                                       *\r
-     *    Thank you!                                                         *\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
 \r
-    >>! NOTE: The modification to the GPL is included to allow you to distribute\r
-    >>! a combined work that includes FreeRTOS without being obliged to provide\r
-    >>! the source code for proprietary components outside of the FreeRTOS\r
-    >>! kernel.\r
+    ***************************************************************************\r
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<\r
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS kernel.                                   !<<\r
+    ***************************************************************************\r
 \r
     FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY\r
     WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS\r
-    FOR A PARTICULAR PURPOSE.  Full license text is available from the following\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
     link: http://www.freertos.org/a00114.html\r
 \r
-    1 tab == 4 spaces!\r
-\r
     ***************************************************************************\r
      *                                                                       *\r
-     *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?"                                     *\r
+     *    FreeRTOS provides completely free yet professionally developed,    *\r
+     *    robust, strictly quality controlled, supported, and cross          *\r
+     *    platform software that is more than just the market leader, it     *\r
+     *    is the industry's de facto standard.                               *\r
      *                                                                       *\r
-     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
+     *    Help yourself get started quickly while simultaneously helping     *\r
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *\r
+     *    tutorial book, reference manual, or both:                          *\r
+     *    http://www.FreeRTOS.org/Documentation                              *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
-    license and Real Time Engineers Ltd. contact details.\r
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading\r
+    the FAQ page "My application does not run, what could be wrong?".  Have you\r
+    defined configASSERT()?\r
+\r
+    http://www.FreeRTOS.org/support - In return for receiving this top quality\r
+    embedded software for free we request you assist our global community by\r
+    participating in the support forum.\r
+\r
+    http://www.FreeRTOS.org/training - Investing in training allows your team to\r
+    be as productive as possible as early as possible.  Now you can receive\r
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers\r
+    Ltd, and the world's leading authority on the world's leading RTOS.\r
 \r
     http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
     including FreeRTOS+Trace - an indispensable productivity tool, a DOS\r
     compatible FAT file system, and our tiny thread aware UDP/IP stack.\r
 \r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High\r
-    Integrity Systems to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and middleware.\r
+    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.\r
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.\r
+\r
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High\r
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
+    licenses offer ticketed support, indemnification and commercial middleware.\r
 \r
     http://www.SafeRTOS.com - High Integrity Systems also provide a safety\r
     engineered and independently SIL3 certified version for use in safety and\r
@@ -63,9 +67,9 @@
     1 tab == 4 spaces!\r
 */\r
 \r
-/* \r
+/*\r
        NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
-       The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+       The processor MUST be in supervisor mode when vTaskStartScheduler is\r
        called.  The demo applications included in the FreeRTOS.org download switch\r
        to supervisor mode prior to main being called.  If you are not using one of\r
        these demo application projects then ensure Supervisor mode is used.\r
 /*\r
  * Creates all the application tasks, then starts the scheduler.\r
  *\r
- * A task defined by the function vBasicWEBServer is created.  This executes \r
+ * A task defined by the function vBasicWEBServer is created.  This executes\r
  * the lwIP stack and basic WEB server sample.  A task defined by the function\r
- * vUSBCDCTask.  This executes the USB to serial CDC example.  All the other \r
- * tasks are from the set of standard demo tasks.  The WEB documentation \r
+ * vUSBCDCTask.  This executes the USB to serial CDC example.  All the other\r
+ * tasks are from the set of standard demo tasks.  The WEB documentation\r
  * provides more details of the standard demo application tasks.\r
  *\r
  * Main.c also creates a task called "Check".  This only executes every three\r
 /*\r
        Changes from V3.2.2\r
 \r
-       + Modified the stack sizes used by some tasks to permit use of the \r
+       + Modified the stack sizes used by some tasks to permit use of the\r
          command line GCC tools.\r
 */\r
 \r
 #include "USB-CDC.h"\r
 \r
 /* lwIP includes. */\r
-#include "lwip/api.h" \r
+#include "lwip/api.h"\r
 \r
 /* Hardware specific headers. */\r
 #include "Board.h"\r
 \r
 /* The rate at which the on board LED will toggle when there is/is not an\r
 error. */\r
-#define mainNO_ERROR_FLASH_PERIOD      ( ( portTickType ) 3000 / portTICK_RATE_MS  )\r
-#define mainERROR_FLASH_PERIOD         ( ( portTickType ) 500 / portTICK_RATE_MS  )\r
+#define mainNO_ERROR_FLASH_PERIOD      ( ( TickType_t ) 3000 / portTICK_PERIOD_MS  )\r
+#define mainERROR_FLASH_PERIOD         ( ( TickType_t ) 500 / portTICK_PERIOD_MS  )\r
 \r
 /* The rate at which the idle hook sends data to the USB port. */\r
-#define mainUSB_TX_FREQUENCY           ( 100 / portTICK_RATE_MS )\r
+#define mainUSB_TX_FREQUENCY           ( 100 / portTICK_PERIOD_MS )\r
 \r
 /* The string that is transmitted down the USB port. */\r
 #define mainFIRST_TX_CHAR                      'a'\r
@@ -194,7 +198,7 @@ int main( void )
     sys_thread_new( vBasicWEBServer, ( void * ) NULL, mainWEBSERVER_PRIORITY );\r
 \r
        /* Create the demo USB CDC task. */\r
-       xTaskCreate( vUSBCDCTask, ( signed char * ) "USB", mainUSB_TASK_STACK, NULL, mainUSB_PRIORITY, NULL );\r
+       xTaskCreate( vUSBCDCTask, "USB", mainUSB_TASK_STACK, NULL, mainUSB_PRIORITY, NULL );\r
 \r
        /* Create the standard demo application tasks. */\r
        vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
@@ -203,13 +207,13 @@ int main( void )
        vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
        vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
 \r
-       /* Start the check task - which is defined in this file. */     \r
-    xTaskCreate( vErrorChecks, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+       /* Start the check task - which is defined in this file. */\r
+    xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
 \r
-       /* Finally, start the scheduler. \r
+       /* Finally, start the scheduler.\r
 \r
        NOTE : Tasks run in system mode and the scheduler runs in Supervisor mode.\r
-       The processor MUST be in supervisor mode when vTaskStartScheduler is \r
+       The processor MUST be in supervisor mode when vTaskStartScheduler is\r
        called.  The demo applications included in the FreeRTOS.org download switch\r
        to supervisor mode prior to main being called.  If you are not using one of\r
        these demo application projects then ensure Supervisor mode is used here. */\r
@@ -227,7 +231,7 @@ static void prvSetupHardware( void )
        the correct default state.  This line just ensures that this does not\r
        cause all interrupts to be masked at the start. */\r
        AT91C_BASE_AIC->AIC_EOICR = 0;\r
-       \r
+\r
        /* Most setup is performed by the low level init function called from the\r
        startup asm file.\r
 \r
@@ -246,8 +250,8 @@ static void prvSetupHardware( void )
 \r
 static void vErrorChecks( void *pvParameters )\r
 {\r
-portTickType xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;\r
-portTickType xLastWakeTime;\r
+TickType_t xDelayPeriod = mainNO_ERROR_FLASH_PERIOD;\r
+TickType_t xLastWakeTime;\r
 \r
        /* The parameters are not used. */\r
        ( void ) pvParameters;\r
@@ -265,7 +269,7 @@ portTickType xLastWakeTime;
                /* Delay until it is time to execute again.  The delay period is\r
                shorter following an error. */\r
                vTaskDelayUntil( &xLastWakeTime, xDelayPeriod );\r
-       \r
+\r
                /* Check all the standard demo application tasks are executing without\r
                error.  */\r
                if( prvCheckOtherTasksAreStillRunning() != pdPASS )\r
@@ -313,7 +317,7 @@ long lReturn = ( long ) pdPASS;
 \r
 void vApplicationIdleHook( void )\r
 {\r
-static portTickType xLastTx = 0;\r
+static TickType_t xLastTx = 0;\r
 char cTxByte;\r
 \r
        /* The idle hook simply sends a string of characters to the USB port.\r
@@ -324,7 +328,7 @@ char cTxByte;
                for( cTxByte = mainFIRST_TX_CHAR; cTxByte <= mainLAST_TX_CHAR; cTxByte++ )\r
                {\r
                        vUSBSendByte( cTxByte );\r
-               }               \r
+               }\r
        }\r
 }\r
 \r