]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/Common/Minimal/IntQueue.c
Update the demo directory to use the version 8 type naming conventions.
[freertos] / FreeRTOS / Demo / Common / Minimal / IntQueue.c
index 2ba0662ff371c08aaf9c4981eff5597132d42549..6fcc07710c23dd7ffdf96af11c76473831e78e33 100644 (file)
@@ -1,5 +1,5 @@
 /*\r
-    FreeRTOS V7.5.3 - 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
@@ -178,7 +178,7 @@ an interrupt. */
 /*-----------------------------------------------------------*/\r
 \r
 /* The two queues used by the test. */\r
-static xQueueHandle xNormallyEmptyQueue, xNormallyFullQueue;\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
@@ -196,14 +196,14 @@ time to each queue. */
 volatile unsigned portBASE_TYPE uxValueForNormallyEmptyQueue = 0, uxValueForNormallyFullQueue = 0;\r
 \r
 /* A handle to some of the tasks is required so they can be suspended/resumed. */\r
-xTaskHandle xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xHighPriorityNormallyFullTask1, xHighPriorityNormallyFullTask2;\r
+TaskHandle_t xHighPriorityNormallyEmptyTask1, xHighPriorityNormallyEmptyTask2, xHighPriorityNormallyFullTask1, xHighPriorityNormallyFullTask2;\r
 \r
 /* When a value is received in a queue the value is ticked off in the array\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 portCHAR ucNormallyEmptyReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
-static unsigned portCHAR ucNormallyFullReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
+static unsigned char ucNormallyEmptyReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
+static unsigned char ucNormallyFullReceivedValues[ intqNUM_VALUES_TO_LOG ] = { 0 };\r
 \r
 /* The test tasks themselves. */\r
 static void prvLowerPriorityNormallyEmptyTask( void *pvParameters );\r
@@ -225,12 +225,12 @@ static void prvQueueAccessLogError( unsigned portBASE_TYPE uxLine );
 void vStartInterruptQueueTasks( void )\r
 {\r
        /* Start the test tasks. */\r
-       xTaskCreate( prvHigherPriorityNormallyEmptyTask, ( signed portCHAR * ) "H1QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask1 );\r
-       xTaskCreate( prvHigherPriorityNormallyEmptyTask, ( signed portCHAR * ) "H2QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask2 );\r
-       xTaskCreate( prvLowerPriorityNormallyEmptyTask, ( signed portCHAR * ) "L1QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
-       xTaskCreate( prv1stHigherPriorityNormallyFullTask, ( signed portCHAR * ) "H1QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask1 );\r
-       xTaskCreate( prv2ndHigherPriorityNormallyFullTask, ( signed portCHAR * ) "H2QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask2 );\r
-       xTaskCreate( prvLowerPriorityNormallyFullTask, ( signed portCHAR * ) "L2QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
+       xTaskCreate( prvHigherPriorityNormallyEmptyTask, "H1QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask1 );\r
+       xTaskCreate( prvHigherPriorityNormallyEmptyTask, "H2QRx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyEmptyTask2 );\r
+       xTaskCreate( prvLowerPriorityNormallyEmptyTask, "L1QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
+       xTaskCreate( prv1stHigherPriorityNormallyFullTask, "H1QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK1, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask1 );\r
+       xTaskCreate( prv2ndHigherPriorityNormallyFullTask, "H2QTx", configMINIMAL_STACK_SIZE, ( void * ) intqHIGH_PRIORITY_TASK2, intqHIGHER_PRIORITY, &xHighPriorityNormallyFullTask2 );\r
+       xTaskCreate( prvLowerPriorityNormallyFullTask, "L2QRx", configMINIMAL_STACK_SIZE, NULL, intqLOWER_PRIORITY, NULL );\r
 \r
        /* Create the queues that are accessed by multiple tasks and multiple\r
        interrupts. */\r
@@ -243,8 +243,8 @@ void vStartInterruptQueueTasks( void )
        is not being used.  The call to vQueueAddToRegistry() will be removed\r
        by the pre-processor if configQUEUE_REGISTRY_SIZE is not defined or is\r
        defined to be less than 1. */\r
-       vQueueAddToRegistry( xNormallyFullQueue, ( signed portCHAR * ) "NormallyFull" );\r
-       vQueueAddToRegistry( xNormallyEmptyQueue, ( signed portCHAR * ) "NormallyEmpty" );\r
+       vQueueAddToRegistry( xNormallyFullQueue, "NormallyFull" );\r
+       vQueueAddToRegistry( xNormallyEmptyQueue, "NormallyEmpty" );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -424,9 +424,9 @@ unsigned portBASE_TYPE uxValue, uxRxed;
        {\r
                if( xQueueReceive( xNormallyEmptyQueue, &uxRxed, intqONE_TICK_DELAY ) != errQUEUE_EMPTY )\r
                {\r
-                       /* We should only obtain a value when the high priority task is\r
+                       /* A value should only be obtained when the high priority task is\r
                        suspended. */\r
-                       if( xTaskIsTaskSuspended( xHighPriorityNormallyEmptyTask1 ) == pdFALSE )\r
+                       if( eTaskGetState( xHighPriorityNormallyEmptyTask1 ) != eSuspended )\r
                        {\r
                                prvQueueAccessLogError( __LINE__ );\r
                        }\r
@@ -621,9 +621,8 @@ unsigned portBASE_TYPE uxValue, uxTxed = 9999;
        {\r
                if( xQueueSend( xNormallyFullQueue, &uxTxed, intqONE_TICK_DELAY ) != errQUEUE_FULL )\r
                {\r
-                       /* We would only expect to succeed when the higher priority task\r
-                       is suspended. */\r
-                       if( xTaskIsTaskSuspended( xHighPriorityNormallyFullTask1 ) == pdFALSE )\r
+                       /* Should only succeed when the higher priority task is suspended */\r
+                       if( eTaskGetState( xHighPriorityNormallyFullTask1 ) != eSuspended )\r
                        {\r
                                prvQueueAccessLogError( __LINE__ );\r
                        }\r