#include "TaskNotify.h"\r
#include "QueueSetPolling.h"\r
#include "StaticAllocation.h"\r
+#include "blocktim.h"\r
+#include "AbortDelay.h"\r
\r
/* Priorities at which the tasks are created. */\r
#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 2 )\r
*/\r
static void prvDemoQueueSpaceFunctions( void *pvParameters );\r
\r
+/*\r
+ * Tasks that ensure indefinite delays are truly indefinite.\r
+ */\r
+static void prvPermanentlyBlockingSemaphoreTask( void *pvParameters );\r
+static void prvPermanentlyBlockingNotificationTask( void *pvParameters );\r
+\r
/*-----------------------------------------------------------*/\r
\r
/* The variable into which error messages are latched. */\r
vStartEventGroupTasks();\r
vStartInterruptSemaphoreTasks();\r
vStartQueueSetPollingTask();\r
+ vCreateBlockTimeTasks();\r
+ vCreateAbortDelayTasks();\r
xTaskCreate( prvDemoQueueSpaceFunctions, "QSpace", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvPermanentlyBlockingSemaphoreTask, "BlockSem", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
+ xTaskCreate( prvPermanentlyBlockingNotificationTask, "BlockNoti", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
{\r
/* Start the scheduler itself. */\r
vTaskStartScheduler();\r
\r
- /* Should never get here unless there was not enough heap space to create\r
+ /* Should never get here unless there was not enough heap space to create\r
the idle and other system tasks. */\r
- return 0;\r
+ return 0;\r
}\r
/*-----------------------------------------------------------*/\r
\r
{\r
pcStatusMessage = "Error: Queue set polling";\r
}\r
+ else if( xAreBlockTimeTestTasksStillRunning() != pdPASS )\r
+ {\r
+ pcStatusMessage = "Error: Block time";\r
+ }\r
+ else if( xAreAbortDelayTestTasksStillRunning() != pdPASS )\r
+ {\r
+ pcStatusMessage = "Error: Abort delay";\r
+ }\r
\r
#if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
else if( xAreStaticAllocationTasksStillRunning() != pdPASS )\r
#endif\r
}\r
}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvPermanentlyBlockingSemaphoreTask( void *pvParameters )\r
+{\r
+SemaphoreHandle_t xSemaphore;\r
+\r
+ /* This task should block on a semaphore, and never return. */\r
+ xSemaphore = xSemaphoreCreateBinary();\r
+ configASSERT( xSemaphore );\r
+\r
+ xSemaphoreTake( xSemaphore, portMAX_DELAY );\r
+\r
+ /* The above xSemaphoreTake() call should never return, force an assert if\r
+ it does. */\r
+ configASSERT( pvParameters != NULL );\r
+ vTaskDelete( NULL );\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvPermanentlyBlockingNotificationTask( void *pvParameters )\r
+{\r
+ /* This task should block on a task notification, and never return. */\r
+ ulTaskNotifyTake( pdTRUE, portMAX_DELAY );\r
+\r
+ /* The above ulTaskNotifyTake() call should never return, force an assert\r
+ if it does. */\r
+ configASSERT( pvParameters != NULL );\r
+ vTaskDelete( NULL );\r
+}\r
+\r
\r
\r