#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