]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/ARM7_STR75x_IAR/main.c
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Demo / ARM7_STR75x_IAR / main.c
index 25e7289a8fe188c89532202d2e619645d88441df..5153dc1cf564fd89aef04bad995946d2a4affe3c 100644 (file)
@@ -1,67 +1,66 @@
 /*\r
-    FreeRTOS V7.2.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
-       \r
+    FreeRTOS V8.1.2 - Copyright (C) 2014 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 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
+     *    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
-     *    >>> See http://www.FreeRTOS.org/Documentation for details. <<<     *\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 for using FreeRTOS, and thank you for your support!      *\r
+     *    Thank you!                                                         *\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
+    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   !<<\r
+    >>!   obliged to provide the source code for proprietary components     !<<\r
+    >>!   outside of the FreeRTOS 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
      *                                                                       *\r
      *    Having a problem?  Start by reading the FAQ "My application does   *\r
-     *    not run, what could be wrong?                                      *\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 - 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.\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
-    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
+    1 tab == 4 spaces!\r
 */\r
 \r
 /*\r
@@ -169,7 +168,7 @@ static void vPrintTask( void *pvParameters );
 /*-----------------------------------------------------------*/\r
 \r
 /* The queue used to communicate with the LCD print task. */\r
-static xQueueHandle xLCDQueue;\r
+static QueueHandle_t xLCDQueue;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -181,8 +180,8 @@ void main( void )
        vParTestInitialise();\r
 \r
        /* Create the queue used to communicate with the LCD print task. */\r
-       xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) ); \r
-       \r
+       xLCDQueue = xQueueCreate( mainLCD_QUEUE_LENGTH, sizeof( LCDMessage ) );\r
+\r
        /* Create the standard demo application tasks.  See the WEB documentation\r
        for more information on these tasks. */\r
        vCreateBlockTimeTasks();\r
@@ -191,13 +190,13 @@ void main( void )
        vStartDynamicPriorityTasks();\r
        vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
        vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
-       \r
+\r
        /* Create the tasks defined within this file. */\r
