mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-12-06 21:25:00 -05: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
|
|
@ -99,7 +99,7 @@ Changes from V1.00:
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
|
||||
Changes from V4.0.2
|
||||
|
||||
|
|
@ -125,8 +125,8 @@ Changes from V4.0.2
|
|||
/* Structure used to pass parameters to the blocking queue tasks. */
|
||||
typedef struct BLOCKING_QUEUE_PARAMETERS
|
||||
{
|
||||
xQueueHandle xQueue; /*< The queue to be used by the task. */
|
||||
portTickType xBlockTime; /*< The block time to use on queue reads/writes. */
|
||||
QueueHandle_t xQueue; /*< The queue to be used by the task. */
|
||||
TickType_t xBlockTime; /*< The block time to use on queue reads/writes. */
|
||||
volatile short *psCheckVariable; /*< Incremented on each successful cycle to check the task is still running. */
|
||||
} xBlockingQueueParameters;
|
||||
|
||||
|
|
@ -154,8 +154,8 @@ xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;
|
|||
xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;
|
||||
xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;
|
||||
const unsigned portBASE_TYPE uxQueueSize1 = 1, uxQueueSize5 = 5;
|
||||
const portTickType xBlockTime = ( portTickType ) 1000 / portTICK_RATE_MS;
|
||||
const portTickType xDontBlock = ( portTickType ) 0;
|
||||
const TickType_t xBlockTime = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
const TickType_t xDontBlock = ( TickType_t ) 0;
|
||||
|
||||
/* Create the first two tasks as described at the top of the file. */
|
||||
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -122,7 +122,7 @@ static volatile short sPollingConsumerCount = 0, sPollingProducerCount = 0;
|
|||
|
||||
void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
static xQueueHandle xPolledQueue;
|
||||
static QueueHandle_t xPolledQueue;
|
||||
const unsigned portBASE_TYPE uxQueueSize = 10;
|
||||
|
||||
/* Create the queue used by the producer and consumer. */
|
||||
|
|
@ -137,8 +137,8 @@ const unsigned portBASE_TYPE uxQueueSize = 10;
|
|||
static void vPolledQueueProducer( void *pvParameters )
|
||||
{
|
||||
unsigned short usValue = 0, usLoop;
|
||||
xQueueHandle *pxQueue;
|
||||
const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;
|
||||
QueueHandle_t *pxQueue;
|
||||
const TickType_t xDelay = ( TickType_t ) 200 / portTICK_PERIOD_MS;
|
||||
const unsigned short usNumToProduce = 3;
|
||||
const char * const pcTaskStartMsg = "Polled queue producer started.\r\n";
|
||||
const char * const pcTaskErrorMsg = "Could not post on polled queue.\r\n";
|
||||
|
|
@ -148,14 +148,14 @@ short sError = pdFALSE;
|
|||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
||||
/* The queue being used is passed in as the parameter. */
|
||||
pxQueue = ( xQueueHandle * ) pvParameters;
|
||||
pxQueue = ( QueueHandle_t * ) pvParameters;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
for( usLoop = 0; usLoop < usNumToProduce; ++usLoop )
|
||||
{
|
||||
/* Send an incrementing number on the queue without blocking. */
|
||||
if( xQueueSendToBack( *pxQueue, ( void * ) &usValue, ( portTickType ) 0 ) != pdPASS )
|
||||
if( xQueueSendToBack( *pxQueue, ( void * ) &usValue, ( TickType_t ) 0 ) != pdPASS )
|
||||
{
|
||||
/* We should never find the queue full - this is an error. */
|
||||
vPrintDisplayMessage( &pcTaskErrorMsg );
|
||||
|
|
@ -185,8 +185,8 @@ short sError = pdFALSE;
|
|||
static void vPolledQueueConsumer( void *pvParameters )
|
||||
{
|
||||
unsigned short usData, usExpectedValue = 0;
|
||||
xQueueHandle *pxQueue;
|
||||
const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;
|
||||
QueueHandle_t *pxQueue;
|
||||
const TickType_t xDelay = ( TickType_t ) 200 / portTICK_PERIOD_MS;
|
||||
const char * const pcTaskStartMsg = "Polled queue consumer started.\r\n";
|
||||
const char * const pcTaskErrorMsg = "Incorrect value received on polled queue.\r\n";
|
||||
short sError = pdFALSE;
|
||||
|
|
@ -195,14 +195,14 @@ short sError = pdFALSE;
|
|||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
|
||||
/* The queue being used is passed in as the parameter. */
|
||||
pxQueue = ( xQueueHandle * ) pvParameters;
|
||||
pxQueue = ( QueueHandle_t * ) pvParameters;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
/* Loop until the queue is empty. */
|
||||
while( uxQueueMessagesWaiting( *pxQueue ) )
|
||||
{
|
||||
if( xQueueReceive( *pxQueue, &usData, ( portTickType ) 0 ) == pdPASS )
|
||||
if( xQueueReceive( *pxQueue, &usData, ( TickType_t ) 0 ) == pdPASS )
|
||||
{
|
||||
if( usData != usExpectedValue )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -120,7 +120,7 @@ Changed from V1.2.5
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
+ Slight modification to task priorities.
|
||||
|
||||
*/
|
||||
|
|
@ -139,8 +139,8 @@ Changes from V2.0.0
|
|||
|
||||
/* The Tx task will transmit the sequence of characters at a pseudo random
|
||||
interval. This is the maximum and minimum block time between sends. */
|
||||
#define comTX_MAX_BLOCK_TIME ( ( portTickType ) 0x15e )
|
||||
#define comTX_MIN_BLOCK_TIME ( ( portTickType ) 0xc8 )
|
||||
#define comTX_MAX_BLOCK_TIME ( ( TickType_t ) 0x15e )
|
||||
#define comTX_MIN_BLOCK_TIME ( ( TickType_t ) 0xc8 )
|
||||
|
||||
#define comMAX_CONSECUTIVE_ERRORS ( 2 )
|
||||
|
||||
|
|
@ -169,7 +169,7 @@ check that both tasks are still executing. */
|
|||
volatile short sTxCount = 0, sRxCount = 0, sSemCount = 0;
|
||||
|
||||
/* The handle to the semaphore test task. */
|
||||
static xTaskHandle xSemTestTaskHandle = NULL;
|
||||
static TaskHandle_t xSemTestTaskHandle = NULL;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -188,7 +188,7 @@ const unsigned portBASE_TYPE uxBufferLength = 255;
|
|||
static void vComTxTask( void *pvParameters )
|
||||
{
|
||||
const char * const pcTaskStartMsg = "COM Tx task started.\r\n";
|
||||
portTickType xTimeToWait;
|
||||
TickType_t xTimeToWait;
|
||||
|
||||
/* Stop warnings. */
|
||||
( void ) pvParameters;
|
||||
|
|
@ -228,7 +228,7 @@ const char * const pcTaskStartMsg = "COM Rx task started.\r\n";
|
|||
const char * const pcTaskErrorMsg = "COM read error\r\n";
|
||||
const char * const pcTaskRestartMsg = "COM resynced\r\n";
|
||||
const char * const pcTaskTimeoutMsg = "COM Rx timed out\r\n";
|
||||
const portTickType xBlockTime = ( portTickType ) 0xffff / portTICK_RATE_MS;
|
||||
const TickType_t xBlockTime = ( TickType_t ) 0xffff / portTICK_PERIOD_MS;
|
||||
const char *pcExpectedChar;
|
||||
portBASE_TYPE xGotChar;
|
||||
char cRxedChar;
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -119,7 +119,7 @@ static const unsigned portBASE_TYPE uxMaxNumberOfExtraTasksRunning = 5;
|
|||
|
||||
/* Used to store a handle to the tasks that should be killed by a suicidal task,
|
||||
before it kills itself. */
|
||||
xTaskHandle xCreatedTask1, xCreatedTask2;
|
||||
TaskHandle_t xCreatedTask1, xCreatedTask2;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -143,15 +143,15 @@ unsigned portBASE_TYPE *puxPriority;
|
|||
static void vSuicidalTask( void *pvParameters )
|
||||
{
|
||||
portDOUBLE d1, d2;
|
||||
xTaskHandle xTaskToKill;
|
||||
const portTickType xDelay = ( portTickType ) 500 / portTICK_RATE_MS;
|
||||
TaskHandle_t xTaskToKill;
|
||||
const TickType_t xDelay = ( TickType_t ) 500 / portTICK_PERIOD_MS;
|
||||
|
||||
if( pvParameters != NULL )
|
||||
{
|
||||
/* This task is periodically created four times. Tow created tasks are
|
||||
passed a handle to the other task so it can kill it before killing itself.
|
||||
The other task is passed in null. */
|
||||
xTaskToKill = *( xTaskHandle* )pvParameters;
|
||||
xTaskToKill = *( TaskHandle_t* )pvParameters;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -169,7 +169,7 @@ const portTickType xDelay = ( portTickType ) 500 / portTICK_RATE_MS;
|
|||
if( xTaskToKill != NULL )
|
||||
{
|
||||
/* Make sure the other task has a go before we delete it. */
|
||||
vTaskDelay( ( portTickType ) 0 );
|
||||
vTaskDelay( ( TickType_t ) 0 );
|
||||
/* Kill the other task that was created by vCreateTasks(). */
|
||||
vTaskDelete( xTaskToKill );
|
||||
/* Kill ourselves. */
|
||||
|
|
@ -181,7 +181,7 @@ const portTickType xDelay = ( portTickType ) 500 / portTICK_RATE_MS;
|
|||
|
||||
static void vCreateTasks( void *pvParameters )
|
||||
{
|
||||
const portTickType xDelay = ( portTickType ) 1000 / portTICK_RATE_MS;
|
||||
const TickType_t xDelay = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
unsigned portBASE_TYPE uxPriority;
|
||||
const char * const pcTaskStartMsg = "Create task started.\r\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
+ Added a second, simple test that uses the functions
|
||||
vQueueReceiveWhenSuspendedTask() and vQueueSendWhenSuspendedTask().
|
||||
|
||||
|
|
@ -177,17 +177,17 @@ static void prvChangePriorityHelperTask( void *pvParameters );
|
|||
|
||||
/* Demo task specific constants. */
|
||||
#define priSTACK_SIZE ( ( unsigned short ) configMINIMAL_STACK_SIZE )
|
||||
#define priSLEEP_TIME ( ( portTickType ) 50 )
|
||||
#define priSLEEP_TIME ( ( TickType_t ) 50 )
|
||||
#define priLOOPS ( 5 )
|
||||
#define priMAX_COUNT ( ( unsigned long ) 0xff )
|
||||
#define priNO_BLOCK ( ( portTickType ) 0 )
|
||||
#define priNO_BLOCK ( ( TickType_t ) 0 )
|
||||
#define priSUSPENDED_QUEUE_LENGTH ( 1 )
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Handles to the two counter tasks. These could be passed in as parameters
|
||||
to the controller task to prevent them having to be file scope. */
|
||||
static xTaskHandle xContinuousIncrementHandle, xLimitedIncrementHandle, xChangePriorityWhenSuspendedHandle;
|
||||
static TaskHandle_t xContinuousIncrementHandle, xLimitedIncrementHandle, xChangePriorityWhenSuspendedHandle;
|
||||
|
||||
/* The shared counter variable. This is passed in as a parameter to the two
|
||||
counter variables for demonstration purposes. */
|
||||
|
|
@ -207,7 +207,7 @@ static portBASE_TYPE xSuspendedQueueReceiveError = pdFALSE;
|
|||
static portBASE_TYPE xPriorityRaiseWhenSuspendedError = pdFALSE;
|
||||
|
||||
/* Queue used by the second test. */
|
||||
xQueueHandle xSuspendedTestQueue;
|
||||
QueueHandle_t xSuspendedTestQueue;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -126,11 +126,11 @@ static portBASE_TYPE xExpectedTaskCounters[ evtNUM_TASKS ] = { 0, 0, 0, 0 };
|
|||
|
||||
/* Handles to the four event tasks. These are required to suspend and resume
|
||||
the tasks. */
|
||||
static xTaskHandle xCreatedTasks[ evtNUM_TASKS ];
|
||||
static TaskHandle_t xCreatedTasks[ evtNUM_TASKS ];
|
||||
|
||||
/* The single queue onto which the controlling task posts, and the four event
|
||||
tasks block. */
|
||||
static xQueueHandle xQueue;
|
||||
static QueueHandle_t xQueue;
|
||||
|
||||
/* Flag used to indicate whether or not an error has occurred at any time.
|
||||
An error is either the queue being full when not expected, or an unexpected
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
|
||||
Changes from V2.1.1
|
||||
|
||||
|
|
@ -108,7 +108,7 @@ Changes from V2.1.1
|
|||
typedef struct LED_PARAMETERS
|
||||
{
|
||||
unsigned portBASE_TYPE uxLED; /*< The output the task should use. */
|
||||
portTickType xFlashRate; /*< The rate at which the LED should flash. */
|
||||
TickType_t xFlashRate; /*< The rate at which the LED should flash. */
|
||||
} xLEDParameters;
|
||||
|
||||
/* The task that is created eight times - each time with a different xLEDParaemtes
|
||||
|
|
@ -125,7 +125,7 @@ void vStartLEDFlashTasks( unsigned portBASE_TYPE uxPriority )
|
|||
unsigned portBASE_TYPE uxLEDTask;
|
||||
xLEDParameters *pxLEDParameters;
|
||||
const unsigned portBASE_TYPE uxNumOfLEDs = 8;
|
||||
const portTickType xFlashRate = 125;
|
||||
const TickType_t xFlashRate = 125;
|
||||
|
||||
/* Create the eight tasks. */
|
||||
for( uxLEDTask = 0; uxLEDTask < uxNumOfLEDs; ++uxLEDTask )
|
||||
|
|
@ -134,11 +134,11 @@ const portTickType xFlashRate = 125;
|
|||
created task. */
|
||||
pxLEDParameters = ( xLEDParameters * ) pvPortMalloc( sizeof( xLEDParameters ) );
|
||||
pxLEDParameters->uxLED = uxLEDTask;
|
||||
pxLEDParameters->xFlashRate = ( xFlashRate + ( xFlashRate * ( portTickType ) uxLEDTask ) );
|
||||
pxLEDParameters->xFlashRate /= portTICK_RATE_MS;
|
||||
pxLEDParameters->xFlashRate = ( xFlashRate + ( xFlashRate * ( TickType_t ) uxLEDTask ) );
|
||||
pxLEDParameters->xFlashRate /= portTICK_PERIOD_MS;
|
||||
|
||||
/* Spawn the task. */
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, ( void * ) pxLEDParameters, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, ( void * ) pxLEDParameters, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
@ -155,11 +155,11 @@ xLEDParameters *pxParameters;
|
|||
for(;;)
|
||||
{
|
||||
/* Delay for half the flash period then turn the LED on. */
|
||||
vTaskDelay( pxParameters->xFlashRate / ( portTickType ) 2 );
|
||||
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
|
||||
vParTestToggleLED( pxParameters->uxLED );
|
||||
|
||||
/* Delay for half the flash period then turn the LED off. */
|
||||
vTaskDelay( pxParameters->xFlashRate / ( portTickType ) 2 );
|
||||
vTaskDelay( pxParameters->xFlashRate / ( TickType_t ) 2 );
|
||||
vParTestToggleLED( pxParameters->uxLED );
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -103,7 +103,7 @@ Changes from V2.0.0
|
|||
/* Demo program include files. */
|
||||
#include "print.h"
|
||||
|
||||
static xQueueHandle xPrintQueue;
|
||||
static QueueHandle_t xPrintQueue;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ const unsigned portBASE_TYPE uxQueueSize = 20;
|
|||
void vPrintDisplayMessage( const char * const * ppcMessageToSend )
|
||||
{
|
||||
#ifdef USE_STDIO
|
||||
xQueueSend( xPrintQueue, ( void * ) ppcMessageToSend, ( portTickType ) 0 );
|
||||
xQueueSend( xPrintQueue, ( void * ) ppcMessageToSend, ( TickType_t ) 0 );
|
||||
#else
|
||||
/* Stop warnings. */
|
||||
( void ) ppcMessageToSend;
|
||||
|
|
@ -127,7 +127,7 @@ void vPrintDisplayMessage( const char * const * ppcMessageToSend )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
const char *pcPrintGetNextMessage( portTickType xPrintRate )
|
||||
const char *pcPrintGetNextMessage( TickType_t xPrintRate )
|
||||
{
|
||||
char *pcMessage;
|
||||
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ Changes from V1.2.0:
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
|
||||
Changes from V2.1.1
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ Changes from V2.1.1
|
|||
|
||||
#define semtstNUM_TASKS ( 4 )
|
||||
|
||||
#define semtstDELAY_FACTOR ( ( portTickType ) 10 )
|
||||
#define semtstDELAY_FACTOR ( ( TickType_t ) 10 )
|
||||
|
||||
/* The task function as described at the top of the file. */
|
||||
static void prvSemaphoreTest( void *pvParameters );
|
||||
|
|
@ -136,9 +136,9 @@ static void prvSemaphoreTest( void *pvParameters );
|
|||
/* Structure used to pass parameters to each task. */
|
||||
typedef struct SEMAPHORE_PARAMETERS
|
||||
{
|
||||
xSemaphoreHandle xSemaphore;
|
||||
SemaphoreHandle_t xSemaphore;
|
||||
volatile unsigned long *pulSharedVariable;
|
||||
portTickType xBlockTime;
|
||||
TickType_t xBlockTime;
|
||||
} xSemaphoreParameters;
|
||||
|
||||
/* Variables used to check that all the tasks are still running without errors. */
|
||||
|
|
@ -154,7 +154,7 @@ const char * const pcSemaphoreTaskStart = "Guarded shared variable task started.
|
|||
void vStartSemaphoreTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
xSemaphoreParameters *pxFirstSemaphoreParameters, *pxSecondSemaphoreParameters;
|
||||
const portTickType xBlockTime = ( portTickType ) 100;
|
||||
const TickType_t xBlockTime = ( TickType_t ) 100;
|
||||
|
||||
/* Create the structure used to pass parameters to the first two tasks. */
|
||||
pxFirstSemaphoreParameters = ( xSemaphoreParameters * ) pvPortMalloc( sizeof( xSemaphoreParameters ) );
|
||||
|
|
@ -173,11 +173,11 @@ const portTickType xBlockTime = ( portTickType ) 100;
|
|||
*( pxFirstSemaphoreParameters->pulSharedVariable ) = semtstNON_BLOCKING_EXPECTED_VALUE;
|
||||
|
||||
/* The first two tasks do not block on semaphore calls. */
|
||||
pxFirstSemaphoreParameters->xBlockTime = ( portTickType ) 0;
|
||||
pxFirstSemaphoreParameters->xBlockTime = ( TickType_t ) 0;
|
||||
|
||||
/* Spawn the first two tasks. As they poll they operate at the idle priority. */
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -192,10 +192,10 @@ const portTickType xBlockTime = ( portTickType ) 100;
|
|||
{
|
||||
pxSecondSemaphoreParameters->pulSharedVariable = ( unsigned long * ) pvPortMalloc( sizeof( unsigned long ) );
|
||||
*( pxSecondSemaphoreParameters->pulSharedVariable ) = semtstBLOCKING_EXPECTED_VALUE;
|
||||
pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_RATE_MS;
|
||||
pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_PERIOD_MS;
|
||||
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -225,7 +225,7 @@ short sError = pdFALSE, sCheckVariableToUse;
|
|||
|
||||
/* If we are blocking we use a much higher count to ensure loads of context
|
||||
switches occur during the count. */
|
||||
if( pxParameters->xBlockTime > ( portTickType ) 0 )
|
||||
if( pxParameters->xBlockTime > ( TickType_t ) 0 )
|
||||
{
|
||||
ulExpectedValue = semtstBLOCKING_EXPECTED_VALUE;
|
||||
}
|
||||
|
|
@ -289,7 +289,7 @@ short sError = pdFALSE, sCheckVariableToUse;
|
|||
}
|
||||
else
|
||||
{
|
||||
if( pxParameters->xBlockTime == ( portTickType ) 0 )
|
||||
if( pxParameters->xBlockTime == ( TickType_t ) 0 )
|
||||
{
|
||||
/* We have not got the semaphore yet, so no point using the
|
||||
processor. We are not blocking when attempting to obtain the
|
||||
|
|
|
|||
|
|
@ -106,8 +106,8 @@
|
|||
/* Structure used to pass parameters to the blocking queue tasks. */
|
||||
typedef struct BLOCKING_QUEUE_PARAMETERS
|
||||
{
|
||||
xQueueHandle xQueue; /*< The queue to be used by the task. */
|
||||
portTickType xBlockTime; /*< The block time to use on queue reads/writes. */
|
||||
QueueHandle_t xQueue; /*< The queue to be used by the task. */
|
||||
TickType_t xBlockTime; /*< The block time to use on queue reads/writes. */
|
||||
volatile short *psCheckVariable; /*< Incremented on each successful cycle to check the task is still running. */
|
||||
} xBlockingQueueParameters;
|
||||
|
||||
|
|
@ -135,8 +135,8 @@ xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;
|
|||
xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;
|
||||
xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;
|
||||
const unsigned portBASE_TYPE uxQueueSize1 = 1, uxQueueSize5 = 5;
|
||||
const portTickType xBlockTime = ( portTickType ) 1000 / portTICK_RATE_MS;
|
||||
const portTickType xDontBlock = ( portTickType ) 0;
|
||||
const TickType_t xBlockTime = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
const TickType_t xDontBlock = ( TickType_t ) 0;
|
||||
|
||||
/* Create the first two tasks as described at the top of the file. */
|
||||
|
||||
|
|
|
|||
|
|
@ -85,19 +85,19 @@
|
|||
|
||||
/* Task behaviour. */
|
||||
#define bktQUEUE_LENGTH ( 5 )
|
||||
#define bktSHORT_WAIT ( ( ( portTickType ) 20 ) / portTICK_RATE_MS )
|
||||
#define bktSHORT_WAIT ( ( ( TickType_t ) 20 ) / portTICK_PERIOD_MS )
|
||||
#define bktPRIMARY_BLOCK_TIME ( 10 )
|
||||
#define bktALLOWABLE_MARGIN ( 12 )
|
||||
#define bktTIME_TO_BLOCK ( 175 )
|
||||
#define bktDONT_BLOCK ( ( portTickType ) 0 )
|
||||
#define bktDONT_BLOCK ( ( TickType_t ) 0 )
|
||||
#define bktRUN_INDICATOR ( ( unsigned portBASE_TYPE ) 0x55 )
|
||||
|
||||
/* The queue on which the tasks block. */
|
||||
static xQueueHandle xTestQueue;
|
||||
static QueueHandle_t xTestQueue;
|
||||
|
||||
/* Handle to the secondary task is required by the primary task for calls
|
||||
to vTaskSuspend/Resume(). */
|
||||
static xTaskHandle xSecondary;
|
||||
static TaskHandle_t xSecondary;
|
||||
|
||||
/* Used to ensure that tasks are still executing without error. */
|
||||
static portBASE_TYPE xPrimaryCycles = 0, xSecondaryCycles = 0;
|
||||
|
|
@ -136,8 +136,8 @@ void vCreateAltBlockTimeTasks( void )
|
|||
static void vPrimaryBlockTimeTestTask( void *pvParameters )
|
||||
{
|
||||
portBASE_TYPE xItem, xData;
|
||||
portTickType xTimeWhenBlocking;
|
||||
portTickType xTimeToBlock, xBlockedTime;
|
||||
TickType_t xTimeWhenBlocking;
|
||||
TickType_t xTimeToBlock, xBlockedTime;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
|
@ -415,7 +415,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
|
||||
static void vSecondaryBlockTimeTestTask( void *pvParameters )
|
||||
{
|
||||
portTickType xTimeWhenBlocking, xBlockedTime;
|
||||
TickType_t xTimeWhenBlocking, xBlockedTime;
|
||||
portBASE_TYPE xData;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -103,9 +103,9 @@ Changes from V2.0.0
|
|||
|
||||
#define pollqSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define pollqQUEUE_SIZE ( 10 )
|
||||
#define pollqPRODUCER_DELAY ( ( portTickType ) 200 / portTICK_RATE_MS )
|
||||
#define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( portTickType ) ( 20 / portTICK_RATE_MS ) )
|
||||
#define pollqNO_DELAY ( ( portTickType ) 0 )
|
||||
#define pollqPRODUCER_DELAY ( ( TickType_t ) 200 / portTICK_PERIOD_MS )
|
||||
#define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( TickType_t ) ( 20 / portTICK_PERIOD_MS ) )
|
||||
#define pollqNO_DELAY ( ( TickType_t ) 0 )
|
||||
#define pollqVALUES_TO_PRODUCE ( ( signed portBASE_TYPE ) 3 )
|
||||
#define pollqINITIAL_VALUE ( ( signed portBASE_TYPE ) 0 )
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE,
|
|||
|
||||
void vStartAltPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
static xQueueHandle xPolledQueue;
|
||||
static QueueHandle_t xPolledQueue;
|
||||
|
||||
/* Create the queue used by the producer and consumer. */
|
||||
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );
|
||||
|
|
@ -138,8 +138,8 @@ static xQueueHandle xPolledQueue;
|
|||
|
||||
|
||||
/* Spawn the producer and consumer. */
|
||||
xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -162,7 +162,7 @@ signed portBASE_TYPE xError = pdFALSE, xLoop;
|
|||
for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ )
|
||||
{
|
||||
/* Send an incrementing number on the queue without blocking. */
|
||||
if( xQueueAltSendToBack( *( ( xQueueHandle * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )
|
||||
if( xQueueAltSendToBack( *( ( QueueHandle_t * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )
|
||||
{
|
||||
/* We should never find the queue full so if we get here there
|
||||
has been an error. */
|
||||
|
|
@ -208,9 +208,9 @@ signed portBASE_TYPE xError = pdFALSE;
|
|||
for( ;; )
|
||||
{
|
||||
/* Loop until the queue is empty. */
|
||||
while( uxQueueMessagesWaiting( *( ( xQueueHandle * ) pvParameters ) ) )
|
||||
while( uxQueueMessagesWaiting( *( ( QueueHandle_t * ) pvParameters ) ) )
|
||||
{
|
||||
if( xQueueAltReceive( *( ( xQueueHandle * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )
|
||||
if( xQueueAltReceive( *( ( QueueHandle_t * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )
|
||||
{
|
||||
if( usData != usExpectedValue )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -135,14 +135,14 @@ static volatile unsigned long ulGuardedVariable = 0;
|
|||
|
||||
/* Handles used in the mutext test to suspend and resume the high and medium
|
||||
priority mutex test tasks. */
|
||||
static xTaskHandle xHighPriorityMutexTask, xMediumPriorityMutexTask;
|
||||
static TaskHandle_t xHighPriorityMutexTask, xMediumPriorityMutexTask;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vStartAltGenericQueueTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
xQueueHandle xQueue;
|
||||
xSemaphoreHandle xMutex;
|
||||
QueueHandle_t xQueue;
|
||||
SemaphoreHandle_t xMutex;
|
||||
|
||||
/* Create the queue that we are going to use for the
|
||||
prvSendFrontAndBackTest demo. */
|
||||
|
|
@ -170,7 +170,7 @@ xSemaphoreHandle xMutex;
|
|||
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||
defined to be less than 1. */
|
||||
vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Alt_Q_Mutex" );
|
||||
vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Alt_Q_Mutex" );
|
||||
|
||||
/* Create the mutex demo tasks and pass it the mutex just created. We are
|
||||
passing the mutex handle by value so it does not matter that it is declared
|
||||
|
|
@ -184,7 +184,7 @@ xSemaphoreHandle xMutex;
|
|||
static void prvSendFrontAndBackTest( void *pvParameters )
|
||||
{
|
||||
unsigned long ulData, ulData2;
|
||||
xQueueHandle xQueue;
|
||||
QueueHandle_t xQueue;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
|
@ -195,7 +195,7 @@ xQueueHandle xQueue;
|
|||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
#endif
|
||||
|
||||
xQueue = ( xQueueHandle ) pvParameters;
|
||||
xQueue = ( QueueHandle_t ) pvParameters;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
|
|
@ -411,7 +411,7 @@ xQueueHandle xQueue;
|
|||
|
||||
static void prvLowPriorityMutexTask( void *pvParameters )
|
||||
{
|
||||
xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
||||
SemaphoreHandle_t xMutex = ( SemaphoreHandle_t ) pvParameters;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
|
@ -530,7 +530,7 @@ static void prvMediumPriorityMutexTask( void *pvParameters )
|
|||
|
||||
static void prvHighPriorityMutexTask( void *pvParameters )
|
||||
{
|
||||
xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
||||
SemaphoreHandle_t xMutex = ( SemaphoreHandle_t ) pvParameters;
|
||||
|
||||
( void ) pvParameters;
|
||||
|
||||
|
|
|
|||
|
|
@ -103,8 +103,8 @@
|
|||
/* Structure used to pass parameters to the blocking queue tasks. */
|
||||
typedef struct BLOCKING_QUEUE_PARAMETERS
|
||||
{
|
||||
xQueueHandle xQueue; /*< The queue to be used by the task. */
|
||||
portTickType xBlockTime; /*< The block time to use on queue reads/writes. */
|
||||
QueueHandle_t xQueue; /*< The queue to be used by the task. */
|
||||
TickType_t xBlockTime; /*< The block time to use on queue reads/writes. */
|
||||
volatile short *psCheckVariable; /*< Incremented on each successful cycle to check the task is still running. */
|
||||
} xBlockingQueueParameters;
|
||||
|
||||
|
|
@ -132,8 +132,8 @@ xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;
|
|||
xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;
|
||||
xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;
|
||||
const unsigned portBASE_TYPE uxQueueSize1 = 1, uxQueueSize5 = 5;
|
||||
const portTickType xBlockTime = ( portTickType ) 1000 / portTICK_RATE_MS;
|
||||
const portTickType xDontBlock = ( portTickType ) 0;
|
||||
const TickType_t xBlockTime = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
const TickType_t xDontBlock = ( TickType_t ) 0;
|
||||
|
||||
/* Create the first two tasks as described at the top of the file. */
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ that synchronise with the xEventGroupSync() function. */
|
|||
#define ebDONT_BLOCK ( 0 )
|
||||
|
||||
/* A 5ms delay. */
|
||||
#define ebSHORT_DELAY ( 5 / portTICK_RATE_MS )
|
||||
#define ebSHORT_DELAY ( 5 / portTICK_PERIOD_MS )
|
||||
|
||||
/* Used in the selective bits test which checks no, one or both tasks blocked on
|
||||
event bits in a group are unblocked as appropriate as different bits get set. */
|
||||
|
|
|
|||
|
|
@ -137,14 +137,14 @@ static volatile unsigned long ulGuardedVariable = 0;
|
|||
|
||||
/* Handles used in the mutext test to suspend and resume the high and medium
|
||||
priority mutex test tasks. */
|
||||
static xTaskHandle xHighPriorityMutexTask, xMediumPriorityMutexTask;
|
||||
static TaskHandle_t xHighPriorityMutexTask, xMediumPriorityMutexTask;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vStartGenericQueueTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
xQueueHandle xQueue;
|
||||
xSemaphoreHandle xMutex;
|
||||
QueueHandle_t xQueue;
|
||||
SemaphoreHandle_t xMutex;
|
||||
|
||||
/* Create the queue that we are going to use for the
|
||||
prvSendFrontAndBackTest demo. */
|
||||
|
|
@ -172,7 +172,7 @@ xSemaphoreHandle xMutex;
|
|||
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||
defined to be less than 1. */
|
||||
vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Gen_Queue_Mutex" );
|
||||
vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Gen_Queue_Mutex" );
|
||||
|
||||
/* Create the mutex demo tasks and pass it the mutex just created. We are
|
||||
passing the mutex handle by value so it does not matter that it is declared
|
||||
|
|
@ -186,7 +186,7 @@ xSemaphoreHandle xMutex;
|
|||
static void prvSendFrontAndBackTest( void *pvParameters )
|
||||
{
|
||||
unsigned long ulData, ulData2;
|
||||
xQueueHandle xQueue;
|
||||
QueueHandle_t xQueue;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
|
@ -197,7 +197,7 @@ xQueueHandle xQueue;
|
|||
vPrintDisplayMessage( &pcTaskStartMsg );
|
||||
#endif
|
||||
|
||||
xQueue = ( xQueueHandle ) pvParameters;
|
||||
xQueue = ( QueueHandle_t ) pvParameters;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
|
|
@ -413,7 +413,7 @@ xQueueHandle xQueue;
|
|||
|
||||
static void prvLowPriorityMutexTask( void *pvParameters )
|
||||
{
|
||||
xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
||||
SemaphoreHandle_t xMutex = ( SemaphoreHandle_t ) pvParameters;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
void vPrintDisplayMessage( const char * const * ppcMessageToSend );
|
||||
|
|
@ -545,7 +545,7 @@ static void prvMediumPriorityMutexTask( void *pvParameters )
|
|||
|
||||
static void prvHighPriorityMutexTask( void *pvParameters )
|
||||
{
|
||||
xSemaphoreHandle xMutex = ( xSemaphoreHandle ) pvParameters;
|
||||
SemaphoreHandle_t xMutex = ( SemaphoreHandle_t ) pvParameters;
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ an interrupt. */
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* The two queues used by the test. */
|
||||
static xQueueHandle xNormallyEmptyQueue, xNormallyFullQueue;
|
||||
static QueueHandle_t xNormallyEmptyQueue, xNormallyFullQueue;
|
||||
|
||||
/* Variables used to detect a stall in one of the tasks. */
|
||||
static unsigned portBASE_TYPE uxHighPriorityLoops1 = 0, uxHighPriorityLoops2 = 0, uxLowPriorityLoops1 = 0, uxLowPriorityLoops2 = 0;
|
||||
|
|
@ -196,7 +196,7 @@ time to each queue. */
|
|||
volatile unsigned portBASE_TYPE uxValueForNormallyEmptyQueue = 0, uxValueForNormallyFullQueue = 0;
|
||||
|
||||
/* A handle to some of the tasks is required so they can be suspended/resumed. */
|
||||
xTaskHandle xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xHighPriorityNormallyFullTask1, xHighPriorityNormallyFullTask2;
|
||||
TaskHandle_t xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xHighPriorityNormallyFullTask1, xHighPriorityNormallyFullTask2;
|
||||
|
||||
/* When a value is received in a queue the value is ticked off in the array
|
||||
the array position of the value is set to a the identifier of the task or
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@
|
|||
Changes from V2.0.0
|
||||
|
||||
+ Delay periods are now specified using variables and constants of
|
||||
portTickType rather than unsigned long.
|
||||
TickType_t rather than unsigned long.
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
|
|
@ -105,9 +105,9 @@ Changes from V2.0.0
|
|||
|
||||
#define pollqSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define pollqQUEUE_SIZE ( 10 )
|
||||
#define pollqPRODUCER_DELAY ( ( portTickType ) 200 / portTICK_RATE_MS )
|
||||
#define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( portTickType ) ( 20 / portTICK_RATE_MS ) )
|
||||
#define pollqNO_DELAY ( ( portTickType ) 0 )
|
||||
#define pollqPRODUCER_DELAY ( ( TickType_t ) 200 / portTICK_PERIOD_MS )
|
||||
#define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( TickType_t ) ( 20 / portTICK_PERIOD_MS ) )
|
||||
#define pollqNO_DELAY ( ( TickType_t ) 0 )
|
||||
#define pollqVALUES_TO_PRODUCE ( ( signed portBASE_TYPE ) 3 )
|
||||
#define pollqINITIAL_VALUE ( ( signed portBASE_TYPE ) 0 )
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE,
|
|||
|
||||
void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
static xQueueHandle xPolledQueue;
|
||||
static QueueHandle_t xPolledQueue;
|
||||
|
||||
/* Create the queue used by the producer and consumer. */
|
||||
xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );
|
||||
|
|
@ -139,8 +139,8 @@ static xQueueHandle xPolledQueue;
|
|||
vQueueAddToRegistry( xPolledQueue, "Poll_Test_Queue" );
|
||||
|
||||
/* Spawn the producer and consumer. */
|
||||
xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vPolledQueueConsumer, "QConsNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
xTaskCreate( vPolledQueueProducer, "QProdNB", pollqSTACK_SIZE, ( void * ) &xPolledQueue, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ signed portBASE_TYPE xError = pdFALSE, xLoop;
|
|||
for( xLoop = 0; xLoop < pollqVALUES_TO_PRODUCE; xLoop++ )
|
||||
{
|
||||
/* Send an incrementing number on the queue without blocking. */
|
||||
if( xQueueSend( *( ( xQueueHandle * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )
|
||||
if( xQueueSend( *( ( QueueHandle_t * ) pvParameters ), ( void * ) &usValue, pollqNO_DELAY ) != pdPASS )
|
||||
{
|
||||
/* We should never find the queue full so if we get here there
|
||||
has been an error. */
|
||||
|
|
@ -191,9 +191,9 @@ signed portBASE_TYPE xError = pdFALSE;
|
|||
for( ;; )
|
||||
{
|
||||
/* Loop until the queue is empty. */
|
||||
while( uxQueueMessagesWaiting( *( ( xQueueHandle * ) pvParameters ) ) )
|
||||
while( uxQueueMessagesWaiting( *( ( QueueHandle_t * ) pvParameters ) ) )
|
||||
{
|
||||
if( xQueueReceive( *( ( xQueueHandle * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )
|
||||
if( xQueueReceive( *( ( QueueHandle_t * ) pvParameters ), &usData, pollqNO_DELAY ) == pdPASS )
|
||||
{
|
||||
if( usData != usExpectedValue )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -113,12 +113,12 @@ detect a stalled task - a test that is no longer running. */
|
|||
static volatile unsigned long ulLoopCounter = 0;
|
||||
|
||||
/* Handles to the test tasks. */
|
||||
xTaskHandle xMediumPriorityTask, xHighPriorityTask, xHighestPriorityTask;
|
||||
TaskHandle_t xMediumPriorityTask, xHighPriorityTask, xHighestPriorityTask;
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vStartQueuePeekTasks( void )
|
||||
{
|
||||
xQueueHandle xQueue;
|
||||
QueueHandle_t xQueue;
|
||||
|
||||
/* Create the queue that we are going to use for the test/demo. */
|
||||
xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( unsigned long ) );
|
||||
|
|
@ -143,7 +143,7 @@ xQueueHandle xQueue;
|
|||
|
||||
static void prvHighestPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;
|
||||
unsigned long ulValue;
|
||||
|
||||
#ifdef USE_STDIO
|
||||
|
|
@ -252,7 +252,7 @@ unsigned long ulValue;
|
|||
|
||||
static void prvHighPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;
|
||||
unsigned long ulValue;
|
||||
|
||||
for( ;; )
|
||||
|
|
@ -307,7 +307,7 @@ unsigned long ulValue;
|
|||
|
||||
static void prvMediumPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;
|
||||
unsigned long ulValue;
|
||||
|
||||
for( ;; )
|
||||
|
|
@ -348,7 +348,7 @@ unsigned long ulValue;
|
|||
|
||||
static void prvLowPriorityPeekTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xQueue = ( xQueueHandle ) pvParameters;
|
||||
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;
|
||||
unsigned long ulValue;
|
||||
|
||||
for( ;; )
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ static portBASE_TYPE xISRTestStatus = pdPASS;
|
|||
|
||||
/* The queue that is accessed from the ISR. The queue accessed by the task is
|
||||
created inside the task itself. */
|
||||
static xQueueHandle xISRQueue = NULL;
|
||||
static QueueHandle_t xISRQueue = NULL;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -109,13 +109,13 @@ const unsigned portBASE_TYPE uxQueueLength = 1;
|
|||
|
||||
/* Create the test task. The queue used by the test task is created inside
|
||||
the task itself. */
|
||||
xTaskCreate( prvQueueOverwriteTask, "QOver", configMINIMAL_STACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvQueueOverwriteTask, "QOver", configMINIMAL_STACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvQueueOverwriteTask( void *pvParameters )
|
||||
{
|
||||
xQueueHandle xTaskQueue;
|
||||
QueueHandle_t xTaskQueue;
|
||||
const unsigned portBASE_TYPE uxQueueLength = 1;
|
||||
unsigned long ulValue, ulStatus = pdPASS, x;
|
||||
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ queuesetPRIORITY_CHANGE_LOOPS number of values are sent to a queue. */
|
|||
/* A delay inserted when the Tx task changes its priority to be above the idle
|
||||
task priority to ensure the idle priority tasks get some CPU time before the
|
||||
next iteration of the queue set Tx task. */
|
||||
#define queuesetTX_LOOP_DELAY ( 200 / portTICK_RATE_MS )
|
||||
#define queuesetTX_LOOP_DELAY ( 200 / portTICK_PERIOD_MS )
|
||||
|
||||
/* The allowable maximum deviation between a received value and the expected
|
||||
received value. A deviation will occur when data is received from a queue
|
||||
|
|
@ -189,14 +189,14 @@ static void prvSRand( unsigned long ulSeed );
|
|||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* The queues that are added to the set. */
|
||||
static xQueueHandle xQueues[ queuesetNUM_QUEUES_IN_SET ] = { 0 };
|
||||
static QueueHandle_t xQueues[ queuesetNUM_QUEUES_IN_SET ] = { 0 };
|
||||
|
||||
/* Counts how many times each queue in the set is used to ensure all the
|
||||
queues are used. */
|
||||
static unsigned long ulQueueUsedCounter[ queuesetNUM_QUEUES_IN_SET ] = { 0 };
|
||||
|
||||
/* The handle of the queue set to which the queues are added. */
|
||||
static xQueueSetHandle xQueueSet;
|
||||
static QueueSetHandle_t xQueueSet;
|
||||
|
||||
/* If the prvQueueSetReceivingTask() task has not detected any errors then
|
||||
it increments ulCycleCounter on each iteration.
|
||||
|
|
@ -222,7 +222,7 @@ static volatile unsigned long ulISRTxValue = queuesetINITIAL_ISR_TX_VALUE;
|
|||
static unsigned long ulNextRand = 0;
|
||||
|
||||
/* The task handles are stored so their priorities can be changed. */
|
||||
xTaskHandle xQueueSetSendingTask, xQueueSetReceivingTask;
|
||||
TaskHandle_t xQueueSetSendingTask, xQueueSetReceivingTask;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ portBASE_TYPE xReturn = pdPASS, x;
|
|||
static void prvQueueSetSendingTask( void *pvParameters )
|
||||
{
|
||||
unsigned long ulTaskTxValue = 0, ulQueueToWriteTo;
|
||||
xQueueHandle xQueueInUse;
|
||||
QueueHandle_t xQueueInUse;
|
||||
|
||||
/* Remove compiler warning about the unused parameter. */
|
||||
( void ) pvParameters;
|
||||
|
|
@ -390,7 +390,7 @@ static eRelativePriorities ePriorities = eEqualPriority;
|
|||
static void prvQueueSetReceivingTask( void *pvParameters )
|
||||
{
|
||||
unsigned long ulReceived;
|
||||
xQueueHandle xActivatedQueue;
|
||||
QueueHandle_t xActivatedQueue;
|
||||
|
||||
/* Remove compiler warnings. */
|
||||
( void ) pvParameters;
|
||||
|
|
@ -570,7 +570,7 @@ portBASE_TYPE xReturn = pdPASS;
|
|||
|
||||
static void prvReceiveFromQueueInSetFromISR( void )
|
||||
{
|
||||
xQueueSetMemberHandle xActivatedQueue;
|
||||
QueueSetMemberHandle_t xActivatedQueue;
|
||||
unsigned long ulReceived;
|
||||
|
||||
/* See if any of the queues in the set contain data. */
|
||||
|
|
|
|||
|
|
@ -84,8 +84,8 @@
|
|||
#error configTIMER_TASK_PRIORITY must be set to at least 1 for this test/demo to function correctly.
|
||||
#endif
|
||||
|
||||
#define tmrdemoDONT_BLOCK ( ( portTickType ) 0 )
|
||||
#define tmrdemoONE_SHOT_TIMER_PERIOD ( xBasePeriod * ( portTickType ) 3 )
|
||||
#define tmrdemoDONT_BLOCK ( ( TickType_t ) 0 )
|
||||
#define tmrdemoONE_SHOT_TIMER_PERIOD ( xBasePeriod * ( TickType_t ) 3 )
|
||||
#define trmdemoNUM_TIMER_RESETS ( ( unsigned char ) 10 )
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
@ -97,11 +97,11 @@ prvAutoReloadTimerCallback() callback function, and use the ID of the
|
|||
pxExpiredTimer parameter passed into that function to know which counter to
|
||||
increment. The other timers all have their own unique callback function and
|
||||
simply increment their counters without using the callback function parameter. */
|
||||
static void prvAutoReloadTimerCallback( xTimerHandle pxExpiredTimer );
|
||||
static void prvOneShotTimerCallback( xTimerHandle pxExpiredTimer );
|
||||
static void prvAutoReloadTimerCallback( TimerHandle_t pxExpiredTimer );
|
||||
static void prvOneShotTimerCallback( TimerHandle_t pxExpiredTimer );
|
||||
static void prvTimerTestTask( void *pvParameters );
|
||||
static void prvISRAutoReloadTimerCallback( xTimerHandle pxExpiredTimer );
|
||||
static void prvISROneShotTimerCallback( xTimerHandle pxExpiredTimer );
|
||||
static void prvISRAutoReloadTimerCallback( TimerHandle_t pxExpiredTimer );
|
||||
static void prvISROneShotTimerCallback( TimerHandle_t pxExpiredTimer );
|
||||
|
||||
/* The test functions used by the timer test task. These manipulate the auto
|
||||
reload and one shot timers in various ways, then delay, then inspect the timers
|
||||
|
|
@ -128,33 +128,33 @@ static volatile unsigned long ulLoopCounter = 0;
|
|||
The callback function uses the timer ID to index into, and then increment, a
|
||||
counter in the ucAutoReloadTimerCounters[] array. The auto reload timers
|
||||
referenced from xAutoReloadTimers[] are used by the prvTimerTestTask task. */
|
||||
static xTimerHandle xAutoReloadTimers[ configTIMER_QUEUE_LENGTH + 1 ] = { 0 };
|
||||
static TimerHandle_t xAutoReloadTimers[ configTIMER_QUEUE_LENGTH + 1 ] = { 0 };
|
||||
static unsigned char ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH + 1 ] = { 0 };
|
||||
|
||||
/* The one shot timer is configured to use a callback function that increments
|
||||
ucOneShotTimerCounter each time it gets called. */
|
||||
static xTimerHandle xOneShotTimer = NULL;
|
||||
static TimerHandle_t xOneShotTimer = NULL;
|
||||
static unsigned char ucOneShotTimerCounter = ( unsigned char ) 0;
|
||||
|
||||
/* The ISR reload timer is controlled from the tick hook to exercise the timer
|
||||
API functions that can be used from an ISR. It is configured to increment
|
||||
ucISRReloadTimerCounter each time its callback function is executed. */
|
||||
static xTimerHandle xISRAutoReloadTimer = NULL;
|
||||
static TimerHandle_t xISRAutoReloadTimer = NULL;
|
||||
static unsigned char ucISRAutoReloadTimerCounter = ( unsigned char ) 0;
|
||||
|
||||
/* The ISR one shot timer is controlled from the tick hook to exercise the timer
|
||||
API functions that can be used from an ISR. It is configured to increment
|
||||
ucISRReloadTimerCounter each time its callback function is executed. */
|
||||
static xTimerHandle xISROneShotTimer = NULL;
|
||||
static TimerHandle_t xISROneShotTimer = NULL;
|
||||
static unsigned char ucISROneShotTimerCounter = ( unsigned char ) 0;
|
||||
|
||||
/* The period of all the timers are a multiple of the base period. The base
|
||||
period is configured by the parameter to vStartTimerDemoTask(). */
|
||||
static portTickType xBasePeriod = 0;
|
||||
static TickType_t xBasePeriod = 0;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vStartTimerDemoTask( portTickType xBasePeriodIn )
|
||||
void vStartTimerDemoTask( TickType_t xBasePeriodIn )
|
||||
{
|
||||
/* Start with the timer and counter arrays clear - this is only necessary
|
||||
where the compiler does not clear them automatically on start up. */
|
||||
|
|
@ -226,17 +226,17 @@ static void prvTimerTestTask( void *pvParameters )
|
|||
|
||||
/* This is called to check that the created task is still running and has not
|
||||
detected any errors. */
|
||||
portBASE_TYPE xAreTimerDemoTasksStillRunning( portTickType xCycleFrequency )
|
||||
portBASE_TYPE xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency )
|
||||
{
|
||||
static unsigned long ulLastLoopCounter = 0UL;
|
||||
portTickType xMaxBlockTimeUsedByTheseTests, xLoopCounterIncrementTimeMax;
|
||||
static portTickType xIterationsWithoutCounterIncrement = ( portTickType ) 0, xLastCycleFrequency;
|
||||
TickType_t xMaxBlockTimeUsedByTheseTests, xLoopCounterIncrementTimeMax;
|
||||
static TickType_t xIterationsWithoutCounterIncrement = ( TickType_t ) 0, xLastCycleFrequency;
|
||||
|
||||
if( xLastCycleFrequency != xCycleFrequency )
|
||||
{
|
||||
/* The cycle frequency has probably become much faster due to an error
|
||||
elsewhere. Start counting Iterations again. */
|
||||
xIterationsWithoutCounterIncrement = ( portTickType ) 0;
|
||||
xIterationsWithoutCounterIncrement = ( TickType_t ) 0;
|
||||
xLastCycleFrequency = xCycleFrequency;
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ static portTickType xIterationsWithoutCounterIncrement = ( portTickType ) 0, xLa
|
|||
function to be called without ulLoopCounter being incremented. This is
|
||||
necessary because the tests in this file block for extended periods, and the
|
||||
block period might be longer than the time between calls to this function. */
|
||||
xMaxBlockTimeUsedByTheseTests = ( ( portTickType ) configTIMER_QUEUE_LENGTH ) * xBasePeriod;
|
||||
xMaxBlockTimeUsedByTheseTests = ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod;
|
||||
xLoopCounterIncrementTimeMax = ( xMaxBlockTimeUsedByTheseTests / xCycleFrequency ) + 1;
|
||||
|
||||
/* If the demo task is still running then the loop counter is expected to
|
||||
|
|
@ -263,7 +263,7 @@ static portTickType xIterationsWithoutCounterIncrement = ( portTickType ) 0, xLa
|
|||
{
|
||||
/* ulLoopCounter changed, so the count of times this function was called
|
||||
without a change can be reset to zero. */
|
||||
xIterationsWithoutCounterIncrement = ( portTickType ) 0;
|
||||
xIterationsWithoutCounterIncrement = ( TickType_t ) 0;
|
||||
}
|
||||
|
||||
ulLastLoopCounter = ulLoopCounter;
|
||||
|
|
@ -286,7 +286,7 @@ unsigned portBASE_TYPE xTimer;
|
|||
been started, so their block times should get set to zero within the timer
|
||||
API itself. */
|
||||
xAutoReloadTimers[ xTimer ] = xTimerCreate( "FR Timer", /* Text name to facilitate debugging. The kernel does not use this itself. */
|
||||
( ( xTimer + ( portTickType ) 1 ) * xBasePeriod ),/* The period for the timer. The plus 1 ensures a period of zero is not specified. */
|
||||
( ( xTimer + ( TickType_t ) 1 ) * xBasePeriod ),/* The period for the timer. The plus 1 ensures a period of zero is not specified. */
|
||||
pdTRUE, /* Auto-reload is set to true. */
|
||||
( void * ) xTimer, /* An identifier for the timer as all the auto reload timers use the same callback. */
|
||||
prvAutoReloadTimerCallback ); /* The callback to be called when the timer expires. */
|
||||
|
|
@ -388,14 +388,14 @@ unsigned char ucTimer;
|
|||
static void prvTest3_CheckAutoReloadExpireRates( void )
|
||||
{
|
||||
unsigned char ucMaxAllowableValue, ucMinAllowableValue, ucTimer;
|
||||
portTickType xBlockPeriod, xTimerPeriod, xExpectedNumber;
|
||||
TickType_t xBlockPeriod, xTimerPeriod, xExpectedNumber;
|
||||
|
||||
/* Check the auto reload timers expire at the expected rates. */
|
||||
|
||||
|
||||
/* Delaying for configTIMER_QUEUE_LENGTH * xBasePeriod ticks should allow
|
||||
all the auto reload timers to expire at least once. */
|
||||
xBlockPeriod = ( ( portTickType ) configTIMER_QUEUE_LENGTH ) * xBasePeriod;
|
||||
xBlockPeriod = ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod;
|
||||
vTaskDelay( xBlockPeriod );
|
||||
|
||||
/* Check that all the auto reload timers have called their callback
|
||||
|
|
@ -404,7 +404,7 @@ portTickType xBlockPeriod, xTimerPeriod, xExpectedNumber;
|
|||
{
|
||||
/* The expected number of expiries is equal to the block period divided
|
||||
by the timer period. */
|
||||
xTimerPeriod = ( ( ( portTickType ) ucTimer + ( portTickType ) 1 ) * xBasePeriod );
|
||||
xTimerPeriod = ( ( ( TickType_t ) ucTimer + ( TickType_t ) 1 ) * xBasePeriod );
|
||||
xExpectedNumber = xBlockPeriod / xTimerPeriod;
|
||||
|
||||
ucMaxAllowableValue = ( ( unsigned char ) xExpectedNumber ) ;
|
||||
|
|
@ -477,7 +477,7 @@ unsigned char ucTimer;
|
|||
|
||||
/* The timers are now all inactive, so this time, after delaying, none
|
||||
of the callback counters should have incremented. */
|
||||
vTaskDelay( ( ( portTickType ) configTIMER_QUEUE_LENGTH ) * xBasePeriod );
|
||||
vTaskDelay( ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod );
|
||||
for( ucTimer = 0; ucTimer < ( unsigned char ) configTIMER_QUEUE_LENGTH; ucTimer++ )
|
||||
{
|
||||
if( ucAutoReloadTimerCounters[ ucTimer ] != ( unsigned char ) 0 )
|
||||
|
|
@ -525,7 +525,7 @@ static void prvTest5_CheckBasicOneShotTimerBehaviour( void )
|
|||
/* Delay for three times as long as the one shot timer period, then check
|
||||
to ensure it has only called its callback once, and is now not in the
|
||||
active state. */
|
||||
vTaskDelay( tmrdemoONE_SHOT_TIMER_PERIOD * ( portTickType ) 3 );
|
||||
vTaskDelay( tmrdemoONE_SHOT_TIMER_PERIOD * ( TickType_t ) 3 );
|
||||
|
||||
if( xTimerIsTimerActive( xOneShotTimer ) != pdFALSE )
|
||||
{
|
||||
|
|
@ -622,7 +622,7 @@ unsigned char ucTimer;
|
|||
}
|
||||
|
||||
/* Finally delay long enough for both running timers to expire. */
|
||||
vTaskDelay( ( ( portTickType ) configTIMER_QUEUE_LENGTH ) * xBasePeriod );
|
||||
vTaskDelay( ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod );
|
||||
|
||||
/* The timers were not reset during the above delay period so should now
|
||||
both have called their callback functions. */
|
||||
|
|
@ -715,7 +715,7 @@ unsigned char ucTimer;
|
|||
|
||||
void vTimerPeriodicISRTests( void )
|
||||
{
|
||||
static portTickType uxTick = ( portTickType ) -1;
|
||||
static TickType_t uxTick = ( TickType_t ) -1;
|
||||
|
||||
#if( configTIMER_TASK_PRIORITY != ( configMAX_PRIORITIES - 1 ) )
|
||||
/* The timer service task is not the highest priority task, so it cannot
|
||||
|
|
@ -737,9 +737,9 @@ static portTickType uxTick = ( portTickType ) -1;
|
|||
will expire when the kernel's tick count is (100 + xBasePeriod). For this
|
||||
reason xMargin is used as an allowable margin for premature timer expiries
|
||||
as well as late timer expiries. */
|
||||
const portTickType xMargin = 6;
|
||||
const TickType_t xMargin = 6;
|
||||
#else
|
||||
const portTickType xMargin = 3;
|
||||
const TickType_t xMargin = 3;
|
||||
#endif
|
||||
|
||||
|
||||
|
|
@ -755,7 +755,7 @@ static portTickType uxTick = ( portTickType ) -1;
|
|||
/* It is possible that the timer task has not yet made room in the
|
||||
timer queue. If the timers cannot be started then reset uxTick so
|
||||
another attempt is made later. */
|
||||
uxTick = ( portTickType ) -1;
|
||||
uxTick = ( TickType_t ) -1;
|
||||
|
||||
/* Try starting first timer. */
|
||||
if( xTimerChangePeriodFromISR( xISRAutoReloadTimer, xBasePeriod, NULL ) == pdPASS )
|
||||
|
|
@ -822,7 +822,7 @@ static portTickType uxTick = ( portTickType ) -1;
|
|||
configASSERT( xTestStatus );
|
||||
}
|
||||
}
|
||||
else if( uxTick == ( ( 2 * xBasePeriod ) + ( xBasePeriod >> ( portTickType ) 2U ) ) )
|
||||
else if( uxTick == ( ( 2 * xBasePeriod ) + ( xBasePeriod >> ( TickType_t ) 2U ) ) )
|
||||
{
|
||||
/* The auto reload timer will still be active, but the one shot timer
|
||||
should now have stopped. Again though, at this time, neither timer call
|
||||
|
|
@ -1012,14 +1012,14 @@ static portTickType uxTick = ( portTickType ) -1;
|
|||
configASSERT( xTestStatus );
|
||||
}
|
||||
|
||||
uxTick = ( portTickType ) -1;
|
||||
uxTick = ( TickType_t ) -1;
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/*** Timer callback functions are defined below here. ***/
|
||||
|
||||
static void prvAutoReloadTimerCallback( xTimerHandle pxExpiredTimer )
|
||||
static void prvAutoReloadTimerCallback( TimerHandle_t pxExpiredTimer )
|
||||
{
|
||||
unsigned long ulTimerID;
|
||||
|
||||
|
|
@ -1037,7 +1037,7 @@ unsigned long ulTimerID;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvOneShotTimerCallback( xTimerHandle pxExpiredTimer )
|
||||
static void prvOneShotTimerCallback( TimerHandle_t pxExpiredTimer )
|
||||
{
|
||||
/* The parameter is not used in this case as only one timer uses this
|
||||
callback function. */
|
||||
|
|
@ -1047,7 +1047,7 @@ static void prvOneShotTimerCallback( xTimerHandle pxExpiredTimer )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvISRAutoReloadTimerCallback( xTimerHandle pxExpiredTimer )
|
||||
static void prvISRAutoReloadTimerCallback( TimerHandle_t pxExpiredTimer )
|
||||
{
|
||||
/* The parameter is not used in this case as only one timer uses this
|
||||
callback function. */
|
||||
|
|
@ -1057,7 +1057,7 @@ static void prvISRAutoReloadTimerCallback( xTimerHandle pxExpiredTimer )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvISROneShotTimerCallback( xTimerHandle pxExpiredTimer )
|
||||
static void prvISROneShotTimerCallback( TimerHandle_t pxExpiredTimer )
|
||||
{
|
||||
/* The parameter is not used in this case as only one timer uses this
|
||||
callback function. */
|
||||
|
|
|
|||
|
|
@ -88,19 +88,19 @@
|
|||
|
||||
/* Task behaviour. */
|
||||
#define bktQUEUE_LENGTH ( 5 )
|
||||
#define bktSHORT_WAIT ( ( ( portTickType ) 20 ) / portTICK_RATE_MS )
|
||||
#define bktSHORT_WAIT ( ( ( TickType_t ) 20 ) / portTICK_PERIOD_MS )
|
||||
#define bktPRIMARY_BLOCK_TIME ( 10 )
|
||||
#define bktALLOWABLE_MARGIN ( 15 )
|
||||
#define bktTIME_TO_BLOCK ( 175 )
|
||||
#define bktDONT_BLOCK ( ( portTickType ) 0 )
|
||||
#define bktDONT_BLOCK ( ( TickType_t ) 0 )
|
||||
#define bktRUN_INDICATOR ( ( unsigned portBASE_TYPE ) 0x55 )
|
||||
|
||||
/* The queue on which the tasks block. */
|
||||
static xQueueHandle xTestQueue;
|
||||
static QueueHandle_t xTestQueue;
|
||||
|
||||
/* Handle to the secondary task is required by the primary task for calls
|
||||
to vTaskSuspend/Resume(). */
|
||||
static xTaskHandle xSecondary;
|
||||
static TaskHandle_t xSecondary;
|
||||
|
||||
/* Used to ensure that tasks are still executing without error. */
|
||||
static volatile portBASE_TYPE xPrimaryCycles = 0, xSecondaryCycles = 0;
|
||||
|
|
@ -138,8 +138,8 @@ void vCreateBlockTimeTasks( void )
|
|||
static void vPrimaryBlockTimeTestTask( void *pvParameters )
|
||||
{
|
||||
portBASE_TYPE xItem, xData;
|
||||
portTickType xTimeWhenBlocking;
|
||||
portTickType xTimeToBlock, xBlockedTime;
|
||||
TickType_t xTimeWhenBlocking;
|
||||
TickType_t xTimeToBlock, xBlockedTime;
|
||||
|
||||
( void ) pvParameters;
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
{
|
||||
/* The queue is empty. Attempt to read from the queue using a block
|
||||
time. When we wake, ensure the delta in time is as expected. */
|
||||
xTimeToBlock = ( portTickType ) ( bktPRIMARY_BLOCK_TIME << xItem );
|
||||
xTimeToBlock = ( TickType_t ) ( bktPRIMARY_BLOCK_TIME << xItem );
|
||||
|
||||
xTimeWhenBlocking = xTaskGetTickCount();
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
{
|
||||
/* The queue is full. Attempt to write to the queue using a block
|
||||
time. When we wake, ensure the delta in time is as expected. */
|
||||
xTimeToBlock = ( portTickType ) ( bktPRIMARY_BLOCK_TIME << xItem );
|
||||
xTimeToBlock = ( TickType_t ) ( bktPRIMARY_BLOCK_TIME << xItem );
|
||||
|
||||
xTimeWhenBlocking = xTaskGetTickCount();
|
||||
|
||||
|
|
@ -388,7 +388,7 @@ portTickType xTimeToBlock, xBlockedTime;
|
|||
|
||||
static void vSecondaryBlockTimeTestTask( void *pvParameters )
|
||||
{
|
||||
portTickType xTimeWhenBlocking, xBlockedTime;
|
||||
TickType_t xTimeWhenBlocking, xBlockedTime;
|
||||
portBASE_TYPE xData;
|
||||
|
||||
( void ) pvParameters;
|
||||
|
|
|
|||
|
|
@ -112,16 +112,16 @@
|
|||
|
||||
/* The Tx task will transmit the sequence of characters at a pseudo random
|
||||
interval. This is the maximum and minimum block time between sends. */
|
||||
#define comTX_MAX_BLOCK_TIME ( ( portTickType ) 0x96 )
|
||||
#define comTX_MIN_BLOCK_TIME ( ( portTickType ) 0x32 )
|
||||
#define comOFFSET_TIME ( ( portTickType ) 3 )
|
||||
#define comTX_MAX_BLOCK_TIME ( ( TickType_t ) 0x96 )
|
||||
#define comTX_MIN_BLOCK_TIME ( ( TickType_t ) 0x32 )
|
||||
#define comOFFSET_TIME ( ( TickType_t ) 3 )
|
||||
|
||||
/* We should find that each character can be queued for Tx immediately and we
|
||||
don't have to block to send. */
|
||||
#define comNO_BLOCK ( ( portTickType ) 0 )
|
||||
#define comNO_BLOCK ( ( TickType_t ) 0 )
|
||||
|
||||
/* The Rx task will block on the Rx queue for a long period. */
|
||||
#define comRX_BLOCK_TIME ( ( portTickType ) 0xffff )
|
||||
#define comRX_BLOCK_TIME ( ( TickType_t ) 0xffff )
|
||||
|
||||
/* The sequence transmitted is from comFIRST_BYTE to and including comLAST_BYTE. */
|
||||
#define comFIRST_BYTE ( 'A' )
|
||||
|
|
@ -158,15 +158,15 @@ void vAltStartComTestTasks( unsigned portBASE_TYPE uxPriority, unsigned long ulB
|
|||
xSerialPortInitMinimal( ulBaudRate, comBUFFER_LEN );
|
||||
|
||||
/* The Tx task is spawned with a lower priority than the Rx task. */
|
||||
xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vComTxTask, "COMTx", comSTACK_SIZE, NULL, uxPriority - 1, ( TaskHandle_t * ) NULL );
|
||||
xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static portTASK_FUNCTION( vComTxTask, pvParameters )
|
||||
{
|
||||
char cByteToSend;
|
||||
portTickType xTimeToWait;
|
||||
TickType_t xTimeToWait;
|
||||
|
||||
/* Just to stop compiler warnings. */
|
||||
( void ) pvParameters;
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@
|
|||
/* The Tx timer transmits the sequence of characters at a pseudo random
|
||||
interval that is capped between comTX_MAX_BLOCK_TIME and
|
||||
comTX_MIN_BLOCK_TIME. */
|
||||
#define comTX_MAX_BLOCK_TIME ( ( portTickType ) 0x96 )
|
||||
#define comTX_MIN_BLOCK_TIME ( ( portTickType ) 0x32 )
|
||||
#define comOFFSET_TIME ( ( portTickType ) 3 )
|
||||
#define comTX_MAX_BLOCK_TIME ( ( TickType_t ) 0x96 )
|
||||
#define comTX_MIN_BLOCK_TIME ( ( TickType_t ) 0x32 )
|
||||
#define comOFFSET_TIME ( ( TickType_t ) 3 )
|
||||
|
||||
/* States for the simple state machine implemented in the Rx task. */
|
||||
#define comtstWAITING_START_OF_STRING 0
|
||||
|
|
@ -132,20 +132,20 @@ a bit so more than one character can be processed at a time. This is relative
|
|||
to comTX_MIN_BLOCK_TIME to ensure it is never longer than the shortest gap
|
||||
between transmissions. It could be worked out more scientifically from the
|
||||
baud rate being used. */
|
||||
#define comSHORT_DELAY ( comTX_MIN_BLOCK_TIME >> ( portTickType ) 2 )
|
||||
#define comSHORT_DELAY ( comTX_MIN_BLOCK_TIME >> ( TickType_t ) 2 )
|
||||
|
||||
/* The string that is transmitted and received. */
|
||||
#define comTRANSACTED_STRING "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
|
||||
|
||||
/* A block time of 0 simply means "don't block". */
|
||||
#define comtstDONT_BLOCK ( portTickType ) 0
|
||||
#define comtstDONT_BLOCK ( TickType_t ) 0
|
||||
|
||||
/* Handle to the com port used by both tasks. */
|
||||
static xComPortHandle xPort = NULL;
|
||||
|
||||
/* The callback function allocated to the transmit timer, as described in the
|
||||
comments at the top of this file. */
|
||||
static void prvComTxTimerCallback( xTimerHandle xTimer );
|
||||
static void prvComTxTimerCallback( TimerHandle_t xTimer );
|
||||
|
||||
/* The receive task as described in the comments at the top of this file. */
|
||||
static void vComRxTask( void *pvParameters );
|
||||
|
|
@ -161,7 +161,7 @@ static volatile unsigned portBASE_TYPE uxRxLoops = 0UL;
|
|||
|
||||
/* The timer used to periodically transmit the string. This is the timer that
|
||||
has prvComTxTimerCallback allocated to it as its callback function. */
|
||||
static xTimerHandle xTxTimer = NULL;
|
||||
static TimerHandle_t xTxTimer = NULL;
|
||||
|
||||
/* The string length is held at file scope so the Tx timer does not need to
|
||||
calculate it each time it executes. */
|
||||
|
|
@ -188,15 +188,15 @@ void vStartComTestStringsTasks( unsigned portBASE_TYPE uxPriority, unsigned long
|
|||
|
||||
/* Create the Rx task and the Tx timer. The timer is started from the
|
||||
Rx task. */
|
||||
xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vComRxTask, "COMRx", comSTACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
xTxTimer = xTimerCreate( "TxTimer", comTX_MIN_BLOCK_TIME, pdFALSE, NULL, prvComTxTimerCallback );
|
||||
configASSERT( xTxTimer );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvComTxTimerCallback( xTimerHandle xTimer )
|
||||
static void prvComTxTimerCallback( TimerHandle_t xTimer )
|
||||
{
|
||||
portTickType xTimeToWait;
|
||||
TickType_t xTimeToWait;
|
||||
|
||||
/* The parameter is not used in this case. */
|
||||
( void ) xTimer;
|
||||
|
|
|
|||
|
|
@ -111,13 +111,13 @@ static void prvCountingSemaphoreTask( void *pvParameters );
|
|||
* Utility function to increment the semaphore count value up from zero to
|
||||
* countMAX_COUNT_VALUE.
|
||||
*/
|
||||
static void prvIncrementSemaphoreCount( xSemaphoreHandle xSemaphore, unsigned portBASE_TYPE *puxLoopCounter );
|
||||
static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter );
|
||||
|
||||
/*
|
||||
* Utility function to decrement the semaphore count value up from
|
||||
* countMAX_COUNT_VALUE to zero.
|
||||
*/
|
||||
static void prvDecrementSemaphoreCount( xSemaphoreHandle xSemaphore, unsigned portBASE_TYPE *puxLoopCounter );
|
||||
static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -125,7 +125,7 @@ static void prvDecrementSemaphoreCount( xSemaphoreHandle xSemaphore, unsigned po
|
|||
typedef struct COUNT_SEM_STRUCT
|
||||
{
|
||||
/* The semaphore to be used for the demo. */
|
||||
xSemaphoreHandle xSemaphore;
|
||||
SemaphoreHandle_t xSemaphore;
|
||||
|
||||
/* Set to countSTART_AT_MAX_COUNT if the semaphore should be created with
|
||||
its count value set to its max count value, or countSTART_AT_ZERO if it
|
||||
|
|
@ -161,8 +161,8 @@ void vStartCountingSemaphoreTasks( void )
|
|||
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||
defined to be less than 1. */
|
||||
vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 0 ].xSemaphore, "Counting_Sem_1" );
|
||||
vQueueAddToRegistry( ( xQueueHandle ) xParameters[ 1 ].xSemaphore, "Counting_Sem_2" );
|
||||
vQueueAddToRegistry( ( QueueHandle_t ) xParameters[ 0 ].xSemaphore, "Counting_Sem_1" );
|
||||
vQueueAddToRegistry( ( QueueHandle_t ) xParameters[ 1 ].xSemaphore, "Counting_Sem_2" );
|
||||
|
||||
|
||||
/* Were the semaphores created? */
|
||||
|
|
@ -175,7 +175,7 @@ void vStartCountingSemaphoreTasks( void )
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvDecrementSemaphoreCount( xSemaphoreHandle xSemaphore, unsigned portBASE_TYPE *puxLoopCounter )
|
||||
static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter )
|
||||
{
|
||||
unsigned portBASE_TYPE ux;
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ unsigned portBASE_TYPE ux;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvIncrementSemaphoreCount( xSemaphoreHandle xSemaphore, unsigned portBASE_TYPE *puxLoopCounter )
|
||||
static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter )
|
||||
{
|
||||
unsigned portBASE_TYPE ux;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE
|
|||
|
||||
/* The queue used to pass data between the 'fixed delay' co-routines and the
|
||||
'flash' co-routine. */
|
||||
static xQueueHandle xFlashQueue;
|
||||
static QueueHandle_t xFlashQueue;
|
||||
|
||||
/* This will be set to pdFALSE if we detect an error. */
|
||||
static portBASE_TYPE xCoRoutineFlashStatus = pdPASS;
|
||||
|
|
@ -170,14 +170,14 @@ static as we do not need it to maintain its state between blocks. */
|
|||
signed portBASE_TYPE xResult;
|
||||
/* The uxIndex 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[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_RATE_MS,
|
||||
200 / portTICK_RATE_MS,
|
||||
250 / portTICK_RATE_MS,
|
||||
300 / portTICK_RATE_MS,
|
||||
350 / portTICK_RATE_MS,
|
||||
400 / portTICK_RATE_MS,
|
||||
450 / portTICK_RATE_MS,
|
||||
500 / portTICK_RATE_MS };
|
||||
static const TickType_t xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_PERIOD_MS,
|
||||
200 / portTICK_PERIOD_MS,
|
||||
250 / portTICK_PERIOD_MS,
|
||||
300 / portTICK_PERIOD_MS,
|
||||
350 / portTICK_PERIOD_MS,
|
||||
400 / portTICK_PERIOD_MS,
|
||||
450 / portTICK_PERIOD_MS,
|
||||
500 / portTICK_PERIOD_MS };
|
||||
|
||||
/* Co-routines MUST start with a call to crSTART. */
|
||||
crSTART( xHandle );
|
||||
|
|
|
|||
|
|
@ -130,12 +130,12 @@ void vApplicationTickHook( void );
|
|||
/* Queues used to send data FROM a co-routine TO the tick hook function.
|
||||
The hook functions received (Rx's) on these queues. One queue per
|
||||
'hook' co-routine. */
|
||||
static xQueueHandle xHookRxQueues[ hookNUM_HOOK_CO_ROUTINES ];
|
||||
static QueueHandle_t xHookRxQueues[ hookNUM_HOOK_CO_ROUTINES ];
|
||||
|
||||
/* Queues used to send data FROM the tick hook TO a co-routine function.
|
||||
The hood function transmits (Tx's) on these queues. One queue per
|
||||
'hook' co-routine. */
|
||||
static xQueueHandle xHookTxQueues[ hookNUM_HOOK_CO_ROUTINES ];
|
||||
static QueueHandle_t xHookTxQueues[ hookNUM_HOOK_CO_ROUTINES ];
|
||||
|
||||
/* Set to true if an error is detected at any time. */
|
||||
static portBASE_TYPE xCoRoutineErrorDetected = pdFALSE;
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ static const unsigned portBASE_TYPE uxMaxNumberOfExtraTasksRunning = 3;
|
|||
|
||||
/* Used to store a handle to the task that should be killed by a suicidal task,
|
||||
before it kills itself. */
|
||||
xTaskHandle xCreatedTask;
|
||||
TaskHandle_t xCreatedTask;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -168,15 +168,15 @@ unsigned portBASE_TYPE *puxPriority;
|
|||
static portTASK_FUNCTION( vSuicidalTask, pvParameters )
|
||||
{
|
||||
volatile long l1, l2;
|
||||
xTaskHandle xTaskToKill;
|
||||
const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;
|
||||
TaskHandle_t xTaskToKill;
|
||||
const TickType_t xDelay = ( TickType_t ) 200 / portTICK_PERIOD_MS;
|
||||
|
||||
if( pvParameters != NULL )
|
||||
{
|
||||
/* This task is periodically created four times. Two created tasks are
|
||||
passed a handle to the other task so it can kill it before killing itself.
|
||||
The other task is passed in null. */
|
||||
xTaskToKill = *( xTaskHandle* )pvParameters;
|
||||
xTaskToKill = *( TaskHandle_t* )pvParameters;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -194,7 +194,7 @@ const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;
|
|||
if( xTaskToKill != NULL )
|
||||
{
|
||||
/* Make sure the other task has a go before we delete it. */
|
||||
vTaskDelay( ( portTickType ) 0 );
|
||||
vTaskDelay( ( TickType_t ) 0 );
|
||||
|
||||
/* Kill the other task that was created by vCreateTasks(). */
|
||||
vTaskDelete( xTaskToKill );
|
||||
|
|
@ -208,7 +208,7 @@ const portTickType xDelay = ( portTickType ) 200 / portTICK_RATE_MS;
|
|||
|
||||
static portTASK_FUNCTION( vCreateTasks, pvParameters )
|
||||
{
|
||||
const portTickType xDelay = ( portTickType ) 1000 / portTICK_RATE_MS;
|
||||
const TickType_t xDelay = ( TickType_t ) 1000 / portTICK_PERIOD_MS;
|
||||
unsigned portBASE_TYPE uxPriority;
|
||||
|
||||
uxPriority = *( unsigned portBASE_TYPE * ) pvParameters;
|
||||
|
|
|
|||
|
|
@ -144,17 +144,17 @@ static portTASK_FUNCTION_PROTO( vQueueSendWhenSuspendedTask, pvParameters );
|
|||
|
||||
/* Demo task specific constants. */
|
||||
#define priSTACK_SIZE ( configMINIMAL_STACK_SIZE )
|
||||
#define priSLEEP_TIME ( ( portTickType ) 128 / portTICK_RATE_MS )
|
||||
#define priSLEEP_TIME ( ( TickType_t ) 128 / portTICK_PERIOD_MS )
|
||||
#define priLOOPS ( 5 )
|
||||
#define priMAX_COUNT ( ( unsigned long ) 0xff )
|
||||
#define priNO_BLOCK ( ( portTickType ) 0 )
|
||||
#define priNO_BLOCK ( ( TickType_t ) 0 )
|
||||
#define priSUSPENDED_QUEUE_LENGTH ( 1 )
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
/* Handles to the two counter tasks. These could be passed in as parameters
|
||||
to the controller task to prevent them having to be file scope. */
|
||||
static xTaskHandle xContinuousIncrementHandle, xLimitedIncrementHandle;
|
||||
static TaskHandle_t xContinuousIncrementHandle, xLimitedIncrementHandle;
|
||||
|
||||
/* The shared counter variable. This is passed in as a parameter to the two
|
||||
counter variables for demonstration purposes. */
|
||||
|
|
@ -169,7 +169,7 @@ static volatile portBASE_TYPE xSuspendedQueueSendError = pdFALSE;
|
|||
static volatile portBASE_TYPE xSuspendedQueueReceiveError = pdFALSE;
|
||||
|
||||
/* Queue used by the second test. */
|
||||
xQueueHandle xSuspendedTestQueue;
|
||||
QueueHandle_t xSuspendedTestQueue;
|
||||
|
||||
/* The value the queue receive task expects to receive next. This is file
|
||||
scope so xAreDynamicPriorityTasksStillRunning() can ensure it is still
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@
|
|||
|
||||
#define ledSTACK_SIZE configMINIMAL_STACK_SIZE
|
||||
#define ledNUMBER_OF_LEDS ( 3 )
|
||||
#define ledFLASH_RATE_BASE ( ( portTickType ) 333 )
|
||||
#define ledFLASH_RATE_BASE ( ( TickType_t ) 333 )
|
||||
|
||||
/* Variable used by the created tasks to calculate the LED number to use, and
|
||||
the rate at which they should flash the LED. */
|
||||
|
|
@ -108,14 +108,14 @@ signed portBASE_TYPE xLEDTask;
|
|||
for( xLEDTask = 0; xLEDTask < ledNUMBER_OF_LEDS; ++xLEDTask )
|
||||
{
|
||||
/* Spawn the task. */
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, NULL, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vLEDFlashTask, "LEDx", ledSTACK_SIZE, NULL, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static portTASK_FUNCTION( vLEDFlashTask, pvParameters )
|
||||
{
|
||||
portTickType xFlashRate, xLastFlashTime;
|
||||
TickType_t xFlashRate, xLastFlashTime;
|
||||
unsigned portBASE_TYPE uxLED;
|
||||
|
||||
/* The parameters are not used. */
|
||||
|
|
@ -132,12 +132,12 @@ unsigned portBASE_TYPE uxLED;
|
|||
}
|
||||
portEXIT_CRITICAL();
|
||||
|
||||
xFlashRate = ledFLASH_RATE_BASE + ( ledFLASH_RATE_BASE * ( portTickType ) uxLED );
|
||||
xFlashRate /= portTICK_RATE_MS;
|
||||
xFlashRate = ledFLASH_RATE_BASE + ( ledFLASH_RATE_BASE * ( TickType_t ) uxLED );
|
||||
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(). */
|
||||
|
|
|
|||
|
|
@ -77,10 +77,10 @@
|
|||
#include "flash_timer.h"
|
||||
|
||||
/* The toggle rates are all a multple of ledFLASH_RATE_BASE. */
|
||||
#define ledFLASH_RATE_BASE ( ( ( portTickType ) 333 ) / portTICK_RATE_MS )
|
||||
#define ledFLASH_RATE_BASE ( ( ( TickType_t ) 333 ) / portTICK_PERIOD_MS )
|
||||
|
||||
/* A block time of zero simple means "don't block". */
|
||||
#define ledDONT_BLOCK ( ( portTickType ) 0 )
|
||||
#define ledDONT_BLOCK ( ( TickType_t ) 0 )
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -89,14 +89,14 @@
|
|||
* this function, and the timer ID is used within the function to determine
|
||||
* which timer has actually expired.
|
||||
*/
|
||||
static void prvLEDTimerCallback( xTimerHandle xTimer );
|
||||
static void prvLEDTimerCallback( TimerHandle_t xTimer );
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
void vStartLEDFlashTimers( unsigned portBASE_TYPE uxNumberOfLEDs )
|
||||
{
|
||||
unsigned portBASE_TYPE uxLEDTimer;
|
||||
xTimerHandle xTimer;
|
||||
TimerHandle_t xTimer;
|
||||
|
||||
/* Create and start the requested number of timers. */
|
||||
for( uxLEDTimer = 0; uxLEDTimer < uxNumberOfLEDs; ++uxLEDTimer )
|
||||
|
|
@ -122,7 +122,7 @@ xTimerHandle xTimer;
|
|||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
static void prvLEDTimerCallback( xTimerHandle xTimer )
|
||||
static void prvLEDTimerCallback( TimerHandle_t xTimer )
|
||||
{
|
||||
portBASE_TYPE xTimerID;
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ short sTask;
|
|||
|
||||
for( sTask = 0; sTask < intgNUMBER_OF_TASKS; sTask++ )
|
||||
{
|
||||
xTaskCreate( vCompeteingIntMathTask, "IntMath", intgSTACK_SIZE, ( void * ) &( xTaskCheck[ sTask ] ), uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( vCompeteingIntMathTask, "IntMath", intgSTACK_SIZE, ( void * ) &( xTaskCheck[ sTask ] ), uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
|
|
|||
|
|
@ -119,9 +119,9 @@ be overridden by a definition in FreeRTOSConfig.h. */
|
|||
#define recmuMAX_COUNT ( 10 )
|
||||
|
||||
/* Misc. */
|
||||
#define recmuSHORT_DELAY ( 20 / portTICK_RATE_MS )
|
||||
#define recmuNO_DELAY ( ( portTickType ) 0 )
|
||||
#define recmuFIVE_TICK_DELAY ( ( portTickType ) 5 )
|
||||
#define recmuSHORT_DELAY ( 20 / portTICK_PERIOD_MS )
|
||||
#define recmuNO_DELAY ( ( TickType_t ) 0 )
|
||||
#define recmuFIVE_TICK_DELAY ( ( TickType_t ) 5 )
|
||||
|
||||
/* The three tasks as described at the top of this file. */
|
||||
static void prvRecursiveMutexControllingTask( void *pvParameters );
|
||||
|
|
@ -129,7 +129,7 @@ static void prvRecursiveMutexBlockingTask( void *pvParameters );
|
|||
static void prvRecursiveMutexPollingTask( void *pvParameters );
|
||||
|
||||
/* The mutex used by the demo. */
|
||||
static xSemaphoreHandle xMutex;
|
||||
static SemaphoreHandle_t xMutex;
|
||||
|
||||
/* Variables used to detect and latch errors. */
|
||||
static volatile portBASE_TYPE xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE;
|
||||
|
|
@ -137,7 +137,7 @@ static volatile unsigned portBASE_TYPE uxControllingCycles = 0, uxBlockingCycles
|
|||
|
||||
/* Handles of the two higher priority tasks, required so they can be resumed
|
||||
(unsuspended). */
|
||||
static xTaskHandle xControllingTaskHandle, xBlockingTaskHandle;
|
||||
static TaskHandle_t xControllingTaskHandle, xBlockingTaskHandle;
|
||||
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ void vStartRecursiveMutexTasks( void )
|
|||
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||
defined to be less than 1. */
|
||||
vQueueAddToRegistry( ( xQueueHandle ) xMutex, "Recursive_Mutex" );
|
||||
vQueueAddToRegistry( ( QueueHandle_t ) xMutex, "Recursive_Mutex" );
|
||||
|
||||
|
||||
if( xMutex != NULL )
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@
|
|||
|
||||
#define semtstNUM_TASKS ( 4 )
|
||||
|
||||
#define semtstDELAY_FACTOR ( ( portTickType ) 10 )
|
||||
#define semtstDELAY_FACTOR ( ( TickType_t ) 10 )
|
||||
|
||||
/* The task function as described at the top of the file. */
|
||||
static portTASK_FUNCTION_PROTO( prvSemaphoreTest, pvParameters );
|
||||
|
|
@ -113,9 +113,9 @@ static portTASK_FUNCTION_PROTO( prvSemaphoreTest, pvParameters );
|
|||
/* Structure used to pass parameters to each task. */
|
||||
typedef struct SEMAPHORE_PARAMETERS
|
||||
{
|
||||
xSemaphoreHandle xSemaphore;
|
||||
SemaphoreHandle_t xSemaphore;
|
||||
volatile unsigned long *pulSharedVariable;
|
||||
portTickType xBlockTime;
|
||||
TickType_t xBlockTime;
|
||||
} xSemaphoreParameters;
|
||||
|
||||
/* Variables used to check that all the tasks are still running without errors. */
|
||||
|
|
@ -127,7 +127,7 @@ static volatile short sNextCheckVariable = 0;
|
|||
void vStartSemaphoreTasks( unsigned portBASE_TYPE uxPriority )
|
||||
{
|
||||
xSemaphoreParameters *pxFirstSemaphoreParameters, *pxSecondSemaphoreParameters;
|
||||
const portTickType xBlockTime = ( portTickType ) 100;
|
||||
const TickType_t xBlockTime = ( TickType_t ) 100;
|
||||
|
||||
/* Create the structure used to pass parameters to the first two tasks. */
|
||||
pxFirstSemaphoreParameters = ( xSemaphoreParameters * ) pvPortMalloc( sizeof( xSemaphoreParameters ) );
|
||||
|
|
@ -147,11 +147,11 @@ const portTickType xBlockTime = ( portTickType ) 100;
|
|||
*( pxFirstSemaphoreParameters->pulSharedVariable ) = semtstNON_BLOCKING_EXPECTED_VALUE;
|
||||
|
||||
/* The first two tasks do not block on semaphore calls. */
|
||||
pxFirstSemaphoreParameters->xBlockTime = ( portTickType ) 0;
|
||||
pxFirstSemaphoreParameters->xBlockTime = ( TickType_t ) 0;
|
||||
|
||||
/* Spawn the first two tasks. As they poll they operate at the idle priority. */
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -167,10 +167,10 @@ const portTickType xBlockTime = ( portTickType ) 100;
|
|||
{
|
||||
pxSecondSemaphoreParameters->pulSharedVariable = ( unsigned long * ) pvPortMalloc( sizeof( unsigned long ) );
|
||||
*( pxSecondSemaphoreParameters->pulSharedVariable ) = semtstBLOCKING_EXPECTED_VALUE;
|
||||
pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_RATE_MS;
|
||||
pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_PERIOD_MS;
|
||||
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -180,8 +180,8 @@ const portTickType xBlockTime = ( portTickType ) 100;
|
|||
is not being used. The call to vQueueAddToRegistry() will be removed
|
||||
by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is
|
||||
defined to be less than 1. */
|
||||
vQueueAddToRegistry( ( xQueueHandle ) pxFirstSemaphoreParameters->xSemaphore, "Counting_Sem_1" );
|
||||
vQueueAddToRegistry( ( xQueueHandle ) pxSecondSemaphoreParameters->xSemaphore, "Counting_Sem_2" );
|
||||
vQueueAddToRegistry( ( QueueHandle_t ) pxFirstSemaphoreParameters->xSemaphore, "Counting_Sem_1" );
|
||||
vQueueAddToRegistry( ( QueueHandle_t ) pxSecondSemaphoreParameters->xSemaphore, "Counting_Sem_2" );
|
||||
}
|
||||
/*-----------------------------------------------------------*/
|
||||
|
||||
|
|
@ -206,7 +206,7 @@ short sError = pdFALSE, sCheckVariableToUse;
|
|||
|
||||
/* If we are blocking we use a much higher count to ensure loads of context
|
||||
switches occur during the count. */
|
||||
if( pxParameters->xBlockTime > ( portTickType ) 0 )
|
||||
if( pxParameters->xBlockTime > ( TickType_t ) 0 )
|
||||
{
|
||||
ulExpectedValue = semtstBLOCKING_EXPECTED_VALUE;
|
||||
}
|
||||
|
|
@ -264,7 +264,7 @@ short sError = pdFALSE, sCheckVariableToUse;
|
|||
}
|
||||
else
|
||||
{
|
||||
if( pxParameters->xBlockTime == ( portTickType ) 0 )
|
||||
if( pxParameters->xBlockTime == ( TickType_t ) 0 )
|
||||
{
|
||||
/* We have not got the semaphore yet, so no point using the
|
||||
processor. We are not blocking when attempting to obtain the
|
||||
|
|
|
|||
|
|
@ -439,7 +439,7 @@ void LCD_Init(void)
|
|||
LCD_WriteReg(R1, 0x10);
|
||||
LCD_WriteReg(R0, 0xA0);
|
||||
LCD_WriteReg(R3, 0x01);
|
||||
vTaskDelay( 10 / portTICK_RATE_MS ); /* Delay 10 ms */
|
||||
vTaskDelay( 10 / portTICK_PERIOD_MS ); /* Delay 10 ms */
|
||||
LCD_WriteReg(R3, 0x00);
|
||||
LCD_WriteReg(R43, 0x04);
|
||||
|
||||
|
|
@ -453,18 +453,18 @@ void LCD_Init(void)
|
|||
LCD_WriteReg(R36, 0x74);
|
||||
LCD_WriteReg(R30, 0x01);
|
||||
LCD_WriteReg(R24, 0xC1);
|
||||
vTaskDelay( 10 / portTICK_RATE_MS ); /* Delay 10 ms */
|
||||
vTaskDelay( 10 / portTICK_PERIOD_MS ); /* Delay 10 ms */
|
||||
LCD_WriteReg(R24, 0xE1);
|
||||
LCD_WriteReg(R24, 0xF1);
|
||||
vTaskDelay( 60 / portTICK_RATE_MS ); /* Delay 60 ms */
|
||||
vTaskDelay( 60 / portTICK_PERIOD_MS ); /* Delay 60 ms */
|
||||
LCD_WriteReg(R24, 0xF5);
|
||||
vTaskDelay( 60 / portTICK_RATE_MS ); /* Delay 60 ms */
|
||||
vTaskDelay( 60 / portTICK_PERIOD_MS ); /* Delay 60 ms */
|
||||
LCD_WriteReg(R27, 0x09);
|
||||
vTaskDelay( 10 / portTICK_RATE_MS ); /* Delay 10 ms */
|
||||
vTaskDelay( 10 / portTICK_PERIOD_MS ); /* Delay 10 ms */
|
||||
LCD_WriteReg(R31, 0x11);
|
||||
LCD_WriteReg(R32, 0x0E);
|
||||
LCD_WriteReg(R30, 0x81);
|
||||
vTaskDelay( 10 / portTICK_RATE_MS ); /* Delay 10 ms */
|
||||
vTaskDelay( 10 / portTICK_PERIOD_MS ); /* Delay 10 ms */
|
||||
|
||||
/* Chip Set ------------------------------------------------------------------*/
|
||||
LCD_WriteReg(R157, 0x00);
|
||||
|
|
@ -539,7 +539,7 @@ void LCD_Init(void)
|
|||
|
||||
LCD_WriteReg(R0, 0x80);
|
||||
LCD_WriteReg(R59, 0x01);
|
||||
vTaskDelay( 40 / portTICK_RATE_MS ); /* Delay 40 ms */
|
||||
vTaskDelay( 40 / portTICK_PERIOD_MS ); /* Delay 40 ms */
|
||||
LCD_WriteReg(R0, 0x20);
|
||||
}
|
||||
|
||||
|
|
@ -808,7 +808,7 @@ void LCD_ScrollText(u8 Line, u8 *ptr)
|
|||
/* Increment the character counter */
|
||||
i++;
|
||||
}
|
||||
vTaskDelay( 100 / portTICK_RATE_MS );
|
||||
vTaskDelay( 100 / portTICK_PERIOD_MS );
|
||||
i = 0;
|
||||
//LCD_ClearLine(Line);
|
||||
ptr -= length;
|
||||
|
|
@ -1153,18 +1153,18 @@ void LCD_PowerOn(void)
|
|||
LCD_WriteReg(R36, 0x74);
|
||||
LCD_WriteReg(R30, 0x01);
|
||||
LCD_WriteReg(R24, 0xC1);
|
||||
vTaskDelay( 10 / portTICK_RATE_MS ); /* Delay 10 ms */
|
||||
vTaskDelay( 10 / portTICK_PERIOD_MS ); /* Delay 10 ms */
|
||||
LCD_WriteReg(R24, 0xE1);
|
||||
LCD_WriteReg(R24, 0xF1);
|
||||
vTaskDelay( 60 / portTICK_RATE_MS ); /* Delay 60 ms */
|
||||
vTaskDelay( 60 / portTICK_PERIOD_MS ); /* Delay 60 ms */
|
||||
LCD_WriteReg(R24, 0xF5);
|
||||
vTaskDelay( 60 / portTICK_RATE_MS ); /* Delay 60 ms */
|
||||
vTaskDelay( 60 / portTICK_PERIOD_MS ); /* Delay 60 ms */
|
||||
LCD_WriteReg(R27, 0x09);
|
||||
vTaskDelay( 10 / portTICK_RATE_MS ); /* Delay 10 ms */
|
||||
vTaskDelay( 10 / portTICK_PERIOD_MS ); /* Delay 10 ms */
|
||||
LCD_WriteReg(R31, 0x11);
|
||||
LCD_WriteReg(R32, 0x0E);
|
||||
LCD_WriteReg(R30, 0x81);
|
||||
vTaskDelay( 10 / portTICK_RATE_MS ); /* Delay 10 ms */
|
||||
vTaskDelay( 10 / portTICK_PERIOD_MS ); /* Delay 10 ms */
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
@ -1182,7 +1182,7 @@ void LCD_DisplayOn(void)
|
|||
/* Display On */
|
||||
LCD_WriteReg(R0, 0x80);
|
||||
LCD_WriteReg(R59, 0x01);
|
||||
vTaskDelay( 40 / portTICK_RATE_MS ); /* Delay 40 ms */
|
||||
vTaskDelay( 40 / portTICK_PERIOD_MS ); /* Delay 40 ms */
|
||||
LCD_WriteReg(R0, 0x20);
|
||||
}
|
||||
|
||||
|
|
@ -1197,7 +1197,7 @@ void LCD_DisplayOff(void)
|
|||
{
|
||||
/* Display Off */
|
||||
LCD_WriteReg(R0, 0xA0);
|
||||
vTaskDelay( 40 / portTICK_RATE_MS ); /* Delay 40 ms */
|
||||
vTaskDelay( 40 / portTICK_PERIOD_MS ); /* Delay 40 ms */
|
||||
LCD_WriteReg(R59, 0x00);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -64,8 +64,8 @@ ETH_DMADESCTypeDef *DMAPTPRxDescToGet;
|
|||
#define ETH_ERROR ((u32)0)
|
||||
#define ETH_SUCCESS ((u32)1)
|
||||
|
||||
#define ethFIVE_SECONDS ( 5000 / portTICK_RATE_MS )
|
||||
#define ethHUNDRED_MS ( 100 / portTICK_RATE_MS )
|
||||
#define ethFIVE_SECONDS ( 5000 / portTICK_PERIOD_MS )
|
||||
#define ethHUNDRED_MS ( 100 / portTICK_PERIOD_MS )
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
|
|
@ -191,7 +191,7 @@ u32 ETH_Init(ETH_InitTypeDef* ETH_InitStruct, u16 PHYAddress)
|
|||
}
|
||||
|
||||
/* Delay to assure PHY reset */
|
||||
vTaskDelay( 250 / portTICK_RATE_MS );
|
||||
vTaskDelay( 250 / portTICK_PERIOD_MS );
|
||||
|
||||
if(ETH_InitStruct->ETH_AutoNegotiation != ETH_AutoNegotiation_Disable)
|
||||
{
|
||||
|
|
@ -277,7 +277,7 @@ u32 ETH_Init(ETH_InitTypeDef* ETH_InitStruct, u16 PHYAddress)
|
|||
return ETH_ERROR;
|
||||
}
|
||||
|
||||
vTaskDelay( 250 / portTICK_RATE_MS );
|
||||
vTaskDelay( 250 / portTICK_PERIOD_MS );
|
||||
}
|
||||
|
||||
/*------------------------- ETHERNET MACCR Configuration ---------------------*/
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
|
||||
#include "FreeRTOS.h"
|
||||
|
||||
typedef portTickType clock_time_t;
|
||||
typedef TickType_t clock_time_t;
|
||||
#define CLOCK_CONF_SECOND configTICK_RATE_HZ
|
||||
|
||||
#endif /* __CLOCK_ARCH_H__ */
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@
|
|||
#include "FreeRTOS.h"
|
||||
#include "task.h"
|
||||
|
||||
xTaskHandle xEthIntTask;
|
||||
TaskHandle_t xEthIntTask;
|
||||
|
||||
/* lwIP includes. */
|
||||
#include "lwip/def.h"
|
||||
|
|
@ -55,10 +55,10 @@ xTaskHandle xEthIntTask;
|
|||
/* Delay to wait for a DMA buffer to become available if one is not already
|
||||
available. */
|
||||
#define netifBUFFER_WAIT_ATTEMPTS 10
|
||||
#define netifBUFFER_WAIT_DELAY (10 / portTICK_RATE_MS)
|
||||
#define netifBUFFER_WAIT_DELAY (10 / portTICK_PERIOD_MS)
|
||||
|
||||
/* Delay between polling the PHY to see if a link has been established. */
|
||||
#define netifLINK_DELAY ( 500 / portTICK_RATE_MS )
|
||||
#define netifLINK_DELAY ( 500 / portTICK_PERIOD_MS )
|
||||
|
||||
/* Delay between looking for incoming packets. In ideal world this would be
|
||||
infinite. */
|
||||
|
|
@ -85,7 +85,7 @@ static unsigned char ucFECRxBuffers[ ( configNUM_FEC_RX_BUFFERS * configFEC_BUFF
|
|||
static unsigned portBASE_TYPE uxNextRxBuffer = 0, uxNextTxBuffer = 0;
|
||||
|
||||
/* Semaphore used by the FEC interrupt handler to wake the handler task. */
|
||||
static xSemaphoreHandle xFecSemaphore;
|
||||
static SemaphoreHandle_t xFecSemaphore;
|
||||
|
||||
#pragma options align= packed
|
||||
struct ethernetif
|
||||
|
|
|
|||
|
|
@ -56,16 +56,16 @@
|
|||
/* This is the number of threads that can be started with sys_thead_new() */
|
||||
#define SYS_MBOX_SIZE ( 16 )
|
||||
#define MS_TO_TICKS( ms ) \
|
||||
( portTickType )( ( portTickType ) ( ms ) / portTICK_RATE_MS )
|
||||
( TickType_t )( ( TickType_t ) ( ms ) / portTICK_PERIOD_MS )
|
||||
#define TICKS_TO_MS( ticks ) \
|
||||
( unsigned long )( ( portTickType ) ( ticks ) * portTICK_RATE_MS )
|
||||
( unsigned long )( ( TickType_t ) ( ticks ) * portTICK_PERIOD_MS )
|
||||
#define THREAD_STACK_SIZE ( 256 /*FSL:1024*/ )
|
||||
#define THREAD_NAME "lwIP"
|
||||
|
||||
#define THREAD_INIT( tcb ) \
|
||||
do { \
|
||||
tcb->next = NULL; \
|
||||
tcb->pid = ( xTaskHandle )0; \
|
||||
tcb->pid = ( TaskHandle_t )0; \
|
||||
tcb->timeouts.next = NULL; \
|
||||
} while( 0 )
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ typedef struct sys_tcb
|
|||
{
|
||||
struct sys_tcb *next;
|
||||
struct sys_timeouts timeouts;
|
||||
xTaskHandle pid;
|
||||
TaskHandle_t pid;
|
||||
} sys_tcb_t;
|
||||
|
||||
/* ------------------------ Prototypes ------------------------------------ */
|
||||
|
|
@ -223,7 +223,7 @@ sys_arch_thread_remove( sys_thread_t hdl )
|
|||
{
|
||||
sys_tcb_t *current = tasks, *prev;
|
||||
sys_tcb_t *toremove = hdl;
|
||||
xTaskHandle pid = ( xTaskHandle ) 0;
|
||||
TaskHandle_t pid = ( TaskHandle_t ) 0;
|
||||
|
||||
LWIP_ASSERT( "sys_arch_thread_remove: assertion hdl != NULL failed!", hdl != NULL );
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ sys_arch_thread_remove( sys_thread_t hdl )
|
|||
* resources.
|
||||
*/
|
||||
vPortExitCritical( );
|
||||
if( pid != ( xTaskHandle ) 0 )
|
||||
if( pid != ( TaskHandle_t ) 0 )
|
||||
{
|
||||
vTaskDelete( pid );
|
||||
/* not reached. */
|
||||
|
|
@ -276,7 +276,7 @@ sys_thread_t
|
|||
sys_arch_thread_current( void )
|
||||
{
|
||||
sys_tcb_t *p = tasks;
|
||||
xTaskHandle pid = xTaskGetCurrentTaskHandle( );
|
||||
TaskHandle_t pid = xTaskGetCurrentTaskHandle( );
|
||||
|
||||
vPortEnterCritical( );
|
||||
while( ( p != NULL ) && ( p->pid != pid ) )
|
||||
|
|
@ -316,7 +316,7 @@ sys_arch_timeouts( void )
|
|||
sys_sem_t
|
||||
sys_sem_new( u8_t count )
|
||||
{
|
||||
xSemaphoreHandle xSemaphore;
|
||||
SemaphoreHandle_t xSemaphore;
|
||||
|
||||
vSemaphoreCreateBinary( xSemaphore );
|
||||
if( xSemaphore != SYS_SEM_NULL )
|
||||
|
|
@ -386,7 +386,7 @@ u32_t
|
|||
sys_arch_sem_wait( sys_sem_t sem, u32_t timeout )
|
||||
{
|
||||
portBASE_TYPE xStatus;
|
||||
portTickType xTicksStart, xTicksEnd, xTicksElapsed;
|
||||
TickType_t xTicksStart, xTicksEnd, xTicksElapsed;
|
||||
u32_t timespent;
|
||||
|
||||
LWIP_ASSERT( "sys_arch_sem_wait: sem != SYS_SEM_NULL", sem != SYS_SEM_NULL );
|
||||
|
|
@ -425,7 +425,7 @@ sys_arch_sem_wait( sys_sem_t sem, u32_t timeout )
|
|||
sys_mbox_t
|
||||
sys_mbox_new( /*paolo:void*/int size )
|
||||
{
|
||||
xQueueHandle mbox;
|
||||
QueueHandle_t mbox;
|
||||
|
||||
mbox = xQueueCreate( SYS_MBOX_SIZE/*size*/, sizeof( void * ) );
|
||||
if( mbox != SYS_MBOX_NULL )
|
||||
|
|
@ -523,7 +523,7 @@ sys_arch_mbox_fetch( sys_mbox_t mbox, void **msg, u32_t timeout )
|
|||
{
|
||||
void *ret_msg;
|
||||
portBASE_TYPE xStatus;
|
||||
portTickType xTicksStart, xTicksEnd, xTicksElapsed;
|
||||
TickType_t xTicksStart, xTicksEnd, xTicksElapsed;
|
||||
u32_t timespent;
|
||||
|
||||
LWIP_ASSERT( "sys_arch_mbox_fetch: mbox != SYS_MBOX_NULL", mbox != SYS_MBOX_NULL );
|
||||
|
|
@ -565,7 +565,7 @@ sys_arch_mbox_fetch( sys_mbox_t mbox, void **msg, u32_t timeout )
|
|||
u32_t
|
||||
sys_jiffies( void )
|
||||
{
|
||||
portTickType xTicks = xTaskGetTickCount( );
|
||||
TickType_t xTicks = xTaskGetTickCount( );
|
||||
|
||||
return ( u32_t )TICKS_TO_MS( xTicks );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@
|
|||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
#define SYS_MBOX_NULL (xQueueHandle)0
|
||||
#define SYS_SEM_NULL (xSemaphoreHandle)0
|
||||
#define SYS_MBOX_NULL (QueueHandle_t)0
|
||||
#define SYS_SEM_NULL (SemaphoreHandle_t)0
|
||||
|
||||
typedef xSemaphoreHandle sys_sem_t;
|
||||
typedef xQueueHandle sys_mbox_t;
|
||||
typedef xTaskHandle sys_thread_t;
|
||||
typedef SemaphoreHandle_t sys_sem_t;
|
||||
typedef QueueHandle_t sys_mbox_t;
|
||||
typedef TaskHandle_t sys_thread_t;
|
||||
|
||||
/* Message queue constants. */
|
||||
#define archMESG_QUEUE_LENGTH ( 6 )
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@
|
|||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
#define SYS_MBOX_NULL (xQueueHandle)0
|
||||
#define SYS_SEM_NULL (xSemaphoreHandle)0
|
||||
#define SYS_MBOX_NULL (QueueHandle_t)0
|
||||
#define SYS_SEM_NULL (SemaphoreHandle_t)0
|
||||
|
||||
typedef xSemaphoreHandle sys_sem_t;
|
||||
typedef xQueueHandle sys_mbox_t;
|
||||
typedef xTaskHandle sys_thread_t;
|
||||
typedef SemaphoreHandle_t sys_sem_t;
|
||||
typedef QueueHandle_t sys_mbox_t;
|
||||
typedef TaskHandle_t sys_thread_t;
|
||||
|
||||
/* Message queue constants. */
|
||||
#define archMESG_QUEUE_LENGTH ( 6 )
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
struct timeoutlist
|
||||
{
|
||||
struct sys_timeouts timeouts;
|
||||
xTaskHandle pid;
|
||||
TaskHandle_t pid;
|
||||
};
|
||||
|
||||
/* This is the number of threads that can be started with sys_thread_new() */
|
||||
|
|
@ -54,7 +54,7 @@ static u16_t s_nextthread = 0;
|
|||
// Creates an empty mailbox.
|
||||
sys_mbox_t sys_mbox_new(int size)
|
||||
{
|
||||
xQueueHandle mbox;
|
||||
QueueHandle_t mbox;
|
||||
|
||||
( void ) size;
|
||||
|
||||
|
|
@ -146,7 +146,7 @@ err_t result;
|
|||
u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)
|
||||
{
|
||||
void *dummyptr;
|
||||
portTickType StartTime, EndTime, Elapsed;
|
||||
TickType_t StartTime, EndTime, Elapsed;
|
||||
|
||||
StartTime = xTaskGetTickCount();
|
||||
|
||||
|
|
@ -157,10 +157,10 @@ portTickType StartTime, EndTime, Elapsed;
|
|||
|
||||
if ( timeout != 0 )
|
||||
{
|
||||
if ( pdTRUE == xQueueReceive( mbox, &(*msg), timeout / portTICK_RATE_MS ) )
|
||||
if ( pdTRUE == xQueueReceive( mbox, &(*msg), timeout / portTICK_PERIOD_MS ) )
|
||||
{
|
||||
EndTime = xTaskGetTickCount();
|
||||
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;
|
||||
Elapsed = (EndTime - StartTime) * portTICK_PERIOD_MS;
|
||||
|
||||
return ( Elapsed );
|
||||
}
|
||||
|
|
@ -175,7 +175,7 @@ portTickType StartTime, EndTime, Elapsed;
|
|||
{
|
||||
while( pdTRUE != xQueueReceive( mbox, &(*msg), portMAX_DELAY ) ){} // time is arbitrary
|
||||
EndTime = xTaskGetTickCount();
|
||||
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;
|
||||
Elapsed = (EndTime - StartTime) * portTICK_PERIOD_MS;
|
||||
|
||||
return ( Elapsed ); // return time blocked TODO test
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ void *dummyptr;
|
|||
// the initial state of the semaphore.
|
||||
sys_sem_t sys_sem_new(u8_t count)
|
||||
{
|
||||
xSemaphoreHandle xSemaphore;
|
||||
SemaphoreHandle_t xSemaphore;
|
||||
|
||||
vSemaphoreCreateBinary( xSemaphore );
|
||||
|
||||
|
|
@ -257,16 +257,16 @@ sys_sem_t sys_sem_new(u8_t count)
|
|||
*/
|
||||
u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout)
|
||||
{
|
||||
portTickType StartTime, EndTime, Elapsed;
|
||||
TickType_t StartTime, EndTime, Elapsed;
|
||||
|
||||
StartTime = xTaskGetTickCount();
|
||||
|
||||
if( timeout != 0)
|
||||
{
|
||||
if( xSemaphoreTake( sem, timeout / portTICK_RATE_MS ) == pdTRUE )
|
||||
if( xSemaphoreTake( sem, timeout / portTICK_PERIOD_MS ) == pdTRUE )
|
||||
{
|
||||
EndTime = xTaskGetTickCount();
|
||||
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;
|
||||
Elapsed = (EndTime - StartTime) * portTICK_PERIOD_MS;
|
||||
|
||||
return (Elapsed); // return time blocked TODO test
|
||||
}
|
||||
|
|
@ -279,7 +279,7 @@ portTickType StartTime, EndTime, Elapsed;
|
|||
{
|
||||
while( xSemaphoreTake( sem, portMAX_DELAY ) != pdTRUE ){}
|
||||
EndTime = xTaskGetTickCount();
|
||||
Elapsed = (EndTime - StartTime) * portTICK_RATE_MS;
|
||||
Elapsed = (EndTime - StartTime) * portTICK_PERIOD_MS;
|
||||
|
||||
return ( Elapsed ); // return time blocked
|
||||
|
||||
|
|
@ -337,7 +337,7 @@ void sys_init(void)
|
|||
struct sys_timeouts *sys_arch_timeouts(void)
|
||||
{
|
||||
int i;
|
||||
xTaskHandle pid;
|
||||
TaskHandle_t pid;
|
||||
struct timeoutlist *tl;
|
||||
|
||||
pid = xTaskGetCurrentTaskHandle( );
|
||||
|
|
@ -367,7 +367,7 @@ struct timeoutlist *tl;
|
|||
*/
|
||||
sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, int stacksize, int prio)
|
||||
{
|
||||
xTaskHandle CreatedTask;
|
||||
TaskHandle_t CreatedTask;
|
||||
int result;
|
||||
|
||||
if ( s_nextthread < SYS_THREAD_MAX )
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@
|
|||
#define netifINTERFACE_TASK_STACK_SIZE ( 350 )
|
||||
#define netifINTERFACE_TASK_PRIORITY ( configMAX_PRIORITIES - 1 )
|
||||
#define netifBUFFER_WAIT_ATTEMPTS 10
|
||||
#define netifBUFFER_WAIT_DELAY (10 / portTICK_RATE_MS)
|
||||
#define netifBUFFER_WAIT_DELAY (10 / portTICK_PERIOD_MS)
|
||||
#define IFNAME0 'e'
|
||||
#define IFNAME1 'n'
|
||||
|
||||
/* The time to block waiting for input. */
|
||||
#define emacBLOCK_TIME_WAITING_FOR_INPUT ( ( portTickType ) 100 )
|
||||
#define emacBLOCK_TIME_WAITING_FOR_INPUT ( ( TickType_t ) 100 )
|
||||
|
||||
/* Interrupt status bit definition. */
|
||||
#define DMI_RX_CURRENT_DONE 0x8000
|
||||
|
|
@ -67,7 +67,7 @@
|
|||
static u8_t s_rxBuff[1520];
|
||||
|
||||
/* The semaphore used by the ISR to wake the lwIP task. */
|
||||
static xSemaphoreHandle s_xSemaphore = NULL;
|
||||
static SemaphoreHandle_t s_xSemaphore = NULL;
|
||||
|
||||
struct ethernetif {
|
||||
struct eth_addr *ethaddr;
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
* milliseconds. It will do this a maximum of netifMAX_TX_ATTEMPTS before
|
||||
* giving up.
|
||||
*/
|
||||
#define netifTX_BUFFER_FREE_WAIT ( ( portTickType ) 2UL / portTICK_RATE_MS )
|
||||
#define netifTX_BUFFER_FREE_WAIT ( ( TickType_t ) 2UL / portTICK_PERIOD_MS )
|
||||
#define netifMAX_TX_ATTEMPTS ( 5 )
|
||||
|
||||
#define netifMAX_MTU 1500
|
||||
|
|
|
|||
|
|
@ -37,14 +37,14 @@
|
|||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
#define SYS_MBOX_NULL ( ( xQueueHandle ) NULL )
|
||||
#define SYS_SEM_NULL ( ( xSemaphoreHandle ) NULL )
|
||||
#define SYS_MBOX_NULL ( ( QueueHandle_t ) NULL )
|
||||
#define SYS_SEM_NULL ( ( SemaphoreHandle_t ) NULL )
|
||||
#define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE
|
||||
|
||||
typedef xSemaphoreHandle sys_sem_t;
|
||||
typedef xSemaphoreHandle sys_mutex_t;
|
||||
typedef xQueueHandle sys_mbox_t;
|
||||
typedef xTaskHandle sys_thread_t;
|
||||
typedef SemaphoreHandle_t sys_sem_t;
|
||||
typedef SemaphoreHandle_t sys_mutex_t;
|
||||
typedef QueueHandle_t sys_mbox_t;
|
||||
typedef TaskHandle_t sys_thread_t;
|
||||
|
||||
#define sys_mbox_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE )
|
||||
#define sys_mbox_set_invalid( x ) ( ( *x ) = NULL )
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
|||
}
|
||||
else
|
||||
{
|
||||
xReturn = xQueueSend( *pxMailBox, &pxMessageToPost, ( portTickType ) 0 );
|
||||
xReturn = xQueueSend( *pxMailBox, &pxMessageToPost, ( TickType_t ) 0 );
|
||||
}
|
||||
|
||||
if( xReturn == pdPASS )
|
||||
|
|
@ -195,7 +195,7 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
|
|||
u32_t sys_arch_mbox_fetch( sys_mbox_t *pxMailBox, void **ppvBuffer, u32_t ulTimeOut )
|
||||
{
|
||||
void *pvDummy;
|
||||
portTickType xStartTime, xEndTime, xElapsed;
|
||||
TickType_t xStartTime, xEndTime, xElapsed;
|
||||
unsigned long ulReturn;
|
||||
|
||||
xStartTime = xTaskGetTickCount();
|
||||
|
|
@ -209,10 +209,10 @@ unsigned long ulReturn;
|
|||
{
|
||||
configASSERT( xInsideISR == ( portBASE_TYPE ) 0 );
|
||||
|
||||
if( pdTRUE == xQueueReceive( *pxMailBox, &( *ppvBuffer ), ulTimeOut/ portTICK_RATE_MS ) )
|
||||
if( pdTRUE == xQueueReceive( *pxMailBox, &( *ppvBuffer ), ulTimeOut/ portTICK_PERIOD_MS ) )
|
||||
{
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_PERIOD_MS;
|
||||
|
||||
ulReturn = xElapsed;
|
||||
}
|
||||
|
|
@ -227,7 +227,7 @@ unsigned long ulReturn;
|
|||
{
|
||||
while( pdTRUE != xQueueReceive( *pxMailBox, &( *ppvBuffer ), portMAX_DELAY ) );
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_PERIOD_MS;
|
||||
|
||||
if( xElapsed == 0UL )
|
||||
{
|
||||
|
|
@ -349,17 +349,17 @@ err_t xReturn = ERR_MEM;
|
|||
*---------------------------------------------------------------------------*/
|
||||
u32_t sys_arch_sem_wait( sys_sem_t *pxSemaphore, u32_t ulTimeout )
|
||||
{
|
||||
portTickType xStartTime, xEndTime, xElapsed;
|
||||
TickType_t xStartTime, xEndTime, xElapsed;
|
||||
unsigned long ulReturn;
|
||||
|
||||
xStartTime = xTaskGetTickCount();
|
||||
|
||||
if( ulTimeout != 0UL )
|
||||
{
|
||||
if( xSemaphoreTake( *pxSemaphore, ulTimeout / portTICK_RATE_MS ) == pdTRUE )
|
||||
if( xSemaphoreTake( *pxSemaphore, ulTimeout / portTICK_PERIOD_MS ) == pdTRUE )
|
||||
{
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = (xEndTime - xStartTime) * portTICK_RATE_MS;
|
||||
xElapsed = (xEndTime - xStartTime) * portTICK_PERIOD_MS;
|
||||
ulReturn = xElapsed;
|
||||
}
|
||||
else
|
||||
|
|
@ -371,7 +371,7 @@ unsigned long ulReturn;
|
|||
{
|
||||
while( xSemaphoreTake( *pxSemaphore, portMAX_DELAY ) != pdTRUE );
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_PERIOD_MS;
|
||||
|
||||
if( xElapsed == 0UL )
|
||||
{
|
||||
|
|
@ -501,7 +501,7 @@ u32_t sys_now(void)
|
|||
*---------------------------------------------------------------------------*/
|
||||
sys_thread_t sys_thread_new( const char *pcName, void( *pxThread )( void *pvParameters ), void *pvArg, int iStackSize, int iPriority )
|
||||
{
|
||||
xTaskHandle xCreatedTask;
|
||||
TaskHandle_t xCreatedTask;
|
||||
portBASE_TYPE xResult;
|
||||
sys_thread_t xReturn;
|
||||
|
||||
|
|
|
|||
|
|
@ -335,7 +335,7 @@ static void prvInterruptSimulator( void *pvParameters )
|
|||
{
|
||||
static struct pcap_pkthdr *pxHeader;
|
||||
const unsigned char *pucPacketData;
|
||||
extern xQueueHandle xEMACEventQueue;
|
||||
extern QueueHandle_t xEMACEventQueue;
|
||||
const unsigned long ulRxEvent = uipETHERNET_RX_EVENT;
|
||||
long lResult;
|
||||
|
||||
|
|
|
|||
|
|
@ -587,7 +587,7 @@ static void prvInterruptSimulator( void *pvParameters )
|
|||
{
|
||||
static struct pcap_pkthdr *pxHeader;
|
||||
const unsigned char *pucPacketData;
|
||||
extern xQueueHandle xEMACEventQueue;
|
||||
extern QueueHandle_t xEMACEventQueue;
|
||||
long lResult;
|
||||
|
||||
/* Just to kill the compiler warning. */
|
||||
|
|
|
|||
|
|
@ -37,14 +37,14 @@
|
|||
#include "queue.h"
|
||||
#include "semphr.h"
|
||||
|
||||
#define SYS_MBOX_NULL ( ( xQueueHandle ) NULL )
|
||||
#define SYS_SEM_NULL ( ( xSemaphoreHandle ) NULL )
|
||||
#define SYS_MBOX_NULL ( ( QueueHandle_t ) NULL )
|
||||
#define SYS_SEM_NULL ( ( SemaphoreHandle_t ) NULL )
|
||||
#define SYS_DEFAULT_THREAD_STACK_DEPTH configMINIMAL_STACK_SIZE
|
||||
|
||||
typedef xSemaphoreHandle sys_sem_t;
|
||||
typedef xSemaphoreHandle sys_mutex_t;
|
||||
typedef xQueueHandle sys_mbox_t;
|
||||
typedef xTaskHandle sys_thread_t;
|
||||
typedef SemaphoreHandle_t sys_sem_t;
|
||||
typedef SemaphoreHandle_t sys_mutex_t;
|
||||
typedef QueueHandle_t sys_mbox_t;
|
||||
typedef TaskHandle_t sys_thread_t;
|
||||
|
||||
#define sys_mbox_valid( x ) ( ( ( *x ) == NULL) ? pdFALSE : pdTRUE )
|
||||
#define sys_mbox_set_invalid( x ) ( ( *x ) = NULL )
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ err_t xReturn;
|
|||
u32_t sys_arch_mbox_fetch( sys_mbox_t *pxMailBox, void **ppvBuffer, u32_t ulTimeOut )
|
||||
{
|
||||
void *pvDummy;
|
||||
portTickType xStartTime, xEndTime, xElapsed;
|
||||
TickType_t xStartTime, xEndTime, xElapsed;
|
||||
unsigned long ulReturn;
|
||||
|
||||
xStartTime = xTaskGetTickCount();
|
||||
|
|
@ -192,10 +192,10 @@ unsigned long ulReturn;
|
|||
|
||||
if( ulTimeOut != 0UL )
|
||||
{
|
||||
if( pdTRUE == xQueueReceive( *pxMailBox, &( *ppvBuffer ), ulTimeOut/ portTICK_RATE_MS ) )
|
||||
if( pdTRUE == xQueueReceive( *pxMailBox, &( *ppvBuffer ), ulTimeOut/ portTICK_PERIOD_MS ) )
|
||||
{
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_PERIOD_MS;
|
||||
|
||||
ulReturn = xElapsed;
|
||||
}
|
||||
|
|
@ -210,7 +210,7 @@ unsigned long ulReturn;
|
|||
{
|
||||
while( pdTRUE != xQueueReceive( *pxMailBox, &( *ppvBuffer ), portMAX_DELAY ) );
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_PERIOD_MS;
|
||||
|
||||
if( xElapsed == 0UL )
|
||||
{
|
||||
|
|
@ -321,17 +321,17 @@ err_t xReturn = ERR_MEM;
|
|||
*---------------------------------------------------------------------------*/
|
||||
u32_t sys_arch_sem_wait( sys_sem_t *pxSemaphore, u32_t ulTimeout )
|
||||
{
|
||||
portTickType xStartTime, xEndTime, xElapsed;
|
||||
TickType_t xStartTime, xEndTime, xElapsed;
|
||||
unsigned long ulReturn;
|
||||
|
||||
xStartTime = xTaskGetTickCount();
|
||||
|
||||
if( ulTimeout != 0UL )
|
||||
{
|
||||
if( xSemaphoreTake( *pxSemaphore, ulTimeout / portTICK_RATE_MS ) == pdTRUE )
|
||||
if( xSemaphoreTake( *pxSemaphore, ulTimeout / portTICK_PERIOD_MS ) == pdTRUE )
|
||||
{
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = (xEndTime - xStartTime) * portTICK_RATE_MS;
|
||||
xElapsed = (xEndTime - xStartTime) * portTICK_PERIOD_MS;
|
||||
ulReturn = xElapsed;
|
||||
}
|
||||
else
|
||||
|
|
@ -343,7 +343,7 @@ unsigned long ulReturn;
|
|||
{
|
||||
while( xSemaphoreTake( *pxSemaphore, portMAX_DELAY ) != pdTRUE );
|
||||
xEndTime = xTaskGetTickCount();
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_RATE_MS;
|
||||
xElapsed = ( xEndTime - xStartTime ) * portTICK_PERIOD_MS;
|
||||
|
||||
if( xElapsed == 0UL )
|
||||
{
|
||||
|
|
@ -464,7 +464,7 @@ u32_t sys_now(void)
|
|||
*---------------------------------------------------------------------------*/
|
||||
sys_thread_t sys_thread_new( const char *pcName, void( *pxThread )( void *pvParameters ), void *pvArg, int iStackSize, int iPriority )
|
||||
{
|
||||
xTaskHandle xCreatedTask;
|
||||
TaskHandle_t xCreatedTask;
|
||||
portBASE_TYPE xResult;
|
||||
sys_thread_t xReturn;
|
||||
|
||||
|
|
|
|||
|
|
@ -66,8 +66,8 @@
|
|||
#ifndef TIMER_DEMO_H
|
||||
#define TIMER_DEMO_H
|
||||
|
||||
void vStartTimerDemoTask( portTickType xBaseFrequencyIn );
|
||||
portBASE_TYPE xAreTimerDemoTasksStillRunning( portTickType xCycleFrequency );
|
||||
void vStartTimerDemoTask( TickType_t xBaseFrequencyIn );
|
||||
portBASE_TYPE xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency );
|
||||
void vTimerPeriodicISRTests( void );
|
||||
|
||||
#endif /* TIMER_DEMO_H */
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@
|
|||
|
||||
void vPrintInitialise( void );
|
||||
void vPrintDisplayMessage( const char * const * pcMessageToSend );
|
||||
const char *pcPrintGetNextMessage( portTickType xPrintRate );
|
||||
const char *pcPrintGetNextMessage( TickType_t xPrintRate );
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -127,8 +127,8 @@ typedef enum
|
|||
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength );
|
||||
xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength );
|
||||
void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength );
|
||||
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime );
|
||||
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime );
|
||||
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime );
|
||||
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime );
|
||||
portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort );
|
||||
void vSerialClose( xComPortHandle xPort );
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue