]> git.sur5r.net Git - freertos/blobdiff - Demo/CORTEX_A2F200_IAR_and_Keil/main-full.c
SmartFusion A2F demo work in progress.
[freertos] / Demo / CORTEX_A2F200_IAR_and_Keil / main-full.c
index 51299bc9a619a9db281455725b5030b07dc2bc1f..78592ea8298483e4673059769e8234f694a0a077 100644 (file)
@@ -326,6 +326,12 @@ int main(void)
 \r
                /* Create the web server task. */\r
                xTaskCreate( vuIP_Task, ( signed char * ) "uIP", mainuIP_STACK_SIZE, NULL, mainuIP_TASK_PRIORITY, NULL );\r
+               \r
+               /* The suicide tasks must be created last, as they need to know how many\r
+               tasks were running prior to their creation in order to ascertain whether\r
+               or not the correct/expected number of tasks are running at any given\r
+               time. */\r
+               vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
 \r
                /* Start the tasks and timer running. */\r
                vTaskStartScheduler();\r
@@ -443,13 +449,6 @@ static void prvQueueSendTask( void *pvParameters )
 portTickType xNextWakeTime;\r
 const unsigned long ulValueToSend = 100UL;\r
 \r
-       /* The suicide tasks must be created last, as they need to know how many\r
-       tasks were running prior to their creation in order to ascertain whether\r
-       or not the correct/expected number of tasks are running at any given time.\r
-       Therefore the standard demo 'death' tasks are not created in main(), but\r
-       instead created here. */\r
-       vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );\r
-\r
        /* The timer command queue will have been filled when the timer test tasks\r
        were created in main() (this is part of the test they perform).  Therefore,\r
        while the check and OLED timers can be created in main(), they cannot be\r
@@ -502,30 +501,16 @@ unsigned long ulReceivedValue;
 \r
 static void vOLEDTimerCallback( xTimerHandle xHandle )\r
 {\r
-volatile size_t xFreeStackSpace;\r
 static struct oled_data xOLEDData;\r
 static unsigned char ucOffset1 = 0, ucOffset2 = 5;\r
 \r
-       /* This function is called on each cycle of the idle task.  In this case it\r
-       does nothing useful, other than report the amount of FreeRTOS heap that\r
-       remains unallocated. */\r
-       xFreeStackSpace = xPortGetFreeHeapSize();\r
-\r
-       if( xFreeStackSpace > 100 )\r
-       {\r
-               /* By now, the kernel has allocated everything it is going to, so\r
-               if there is a lot of heap remaining unallocated then\r
-               the value of configTOTAL_HEAP_SIZE in FreeRTOSConfig.h can be\r
-               reduced accordingly. */\r
-       }\r
-\r
        xOLEDData.line1          = FIRST_LINE;\r
        xOLEDData.char_offset1   = ucOffset1++;\r
-       xOLEDData.string1        = "www.FreeRTOS.org";\r
+       xOLEDData.string1        = " www.FreeRTOS.org";\r
 \r
        xOLEDData.line2          = SECOND_LINE;\r
        xOLEDData.char_offset2   = ucOffset2++;\r
-       xOLEDData.string2        = "www.FreeRTOS.org";\r
+       xOLEDData.string2        = " www.FreeRTOS.org";\r
 \r
        xOLEDData.contrast_val                 = OLED_CONTRAST_VAL;\r
        xOLEDData.on_off                       = OLED_HORIZ_SCROLL_OFF;\r
@@ -540,6 +525,8 @@ static unsigned char ucOffset1 = 0, ucOffset2 = 5;
 \r
 static void prvSetupHardware( void )\r
 {\r
+       SystemCoreClockUpdate();\r
+       \r
        /* Disable the Watch Dog Timer */\r
        MSS_WD_disable( );\r
 \r