]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/semtest.c
Ensure demo app files are using FreeRTOS V8 names - a few were missed previously.
[freertos] / FreeRTOS / Demo / Common / Minimal / semtest.c
index 39e779fb7630e57a03972bfa2a5db59748a423d4..dcf533f66be71c735becb92a2bbd176d0d32f7fa 100644 (file)
@@ -98,8 +98,8 @@
 #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
@@ -114,7 +114,7 @@ static portTASK_FUNCTION_PROTO( prvSemaphoreTest, pvParameters );
 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
@@ -124,7 +124,7 @@ static volatile short sNextCheckVariable = 0;
 \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
@@ -141,7 +141,7 @@ const TickType_t xBlockTime = ( TickType_t ) 100;
                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
@@ -165,7 +165,7 @@ const TickType_t xBlockTime = ( TickType_t ) 100;
 \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
@@ -188,8 +188,8 @@ const TickType_t xBlockTime = ( TickType_t ) 100;
 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
@@ -231,7 +231,7 @@ short sError = pdFALSE, sCheckVariableToUse;
                        /* 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
@@ -277,10 +277,10 @@ short sError = pdFALSE, sCheckVariableToUse;
 /*-----------------------------------------------------------*/\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