/*\r
- FreeRTOS V7.5.0 - Copyright (C) 2013 Real Time Engineers Ltd.\r
+ FreeRTOS V8.0.0:rc1 - Copyright (C) 2014 Real Time Engineers Ltd. \r
+ All rights reserved\r
\r
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
Changes from V2.0.0\r
\r
+ Delay periods are now specified using variables and constants of\r
- portTickType rather than unsigned long.\r
+ TickType_t rather than unsigned long.\r
\r
Changes from V2.1.1\r
\r
\r
#define semtstNUM_TASKS ( 4 )\r
\r
-#define semtstDELAY_FACTOR ( ( portTickType ) 10 )\r
+#define semtstDELAY_FACTOR ( ( TickType_t ) 10 )\r
\r
/* The task function as described at the top of the file. */\r
static void prvSemaphoreTest( void *pvParameters );\r
/* Structure used to pass parameters to each task. */\r
typedef struct SEMAPHORE_PARAMETERS\r
{\r
- xSemaphoreHandle xSemaphore;\r
+ SemaphoreHandle_t xSemaphore;\r
volatile unsigned long *pulSharedVariable;\r
- portTickType xBlockTime;\r
+ TickType_t xBlockTime;\r
} xSemaphoreParameters;\r
\r
/* Variables used to check that all the tasks are still running without errors. */\r
void vStartSemaphoreTasks( unsigned portBASE_TYPE uxPriority )\r
{\r
xSemaphoreParameters *pxFirstSemaphoreParameters, *pxSecondSemaphoreParameters;\r
-const portTickType xBlockTime = ( portTickType ) 100;\r
+const TickType_t xBlockTime = ( TickType_t ) 100;\r
\r
/* Create the structure used to pass parameters to the first two tasks. */\r
pxFirstSemaphoreParameters = ( xSemaphoreParameters * ) pvPortMalloc( sizeof( xSemaphoreParameters ) );\r
*( pxFirstSemaphoreParameters->pulSharedVariable ) = semtstNON_BLOCKING_EXPECTED_VALUE;\r
\r
/* The first two tasks do not block on semaphore calls. */\r
- pxFirstSemaphoreParameters->xBlockTime = ( portTickType ) 0;\r
+ pxFirstSemaphoreParameters->xBlockTime = ( TickType_t ) 0;\r
\r
/* Spawn the first two tasks. As they poll they operate at the idle priority. */\r
- xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
- xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "PolSEM1", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "PolSEM2", semtstSTACK_SIZE, ( void * ) pxFirstSemaphoreParameters, tskIDLE_PRIORITY, ( TaskHandle_t * ) NULL );\r
}\r
}\r
\r
{\r
pxSecondSemaphoreParameters->pulSharedVariable = ( unsigned long * ) pvPortMalloc( sizeof( unsigned long ) );\r
*( pxSecondSemaphoreParameters->pulSharedVariable ) = semtstBLOCKING_EXPECTED_VALUE;\r
- pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_RATE_MS;\r
+ pxSecondSemaphoreParameters->xBlockTime = xBlockTime / portTICK_PERIOD_MS;\r
\r
- xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
- xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( xTaskHandle * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "BlkSEM1", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );\r
+ xTaskCreate( prvSemaphoreTest, "BlkSEM2", semtstSTACK_SIZE, ( void * ) pxSecondSemaphoreParameters, uxPriority, ( TaskHandle_t * ) NULL );\r
}\r
}\r
}\r
\r
/* If we are blocking we use a much higher count to ensure loads of context\r
switches occur during the count. */\r
- if( pxParameters->xBlockTime > ( portTickType ) 0 )\r
+ if( pxParameters->xBlockTime > ( TickType_t ) 0 )\r
{\r
ulExpectedValue = semtstBLOCKING_EXPECTED_VALUE;\r
}\r
}\r
else\r
{\r
- if( pxParameters->xBlockTime == ( portTickType ) 0 )\r
+ if( pxParameters->xBlockTime == ( TickType_t ) 0 )\r
{\r
/* We have not got the semaphore yet, so no point using the\r
processor. We are not blocking when attempting to obtain the\r