From: rtel Date: Mon, 21 Oct 2019 17:17:34 +0000 (+0000) Subject: Add some asserts into the common demo tasks to catch scenarios where the tasks are... X-Git-Tag: V10.3.0~77 X-Git-Url: https://git.sur5r.net/?p=freertos;a=commitdiff_plain;h=d1fc4416501043db46eaf4e5173dfebad4e98da7 Add some asserts into the common demo tasks to catch scenarios where the tasks are not being used but the part of the demo/test that gets called from the tick hook is called resultant in an access to objects that were not created. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2746 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- diff --git a/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c b/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c index 8890f4deb..21b2d7769 100644 --- a/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c +++ b/FreeRTOS/Demo/Common/Minimal/EventGroupsDemo.c @@ -976,6 +976,9 @@ BaseType_t xMessagePosted; /* Called periodically from the tick hook to exercise the "FromISR" functions. */ + /* Check the even group tasks were actually created. */ + configASSERT( xISREventGroup ); + xCallCount++; if( xCallCount == xSetBitCount ) diff --git a/FreeRTOS/Demo/Common/Minimal/TaskNotify.c b/FreeRTOS/Demo/Common/Minimal/TaskNotify.c index 8307323b7..4adc06f56 100644 --- a/FreeRTOS/Demo/Common/Minimal/TaskNotify.c +++ b/FreeRTOS/Demo/Common/Minimal/TaskNotify.c @@ -609,6 +609,9 @@ const BaseType_t xCallInterval = pdMS_TO_TICKS( 50 ); uint32_t ulPreviousValue; const uint32_t ulUnexpectedValue = 0xff; + /* Check the task notification demo tasks were actually created. */ + configASSERT( xTaskToNotify ); + /* The task performs some tests before starting the timer that gives the notification from this interrupt. If the timer has not been created yet then the initial tests have not yet completed and the notification should diff --git a/FreeRTOS/Demo/Common/Minimal/blocktim.c b/FreeRTOS/Demo/Common/Minimal/blocktim.c index 22a3b8ce4..9abf824fc 100644 --- a/FreeRTOS/Demo/Common/Minimal/blocktim.c +++ b/FreeRTOS/Demo/Common/Minimal/blocktim.c @@ -478,7 +478,8 @@ const TickType_t xPeriod = 75, xCycles = 5, xAllowableMargin = ( bktALLOWABLE_MA high as to disrupt the timer tests. */ vTaskPrioritySet( NULL, configTIMER_TASK_PRIORITY - 1 ); - /* Crude check to too that vTaskDelay() blocks for the expected period. */ + /* Crude check to too see that vTaskDelay() blocks for the expected + period. */ xPreTime = xTaskGetTickCount(); vTaskDelay( bktTIME_TO_BLOCK ); xPostTime = xTaskGetTickCount();