summaryrefslogtreecommitdiff
path: root/FreeRTOS
diff options
context:
space:
mode:
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2013-02-12 14:30:12 +0000
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>2013-02-12 14:30:12 +0000
commit1ce78a574e70f72507db3d93c174f63a744be9e0 (patch)
tree73471e1f02db65ee2a403bfabaec2be785ca21bd /FreeRTOS
parentdc0a5c9cfe557f8022872665f3a5f92d3e5cc0df (diff)
downloadfreertos-1ce78a574e70f72507db3d93c174f63a744be9e0.tar.gz
Adjusted the wrap checks in the QueueSet test task.
Added the QueueSet test to the Rowlay Stellaris and SAM4S-EK Studio demos. Updated the MSVC demo to use heap_4.c. git-svn-id: http://svn.code.sf.net/p/freertos/code/trunk@1824 1d2547de-c912-0410-9cb9-b8ca96c0e9e2
Diffstat (limited to 'FreeRTOS')
-rw-r--r--FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/FreeRTOSConfig.h22
-rw-r--r--FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzp2
-rw-r--r--FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzs6
-rw-r--r--FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/main.c28
-rw-r--r--FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.atsuobin42496 -> 46080 bytes
-rw-r--r--FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h43
-rw-r--r--FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c2
-rw-r--r--FreeRTOS/Demo/Common/Minimal/QueueSet.c29
-rw-r--r--FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h2
-rw-r--r--FreeRTOS/Demo/WIN32-MSVC/WIN32.suobin64000 -> 65024 bytes
-rw-r--r--FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj2
-rw-r--r--FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters6
-rw-r--r--FreeRTOS/Demo/WIN32-MSVC/main.c10
13 files changed, 92 insertions, 60 deletions
diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/FreeRTOSConfig.h
index a3776d4a1..dd1e20178 100644
--- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/FreeRTOSConfig.h
+++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/FreeRTOSConfig.h
@@ -1,7 +1,7 @@
/*
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
@@ -42,7 +42,7 @@
FreeRTOS WEB site.
1 tab == 4 spaces!
-
+
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
@@ -52,17 +52,17 @@
* *
***************************************************************************
-
- http://www.FreeRTOS.org - Documentation, training, latest versions, license
- and contact details.
-
+
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license
+ and contact details.
+
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
- the code with commercial support, indemnification, and middleware, under
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
+ the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
- provide a safety engineered and independently SIL3 certified version under
+ provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
@@ -99,6 +99,7 @@
#define configQUEUE_REGISTRY_SIZE 10
#define configGENERATE_RUN_TIME_STATS 1
#define configUSE_MALLOC_FAILED_HOOK 1
+#define configUSE_QUEUE_SETS 1
#define configMAX_PRIORITIES ( 5UL )
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
@@ -132,4 +133,7 @@ to zero. */
version. */
#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
+/* Disable interrupts and sit in a null loop if assert is called. */
+#define configASSERT( x ) if( ( x == 0 ) ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
+
#endif /* FREERTOS_CONFIG_H */
diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzp b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzp
index 3d683eb4f..67ac5394d 100644
--- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzp
+++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzp
@@ -58,7 +58,9 @@
<file file_name="../Common/include/death.h"/>
<file file_name="../Common/include/GenQTest.h"/>
<file file_name="../Common/include/integer.h"/>
+ <file file_name="../Common/include/QueueSet.h"/>
</folder>
+ <file file_name="../Common/Minimal/QueueSet.c"/>
</folder>
<folder Name="WEB Server">
<file file_name="webserver/uIP_Task.c"/>
diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzs b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzs
index c67c36900..a7a437463 100644
--- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzs
+++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/RTOSDemo.hzs
@@ -24,9 +24,7 @@
<ProjectSessionItem path="RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files" name="unnamed" />
- <ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;FreeRTOS" name="unnamed" />
<ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;include" name="unnamed" />
- <ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;WEB Server" name="unnamed" />
</Project>
<Register1>
<RegisterWindow openNodes="CPU;CPU/xPSR;CPU/CFBP" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="CPU" decimalNodes="" octalNodes="" asciiNodes="" />
@@ -57,7 +55,7 @@
<Watches active="0" update="Never" />
</Watch4>
<Files>
- <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_LM3Sxxxx_Rowley\main.c" y="238" path="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_LM3Sxxxx_Rowley\main.c" left="0" selected="1" name="unnamed" top="63" />
+ <SessionOpenFile useTextEdit="1" useBinaryEdit="0" codecName="Latin1" x="0" debugPath="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_LM3Sxxxx_Rowley\main.c" y="241" path="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_LM3Sxxxx_Rowley\main.c" left="0" selected="1" name="unnamed" top="59" />
</Files>
- <ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="Luminary USB Debug" debugSearchFileMap="" fileDialogInitialDirectory="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Source\portable\MemMang" fileDialogDefaultFilter="*.*" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Debug" />
+ <ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="Luminary USB Debug" debugSearchFileMap="" fileDialogInitialDirectory="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\Common\include" fileDialogDefaultFilter="*.*" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Debug" />
</session>
diff --git a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/main.c b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/main.c
index ad38a3dc0..db2873b44 100644
--- a/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/main.c
+++ b/FreeRTOS/Demo/CORTEX_LM3Sxxxx_Rowley/main.c
@@ -1,7 +1,7 @@
/*
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
***************************************************************************
@@ -42,7 +42,7 @@
FreeRTOS WEB site.
1 tab == 4 spaces!
-
+
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
@@ -52,17 +52,17 @@
* *
***************************************************************************
-
- http://www.FreeRTOS.org - Documentation, training, latest versions, license
- and contact details.
-
+
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license
+ and contact details.
+
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
- the code with commercial support, indemnification, and middleware, under
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
+ the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
- provide a safety engineered and independently SIL3 certified version under
+ provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
@@ -146,6 +146,7 @@
#include "QPeek.h"
#include "recmutex.h"
#include "IntQueue.h"
+#include "QueueSet.h"
/*-----------------------------------------------------------*/
@@ -262,6 +263,7 @@ int main( void )
vStartQueuePeekTasks();
vStartRecursiveMutexTasks();
vStartInterruptQueueTasks();
+ vStartQueueSetTasks();
/* Start the tasks defined within this file/specific to this demo. */
xTaskCreate( vOLEDTask, ( signed char * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
@@ -366,12 +368,18 @@ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
{
xMessage.pcMessage = "ERROR IN INT QUEUE";
}
-
+ else if( xAreQueueSetTasksStillRunning() != pdTRUE )
+ {
+ xMessage.pcMessage = "ERROR IN QUEUE SET";
+ }
/* Send the message to the OLED gatekeeper for display. */
xHigherPriorityTaskWoken = pdFALSE;
xQueueSendFromISR( xOLEDQueue, &xMessage, &xHigherPriorityTaskWoken );
}
+
+ /* Exercise the queue sets from an ISR. */
+ vQueueSetAccessQueueSetFromISR();
}
/*-----------------------------------------------------------*/
diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.atsuo b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.atsuo
index 5e8db2c57..9e0627d80 100644
--- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.atsuo
+++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/RTOSDemo.atsuo
Binary files differ
diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h
index 1cfa33cb1..94dcbd37b 100644
--- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h
+++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/FreeRTOSConfig.h
@@ -92,27 +92,28 @@
#include <stdint.h>
extern uint32_t SystemCoreClock;
-#define configUSE_PREEMPTION 1
-#define configUSE_IDLE_HOOK 0
-#define configUSE_TICK_HOOK 1
-#define configCPU_CLOCK_HZ ( SystemCoreClock )
-#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
-#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 5 )
-#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 )
-#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40960 ) )
-#define configMAX_TASK_NAME_LEN ( 10 )
-#define configUSE_TRACE_FACILITY 0
-#define configUSE_16_BIT_TICKS 0
-#define configIDLE_SHOULD_YIELD 1
-#define configUSE_MUTEXES 1
-#define configQUEUE_REGISTRY_SIZE 0
-#define configCHECK_FOR_STACK_OVERFLOW 2
-#define configUSE_RECURSIVE_MUTEXES 1
-#define configUSE_MALLOC_FAILED_HOOK 1
-#define configUSE_APPLICATION_TASK_TAG 0
-#define configUSE_COUNTING_SEMAPHORES 1
-#define configUSE_QUEUE_SETS 1
-#define configGENERATE_RUN_TIME_STATS 0
+#define configUSE_PREEMPTION 1
+#define configUSE_PORT_OPTIMISED_TASK_SELECTION 1
+#define configUSE_IDLE_HOOK 0
+#define configUSE_TICK_HOOK 1
+#define configCPU_CLOCK_HZ ( SystemCoreClock )
+#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
+#define configMAX_PRIORITIES ( 5 )
+#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 130 )
+#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 40960 ) )
+#define configMAX_TASK_NAME_LEN ( 10 )
+#define configUSE_TRACE_FACILITY 0
+#define configUSE_16_BIT_TICKS 0
+#define configIDLE_SHOULD_YIELD 1
+#define configUSE_MUTEXES 1
+#define configQUEUE_REGISTRY_SIZE 0
+#define configCHECK_FOR_STACK_OVERFLOW 2
+#define configUSE_RECURSIVE_MUTEXES 1
+#define configUSE_MALLOC_FAILED_HOOK 1
+#define configUSE_APPLICATION_TASK_TAG 0
+#define configUSE_COUNTING_SEMAPHORES 1
+#define configUSE_QUEUE_SETS 1
+#define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
diff --git a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c
index f1c8cfec3..a4a5691c4 100644
--- a/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c
+++ b/FreeRTOS/Demo/CORTEX_M4_ATSAM4S_Atmel_Studio/src/main.c
@@ -211,7 +211,7 @@ void vApplicationTickHook( void )
#if ( mainCREATE_SIMPLE_BLINKY_DEMO_ONLY == 0 )
{
/* In this case the tick hook is used as part of the queue set test. */
- vQueueSetWriteToQueueFromISR();
+ vQueueSetAccessQueueSetFromISR();
}
#endif /* mainCREATE_SIMPLE_BLINKY_DEMO_ONLY */
}
diff --git a/FreeRTOS/Demo/Common/Minimal/QueueSet.c b/FreeRTOS/Demo/Common/Minimal/QueueSet.c
index 59dbcd3d2..b7e37c008 100644
--- a/FreeRTOS/Demo/Common/Minimal/QueueSet.c
+++ b/FreeRTOS/Demo/Common/Minimal/QueueSet.c
@@ -116,13 +116,18 @@ queuesetPRIORITY_CHANGE_LOOPS number of values are sent to a queue. */
#define queuesetPRIORITY_CHANGE_LOOPS 100UL
/* The ISR sends to the queue every queuesetISR_TX_PERIOD ticks. */
-#define queuesetISR_TX_PERIOD 2//( 100UL )
+#define queuesetISR_TX_PERIOD ( 100UL )
/* The allowable maximum deviation between a received value and the expected
received value. A deviation will occur when data is received from a queue
inside an ISR in between a task receiving from a queue and the task checking
the received value. */
-#define queuesetALLOWABLE_RX_DEVIATION 5
+#define queuesetALLOWABLE_RX_DEVIATION 3
+
+/* Ignore values that are at the boundaries of allowable values to make the
+testing of limits easier (don't have to deal with wrapping values). */
+#define queuesetIGNORED_BOUNDARY ( queuesetALLOWABLE_RX_DEVIATION * 2 )
+
/*
* The task that periodically sends to the queue set.
*/
@@ -414,17 +419,21 @@ static unsigned long ulExpectedReceivedFromTask = 0, ulExpectedReceivedFromISR =
if( ulReceived >= queuesetINITIAL_ISR_TX_VALUE )
{
/* The value was sent from the ISR. */
- if( ( ulReceived - queuesetINITIAL_ISR_TX_VALUE ) < queuesetALLOWABLE_RX_DEVIATION )
+ if( ( ulReceived - queuesetINITIAL_ISR_TX_VALUE ) < queuesetIGNORED_BOUNDARY )
{
/* The value received is at the lower limit of the expected range.
Don't test it and expect to receive one higher next time. */
ulExpectedReceivedFromISR++;
}
- else if( ( ULONG_MAX - ulReceived ) <= queuesetALLOWABLE_RX_DEVIATION )
+ else if( ( ULONG_MAX - ulReceived ) <= queuesetIGNORED_BOUNDARY )
{
/* The value received is at the higher limit of the expected range.
Don't test it and expect to wrap soon. */
- ulExpectedReceivedFromISR = queuesetINITIAL_ISR_TX_VALUE;
+ ulExpectedReceivedFromISR++;
+ if( ulExpectedReceivedFromISR == 0 )
+ {
+ ulExpectedReceivedFromISR = queuesetINITIAL_ISR_TX_VALUE;
+ }
}
else
{
@@ -443,17 +452,21 @@ static unsigned long ulExpectedReceivedFromTask = 0, ulExpectedReceivedFromISR =
else
{
/* The value was sent from the Tx task. */
- if( ulReceived < queuesetALLOWABLE_RX_DEVIATION )
+ if( ulReceived < queuesetIGNORED_BOUNDARY )
{
/* The value received is at the lower limit of the expected range.
Don't test it, and expect to receive one higher next time. */
ulExpectedReceivedFromTask++;
}
- else if( ( ( queuesetINITIAL_ISR_TX_VALUE - 1 ) - ulReceived ) <= queuesetALLOWABLE_RX_DEVIATION )
+ else if( ( ( queuesetINITIAL_ISR_TX_VALUE - 1 ) - ulReceived ) <= queuesetIGNORED_BOUNDARY )
{
/* The value received is at the higher limit of the expected range.
Don't test it and expect to wrap soon. */
- ulExpectedReceivedFromTask = 0;
+ ulExpectedReceivedFromTask++;
+ if( ulExpectedReceivedFromTask >= queuesetINITIAL_ISR_TX_VALUE )
+ {
+ ulExpectedReceivedFromTask = 0;
+ }
}
else
{
diff --git a/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h b/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h
index 31bb3115e..d0c1f9368 100644
--- a/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h
+++ b/FreeRTOS/Demo/WIN32-MSVC/FreeRTOSConfig.h
@@ -85,7 +85,7 @@
#define configUSE_TICK_HOOK 1
#define configTICK_RATE_HZ ( 1000 ) /* In this non-real time simulated environment the tick frequency has to be at least a multiple of the Win32 tick frequency, and therefore very slow. */
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 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 configTOTAL_HEAP_SIZE ( ( size_t ) ( 20 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 12 )
#define configUSE_TRACE_FACILITY 1
#define configUSE_16_BIT_TICKS 0
diff --git a/FreeRTOS/Demo/WIN32-MSVC/WIN32.suo b/FreeRTOS/Demo/WIN32-MSVC/WIN32.suo
index 4e80022d3..3a7a73946 100644
--- a/FreeRTOS/Demo/WIN32-MSVC/WIN32.suo
+++ b/FreeRTOS/Demo/WIN32-MSVC/WIN32.suo
Binary files differ
diff --git a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj
index 5429533dc..6ea0af09d 100644
--- a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj
+++ b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj
@@ -129,7 +129,7 @@
<ClCompile Include="..\..\..\FreeRTOS-Plus\FreeRTOS-Plus-Trace\trcKernel.c" />
<ClCompile Include="..\..\..\FreeRTOS-Plus\FreeRTOS-Plus-Trace\trcPort.c" />
<ClCompile Include="..\..\..\FreeRTOS-Plus\FreeRTOS-Plus-Trace\trcUser.c" />
- <ClCompile Include="..\..\Source\portable\MemMang\heap_3.c" />
+ <ClCompile Include="..\..\Source\portable\MemMang\heap_4.c" />
<ClCompile Include="..\..\Source\timers.c" />
<ClCompile Include="..\Common\Minimal\BlockQ.c" />
<ClCompile Include="..\Common\Minimal\blocktim.c" />
diff --git a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters
index bbd24de02..1c628ea6a 100644
--- a/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters
+++ b/FreeRTOS/Demo/WIN32-MSVC/WIN32.vcxproj.filters
@@ -49,9 +49,6 @@
<ClCompile Include="..\..\Source\tasks.c">
<Filter>FreeRTOS Source\Source</Filter>
</ClCompile>
- <ClCompile Include="..\..\Source\portable\MemMang\heap_3.c">
- <Filter>FreeRTOS Source\Source</Filter>
- </ClCompile>
<ClCompile Include="..\..\Source\portable\MSVC-MingW\port.c">
<Filter>FreeRTOS Source\Source\Portable</Filter>
</ClCompile>
@@ -115,6 +112,9 @@
<ClCompile Include="Run-time-stats-utils.c">
<Filter>Demo App Source</Filter>
</ClCompile>
+ <ClCompile Include="..\..\Source\portable\MemMang\heap_4.c">
+ <Filter>FreeRTOS Source\Source\Portable</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="FreeRTOSConfig.h">
diff --git a/FreeRTOS/Demo/WIN32-MSVC/main.c b/FreeRTOS/Demo/WIN32-MSVC/main.c
index 2cc0a9b04..9b0164233 100644
--- a/FreeRTOS/Demo/WIN32-MSVC/main.c
+++ b/FreeRTOS/Demo/WIN32-MSVC/main.c
@@ -96,6 +96,7 @@
/* Standard includes. */
#include <stdio.h>
+#include <stdlib.h>
/* Kernel includes. */
#include <FreeRTOS.h>
@@ -292,6 +293,7 @@ const unsigned long ulMSToSleep = 15;
xTaskHandle xIdleTaskHandle, xTimerTaskHandle, xTestTask;
signed char *pcTaskName;
const unsigned char ucConstQueueNumber = 0xaaU, ucConstTaskNumber = 0x55U;
+void *pvAllocated;
/* These three functions are only meant for use by trace code, and not for
direct use from application code, hence their prototypes are not in queue.h. */
@@ -386,13 +388,17 @@ extern unsigned portBASE_TYPE uxTaskGetTaskNumber( xTaskHandle xTask );
}
}
}
+
+ /* Exercise heap_4 a bit. The malloc failed hook will trap failed
+ allocations so there is no need to test here. */
+ pvAllocated = pvPortMalloc( ( rand() % 100 ) + 1 );
+ vPortFree( pvAllocated );
}
/*-----------------------------------------------------------*/
void vApplicationMallocFailedHook( void )
{
- /* Can be implemented if required, but probably not required in this
- environment and running this demo. */
+ vAssertCalled();
}
/*-----------------------------------------------------------*/