]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/ARM7_STR75x_GCC/main.c
Update version numbers in preparation for new release.
[freertos] / FreeRTOS / Demo / ARM7_STR75x_GCC / main.c
index 1a529f0bcbe3a138971da8dd35c37a73e7f2fe54..7851274796c3428893aa1225c72b60e1a31ddcbb 100644 (file)
@@ -1,59 +1,64 @@
 /*\r
-    FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.2 - 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
-    ***************************************************************************\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
+    >>!   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
@@ -167,7 +172,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
@@ -179,8 +184,8 @@ int 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
@@ -189,13 +194,13 @@ int 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
        return 0;\r
@@ -204,8 +209,8 @@ int 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 *ucErrorMessage = ( unsigned char * )"              FAIL";\r
 unsigned char *ucSuccessMessage = ( unsigned char * )"              PASS";\r
 unsigned portBASE_TYPE uxColumn = mainMAX_WRITE_COLUMN;\r
@@ -221,7 +226,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
@@ -236,17 +241,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
@@ -255,19 +260,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 = ucSuccessMessage + uxColumn;\r
                }\r
                else\r
                {\r
-                       xMessage.pucString = ucErrorMessage + uxColumn;                 \r
-               }               \r
+                       xMessage.pucString = ucErrorMessage + 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 +293,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 +304,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, ( unsigned char * ) "www.FreeRTOS.org", BlackText);\r
        LCD_DisplayString(Line2, ( unsigned char * ) "  STR750 Demo  ", BlackText);\r
-       \r
+\r
        EIC_IRQCmd(ENABLE);\r
 }\r
 /*-----------------------------------------------------------*/\r