]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/MB96350_Softune_Dice_Kit/main.c
Update version number in readiness for V10.3.0 release. Sync SVN with reviewed releas...
[freertos] / FreeRTOS / Demo / MB96350_Softune_Dice_Kit / main.c
index d8877492800495aa4927a1f88d24ee28514121c8..b53cbb1b1dd34dff0cd7d58b5b39056aab151785 100644 (file)
@@ -1,93 +1,54 @@
 /*\r
-    FreeRTOS V7.2.0 - Copyright (C) 2012 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
-    ***************************************************************************\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
-    \r
-    http://www.FreeRTOS.org - Documentation, training, latest information, \r
-    license and contact details.\r
-    \r
-    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
-    including FreeRTOS+Trace - an indispensable productivity tool.\r
-\r
-    Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
-    the code with commercial support, indemnification, and middleware, under \r
-    the OpenRTOS brand: http://www.OpenRTOS.com.  High Integrity Systems also\r
-    provide a safety engineered and independently SIL3 certified version under \r
-    the SafeRTOS brand: http://www.SafeRTOS.com.\r
-*/\r
+ * FreeRTOS Kernel V10.3.0\r
+ * Copyright (C) 2020 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
  *\r
  * See http://www.freertos.org/Documentation/FreeRTOS-documentation-and-book.html\r
- * for an introductory guide to using real time kernels, and FreeRTOS in \r
- * particular. \r
+ * for an introductory guide to using real time kernels, and FreeRTOS in\r
+ * particular.\r
  *\r
  *****\r
- *  \r
+ *\r
  * The DICE-KIT-16FX has two 7 segment displays and two buttons that can\r
  * generate interrupts.  This example uses this IO as follows:\r
  *\r
  *\r
- * - Left 7 segment display - \r
+ * - Left 7 segment display -\r
  *\r
- * 7 'flash' tasks are created, each of which toggles a single segment of the \r
- * left display.  Each task executes at a fixed frequency, with a different \r
+ * 7 'flash' tasks are created, each of which toggles a single segment of the\r
+ * left display.  Each task executes at a fixed frequency, with a different\r
  * frequency being used by each task.\r
  *\r
  * When button SW2 is pressed an interrupt is generated that wakes up a 'dice'\r
  * task.  The dice task suspends the 7 tasks that are accessing the left display\r
  * before simulating a dice being thrown by generating a random number between\r
  * 1 and 6.  After the number has been generated the task sleeps for 5 seconds,\r
- * if SW2 is pressed again within the 5 seconds another random number is \r
+ * if SW2 is pressed again within the 5 seconds another random number is\r
  * generated, if SW2 is not pressed within the 5 seconds then the 7 tasks are\r
  * un-suspended and will once again toggle the segments of the left hand display.\r
  *\r
  * Only one dice task is actually defined.  Two instances of this single\r
  * definition are created, the first to simulate a dice being thrown on the left\r
  * display, and the other to simulate a dice being thrown on the right display.\r
- * The task parameter is used to let the dice tasks know which display to \r
+ * The task parameter is used to let the dice tasks know which display to\r
  * control.\r
  *\r
  * Both dice tasks and the flash tasks operate completely independently under\r
  * the control of FreeRTOS.  11 tasks and 7 co-routines are created in total,\r
- * including the idle task. \r
+ * including the idle task.\r
  *\r
  * The co-routines all execute within a single low priority task.\r
  *\r
 \r
 /* Kernel includes. */\r
 #include "FreeRTOS.h"\r
-#include "Task.h"\r
+#include "task.h"\r
 \r
 /* Demo includes. */\r
 #include "DiceTask.h"\r
@@ -161,10 +122,10 @@ void main( void )
        vCreateFlashTasksAndCoRoutines();\r
 \r
        /* Create a 'dice' task to control the left hand display. */\r
-       xTaskCreate( vDiceTask, ( signed char * ) "Dice1", configMINIMAL_STACK_SIZE, ( void * ) configLEFT_DISPLAY, mainDICE_PRIORITY, NULL );\r
+       xTaskCreate( vDiceTask, "Dice1", configMINIMAL_STACK_SIZE, ( void * ) configLEFT_DISPLAY, mainDICE_PRIORITY, NULL );\r
 \r
        /* Create a 'dice' task to control the right hand display. */\r
-       xTaskCreate( vDiceTask, ( signed char * ) "Dice2", configMINIMAL_STACK_SIZE, ( void * ) configRIGHT_DISPLAY, mainDICE_PRIORITY, NULL );\r
+       xTaskCreate( vDiceTask, "Dice2", configMINIMAL_STACK_SIZE, ( void * ) configRIGHT_DISPLAY, mainDICE_PRIORITY, NULL );\r
 \r
        /* Start the scheduler running. */\r
        vTaskStartScheduler();\r
@@ -182,7 +143,7 @@ static void prvSetupHardware( void )
        scheduler has been started. */\r
        InitIrqLevels();\r
        portDISABLE_INTERRUPTS();\r
-       __set_il( 7 );  \r
+       __set_il( 7 );\r
 \r
        /* Set Port3 as output (7Segment Display). */\r
        DDR03  = 0xff;\r
@@ -211,7 +172,7 @@ static void prvSetupHardware( void )
 \r
        /* Enable external interrupt 8. */\r
        PIER00_IE0 = 1;\r
-       \r
+\r
        /* LB0, LA0 = 11 -> falling edge. */\r
        ELVRL1_LB8 = 1;\r
        ELVRL1_LA8 = 1;\r
@@ -222,13 +183,13 @@ static void prvSetupHardware( void )
 \r
        /* Enable external interrupt 9. */\r
        PIER00_IE1 = 1;\r
-       \r
+\r
        /* LB1, LA1 = 11 -> falling edge. */\r
        ELVRL1_LB9 = 1;\r
        ELVRL1_LA9 = 1;\r
 \r
        /* Reset and enable the interrupt request. */\r
        EIRR1_ER9 = 0;\r
-       ENIR1_EN9 = 1;  \r
+       ENIR1_EN9 = 1;\r
 }\r
 \r