/* Variables which are incremented each time an item is removed from a queue, and\r
found to be the expected value.\r
These are used to check that the tasks are still running. */\r
-static volatile short sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
+static volatile short sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
\r
/* Variable which are incremented each time an item is posted on a queue. These\r
are used to check that the tasks are still running. */\r
-static volatile short sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
+static volatile short sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartAltBlockingQueueTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartAltBlockingQueueTasks( UBaseType_t uxPriority )\r
{\r
xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;\r
xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;\r
xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;\r
-const unsigned portBASE_TYPE uxQueueSize1 = 1, uxQueueSize5 = 5;\r
+const UBaseType_t uxQueueSize1 = 1, uxQueueSize5 = 5;\r
const TickType_t xBlockTime = ( TickType_t ) 1000 / portTICK_PERIOD_MS;\r
const TickType_t xDontBlock = ( TickType_t ) 0;\r
\r
\r
/* Create the queue used by the first two tasks to pass the incrementing number.\r
Pass a pointer to the queue in the parameter structure. */\r
- pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( UBaseType_t ) sizeof( uint16_t ) );\r
\r
/* The consumer is created first so gets a block time as described above. */\r
pxQueueParameters1->xBlockTime = xBlockTime;\r
the same mechanism but reverses the task priorities. */\r
\r
pxQueueParameters3 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
- pxQueueParameters3->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ pxQueueParameters3->xQueue = xQueueCreate( uxQueueSize1, ( UBaseType_t ) sizeof( uint16_t ) );\r
pxQueueParameters3->xBlockTime = xDontBlock;\r
pxQueueParameters3->psCheckVariable = &( sBlockingProducerCount[ 1 ] );\r
\r
/* Create the last two tasks as described above. The mechanism is again just\r
the same. This time both parameter structures are given a block time. */\r
pxQueueParameters5 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
- pxQueueParameters5->xQueue = xQueueCreate( uxQueueSize5, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ pxQueueParameters5->xQueue = xQueueCreate( uxQueueSize5, ( UBaseType_t ) sizeof( uint16_t ) );\r
pxQueueParameters5->xBlockTime = xBlockTime;\r
pxQueueParameters5->psCheckVariable = &( sBlockingProducerCount[ 2 ] );\r
\r
\r
static portTASK_FUNCTION( vBlockingQueueProducer, pvParameters )\r
{\r
-unsigned short usValue = 0;\r
+uint16_t usValue = 0;\r
xBlockingQueueParameters *pxQueueParameters;\r
short sErrorEverOccurred = pdFALSE;\r
\r
\r
static portTASK_FUNCTION( vBlockingQueueConsumer, pvParameters )\r
{\r
-unsigned short usData, usExpectedValue = 0;\r
+uint16_t usData, usExpectedValue = 0;\r
xBlockingQueueParameters *pxQueueParameters;\r
short sErrorEverOccurred = pdFALSE;\r
\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreAltBlockingQueuesStillRunning( void )\r
+BaseType_t xAreAltBlockingQueuesStillRunning( void )\r
{\r
-static short sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
-static short sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
-portBASE_TYPE xReturn = pdPASS, xTasks;\r
+static short sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
+static short sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
+BaseType_t xReturn = pdPASS, xTasks;\r
\r
/* Not too worried about mutual exclusion on these variables as they are 16\r
bits and we are only reading them. We also only care to see if they have\r
#define bktALLOWABLE_MARGIN ( 12 )\r
#define bktTIME_TO_BLOCK ( 175 )\r
#define bktDONT_BLOCK ( ( TickType_t ) 0 )\r
-#define bktRUN_INDICATOR ( ( unsigned portBASE_TYPE ) 0x55 )\r
+#define bktRUN_INDICATOR ( ( UBaseType_t ) 0x55 )\r
\r
/* The queue on which the tasks block. */\r
static QueueHandle_t xTestQueue;\r
static TaskHandle_t xSecondary;\r
\r
/* Used to ensure that tasks are still executing without error. */\r
-static portBASE_TYPE xPrimaryCycles = 0, xSecondaryCycles = 0;\r
-static portBASE_TYPE xErrorOccurred = pdFALSE;\r
+static BaseType_t xPrimaryCycles = 0, xSecondaryCycles = 0;\r
+static BaseType_t xErrorOccurred = pdFALSE;\r
\r
/* Provides a simple mechanism for the primary task to know when the\r
secondary task has executed. */\r
-static volatile unsigned portBASE_TYPE xRunIndicator;\r
+static volatile UBaseType_t xRunIndicator;\r
\r
/* The two test tasks. Their behaviour is commented within the files. */\r
static void vPrimaryBlockTimeTestTask( void *pvParameters );\r
void vCreateAltBlockTimeTasks( void )\r
{\r
/* Create the queue on which the two tasks block. */\r
- xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( portBASE_TYPE ) );\r
+ xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( BaseType_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware \r
\r
static void vPrimaryBlockTimeTestTask( void *pvParameters )\r
{\r
-portBASE_TYPE xItem, xData;\r
+BaseType_t xItem, xData;\r
TickType_t xTimeWhenBlocking;\r
TickType_t xTimeToBlock, xBlockedTime;\r
\r
static void vSecondaryBlockTimeTestTask( void *pvParameters )\r
{\r
TickType_t xTimeWhenBlocking, xBlockedTime;\r
-portBASE_TYPE xData;\r
+BaseType_t xData;\r
\r
#ifdef USE_STDIO\r
void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreAltBlockTimeTestTasksStillRunning( void )\r
+BaseType_t xAreAltBlockTimeTestTasksStillRunning( void )\r
{\r
-static portBASE_TYPE xLastPrimaryCycleCount = 0, xLastSecondaryCycleCount = 0;\r
-portBASE_TYPE xReturn = pdPASS;\r
+static BaseType_t xLastPrimaryCycleCount = 0, xLastSecondaryCycleCount = 0;\r
+BaseType_t xReturn = pdPASS;\r
\r
/* Have both tasks performed at least one cycle since this function was\r
last called? */\r
Changes from V2.0.0\r
\r
+ Delay periods are now specified using variables and constants of\r
- TickType_t rather than unsigned long.\r
+ TickType_t rather than uint32_t.\r
*/\r
\r
#include <stdlib.h>\r
#define pollqPRODUCER_DELAY ( ( TickType_t ) 200 / portTICK_PERIOD_MS )\r
#define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( TickType_t ) ( 20 / portTICK_PERIOD_MS ) )\r
#define pollqNO_DELAY ( ( TickType_t ) 0 )\r
-#define pollqVALUES_TO_PRODUCE ( ( signed portBASE_TYPE ) 3 )\r
-#define pollqINITIAL_VALUE ( ( signed portBASE_TYPE ) 0 )\r
+#define pollqVALUES_TO_PRODUCE ( ( BaseType_t ) 3 )\r
+#define pollqINITIAL_VALUE ( ( BaseType_t ) 0 )\r
\r
/* The task that posts the incrementing number onto the queue. */\r
static portTASK_FUNCTION_PROTO( vPolledQueueProducer, pvParameters );\r
\r
/* Variables that are used to check that the tasks are still running with no\r
errors. */\r
-static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;\r
+static volatile BaseType_t xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartAltPolledQueueTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartAltPolledQueueTasks( UBaseType_t uxPriority )\r
{\r
static QueueHandle_t xPolledQueue;\r
\r
/* Create the queue used by the producer and consumer. */\r
- xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( UBaseType_t ) sizeof( uint16_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware \r
\r
static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )\r
{\r
-unsigned short usValue = ( unsigned short ) 0;\r
-signed portBASE_TYPE xError = pdFALSE, xLoop;\r
+uint16_t usValue = ( uint16_t ) 0;\r
+BaseType_t xError = pdFALSE, xLoop;\r
\r
#ifdef USE_STDIO\r
void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
\r
static portTASK_FUNCTION( vPolledQueueConsumer, pvParameters )\r
{\r
-unsigned short usData, usExpectedValue = ( unsigned short ) 0;\r
-signed portBASE_TYPE xError = pdFALSE;\r
+uint16_t usData, usExpectedValue = ( uint16_t ) 0;\r
+BaseType_t xError = pdFALSE;\r
\r
#ifdef USE_STDIO\r
void vPrintDisplayMessage( const char * const * ppcMessageToSend );\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running with no errors. */\r
-portBASE_TYPE xAreAltPollingQueuesStillRunning( void )\r
+BaseType_t xAreAltPollingQueuesStillRunning( void )\r
{\r
-portBASE_TYPE xReturn;\r
+BaseType_t xReturn;\r
\r
/* Check both the consumer and producer poll count to check they have both\r
been changed since out last trip round. We do not need a critical section\r
\r
/* Flag that will be latched to pdTRUE should any unexpected behaviour be\r
detected in any of the tasks. */\r
-static portBASE_TYPE xErrorDetected = pdFALSE;\r
+static BaseType_t xErrorDetected = pdFALSE;\r
\r
/* Counters that are incremented on each cycle of a test. This is used to\r
detect a stalled task - a test that is no longer running. */\r
-static volatile unsigned long ulLoopCounter = 0;\r
-static volatile unsigned long ulLoopCounter2 = 0;\r
+static volatile uint32_t ulLoopCounter = 0;\r
+static volatile uint32_t ulLoopCounter2 = 0;\r
\r
/* The variable that is guarded by the mutex in the mutex demo tasks. */\r
-static volatile unsigned long ulGuardedVariable = 0;\r
+static volatile uint32_t ulGuardedVariable = 0;\r
\r
/* Handles used in the mutext test to suspend and resume the high and medium\r
priority mutex test tasks. */\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartAltGenericQueueTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartAltGenericQueueTasks( UBaseType_t uxPriority )\r
{\r
QueueHandle_t xQueue;\r
SemaphoreHandle_t xMutex;\r
\r
/* Create the queue that we are going to use for the\r
prvSendFrontAndBackTest demo. */\r
- xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned long ) );\r
+ xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( uint32_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware \r
\r
static void prvSendFrontAndBackTest( void *pvParameters )\r
{\r
-unsigned long ulData, ulData2;\r
+uint32_t ulData, ulData2;\r
QueueHandle_t xQueue;\r
\r
#ifdef USE_STDIO\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreAltGenericQueueTasksStillRunning( void )\r
+BaseType_t xAreAltGenericQueueTasksStillRunning( void )\r
{\r
-static unsigned long ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;\r
+static uint32_t ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;\r
\r
/* If the demo task is still running then we expect the loopcounters to\r
have incremented since this function was last called. */\r
/* Variables which are incremented each time an item is removed from a queue, and\r
found to be the expected value.\r
These are used to check that the tasks are still running. */\r
-static volatile short sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
+static volatile short sBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
\r
/* Variable which are incremented each time an item is posted on a queue. These\r
are used to check that the tasks are still running. */\r
-static volatile short sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
+static volatile short sBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartBlockingQueueTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartBlockingQueueTasks( UBaseType_t uxPriority )\r
{\r
xBlockingQueueParameters *pxQueueParameters1, *pxQueueParameters2;\r
xBlockingQueueParameters *pxQueueParameters3, *pxQueueParameters4;\r
xBlockingQueueParameters *pxQueueParameters5, *pxQueueParameters6;\r
-const unsigned portBASE_TYPE uxQueueSize1 = 1, uxQueueSize5 = 5;\r
+const UBaseType_t uxQueueSize1 = 1, uxQueueSize5 = 5;\r
const TickType_t xBlockTime = ( TickType_t ) 1000 / portTICK_PERIOD_MS;\r
const TickType_t xDontBlock = ( TickType_t ) 0;\r
\r
\r
/* Create the queue used by the first two tasks to pass the incrementing number.\r
Pass a pointer to the queue in the parameter structure. */\r
- pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ pxQueueParameters1->xQueue = xQueueCreate( uxQueueSize1, ( UBaseType_t ) sizeof( uint16_t ) );\r
\r
/* The consumer is created first so gets a block time as described above. */\r
pxQueueParameters1->xBlockTime = xBlockTime;\r
the same mechanism but reverses the task priorities. */\r
\r
pxQueueParameters3 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
- pxQueueParameters3->xQueue = xQueueCreate( uxQueueSize1, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ pxQueueParameters3->xQueue = xQueueCreate( uxQueueSize1, ( UBaseType_t ) sizeof( uint16_t ) );\r
pxQueueParameters3->xBlockTime = xDontBlock;\r
pxQueueParameters3->psCheckVariable = &( sBlockingProducerCount[ 1 ] );\r
\r
/* Create the last two tasks as described above. The mechanism is again just\r
the same. This time both parameter structures are given a block time. */\r
pxQueueParameters5 = ( xBlockingQueueParameters * ) pvPortMalloc( sizeof( xBlockingQueueParameters ) );\r
- pxQueueParameters5->xQueue = xQueueCreate( uxQueueSize5, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ pxQueueParameters5->xQueue = xQueueCreate( uxQueueSize5, ( UBaseType_t ) sizeof( uint16_t ) );\r
pxQueueParameters5->xBlockTime = xBlockTime;\r
pxQueueParameters5->psCheckVariable = &( sBlockingProducerCount[ 2 ] );\r
\r
\r
static portTASK_FUNCTION( vBlockingQueueProducer, pvParameters )\r
{\r
-unsigned short usValue = 0;\r
+uint16_t usValue = 0;\r
xBlockingQueueParameters *pxQueueParameters;\r
short sErrorEverOccurred = pdFALSE;\r
\r
\r
static portTASK_FUNCTION( vBlockingQueueConsumer, pvParameters )\r
{\r
-unsigned short usData, usExpectedValue = 0;\r
+uint16_t usData, usExpectedValue = 0;\r
xBlockingQueueParameters *pxQueueParameters;\r
short sErrorEverOccurred = pdFALSE;\r
\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreBlockingQueuesStillRunning( void )\r
+BaseType_t xAreBlockingQueuesStillRunning( void )\r
{\r
-static short sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
-static short sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( unsigned short ) 0, ( unsigned short ) 0, ( unsigned short ) 0 };\r
-portBASE_TYPE xReturn = pdPASS, xTasks;\r
+static short sLastBlockingConsumerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
+static short sLastBlockingProducerCount[ blckqNUM_TASK_SETS ] = { ( uint16_t ) 0, ( uint16_t ) 0, ( uint16_t ) 0 };\r
+BaseType_t xReturn = pdPASS, xTasks;\r
\r
/* Not too worried about mutual exclusion on these variables as they are 16\r
bits and we are only reading them. We also only care to see if they have\r
\r
/* Variables that are incremented by the tasks on each cycle provided no errors\r
have been found. Used to detect an error or stall in the test cycling. */\r
-static volatile unsigned long ulTestMasterCycles = 0, ulTestSlaveCycles = 0, ulISRCycles = 0;\r
+static volatile uint32_t ulTestMasterCycles = 0, ulTestSlaveCycles = 0, ulISRCycles = 0;\r
\r
/* The event group used by all the task based tests. */\r
static EventGroupHandle_t xEventGroup = NULL;\r
/* This is called to check that all the created tasks are still running. */\r
BaseType_t xAreEventGroupTasksStillRunning( void )\r
{\r
-static unsigned long ulPreviousWaitBitCycles = 0, ulPreviousSetBitCycles = 0, ulPreviousISRCycles = 0;\r
+static uint32_t ulPreviousWaitBitCycles = 0, ulPreviousSetBitCycles = 0, ulPreviousISRCycles = 0;\r
BaseType_t xStatus = pdPASS;\r
\r
/* Check the tasks are still cycling without finding any errors. */\r
\r
/* Flag that will be latched to pdTRUE should any unexpected behaviour be\r
detected in any of the tasks. */\r
-static volatile portBASE_TYPE xErrorDetected = pdFALSE;\r
+static volatile BaseType_t xErrorDetected = pdFALSE;\r
\r
/* Counters that are incremented on each cycle of a test. This is used to\r
detect a stalled task - a test that is no longer running. */\r
-static volatile unsigned long ulLoopCounter = 0;\r
-static volatile unsigned long ulLoopCounter2 = 0;\r
+static volatile uint32_t ulLoopCounter = 0;\r
+static volatile uint32_t ulLoopCounter2 = 0;\r
\r
/* The variable that is guarded by the mutex in the mutex demo tasks. */\r
-static volatile unsigned long ulGuardedVariable = 0;\r
+static volatile uint32_t ulGuardedVariable = 0;\r
\r
/* Handles used in the mutext test to suspend and resume the high and medium\r
priority mutex test tasks. */\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartGenericQueueTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartGenericQueueTasks( UBaseType_t uxPriority )\r
{\r
QueueHandle_t xQueue;\r
SemaphoreHandle_t xMutex;\r
\r
/* Create the queue that we are going to use for the\r
prvSendFrontAndBackTest demo. */\r
- xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( unsigned long ) );\r
+ xQueue = xQueueCreate( genqQUEUE_LENGTH, sizeof( uint32_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware\r
\r
static void prvSendFrontAndBackTest( void *pvParameters )\r
{\r
-unsigned long ulData, ulData2;\r
+uint32_t ulData, ulData2;\r
QueueHandle_t xQueue;\r
\r
#ifdef USE_STDIO\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreGenericQueueTasksStillRunning( void )\r
+BaseType_t xAreGenericQueueTasksStillRunning( void )\r
{\r
-static unsigned long ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;\r
+static uint32_t ulLastLoopCounter = 0, ulLastLoopCounter2 = 0;\r
\r
/* If the demo task is still running then we expect the loopcounters to\r
have incremented since this function was last called. */\r
/* Errors detected in the task itself will have latched xErrorDetected\r
to true. */\r
\r
- return ( portBASE_TYPE ) !xErrorDetected;\r
+ return ( BaseType_t ) !xErrorDetected;\r
}\r
\r
\r
/* Each task and interrupt is given a unique identifier. This value is used to\r
identify which task sent or received each value. The identifier is also used\r
to distinguish between two tasks that are running the same task function. */\r
-#define intqHIGH_PRIORITY_TASK1 ( ( unsigned portBASE_TYPE ) 1 )\r
-#define intqHIGH_PRIORITY_TASK2 ( ( unsigned portBASE_TYPE ) 2 )\r
-#define intqLOW_PRIORITY_TASK ( ( unsigned portBASE_TYPE ) 3 )\r
-#define intqFIRST_INTERRUPT ( ( unsigned portBASE_TYPE ) 4 )\r
-#define intqSECOND_INTERRUPT ( ( unsigned portBASE_TYPE ) 5 )\r
-#define intqQUEUE_LENGTH ( ( unsigned portBASE_TYPE ) 10 )\r
+#define intqHIGH_PRIORITY_TASK1 ( ( UBaseType_t ) 1 )\r
+#define intqHIGH_PRIORITY_TASK2 ( ( UBaseType_t ) 2 )\r
+#define intqLOW_PRIORITY_TASK ( ( UBaseType_t ) 3 )\r
+#define intqFIRST_INTERRUPT ( ( UBaseType_t ) 4 )\r
+#define intqSECOND_INTERRUPT ( ( UBaseType_t ) 5 )\r
+#define intqQUEUE_LENGTH ( ( UBaseType_t ) 10 )\r
\r
/* At least intqMIN_ACCEPTABLE_TASK_COUNT values should be sent to/received\r
from each queue by each task, otherwise an error is detected. */\r
#define timerNORMALLY_EMPTY_TX() \\r
if( xQueueIsQueueFullFromISR( xNormallyEmptyQueue ) != pdTRUE ) \\r
{ \\r
- unsigned portBASE_TYPE uxSavedInterruptStatus; \\r
+ UBaseType_t uxSavedInterruptStatus; \\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR(); \\r
{ \\r
uxValueForNormallyEmptyQueue++; \\r
#define timerNORMALLY_FULL_TX() \\r
if( xQueueIsQueueFullFromISR( xNormallyFullQueue ) != pdTRUE ) \\r
{ \\r
- unsigned portBASE_TYPE uxSavedInterruptStatus; \\r
+ UBaseType_t uxSavedInterruptStatus; \\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR(); \\r
{ \\r
uxValueForNormallyFullQueue++; \\r
static QueueHandle_t xNormallyEmptyQueue, xNormallyFullQueue;\r
\r
/* Variables used to detect a stall in one of the tasks. */\r
-static unsigned portBASE_TYPE uxHighPriorityLoops1 = 0, uxHighPriorityLoops2 = 0, uxLowPriorityLoops1 = 0, uxLowPriorityLoops2 = 0;\r
+static UBaseType_t uxHighPriorityLoops1 = 0, uxHighPriorityLoops2 = 0, uxLowPriorityLoops1 = 0, uxLowPriorityLoops2 = 0;\r
\r
/* Any unexpected behaviour sets xErrorStatus to fail and log the line that\r
caused the error in xErrorLine. */\r
-static portBASE_TYPE xErrorStatus = pdPASS;\r
-static volatile unsigned portBASE_TYPE xErrorLine = ( unsigned portBASE_TYPE ) 0;\r
+static BaseType_t xErrorStatus = pdPASS;\r
+static volatile UBaseType_t xErrorLine = ( UBaseType_t ) 0;\r
\r
/* Used for sequencing between tasks. */\r
-static portBASE_TYPE xWasSuspended = pdFALSE;\r
+static BaseType_t xWasSuspended = pdFALSE;\r
\r
/* The values that are sent to the queues. An incremented value is sent each\r
time to each queue. */\r
-volatile unsigned portBASE_TYPE uxValueForNormallyEmptyQueue = 0, uxValueForNormallyFullQueue = 0;\r
+volatile UBaseType_t uxValueForNormallyEmptyQueue = 0, uxValueForNormallyFullQueue = 0;\r
\r
/* A handle to some of the tasks is required so they can be suspended/resumed. */\r
TaskHandle_t xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xHighPriorityNormallyFullTask1, xHighPriorityNormallyFullTask2;\r
the array position of the value is set to a the identifier of the task or\r
interrupt that accessed the queue. This way missing or duplicate values can be\r
detected. */\r
-static unsigned char ucNormallyEmptyReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
-static unsigned char ucNormallyFullReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
+static uint8_t ucNormallyEmptyReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
+static uint8_t ucNormallyFullReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
\r
/* The test tasks themselves. */\r
static void prvLowerPriorityNormallyEmptyTask( void *pvParameters );\r
\r
/* Used to mark the positions within the ucNormallyEmptyReceivedValues and\r
ucNormallyFullReceivedValues arrays, while checking for duplicates. */\r
-static void prvRecordValue_NormallyEmpty( unsigned portBASE_TYPE uxValue, unsigned portBASE_TYPE uxSource );\r
-static void prvRecordValue_NormallyFull( unsigned portBASE_TYPE uxValue, unsigned portBASE_TYPE uxSource );\r
+static void prvRecordValue_NormallyEmpty( UBaseType_t uxValue, UBaseType_t uxSource );\r
+static void prvRecordValue_NormallyFull( UBaseType_t uxValue, UBaseType_t uxSource );\r
\r
/* Logs the line on which an error occurred. */\r
-static void prvQueueAccessLogError( unsigned portBASE_TYPE uxLine );\r
+static void prvQueueAccessLogError( UBaseType_t uxLine );\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Create the queues that are accessed by multiple tasks and multiple\r
interrupts. */\r
- xNormallyFullQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );\r
- xNormallyEmptyQueue = xQueueCreate( intqQUEUE_LENGTH, ( unsigned portBASE_TYPE ) sizeof( unsigned portBASE_TYPE ) );\r
+ xNormallyFullQueue = xQueueCreate( intqQUEUE_LENGTH, ( UBaseType_t ) sizeof( UBaseType_t ) );\r
+ xNormallyEmptyQueue = xQueueCreate( intqQUEUE_LENGTH, ( UBaseType_t ) sizeof( UBaseType_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvRecordValue_NormallyFull( unsigned portBASE_TYPE uxValue, unsigned portBASE_TYPE uxSource )\r
+static void prvRecordValue_NormallyFull( UBaseType_t uxValue, UBaseType_t uxSource )\r
{\r
if( uxValue < intqNUM_VALUES_TO_LOG )\r
{\r
}\r
\r
/* Log that this value has been received. */\r
- ucNormallyFullReceivedValues[ uxValue ] = ( unsigned char ) uxSource;\r
+ ucNormallyFullReceivedValues[ uxValue ] = ( uint8_t ) uxSource;\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvRecordValue_NormallyEmpty( unsigned portBASE_TYPE uxValue, unsigned portBASE_TYPE uxSource )\r
+static void prvRecordValue_NormallyEmpty( UBaseType_t uxValue, UBaseType_t uxSource )\r
{\r
if( uxValue < intqNUM_VALUES_TO_LOG )\r
{\r
}\r
\r
/* Log that this value has been received. */\r
- ucNormallyEmptyReceivedValues[ uxValue ] = ( unsigned char ) uxSource;\r
+ ucNormallyEmptyReceivedValues[ uxValue ] = ( uint8_t ) uxSource;\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvQueueAccessLogError( unsigned portBASE_TYPE uxLine )\r
+static void prvQueueAccessLogError( UBaseType_t uxLine )\r
{\r
/* Latch the line number that caused the error. */\r
xErrorLine = uxLine;\r
\r
static void prvHigherPriorityNormallyEmptyTask( void *pvParameters )\r
{\r
-unsigned portBASE_TYPE uxRxed, ux, uxTask1, uxTask2, uxInterrupts, uxErrorCount1 = 0, uxErrorCount2 = 0;\r
+UBaseType_t uxRxed, ux, uxTask1, uxTask2, uxInterrupts, uxErrorCount1 = 0, uxErrorCount2 = 0;\r
\r
/* The timer should not be started until after the scheduler has started.\r
More than one task is running this code so we check the parameter value\r
to determine which task should start the timer. */\r
- if( ( unsigned portBASE_TYPE ) pvParameters == intqHIGH_PRIORITY_TASK1 )\r
+ if( ( UBaseType_t ) pvParameters == intqHIGH_PRIORITY_TASK1 )\r
{\r
vInitialiseTimerForIntQueueTest();\r
}\r
{\r
/* Note which value was received so we can check all expected\r
values are received and no values are duplicated. */\r
- prvRecordValue_NormallyEmpty( uxRxed, ( unsigned portBASE_TYPE ) pvParameters );\r
+ prvRecordValue_NormallyEmpty( uxRxed, ( UBaseType_t ) pvParameters );\r
}\r
\r
/* Ensure the other task running this code gets a chance to execute. */\r
taskYIELD();\r
\r
- if( ( unsigned portBASE_TYPE ) pvParameters == intqHIGH_PRIORITY_TASK1 )\r
+ if( ( UBaseType_t ) pvParameters == intqHIGH_PRIORITY_TASK1 )\r
{\r
/* Have we received all the expected values? */\r
if( uxValueForNormallyEmptyQueue > ( intqNUM_VALUES_TO_LOG + intqVALUE_OVERRUN ) )\r
\r
static void prvLowerPriorityNormallyEmptyTask( void *pvParameters )\r
{\r
-unsigned portBASE_TYPE uxValue, uxRxed;\r
+UBaseType_t uxValue, uxRxed;\r
\r
/* The parameters are not being used so avoid compiler warnings. */\r
( void ) pvParameters;\r
\r
static void prv1stHigherPriorityNormallyFullTask( void *pvParameters )\r
{\r
-unsigned portBASE_TYPE uxValueToTx, ux, uxInterrupts;\r
+UBaseType_t uxValueToTx, ux, uxInterrupts;\r
\r
/* The parameters are not being used so avoid compiler warnings. */\r
( void ) pvParameters;\r
\r
static void prv2ndHigherPriorityNormallyFullTask( void *pvParameters )\r
{\r
-unsigned portBASE_TYPE uxValueToTx, ux;\r
+UBaseType_t uxValueToTx, ux;\r
\r
/* The parameters are not being used so avoid compiler warnings. */\r
( void ) pvParameters;\r
\r
static void prvLowerPriorityNormallyFullTask( void *pvParameters )\r
{\r
-unsigned portBASE_TYPE uxValue, uxTxed = 9999;\r
+UBaseType_t uxValue, uxTxed = 9999;\r
\r
/* The parameters are not being used so avoid compiler warnings. */\r
( void ) pvParameters;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xFirstTimerHandler( void )\r
+BaseType_t xFirstTimerHandler( void )\r
{\r
-portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
-unsigned portBASE_TYPE uxRxedValue;\r
-static unsigned portBASE_TYPE uxNextOperation = 0;\r
+BaseType_t xHigherPriorityTaskWoken = pdFALSE;\r
+UBaseType_t uxRxedValue;\r
+static UBaseType_t uxNextOperation = 0;\r
\r
/* Called from a timer interrupt. Perform various read and write\r
accesses on the queues. */\r
\r
uxNextOperation++;\r
\r
- if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 )\r
+ if( uxNextOperation & ( UBaseType_t ) 0x01 )\r
{\r
timerNORMALLY_EMPTY_TX();\r
timerNORMALLY_EMPTY_TX();\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xSecondTimerHandler( void )\r
+BaseType_t xSecondTimerHandler( void )\r
{\r
-unsigned portBASE_TYPE uxRxedValue;\r
-portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;\r
-static unsigned portBASE_TYPE uxNextOperation = 0;\r
+UBaseType_t uxRxedValue;\r
+BaseType_t xHigherPriorityTaskWoken = pdFALSE;\r
+static UBaseType_t uxNextOperation = 0;\r
\r
/* Called from a timer interrupt. Perform various read and write\r
accesses on the queues. */\r
\r
uxNextOperation++;\r
\r
- if( uxNextOperation & ( unsigned portBASE_TYPE ) 0x01 )\r
+ if( uxNextOperation & ( UBaseType_t ) 0x01 )\r
{\r
timerNORMALLY_EMPTY_TX();\r
timerNORMALLY_EMPTY_TX();\r
/*-----------------------------------------------------------*/\r
\r
\r
-portBASE_TYPE xAreIntQueueTasksStillRunning( void )\r
+BaseType_t xAreIntQueueTasksStillRunning( void )\r
{\r
-static unsigned portBASE_TYPE uxLastHighPriorityLoops1 = 0, uxLastHighPriorityLoops2 = 0, uxLastLowPriorityLoops1 = 0, uxLastLowPriorityLoops2 = 0;\r
+static UBaseType_t uxLastHighPriorityLoops1 = 0, uxLastHighPriorityLoops2 = 0, uxLastLowPriorityLoops1 = 0, uxLastLowPriorityLoops2 = 0;\r
\r
/* xErrorStatus can be set outside of this function. This function just\r
checks that all the tasks are still cycling. */\r
Changes from V2.0.0\r
\r
+ Delay periods are now specified using variables and constants of\r
- TickType_t rather than unsigned long.\r
+ TickType_t rather than uint32_t.\r
*/\r
\r
#include <stdlib.h>\r
#define pollqPRODUCER_DELAY ( ( TickType_t ) 200 / portTICK_PERIOD_MS )\r
#define pollqCONSUMER_DELAY ( pollqPRODUCER_DELAY - ( TickType_t ) ( 20 / portTICK_PERIOD_MS ) )\r
#define pollqNO_DELAY ( ( TickType_t ) 0 )\r
-#define pollqVALUES_TO_PRODUCE ( ( signed portBASE_TYPE ) 3 )\r
-#define pollqINITIAL_VALUE ( ( signed portBASE_TYPE ) 0 )\r
+#define pollqVALUES_TO_PRODUCE ( ( BaseType_t ) 3 )\r
+#define pollqINITIAL_VALUE ( ( BaseType_t ) 0 )\r
\r
/* The task that posts the incrementing number onto the queue. */\r
static portTASK_FUNCTION_PROTO( vPolledQueueProducer, pvParameters );\r
\r
/* Variables that are used to check that the tasks are still running with no\r
errors. */\r
-static volatile signed portBASE_TYPE xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;\r
+static volatile BaseType_t xPollingConsumerCount = pollqINITIAL_VALUE, xPollingProducerCount = pollqINITIAL_VALUE;\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartPolledQueueTasks( UBaseType_t uxPriority )\r
{\r
static QueueHandle_t xPolledQueue;\r
\r
/* Create the queue used by the producer and consumer. */\r
- xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( unsigned portBASE_TYPE ) sizeof( unsigned short ) );\r
+ xPolledQueue = xQueueCreate( pollqQUEUE_SIZE, ( UBaseType_t ) sizeof( uint16_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware \r
\r
static portTASK_FUNCTION( vPolledQueueProducer, pvParameters )\r
{\r
-unsigned short usValue = ( unsigned short ) 0;\r
-signed portBASE_TYPE xError = pdFALSE, xLoop;\r
+uint16_t usValue = ( uint16_t ) 0;\r
+BaseType_t xError = pdFALSE, xLoop;\r
\r
for( ;; )\r
{ \r
\r
static portTASK_FUNCTION( vPolledQueueConsumer, pvParameters )\r
{\r
-unsigned short usData, usExpectedValue = ( unsigned short ) 0;\r
-signed portBASE_TYPE xError = pdFALSE;\r
+uint16_t usData, usExpectedValue = ( uint16_t ) 0;\r
+BaseType_t xError = pdFALSE;\r
\r
for( ;; )\r
{ \r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running with no errors. */\r
-portBASE_TYPE xArePollingQueuesStillRunning( void )\r
+BaseType_t xArePollingQueuesStillRunning( void )\r
{\r
-portBASE_TYPE xReturn;\r
+BaseType_t xReturn;\r
\r
/* Check both the consumer and producer poll count to check they have both\r
been changed since out last trip round. We do not need a critical section\r
\r
/* Flag that will be latched to pdTRUE should any unexpected behaviour be\r
detected in any of the tasks. */\r
-static volatile portBASE_TYPE xErrorDetected = pdFALSE;\r
+static volatile BaseType_t xErrorDetected = pdFALSE;\r
\r
/* Counter that is incremented on each cycle of a test. This is used to\r
detect a stalled task - a test that is no longer running. */\r
-static volatile unsigned long ulLoopCounter = 0;\r
+static volatile uint32_t ulLoopCounter = 0;\r
\r
/* Handles to the test tasks. */\r
TaskHandle_t xMediumPriorityTask, xHighPriorityTask, xHighestPriorityTask;\r
QueueHandle_t xQueue;\r
\r
/* Create the queue that we are going to use for the test/demo. */\r
- xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( unsigned long ) );\r
+ xQueue = xQueueCreate( qpeekQUEUE_LENGTH, sizeof( uint32_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware\r
static void prvHighestPriorityPeekTask( void *pvParameters )\r
{\r
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;\r
-unsigned long ulValue;\r
+uint32_t ulValue;\r
\r
#ifdef USE_STDIO\r
{\r
static void prvHighPriorityPeekTask( void *pvParameters )\r
{\r
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;\r
-unsigned long ulValue;\r
+uint32_t ulValue;\r
\r
for( ;; )\r
{\r
static void prvMediumPriorityPeekTask( void *pvParameters )\r
{\r
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;\r
-unsigned long ulValue;\r
+uint32_t ulValue;\r
\r
for( ;; )\r
{\r
static void prvLowPriorityPeekTask( void *pvParameters )\r
{\r
QueueHandle_t xQueue = ( QueueHandle_t ) pvParameters;\r
-unsigned long ulValue;\r
+uint32_t ulValue;\r
\r
for( ;; )\r
{\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreQueuePeekTasksStillRunning( void )\r
+BaseType_t xAreQueuePeekTasksStillRunning( void )\r
{\r
-static unsigned long ulLastLoopCounter = 0;\r
+static uint32_t ulLastLoopCounter = 0;\r
\r
/* If the demo task is still running then we expect the loopcounter to\r
have incremented since this function was last called. */\r
/* Errors detected in the task itself will have latched xErrorDetected\r
to true. */\r
\r
- return ( portBASE_TYPE ) !xErrorDetected;\r
+ return ( BaseType_t ) !xErrorDetected;\r
}\r
\r
\r
/* Variable that is incremented on each loop of prvQueueOverwriteTask() provided\r
prvQueueOverwriteTask() has not found any errors. */\r
-static unsigned long ulLoopCounter = 0;\r
+static uint32_t ulLoopCounter = 0;\r
\r
/* Set to pdFALSE if an error is discovered by the\r
vQueueOverwritePeriodicISRDemo() function. */\r
-static portBASE_TYPE xISRTestStatus = pdPASS;\r
+static BaseType_t xISRTestStatus = pdPASS;\r
\r
/* The queue that is accessed from the ISR. The queue accessed by the task is\r
created inside the task itself. */\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartQueueOverwriteTask( unsigned portBASE_TYPE uxPriority )\r
+void vStartQueueOverwriteTask( UBaseType_t uxPriority )\r
{\r
-const unsigned portBASE_TYPE uxQueueLength = 1;\r
+const UBaseType_t uxQueueLength = 1;\r
\r
/* Create the queue used by the ISR. xQueueOverwriteFromISR() should only\r
be used on queues that have a length of 1. */\r
- xISRQueue = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( unsigned long ) );\r
+ xISRQueue = xQueueCreate( uxQueueLength, ( UBaseType_t ) sizeof( uint32_t ) );\r
\r
/* Create the test task. The queue used by the test task is created inside\r
the task itself. */\r
static void prvQueueOverwriteTask( void *pvParameters )\r
{\r
QueueHandle_t xTaskQueue;\r
-const unsigned portBASE_TYPE uxQueueLength = 1;\r
-unsigned long ulValue, ulStatus = pdPASS, x;\r
+const UBaseType_t uxQueueLength = 1;\r
+uint32_t ulValue, ulStatus = pdPASS, x;\r
\r
/* The parameter is not used. */\r
( void ) pvParameters;\r
\r
/* Create the queue. xQueueOverwrite() should only be used on queues that\r
have a length of 1. */\r
- xTaskQueue = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( unsigned long ) );\r
+ xTaskQueue = xQueueCreate( uxQueueLength, ( UBaseType_t ) sizeof( uint32_t ) );\r
configASSERT( xTaskQueue );\r
\r
for( ;; )\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xIsQueueOverwriteTaskStillRunning( void )\r
+BaseType_t xIsQueueOverwriteTaskStillRunning( void )\r
{\r
-portBASE_TYPE xReturn;\r
+BaseType_t xReturn;\r
\r
if( xISRTestStatus != pdPASS )\r
{\r
\r
void vQueueOverwritePeriodicISRDemo( void )\r
{\r
-static unsigned long ulCallCount = 0;\r
-const unsigned long ulTx1 = 10UL, ulTx2 = 20UL, ulNumberOfSwitchCases = 3UL;\r
-unsigned long ulRx;\r
+static uint32_t ulCallCount = 0;\r
+const uint32_t ulTx1 = 10UL, ulTx2 = 20UL, ulNumberOfSwitchCases = 3UL;\r
+uint32_t ulRx;\r
\r
/* This function should be called from an interrupt, such as the tick hook\r
function vApplicationTickHook(). */\r
* range of the value being used to distinguish between the two message\r
* sources.\r
*/\r
-static void prvCheckReceivedValue( unsigned long ulReceived );\r
+static void prvCheckReceivedValue( uint32_t ulReceived );\r
\r
/*\r
* For purposes of test coverage, functions that read from and write to a\r
* Checks a value received from a queue falls within the range of expected\r
* values.\r
*/\r
-static portBASE_TYPE prvCheckReceivedValueWithinExpectedRange( unsigned long ulReceived, unsigned long ulExpectedReceived );\r
+static BaseType_t prvCheckReceivedValueWithinExpectedRange( uint32_t ulReceived, uint32_t ulExpectedReceived );\r
\r
/*\r
* Increase test coverage by occasionally change the priorities of the two tasks\r
* Local pseudo random number seed and return functions. Used to avoid calls\r
* to the standard library.\r
*/\r
-static unsigned long prvRand( void );\r
-static void prvSRand( unsigned long ulSeed );\r
+static uint32_t prvRand( void );\r
+static void prvSRand( uint32_t ulSeed );\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Counts how many times each queue in the set is used to ensure all the\r
queues are used. */\r
-static unsigned long ulQueueUsedCounter[ queuesetNUM_QUEUES_IN_SET ] = { 0 };\r
+static uint32_t ulQueueUsedCounter[ queuesetNUM_QUEUES_IN_SET ] = { 0 };\r
\r
/* The handle of the queue set to which the queues are added. */\r
static QueueSetHandle_t xQueueSet;\r
xAreQueueSetTasksStillRunning() returns pdPASS if the value of\r
ulCycleCounter has changed between consecutive calls, and pdFALSE if\r
ulCycleCounter has stopped incrementing (indicating an error condition). */\r
-static volatile unsigned long ulCycleCounter = 0UL;\r
+static volatile uint32_t ulCycleCounter = 0UL;\r
\r
/* Set to pdFAIL if an error is detected by any queue set task.\r
ulCycleCounter will only be incremented if xQueueSetTasksSatus equals pdPASS. */\r
-static volatile portBASE_TYPE xQueueSetTasksStatus = pdPASS;\r
+static volatile BaseType_t xQueueSetTasksStatus = pdPASS;\r
\r
/* Just a flag to let the function that writes to a queue from an ISR know that\r
the queues are setup and can be used. */\r
-static volatile portBASE_TYPE xSetupComplete = pdFALSE;\r
+static volatile BaseType_t xSetupComplete = pdFALSE;\r
\r
/* The value sent to the queue from the ISR is file scope so the\r
xAreQueeuSetTasksStillRunning() function can check it is incrementing as\r
expected. */\r
-static volatile unsigned long ulISRTxValue = queuesetINITIAL_ISR_TX_VALUE;\r
+static volatile uint32_t ulISRTxValue = queuesetINITIAL_ISR_TX_VALUE;\r
\r
/* Used by the pseudo random number generator. */\r
-static unsigned long ulNextRand = 0;\r
+static uint32_t ulNextRand = 0;\r
\r
/* The task handles are stored so their priorities can be changed. */\r
TaskHandle_t xQueueSetSendingTask, xQueueSetReceivingTask;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreQueueSetTasksStillRunning( void )\r
+BaseType_t xAreQueueSetTasksStillRunning( void )\r
{\r
-static unsigned long ulLastCycleCounter, ulLastISRTxValue = 0;\r
-static unsigned long ulLastQueueUsedCounter[ queuesetNUM_QUEUES_IN_SET ] = { 0 };\r
-portBASE_TYPE xReturn = pdPASS, x;\r
+static uint32_t ulLastCycleCounter, ulLastISRTxValue = 0;\r
+static uint32_t ulLastQueueUsedCounter[ queuesetNUM_QUEUES_IN_SET ] = { 0 };\r
+BaseType_t xReturn = pdPASS, x;\r
\r
if( ulLastCycleCounter == ulCycleCounter )\r
{\r
\r
static void prvQueueSetSendingTask( void *pvParameters )\r
{\r
-unsigned long ulTaskTxValue = 0, ulQueueToWriteTo;\r
+uint32_t ulTaskTxValue = 0, ulQueueToWriteTo;\r
QueueHandle_t xQueueInUse;\r
\r
/* Remove compiler warning about the unused parameter. */\r
( void ) pvParameters;\r
\r
/* Seed mini pseudo random number generator. */\r
- prvSRand( ( unsigned long ) &ulTaskTxValue );\r
+ prvSRand( ( uint32_t ) &ulTaskTxValue );\r
\r
for( ;; )\r
{\r
\r
static void prvChangeRelativePriorities( void )\r
{\r
-static unsigned portBASE_TYPE ulLoops = 0;\r
+static UBaseType_t ulLoops = 0;\r
static eRelativePriorities ePriorities = eEqualPriority;\r
\r
/* Occasionally change the task priority relative to the priority of\r
\r
static void prvQueueSetReceivingTask( void *pvParameters )\r
{\r
-unsigned long ulReceived;\r
+uint32_t ulReceived;\r
QueueHandle_t xActivatedQueue;\r
\r
/* Remove compiler warnings. */\r
\r
void vQueueSetAccessQueueSetFromISR( void )\r
{\r
-static unsigned long ulCallCount = 0;\r
+static uint32_t ulCallCount = 0;\r
\r
/* xSetupComplete is set to pdTRUE when the queues have been created and\r
are available for use. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvCheckReceivedValue( unsigned long ulReceived )\r
+static void prvCheckReceivedValue( uint32_t ulReceived )\r
{\r
-static unsigned long ulExpectedReceivedFromTask = 0, ulExpectedReceivedFromISR = queuesetINITIAL_ISR_TX_VALUE;\r
+static uint32_t ulExpectedReceivedFromTask = 0, ulExpectedReceivedFromISR = queuesetINITIAL_ISR_TX_VALUE;\r
\r
/* Values are received in tasks and interrupts. It is likely that the\r
receiving task will sometimes get preempted by the receiving interrupt\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static portBASE_TYPE prvCheckReceivedValueWithinExpectedRange( unsigned long ulReceived, unsigned long ulExpectedReceived )\r
+static BaseType_t prvCheckReceivedValueWithinExpectedRange( uint32_t ulReceived, uint32_t ulExpectedReceived )\r
{\r
-portBASE_TYPE xReturn = pdPASS;\r
+BaseType_t xReturn = pdPASS;\r
\r
if( ulReceived > ulExpectedReceived )\r
{\r
static void prvReceiveFromQueueInSetFromISR( void )\r
{\r
QueueSetMemberHandle_t xActivatedQueue;\r
-unsigned long ulReceived;\r
+uint32_t ulReceived;\r
\r
/* See if any of the queues in the set contain data. */\r
xActivatedQueue = xQueueSelectFromSetFromISR( xQueueSet );\r
\r
static void prvSendToQueueInSetFromISR( void )\r
{\r
-static portBASE_TYPE xQueueToWriteTo = 0;\r
+static BaseType_t xQueueToWriteTo = 0;\r
\r
if( xQueueSendFromISR( xQueues[ xQueueToWriteTo ], ( void * ) &ulISRTxValue, NULL ) == pdPASS )\r
{\r
\r
static void prvSetupTest( void )\r
{\r
-portBASE_TYPE x;\r
-unsigned long ulValueToSend = 0;\r
+BaseType_t x;\r
+uint32_t ulValueToSend = 0;\r
\r
/* Ensure the queues are created and the queue set configured before the\r
sending task is unsuspended.\r
for( x = 0; x < queuesetNUM_QUEUES_IN_SET; x++ )\r
{\r
/* Create the queue and add it to the set. The queue is just holding\r
- unsigned long value. */\r
- xQueues[ x ] = xQueueCreate( queuesetQUEUE_LENGTH, sizeof( unsigned long ) );\r
+ uint32_t value. */\r
+ xQueues[ x ] = xQueueCreate( queuesetQUEUE_LENGTH, sizeof( uint32_t ) );\r
configASSERT( xQueues[ x ] );\r
if( xQueueAddToSet( xQueues[ x ], xQueueSet ) != pdPASS )\r
{\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static unsigned long prvRand( void )\r
+static uint32_t prvRand( void )\r
{\r
ulNextRand = ( ulNextRand * 1103515245UL ) + 12345UL;\r
return ( ulNextRand / 65536UL ) % 32768UL;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvSRand( unsigned long ulSeed )\r
+static void prvSRand( uint32_t ulSeed )\r
{\r
ulNextRand = ulSeed;\r
}\r
\r
#define tmrdemoDONT_BLOCK ( ( TickType_t ) 0 )\r
#define tmrdemoONE_SHOT_TIMER_PERIOD ( xBasePeriod * ( TickType_t ) 3 )\r
-#define trmdemoNUM_TIMER_RESETS ( ( unsigned char ) 10 )\r
+#define trmdemoNUM_TIMER_RESETS ( ( uint8_t ) 10 )\r
\r
/*-----------------------------------------------------------*/\r
\r
\r
/* Flag that will be latched to pdFAIL should any unexpected behaviour be\r
detected in any of the demo tests. */\r
-static volatile portBASE_TYPE xTestStatus = pdPASS;\r
+static volatile BaseType_t xTestStatus = pdPASS;\r
\r
/* Counter that is incremented on each cycle of a test. This is used to\r
detect a stalled task - a test that is no longer running. */\r
-static volatile unsigned long ulLoopCounter = 0;\r
+static volatile uint32_t ulLoopCounter = 0;\r
\r
/* A set of auto reload timers - each of which use the same callback function.\r
The callback function uses the timer ID to index into, and then increment, a\r
counter in the ucAutoReloadTimerCounters[] array. The auto reload timers\r
referenced from xAutoReloadTimers[] are used by the prvTimerTestTask task. */\r
static TimerHandle_t xAutoReloadTimers[ configTIMER_QUEUE_LENGTH + 1 ] = { 0 };\r
-static unsigned char ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH + 1 ] = { 0 };\r
+static uint8_t ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH + 1 ] = { 0 };\r
\r
/* The one shot timer is configured to use a callback function that increments\r
ucOneShotTimerCounter each time it gets called. */\r
static TimerHandle_t xOneShotTimer = NULL;\r
-static unsigned char ucOneShotTimerCounter = ( unsigned char ) 0;\r
+static uint8_t ucOneShotTimerCounter = ( uint8_t ) 0;\r
\r
/* The ISR reload timer is controlled from the tick hook to exercise the timer\r
API functions that can be used from an ISR. It is configured to increment\r
ucISRReloadTimerCounter each time its callback function is executed. */\r
static TimerHandle_t xISRAutoReloadTimer = NULL;\r
-static unsigned char ucISRAutoReloadTimerCounter = ( unsigned char ) 0;\r
+static uint8_t ucISRAutoReloadTimerCounter = ( uint8_t ) 0;\r
\r
/* The ISR one shot timer is controlled from the tick hook to exercise the timer\r
API functions that can be used from an ISR. It is configured to increment\r
ucISRReloadTimerCounter each time its callback function is executed. */\r
static TimerHandle_t xISROneShotTimer = NULL;\r
-static unsigned char ucISROneShotTimerCounter = ( unsigned char ) 0;\r
+static uint8_t ucISROneShotTimerCounter = ( uint8_t ) 0;\r
\r
/* The period of all the timers are a multiple of the base period. The base\r
period is configured by the parameter to vStartTimerDemoTask(). */\r
\r
/* This is called to check that the created task is still running and has not\r
detected any errors. */\r
-portBASE_TYPE xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency )\r
+BaseType_t xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency )\r
{\r
-static unsigned long ulLastLoopCounter = 0UL;\r
+static uint32_t ulLastLoopCounter = 0UL;\r
TickType_t xMaxBlockTimeUsedByTheseTests, xLoopCounterIncrementTimeMax;\r
static TickType_t xIterationsWithoutCounterIncrement = ( TickType_t ) 0, xLastCycleFrequency;\r
\r
\r
static void prvTest1_CreateTimersWithoutSchedulerRunning( void )\r
{\r
-unsigned portBASE_TYPE xTimer;\r
+UBaseType_t xTimer;\r
\r
for( xTimer = 0; xTimer < configTIMER_QUEUE_LENGTH; xTimer++ )\r
{\r
\r
static void prvTest2_CheckTaskAndTimersInitialState( void )\r
{\r
-unsigned char ucTimer;\r
+uint8_t ucTimer;\r
\r
/* Ensure all the timers are in their expected initial state. This depends\r
on the timer service task having a higher priority than this task.\r
and auto reload timer configTIMER_QUEUE_LENGTH should not yet be active (it\r
could not be started prior to the scheduler being started when it was\r
created). */\r
- for( ucTimer = 0; ucTimer < ( unsigned char ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
+ for( ucTimer = 0; ucTimer < ( uint8_t ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
{\r
if( xTimerIsTimerActive( xAutoReloadTimers[ ucTimer ] ) == pdFALSE )\r
{\r
\r
static void prvTest3_CheckAutoReloadExpireRates( void )\r
{\r
-unsigned char ucMaxAllowableValue, ucMinAllowableValue, ucTimer;\r
+uint8_t ucMaxAllowableValue, ucMinAllowableValue, ucTimer;\r
TickType_t xBlockPeriod, xTimerPeriod, xExpectedNumber;\r
\r
/* Check the auto reload timers expire at the expected rates. */\r
\r
/* Check that all the auto reload timers have called their callback \r
function the expected number of times. */\r
- for( ucTimer = 0; ucTimer < ( unsigned char ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
+ for( ucTimer = 0; ucTimer < ( uint8_t ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
{\r
/* The expected number of expiries is equal to the block period divided\r
by the timer period. */\r
xTimerPeriod = ( ( ( TickType_t ) ucTimer + ( TickType_t ) 1 ) * xBasePeriod );\r
xExpectedNumber = xBlockPeriod / xTimerPeriod;\r
\r
- ucMaxAllowableValue = ( ( unsigned char ) xExpectedNumber ) ;\r
- ucMinAllowableValue = ( unsigned char ) ( ( unsigned char ) xExpectedNumber - ( unsigned char ) 1 ); /* Weird casting to try and please all compilers. */\r
+ ucMaxAllowableValue = ( ( uint8_t ) xExpectedNumber ) ;\r
+ ucMinAllowableValue = ( uint8_t ) ( ( uint8_t ) xExpectedNumber - ( uint8_t ) 1 ); /* Weird casting to try and please all compilers. */\r
\r
if( ( ucAutoReloadTimerCounters[ ucTimer ] < ucMinAllowableValue ) ||\r
( ucAutoReloadTimerCounters[ ucTimer ] > ucMaxAllowableValue )\r
\r
static void prvTest4_CheckAutoReloadTimersCanBeStopped( void )\r
{ \r
-unsigned char ucTimer;\r
+uint8_t ucTimer;\r
\r
/* Check the auto reload timers can be stopped correctly, and correctly\r
report their state. */\r
\r
/* Stop all the active timers. */\r
- for( ucTimer = 0; ucTimer < ( unsigned char ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
+ for( ucTimer = 0; ucTimer < ( uint8_t ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
{\r
/* The timer has not been stopped yet! */\r
if( xTimerIsTimerActive( xAutoReloadTimers[ ucTimer ] ) == pdFALSE )\r
be active. The critical section is used to ensure the timer does\r
not call its callback between the next line running and the array\r
being cleared back to zero, as that would mask an error condition. */\r
- if( ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH ] != ( unsigned char ) 0 )\r
+ if( ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH ] != ( uint8_t ) 0 )\r
{\r
xTestStatus = pdFAIL;\r
configASSERT( xTestStatus );\r
/* The timers are now all inactive, so this time, after delaying, none\r
of the callback counters should have incremented. */\r
vTaskDelay( ( ( TickType_t ) configTIMER_QUEUE_LENGTH ) * xBasePeriod );\r
- for( ucTimer = 0; ucTimer < ( unsigned char ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
+ for( ucTimer = 0; ucTimer < ( uint8_t ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
{\r
- if( ucAutoReloadTimerCounters[ ucTimer ] != ( unsigned char ) 0 )\r
+ if( ucAutoReloadTimerCounters[ ucTimer ] != ( uint8_t ) 0 )\r
{\r
xTestStatus = pdFAIL;\r
configASSERT( xTestStatus );\r
configASSERT( xTestStatus );\r
}\r
\r
- if( ucOneShotTimerCounter != ( unsigned char ) 0 )\r
+ if( ucOneShotTimerCounter != ( uint8_t ) 0 )\r
{\r
xTestStatus = pdFAIL;\r
configASSERT( xTestStatus );\r
configASSERT( xTestStatus );\r
}\r
\r
- if( ucOneShotTimerCounter != ( unsigned char ) 1 )\r
+ if( ucOneShotTimerCounter != ( uint8_t ) 1 )\r
{\r
xTestStatus = pdFAIL;\r
configASSERT( xTestStatus );\r
else\r
{\r
/* Reset the one shot timer callback count. */\r
- ucOneShotTimerCounter = ( unsigned char ) 0;\r
+ ucOneShotTimerCounter = ( uint8_t ) 0;\r
}\r
\r
if( xTestStatus == pdPASS )\r
\r
static void prvTest6_CheckAutoReloadResetBehaviour( void )\r
{\r
-unsigned char ucTimer;\r
+uint8_t ucTimer;\r
\r
/* Check timer reset behaviour. */\r
\r
configASSERT( xTestStatus );\r
}\r
\r
- if( ucOneShotTimerCounter != ( unsigned char ) 0 )\r
+ if( ucOneShotTimerCounter != ( uint8_t ) 0 )\r
{\r
xTestStatus = pdFAIL;\r
configASSERT( xTestStatus );\r
configASSERT( xTestStatus );\r
}\r
\r
- if( ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH - 1 ] != ( unsigned char ) 0 )\r
+ if( ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH - 1 ] != ( uint8_t ) 0 )\r
{\r
xTestStatus = pdFAIL;\r
configASSERT( xTestStatus );\r
\r
/* The timers were not reset during the above delay period so should now\r
both have called their callback functions. */\r
- if( ucOneShotTimerCounter != ( unsigned char ) 1 )\r
+ if( ucOneShotTimerCounter != ( uint8_t ) 1 )\r
{\r
xTestStatus = pdFAIL;\r
configASSERT( xTestStatus );\r
\r
/* Clear the timer callback counts, ready for another iteration of these\r
tests. */\r
- ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH - 1 ] = ( unsigned char ) 0;\r
- ucOneShotTimerCounter = ( unsigned char ) 0;\r
+ ucAutoReloadTimerCounters[ configTIMER_QUEUE_LENGTH - 1 ] = ( uint8_t ) 0;\r
+ ucOneShotTimerCounter = ( uint8_t ) 0;\r
\r
if( xTestStatus == pdPASS )\r
{\r
\r
static void prvResetStartConditionsForNextIteration( void )\r
{\r
-unsigned char ucTimer;\r
+uint8_t ucTimer;\r
\r
/* Start the timers again to start all the tests over again. */\r
\r
/* Start the timers again. */\r
- for( ucTimer = 0; ucTimer < ( unsigned char ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
+ for( ucTimer = 0; ucTimer < ( uint8_t ) configTIMER_QUEUE_LENGTH; ucTimer++ )\r
{\r
/* The timer has not been started yet! */\r
if( xTimerIsTimerActive( xAutoReloadTimers[ ucTimer ] ) != pdFALSE )\r
\r
static void prvAutoReloadTimerCallback( TimerHandle_t pxExpiredTimer )\r
{\r
-unsigned long ulTimerID;\r
+uint32_t ulTimerID;\r
\r
- ulTimerID = ( unsigned long ) pvTimerGetTimerID( pxExpiredTimer );\r
+ ulTimerID = ( uint32_t ) pvTimerGetTimerID( pxExpiredTimer );\r
if( ulTimerID <= ( configTIMER_QUEUE_LENGTH + 1 ) )\r
{\r
( ucAutoReloadTimerCounters[ ulTimerID ] )++;\r
#define bktALLOWABLE_MARGIN ( 15 )\r
#define bktTIME_TO_BLOCK ( 175 )\r
#define bktDONT_BLOCK ( ( TickType_t ) 0 )\r
-#define bktRUN_INDICATOR ( ( unsigned portBASE_TYPE ) 0x55 )\r
+#define bktRUN_INDICATOR ( ( UBaseType_t ) 0x55 )\r
\r
/* The queue on which the tasks block. */\r
static QueueHandle_t xTestQueue;\r
static TaskHandle_t xSecondary;\r
\r
/* Used to ensure that tasks are still executing without error. */\r
-static volatile portBASE_TYPE xPrimaryCycles = 0, xSecondaryCycles = 0;\r
-static volatile portBASE_TYPE xErrorOccurred = pdFALSE;\r
+static volatile BaseType_t xPrimaryCycles = 0, xSecondaryCycles = 0;\r
+static volatile BaseType_t xErrorOccurred = pdFALSE;\r
\r
/* Provides a simple mechanism for the primary task to know when the\r
secondary task has executed. */\r
-static volatile unsigned portBASE_TYPE xRunIndicator;\r
+static volatile UBaseType_t xRunIndicator;\r
\r
/* The two test tasks. Their behaviour is commented within the files. */\r
static void vPrimaryBlockTimeTestTask( void *pvParameters );\r
void vCreateBlockTimeTasks( void )\r
{\r
/* Create the queue on which the two tasks block. */\r
- xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( portBASE_TYPE ) );\r
+ xTestQueue = xQueueCreate( bktQUEUE_LENGTH, sizeof( BaseType_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware\r
\r
static void vPrimaryBlockTimeTestTask( void *pvParameters )\r
{\r
-portBASE_TYPE xItem, xData;\r
+BaseType_t xItem, xData;\r
TickType_t xTimeWhenBlocking;\r
TickType_t xTimeToBlock, xBlockedTime;\r
\r
static void vSecondaryBlockTimeTestTask( void *pvParameters )\r
{\r
TickType_t xTimeWhenBlocking, xBlockedTime;\r
-portBASE_TYPE xData;\r
+BaseType_t xData;\r
\r
( void ) pvParameters;\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreBlockTimeTestTasksStillRunning( void )\r
+BaseType_t xAreBlockTimeTestTasksStillRunning( void )\r
{\r
-static portBASE_TYPE xLastPrimaryCycleCount = 0, xLastSecondaryCycleCount = 0;\r
-portBASE_TYPE xReturn = pdPASS;\r
+static BaseType_t xLastPrimaryCycleCount = 0, xLastSecondaryCycleCount = 0;\r
+BaseType_t xReturn = pdPASS;\r
\r
/* Have both tasks performed at least one cycle since this function was\r
last called? */\r
#define comFIRST_BYTE ( 'A' )\r
#define comLAST_BYTE ( 'X' )\r
\r
-#define comBUFFER_LEN ( ( unsigned portBASE_TYPE ) ( comLAST_BYTE - comFIRST_BYTE ) + ( unsigned portBASE_TYPE ) 1 )\r
+#define comBUFFER_LEN ( ( UBaseType_t ) ( comLAST_BYTE - comFIRST_BYTE ) + ( UBaseType_t ) 1 )\r
#define comINITIAL_RX_COUNT_VALUE ( 0 )\r
\r
/* Handle to the com port used by both tasks. */\r
/* The LED that should be toggled by the Rx and Tx tasks. The Rx task will\r
toggle LED ( uxBaseLED + comRX_LED_OFFSET). The Tx task will toggle LED\r
( uxBaseLED + comTX_LED_OFFSET ). */\r
-static unsigned portBASE_TYPE uxBaseLED = 0;\r
+static UBaseType_t uxBaseLED = 0;\r
\r
/* Check variable used to ensure no error have occurred. The Rx task will\r
increment this variable after every successfully received sequence. If at any\r
time the sequence is incorrect the the variable will stop being incremented. */\r
-static volatile unsigned portBASE_TYPE uxRxLoops = comINITIAL_RX_COUNT_VALUE;\r
+static volatile UBaseType_t uxRxLoops = comINITIAL_RX_COUNT_VALUE;\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vAltStartComTestTasks( unsigned portBASE_TYPE uxPriority, unsigned long ulBaudRate, unsigned portBASE_TYPE uxLED )\r
+void vAltStartComTestTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED )\r
{\r
/* Initialise the com port then spawn the Rx and Tx tasks. */\r
uxBaseLED = uxLED;\r
static portTASK_FUNCTION( vComRxTask, pvParameters )\r
{\r
signed char cExpectedByte, cByteRxed;\r
-portBASE_TYPE xResyncRequired = pdFALSE, xErrorOccurred = pdFALSE;\r
+BaseType_t xResyncRequired = pdFALSE, xErrorOccurred = pdFALSE;\r
\r
/* Just to stop compiler warnings. */\r
( void ) pvParameters;\r
} /*lint !e715 !e818 pvParameters is required for a task function even if it is not referenced. */\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreComTestTasksStillRunning( void )\r
+BaseType_t xAreComTestTasksStillRunning( void )\r
{\r
-portBASE_TYPE xReturn;\r
+BaseType_t xReturn;\r
\r
/* If the count of successful reception loops has not changed than at\r
some time an error occurred (i.e. a character was received out of sequence)\r
\r
/* The Rx task will toggle LED ( uxBaseLED + comRX_LED_OFFSET). The Tx task\r
will toggle LED ( uxBaseLED + comTX_LED_OFFSET ). */\r
-static unsigned portBASE_TYPE uxBaseLED = 0;\r
+static UBaseType_t uxBaseLED = 0;\r
\r
/* The Rx task toggles uxRxLoops on each successful iteration of its defined\r
function - provided no errors have ever been latched. If this variable stops\r
incrementing, then an error has occurred. */\r
-static volatile unsigned portBASE_TYPE uxRxLoops = 0UL;\r
+static volatile UBaseType_t uxRxLoops = 0UL;\r
\r
/* The timer used to periodically transmit the string. This is the timer that\r
has prvComTxTimerCallback allocated to it as its callback function. */\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartComTestStringsTasks( unsigned portBASE_TYPE uxPriority, unsigned long ulBaudRate, unsigned portBASE_TYPE uxLED )\r
+void vStartComTestStringsTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED )\r
{\r
/* Store values that are used at run time. */\r
uxBaseLED = uxLED;\r
\r
static void vComRxTask( void *pvParameters )\r
{\r
-portBASE_TYPE xState = comtstWAITING_START_OF_STRING, xErrorOccurred = pdFALSE;\r
+BaseType_t xState = comtstWAITING_START_OF_STRING, xErrorOccurred = pdFALSE;\r
char *pcExpectedByte, cRxedChar;\r
const xComPortHandle xPort = NULL;\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreComTestTasksStillRunning( void )\r
+BaseType_t xAreComTestTasksStillRunning( void )\r
{\r
-portBASE_TYPE xReturn;\r
+BaseType_t xReturn;\r
\r
/* If the count of successful reception loops has not changed than at\r
some time an error occurred (i.e. a character was received out of sequence)\r
\r
/* Flag that will be latched to pdTRUE should any unexpected behaviour be\r
detected in any of the tasks. */\r
-static volatile portBASE_TYPE xErrorDetected = pdFALSE;\r
+static volatile BaseType_t xErrorDetected = pdFALSE;\r
\r
/*-----------------------------------------------------------*/\r
\r
* Utility function to increment the semaphore count value up from zero to\r
* countMAX_COUNT_VALUE.\r
*/\r
-static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter );\r
+static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter );\r
\r
/*\r
* Utility function to decrement the semaphore count value up from \r
* countMAX_COUNT_VALUE to zero.\r
*/\r
-static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter );\r
+static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter );\r
\r
/*-----------------------------------------------------------*/\r
\r
/* Set to countSTART_AT_MAX_COUNT if the semaphore should be created with\r
its count value set to its max count value, or countSTART_AT_ZERO if it\r
should have been created with its count value set to 0. */\r
- unsigned portBASE_TYPE uxExpectedStartCount; \r
+ UBaseType_t uxExpectedStartCount; \r
\r
/* Incremented on each cycle of the demo task. Used to detect a stalled\r
task. */\r
- unsigned portBASE_TYPE uxLoopCounter; \r
+ UBaseType_t uxLoopCounter; \r
} xCountSemStruct;\r
\r
/* Two structures are defined, one is passed to each test task. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter )\r
+static void prvDecrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter )\r
{\r
-unsigned portBASE_TYPE ux;\r
+UBaseType_t ux;\r
\r
/* If the semaphore count is at its maximum then we should not be able to\r
'give' the semaphore. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, unsigned portBASE_TYPE *puxLoopCounter )\r
+static void prvIncrementSemaphoreCount( SemaphoreHandle_t xSemaphore, UBaseType_t *puxLoopCounter )\r
{\r
-unsigned portBASE_TYPE ux;\r
+UBaseType_t ux;\r
\r
/* If the semaphore count is zero then we should not be able to 'take' \r
the semaphore. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreCountingSemaphoreTasksStillRunning( void )\r
+BaseType_t xAreCountingSemaphoreTasksStillRunning( void )\r
{\r
-static unsigned portBASE_TYPE uxLastCount0 = 0, uxLastCount1 = 0;\r
-portBASE_TYPE xReturn = pdPASS;\r
+static UBaseType_t uxLastCount0 = 0, uxLastCount1 = 0;\r
+BaseType_t xReturn = pdPASS;\r
\r
/* Return fail if any 'give' or 'take' did not result in the expected\r
behaviour. */\r
/*\r
* The 'fixed delay' co-routine as described at the top of the file.\r
*/\r
-static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex );\r
+static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex );\r
\r
/*\r
* The 'flash' co-routine as described at the top of the file.\r
*/\r
-static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex );\r
+static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex );\r
\r
/* The queue used to pass data between the 'fixed delay' co-routines and the\r
'flash' co-routine. */\r
static QueueHandle_t xFlashQueue;\r
\r
/* This will be set to pdFALSE if we detect an error. */\r
-static portBASE_TYPE xCoRoutineFlashStatus = pdPASS;\r
+static BaseType_t xCoRoutineFlashStatus = pdPASS;\r
\r
/*-----------------------------------------------------------*/\r
\r
/*\r
* See the header file for details.\r
*/\r
-void vStartFlashCoRoutines( unsigned portBASE_TYPE uxNumberToCreate )\r
+void vStartFlashCoRoutines( UBaseType_t uxNumberToCreate )\r
{\r
-unsigned portBASE_TYPE uxIndex;\r
+UBaseType_t uxIndex;\r
\r
if( uxNumberToCreate > crfMAX_FLASH_TASKS )\r
{\r
}\r
\r
/* Create the queue used to pass data between the co-routines. */\r
- xFlashQueue = xQueueCreate( crfQUEUE_LENGTH, sizeof( unsigned portBASE_TYPE ) );\r
+ xFlashQueue = xQueueCreate( crfQUEUE_LENGTH, sizeof( UBaseType_t ) );\r
\r
if( xFlashQueue )\r
{\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
+static void prvFixedDelayCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )\r
{\r
/* Even though this is a co-routine the xResult variable does not need to be\r
static as we do not need it to maintain its state between blocks. */\r
-signed portBASE_TYPE xResult;\r
+BaseType_t xResult;\r
/* The uxIndex parameter of the co-routine function is used as an index into\r
the xFlashRates array to obtain the delay period to use. */\r
static const TickType_t xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_PERIOD_MS,\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
+static void prvFlashCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )\r
{\r
/* Even though this is a co-routine the variable do not need to be\r
static as we do not need it to maintain their state between blocks. */\r
-signed portBASE_TYPE xResult;\r
-unsigned portBASE_TYPE uxLEDToFlash;\r
+BaseType_t xResult;\r
+UBaseType_t uxLEDToFlash;\r
\r
/* Co-routines MUST start with a call to crSTART. */\r
crSTART( xHandle );\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreFlashCoRoutinesStillRunning( void )\r
+BaseType_t xAreFlashCoRoutinesStillRunning( void )\r
{\r
/* Return pdPASS or pdFAIL depending on whether an error has been detected\r
or not. */\r
/*\r
* The co-routine function itself.\r
*/\r
-static void prvHookCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex );\r
+static void prvHookCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex );\r
\r
\r
/*\r
static QueueHandle_t xHookTxQueues[ hookNUM_HOOK_CO_ROUTINES ];\r
\r
/* Set to true if an error is detected at any time. */\r
-static portBASE_TYPE xCoRoutineErrorDetected = pdFALSE;\r
+static BaseType_t xCoRoutineErrorDetected = pdFALSE;\r
\r
/*-----------------------------------------------------------*/\r
\r
void vStartHookCoRoutines( void )\r
{\r
-unsigned portBASE_TYPE uxIndex, uxValueToPost = 0;\r
+UBaseType_t uxIndex, uxValueToPost = 0;\r
\r
for( uxIndex = 0; uxIndex < hookNUM_HOOK_CO_ROUTINES; uxIndex++ )\r
{\r
/* Create a queue to transmit to and receive from each 'hook' \r
co-routine. */\r
- xHookRxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( unsigned portBASE_TYPE ) );\r
- xHookTxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( unsigned portBASE_TYPE ) );\r
+ xHookRxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( UBaseType_t ) );\r
+ xHookTxQueues[ uxIndex ] = xQueueCreate( hookHOOK_QUEUE_LENGTH, sizeof( UBaseType_t ) );\r
\r
/* To start things off the tick hook function expects the queue it \r
uses to receive data to contain a value. */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static unsigned portBASE_TYPE uxCallCounter = 0, uxNumberToPost = 0;\r
+static UBaseType_t uxCallCounter = 0, uxNumberToPost = 0;\r
void vApplicationTickHook( void )\r
{\r
-unsigned portBASE_TYPE uxReceivedNumber;\r
-signed portBASE_TYPE xIndex, xCoRoutineWoken;\r
+UBaseType_t uxReceivedNumber;\r
+BaseType_t xIndex, xCoRoutineWoken;\r
\r
/* Is it time to talk to the 'hook' co-routines again? */\r
uxCallCounter++;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvHookCoRoutine( CoRoutineHandle_t xHandle, unsigned portBASE_TYPE uxIndex )\r
+static void prvHookCoRoutine( CoRoutineHandle_t xHandle, UBaseType_t uxIndex )\r
{\r
-static unsigned portBASE_TYPE uxReceivedValue[ hookNUM_HOOK_CO_ROUTINES ];\r
-portBASE_TYPE xResult;\r
+static UBaseType_t uxReceivedValue[ hookNUM_HOOK_CO_ROUTINES ];\r
+BaseType_t xResult;\r
\r
/* Each co-routine MUST start with a call to crSTART(); */\r
crSTART( xHandle );\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xAreHookCoRoutinesStillRunning( void )\r
+BaseType_t xAreHookCoRoutinesStillRunning( void )\r
{\r
if( xCoRoutineErrorDetected )\r
{\r
\r
/* A variable which is incremented every time the dynamic tasks are created. This\r
is used to check that the task is still running. */\r
-static volatile unsigned short usCreationCount = 0;\r
+static volatile uint16_t usCreationCount = 0;\r
\r
/* Used to store the number of tasks that were originally running so the creator\r
task can tell if any of the suicidal tasks have failed to die.\r
*/\r
-static volatile unsigned portBASE_TYPE uxTasksRunningAtStart = 0;\r
+static volatile UBaseType_t uxTasksRunningAtStart = 0;\r
\r
/* Tasks are deleted by the idle task. Under heavy load the idle task might\r
not get much processing time, so it would be legitimate for several tasks to\r
remain undeleted for a short period. */\r
-static const unsigned portBASE_TYPE uxMaxNumberOfExtraTasksRunning = 3;\r
+static const UBaseType_t uxMaxNumberOfExtraTasksRunning = 3;\r
\r
/* Used to store a handle to the task that should be killed by a suicidal task,\r
before it kills itself. */\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vCreateSuicidalTasks( unsigned portBASE_TYPE uxPriority )\r
+void vCreateSuicidalTasks( UBaseType_t uxPriority )\r
{\r
-unsigned portBASE_TYPE *puxPriority;\r
+UBaseType_t *puxPriority;\r
\r
/* Create the Creator tasks - passing in as a parameter the priority at which\r
the suicidal tasks should be created. */\r
- puxPriority = ( unsigned portBASE_TYPE * ) pvPortMalloc( sizeof( unsigned portBASE_TYPE ) );\r
+ puxPriority = ( UBaseType_t * ) pvPortMalloc( sizeof( UBaseType_t ) );\r
*puxPriority = uxPriority;\r
\r
xTaskCreate( vCreateTasks, "CREATOR", deathSTACK_SIZE, ( void * ) puxPriority, uxPriority, NULL );\r
\r
/* Record the number of tasks that are running now so we know if any of the\r
suicidal tasks have failed to be killed. */\r
- uxTasksRunningAtStart = ( unsigned portBASE_TYPE ) uxTaskGetNumberOfTasks();\r
+ uxTasksRunningAtStart = ( UBaseType_t ) uxTaskGetNumberOfTasks();\r
\r
/* FreeRTOS.org versions before V3.0 started the idle-task as the very\r
first task. The idle task was then already included in uxTasksRunningAtStart.\r
static portTASK_FUNCTION( vCreateTasks, pvParameters )\r
{\r
const TickType_t xDelay = ( TickType_t ) 1000 / portTICK_PERIOD_MS;\r
-unsigned portBASE_TYPE uxPriority;\r
+UBaseType_t uxPriority;\r
\r
- uxPriority = *( unsigned portBASE_TYPE * ) pvParameters;\r
+ uxPriority = *( UBaseType_t * ) pvParameters;\r
vPortFree( pvParameters );\r
\r
for( ;; )\r
\r
/* This is called to check that the creator task is still running and that there\r
are not any more than four extra tasks. */\r
-portBASE_TYPE xIsCreateTaskStillRunning( void )\r
+BaseType_t xIsCreateTaskStillRunning( void )\r
{\r
-static unsigned short usLastCreationCount = 0xfff;\r
-portBASE_TYPE xReturn = pdTRUE;\r
-static unsigned portBASE_TYPE uxTasksRunningNow;\r
+static uint16_t usLastCreationCount = 0xfff;\r
+BaseType_t xReturn = pdTRUE;\r
+static UBaseType_t uxTasksRunningNow;\r
\r
if( usLastCreationCount == usCreationCount )\r
{\r
usLastCreationCount = usCreationCount;\r
}\r
\r
- uxTasksRunningNow = ( unsigned portBASE_TYPE ) uxTaskGetNumberOfTasks();\r
+ uxTasksRunningNow = ( UBaseType_t ) uxTaskGetNumberOfTasks();\r
\r
if( uxTasksRunningNow < uxTasksRunningAtStart )\r
{\r
#define priSTACK_SIZE ( configMINIMAL_STACK_SIZE )\r
#define priSLEEP_TIME ( ( TickType_t ) 128 / portTICK_PERIOD_MS )\r
#define priLOOPS ( 5 )\r
-#define priMAX_COUNT ( ( unsigned long ) 0xff )\r
+#define priMAX_COUNT ( ( uint32_t ) 0xff )\r
#define priNO_BLOCK ( ( TickType_t ) 0 )\r
#define priSUSPENDED_QUEUE_LENGTH ( 1 )\r
\r
\r
/* The shared counter variable. This is passed in as a parameter to the two\r
counter variables for demonstration purposes. */\r
-static volatile unsigned long ulCounter;\r
+static volatile uint32_t ulCounter;\r
\r
/* Variables used to check that the tasks are still operating without error.\r
Each complete iteration of the controller task increments this variable\r
provided no errors have been found. The variable maintaining the same value\r
is therefore indication of an error. */\r
-static volatile unsigned short usCheckVariable = ( unsigned short ) 0;\r
-static volatile portBASE_TYPE xSuspendedQueueSendError = pdFALSE;\r
-static volatile portBASE_TYPE xSuspendedQueueReceiveError = pdFALSE;\r
+static volatile uint16_t usCheckVariable = ( uint16_t ) 0;\r
+static volatile BaseType_t xSuspendedQueueSendError = pdFALSE;\r
+static volatile BaseType_t xSuspendedQueueReceiveError = pdFALSE;\r
\r
/* Queue used by the second test. */\r
QueueHandle_t xSuspendedTestQueue;\r
/* The value the queue receive task expects to receive next. This is file\r
scope so xAreDynamicPriorityTasksStillRunning() can ensure it is still\r
incrementing. */\r
-static unsigned long ulExpectedValue = ( unsigned long ) 0;\r
+static uint32_t ulExpectedValue = ( uint32_t ) 0;\r
\r
/*-----------------------------------------------------------*/\r
/*\r
*/\r
void vStartDynamicPriorityTasks( void )\r
{\r
- xSuspendedTestQueue = xQueueCreate( priSUSPENDED_QUEUE_LENGTH, sizeof( unsigned long ) );\r
+ xSuspendedTestQueue = xQueueCreate( priSUSPENDED_QUEUE_LENGTH, sizeof( uint32_t ) );\r
\r
/* vQueueAddToRegistry() adds the queue to the queue registry, if one is\r
in use. The queue registry is provided as a means for kernel aware\r
*/\r
static portTASK_FUNCTION( vLimitedIncrementTask, pvParameters )\r
{\r
-unsigned long *pulCounter;\r
+uint32_t *pulCounter;\r
\r
/* Take a pointer to the shared variable from the parameters passed into\r
the task. */\r
- pulCounter = ( unsigned long * ) pvParameters;\r
+ pulCounter = ( uint32_t * ) pvParameters;\r
\r
/* This will run before the control task, so the first thing it does is\r
suspend - the control task will resume it when ready. */\r
*/\r
static portTASK_FUNCTION( vContinuousIncrementTask, pvParameters )\r
{\r
-volatile unsigned long *pulCounter;\r
-unsigned portBASE_TYPE uxOurPriority;\r
+volatile uint32_t *pulCounter;\r
+UBaseType_t uxOurPriority;\r
\r
/* Take a pointer to the shared variable from the parameters passed into\r
the task. */\r
- pulCounter = ( unsigned long * ) pvParameters;\r
+ pulCounter = ( uint32_t * ) pvParameters;\r
\r
/* Query our priority so we can raise it when exclusive access to the\r
shared variable is required. */\r
*/\r
static portTASK_FUNCTION( vCounterControlTask, pvParameters )\r
{\r
-unsigned long ulLastCounter;\r
+uint32_t ulLastCounter;\r
short sLoops;\r
short sError = pdFALSE;\r
\r
for( ;; )\r
{\r
/* Start with the counter at zero. */\r
- ulCounter = ( unsigned long ) 0;\r
+ ulCounter = ( uint32_t ) 0;\r
\r
/* First section : */\r
\r
vTaskSuspend( xContinuousIncrementHandle );\r
\r
/* Reset the variable. */\r
- ulCounter = ( unsigned long ) 0;\r
+ ulCounter = ( uint32_t ) 0;\r
\r
#if( INCLUDE_eTaskGetState == 1 )\r
{\r
\r
static portTASK_FUNCTION( vQueueSendWhenSuspendedTask, pvParameters )\r
{\r
-static unsigned long ulValueToSend = ( unsigned long ) 0;\r
+static uint32_t ulValueToSend = ( uint32_t ) 0;\r
\r
/* Just to stop warning messages. */\r
( void ) pvParameters;\r
\r
static portTASK_FUNCTION( vQueueReceiveWhenSuspendedTask, pvParameters )\r
{\r
-unsigned long ulReceivedValue;\r
-portBASE_TYPE xGotValue;\r
+uint32_t ulReceivedValue;\r
+BaseType_t xGotValue;\r
\r
/* Just to stop warning messages. */\r
( void ) pvParameters;\r
/*-----------------------------------------------------------*/\r
\r
/* Called to check that all the created tasks are still running without error. */\r
-portBASE_TYPE xAreDynamicPriorityTasksStillRunning( void )\r
+BaseType_t xAreDynamicPriorityTasksStillRunning( void )\r
{\r
/* Keep a history of the check variables so we know if it has been incremented\r
since the last call. */\r
-static unsigned short usLastTaskCheck = ( unsigned short ) 0;\r
-static unsigned long ulLastExpectedValue = ( unsigned long ) 0U;\r
-portBASE_TYPE xReturn = pdTRUE;\r
+static uint16_t usLastTaskCheck = ( uint16_t ) 0;\r
+static uint32_t ulLastExpectedValue = ( uint32_t ) 0U;\r
+BaseType_t xReturn = pdTRUE;\r
\r
/* Check the tasks are still running by ensuring the check variable\r
is still incrementing. */\r
\r
/* Variable used by the created tasks to calculate the LED number to use, and\r
the rate at which they should flash the LED. */\r
-static volatile unsigned portBASE_TYPE uxFlashTaskNumber = 0;\r
+static volatile UBaseType_t uxFlashTaskNumber = 0;\r
\r
/* The task that is created three times. */\r
static portTASK_FUNCTION_PROTO( vLEDFlashTask, pvParameters );\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartLEDFlashTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartLEDFlashTasks( UBaseType_t uxPriority )\r
{\r
-signed portBASE_TYPE xLEDTask;\r
+BaseType_t xLEDTask;\r
\r
/* Create the three tasks. */\r
for( xLEDTask = 0; xLEDTask < ledNUMBER_OF_LEDS; ++xLEDTask )\r
static portTASK_FUNCTION( vLEDFlashTask, pvParameters )\r
{\r
TickType_t xFlashRate, xLastFlashTime;\r
-unsigned portBASE_TYPE uxLED;\r
+UBaseType_t uxLED;\r
\r
/* The parameters are not used. */\r
( void ) pvParameters;\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartLEDFlashTimers( unsigned portBASE_TYPE uxNumberOfLEDs )\r
+void vStartLEDFlashTimers( UBaseType_t uxNumberOfLEDs )\r
{\r
-unsigned portBASE_TYPE uxLEDTimer;\r
+UBaseType_t uxLEDTimer;\r
TimerHandle_t xTimer;\r
\r
/* Create and start the requested number of timers. */\r
\r
static void prvLEDTimerCallback( TimerHandle_t xTimer )\r
{\r
-portBASE_TYPE xTimerID;\r
+BaseType_t xTimerID;\r
\r
/* The timer ID is used to identify the timer that has actually expired as\r
each timer uses the same callback. The ID is then also used as the number\r
of the LED that is to be toggled. */\r
- xTimerID = ( portBASE_TYPE ) pvTimerGetTimerID( xTimer );\r
+ xTimerID = ( BaseType_t ) pvTimerGetTimerID( xTimer );\r
vParTestToggleLED( xTimerID );\r
}\r
\r
\r
/* These variables are used to check that all the tasks are still running. If a\r
task gets a calculation wrong it will stop setting its check variable. */\r
-static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
+static volatile uint16_t usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( uint16_t ) 0 };\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartMathTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartMathTasks( UBaseType_t uxPriority )\r
{\r
xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );\r
xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );\r
static portTASK_FUNCTION( vCompetingMathTask1, pvParameters )\r
{\r
volatile portDOUBLE d1, d2, d3, d4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile portDOUBLE dAnswer;\r
short sError = pdFALSE;\r
\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for(;;)\r
static portTASK_FUNCTION( vCompetingMathTask2, pvParameters )\r
{\r
volatile portDOUBLE d1, d2, d3, d4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile portDOUBLE dAnswer;\r
short sError = pdFALSE;\r
\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for( ;; )\r
static portTASK_FUNCTION( vCompetingMathTask3, pvParameters )\r
{\r
volatile portDOUBLE *pdArray, dTotal1, dTotal2, dDifference;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
const size_t xArraySize = 10;\r
size_t xPosition;\r
short sError = pdFALSE;\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
static portTASK_FUNCTION( vCompetingMathTask4, pvParameters )\r
{\r
volatile portDOUBLE *pdArray, dTotal1, dTotal2, dDifference;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
const size_t xArraySize = 10;\r
size_t xPosition;\r
short sError = pdFALSE;\r
\r
/* The variable this task increments to show it is still running is passed in\r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
pdArray = ( portDOUBLE * ) pvPortMalloc( xArraySize * sizeof( portDOUBLE ) );\r
\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreMathsTaskStillRunning( void )\r
+BaseType_t xAreMathsTaskStillRunning( void )\r
{\r
-portBASE_TYPE xReturn = pdPASS, xTask;\r
+BaseType_t xReturn = pdPASS, xTask;\r
\r
/* Check the maths tasks are still running by ensuring their check variables\r
have been set to pdPASS. */\r
that the task is still executing. The check task sets the variable back to\r
false, flagging an error if the variable is still false the next time it\r
is called. */\r
-static volatile signed portBASE_TYPE xTaskCheck[ intgNUMBER_OF_TASKS ] = { ( signed portBASE_TYPE ) pdFALSE };\r
+static volatile BaseType_t xTaskCheck[ intgNUMBER_OF_TASKS ] = { ( BaseType_t ) pdFALSE };\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartIntegerMathTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartIntegerMathTasks( UBaseType_t uxPriority )\r
{\r
short sTask;\r
\r
ensure the compiler does not just get rid of them. */\r
volatile long lValue;\r
short sError = pdFALSE;\r
-volatile signed portBASE_TYPE *pxTaskHasExecuted;\r
+volatile BaseType_t *pxTaskHasExecuted;\r
\r
/* Set a pointer to the variable we are going to set to true each\r
iteration. This is also a good test of the parameter passing mechanism\r
within each port. */\r
- pxTaskHasExecuted = ( volatile signed portBASE_TYPE * ) pvParameters;\r
+ pxTaskHasExecuted = ( volatile BaseType_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for( ;; )\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreIntegerMathsTaskStillRunning( void )\r
+BaseType_t xAreIntegerMathsTaskStillRunning( void )\r
{\r
-portBASE_TYPE xReturn = pdTRUE;\r
+BaseType_t xReturn = pdTRUE;\r
short sTask;\r
\r
/* Check the maths tasks are still running by ensuring their check variables \r
static SemaphoreHandle_t xMutex;\r
\r
/* Variables used to detect and latch errors. */\r
-static volatile portBASE_TYPE xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE;\r
-static volatile unsigned portBASE_TYPE uxControllingCycles = 0, uxBlockingCycles = 0, uxPollingCycles = 0;\r
+static volatile BaseType_t xErrorOccurred = pdFALSE, xControllingIsSuspended = pdFALSE, xBlockingIsSuspended = pdFALSE;\r
+static volatile UBaseType_t uxControllingCycles = 0, uxBlockingCycles = 0, uxPollingCycles = 0;\r
\r
/* Handles of the two higher priority tasks, required so they can be resumed\r
(unsuspended). */\r
\r
static void prvRecursiveMutexControllingTask( void *pvParameters )\r
{\r
-unsigned portBASE_TYPE ux;\r
+UBaseType_t ux;\r
\r
/* Just to remove compiler warning. */\r
( void ) pvParameters;\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreRecursiveMutexTasksStillRunning( void )\r
+BaseType_t xAreRecursiveMutexTasksStillRunning( void )\r
{\r
-portBASE_TYPE xReturn;\r
-static unsigned portBASE_TYPE uxLastControllingCycles = 0, uxLastBlockingCycles = 0, uxLastPollingCycles = 0;\r
+BaseType_t xReturn;\r
+static UBaseType_t uxLastControllingCycles = 0, uxLastBlockingCycles = 0, uxLastPollingCycles = 0;\r
\r
/* Is the controlling task still cycling? */\r
if( uxLastControllingCycles == uxControllingCycles )\r
#include "semtest.h"\r
\r
/* The value to which the shared variables are counted. */\r
-#define semtstBLOCKING_EXPECTED_VALUE ( ( unsigned long ) 0xfff )\r
-#define semtstNON_BLOCKING_EXPECTED_VALUE ( ( unsigned long ) 0xff )\r
+#define semtstBLOCKING_EXPECTED_VALUE ( ( uint32_t ) 0xfff )\r
+#define semtstNON_BLOCKING_EXPECTED_VALUE ( ( uint32_t ) 0xff )\r
\r
#define semtstSTACK_SIZE configMINIMAL_STACK_SIZE\r
\r
typedef struct SEMAPHORE_PARAMETERS\r
{\r
SemaphoreHandle_t xSemaphore;\r
- volatile unsigned long *pulSharedVariable;\r
+ volatile uint32_t *pulSharedVariable;\r
TickType_t xBlockTime;\r
} xSemaphoreParameters;\r
\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartSemaphoreTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartSemaphoreTasks( UBaseType_t uxPriority )\r
{\r
xSemaphoreParameters *pxFirstSemaphoreParameters, *pxSecondSemaphoreParameters;\r
const TickType_t xBlockTime = ( TickType_t ) 100;\r
if( pxFirstSemaphoreParameters->xSemaphore != NULL )\r
{\r
/* Create the variable which is to be shared by the first two tasks. */\r
- pxFirstSemaphoreParameters->pulSharedVariable = ( unsigned long * ) pvPortMalloc( sizeof( unsigned long ) );\r
+ pxFirstSemaphoreParameters->pulSharedVariable = ( uint32_t * ) pvPortMalloc( sizeof( uint32_t ) );\r
\r
/* Initialise the share variable to the value the tasks expect. */\r
*( pxFirstSemaphoreParameters->pulSharedVariable ) = semtstNON_BLOCKING_EXPECTED_VALUE;\r
\r
if( pxSecondSemaphoreParameters->xSemaphore != NULL )\r
{\r
- pxSecondSemaphoreParameters->pulSharedVariable = ( unsigned long * ) pvPortMalloc( sizeof( unsigned long ) );\r
+ pxSecondSemaphoreParameters->pulSharedVariable = ( uint32_t * ) pvPortMalloc( sizeof( uint32_t ) );\r
*( pxSecondSemaphoreParameters->pulSharedVariable ) = semtstBLOCKING_EXPECTED_VALUE;\r
pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_PERIOD_MS;\r
\r
static portTASK_FUNCTION( prvSemaphoreTest, pvParameters )\r
{\r
xSemaphoreParameters *pxParameters;\r
-volatile unsigned long *pulSharedVariable, ulExpectedValue;\r
-unsigned long ulCounter;\r
+volatile uint32_t *pulSharedVariable, ulExpectedValue;\r
+uint32_t ulCounter;\r
short sError = pdFALSE, sCheckVariableToUse;\r
\r
/* See which check variable to use. sNextCheckVariable is not semaphore \r
/* Clear the variable, then count it back up to the expected value\r
before releasing the semaphore. Would expect a context switch or\r
two during this time. */\r
- for( ulCounter = ( unsigned long ) 0; ulCounter <= ulExpectedValue; ulCounter++ )\r
+ for( ulCounter = ( uint32_t ) 0; ulCounter <= ulExpectedValue; ulCounter++ )\r
{\r
*pulSharedVariable = ulCounter;\r
if( *pulSharedVariable != ulCounter )\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreSemaphoreTasksStillRunning( void )\r
+BaseType_t xAreSemaphoreTasksStillRunning( void )\r
{\r
static short sLastCheckVariables[ semtstNUM_TASKS ] = { 0 };\r
-portBASE_TYPE xTask, xReturn = pdTRUE;\r
+BaseType_t xTask, xReturn = pdTRUE;\r
\r
for( xTask = 0; xTask < semtstNUM_TASKS; xTask++ )\r
{\r
/* These variables are used to check that all the tasks are still running. If a \r
task gets a calculation wrong it will\r
stop incrementing its check variable. */\r
-static volatile unsigned short usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
+static volatile uint16_t usTaskCheck[ mathNUMBER_OF_TASKS ] = { ( uint16_t ) 0 };\r
\r
/*-----------------------------------------------------------*/\r
\r
-void vStartMathTasks( unsigned portBASE_TYPE uxPriority )\r
+void vStartMathTasks( UBaseType_t uxPriority )\r
{\r
xTaskCreate( vCompetingMathTask1, "Math1", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 0 ] ), uxPriority, NULL );\r
xTaskCreate( vCompetingMathTask2, "Math2", mathSTACK_SIZE, ( void * ) &( usTaskCheck[ 1 ] ), uxPriority, NULL );\r
static portTASK_FUNCTION( vCompetingMathTask1, pvParameters )\r
{\r
volatile float f1, f2, f3, f4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile float fAnswer;\r
short sError = pdFALSE;\r
\r
\r
/* The variable this task increments to show it is still running is passed in \r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for(;;)\r
static portTASK_FUNCTION( vCompetingMathTask2, pvParameters )\r
{\r
volatile float f1, f2, f3, f4;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
volatile float fAnswer;\r
short sError = pdFALSE;\r
\r
\r
/* The variable this task increments to show it is still running is passed in \r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
/* Keep performing a calculation and checking the result against a constant. */\r
for( ;; )\r
static portTASK_FUNCTION( vCompetingMathTask3, pvParameters )\r
{\r
volatile float *pfArray, fTotal1, fTotal2, fDifference, fPosition;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
const size_t xArraySize = 10;\r
size_t xPosition;\r
short sError = pdFALSE;\r
\r
/* The variable this task increments to show it is still running is passed in \r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
pfArray = ( float * ) pvPortMalloc( xArraySize * sizeof( float ) );\r
\r
static portTASK_FUNCTION( vCompetingMathTask4, pvParameters )\r
{\r
volatile float *pfArray, fTotal1, fTotal2, fDifference, fPosition;\r
-volatile unsigned short *pusTaskCheckVariable;\r
+volatile uint16_t *pusTaskCheckVariable;\r
const size_t xArraySize = 10;\r
size_t xPosition;\r
short sError = pdFALSE;\r
\r
/* The variable this task increments to show it is still running is passed in \r
as the parameter. */\r
- pusTaskCheckVariable = ( unsigned short * ) pvParameters;\r
+ pusTaskCheckVariable = ( uint16_t * ) pvParameters;\r
\r
pfArray = ( float * ) pvPortMalloc( xArraySize * sizeof( float ) );\r
\r
/*-----------------------------------------------------------*/\r
\r
/* This is called to check that all the created tasks are still running. */\r
-portBASE_TYPE xAreMathsTaskStillRunning( void )\r
+BaseType_t xAreMathsTaskStillRunning( void )\r
{\r
/* Keep a history of the check variables so we know if they have been incremented \r
since the last call. */\r
-static unsigned short usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( unsigned short ) 0 };\r
-portBASE_TYPE xReturn = pdTRUE, xTask;\r
+static uint16_t usLastTaskCheck[ mathNUMBER_OF_TASKS ] = { ( uint16_t ) 0 };\r
+BaseType_t xReturn = pdTRUE, xTask;\r
\r
/* Check the maths tasks are still running by ensuring their check variables \r
are still incrementing. */\r
#ifndef ALT_BLOCK_Q_H\r
#define ALT_BLOCK_Q_H\r
\r
-void vStartAltBlockingQueueTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreAltBlockingQueuesStillRunning( void );\r
+void vStartAltBlockingQueueTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreAltBlockingQueuesStillRunning( void );\r
\r
#endif\r
\r
#define FAST_BLOCK_TIME_TEST_H\r
\r
void vCreateAltBlockTimeTasks( void );\r
-portBASE_TYPE xAreAltBlockTimeTestTasksStillRunning( void );\r
+BaseType_t xAreAltBlockTimeTestTasksStillRunning( void );\r
\r
#endif\r
\r
#ifndef ALT_POLLED_Q_H\r
#define ALT_POLLED_Q_H\r
\r
-void vStartAltPolledQueueTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreAltPollingQueuesStillRunning( void );\r
+void vStartAltPolledQueueTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreAltPollingQueuesStillRunning( void );\r
\r
#endif\r
\r
#ifndef FAST_GEN_Q_TEST_H\r
#define FAST_GEN_Q_TEST_H\r
\r
-void vStartAltGenericQueueTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreAltGenericQueueTasksStillRunning( void );\r
+void vStartAltGenericQueueTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreAltGenericQueueTasksStillRunning( void );\r
\r
#endif /* GEN_Q_TEST_H */\r
\r
#ifndef BLOCK_Q_H\r
#define BLOCK_Q_H\r
\r
-void vStartBlockingQueueTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreBlockingQueuesStillRunning( void );\r
+void vStartBlockingQueueTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreBlockingQueuesStillRunning( void );\r
\r
#endif\r
\r
#define EVENT_GROUPS_DEMO_H\r
\r
void vStartEventGroupTasks( void );\r
-portBASE_TYPE xAreEventGroupTasksStillRunning( void );\r
+BaseType_t xAreEventGroupTasksStillRunning( void );\r
void vPeriodicEventGroupsProcessing( void );\r
\r
#endif /* EVENT_GROUPS_DEMO_H */\r
#ifndef GEN_Q_TEST_H\r
#define GEN_Q_TEST_H\r
\r
-void vStartGenericQueueTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreGenericQueueTasksStillRunning( void );\r
+void vStartGenericQueueTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreGenericQueueTasksStillRunning( void );\r
\r
#endif /* GEN_Q_TEST_H */\r
\r
#define QUEUE_ACCESS_TEST\r
\r
void vStartInterruptQueueTasks( void );\r
-portBASE_TYPE xAreIntQueueTasksStillRunning( void );\r
-portBASE_TYPE xFirstTimerHandler( void );\r
-portBASE_TYPE xSecondTimerHandler( void );\r
+BaseType_t xAreIntQueueTasksStillRunning( void );\r
+BaseType_t xFirstTimerHandler( void );\r
+BaseType_t xSecondTimerHandler( void );\r
\r
#endif /* QUEUE_ACCESS_TEST */\r
\r
#ifndef POLLED_Q_H\r
#define POLLED_Q_H\r
\r
-void vStartPolledQueueTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xArePollingQueuesStillRunning( void );\r
+void vStartPolledQueueTasks( UBaseType_t uxPriority );\r
+BaseType_t xArePollingQueuesStillRunning( void );\r
\r
#endif\r
\r
#define Q_PEEK_TEST_H\r
\r
void vStartQueuePeekTasks( void );\r
-portBASE_TYPE xAreQueuePeekTasksStillRunning( void );\r
+BaseType_t xAreQueuePeekTasksStillRunning( void );\r
\r
#endif /* Q_PEEK_TEST_H */\r
\r
#ifndef QUEUE_OVERWRITE_H\r
#define QUEUE_OVERWRITE_H\r
\r
-void vStartQueueOverwriteTask( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xIsQueueOverwriteTaskStillRunning( void );\r
+void vStartQueueOverwriteTask( UBaseType_t uxPriority );\r
+BaseType_t xIsQueueOverwriteTaskStillRunning( void );\r
void vQueueOverwritePeriodicISRDemo( void );\r
\r
#endif /* QUEUE_OVERWRITE_H */\r
#define QUEUE_WAIT_MULTIPLE_H\r
\r
void vStartQueueSetTasks( void );\r
-portBASE_TYPE xAreQueueSetTasksStillRunning( void );\r
+BaseType_t xAreQueueSetTasksStillRunning( void );\r
void vQueueSetAccessQueueSetFromISR( void );\r
\r
#endif /* QUEUE_WAIT_MULTIPLE_H */\r
#define TIMER_DEMO_H\r
\r
void vStartTimerDemoTask( TickType_t xBaseFrequencyIn );\r
-portBASE_TYPE xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency );\r
+BaseType_t xAreTimerDemoTasksStillRunning( TickType_t xCycleFrequency );\r
void vTimerPeriodicISRTests( void );\r
\r
#endif /* TIMER_DEMO_H */\r
#define BLOCK_TIME_TEST_H\r
\r
void vCreateBlockTimeTasks( void );\r
-portBASE_TYPE xAreBlockTimeTestTasksStillRunning( void );\r
+BaseType_t xAreBlockTimeTestTasksStillRunning( void );\r
\r
#endif\r
\r
#ifndef COMTEST_H\r
#define COMTEST_H\r
\r
-void vAltStartComTestTasks( unsigned portBASE_TYPE uxPriority, unsigned long ulBaudRate, unsigned portBASE_TYPE uxLED );\r
-void vStartComTestTasks( unsigned portBASE_TYPE uxPriority, eCOMPort ePort, eBaud eBaudRate );\r
-portBASE_TYPE xAreComTestTasksStillRunning( void );\r
+void vAltStartComTestTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED );\r
+void vStartComTestTasks( UBaseType_t uxPriority, eCOMPort ePort, eBaud eBaudRate );\r
+BaseType_t xAreComTestTasksStillRunning( void );\r
void vComTestUnsuspendTask( void );\r
\r
#endif\r
#ifndef COMTEST_H\r
#define COMTEST_H\r
\r
-void vAltStartComTestTasks( unsigned portBASE_TYPE uxPriority, unsigned long ulBaudRate, unsigned portBASE_TYPE uxLED );\r
-portBASE_TYPE xAreComTestTasksStillRunning( void );\r
+void vAltStartComTestTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED );\r
+BaseType_t xAreComTestTasksStillRunning( void );\r
\r
#endif\r
\r
#ifndef COMTEST_STRINGS_H\r
#define COMTEST_STRINGS_H\r
\r
-void vStartComTestStringsTasks( unsigned portBASE_TYPE uxPriority, unsigned long ulBaudRate, unsigned portBASE_TYPE uxLED );\r
-portBASE_TYPE xAreComTestTasksStillRunning( void );\r
+void vStartComTestStringsTasks( UBaseType_t uxPriority, uint32_t ulBaudRate, UBaseType_t uxLED );\r
+BaseType_t xAreComTestTasksStillRunning( void );\r
\r
#endif\r
\r
#define COUNT_SEMAPHORE_TEST_H\r
\r
void vStartCountingSemaphoreTasks( void );\r
-portBASE_TYPE xAreCountingSemaphoreTasksStillRunning( void );\r
+BaseType_t xAreCountingSemaphoreTasksStillRunning( void );\r
\r
#endif\r
\r
* also effects the number of LED's that will be utilised. For example,\r
* passing in 3 will cause LED's 0 to 2 to be utilised.\r
*/\r
-void vStartFlashCoRoutines( unsigned portBASE_TYPE uxPriority );\r
+void vStartFlashCoRoutines( UBaseType_t uxPriority );\r
\r
/*\r
* Return pdPASS or pdFAIL depending on whether an error has been detected\r
* or not.\r
*/\r
-portBASE_TYPE xAreFlashCoRoutinesStillRunning( void );\r
+BaseType_t xAreFlashCoRoutinesStillRunning( void );\r
\r
#endif\r
\r
* Return pdPASS or pdFAIL depending on whether an error has been detected\r
* or not.\r
*/\r
-portBASE_TYPE xAreHookCoRoutinesStillRunning( void );\r
+BaseType_t xAreHookCoRoutinesStillRunning( void );\r
\r
#endif\r
\r
#ifndef SUICIDE_TASK_H\r
#define SUICIDE_TASK_H\r
\r
-void vCreateSuicidalTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xIsCreateTaskStillRunning( void );\r
+void vCreateSuicidalTasks( UBaseType_t uxPriority );\r
+BaseType_t xIsCreateTaskStillRunning( void );\r
\r
#endif\r
\r
#define DYNAMIC_MANIPULATION_H\r
\r
void vStartDynamicPriorityTasks( void );\r
-portBASE_TYPE xAreDynamicPriorityTasksStillRunning( void );\r
+BaseType_t xAreDynamicPriorityTasksStillRunning( void );\r
\r
#endif\r
\r
\r
void vDisplayMessage( const char * const pcMessageToPrint );\r
void vWriteMessageToDisk( const char * const pcMessage );\r
-void vWriteBufferToDisk( const char * const pcBuffer, unsigned long ulBufferLength );\r
+void vWriteBufferToDisk( const char * const pcBuffer, uint32_t ulBufferLength );\r
\r
#endif\r
\r
#ifndef FLASH_LED_H\r
#define FLASH_LED_H\r
\r
-void vStartLEDFlashTasks( unsigned portBASE_TYPE uxPriority );\r
+void vStartLEDFlashTasks( UBaseType_t uxPriority );\r
\r
#endif\r
\r
* within the callback function to determine which timer has actually expired\r
* (and therefore which LED to toggle).\r
*/\r
-void vStartLEDFlashTimers( unsigned portBASE_TYPE uxNumberOfLEDs );\r
+void vStartLEDFlashTimers( UBaseType_t uxNumberOfLEDs );\r
\r
#endif /* FLASH_TIMER_H */\r
#ifndef FLOP_TASKS_H\r
#define FLOP_TASKS_H\r
\r
-void vStartMathTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreMathsTaskStillRunning( void );\r
+void vStartMathTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreMathsTaskStillRunning( void );\r
\r
#endif\r
\r
#ifndef INTEGER_TASKS_H\r
#define INTEGER_TASKS_H\r
\r
-void vStartIntegerMathTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreIntegerMathsTaskStillRunning( void );\r
+void vStartIntegerMathTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreIntegerMathsTaskStillRunning( void );\r
\r
#endif\r
\r
#define EVENTS_TEST_H\r
\r
void vStartMultiEventTasks( void );\r
-portBASE_TYPE xAreMultiEventTasksStillRunning( void );\r
+BaseType_t xAreMultiEventTasksStillRunning( void );\r
\r
#endif\r
\r
#ifndef PARTEST_H\r
#define PARTEST_H\r
\r
-#define partstDEFAULT_PORT_ADDRESS ( ( unsigned short ) 0x378 )\r
+#define partstDEFAULT_PORT_ADDRESS ( ( uint16_t ) 0x378 )\r
\r
void vParTestInitialise( void );\r
-void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue );\r
-void vParTestToggleLED( unsigned portBASE_TYPE uxLED );\r
+void vParTestSetLED( UBaseType_t uxLED, BaseType_t xValue );\r
+void vParTestToggleLED( UBaseType_t uxLED );\r
\r
#endif\r
\r
#define RECURSIVE_MUTEX_TEST_H\r
\r
void vStartRecursiveMutexTasks( void );\r
-portBASE_TYPE xAreRecursiveMutexTasksStillRunning( void );\r
+BaseType_t xAreRecursiveMutexTasksStillRunning( void );\r
\r
#endif\r
\r
#ifndef SEMAPHORE_TEST_H\r
#define SEMAPHORE_TEST_H\r
\r
-void vStartSemaphoreTasks( unsigned portBASE_TYPE uxPriority );\r
-portBASE_TYPE xAreSemaphoreTasksStillRunning( void );\r
+void vStartSemaphoreTasks( UBaseType_t uxPriority );\r
+BaseType_t xAreSemaphoreTasksStillRunning( void );\r
\r
#endif\r
\r
ser115200\r
} eBaud;\r
\r
-xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength );\r
-xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portBASE_TYPE uxBufferLength );\r
-void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, unsigned short usStringLength );\r
-signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime );\r
-signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime );\r
-portBASE_TYPE xSerialWaitForSemaphore( xComPortHandle xPort );\r
+xComPortHandle xSerialPortInitMinimal( uint32_t ulWantedBaud, UBaseType_t uxQueueLength );\r
+xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, UBaseType_t uxBufferLength );\r
+void vSerialPutString( xComPortHandle pxPort, const signed char * const pcString, uint16_t usStringLength );\r
+BaseType_t xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, TickType_t xBlockTime );\r
+BaseType_t xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, TickType_t xBlockTime );\r
+BaseType_t xSerialWaitForSemaphore( xComPortHandle xPort );\r
void vSerialClose( xComPortHandle xPort );\r
\r
#endif\r