From 641408b76ffa009d4d5b459b79094d9e035f5d42 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Mon, 15 Nov 2010 22:30:47 +0000 Subject: [PATCH] Added in more demo apps to the Win32 demo. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@1143 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Demo/WIN32-MSVC/FreeRTOSConfig.h | 49 ++++--- Demo/WIN32-MSVC/WIN32.suo | Bin 36864 -> 41984 bytes Demo/WIN32-MSVC/WIN32.vcxproj | 13 +- Demo/WIN32-MSVC/WIN32.vcxproj.filters | 39 ++++- Demo/WIN32-MSVC/main.c | 197 +++++++++++++++----------- 5 files changed, 191 insertions(+), 107 deletions(-) diff --git a/Demo/WIN32-MSVC/FreeRTOSConfig.h b/Demo/WIN32-MSVC/FreeRTOSConfig.h index 01a8bd564..3d657bf94 100644 --- a/Demo/WIN32-MSVC/FreeRTOSConfig.h +++ b/Demo/WIN32-MSVC/FreeRTOSConfig.h @@ -64,19 +64,28 @@ * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. *----------------------------------------------------------*/ +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 +#define configTICK_RATE_HZ ( ( portTickType ) 50 ) +#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 50 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */ +#define configTOTAL_HEAP_SIZE ( ( size_t ) 0 ) /* This parameter has no effect when heap_3.c is included in the project. */ +#define configMAX_TASK_NAME_LEN ( 12 ) +#define configUSE_TRACE_FACILITY 1 +#define configUSE_16_BIT_TICKS 0 +#define configIDLE_SHOULD_YIELD 1 +#define configUSE_CO_ROUTINES 0 +#define configUSE_MUTEXES 1 +#define configGENERATE_RUN_TIME_STATS 0 +#define configCHECK_FOR_STACK_OVERFLOW 0 +#define configUSE_RECURSIVE_MUTEXES 1 +#define configQUEUE_REGISTRY_SIZE 0 +#define configUSE_MALLOC_FAILED_HOOK 1 +#define configUSE_APPLICATION_TASK_TAG 0 + +#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 7 ) +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) -#define configUSE_PREEMPTION 0 -#define configUSE_IDLE_HOOK 1 -#define configUSE_TICK_HOOK 0 -#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 47923200 ) -#define configTICK_RATE_HZ ( ( portTickType ) 100 ) -#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 ) -#define configMINIMAL_STACK_SIZE ( ( unsigned portSHORT ) 50 ) /* In this simulated case, the stack only has to hold one small structure as the real stack is part of the win32 thread. */ -#define configTOTAL_HEAP_SIZE ( ( size_t ) 0 ) /* This parameter has no effect when heap_3.c is included in the project. */ -#define configMAX_TASK_NAME_LEN ( 16 ) -#define configUSE_TRACE_FACILITY 0 -#define configUSE_16_BIT_TICKS 0 -#define configIDLE_SHOULD_YIELD 1 /* Co-routine definitions. */ #define configUSE_CO_ROUTINES 0 @@ -85,13 +94,15 @@ /* Set the following definitions to 1 to include the API function, or zero to exclude the API function. */ -#define INCLUDE_vTaskPrioritySet 1 -#define INCLUDE_uxTaskPriorityGet 1 -#define INCLUDE_vTaskDelete 0 -#define INCLUDE_vTaskCleanUpResources 0 -#define INCLUDE_vTaskSuspend 1 -#define INCLUDE_vTaskDelayUntil 1 -#define INCLUDE_vTaskDelay 1 +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 1 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 +#define INCLUDE_uxTaskGetStackHighWaterMark 1 +#define INCLUDE_xTaskGetSchedulerState 1 #endif /* FREERTOS_CON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O{CX+S7~nh$vb-(WB(!j}Sq~}xqkP|^7SXtV zgTz-3aXutnUT@%_ZA#=?O!$JeU^+qVxJxsN$yZWU|BcD@=Ly9=oYcD$Oz^Ps0^da$!X zO@&8KY54kdE>u&WDIFFJc4G2{A|<738`P<*;Hwp>Q1e_#5MmYB&K~6>+|H?G=cF3( z`C#mVe20im#Cgce@pMz&=vOCt>Oo)Wq4DD1T$DIjJ9_O6`R76Zx*<6b58Jn>pKk0L z9!rC0J|bkyLWv3+t7k2&EffF;nxJ4Tq)?#L9SV*IgXLn@kQT`eOk~xlvxHgLd{%)o z7jr}Z%Sq89%f(Z(BXjQtZlOVxg8i)Bn-H0M^n%bJ8v4wlf_jG0%a6>xb#f&Ur9zCX zl14>l%qtrsIwN9ZsgW7;%f^UiL~JZAGGn)8V?>FKER4Nq%mF8iHvAsCDW61?-sH$m z+8UYLJ7r@;BahL{$c%j|8zV|zIFbD_I~wc%x3-uRZi^qt7KrL$-Io0S+!8H#dKXOF t*7-~=j0rX_1yha=?D%~=(6pXD1>lFZv9Q^%55CfbpA`)1x@%Bn#Gino&AtEt diff --git a/Demo/WIN32-MSVC/WIN32.vcxproj b/Demo/WIN32-MSVC/WIN32.vcxproj index 789455967..bc4b02e9f 100644 --- a/Demo/WIN32-MSVC/WIN32.vcxproj +++ b/Demo/WIN32-MSVC/WIN32.vcxproj @@ -55,7 +55,7 @@ Disabled ..\..\Source\include;..\..\Source\portable\MSVC-MingW;..\Common\Include;.;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0400;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) + WIN32;_DEBUG;_CONSOLE;_WIN32_WINNT=0x0500;WINVER=0x400;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebug @@ -66,6 +66,7 @@ Level4 true EditAndContinue + false _DEBUG;%(PreprocessorDefinitions) @@ -78,6 +79,7 @@ .\Debug/WIN32.pdb Console MachineX86 + %(AdditionalDependencies) true @@ -122,6 +124,15 @@ + + + + + + + + + %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) diff --git a/Demo/WIN32-MSVC/WIN32.vcxproj.filters b/Demo/WIN32-MSVC/WIN32.vcxproj.filters index 99f5959de..f57f15453 100644 --- a/Demo/WIN32-MSVC/WIN32.vcxproj.filters +++ b/Demo/WIN32-MSVC/WIN32.vcxproj.filters @@ -23,6 +23,12 @@ {34567deb-d5ab-4a56-8640-0aaec609521a} cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + {2d4a700c-06e3-4dd2-afbe-ab1be71ebe2a} + + + {88f409e6-d396-4ac5-94bd-7a99c914be46} + @@ -31,9 +37,6 @@ FreeRTOS Source\Source - - FreeRTOS Source\Source - FreeRTOS Source\Source @@ -43,6 +46,36 @@ FreeRTOS Source\Source + + FreeRTOS Source\Source\Portable + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + + + Demo App Source\Common Demo Tasks + diff --git a/Demo/WIN32-MSVC/main.c b/Demo/WIN32-MSVC/main.c index b5b7d497b..6685e2fed 100644 --- a/Demo/WIN32-MSVC/main.c +++ b/Demo/WIN32-MSVC/main.c @@ -51,13 +51,38 @@ licensing and training services. */ +/* Standard includes. */ #include + +/* Kernel includes. */ #include #include "task.h" #include "queue.h" -/* Task priorities. */ -#define mainSTDOUT_TASK_PRIORITY tskIDLE_PRIORITY +/* Standard demo includes. */ +#include "partest.h" +#include "BlockQ.h" +#include "death.h" +#include "integer.h" +//#include "blocktim.h" +#include "semtest.h" +#include "PollQ.h" +#include "GenQTest.h" +#include "QPeek.h" +#include "recmutex.h" +#include "flop.h" + +/* Priorities at which the tasks are created. */ +#define mainCHECK_TASK_PRIORITY ( configMAX_PRIORITIES - 1 ) +#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 ) +#define mainFLASH_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) +#define mainuIP_TASK_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainINTEGER_TASK_PRIORITY ( tskIDLE_PRIORITY ) +#define mainGEN_QUEUE_TASK_PRIORITY ( tskIDLE_PRIORITY ) +#define mainFLOP_TASK_PRIORITY ( tskIDLE_PRIORITY ) /* Stack sizes. */ #define mainSTDOUT_TASK_STACK_SIZE ( configMINIMAL_STACK_SIZE * 4 ) @@ -67,9 +92,7 @@ static volatile unsigned long ul1 = 0, ul2 = 0; static xQueueHandle xStdoutQueue = NULL; /* Task function prototypes. */ -static void prvTask1( void *pvParameters ); -static void prvTask2( void *pvParameters ); -static void prvStdoutTask( void *pvParameters ); +static void prvCheckTask( void *pvParameters ); /* Create a queue on which console output strings can be posted, then start the task that processes the queue - printf()'ing each string that is received. */ @@ -79,14 +102,25 @@ static void prvStartStdoutTask( void ); pointed to by pcTextToPrint for output to stdout in a thread safe manner. */ void vMainConsolePrint( const char *pcTextToPrint, portTickType xTicksToWait ); -volatile unsigned long ulIdleCount = 0UL, ulT1Count = 0UL, ulT2Count = 0UL, ulTicks = 0UL; /*-----------------------------------------------------------*/ int main( void ) { - prvStartStdoutTask(); - xTaskCreate( prvTask1, "t1", 100, NULL, 0, NULL ); - xTaskCreate( prvTask2, "t2", 100, NULL, 0, NULL ); + /* Start the check task as described at the top of this file. */ + xTaskCreate( prvCheckTask, ( signed char * ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* Create the standard demo tasks. */ + vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); +// vCreateBlockTimeTasks(); + vStartSemaphoreTasks( mainSEM_TEST_PRIORITY ); + vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); + vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY ); + vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY ); + vStartQueuePeekTasks(); + vStartRecursiveMutexTasks(); + vStartMathTasks( mainFLOP_TASK_PRIORITY ); + + /* Start the scheduler itself. */ vTaskStartScheduler(); /* Should never get here unless there was not enough heap space to create @@ -95,102 +129,97 @@ int main( void ) } /*-----------------------------------------------------------*/ -void vMainConsolePrint( const char *pcTextToPrint, portTickType xTicksToWait ) -{ - if( xStdoutQueue != NULL ) - { - xQueueSend( xStdoutQueue, &pcTextToPrint, xTicksToWait ); - } -} -/*-----------------------------------------------------------*/ - -static void prvStartStdoutTask( void ) -{ -const unsigned long ulQueueLength = 20; - - /* Create the queue on which starings for output will be stored. */ - xStdoutQueue = xQueueCreate( ulQueueLength, ( unsigned portBASE_TYPE ) sizeof( char * ) ); - - if( xStdoutQueue != NULL ) - { - /* Create the task that processes the stdout messages. */ - xTaskCreate( prvStdoutTask, "stdout task", mainSTDOUT_TASK_STACK_SIZE, NULL, mainSTDOUT_TASK_PRIORITY, NULL ); - } -} -/*-----------------------------------------------------------*/ - -static void prvStdoutTask( void *pvParameters ) -{ -char *pcString; - - /* Just to remove compiler warnings. */ - ( void ) pvParameters; - - for( ;; ) - { - /* This task would not have been created if the queue had not been created - successfully too. Also, because of the FreeRTOSConfig.h settings using - portMAX_DELAY in this case means wait forever, so when this function returns - we know there is a string to print. */ - xQueueReceive( xStdoutQueue, &pcString, portMAX_DELAY ); - printf( "%s", pcString ); - //fflush( stdout ); - } -} -/*-----------------------------------------------------------*/ - -static void prvTask1( void *pvParameters ) +static void prvCheckTask( void *pvParameters ) { -const char *pcTask1Message = "Task 1 running\r\n"; -const portTickType xTicksToDelay = 1000 / portTICK_RATE_MS; +portTickType xNextWakeTime; +const portTickType xCycleFrequency = 5000 / portTICK_RATE_MS; +char *pcStatusMessage = "OK"; +long lCycleCount = 0; - /* Just to remove compiler warnings. */ + /* Just to remove compiler warning. */ ( void ) pvParameters; - for( ;; ) - { -// ul1++; - vMainConsolePrint( pcTask1Message, 0 ); - vTaskDelay( xTicksToDelay ); - ulT1Count++; - } -} -/*-----------------------------------------------------------*/ - -static void prvTask2( void *pvParameters ) -{ -const char *pcTask2Message = "Task 2 running\r\n"; -const portTickType xTicksToDelay = 500 / portTICK_RATE_MS; - - /* Just to remove compiler warnings. */ - ( void ) pvParameters; + /* Initialise xNextWakeTime - this only needs to be done once. */ + xNextWakeTime = xTaskGetTickCount(); for( ;; ) { -// ul2++; - vMainConsolePrint( pcTask2Message, 0 ); - vTaskDelay( xTicksToDelay ); - ulT2Count++; -// taskYIELD(); + /* Place this task in the blocked state until it is time to run again. */ + vTaskDelayUntil( &xNextWakeTime, xCycleFrequency ); + + /* Check the standard demo tasks are running without error. */ + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + pcStatusMessage = "Error: IntMath"; + } + else if( xAreGenericQueueTasksStillRunning() != pdTRUE ) + { + pcStatusMessage = "Error: GenQueue"; + } + else if( xAreQueuePeekTasksStillRunning() != pdTRUE ) + { + pcStatusMessage = "Error: QueuePeek"; + } + else if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + pcStatusMessage = "Error: BlockQueue"; + } +// else if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) +// { +// pcStatusMessage = "Error: BlockTime"; +// } + else if( xAreSemaphoreTasksStillRunning() != pdTRUE ) + { + pcStatusMessage = "Error: SemTest"; + } + else if( xArePollingQueuesStillRunning() != pdTRUE ) + { + pcStatusMessage = "Error: PollQueue"; + } + else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE ) + { + pcStatusMessage = "Error: RecMutex"; + } + else if( xAreMathsTaskStillRunning() != pdPASS ) + { + pcStatusMessage = "Error: Flop"; + } + + /* This is the only task that uses stdout so its ok to call printf() + directly. */ + printf( "%s - %d\r\n", pcStatusMessage, xTaskGetTickCount() ); } } /*-----------------------------------------------------------*/ -void vApplicationIdleHook() +void vApplicationIdleHook( void ) { -const unsigned long ulMSToSleep = 5; - /* Sleep to reduce CPU load, but don't sleep indefinitely if not using preemption as as nothing will cause a task switch. */ - #if configUSE_PREEMPTION != 0 + #if( configUSE_PREEMPTION != 0 ) { SleepEx( INFINITE, TRUE ); } #else { + const unsigned long ulMSToSleep = 5; + SleepEx( ulMSToSleep, TRUE ); } #endif +} +/*-----------------------------------------------------------*/ - ulIdleCount++; +void vApplicationMallocFailedHook( void ) +{ + /* Can be implemented if required, but probably not required in this + environment and running this demo. */ } +/*-----------------------------------------------------------*/ + +void vApplicationStackOverflowHook( void ) +{ + /* Can be implemented if required, but not required in this + environment and running this demo. */ +} + -- 2.39.5