mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 09:38:32 -04:00
Update the demo directory to use the version 8 type naming conventions.
This commit is contained in:
parent
c6d8892b0d
commit
5a2a8fc319
639 changed files with 3127 additions and 3470 deletions
|
@ -75,10 +75,10 @@
|
|||
#include "semphr.h"
|
||||
|
||||
/* Delays used within the dice functionality. All delays are defined in milliseconds. */
|
||||
#define diceDELAY_BETWEEN_RANDOM_NUMBERS_ms ( 20 / portTICK_RATE_MS )
|
||||
#define diceSHAKE_TIME ( ( 2000 / portTICK_RATE_MS ) / diceDELAY_BETWEEN_RANDOM_NUMBERS_ms )
|
||||
#define diceSHORT_PAUSE_BEFORE_SHAKE ( 250 / portTICK_RATE_MS )
|
||||
#define diceDELAY_WHILE_DISPLAYING_RESULT ( 5000 / portTICK_RATE_MS )
|
||||
#define diceDELAY_BETWEEN_RANDOM_NUMBERS_ms ( 20 / portTICK_PERIOD_MS )
|
||||
#define diceSHAKE_TIME ( ( 2000 / portTICK_PERIOD_MS ) / diceDELAY_BETWEEN_RANDOM_NUMBERS_ms )
|
||||
#define diceSHORT_PAUSE_BEFORE_SHAKE ( 250 / portTICK_PERIOD_MS )
|
||||
#define diceDELAY_WHILE_DISPLAYING_RESULT ( 5000 / portTICK_PERIOD_MS )
|
||||
|
||||
/* Macro to access the display ports. */
|
||||
#define dice7SEG_Value( x ) ( *( pucDisplayOutput[ x ] ) )
|
||||
|
@ -98,7 +98,7 @@ static const char cDisplaySegments[ 2 ][ 11 ] =
|
|||
/* The semaphores used to communicate button push events between the button
|
||||
input interrupt handlers and the dice tasks. Two dice tasks are created so two
|
||||
semaphores are required. */
|
||||
static xSemaphoreHandle xSemaphores[ 2 ] = { 0 };
|
||||
static SemaphoreHandle_t xSemaphores[ 2 ] = { 0 };
|
||||
|
||||
/* Defines the ports used to write to the display. This variable is defined in
|
||||
partest.c, which contains the LED set/clear/toggle functions. */
|
||||
|
|
|
@ -101,7 +101,7 @@ the ComTest tasks will be included in place of the trace task. */
|
|||
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 180 ) /* This can be greatly reduced when using the small or medium memory model. */
|
||||
#define configCPU_CLOCK_HZ ( ( unsigned long ) 56000000 ) /* Clock setup from start.asm in the demo application. */
|
||||
#define configCLKP1_CLOCK_HZ ( ( unsigned long ) 56000000 ) /* Clock setup from start.asm in the demo application. */
|
||||
#define configTICK_RATE_HZ ( (portTickType) 1000 )
|
||||
#define configTICK_RATE_HZ ( (TickType_t) 1000 )
|
||||
#define configMAX_PRIORITIES ( 6 )
|
||||
#define configTOTAL_HEAP_SIZE ( (size_t) (5000) )
|
||||
#define configMAX_TASK_NAME_LEN ( 20 )
|
||||
|
|
|
@ -85,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
|
||||
|
@ -106,11 +106,11 @@ 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;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
@ -176,19 +176,19 @@ 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
|
||||
vTaskDelayUntil(). */
|
||||
|
@ -232,13 +232,13 @@ static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned short us
|
|||
{
|
||||
/* 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 );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue