]> 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 2bc5c57a2f68d07e7d94edec9b88e8c448da1c7d..23607f9f1df0850cfcc48c761abc2825af200f5e 100644 (file)
@@ -1,80 +1,75 @@
 /*\r
-    FreeRTOS V7.4.1 - Copyright (C) 2013 Real Time Engineers Ltd.\r
-\r
-    FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME.  PLEASE VISIT\r
-    http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\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
+    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
     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
+    Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception.\r
 \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.\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.  See the GNU General Public License for more\r
-    details. You should have received a copy of the GNU General Public License\r
-    and the FreeRTOS license exception along with FreeRTOS; if not it can be\r
-    viewed here: http://www.freertos.org/a00114.html and also obtained by\r
-    writing to Real Time Engineers Ltd., contact details for whom are available\r
-    on the FreeRTOS WEB site.\r
-\r
-    1 tab == 4 spaces!\r
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following\r
+    link: http://www.freertos.org/a00114.html\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/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 - Documentation, books, training, latest versions, \r
-    license and Real Time Engineers Ltd. contact details.\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, and our new\r
-    fully thread aware and reentrant UDP/IP stack.\r
-\r
-    http://www.OpenRTOS.com - Real Time Engineers ltd license FreeRTOS to High \r
-    Integrity Systems, who sell the code with commercial support, \r
-    indemnification and middleware, under the OpenRTOS brand.\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
+    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.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
     mission critical applications that require provable dependability.\r
+\r
+    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
@@ -203,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
@@ -212,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
@@ -236,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
@@ -255,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
@@ -274,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
@@ -322,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
@@ -333,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