/* Add an item to the queue then ensure the queue set correctly\r
indicates that one item is available, and that that item is indeed the\r
queue written to. */\r
- xQueueSend( xQueueHandle, ( void * ) &ulValueToSend, 0 );\r
+ xQueueOverwrite( xQueueHandle, ( void * ) &ulValueToSend );\r
if( uxQueueMessagesWaiting( xQueueSet ) != ( UBaseType_t ) 1 )\r
{\r
/* Expected one item in the queue set. */\r
xBytesToSend = xStringLength - xNextChar;\r
\r
/* Attempt to send right up to the end of the string. */\r
- xBytesActuallySent = xStreamBufferSend( xStreamBuffer, ( void * ) &( pc55ByteString[ xNextChar ] ), xBytesToSend, xTicksToWait );\r
+ xBytesActuallySent = xStreamBufferSend( xStreamBuffer, ( const void * ) &( pc55ByteString[ xNextChar ] ), xBytesToSend, xTicksToWait );\r
configASSERT( xBytesActuallySent <= xBytesToSend );\r
\r
/* Move the index up the string to the next character to be sent,\r
} while( xReceivedLength == 0 );\r
\r
/* Ensure the received string matches the expected string. */\r
- configASSERT( memcmp( ( void * ) cRxString, ( void * ) &( pc55ByteString[ xNextChar ] ), xReceivedLength ) == 0 );\r
+ configASSERT( memcmp( ( void * ) cRxString, ( const void * ) &( pc55ByteString[ xNextChar ] ), xReceivedLength ) == 0 );\r
\r
/* Move the index into the string up to the end of the bytes\r
received so far - wrapping if the end of the string has been\r
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">\r
<storageModule moduleId="org.eclipse.cdt.core.settings">\r
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239">\r
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" moduleId="org.eclipse.cdt.core.settings" name="Debug">\r
+ <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" moduleId="org.eclipse.cdt.core.settings" name="Debug_Full">\r
<externalSettings/>\r
<extensions>\r
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>\r
</extensions>\r
</storageModule>\r
<storageModule moduleId="cdtBuildSystem" version="4.0.0">\r
- <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
+ <configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="Everything Enabled" id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239" name="Debug_Full" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">\r
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239." name="/" resourcePath="">\r
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.1619684599" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">\r
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.1827277435" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>\r
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.500696043" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>\r
</toolChain>\r
</folderInfo>\r
- <folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.396692239.363521217" name="/" resourcePath="FreeRTOS+Trace Recorder/streamports">\r
- <toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.2001714173" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug" unusedChildren="">\r
- <tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.484223068" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.2050893079"/>\r
- <tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1176918279" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base.867063893"/>\r
- <tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1512464009" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1190873987"/>\r
- <tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.666862055" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1285167012"/>\r
- <tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.1503833368" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.2080839343"/>\r
- <tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.2108315890" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.500696043"/>\r
- </toolChain>\r
- </folderInfo>\r
<sourceEntries>\r
<entry excluding="FreeRTOS+Trace Recorder/streamports" flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/>\r
</sourceEntries>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948166</id>\r
+ <id>1520280722235</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948169</id>\r
+ <id>1520280722238</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948172</id>\r
+ <id>1520280722242</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948176</id>\r
+ <id>1520280722245</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948179</id>\r
+ <id>1520280722248</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948183</id>\r
+ <id>1520280722252</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948186</id>\r
+ <id>1520280722255</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948190</id>\r
+ <id>1520280722260</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948195</id>\r
+ <id>1520280722266</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948199</id>\r
+ <id>1520280722269</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948202</id>\r
+ <id>1520280722274</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948213</id>\r
+ <id>1520280722279</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948216</id>\r
+ <id>1520280722282</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948224</id>\r
+ <id>1520280722286</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948228</id>\r
+ <id>1520280722289</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948231</id>\r
+ <id>1520280722292</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948235</id>\r
+ <id>1520280722296</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948237</id>\r
+ <id>1520280722342</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948240</id>\r
+ <id>1520280722367</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948242</id>\r
+ <id>1520280722370</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948269</id>\r
+ <id>1520280722374</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948274</id>\r
+ <id>1520280722380</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948277</id>\r
+ <id>1520280722384</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948281</id>\r
+ <id>1520280722388</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
</matcher>\r
</filter>\r
<filter>\r
- <id>1519407948286</id>\r
+ <id>1520280722391</id>\r
<name>Standard_Demo_Tasks</name>\r
<type>5</type>\r
<matcher>\r
<arguments>1.0-name-matches-false-false-MessageBufferAMP.c</arguments>\r
</matcher>\r
</filter>\r
+ <filter>\r
+ <id>1520280722395</id>\r
+ <name>Standard_Demo_Tasks</name>\r
+ <type>5</type>\r
+ <matcher>\r
+ <id>org.eclipse.ui.ide.multiFilter</id>\r
+ <arguments>1.0-name-matches-false-false-StaticAllocation.c</arguments>\r
+ </matcher>\r
+ </filter>\r
<filter>\r
<id>0</id>\r
<name>FreeRTOS_Source/portable</name>\r
#define configUSE_ALTERNATIVE_API 0\r
#define configUSE_QUEUE_SETS 1\r
#define configUSE_TASK_NOTIFICATIONS 1\r
-#define configSUPPORT_STATIC_ALLOCATION 0\r
+#define configSUPPORT_STATIC_ALLOCATION 1\r
\r
/* Software timer related configuration options. */\r
#define configUSE_TIMERS 1\r
extern void vAssertCalled( unsigned long ulLine, const char * const pcFileName );\r
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled( __LINE__, __FILE__ )\r
\r
-#define configINCLUDE_MESSAGE_BUFFER_AMP_DEMO 1\r
+#define configINCLUDE_MESSAGE_BUFFER_AMP_DEMO 0\r
#if ( configINCLUDE_MESSAGE_BUFFER_AMP_DEMO == 1 )\r
extern void vGenerateCoreBInterrupt( void * xUpdatedMessageBuffer );\r
#define sbSEND_COMPLETED( pxStreamBuffer ) vGenerateCoreBInterrupt( pxStreamBuffer )\r
as this demo could easily create one large heap region instead of multiple\r
smaller heap regions - in which case heap_4.c would be the more appropriate\r
choice. See http://www.freertos.org/a00111.html for an explanation. */\r
-#define mainREGION_1_SIZE 7201\r
+#define mainREGION_1_SIZE 8201\r
#define mainREGION_2_SIZE 29905\r
-#define mainREGION_3_SIZE 6407\r
+#define mainREGION_3_SIZE 6007\r
\r
/*-----------------------------------------------------------*/\r
\r
void vApplicationIdleHook( void );\r
void vApplicationStackOverflowHook( TaskHandle_t pxTask, char *pcTaskName );\r
void vApplicationTickHook( void );\r
+void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize );\r
+void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize );\r
\r
/*\r
* Writes trace data to a disk file when the trace recording is stopped.\r
*/\r
static void prvSaveTraceFile( void );\r
\r
+/*-----------------------------------------------------------*/\r
+\r
+/* When configSUPPORT_STATIC_ALLOCATION is set to 1 the application writer can\r
+use a callback function to optionally provide the memory required by the idle\r
+and timer tasks. This is the stack that will be used by the timer task. It is\r
+declared here, as a global, so it can be checked by a test that is implemented\r
+in a different file. */\r
+StackType_t uxTimerTaskStack[ configTIMER_TASK_STACK_DEPTH ];\r
+\r
/* Notes if the trace is running or not. */\r
static BaseType_t xTraceRunning = pdTRUE;\r
\r
vPortDefineHeapRegions( xHeapRegions );\r
}\r
/*-----------------------------------------------------------*/\r
+\r
+/* configUSE_STATIC_ALLOCATION is set to 1, so the application must provide an\r
+implementation of vApplicationGetIdleTaskMemory() to provide the memory that is\r
+used by the Idle task. */\r
+void vApplicationGetIdleTaskMemory( StaticTask_t **ppxIdleTaskTCBBuffer, StackType_t **ppxIdleTaskStackBuffer, uint32_t *pulIdleTaskStackSize )\r
+{\r
+/* If the buffers to be provided to the Idle task are declared inside this\r
+function then they must be declared static - otherwise they will be allocated on\r
+the stack and so not exists after this function exits. */\r
+static StaticTask_t xIdleTaskTCB;\r
+static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];\r
+\r
+ /* Pass out a pointer to the StaticTask_t structure in which the Idle task's\r
+ state will be stored. */\r
+ *ppxIdleTaskTCBBuffer = &xIdleTaskTCB;\r
+\r
+ /* Pass out the array that will be used as the Idle task's stack. */\r
+ *ppxIdleTaskStackBuffer = uxIdleTaskStack;\r
+\r
+ /* Pass out the size of the array pointed to by *ppxIdleTaskStackBuffer.\r
+ Note that, as the array is necessarily of type StackType_t,\r
+ configMINIMAL_STACK_SIZE is specified in words, not bytes. */\r
+ *pulIdleTaskStackSize = configMINIMAL_STACK_SIZE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+/* configUSE_STATIC_ALLOCATION and configUSE_TIMERS are both set to 1, so the\r
+application must provide an implementation of vApplicationGetTimerTaskMemory()\r
+to provide the memory that is used by the Timer service task. */\r
+void vApplicationGetTimerTaskMemory( StaticTask_t **ppxTimerTaskTCBBuffer, StackType_t **ppxTimerTaskStackBuffer, uint32_t *pulTimerTaskStackSize )\r
+{\r
+/* If the buffers to be provided to the Timer task are declared inside this\r
+function then they must be declared static - otherwise they will be allocated on\r
+the stack and so not exists after this function exits. */\r
+static StaticTask_t xTimerTaskTCB;\r
+\r
+ /* Pass out a pointer to the StaticTask_t structure in which the Timer\r
+ task's state will be stored. */\r
+ *ppxTimerTaskTCBBuffer = &xTimerTaskTCB;\r
+\r
+ /* Pass out the array that will be used as the Timer task's stack. */\r
+ *ppxTimerTaskStackBuffer = uxTimerTaskStack;\r
+\r
+ /* Pass out the size of the array pointed to by *ppxTimerTaskStackBuffer.\r
+ Note that, as the array is necessarily of type StackType_t,\r
+ configMINIMAL_STACK_SIZE is specified in words, not bytes. */\r
+ *pulTimerTaskStackSize = configTIMER_TASK_STACK_DEPTH;\r
+}\r
+\r
\r
/* Kernel includes. */\r
#include <FreeRTOS.h>\r
-#include "task.h"\r
-#include "queue.h"\r
-#include "timers.h"\r
-#include "semphr.h"\r
+#include <task.h>\r
+#include <queue.h>\r
+#include <timers.h>\r
+#include <semphr.h>\r
\r
/* Standard demo includes. */\r
#include "BlockQ.h"\r
#include "IntSemTest.h"\r
#include "TaskNotify.h"\r
#include "QueueSetPolling.h"\r
+#include "StaticAllocation.h"\r
#include "blocktim.h"\r
#include "AbortDelay.h"\r
#include "MessageBufferDemo.h"\r
vStartStreamBufferInterruptDemo();\r
vStartMessageBufferAMPTasks();\r
\r
+ #if( configSUPPORT_STATIC_ALLOCATION == 1 )\r
+ {\r
+ vStartStaticallyAllocatedTasks();\r
+ }\r
+ #endif\r
+\r
#if( configUSE_PREEMPTION != 0 )\r
{\r
/* Don't expect these tasks to pass when preemption is not used. */\r
static portBASE_TYPE xPerformedOneShotTests = pdFALSE;\r
TaskHandle_t xTestTask;\r
TaskStatus_t xTaskInfo;\r
+extern StackType_t uxTimerTaskStack[];\r
\r
/* Demonstrate the use of the xTimerGetTimerDaemonTaskHandle() and\r
xTaskGetIdleTaskHandle() functions. Also try using the function that sets\r
if( ( xTaskInfo.eCurrentState != eBlocked ) ||\r
( strcmp( xTaskInfo.pcTaskName, "Tmr Svc" ) != 0 ) ||\r
( xTaskInfo.uxCurrentPriority != configTIMER_TASK_PRIORITY ) ||\r
+ ( xTaskInfo.pxStackBase != uxTimerTaskStack ) ||\r
( xTaskInfo.xHandle != xTimerTaskHandle ) )\r
{\r
pcStatusMessage = "Error: vTaskGetInfo() returned incorrect information about the timer task";\r