]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/flash_timer.c
Update version number to 8.1.2 after moving the defaulting of configUSE_PORT_OPTIMISE...
[freertos] / FreeRTOS / Demo / Common / Minimal / flash_timer.c
index a5985ff9832eb293d298caacbe1aa71495c7e5bc..2bd170113930ab2ccbe84ff01a5ad6fe0f9a24a9 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.6.0 - Copyright (C) 2013 Real Time Engineers Ltd. \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
     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
@@ -67,7 +67,7 @@
  * Repeatedly toggles one or more LEDs using software timers - one timer per\r
  * LED.\r
  */\r
\r
+\r
 /* Scheduler include files. */\r
 #include "FreeRTOS.h"\r
 #include "timers.h"\r
 #include "flash_timer.h"\r
 \r
 /* The toggle rates are all a multple of ledFLASH_RATE_BASE. */\r
-#define ledFLASH_RATE_BASE     ( ( ( portTickType ) 333 ) / portTICK_RATE_MS )\r
+#define ledFLASH_RATE_BASE     ( ( ( TickType_t ) 333 ) / portTICK_PERIOD_MS )\r
 \r
 /* A block time of zero simple means "don't block". */\r
-#define ledDONT_BLOCK          ( ( portTickType ) 0 )\r
+#define ledDONT_BLOCK          ( ( TickType_t ) 0 )\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
  * this function, and the timer ID is used within the function to determine\r
  * which timer has actually expired.\r
  */\r
-static void prvLEDTimerCallback( xTimerHandle xTimer );\r
+static void prvLEDTimerCallback( TimerHandle_t xTimer );\r
 \r
 /*-----------------------------------------------------------*/\r
 \r
-void vStartLEDFlashTimers( unsigned portBASE_TYPE uxNumberOfLEDs )\r
+void vStartLEDFlashTimers( UBaseType_t uxNumberOfLEDs )\r
 {\r
-unsigned portBASE_TYPE uxLEDTimer;\r
-xTimerHandle xTimer;\r
+UBaseType_t uxLEDTimer;\r
+TimerHandle_t xTimer;\r
 \r
        /* Create and start the requested number of timers. */\r
        for( uxLEDTimer = 0; uxLEDTimer < uxNumberOfLEDs; ++uxLEDTimer )\r
        {\r
                /* Create the timer. */\r
-               xTimer = xTimerCreate(  ( const signed char * const ) "Flasher",/* A text name, purely to help debugging. */\r
-                                                               ledFLASH_RATE_BASE * ( uxLEDTimer + 1 ),        /* The timer period, which is a multiple of ledFLASH_RATE_BASE. */\r
+               xTimer = xTimerCreate(  "Flasher",                                                              /* A text name, purely to help debugging. */\r
+                                                               ledFLASH_RATE_BASE * ( uxLEDTimer + 1 ),/* The timer period, which is a multiple of ledFLASH_RATE_BASE. */\r
                                                                pdTRUE,                                                                 /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
                                                                ( void * ) uxLEDTimer,                                  /* The ID is used to identify the timer within the timer callback function, as each timer uses the same callback. */\r
                                                                prvLEDTimerCallback                                             /* Each timer uses the same callback. */\r
                                                          );\r
-                               \r
+\r
                /* If the timer was created successfully, attempt to start it.  If the\r
                scheduler has not yet been started then the timer command queue must\r
                be long enough to hold each command sent to it until such time that the\r
@@ -117,19 +117,19 @@ xTimerHandle xTimer;
                if( xTimer != NULL )\r
                {\r
                        xTimerStart( xTimer, ledDONT_BLOCK );\r
-               }                                                         \r
+               }\r
        }\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static void prvLEDTimerCallback( xTimerHandle xTimer )\r
+static void prvLEDTimerCallback( TimerHandle_t xTimer )\r
 {\r
-portBASE_TYPE xTimerID;\r
+BaseType_t xTimerID;\r
 \r
        /* The timer ID is used to identify the timer that has actually expired as\r
        each timer uses the same callback.  The ID is then also used as the number\r
        of the LED that is to be toggled. */\r
-       xTimerID = ( portBASE_TYPE ) pvTimerGetTimerID( xTimer );\r
+       xTimerID = ( BaseType_t ) pvTimerGetTimerID( xTimer );\r
        vParTestToggleLED( xTimerID );\r
 }\r
 \r