]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/PIC32MX_MPLAB/main_blinky.c
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Demo / PIC32MX_MPLAB / main_blinky.c
index 9238059eeb23b65da9e3d5a957cc31d232bd2f33..7761fdb6b15ae0e4f03cfac521607bd2a7f4847a 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
-    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
+    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
+    1 tab == 4 spaces!\r
 */\r
 \r
 /******************************************************************************\r
@@ -76,7 +75,7 @@
  * required to configure the hardware, are defined in main.c.\r
  ******************************************************************************\r
  *\r
- * main_blinky() creates one queue, two tasks, and one software timer.  It then \r
+ * main_blinky() creates one queue, two tasks, and one software timer.  It then\r
  * starts the scheduler.\r
  *\r
  * The Blinky Software Timer:\r
 #define        mainQUEUE_SEND_TASK_PRIORITY            ( tskIDLE_PRIORITY + 1 )\r
 \r
 /* The rate at which data is sent to the queue.  The 200ms value is converted\r
-to ticks using the portTICK_RATE_MS constant. */\r
-#define mainQUEUE_SEND_FREQUENCY_MS                    ( 200 / portTICK_RATE_MS )\r
+to ticks using the portTICK_PERIOD_MS constant. */\r
+#define mainQUEUE_SEND_FREQUENCY_MS                    ( 200 / portTICK_PERIOD_MS )\r
 \r
 /* The number of items the queue can hold.  This is 1 as the receive task\r
 will remove items as they are added, meaning the send task should always find\r
@@ -136,8 +135,8 @@ functionality. */
 #define mainQUEUE_RECEIVE_PARAMETER                    ( 0x22UL )\r
 \r
 /* The period of the blinky software timer.  The period is specified in ms and\r
-converted to ticks using the portTICK_RATE_MS constant. */\r
-#define mainBLINKY_TIMER_PERIOD                                ( 50 / portTICK_RATE_MS )\r
+converted to ticks using the portTICK_PERIOD_MS constant. */\r
+#define mainBLINKY_TIMER_PERIOD                                ( 50 / portTICK_PERIOD_MS )\r
 \r
 /* The LED used by the communicating tasks and the blinky timer respectively. */\r
 #define mainTASKS_LED                                          ( 0 )\r
@@ -158,8 +157,8 @@ static void prvQueueSendTask( void *pvParameters );
  * The callback function for the blinky software timer, as described at the top\r
  * of this file.\r
  */\r
-static void prvBlinkyTimerCallback( xTimerHandle xTimer );\r
\r
+static void prvBlinkyTimerCallback( TimerHandle_t xTimer );\r
+\r
 /*\r
  * Called by main() to create the simply blinky style application if\r
  * mainCREATE_SIMPLE_BLINKY_DEMO_ONLY is set to 1.\r
@@ -169,13 +168,13 @@ void main_blinky( void );
 /*-----------------------------------------------------------*/\r
 \r
 /* The queue used by both tasks. */\r
-static xQueueHandle xQueue = NULL;\r
+static QueueHandle_t xQueue = NULL;\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
 void main_blinky( void )\r
 {\r
-xTimerHandle xTimer;\r
+TimerHandle_t xTimer;\r
 \r
        /* Create the queue. */\r
        xQueue = xQueueCreate( mainQUEUE_LENGTH, sizeof( unsigned long ) );\r
@@ -185,28 +184,28 @@ xTimerHandle xTimer;
                /* Create the two tasks as described in the comments at the top of this\r
                file. */\r
                xTaskCreate( prvQueueReceiveTask,                                       /* The function that implements the task. */\r
-                                       ( signed char * ) "Rx",                                 /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
+                                       "Rx",                                                                   /* The text name assigned to the task - for debug only as it is not used by the kernel. */\r
                                        configMINIMAL_STACK_SIZE,                               /* The size of the stack to allocate to the task. */\r
                                        ( void * ) mainQUEUE_RECEIVE_PARAMETER, /* The parameter passed to the task - just to check the functionality. */\r
                                        mainQUEUE_RECEIVE_TASK_PRIORITY,                /* The priority assigned to the task. */\r
                                        NULL );                                                                 /* The task handle is not required, so NULL is passed. */\r
 \r
-               xTaskCreate( prvQueueSendTask, ( signed char * ) "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
+               xTaskCreate( prvQueueSendTask, "TX", configMINIMAL_STACK_SIZE, ( void * ) mainQUEUE_SEND_PARAMETER, mainQUEUE_SEND_TASK_PRIORITY, NULL );\r
 \r
                /* Create the blinky software timer as described at the top of this\r
                file. */\r
-               xTimer = xTimerCreate(  ( const signed char * ) "Blinky",       /* A text name, purely to help debugging. */\r
-                                                               ( mainBLINKY_TIMER_PERIOD ),            /* The timer period. */\r
-                                                               pdTRUE,                                                         /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
-                                                               ( void * ) 0,                                           /* The ID is not used, so can be set to anything. */\r
-                                                               prvBlinkyTimerCallback                          /* The callback function that inspects the status of all the other tasks. */\r
-                                                       );      \r
-               \r
+               xTimer = xTimerCreate(  "Blinky",                                       /* A text name, purely to help debugging. */\r
+                                                               ( mainBLINKY_TIMER_PERIOD ),/* The timer period. */\r
+                                                               pdTRUE,                                         /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
+                                                               ( void * ) 0,                           /* The ID is not used, so can be set to anything. */\r
+                                                               prvBlinkyTimerCallback          /* The callback function that inspects the status of all the other tasks. */\r
+                                                       );\r
+\r
                if( xTimer != NULL )\r
                {\r
                        xTimerStart( xTimer, mainDONT_BLOCK );\r
                }\r
-                               \r
+\r
                /* Start the tasks and timer running. */\r
                vTaskStartScheduler();\r
        }\r
@@ -222,7 +221,7 @@ xTimerHandle xTimer;
 \r
 static void prvQueueSendTask( void *pvParameters )\r
 {\r
-portTickType xNextWakeTime;\r
+TickType_t xNextWakeTime;\r
 const unsigned long ulValueToSend = 100UL;\r
 \r
        /* Check the task parameter is as expected. */\r
@@ -273,7 +272,7 @@ unsigned long ulReceivedValue;
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvBlinkyTimerCallback( xTimerHandle xTimer )\r
+static void prvBlinkyTimerCallback( TimerHandle_t xTimer )\r
 {\r
        /* This function is called when the blinky software time expires.  All the\r
        function does is toggle the LED.  LED mainTIMER_LED should therefore toggle\r