]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/ARM7_STR75x_IAR/main.c
***IMMINENT RELEASE NOTICE***
[freertos] / FreeRTOS / Demo / ARM7_STR75x_IAR / main.c
index f93e7820ac7e9f2002838579cf265497ff9282a7..4e057ad3d3ba40d8b56d02383f18cd84e3277086 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - Copyright (C) 2013 Real Time Engineers Ltd. \r
+    FreeRTOS V8.1.0 - 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
     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
+    >>!   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
@@ -168,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
@@ -180,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
@@ -190,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
@@ -204,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
@@ -221,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
@@ -236,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
@@ -255,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
@@ -287,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
@@ -298,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