]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_STM32F103_Keil/main.c
Update version numbers in preparation for V8.2.0 release candidate 1.
[freertos] / FreeRTOS / Demo / CORTEX_STM32F103_Keil / main.c
index 598d4cc35157671fc1d4fbfa2b01af547eda35f5..1167d01d9d1e4018e41373ac22193bd88a8315b5 100644 (file)
@@ -1,36 +1,23 @@
 /*\r
-    FreeRTOS V7.5.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+    FreeRTOS V8.2.0rc1 - 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 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
+    >>!   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
+    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
      *    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?".  Have you defined configASSERT()?  *\r
      *                                                                       *\r
      *    http://www.FreeRTOS.org/FAQHelp.html                               *\r
      *                                                                       *\r
     ***************************************************************************\r
 \r
+    ***************************************************************************\r
+     *                                                                       *\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
+     *    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
+    ***************************************************************************\r
+     *                                                                       *\r
+     *   Investing in training allows your team to be as productive as       *\r
+     *   possible as early as possible, lowering your overall development    *\r
+     *   cost, and enabling you to bring a more robust product to market     *\r
+     *   earlier than would otherwise be possible.  Richard Barry is both    *\r
+     *   the architect and key author of FreeRTOS, and so also the world's   *\r
+     *   leading authority on what is the world's most popular real time     *\r
+     *   kernel for deeply embedded MCU designs.  Obtaining your training    *\r
+     *   from Richard ensures your team will gain directly from his in-depth *\r
+     *   product knowledge and years of usage experience.  Contact Real Time *\r
+     *   Engineers Ltd to enquire about the FreeRTOS Masterclass, presented  *\r
+     *   by Richard Barry:  http://www.FreeRTOS.org/contact\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
+    ***************************************************************************\r
+     *                                                                       *\r
+     *    You are receiving this top quality software for free.  Please play *\r
+     *    fair and reciprocate by reporting any suspected issues and         *\r
+     *    participating in the community forum:                              *\r
+     *    http://www.FreeRTOS.org/support                                    *\r
+     *                                                                       *\r
+     *    Thank you!                                                         *\r
+     *                                                                       *\r
+    ***************************************************************************\r
+\r
     http://www.FreeRTOS.org - Documentation, books, training, latest versions,\r
     license and Real Time Engineers Ltd. contact details.\r
 \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.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 to sell under the OpenRTOS brand.  Low cost OpenRTOS\r
-    licenses offer ticketed support, indemnification and middleware.\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
@@ -146,10 +177,10 @@ time. */
 #define mainMAX_MSG_LEN                                                25\r
 \r
 /* The time between cycles of the 'check' task. */\r
-#define mainCHECK_DELAY                                                ( ( portTickType ) 5000 / portTICK_RATE_MS )\r
+#define mainCHECK_DELAY                                                ( ( TickType_t ) 5000 / portTICK_PERIOD_MS )\r
 \r
 /* The number of nano seconds between each processor clock. */\r
-#define mainNS_PER_CLOCK ( ( unsigned portLONG ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) )\r
+#define mainNS_PER_CLOCK ( ( unsigned long ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) )\r
 \r
 /* Baud rate used by the comtest tasks. */\r
 #define mainCOM_TEST_BAUD_RATE         ( 115200 )\r
@@ -204,7 +235,7 @@ extern void vSetupTimerTest( void );
 /*-----------------------------------------------------------*/\r
 \r
 /* The queue used to send messages to the LCD task. */\r
-xQueueHandle xLCDQueue;\r
+QueueHandle_t xLCDQueue;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
@@ -219,7 +250,7 @@ int main( void )
        /* Create the queue used by the LCD task.  Messages for display on the LCD\r
        are received via this queue. */\r
        xLCDQueue = xQueueCreate( mainLCD_QUEUE_SIZE, sizeof( xLCDMessage ) );\r
-       \r
+\r
        /* Start the standard demo tasks. */\r
        vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
     vCreateBlockTimeTasks();\r
@@ -230,20 +261,20 @@ int main( void )
        vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
 \r
        /* Start the tasks defined within this file/specific to this demo. */\r
