]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS/Demo/CORTEX_M4F_Infineon_XMC4500_IAR/main_full.c
Reworked XMC4500 IAR project to use latest system files and include build configurati...
[freertos] / FreeRTOS / Demo / CORTEX_M4F_Infineon_XMC4500_IAR / main_full.c
index ded660a6eef8a9fcf6b87fdbe8989cc91c16b887..29c5be7bdaa581240b56fadde395e46de180fc19 100644 (file)
@@ -75,8 +75,8 @@
  ******************************************************************************\r
  *\r
  * main_full() creates all the demo application tasks and a software timer, then\r
- * starts the scheduler.  The web documentation provides more details of the \r
- * standard demo application tasks, which provide no particular functionality, \r
+ * starts the scheduler.  The web documentation provides more details of the\r
+ * standard demo application tasks, which provide no particular functionality,\r
  * but do provide a good example of how to use the FreeRTOS API.\r
  *\r
  * In addition to the standard demo tasks, the following tasks and tests are\r
 \r
 /* Standard demo application includes. */\r
 #include "flop.h"\r
-#include "integer.h"\r
-#include "PollQ.h"\r
 #include "semtest.h"\r
 #include "dynamic.h"\r
-#include "BlockQ.h"\r
 #include "blocktim.h"\r
 #include "countsem.h"\r
 #include "GenQTest.h"\r
 #include "recmutex.h"\r
-#include "death.h"\r
-\r
-/* Hardware includes. */\r
-#include "XMC4500.h"\r
-#include "System_XMC4500.h"\r
+#include "QueueSet.h"\r
+#include "QueueOverwrite.h"\r
 \r
 /* Priorities for the demo application tasks. */\r
 #define mainQUEUE_POLL_PRIORITY                                ( tskIDLE_PRIORITY + 2UL )\r
 #define mainCREATOR_TASK_PRIORITY                      ( tskIDLE_PRIORITY + 3UL )\r
 #define mainFLOP_TASK_PRIORITY                         ( tskIDLE_PRIORITY )\r
 \r
-/* To toggle the single LED */\r
-#define mainTOGGLE_LED()                                       ( PORT3->OMR =  0x02000200 )\r
-\r
 /* A block time of zero simply means "don't block". */\r
 #define mainDONT_BLOCK                                         ( 0UL )\r
 \r
@@ -183,17 +174,14 @@ xTimerHandle xCheckTimer = NULL;
        /* Start all the other standard demo/test tasks.  The have not particular\r
        functionality, but do demonstrate how to use the FreeRTOS API and test the\r
        kernel port. */\r
-       vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
+       vStartQueueSetTasks();\r
+       vStartQueueOverwriteTask( tskIDLE_PRIORITY );\r
        vStartDynamicPriorityTasks();\r
-       vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
        vCreateBlockTimeTasks();\r
-       vStartCountingSemaphoreTasks();\r
        vStartGenericQueueTasks( tskIDLE_PRIORITY );\r
        vStartRecursiveMutexTasks();\r
-       vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
-       vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
        vStartMathTasks( mainFLOP_TASK_PRIORITY );\r
-       \r
+\r
        /* Create the register check tasks, as described at the top of this\r
        file */\r
        xTaskCreate( vRegTest1Task, ( signed char * ) "Reg1", configMINIMAL_STACK_SIZE, ( void * ) NULL, tskIDLE_PRIORITY, NULL );\r
@@ -206,27 +194,22 @@ xTimerHandle xCheckTimer = NULL;
                                                                pdTRUE,                                                         /* This is an auto-reload timer, so xAutoReload is set to pdTRUE. */\r
                                                                ( void * ) 0,                                           /* The ID is not used, so can be set to anything. */\r
                                                                prvCheckTimerCallback                           /* The callback function that inspects the status of all the other tasks. */\r
-                                                         );    \r
-       \r
+                                                         );\r
+\r
        if( xCheckTimer != NULL )\r
        {\r
                xTimerStart( xCheckTimer, mainDONT_BLOCK );\r
        }\r
 \r
-       /* The set of tasks created by the following function call have to be \r
-       created last as they keep account of the number of tasks they expect to see \r
-       running. */\r
-       vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
-\r
        /* Start the scheduler. */\r
        vTaskStartScheduler();\r
-       \r
+\r
        /* If all is well, the scheduler will now be running, and the following line\r
        will never be reached.  If the following line does execute, then there was\r
        insufficient FreeRTOS heap memory available for the idle and/or timer tasks\r
        to be created.  See the memory management section on the FreeRTOS web site\r
        for more details. */\r
-       for( ;; );      \r
+       for( ;; );\r
 }\r
 /*-----------------------------------------------------------*/\r
 \r
@@ -244,21 +227,11 @@ unsigned long ulErrorFound = pdFALSE;
                ulErrorFound = pdTRUE;\r
        }\r
 \r
-       if( xAreIntegerMathsTaskStillRunning() != pdTRUE )\r
-       {\r
-               ulErrorFound = pdTRUE;\r
-       }\r
-\r
        if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )\r
        {\r
                ulErrorFound = pdTRUE;\r
        }\r
 \r
-       if( xAreBlockingQueuesStillRunning() != pdTRUE )\r
-       {\r
-               ulErrorFound = pdTRUE;\r
-       }\r
-\r
        if ( xAreBlockTimeTestTasksStillRunning() != pdTRUE )\r
        {\r
                ulErrorFound = pdTRUE;\r
@@ -274,21 +247,16 @@ unsigned long ulErrorFound = pdFALSE;
                ulErrorFound = pdTRUE;\r
        }\r
 \r
-       if( xIsCreateTaskStillRunning() != pdTRUE )\r
+       if( xAreQueueSetTasksStillRunning() != pdTRUE )\r
        {\r
                ulErrorFound = pdTRUE;\r
        }\r
 \r
-       if( xArePollingQueuesStillRunning() != pdTRUE )\r
+       if( xIsQueueOverwriteTaskStillRunning() != pdTRUE )\r
        {\r
                ulErrorFound = pdTRUE;\r
        }\r
 \r
-       if( xAreSemaphoreTasksStillRunning() != pdTRUE )\r
-       {\r
-               ulErrorFound = pdTRUE;\r
-       }\r
-       \r
        /* Check that the register test 1 task is still running. */\r
        if( ulLastRegTest1Value == ulRegTest1LoopCounter )\r
        {\r
@@ -306,8 +274,8 @@ unsigned long ulErrorFound = pdFALSE;
        /* Toggle the check LED to give an indication of the system status.  If\r
        the LED toggles every mainCHECK_TIMER_PERIOD_MS milliseconds then\r
        everything is ok.  A faster toggle indicates an error. */\r
-       mainTOGGLE_LED();       \r
-       \r
+       configTOGGLE_LED();\r
+\r
        /* Have any errors been latch in ulErrorFound?  If so, shorten the\r
        period of the check timer to mainERROR_CHECK_TIMER_PERIOD_MS milliseconds.\r
        This will result in an increase in the rate at which mainCHECK_LED\r
@@ -317,7 +285,7 @@ unsigned long ulErrorFound = pdFALSE;
                if( lChangedTimerPeriodAlready == pdFALSE )\r
                {\r
                        lChangedTimerPeriodAlready = pdTRUE;\r
-                       \r
+\r
                        /* This call to xTimerChangePeriod() uses a zero block time.\r
                        Functions called from inside of a timer callback function must\r
                        *never* attempt to block. */\r