]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/WIN32-MSVC/main_full.c
+ New feature added: Task notifications.
[freertos] / FreeRTOS / Demo / WIN32-MSVC / main_full.c
index 74fc3f29ed0e06ed5fd7e37788625679aa719fd9..85691c22517a2ceae368d48938adb213957d5afc 100644 (file)
 \r
 /* Kernel includes. */\r
 #include <FreeRTOS.h>\r
-#include "task.h"\r
-#include "queue.h"\r
-#include "timers.h"\r
-#include "semphr.h"\r
+#include <task.h>\r
+#include <queue.h>\r
+#include <timers.h>\r
+#include <semphr.h>\r
 \r
 /* Standard demo includes. */\r
 #include "BlockQ.h"\r
 #include "QueueOverwrite.h"\r
 #include "EventGroupsDemo.h"\r
 #include "IntSemTest.h"\r
+#include "TaskNotify.h"\r
 \r
 /* Priorities at which the tasks are created. */\r
 #define mainCHECK_TASK_PRIORITY                        ( configMAX_PRIORITIES - 2 )\r
@@ -196,6 +197,7 @@ int main_full( void )
        xTaskCreate( prvCheckTask, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
 \r
        /* Create the standard demo tasks. */\r
+       vStartTaskNotifyTask();\r
        vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
        vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
        vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
@@ -265,6 +267,11 @@ const TickType_t xCycleFrequency = 2500 / portTICK_PERIOD_MS;
                }\r
                #endif\r
 \r
+               if( xAreTaskNotificationTasksStillRunning() != pdTRUE )\r
+               {\r
+                       pcStatusMessage = "Error:  Notification";\r
+               }\r
+\r
                if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE )\r
                {\r
                        pcStatusMessage = "Error: IntSem";\r
@@ -379,7 +386,7 @@ void *pvAllocated;
                xMutexToDelete = NULL;\r
        }\r
 \r
-       /* Exercise heap_4 a bit.  The malloc failed hook will trap failed\r
+       /* Exercise heap_5 a bit.  The malloc failed hook will trap failed\r
        allocations so there is no need to test here. */\r
        pvAllocated = pvPortMalloc( ( rand() % 100 ) + 1 );\r
        vPortFree( pvAllocated );\r
@@ -410,6 +417,9 @@ void vFullDemoTickHookFunction( void )
 \r
        /* Exercise giving mutexes from an interrupt. */\r
        vInterruptSemaphorePeriodicTest();\r
+\r
+       /* Exercise using task notifications from an interrupt. */\r
+       xNotifyTaskFromISR();\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r