]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/lwIP_Demo_Rowley_ARM7/main.c
Roll up the minor changes checked into svn since V10.0.0 into new V10.0.1 ready for...
[freertos] / FreeRTOS / Demo / lwIP_Demo_Rowley_ARM7 / main.c
index 1b660b41fb15e2fdc7ec2deda4578ae9aa3cd0bd..087779cf3bf87d9605e22ce486c365b3d813ddf2 100644 (file)
@@ -1,70 +1,33 @@
 /*\r
-    FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd.\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
-    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
-    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
-     *                                                                       *\r
-     *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
-     *                                                                       *\r
-    ***************************************************************************\r
-\r
-    http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
-    license and Real Time Engineers Ltd. contact details.\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
-\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
+ * FreeRTOS Kernel V10.0.1\r
+ * Copyright (C) 2017 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ *\r
+ * http://www.FreeRTOS.org\r
+ * http://aws.amazon.com/freertos\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
@@ -95,7 +58,7 @@
 /*\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
@@ -193,7 +156,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
@@ -202,13 +165,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
@@ -226,7 +189,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
@@ -245,8 +208,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
@@ -264,7 +227,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
@@ -312,7 +275,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
@@ -323,7 +286,7 @@ char cTxByte;
                for( cTxByte = mainFIRST_TX_CHAR; cTxByte <= mainLAST_TX_CHAR; cTxByte++ )\r
                {\r
                        vUSBSendByte( cTxByte );\r
-               }               \r
+               }\r
        }\r
 }\r
 \r