From 3aeb4081cbf67d7ebb60bda6a730cac3f77f7775 Mon Sep 17 00:00:00 2001 From: richardbarry Date: Tue, 29 Oct 2013 11:43:41 +0000 Subject: [PATCH] Update the FreeRTOS+ Win32 MSVC demos to account for the changes to the Win32 port layer (more accurate timing). git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@2078 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- .../main.c | 13 +++++++------ .../SecureTCPClientTask.c | 4 ++-- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/main.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/main.c index 0e8e422f6..3d3e02d25 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/main.c +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CLI_with_Trace_Windows_Simulator/main.c @@ -70,11 +70,12 @@ * application. It is provided as a convenient development and demonstration * test bed only. This was tested using Windows XP on a dual core laptop. * - * In this example, one simulated millisecond will take approximately 40ms to - * execute, and the timing information in the FreeRTOS+Trace logs have no - * meaningful units. See the documentation page for the Windows simulator for - * an explanation of the slow timing: + * Windows will not be running the FreeRTOS simulator threads continuously, so + * the timing information in the FreeRTOS+Trace logs have no meaningful units. + * See the documentation page for the Windows simulator for an explanation of + * the slow timing: * http://www.freertos.org/FreeRTOS-Windows-Simulator-Emulator-for-Visual-Studio-and-Eclipse-MingW.html + * - READ THE WEB DOCUMENTATION FOR THIS PORT FOR MORE INFORMATION ON USING IT - * * Documentation for this demo can be found on: * http://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_Trace/Free_RTOS_Plus_Trace_CLI_Example.shtml @@ -124,9 +125,9 @@ #define mainQUEUE_SEND_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 ) #define mainUDP_CLI_TASK_PRIORITY ( tskIDLE_PRIORITY ) -/* The rate at which data is sent to the queue. The (simulated) 50ms value is +/* The rate at which data is sent to the queue. The (simulated) 250ms value is converted to ticks using the portTICK_RATE_MS constant. */ -#define mainQUEUE_SEND_FREQUENCY_MS ( 50 / portTICK_RATE_MS ) +#define mainQUEUE_SEND_FREQUENCY_MS ( 250 / portTICK_RATE_MS ) /* The number of items the queue can hold. This is 1 as the receive task will remove items as they are added, meaning the send task should always find diff --git a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPClientTask.c b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPClientTask.c index 9e9210c7f..b4ef1bcae 100644 --- a/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPClientTask.c +++ b/FreeRTOS-Plus/Demo/FreeRTOS_Plus_CyaSSL_Windows_Simulator/SecureTCPClientTask.c @@ -156,7 +156,7 @@ uint32_t ulCount = 0UL; /* Short delay to prevent the messages streaming up the console too quickly. */ - vTaskDelay( 5 ); + vTaskDelay( 50 ); ulCount++; } while( ( lReturned != SOCKET_ERROR ) && ( ulCount < 10UL ) ); @@ -166,7 +166,7 @@ uint32_t ulCount = 0UL; closesocket( xClientSocket ); /* Delay for a short time before starting over. */ - vTaskDelay( 50 ); + vTaskDelay( 250 ); } } } -- 2.39.2