-       xTaskCreate( vPrintTask, ( signed char * ) "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
-       xTaskCreate( vCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
-       \r
+       xTaskCreate( vPrintTask, "LCD", configMINIMAL_STACK_SIZE, NULL, mainLCD_TASK_PRIORITY, NULL );\r
+       xTaskCreate( vCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+\r
        vTaskStartScheduler();\r
-       \r
+\r
        /* Execution will only reach here if there was insufficient heap to\r
        start the scheduler. */\r
 }\r
@@ -205,8 +204,8 @@ void main( void )
 \r
 static void vCheckTask( void *pvParameters )\r
 {\r
-static unsigned long ulErrorDetected = pdFALSE;        \r
-portTickType xLastExecutionTime;\r
+static unsigned long ulErrorDetected = pdFALSE;\r
+TickType_t xLastExecutionTime;\r
 unsigned char *cErrorMessage = "              FAIL";\r
 unsigned char *cSuccessMessage = "              PASS";\r
 unsigned portBASE_TYPE uxColumn = mainMAX_WRITE_COLUMN;\r
@@ -222,7 +221,7 @@ LCDMessage xMessage;
                vTaskDelayUntil( &xLastExecutionTime, mainCHECK_TASK_CYCLE_TIME );\r
 \r
                /* Has an error been found in any of the standard demo tasks? */\r
-               \r
+\r
                if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
                {\r
                        ulErrorDetected = pdTRUE;\r
@@ -237,17 +236,17 @@ LCDMessage xMessage;
                {\r
                        ulErrorDetected = pdTRUE;\r
                }\r
-               \r
+\r
                if( xAreComTestTasksStillRunning() != pdTRUE )\r
                {\r
                        ulErrorDetected = pdTRUE;\r
-               }               \r
-               \r
+               }\r
+\r
                if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
                {\r
                        ulErrorDetected = pdTRUE;\r
-               }               \r
-       \r
+               }\r
+\r
                /* Calculate the LCD line on which we would like the message to\r
                be displayed.  The column variable is used for convenience as\r
                it is incremented each cycle anyway. */\r
@@ -256,19 +255,19 @@ LCDMessage xMessage;
                /* The message displayed depends on whether an error was found or\r
                not.  Any discovered error is latched.  Here the column variable\r
                is used as an index into the text string as a simple way of moving\r
-               the text from column to column. */              \r
+               the text from column to column. */\r
                if( ulErrorDetected == pdFALSE )\r
                {\r
                        xMessage.pucString = cSuccessMessage + uxColumn;\r
                }\r
                else\r
                {\r
-                       xMessage.pucString = cErrorMessage + uxColumn;                  \r
-               }               \r
+                       xMessage.pucString = cErrorMessage + uxColumn;\r
+               }\r
 \r
                /* Send the message to the print task for display. */\r
                xQueueSend( xLCDQueue, ( void * ) &xMessage, mainNO_DELAY );\r
-               \r
+\r
                /* Make sure the message is printed in a different column the next\r
                time around. */\r
                uxColumn--;\r
@@ -288,7 +287,7 @@ LCDMessage xMessage;
        {\r
                /* Wait until a message arrives. */\r
                while( xQueueReceive( xLCDQueue, ( void * ) &xMessage, portMAX_DELAY ) != pdPASS );\r
-               \r
+\r
                /* The message contains the text to display, and the line on which the\r
                text should be displayed. */\r
                LCD_Clear();\r
@@ -299,51 +298,51 @@ LCDMessage xMessage;
 \r
 static void prvSetupHardware(void)\r
 {\r
-ErrorStatus OSC4MStartUpStatus01;      \r
+ErrorStatus OSC4MStartUpStatus01;\r
 \r
        /* ST provided routine. */\r
 \r
        /* MRCC system reset */\r
        MRCC_DeInit();\r
-       \r
+\r
        /* Wait for OSC4M start-up */\r
        OSC4MStartUpStatus01 = MRCC_WaitForOSC4MStartUp();\r
-       \r
+\r
        if(OSC4MStartUpStatus01 == SUCCESS)\r
        {\r
                /* Set HCLK to 60MHz */\r
                MRCC_HCLKConfig(MRCC_CKSYS_Div1);\r
-               \r
+\r
                /* Set CKTIM to 60MHz */\r
                MRCC_CKTIMConfig(MRCC_HCLK_Div1);\r
-               \r
+\r
                /* Set PCLK to 30MHz */\r
                MRCC_PCLKConfig(MRCC_CKTIM_Div2);\r
-               \r
+\r
                /* Enable Flash Burst mode */\r
                CFG_FLASHBurstConfig(CFG_FLASHBurst_Enable);\r
-               \r
+\r
                /* Set CK_SYS to 60 MHz */\r
                MRCC_CKSYSConfig(MRCC_CKSYS_OSC4MPLL, MRCC_PLL_Mul_15);\r
        }\r
-       \r
+\r
        /* GPIO pins optimized for 3V3 operation */\r
        MRCC_IOVoltageRangeConfig(MRCC_IOVoltageRange_3V3);\r
-       \r
+\r
        /* GPIO clock source enable */\r
        MRCC_PeripheralClockConfig(MRCC_Peripheral_GPIO, ENABLE);\r
-       \r
+\r
        /* EXTIT clock source enable */\r
        MRCC_PeripheralClockConfig(MRCC_Peripheral_EXTIT, ENABLE);\r
        /* TB clock source enable */\r
        MRCC_PeripheralClockConfig(MRCC_Peripheral_TB, ENABLE);\r
-       \r
+\r
        /* Initialize the demonstration menu */\r
        LCD_Init();\r
-       \r
+\r
        LCD_DisplayString(Line1, "www.FreeRTOS.org", BlackText);\r
        LCD_DisplayString(Line2, "  STR750 Demo  ", BlackText);\r
-       \r
+\r
        EIC_IRQCmd(ENABLE);\r
 }\r
 /*-----------------------------------------------------------*/\r