-    xTaskCreate( vCheckTask, ( signed portCHAR * ) "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );  \r
-       xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+    xTaskCreate( vCheckTask, "Check", mainCHECK_TASK_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
+       xTaskCreate( vLCDTask, "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
 \r
        /* The suicide tasks must be created last as they need to know how many\r
        tasks were running prior to their creation in order to ascertain whether\r
        or not the correct/expected number of tasks are running at any given time. */\r
     vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
-       \r
+\r
        /* Configure the timers used by the fast interrupt timer test. */\r
        vSetupTimerTest();\r
-       \r
+\r
        /* Start the scheduler. */\r
        vTaskStartScheduler();\r
-       \r
+\r
        /* Will only get here if there was not enough heap space to create the\r
        idle task. */\r
        return 0;\r
@@ -256,7 +287,7 @@ xLCDMessage xMessage;
 \r
        /* Initialise the LCD and display a startup message. */\r
        prvConfigureLCD();\r
-       LCD_DrawMonoPict( ( unsigned portLONG * ) pcBitmap );\r
+       LCD_DrawMonoPict( ( unsigned long * ) pcBitmap );\r
 \r
        for( ;; )\r
        {\r
@@ -264,21 +295,21 @@ xLCDMessage xMessage;
                while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS );\r
 \r
                /* Display the message.  Print each message to a different position. */\r
-               printf( ( portCHAR const * ) xMessage.pcMessage );\r
+               printf( ( char const * ) xMessage.pcMessage );\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
 static void vCheckTask( void *pvParameters )\r
 {\r
-portTickType xLastExecutionTime;\r
+TickType_t xLastExecutionTime;\r
 xLCDMessage xMessage;\r
-static signed portCHAR cPassMessage[ mainMAX_MSG_LEN ];\r
-extern unsigned portSHORT usMaxJitter;\r
+static signed char cPassMessage[ mainMAX_MSG_LEN ];\r
+extern unsigned short usMaxJitter;\r
 \r
        xLastExecutionTime = xTaskGetTickCount();\r
        xMessage.pcMessage = cPassMessage;\r
-       \r
+\r
     for( ;; )\r
        {\r
                /* Perform this check every mainCHECK_DELAY milliseconds. */\r
@@ -313,10 +344,10 @@ extern unsigned portSHORT usMaxJitter;
                else if( xAreComTestTasksStillRunning() != pdTRUE )\r
                {\r
                        xMessage.pcMessage = "ERROR IN COM TEST\n";\r
-               }                               \r
+               }\r
                else\r
                {\r
-                       sprintf( ( portCHAR * ) cPassMessage, "PASS [%uns]\n", ( ( unsigned portLONG ) usMaxJitter ) * mainNS_PER_CLOCK );\r
+                       sprintf( ( char * ) cPassMessage, "PASS [%uns]\n", ( ( unsigned long ) usMaxJitter ) * mainNS_PER_CLOCK );\r
                }\r
 \r
                /* Send the message to the LCD gatekeeper for display. */\r
@@ -339,7 +370,7 @@ static void prvSetupHardware( void )
        }\r
 \r
        /* 2 wait states required on the flash. */\r
-       *( ( unsigned portLONG * ) 0x40022000 ) = 0x02;\r
+       *( ( unsigned long * ) 0x40022000 ) = 0x02;\r
 \r
        /* HCLK = SYSCLK */\r
        RCC_HCLKConfig( RCC_SYSCLK_Div1 );\r
@@ -381,10 +412,10 @@ static void prvSetupHardware( void )
        NVIC_SetVectorTable( NVIC_VectTab_FLASH, 0x0 );\r
 \r
        NVIC_PriorityGroupConfig( NVIC_PriorityGroup_4 );\r
-       \r
+\r
        /* Configure HCLK clock as SysTick clock source. */\r
        SysTick_CLKSourceConfig( SysTick_CLKSource_HCLK );\r
-       \r
+\r
        vParTestInitialise();\r
 }\r
 /*-----------------------------------------------------------*/\r
@@ -417,8 +448,8 @@ GPIO_InitTypeDef GPIO_InitStructure;
 \r
 int fputc( int ch, FILE *f )\r
 {\r
-static unsigned portSHORT usColumn = 0, usRefColumn = mainCOLUMN_START;\r
-static unsigned portCHAR ucLine = 0;\r
+static unsigned short usColumn = 0, usRefColumn = mainCOLUMN_START;\r
+static unsigned char ucLine = 0;\r
 \r
        if( ( usColumn == 0 ) && ( ucLine == 0 ) )\r
        {\r
@@ -429,10 +460,10 @@ static unsigned portCHAR ucLine = 0;
        {\r
                /* Display one character on LCD */\r
                LCD_DisplayChar( ucLine, usRefColumn, (u8) ch );\r
-               \r
+\r
                /* Decrement the column position by 16 */\r
                usRefColumn -= mainCOLUMN_INCREMENT;\r
-               \r
+\r
                /* Increment the character counter */\r
                usColumn++;\r
                if( usColumn == mainMAX_COLUMN )\r
@@ -447,7 +478,7 @@ static unsigned portCHAR ucLine = 0;
                /* Move back to the first column of the next line. */\r
                ucLine += mainROW_INCREMENT;\r
                usRefColumn = mainCOLUMN_START;\r
-               usColumn = 0;   \r
+               usColumn = 0;\r
        }\r
 \r
        /* Wrap back to the top of the display. */\r
@@ -455,14 +486,14 @@ static unsigned portCHAR ucLine = 0;
        {\r
                ucLine = 0;\r
        }\r
-       \r
+\r
        return ch;\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
 #ifdef  DEBUG\r
 /* Keep the linker happy. */\r
-void assert_failed( unsigned portCHAR* pcFile, unsigned portLONG ulLine )\r
+void assert_failed( unsigned char* pcFile, unsigned long ulLine )\r
 {\r
        for( ;; )\r
        {\r