]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/MB96340_Softune/FreeRTOS_96348hs_SK16FX100PMC/Src/main.c
Update version number in preparation for maintenance release.
[freertos] / FreeRTOS / Demo / MB96340_Softune / FreeRTOS_96348hs_SK16FX100PMC / Src / main.c
index bd913948582908c1700259c352a1f2efd3e3afd7..d7f8362baa76a5e94d4dec4642dc068191bbd322 100644 (file)
@@ -1,59 +1,64 @@
 /*\r
-    FreeRTOS V7.5.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V9.0.1 - Copyright (C) 2017 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
+    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
 /*\r
  * Creates all the demo application tasks, then starts the scheduler.  The WEB\r
  * documentation provides more details of the demo application tasks.\r
- * \r
+ *\r
  * In addition to the standard demo tasks, the follow demo specific tasks are\r
  * create:\r
  *\r
- * The "Check" task.  This only executes every three seconds but has the highest \r
- * priority so is guaranteed to get processor time.  Its main function is to \r
- * check that all the other tasks are still operational.  Most tasks maintain \r
- * a unique count that is incremented each time the task successfully completes \r
- * its function.  Should any error occur within such a task the count is \r
- * permanently halted.  The check task inspects the count of each task to ensure \r
- * it has changed since the last time the check task executed.  If all the count \r
- * variables have changed all the tasks are still executing error free, and the \r
- * check task toggles the onboard LED.  Should any task contain an error at any time \r
+ * The "Check" task.  This only executes every three seconds but has the highest\r
+ * priority so is guaranteed to get processor time.  Its main function is to\r
+ * check that all the other tasks are still operational.  Most tasks maintain\r
+ * a unique count that is incremented each time the task successfully completes\r
+ * its function.  Should any error occur within such a task the count is\r
+ * permanently halted.  The check task inspects the count of each task to ensure\r
+ * it has changed since the last time the check task executed.  If all the count\r
+ * variables have changed all the tasks are still executing error free, and the\r
+ * check task toggles the onboard LED.  Should any task contain an error at any time\r
  * the LED toggle rate will change from 3 seconds to 500ms.\r
  *\r
- * The "Trace Utility" task.  This can be used to obtain trace and debug \r
+ * The "Trace Utility" task.  This can be used to obtain trace and debug\r
  * information via UART1.\r
  */\r
 \r
 /* Baud rate used by the COM test tasks. */\r
 #define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 19200 )\r
 \r
-/* The frequency at which the 'Check' tasks executes.  See the comments at the \r
+/* The frequency at which the 'Check' tasks executes.  See the comments at the\r
 top of the page.  When the system is operating error free the 'Check' task\r
 toggles an LED every three seconds.  If an error is discovered in any task the\r
-rate is increased to 500 milliseconds.  [in this case the '*' characters on the \r
+rate is increased to 500 milliseconds.  [in this case the '*' characters on the\r
 LCD represent LED's] */\r
-#define mainNO_ERROR_CHECK_DELAY       ( (portTickType) 3000 / portTICK_RATE_MS )\r
-#define mainERROR_CHECK_DELAY          ( (portTickType) 500 / portTICK_RATE_MS )\r
+#define mainNO_ERROR_CHECK_DELAY       ( (TickType_t) 3000 / portTICK_PERIOD_MS )\r
+#define mainERROR_CHECK_DELAY          ( (TickType_t) 500 / portTICK_PERIOD_MS )\r
 \r
 /* LED assignments for the demo tasks. */\r
 #define mainNUM_FLASH_CO_ROUTINES      8\r
@@ -143,7 +148,7 @@ LCD represent LED's] */
 \r
 /*-----------------------------------------------------------*/\r
 \r
-/* \r
+/*\r
  * The function that implements the Check task.  See the comments at the head\r
  * of the page for implementation details.\r
  */\r
@@ -175,7 +180,7 @@ void main( void )
 \r
        /* Start the standard demo application tasks. */\r
        vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
-       vStartIntegerMathTasks( tskIDLE_PRIORITY );     \r
+       vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
        vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
        vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
        vStartBlockingQueueTasks( mainQUEUE_BLOCK_PRIORITY );\r
@@ -192,7 +197,7 @@ void main( void )
        #endif\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
+       xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
 \r
        /* The suicide tasks must be started last as they record the number of other\r
        tasks that exist within the system.  The value is then used to ensure at run\r
@@ -200,10 +205,10 @@ void main( void )
        vCreateSuicidalTasks( mainDEATH_PRIORITY );\r
 \r
        /* Now start the scheduler.  Following this call the created tasks should\r
-       be executing. */        \r
+       be executing. */\r
        vTaskStartScheduler( );\r
-       \r
-       /* vTaskStartScheduler() will only return if an error occurs while the \r
+\r
+       /* vTaskStartScheduler() will only return if an error occurs while the\r
        idle task is being created. */\r
        for( ;; );\r
 }\r
@@ -223,7 +228,7 @@ static void prvSetupHardware( void )
 \r
 static void vErrorChecks( void *pvParameters )\r
 {\r
-portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY;\r
+TickType_t xDelayPeriod = mainNO_ERROR_CHECK_DELAY;\r
 \r
        /* Just to remove compiler warnings. */\r
        ( void ) pvParameters;\r
@@ -233,14 +238,14 @@ portTickType xDelayPeriod = mainNO_ERROR_CHECK_DELAY;
        for( ;; )\r
        {\r
                /* Wait until it is time to check again.  The time we wait here depends\r
-               on whether an error has been detected or not.  When an error is \r
+               on whether an error has been detected or not.  When an error is\r
                detected the time is shortened resulting in a faster LED flash rate. */\r
                vTaskDelay( xDelayPeriod );\r
 \r
                /* See if the other tasks are all ok. */\r
                if( prvCheckOtherTasksAreStillRunning() != pdPASS )\r
                {\r
-                       /* An error occurred in one of the tasks so shorten the delay \r
+                       /* An error occurred in one of the tasks so shorten the delay\r
                        period - which has the effect of increasing the frequency of the\r
                        LED toggle. */\r
                        xDelayPeriod = mainERROR_CHECK_DELAY;\r
@@ -257,7 +262,7 @@ static short prvCheckOtherTasksAreStillRunning( void )
        static short    sNoErrorFound = pdTRUE;\r
 \r
        /* The demo tasks maintain a count that increments every cycle of the task\r
-       provided that the task has never encountered an error.  This function \r
+       provided that the task has never encountered an error.  This function\r
        checks the counts maintained by the tasks to ensure they are still being\r
        incremented.  A count remaining at the same value between calls therefore\r
        indicates that an error has been detected.  Only tasks that do not flash\r