* queuesetINITIAL_ISR_TX_VALUE to ULONG_MAX.\r
*/\r
\r
+\r
/* Standard includes. */\r
#include <stdlib.h>\r
#include <limits.h>\r
/* The priorities used in this demo. */\r
#define queuesetLOW_PRIORITY ( tskIDLE_PRIORITY )\r
#define queuesetMEDIUM_PRIORITY ( queuesetLOW_PRIORITY + 1 )\r
-#define queuesetHIGH_PRIORITY ( queuesetMEDIUM_PRIORITY + 1 )\r
\r
/* For test purposes the priority of the sending task is changed after every\r
queuesetPRIORITY_CHANGE_LOOPS number of values are sent to a queue. */\r
* Create the queues and add them to a queue set before resuming the Tx\r
* task.\r
*/\r
-static void prvSetupTest( xTaskHandle xQueueSetSendingTask );\r
+static void prvSetupTest( void );\r
\r
/*\r
* Checks a value received from a queue falls within the range of expected\r
\r
void vStartQueueSetTasks( void )\r
{\r
- /* Create the two queues. The handle of the sending task is passed into\r
- the receiving task using the task parameter. The receiving task uses the\r
- handle to resume the sending task after it has created the queues. */\r
+ /* Create the tasks. */\r
xTaskCreate( prvQueueSetSendingTask, ( signed char * ) "SetTx", configMINIMAL_STACK_SIZE, NULL, queuesetMEDIUM_PRIORITY, &xQueueSetSendingTask );\r
xTaskCreate( prvQueueSetReceivingTask, ( signed char * ) "SetRx", configMINIMAL_STACK_SIZE, ( void * ) xQueueSetSendingTask, queuesetMEDIUM_PRIORITY, &xQueueSetReceivingTask );\r
\r
{\r
unsigned long ulReceived;\r
xQueueHandle xActivatedQueue;\r
-xTaskHandle xQueueSetSendingTask;\r
-\r
- /* The handle to the sending task is passed in using the task parameter. */\r
- xQueueSetSendingTask = ( xTaskHandle ) pvParameters;\r
\r
/* Create the queues and add them to the queue set before resuming the Tx\r
task. */\r
- prvSetupTest( xQueueSetSendingTask );\r
+ prvSetupTest();\r
\r
for( ;; )\r
{\r
{\r
/* The value received is at the lower limit of the expected range.\r
Don't test it and expect to receive one higher next time. */\r
- ulExpectedReceivedFromISR++;\r
}\r
else if( ( ULONG_MAX - ulReceived ) <= queuesetIGNORED_BOUNDARY )\r
{\r
/* The value received is at the higher limit of the expected range.\r
Don't test it and expect to wrap soon. */\r
- ulExpectedReceivedFromISR++;\r
- if( ulExpectedReceivedFromISR == 0 )\r
- {\r
- ulExpectedReceivedFromISR = queuesetINITIAL_ISR_TX_VALUE;\r
- }\r
}\r
else\r
{\r
{\r
xQueueSetTasksStatus = pdFAIL;\r
}\r
- else\r
- {\r
- /* It is expected to receive an incrementing value. */\r
- ulExpectedReceivedFromISR++;\r
- }\r
+ }\r
+\r
+ configASSERT( xQueueSetTasksStatus );\r
+\r
+ /* It is expected to receive an incrementing number. */\r
+ ulExpectedReceivedFromISR++;\r
+ if( ulExpectedReceivedFromISR == 0 )\r
+ {\r
+ ulExpectedReceivedFromISR = queuesetINITIAL_ISR_TX_VALUE;\r
}\r
}\r
else\r
{\r
/* The value received is at the lower limit of the expected range.\r
Don't test it, and expect to receive one higher next time. */\r
- ulExpectedReceivedFromTask++;\r
}\r
else if( ( ( queuesetINITIAL_ISR_TX_VALUE - 1 ) - ulReceived ) <= queuesetIGNORED_BOUNDARY )\r
{\r
/* The value received is at the higher limit of the expected range.\r
Don't test it and expect to wrap soon. */\r
- ulExpectedReceivedFromTask++;\r
- if( ulExpectedReceivedFromTask >= queuesetINITIAL_ISR_TX_VALUE )\r
- {\r
- ulExpectedReceivedFromTask = 0;\r
- }\r
}\r
else\r
{\r
{\r
xQueueSetTasksStatus = pdFAIL;\r
}\r
- else\r
- {\r
- /* It is expected to receive an incrementing value. */\r
- ulExpectedReceivedFromTask++;\r
- }\r
+ }\r
+\r
+ configASSERT( xQueueSetTasksStatus );\r
+\r
+ /* It is expected to receive an incrementing number. */\r
+ ulExpectedReceivedFromTask++;\r
+ if( ulExpectedReceivedFromTask >= queuesetINITIAL_ISR_TX_VALUE )\r
+ {\r
+ ulExpectedReceivedFromTask = 0;\r
}\r
}\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvSetupTest( xTaskHandle xQueueSetSendingTask )\r
+static void prvSetupTest( void )\r
{\r
portBASE_TYPE x;\r
unsigned long ulValueToSend = 0;\r
static unsigned long prvRand( void )\r
{\r
ulNextRand = ( ulNextRand * 1103515245UL ) + 12345UL;\r
- return (ulNextRand / 65536UL ) % 32768UL;\r
+ return ( ulNextRand / 65536UL ) % 32768UL;\r
}\r
/*-----------------------------------------------------------*/\r
\r