X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FMB96350_Softune_Dice_Kit%2FSegmentToggleTasks.c;h=641835c35c887c03fb7104fe2806b82c068a3d8a;hb=3d511cabadf346c67f0f56e15e999c02ca0393ed;hp=ce32ba6c0b7dc71e53305222bfe7b8d8ad9900b8;hpb=abc9255183aa4ad1b011116333f26570ccc7aa4b;p=freertos diff --git a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c index ce32ba6c0..641835c35 100644 --- a/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c +++ b/FreeRTOS/Demo/MB96350_Softune_Dice_Kit/SegmentToggleTasks.c @@ -1,5 +1,6 @@ /* - FreeRTOS V7.5.2 - Copyright (C) 2013 Real Time Engineers Ltd. + FreeRTOS V8.1.2 - Copyright (C) 2014 Real Time Engineers Ltd. + All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. @@ -23,10 +24,10 @@ the terms of the GNU General Public License (version 2) as published by the Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. - >>! NOTE: The modification to the GPL is included to allow you to distribute - >>! a combined work that includes FreeRTOS without being obliged to provide - >>! the source code for proprietary components outside of the FreeRTOS - >>! kernel. + >>! NOTE: The modification to the GPL is included to allow you to !<< + >>! distribute a combined work that includes FreeRTOS without being !<< + >>! obliged to provide the source code for proprietary components !<< + >>! outside of the FreeRTOS kernel. !<< FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS @@ -84,7 +85,7 @@ #define ledNUM_OF_LED_TASKS ( 7 ) /* Each task toggles at a frequency that is a multiple of 333ms. */ -#define ledFLASH_RATE_BASE ( ( portTickType ) 333 ) +#define ledFLASH_RATE_BASE ( ( TickType_t ) 333 ) /* One co-routine per segment of the right hand display. */ #define ledNUM_OF_LED_CO_ROUTINES 7 @@ -98,18 +99,18 @@ static void vLEDFlashTask( void *pvParameters ); /* The co-routine that is created 7 times. */ -static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned short usIndex ); +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned short usIndex ); /* This task is created once, but itself creates 7 co-routines. */ static void vLEDCoRoutineControlTask( void *pvParameters ); /* Handles to each of the 7 tasks. Used so the tasks can be suspended and resumed. */ -static xTaskHandle xFlashTaskHandles[ ledNUM_OF_LED_TASKS ] = { 0 }; +static TaskHandle_t xFlashTaskHandles[ ledNUM_OF_LED_TASKS ] = { 0 }; /* Handle to the task in which the co-routines run. Used so the co-routines can be suspended and resumed. */ -static xTaskHandle xCoroutineTask; +static TaskHandle_t xCoroutineTask; /*-----------------------------------------------------------*/ @@ -125,12 +126,12 @@ signed short sLEDTask; for( sLEDTask = 0; sLEDTask < ledNUM_OF_LED_TASKS; ++sLEDTask ) { /* Spawn the task. */ - xTaskCreate( vLEDFlashTask, ( signed char * ) "LEDt", configMINIMAL_STACK_SIZE, ( void * ) sLEDTask, ( tskIDLE_PRIORITY + 1 ), &( xFlashTaskHandles[ sLEDTask ] ) ); + xTaskCreate( vLEDFlashTask, "LEDt", configMINIMAL_STACK_SIZE, ( void * ) sLEDTask, ( tskIDLE_PRIORITY + 1 ), &( xFlashTaskHandles[ sLEDTask ] ) ); } /* Create the task in which the co-routines run. The co-routines themselves are created within the task. */ - xTaskCreate( vLEDCoRoutineControlTask, ( signed char * ) "LEDc", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCoroutineTask ); + xTaskCreate( vLEDCoRoutineControlTask, "LEDc", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, &xCoroutineTask ); } /*-----------------------------------------------------------*/ @@ -175,21 +176,21 @@ short sLEDTask; static void vLEDFlashTask( void * pvParameters ) { -portTickType xFlashRate, xLastFlashTime; +TickType_t xFlashRate, xLastFlashTime; unsigned short usLED; /* The LED to flash is passed in as the task parameter. */ usLED = ( unsigned short ) pvParameters; /* Calculate the rate at which this task is going to toggle its LED. */ - xFlashRate = ledFLASH_RATE_BASE + ( ledFLASH_RATE_BASE * ( portTickType ) usLED ); - xFlashRate /= portTICK_RATE_MS; + xFlashRate = ledFLASH_RATE_BASE + ( ledFLASH_RATE_BASE * ( TickType_t ) usLED ); + xFlashRate /= portTICK_PERIOD_MS; /* We will turn the LED on and off again in the delay period, so each delay is only half the total period. */ - xFlashRate /= ( portTickType ) 2; + xFlashRate /= ( TickType_t ) 2; - /* We need to initialise xLastFlashTime prior to the first call to + /* We need to initialise xLastFlashTime prior to the first call to vTaskDelayUntil(). */ xLastFlashTime = xTaskGetTickCount(); @@ -227,17 +228,17 @@ unsigned short usCoroutine; } /*-----------------------------------------------------------*/ -static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned short usIndex ) +static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned short usIndex ) { /* The usIndex parameter of the co-routine function is used as an index into the xFlashRates array to obtain the delay period to use. */ -static const portTickType xFlashRates[ ledNUM_OF_LED_CO_ROUTINES ] = { 150 / portTICK_RATE_MS, - 300 / portTICK_RATE_MS, - 450 / portTICK_RATE_MS, - 600 / portTICK_RATE_MS, - 750 / portTICK_RATE_MS, - 900 / portTICK_RATE_MS, - 1050 / portTICK_RATE_MS }; +static const TickType_t xFlashRates[ ledNUM_OF_LED_CO_ROUTINES ] = { 150 / portTICK_PERIOD_MS, + 300 / portTICK_PERIOD_MS, + 450 / portTICK_PERIOD_MS, + 600 / portTICK_PERIOD_MS, + 750 / portTICK_PERIOD_MS, + 900 / portTICK_PERIOD_MS, + 1050 / portTICK_PERIOD_MS }; /* Co-routines MUST start with a call to crSTART. */ crSTART( xHandle );