X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=FreeRTOS%2FDemo%2FMicroBlaze_Kintex7_EthernetLite%2FRTOSDemo%2Fsrc%2FFull_Demo%2Fmain_full.c;h=6964298f25b1bd3a8b3340a6d01effb19cd6a401;hb=6a98238fd1b8047c2c2ad925e06fe5bbc70d1988;hp=7c1532f0940390de877c0fc756c976af9250fb48;hpb=16b31d656f7464454c548d829b19322f4bb3b016;p=freertos diff --git a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/Full_Demo/main_full.c b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/Full_Demo/main_full.c index 7c1532f09..6964298f2 100644 --- a/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/Full_Demo/main_full.c +++ b/FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/RTOSDemo/src/Full_Demo/main_full.c @@ -1,5 +1,5 @@ /* - FreeRTOS V8.2.0 - Copyright (C) 2015 Real Time Engineers Ltd. + FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd. All rights reserved VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. @@ -8,14 +8,14 @@ FreeRTOS is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (version 2) as published by the - Free Software Foundation >>!AND MODIFIED BY!<< the FreeRTOS exception. + Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception. - *************************************************************************** + *************************************************************************** >>! NOTE: The modification to the GPL is included to allow you to !<< >>! distribute a combined work that includes FreeRTOS without being !<< >>! obliged to provide the source code for proprietary components !<< >>! outside of the FreeRTOS kernel. !<< - *************************************************************************** + *************************************************************************** FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS @@ -37,17 +37,17 @@ *************************************************************************** http://www.FreeRTOS.org/FAQHelp.html - Having a problem? Start by reading - the FAQ page "My application does not run, what could be wrong?". Have you - defined configASSERT()? + the FAQ page "My application does not run, what could be wrong?". Have you + defined configASSERT()? - http://www.FreeRTOS.org/support - In return for receiving this top quality - embedded software for free we request you assist our global community by - participating in the support forum. + http://www.FreeRTOS.org/support - In return for receiving this top quality + embedded software for free we request you assist our global community by + participating in the support forum. - http://www.FreeRTOS.org/training - Investing in training allows your team to - be as productive as possible as early as possible. Now you can receive - FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers - Ltd, and the world's leading authority on the world's leading RTOS. + http://www.FreeRTOS.org/training - Investing in training allows your team to + be as productive as possible as early as possible. Now you can receive + FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers + Ltd, and the world's leading authority on the world's leading RTOS. http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products, including FreeRTOS+Trace - an indispensable productivity tool, a DOS @@ -69,10 +69,10 @@ /****************************************************************************** - * NOTE 1: This project provides two demo applications. A simple blinky - * style project, and a more comprehensive test and demo application. The - * mainCREATE_SIMPLY_BLINKY_DEMO_ONLY setting in main.c is used to select - * between the two. See the notes on using mainCREATE_SIMPLY_BLINKY_DEMO_ONLY + * NOTE 1: This project provides three demo applications. A simple blinky + * style project, a more comprehensive test and demo application, and an + * lwIP example. The mainSELECTED_APPLICATION setting in main.c is used to + * select between the three. See the notes on using mainSELECTED_APPLICATION * in main.c. This file implements the comprehensive version. * * NOTE 2: This file only contains the source code that is specific to the @@ -137,7 +137,6 @@ #include "partest.h" #include "serial.h" #include "TimerDemo.h" -#include "IntQueue.h" #include "EventGroupsDemo.h" #include "TaskNotify.h" #include "IntSemTest.h" @@ -147,7 +146,7 @@ #define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2UL ) #define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3UL ) #define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY ) -#define mainUART_COMMAND_CONSOLE_STACK_SIZE ( configMINIMAL_STACK_SIZE * 3UL ) +#define mainUART_COMMAND_CONSOLE_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2UL ) #define mainCOM_TEST_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) #define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) #define mainQUEUE_OVERWRITE_PRIORITY ( tskIDLE_PRIORITY ) @@ -156,21 +155,21 @@ /* The priority used by the UART command console task. */ #define mainUART_COMMAND_CONSOLE_TASK_PRIORITY ( configMAX_PRIORITIES - 2 ) -/* The LED used by the check timer. */ +/* The LED used by the check task. */ #define mainCHECK_LED ( 7 ) /* A block time of zero simply means "don't block". */ #define mainDONT_BLOCK ( 0UL ) -/* The period after which the check timer will expire, in ms, provided no errors -have been reported by any of the standard demo tasks. ms are converted to the -equivalent in ticks using the portTICK_PERIOD_MS constant. */ +/* The period of the check task, in ms, provided no errors have been reported by +any of the standard demo tasks. ms are converted to the equivalent in ticks +using the pdMS_TO_TICKS() macro constant. */ #define mainNO_ERROR_CHECK_TASK_PERIOD ( pdMS_TO_TICKS( 3000UL ) ) -/* The period at which the check timer will expire, in ms, if an error has been -reported in one of the standard demo tasks. ms are converted to the equivalent -in ticks using the portTICK_PERIOD_MS constant. */ +/* The period of the check task, in ms, if an error has been reported in one of +the standard demo tasks. ms are converted to the equivalent in ticks using the +pdMS_TO_TICKS() macro. */ #define mainERROR_CHECK_TASK_PERIOD ( pdMS_TO_TICKS( 200UL ) ) /* Parameters that are passed into the register check tasks solely for the @@ -231,7 +230,7 @@ void vFullDemoIdleHook( void ); /* The following two variables are used to communicate the status of the register check tasks to the check task. If the variables keep incrementing, -then the register check tasks has not discovered any errors. If a variable +then the register check tasks have not discovered any errors. If a variable stops incrementing, then an error has been found. */ volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL; @@ -239,11 +238,9 @@ volatile unsigned long ulRegTest1LoopCounter = 0UL, ulRegTest2LoopCounter = 0UL; void main_full( void ) { - /* Start all the other standard demo/test tasks. They have not particular + /* Start all the other standard demo/test tasks. They have no particular functionality, but do demonstrate how to use the FreeRTOS API and test the kernel port. */ -// vStartInterruptQueueTasks(); - vStartDynamicPriorityTasks(); vCreateBlockTimeTasks(); vStartCountingSemaphoreTasks(); @@ -284,12 +281,10 @@ void main_full( void ) /* If all is well, the scheduler will now be running, and the following line will never be reached. If the following line does execute, then - there was either insufficient FreeRTOS heap memory available for the idle - and/or timer tasks to be created, or vTaskStartScheduler() was called from - User mode. See the memory management section on the FreeRTOS web site for - more details on the FreeRTOS heap http://www.freertos.org/a00111.html. The - mode from which main() is called is set in the C start up code and must be - a privileged mode (not user mode). */ + there was insufficient FreeRTOS heap memory available for the Idle and/or + timer tasks to be created. See the memory management section on the + FreeRTOS web site for more details on the FreeRTOS heap + http://www.freertos.org/a00111.html. */ for( ;; ); } /*-----------------------------------------------------------*/ @@ -321,11 +316,6 @@ unsigned long ulErrorFound = pdFALSE; /* Check all the demo tasks (other than the flash tasks) to ensure that they are all still running, and that none have detected an error. */ -if( 0 )// if( xAreIntQueueTasksStillRunning() != pdTRUE ) - { - ulErrorFound |= 1UL << 0UL; - } - if( xAreMathsTaskStillRunning() != pdTRUE ) { ulErrorFound |= 1UL << 1UL; @@ -356,19 +346,14 @@ if( 0 )// if( xAreIntQueueTasksStillRunning() != pdTRUE ) ulErrorFound |= 1UL << 8UL; } - if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) - { - ulErrorFound |= 1UL << 10UL; - } - - if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE ) + if( xAreTimerDemoTasksStillRunning( ( TickType_t ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS ) { - ulErrorFound |= 1UL << 14UL; + ulErrorFound |= 1UL << 9UL; } - if( xAreTimerDemoTasksStillRunning( ( TickType_t ) mainNO_ERROR_CHECK_TASK_PERIOD ) != pdPASS ) + if( xAreCountingSemaphoreTasksStillRunning() != pdTRUE ) { - ulErrorFound |= 1UL << 9UL; + ulErrorFound |= 1UL << 10UL; } if( xAreEventGroupTasksStillRunning() != pdPASS ) @@ -381,6 +366,11 @@ if( 0 )// if( xAreIntQueueTasksStillRunning() != pdTRUE ) ulErrorFound |= 1UL << 13UL; } + if( xAreInterruptSemaphoreTasksStillRunning() != pdTRUE ) + { + ulErrorFound |= 1UL << 14UL; + } + /* Check that the register test 1 task is still running. */ if( ulLastRegTest1Value == ulRegTest1LoopCounter ) { @@ -404,8 +394,7 @@ if( 0 )// if( xAreIntQueueTasksStillRunning() != pdTRUE ) { /* An error has been detected in one of the tasks - flash the LED at a higher frequency to give visible feedback that something has - gone wrong (it might just be that the loop back connector required - by the comtest tasks has not been fitted). */ + gone wrong. */ xDelayPeriod = mainERROR_CHECK_TASK_PERIOD; } } @@ -424,7 +413,7 @@ static void prvRegTestTaskEntry1( void *pvParameters ) } /* The following line will only execute if the task parameter is found to - be incorrect. The check timer will detect that the regtest loop counter is + be incorrect. The check task will detect that the regtest loop counter is not being incremented and flag an error. */ vTaskDelete( NULL ); } @@ -442,7 +431,7 @@ static void prvRegTestTaskEntry2( void *pvParameters ) } /* The following line will only execute if the task parameter is found to - be incorrect. The check timer will detect that the regtest loop counter is + be incorrect. The check task will detect that the regtest loop counter is not being incremented and flag an error. */ vTaskDelete( NULL ); }