/*\r
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
\r
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT \r
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
***************************************************************************\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
- and contact details. \r
- \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+ and contact details.\r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
#define configUSE_TRACE_FACILITY 1\r
#define configUSE_16_BIT_TICKS 0\r
#define configIDLE_SHOULD_YIELD 0\r
-#define configUSE_CO_ROUTINES 0\r
+#define configUSE_CO_ROUTINES 1\r
#define configUSE_MUTEXES 1\r
#define configUSE_RECURSIVE_MUTEXES 1\r
#define configCHECK_FOR_STACK_OVERFLOW 2\r
+#define configUSE_QUEUE_SETS 1\r
+#define configUSE_COUNTING_SEMAPHORES 1\r
+#define configUSE_ALTERNATIVE_API 1\r
\r
#define configMAX_PRIORITIES ( 5UL )\r
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
-#define configQUEUE_REGISTRY_SIZE 10\r
+#define configQUEUE_REGISTRY_SIZE 10\r
+\r
+/* Timer related defines. */\r
+#define configUSE_TIMERS 1\r
+#define configTIMER_TASK_PRIORITY 2\r
+#define configTIMER_QUEUE_LENGTH 20\r
+#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )\r
\r
/* Set the following definitions to 1 to include the API function, or zero\r
to exclude the API function. */\r
\r
-#define INCLUDE_vTaskPrioritySet 1\r
-#define INCLUDE_uxTaskPriorityGet 1\r
-#define INCLUDE_vTaskDelete 1\r
-#define INCLUDE_vTaskCleanUpResources 0\r
-#define INCLUDE_vTaskSuspend 1\r
-#define INCLUDE_vTaskDelayUntil 1\r
-#define INCLUDE_vTaskDelay 1\r
-#define INCLUDE_uxTaskGetStackHighWaterMark 1\r
-\r
-\r
+#define INCLUDE_vTaskPrioritySet 1\r
+#define INCLUDE_uxTaskPriorityGet 1\r
+#define INCLUDE_vTaskDelete 1\r
+#define INCLUDE_vTaskCleanUpResources 0\r
+#define INCLUDE_vTaskSuspend 1\r
+#define INCLUDE_vTaskDelayUntil 1\r
+#define INCLUDE_vTaskDelay 1\r
+#define INCLUDE_uxTaskGetStackHighWaterMark 1\r
+#define INCLUDE_xTaskGetSchedulerState 1\r
+#define INCLUDE_xTimerGetTimerDaemonTaskHandle 1\r
+#define INCLUDE_xTaskGetIdleTaskHandle 1\r
+#define INCLUDE_pcTaskGetTaskName 1\r
+#define INCLUDE_eTaskGetState 1\r
+#define INCLUDE_xSemaphoreGetMutexHolder 1\r
\r
#define configKERNEL_INTERRUPT_PRIORITY ( 7 << 5 ) /* Priority 7, or 255 as only the top three bits are implemented. This is the lowest priority. */\r
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!\r
</option>\r
<option>\r
<name>Variant</name>\r
- <version>19</version>\r
- <state>37</state>\r
+ <version>20</version>\r
+ <state>38</state>\r
</option>\r
<option>\r
<name>GEndianMode</name>\r
</option>\r
<option>\r
<name>OGLastSavedByProductVersion</name>\r
- <state>6.30.7.53437</state>\r
+ <state>6.50.1.4445</state>\r
</option>\r
<option>\r
<name>GeneralEnableMisra</name>\r
</option>\r
<option>\r
<name>OGChipSelectEditMenu</name>\r
- <state>LM3Sx9xx Luminary LM3Sx9xx</state>\r
+ <state>LM3S6965 TexasInstruments LM3S6965</state>\r
</option>\r
<option>\r
<name>GenLowLevelInterface</name>\r
</option>\r
<option>\r
<name>GFPUCoreSlave</name>\r
- <version>19</version>\r
- <state>37</state>\r
+ <version>20</version>\r
+ <state>38</state>\r
</option>\r
<option>\r
<name>GBECoreSlave</name>\r
- <version>19</version>\r
- <state>37</state>\r
+ <version>20</version>\r
+ <state>38</state>\r
</option>\r
<option>\r
<name>OGUseCmsis</name>\r
<version>28</version>\r
<wantNonLocal>1</wantNonLocal>\r
<debug>1</debug>\r
+ <option>\r
+ <name>CCOptimizationNoSizeConstraints</name>\r
+ <state>0</state>\r
+ </option>\r
<option>\r
<name>CCDefines</name>\r
<state>IAR_ARMCM3_LM</state>\r
</option>\r
<option>\r
<name>CCDiagSuppress</name>\r
- <state>pa082, pe513, pe167, pe550, pe144, pe191, pe177, pa039, pa050</state>\r
+ <state>pe550, pe144, pa039</state>\r
</option>\r
<option>\r
<name>CCDiagRemark</name>\r
<file>\r
<name>$PROJ_DIR$\..\Common\Minimal\QPeek.c</name>\r
</file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\QueueSet.c</name>\r
+ </file>\r
<file>\r
<name>$PROJ_DIR$\..\Common\Minimal\recmutex.c</name>\r
</file>\r
</group>\r
<group>\r
<name>Scheduler files</name>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\croutine.c</name>\r
+ </file>\r
<file>\r
<name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_4.c</name>\r
</file>\r
<file>\r
<name>$PROJ_DIR$\..\..\Source\tasks.c</name>\r
</file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\timers.c</name>\r
+ </file>\r
</group>\r
<group>\r
<name>System files</name>\r
/*\r
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
\r
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT \r
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
***************************************************************************\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
- and contact details. \r
- \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+ and contact details.\r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
#include "QPeek.h"\r
#include "recmutex.h"\r
#include "IntQueue.h"\r
+#include "QueueSet.h"\r
\r
/*-----------------------------------------------------------*/\r
\r
vStartIntegerMathTasks( mainINTEGER_TASK_PRIORITY );\r
vStartGenericQueueTasks( mainGEN_QUEUE_TASK_PRIORITY );\r
vStartInterruptQueueTasks();\r
- vStartRecursiveMutexTasks(); \r
+ vStartRecursiveMutexTasks();\r
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );\r
vCreateBlockTimeTasks();\r
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
- vStartQueuePeekTasks(); \r
+ vStartQueuePeekTasks();\r
+ vStartQueueSetTasks();\r
\r
/* Exclude some tasks if using the kickstart version to ensure we stay within\r
the 32K code size limit. */\r
}\r
}\r
#endif\r
- \r
- \r
- \r
+\r
+\r
+\r
/* Start the tasks defined within this file/specific to this demo. */\r
xTaskCreate( vOLEDTask, ( signed portCHAR * ) "OLED", mainOLED_TASK_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );\r
\r
{\r
SysCtlLDOSet( SYSCTL_LDO_2_75V );\r
}\r
- \r
+\r
/* Set the clocking to run from the PLL at 50 MHz */\r
SysCtlClockSet( SYSCTL_SYSDIV_4 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ );\r
- \r
+\r
/* Enable Port F for Ethernet LEDs\r
LED0 Bit 3 Output\r
LED1 Bit 2 Output */\r
SysCtlPeripheralEnable( SYSCTL_PERIPH_GPIOF );\r
GPIODirModeSet( GPIO_PORTF_BASE, (GPIO_PIN_2 | GPIO_PIN_3), GPIO_DIR_MODE_HW );\r
- GPIOPadConfigSet( GPIO_PORTF_BASE, (GPIO_PIN_2 | GPIO_PIN_3 ), GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD ); \r
- \r
+ GPIOPadConfigSet( GPIO_PORTF_BASE, (GPIO_PIN_2 | GPIO_PIN_3 ), GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD );\r
+\r
vParTestInitialise();\r
}\r
/*-----------------------------------------------------------*/\r
if( ulTicksSinceLastDisplay >= mainCHECK_DELAY )\r
{\r
ulTicksSinceLastDisplay = 0;\r
- \r
+\r
/* Has an error been found in any task? */\r
if( xAreGenericQueueTasksStillRunning() != pdTRUE )\r
{\r
else if( xAreQueuePeekTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN PEEK Q";\r
- } \r
+ }\r
else if( xAreRecursiveMutexTasksStillRunning() != pdTRUE )\r
{\r
xMessage.pcMessage = "ERROR IN REC MUTEX";\r
- } \r
- \r
+ }\r
+ else if( xAreQueueSetTasksStillRunning() != pdPASS )\r
+ {\r
+ xMessage.pcMessage = "ERROR IN Q SET";\r
+ }\r
+\r
/* Send the message to the OLED gatekeeper for display. */\r
xHigherPriorityTaskWoken = pdFALSE;\r
xQueueSendFromISR( xOLEDQueue, &xMessage, &xHigherPriorityTaskWoken );\r
}\r
+\r
+ /* Write to a queue that is in use as part of the queue set demo to\r
+ demonstrate using queue sets from an ISR. */\r
+ vQueueSetAccessQueueSetFromISR();\r
}\r
/*-----------------------------------------------------------*/\r
\r
unsigned portLONG ulY, ulMaxY;\r
static portCHAR cMessage[ mainMAX_MSG_LEN ];\r
extern volatile unsigned portLONG ulMaxJitter;\r
-unsigned portBASE_TYPE uxUnusedStackOnEntry;\r
const unsigned portCHAR *pucImage;\r
\r
/* Functions to access the OLED. The one used depends on the dev kit\r
void ( *vOLEDImageDraw )( const unsigned portCHAR *, unsigned portLONG, unsigned portLONG, unsigned portLONG, unsigned portLONG ) = NULL;\r
void ( *vOLEDClear )( void ) = NULL;\r
\r
- /* Just for demo purposes. */\r
- uxUnusedStackOnEntry = uxTaskGetStackHighWaterMark( NULL );\r
-\r
/* Map the OLED access functions to the driver functions that are appropriate\r
- for the evaluation kit being used. */ \r
+ for the evaluation kit being used. */\r
switch( HWREG( SYSCTL_DID1 ) & SYSCTL_DID1_PRTNO_MASK )\r
{\r
- case SYSCTL_DID1_PRTNO_6965 : \r
+ case SYSCTL_DID1_PRTNO_6965 :\r
case SYSCTL_DID1_PRTNO_2965 : vOLEDInit = OSRAM128x64x4Init;\r
vOLEDStringDraw = OSRAM128x64x4StringDraw;\r
vOLEDImageDraw = OSRAM128x64x4ImageDraw;\r
ulMaxY = mainMAX_ROWS_64;\r
pucImage = pucBasicBitmap;\r
break;\r
- \r
- case SYSCTL_DID1_PRTNO_1968 : \r
+\r
+ case SYSCTL_DID1_PRTNO_1968 :\r
case SYSCTL_DID1_PRTNO_8962 : vOLEDInit = RIT128x96x4Init;\r
vOLEDStringDraw = RIT128x96x4StringDraw;\r
vOLEDImageDraw = RIT128x96x4ImageDraw;\r
ulMaxY = mainMAX_ROWS_96;\r
pucImage = pucBasicBitmap;\r
break;\r
- \r
+\r
default : vOLEDInit = vFormike128x128x16Init;\r
vOLEDStringDraw = vFormike128x128x16StringDraw;\r
vOLEDImageDraw = vFormike128x128x16ImageDraw;\r
ulMaxY = mainMAX_ROWS_128;\r
pucImage = pucGrLibBitmap;\r
break;\r
- \r
+\r
}\r
\r
ulY = ulMaxY;\r
- \r
+\r
/* Initialise the OLED and display a startup message. */\r
- vOLEDInit( ulSSI_FREQUENCY ); \r
+ vOLEDInit( ulSSI_FREQUENCY );\r
vOLEDStringDraw( "POWERED BY FreeRTOS", 0, 0, mainFULL_SCALE );\r
vOLEDImageDraw( pucImage, 0, mainCHARACTER_HEIGHT + 1, bmpBITMAP_WIDTH, bmpBITMAP_HEIGHT );\r
- \r
+\r
for( ;; )\r
{\r
/* Wait for a message to arrive that requires displaying. */\r
xQueueReceive( xOLEDQueue, &xMessage, portMAX_DELAY );\r
- \r
+\r
/* Write the message on the next available row. */\r
ulY += mainCHARACTER_HEIGHT;\r
if( ulY >= ulMaxY )\r
{\r
ulY = mainCHARACTER_HEIGHT;\r
vOLEDClear();\r
- vOLEDStringDraw( pcWelcomeMessage, 0, 0, mainFULL_SCALE ); \r
+ vOLEDStringDraw( pcWelcomeMessage, 0, 0, mainFULL_SCALE );\r
}\r
\r
/* Display the message along with the maximum jitter time from the\r
@REM \r
\r
\r
-"C:\devtools\IAR Systems\Embedded Workbench 6.0\common\bin\cspybat" "C:\devtools\IAR Systems\Embedded Workbench 6.0\arm\bin\armproc.dll" "C:\devtools\IAR Systems\Embedded Workbench 6.0\arm\bin\armlmiftdi.dll" %1 --plugin "C:\devtools\IAR Systems\Embedded Workbench 6.0\arm\bin\armbat.dll" --flash_loader "C:\devtools\IAR Systems\Embedded Workbench 6.0\arm\config\flashloader\TexasInstruments\FlashLM3Sx8xx.board" --backend -B "--endian=little" "--cpu=Cortex-M3" "--fpu=None" "-p" "C:\devtools\IAR Systems\Embedded Workbench 6.0\arm\CONFIG\debugger\TexasInstruments\iolm3sxxxx.ddf" "--drv_verify_download" "--semihosting=none" "--device=LM3Sx9xx" "--lmiftdi_speed=500" \r
+"C:\devtools\IAR Systems\Embedded Workbench 6.5\common\bin\cspybat" "C:\devtools\IAR Systems\Embedded Workbench 6.5\arm\bin\armproc.dll" "C:\devtools\IAR Systems\Embedded Workbench 6.5\arm\bin\armlmiftdi.dll" %1 --plugin "C:\devtools\IAR Systems\Embedded Workbench 6.5\arm\bin\armbat.dll" --flash_loader "C:\devtools\IAR Systems\Embedded Workbench 6.5\arm\config\flashloader\TexasInstruments\FlashLM3Sx8xx.board" --backend -B "--endian=little" "--cpu=Cortex-M3" "--fpu=None" "-p" "C:\devtools\IAR Systems\Embedded Workbench 6.5\arm\CONFIG\debugger\TexasInstruments\LM3S6965.ddf" "--drv_verify_download" "--semihosting=none" "--device=LM3S6965" "--lmiftdi_speed=500" \r
\r
\r
<Windows>\r
\r
\r
- <Wnd2>\r
+ <Wnd0>\r
<Tabs>\r
<Tab>\r
<Identity>TabID-10465-12018</Identity>\r
<Factory>Build</Factory>\r
<Session/>\r
</Tab>\r
- </Tabs>\r
+ <Tab><Identity>TabID-31294-227</Identity><TabName>Breakpoints</TabName><Factory>Breakpoints</Factory></Tab></Tabs>\r
\r
- <SelectedTab>0</SelectedTab></Wnd2><Wnd4>\r
+ <SelectedTab>2</SelectedTab></Wnd0><Wnd1>\r
<Tabs>\r
<Tab>\r
<Identity>TabID-21213-12021</Identity>\r
</Tab>\r
</Tabs>\r
\r
- <SelectedTab>0</SelectedTab></Wnd4></Windows>\r
+ <SelectedTab>0</SelectedTab></Wnd1></Windows>\r
<Editor>\r
\r
\r
\r
\r
- <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>239</YPos><SelStart>11530</SelStart><SelEnd>11539</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\portmacro.h</Filename><XPos>0</XPos><YPos>104</YPos><SelStart>6155</SelStart><SelEnd>6155</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>96</YPos><SelStart>5044</SelStart><SelEnd>5044</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>473</YPos><SelStart>21918</SelStart><SelEnd>21918</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c</Filename><XPos>0</XPos><YPos>162</YPos><SelStart>7773</SelStart><SelEnd>7773</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\list.c</Filename><XPos>0</XPos><YPos>148</YPos><SelStart>7981</SelStart><SelEnd>7981</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\uIP_Task.c</Filename><XPos>0</XPos><YPos>123</YPos><SelStart>6722</SelStart><SelEnd>6722</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\emac.c</Filename><XPos>0</XPos><YPos>215</YPos><SelStart>8795</SelStart><SelEnd>8795</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\startup_ewarm.c</Filename><XPos>0</XPos><YPos>136</YPos><SelStart>7437</SelStart><SelEnd>7441</SelEnd></Tab><ActiveTab>8</ActiveTab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
+ <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>225</YPos2><SelStart2>10984</SelStart2><SelEnd2>10984</SelEnd2></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\portmacro.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>55</YPos2><SelStart2>5182</SelStart2><SelEnd2>5187</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\list.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\uIP_Task.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\emac.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\startup_ewarm.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\Common\Minimal\QueueSet.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>549</YPos2><SelStart2>20567</SelStart2><SelEnd2>20567</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
<Positions>\r
\r
\r
\r
\r
\r
- <Top><Row0><Sizes><Toolbar-01349300><key>iaridepm.enu1</key></Toolbar-01349300><Toolbar-04ca1b78><key>debuggergui.enu1</key></Toolbar-04ca1b78></Sizes></Row0></Top><Left><Row0><Sizes><Wnd4><Rect><Top>-2</Top><Left>-2</Left><Bottom>740</Bottom><Right>238</Right><x>-2</x><y>-2</y><xscreen>240</xscreen><yscreen>200</yscreen><sizeHorzCX>142857</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>142857</sizeVertCX><sizeVertCY>755601</sizeVertCY></Rect></Wnd4></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>142857</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd2></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
+ <Top><Row0><Sizes><Toolbar-013491a0><key>iaridepm.enu1</key></Toolbar-013491a0><Toolbar-05268ed0><key>debuggergui.enu1</key></Toolbar-05268ed0></Sizes></Row0></Top><Left><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>740</Bottom><Right>238</Right><x>-2</x><y>-2</y><xscreen>240</xscreen><yscreen>200</yscreen><sizeHorzCX>142857</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>142857</sizeVertCX><sizeVertCY>755601</sizeVertCY></Rect></Wnd1></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>198</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>200</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>142857</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd0></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
</Desktop>\r
</Project>\r
\r
[LMIFTDIDriver]\r
LMI_ResetMode=0x00000000\r
[DebugChecksum]\r
-Checksum=-644613366\r
+Checksum=-42454089\r
[Exceptions]\r
StopOnUncaught=_ 0\r
StopOnThrow=_ 0\r
[Disassemble mode]\r
mode=1\r
[Breakpoints]\r
-Bp0=_ "STD_CODE" "{$PROJ_DIR$\..\..\..\WorkingCopy2\Demo\Common\Minimal\IntQueue.c}.363.2@1" 0 0 0 0 "" 0 ""\r
-Bp1=_ "STD_CODE" "{$PROJ_DIR$\webserver\uIP_Task.c}.197.4" 1 0 0 0 "" 0 ""\r
-Count=2\r
+Count=0\r
[Aliases]\r
Count=0\r
SuppressDialog=0\r
\r
\r
\r
- <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>239</YPos><SelStart>11530</SelStart><SelEnd>11539</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\portmacro.h</Filename><XPos>0</XPos><YPos>125</YPos><SelStart>6155</SelStart><SelEnd>6155</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>96</YPos><SelStart>6091</SelStart><SelEnd>6091</SelEnd></Tab><ActiveTab>2</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>473</YPos><SelStart>21918</SelStart><SelEnd>21918</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c</Filename><XPos>0</XPos><YPos>162</YPos><SelStart>7773</SelStart><SelEnd>7773</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\list.c</Filename><XPos>0</XPos><YPos>148</YPos><SelStart>7981</SelStart><SelEnd>7981</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\uIP_Task.c</Filename><XPos>0</XPos><YPos>123</YPos><SelStart>6722</SelStart><SelEnd>6722</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\emac.c</Filename><XPos>0</XPos><YPos>215</YPos><SelStart>8795</SelStart><SelEnd>8795</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\startup_ewarm.c</Filename><XPos>0</XPos><YPos>136</YPos><SelStart>7437</SelStart><SelEnd>7441</SelEnd></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
+ <Pane><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\main.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>225</YPos2><SelStart2>10984</SelStart2><SelEnd2>10984</SelEnd2></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\portmacro.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\FreeRTOSConfig.h</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>55</YPos2><SelStart2>5182</SelStart2><SelEnd2>5187</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\tasks.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\portable\IAR\ARM_CM3\port.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\..\Source\list.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\uIP_Task.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\webserver\emac.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\startup_ewarm.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>0</YPos2><SelStart2>0</SelStart2><SelEnd2>0</SelEnd2></Tab><Tab><Factory>TextEditor</Factory><Filename>$WS_DIR$\..\Common\Minimal\QueueSet.c</Filename><XPos>0</XPos><YPos>0</YPos><SelStart>0</SelStart><SelEnd>0</SelEnd><XPos2>0</XPos2><YPos2>549</YPos2><SelStart2>20567</SelStart2><SelEnd2>20567</SelEnd2></Tab></Pane><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>\r
<Positions>\r
\r
\r
\r
\r
\r
- <Top><Row0><Sizes><Toolbar-01349300><key>iaridepm.enu1</key></Toolbar-01349300></Sizes></Row0><Row1><Sizes/></Row1></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>760</Bottom><Right>315</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>119048</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>188690</sizeVertCX><sizeVertCY>775967</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>178</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>180</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>183299</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
+ <Top><Row0><Sizes><Toolbar-013491a0><key>iaridepm.enu1</key></Toolbar-013491a0></Sizes></Row0><Row1><Sizes/></Row1><Row2><Sizes/></Row2></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>719</Bottom><Right>315</Right><x>-2</x><y>-2</y><xscreen>200</xscreen><yscreen>200</yscreen><sizeHorzCX>119048</sizeHorzCX><sizeHorzCY>203666</sizeHorzCY><sizeVertCX>188690</sizeVertCX><sizeVertCY>734216</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>219</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>221</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>225051</sizeHorzCY><sizeVertCX>119048</sizeVertCX><sizeVertCY>203666</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
</Desktop>\r
</Workspace>\r
\r
#define configGENERATE_RUN_TIME_STATS 1\r
#define configUSE_MALLOC_FAILED_HOOK 1\r
#define configUSE_QUEUE_SETS 1\r
+#define configUSE_COUNTING_SEMAPHORES 1\r
+#define configUSE_ALTERNATIVE_API 1\r
\r
#define configMAX_PRIORITIES ( 5UL )\r
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
\r
+/* Software timer related constants. */\r
+#define configUSE_TIMERS 0\r
+#define configTIMER_TASK_PRIORITY 2\r
+#define configTIMER_QUEUE_LENGTH 20\r
+#define configTIMER_TASK_STACK_DEPTH ( configMINIMAL_STACK_SIZE * 2 )\r
+\r
+\r
/* Set the following definitions to 1 to include the API function, or zero\r
to exclude the API function. */\r
\r
#define INCLUDE_vTaskDelayUntil 1\r
#define INCLUDE_vTaskDelay 1\r
#define INCLUDE_uxTaskGetStackHighWaterMark 1\r
-\r
-\r
+#define INCLUDE_xSemaphoreGetMutexHolder 1\r
\r
#define configKERNEL_INTERRUPT_PRIORITY ( ( unsigned char ) 7 << ( unsigned char ) 5 ) /* Priority 7, or 255 as only the top three bits are implemented. This is the lowest priority. */\r
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!\r
<configuration Name="RAM" Placement="RAM" linker_section_placement_file="$(PackagesDir)/targets/Luminary_LM3S/ram_placement.xml" target_reset_script="RAMReset()"/>
<folder Name="Source Files">
<configuration Name="Common" filter="c;cpp;cxx;cc;h;s;asm;inc"/>
- <folder Name="FreeRTOS">
+ <folder Name="FreeRTOS" file_name="">
<folder Name="include">
<file file_name="../../Source/portable/GCC/ARM_CM3/portmacro.h"/>
<file file_name="../../Source/include/task.h"/>
<session>
<Bookmarks/>
<Breakpoints/>
- <ETMWindow>
- <ETMRegister number="0" value="800" />
- <ETMRegister number="8" value="6f" />
- <ETMRegister number="9" value="1000000" />
- </ETMWindow>
- <ExecutionCountWindow/>
+ <ExecutionProfileWindow/>
<Memory1>
- <MemoryWindow autoEvaluate="0" addressText="0x200002d0" numColumns="8" sizeText="120" dataSize="1" radix="16" addressSpace="" />
+ <MemoryWindow autoEvaluate="0" addressText="0x200002d0" numColumns="8" sizeText="120" dataSize="1" radix="16" name="RTOSDemo" addressSpace="" />
</Memory1>
<Memory2>
- <MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
+ <MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" name="RTOSDemo" addressSpace="" />
</Memory2>
<Memory3>
- <MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
+ <MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" name="RTOSDemo" addressSpace="" />
</Memory3>
<Memory4>
- <MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" addressSpace="" />
+ <MemoryWindow autoEvaluate="0" addressText="" numColumns="8" sizeText="" dataSize="1" radix="16" name="RTOSDemo" addressSpace="" />
</Memory4>
<Project>
<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;include" name="unnamed" />
+ <ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;FreeRTOS" name="unnamed" />
+ <ProjectSessionItem path="RTOSDemo;RTOSDemo;Source Files;FreeRTOS;include" name="unnamed" />
+ <ProjectSessionItem path="RTOSDemo;RTOSDemo;System Files" name="unnamed" />
</Project>
<Register1>
- <RegisterWindow openNodes="CPU;CPU/xPSR;CPU/CFBP" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="CPU" decimalNodes="" octalNodes="" asciiNodes="" />
+ <RegisterWindow openNodes="CPU;CPU/xPSR;CPU/CFBP" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="CPU" decimalNodes="" octalNodes="" asciiNodes="" name="RTOSDemo" />
</Register1>
<Register2>
- <RegisterWindow openNodes="" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
+ <RegisterWindow openNodes="" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" name="RTOSDemo" />
</Register2>
<Register3>
- <RegisterWindow openNodes="" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
+ <RegisterWindow openNodes="" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" name="RTOSDemo" />
</Register3>
<Register4>
- <RegisterWindow openNodes="" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" />
+ <RegisterWindow openNodes="" binaryNodes="" hiddenNodes="" unsignedNodes="" visibleGroups="" decimalNodes="" octalNodes="" asciiNodes="" name="RTOSDemo" />
</Register4>
<TargetWindow programAction="" uploadFileType="" programLoadAddress="" programSize="" uploadFileName="" uploadMemoryInterface="" programFileName="" uploadStartAddress="" programFileType="" uploadSize="" programMemoryInterface="" />
<TraceWindow>
<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="241" path="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Demo\CORTEX_LM3Sxxxx_Rowley\main.c" left="0" selected="1" name="unnamed" top="59" />
+ <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="63" />
</Files>
- <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" />
+ <ARMCrossStudioWindow activeProject="RTOSDemo" autoConnectTarget="Luminary USB Debug" debugSearchFileMap="" fileDialogInitialDirectory="C:\E\Dev\FreeRTOS\WorkingCopy\FreeRTOS\Source" fileDialogDefaultFilter="*.*" autoConnectCapabilities="388991" debugSearchPath="" buildConfiguration="THUMB Flash Debug" />
</session>
static void prvSetupTest( xTaskHandle xQueueSetSendingTask )\r
{\r
portBASE_TYPE x;\r
-xQueueSetMemberHandle xActivatedQueue;\r
\r
/* Ensure the queues are created and the queue set configured before the\r
sending task is unsuspended.\r
}\r
\r
/* The task that sends to the queues is not running yet, so attempting to\r
- read from the queue set should fail, resulting in xActivatedQueue being set\r
- to NULL. */\r
- xActivatedQueue = xQueueSelectFromSet( xQueueSet, queuesetSHORT_DELAY );\r
- configASSERT( xActivatedQueue == NULL );\r
+ read from the queue set should fail. */\r
+ if( xQueueSelectFromSet( xQueueSet, queuesetSHORT_DELAY ) != NULL )\r
+ {\r
+ xQueueSetTasksStatus = pdFAIL;\r
+ }\r
\r
/* Resume the task that writes to the queues. */\r
vTaskResume( xQueueSetSendingTask );\r
#define configUSE_TRACE_FACILITY 1\r
#define configUSE_16_BIT_TICKS 0\r
#define configIDLE_SHOULD_YIELD 1\r
-#define configUSE_CO_ROUTINES 0\r
#define configUSE_MUTEXES 1\r
#define configCHECK_FOR_STACK_OVERFLOW 0\r
#define configUSE_RECURSIVE_MUTEXES 1\r
-#define configQUEUE_REGISTRY_SIZE 0\r
+#define configQUEUE_REGISTRY_SIZE 20\r
#define configUSE_MALLOC_FAILED_HOOK 1\r
-#define configUSE_APPLICATION_TASK_TAG 0\r
+#define configUSE_APPLICATION_TASK_TAG 1\r
#define configUSE_COUNTING_SEMAPHORES 1\r
#define configUSE_ALTERNATIVE_API 1\r
#define configUSE_QUEUE_SETS 1\r
#define portGET_RUN_TIME_COUNTER_VALUE() ulGetRunTimeCounterValue()\r
\r
/* Co-routine definitions. */\r
-#define configUSE_CO_ROUTINES 0\r
+#define configUSE_CO_ROUTINES 1\r
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )\r
\r
/* Set the following definitions to 1 to include the API function, or zero\r
#define INCLUDE_xTaskGetIdleTaskHandle 1\r
#define INCLUDE_pcTaskGetTaskName 1\r
#define INCLUDE_eTaskGetState 1\r
+#define INCLUDE_xSemaphoreGetMutexHolder 1\r
\r
extern void vAssertCalled( void );\r
#define configASSERT( x ) if( ( x ) == 0 ) vAssertCalled()\r
<ClCompile Include="..\..\..\FreeRTOS-Plus\FreeRTOS-Plus-Trace\trcKernel.c" />\r
<ClCompile Include="..\..\..\FreeRTOS-Plus\FreeRTOS-Plus-Trace\trcPort.c" />\r
<ClCompile Include="..\..\..\FreeRTOS-Plus\FreeRTOS-Plus-Trace\trcUser.c" />\r
+ <ClCompile Include="..\..\Source\croutine.c" />\r
<ClCompile Include="..\..\Source\portable\MemMang\heap_4.c" />\r
<ClCompile Include="..\..\Source\timers.c" />\r
<ClCompile Include="..\Common\Minimal\BlockQ.c" />\r
<ClCompile Include="..\..\Source\portable\MemMang\heap_4.c">\r
<Filter>FreeRTOS Source\Source\Portable</Filter>\r
</ClCompile>\r
+ <ClCompile Include="..\..\Source\croutine.c">\r
+ <Filter>FreeRTOS Source\Source</Filter>\r
+ </ClCompile>\r
</ItemGroup>\r
<ItemGroup>\r
<ClInclude Include="FreeRTOSConfig.h">\r
/*\r
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
\r
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT \r
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
***************************************************************************\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
- and contact details. \r
- \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+ and contact details.\r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
static xList xDelayedCoRoutineList2; /*< Delayed co-routines (two lists are used - one for delays that have overflowed the current tick count. */\r
static xList * pxDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used. */\r
static xList * pxOverflowDelayedCoRoutineList; /*< Points to the delayed co-routine list currently being used to hold co-routines that have overflowed the current tick count. */\r
-static xList xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */\r
+static xList xPendingReadyCoRoutineList; /*< Holds co-routines that have been readied by an external event. They cannot be added directly to the ready lists as the ready lists cannot be accessed by interrupts. */\r
\r
/* Other file private variables. --------------------------------*/\r
corCRCB * pxCurrentCoRoutine = NULL;\r
uxTopCoRoutineReadyPriority = pxCRCB->uxPriority; \\r
} \\r
vListInsertEnd( ( xList * ) &( pxReadyCoRoutineLists[ pxCRCB->uxPriority ] ), &( pxCRCB->xGenericListItem ) ); \\r
-} \r
+}\r
\r
/*\r
* Utility to ready all the lists used by the scheduler. This is called\r
in a list. */\r
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );\r
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );\r
- \r
+\r
/* Event lists are always in priority order. */\r
listSET_LIST_ITEM_VALUE( &( pxCoRoutine->xEventListItem ), configMAX_PRIORITIES - ( portTickType ) uxPriority );\r
- \r
+\r
/* Now the co-routine has been initialised it can be added to the ready\r
list at the correct priority. */\r
prvAddCoRoutineToReadyQueue( pxCoRoutine );\r
xReturn = pdPASS;\r
}\r
else\r
- { \r
+ {\r
xReturn = errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY;\r
}\r
- \r
- return xReturn; \r
+\r
+ return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
\r
/* The pending ready list can be accessed by an ISR. */\r
portDISABLE_INTERRUPTS();\r
- { \r
- pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) ); \r
+ {\r
+ pxUnblockedCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( (&xPendingReadyCoRoutineList) );\r
uxListRemove( &( pxUnblockedCRCB->xEventListItem ) );\r
}\r
portENABLE_INTERRUPTS();\r
\r
uxListRemove( &( pxUnblockedCRCB->xGenericListItem ) );\r
- prvAddCoRoutineToReadyQueue( pxUnblockedCRCB ); \r
+ prvAddCoRoutineToReadyQueue( pxUnblockedCRCB );\r
}\r
}\r
/*-----------------------------------------------------------*/\r
{\r
pxCRCB = ( corCRCB * ) listGET_OWNER_OF_HEAD_ENTRY( pxDelayedCoRoutineList );\r
\r
- if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) ) \r
- { \r
- /* Timeout not yet expired. */ \r
- break; \r
- } \r
+ if( xCoRoutineTickCount < listGET_LIST_ITEM_VALUE( &( pxCRCB->xGenericListItem ) ) )\r
+ {\r
+ /* Timeout not yet expired. */\r
+ break;\r
+ }\r
\r
portDISABLE_INTERRUPTS();\r
{\r
have been moved to the pending ready list and the following\r
line is still valid. Also the pvContainer parameter will have\r
been set to NULL so the following lines are also valid. */\r
- uxListRemove( &( pxCRCB->xGenericListItem ) ); \r
+ uxListRemove( &( pxCRCB->xGenericListItem ) );\r
\r
- /* Is the co-routine waiting on an event also? */ \r
- if( pxCRCB->xEventListItem.pvContainer ) \r
- { \r
- uxListRemove( &( pxCRCB->xEventListItem ) ); \r
+ /* Is the co-routine waiting on an event also? */\r
+ if( pxCRCB->xEventListItem.pvContainer )\r
+ {\r
+ uxListRemove( &( pxCRCB->xEventListItem ) );\r
}\r
}\r
portENABLE_INTERRUPTS();\r
\r
- prvAddCoRoutineToReadyQueue( pxCRCB ); \r
- } \r
+ prvAddCoRoutineToReadyQueue( pxCRCB );\r
+ }\r
}\r
\r
xLastTickCount = xCoRoutineTickCount;\r
typedef void * xQueueSetHandle;\r
\r
/**\r
- * Queue sets can contain both queues and semaphores, so the \r
+ * Queue sets can contain both queues and semaphores, so the\r
* xQueueSetMemberHandle is defined as a type to be used where a parameter or\r
* return value can be either an xQueueHandle or an xSemaphoreHandle.\r
*/\r
typedef void * xQueueSetMemberHandle;\r
- \r
+\r
/* For internal use only. */\r
#define queueSEND_TO_BACK ( 0 )\r
#define queueSEND_TO_FRONT ( 1 )\r
\r
/* For internal use only. These definitions *must* match those in queue.c. */\r
#define queueQUEUE_TYPE_BASE ( 0U )\r
+#define queueQUEUE_TYPE_SET ( 0U )\r
#define queueQUEUE_TYPE_MUTEX ( 1U )\r
#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( 2U )\r
#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( 3U )\r
* \defgroup xQueueSend xQueueSend\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueueGenericSend( xQueueHandle pxQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );\r
+signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );\r
\r
/**\r
* queue. h\r
*\r
* This macro must not be used in an interrupt service routine.\r
*\r
- * @param pxQueue The handle to the queue from which the item is to be\r
+ * @param xQueue The handle to the queue from which the item is to be\r
* received.\r
*\r
* @param pvBuffer Pointer to the buffer into which the received item will\r
* This function must not be used in an interrupt service routine. See\r
* xQueueReceiveFromISR for an alternative that can.\r
*\r
- * @param pxQueue The handle to the queue from which the item is to be\r
+ * @param xQueue The handle to the queue from which the item is to be\r
* received.\r
*\r
* @param pvBuffer Pointer to the buffer into which the received item will\r
* This function must not be used in an interrupt service routine. See\r
* xQueueReceiveFromISR for an alternative that can.\r
*\r
- * @param pxQueue The handle to the queue from which the item is to be\r
+ * @param xQueue The handle to the queue from which the item is to be\r
* received.\r
*\r
* @param pvBuffer Pointer to the buffer into which the received item will\r
* \page vQueueDelete vQueueDelete\r
* \ingroup QueueManagement\r
*/\r
-void vQueueDelete( xQueueHandle pxQueue );\r
+void vQueueDelete( xQueueHandle xQueue );\r
\r
/**\r
* queue. h\r
* <pre>\r
portBASE_TYPE xQueueSendToFrontFromISR(\r
- xQueueHandle pxQueue,\r
+ xQueueHandle xQueue,\r
const void *pvItemToQueue,\r
portBASE_TYPE *pxHigherPriorityTaskWoken\r
);\r
* \defgroup xQueueSendFromISR xQueueSendFromISR\r
* \ingroup QueueManagement\r
*/\r
-#define xQueueSendToFrontFromISR( pxQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )\r
+#define xQueueSendToFrontFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_FRONT )\r
\r
\r
/**\r
* queue. h\r
* <pre>\r
portBASE_TYPE xQueueSendToBackFromISR(\r
- xQueueHandle pxQueue,\r
+ xQueueHandle xQueue,\r
const void *pvItemToQueue,\r
portBASE_TYPE *pxHigherPriorityTaskWoken\r
);\r
* \defgroup xQueueSendFromISR xQueueSendFromISR\r
* \ingroup QueueManagement\r
*/\r
-#define xQueueSendToBackFromISR( pxQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )\r
+#define xQueueSendToBackFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )\r
\r
/**\r
* queue. h\r
* <pre>\r
portBASE_TYPE xQueueSendFromISR(\r
- xQueueHandle pxQueue,\r
+ xQueueHandle xQueue,\r
const void *pvItemToQueue,\r
portBASE_TYPE *pxHigherPriorityTaskWoken\r
);\r
* \defgroup xQueueSendFromISR xQueueSendFromISR\r
* \ingroup QueueManagement\r
*/\r
-#define xQueueSendFromISR( pxQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( pxQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )\r
+#define xQueueSendFromISR( xQueue, pvItemToQueue, pxHigherPriorityTaskWoken ) xQueueGenericSendFromISR( ( xQueue ), ( pvItemToQueue ), ( pxHigherPriorityTaskWoken ), queueSEND_TO_BACK )\r
\r
/**\r
* queue. h\r
* <pre>\r
portBASE_TYPE xQueueGenericSendFromISR(\r
- xQueueHandle pxQueue,\r
+ xQueueHandle xQueue,\r
const void *pvItemToQueue,\r
portBASE_TYPE *pxHigherPriorityTaskWoken,\r
portBASE_TYPE xCopyPosition\r
* \defgroup xQueueSendFromISR xQueueSendFromISR\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition );\r
+signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle xQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition );\r
\r
/**\r
* queue. h\r
* <pre>\r
portBASE_TYPE xQueueReceiveFromISR(\r
- xQueueHandle pxQueue,\r
+ xQueueHandle xQueue,\r
void *pvBuffer,\r
- portBASE_TYPE *pxTaskWoken\r
+ portBASE_TYPE *pxTaskWoken\r
);\r
* </pre>\r
*\r
* Receive an item from a queue. It is safe to use this function from within an\r
* interrupt service routine.\r
*\r
- * @param pxQueue The handle to the queue from which the item is to be\r
+ * @param xQueue The handle to the queue from which the item is to be\r
* received.\r
*\r
* @param pvBuffer Pointer to the buffer into which the received item will\r
* \defgroup xQueueReceiveFromISR xQueueReceiveFromISR\r
* \ingroup QueueManagement\r
*/\r
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken );\r
+signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken );\r
\r
/*\r
* Utilities to query queues that are safe to use from an ISR. These utilities\r
* should be used only from witin an ISR, or within a critical section.\r
*/\r
-signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle pxQueue );\r
-signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle pxQueue );\r
-unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle pxQueue );\r
+signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle xQueue );\r
+signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle xQueue );\r
+unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle xQueue );\r
\r
\r
/*\r
* responsiveness to gain execution speed, whereas the fully featured API\r
* sacrifices execution speed to ensure better interrupt responsiveness.\r
*/\r
-signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle pxQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );\r
-signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle pxQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking );\r
+signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition );\r
+signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking );\r
#define xQueueAltSendToFront( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_FRONT )\r
#define xQueueAltSendToBack( xQueue, pvItemToQueue, xTicksToWait ) xQueueAltGenericSend( ( xQueue ), ( pvItemToQueue ), ( xTicksToWait ), queueSEND_TO_BACK )\r
#define xQueueAltReceive( xQueue, pvBuffer, xTicksToWait ) xQueueAltGenericReceive( ( xQueue ), ( pvBuffer ), ( xTicksToWait ), pdFALSE )\r
* should not be called directly from application code. Instead use the macro\r
* wrappers defined within croutine.h.\r
*/\r
-signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken );\r
-signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle pxQueue, void *pvBuffer, signed portBASE_TYPE *pxTaskWoken );\r
-signed portBASE_TYPE xQueueCRSend( xQueueHandle pxQueue, const void *pvItemToQueue, portTickType xTicksToWait );\r
-signed portBASE_TYPE xQueueCRReceive( xQueueHandle pxQueue, void *pvBuffer, portTickType xTicksToWait );\r
+signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle xQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken );\r
+signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle xQueue, void *pvBuffer, signed portBASE_TYPE *pxTaskWoken );\r
+signed portBASE_TYPE xQueueCRSend( xQueueHandle xQueue, const void *pvItemToQueue, portTickType xTicksToWait );\r
+signed portBASE_TYPE xQueueCRReceive( xQueueHandle xQueue, void *pvBuffer, portTickType xTicksToWait );\r
\r
/*\r
* For internal use only. Use xSemaphoreCreateMutex(),\r
* For internal use only. Use xSemaphoreTakeMutexRecursive() or\r
* xSemaphoreGiveMutexRecursive() instead of calling these functions directly.\r
*/\r
-portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle pxMutex, portTickType xBlockTime );\r
+portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlockTime );\r
portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle pxMutex );\r
\r
/*\r
* reset because there are tasks blocked on the queue waiting to either\r
* receive from the queue or send to the queue.\r
*/\r
-#define xQueueReset( pxQueue ) xQueueGenericReset( pxQueue, pdFALSE )\r
+#define xQueueReset( xQueue ) xQueueGenericReset( xQueue, pdFALSE )\r
\r
/*\r
* The registry is provided as a means for kernel aware debuggers to\r
* queue added to a queue set. Therefore counting semaphores with large maximum\r
* counts should not be added to queue sets.\r
*\r
- * Note 4: A received (in the case of a queue) or take (in the case of a \r
- * semaphore) operation must not be performed on a member of a queue set unless \r
+ * Note 4: A received (in the case of a queue) or take (in the case of a\r
+ * semaphore) operation must not be performed on a member of a queue set unless\r
* a call to xQueueSelect() has first returned a handle to that set member.\r
*\r
* @param uxEventQueueLength Queue sets themselves queue events that occur on\r
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this\r
* function.\r
*\r
- * Note 1: A received (in the case of a queue) or take (in the case of a \r
- * semaphore) operation must not be performed on a member of a queue set unless \r
+ * Note 1: A received (in the case of a queue) or take (in the case of a\r
+ * semaphore) operation must not be performed on a member of a queue set unless\r
* a call to xQueueSelect() has first returned a handle to that set member.\r
*\r
- * @param xQueueOrSemaphore The handle of the queue or semaphore being added to \r
+ * @param xQueueOrSemaphore The handle of the queue or semaphore being added to\r
* the queue set (cast to an xQueueSetMemberHandle type).\r
*\r
* @param xQueueSet The handle of the queue set to which the queue or semaphore\r
* is being added.\r
*\r
- * @return If the queue or semaphore was successfully added to the queue set \r
- * then pdPASS is returned. If the queue could not be successfully added to the \r
- * queue set because it is already a member of a different queue set then pdFAIL \r
+ * @return If the queue or semaphore was successfully added to the queue set\r
+ * then pdPASS is returned. If the queue could not be successfully added to the\r
+ * queue set because it is already a member of a different queue set then pdFAIL\r
* is returned.\r
*/\r
portBASE_TYPE xQueueAddToSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet );\r
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this\r
* function.\r
*\r
- * @param xQueueOrSemaphore The handle of the queue or semaphore being removed \r
+ * @param xQueueOrSemaphore The handle of the queue or semaphore being removed\r
* from the queue set (cast to an xQueueSetMemberHandle type).\r
*\r
* @param xQueueSet The handle of the queue set in which the queue or semaphore\r
* is included.\r
*\r
- * @return If the queue or semaphore was successfully removed from the queue set \r
+ * @return If the queue or semaphore was successfully removed from the queue set\r
* then pdPASS is returned. If the queue was not in the queue set then pdFAIL\r
* is returned.\r
*/\r
portBASE_TYPE xQueueRemoveFromSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet );\r
\r
/*\r
- * xQueueSelectFromSet() selects from the members of a queue set a queue or \r
+ * xQueueSelectFromSet() selects from the members of a queue set a queue or\r
* semaphore that either contains data (in the case of a queue) or is available\r
- * to take (in the case of a semaphore). xQueueSelectFromSet() effectively \r
- * allows a task to block (pend) on a read operation on all the queues and \r
+ * to take (in the case of a semaphore). xQueueSelectFromSet() effectively\r
+ * allows a task to block (pend) on a read operation on all the queues and\r
* semaphores in a queue set simultaneously.\r
*\r
* See FreeRTOS/Source/Demo/Common/Minimal/QueueSet.c for an example using this\r
* Note 2: Blocking on a queue set that contains a mutex will not cause the\r
* mutex holder to inherit the priority of the blocked task.\r
*\r
- * Note 3: A received (in the case of a queue) or take (in the case of a \r
- * semaphore) operation must not be performed on a member of a queue set unless \r
+ * Note 3: A received (in the case of a queue) or take (in the case of a\r
+ * semaphore) operation must not be performed on a member of a queue set unless\r
* a call to xQueueSelect() has first returned a handle to that set member.\r
*\r
* @param xQueueSet The queue set on which the task will (potentially) block.\r
* operation.\r
*\r
* @return xQueueSelectFromSet() will return the handle of a queue (cast to\r
- * a xQueueSetMemberHandle type) contained in the queue set that contains data, \r
+ * a xQueueSetMemberHandle type) contained in the queue set that contains data,\r
* or the handle of a semaphore (cast to a xQueueSetMemberHandle type) contained\r
- * in the queue set that is available, or NULL if no such queue or semaphore \r
+ * in the queue set that is available, or NULL if no such queue or semaphore\r
* exists before before the specified block time expires.\r
*/\r
xQueueSetMemberHandle xQueueSelectFromSet( xQueueSetHandle xQueueSet, portTickType xBlockTimeTicks );\r
xQueueSetMemberHandle xQueueSelectFromSetFromISR( xQueueSetHandle xQueueSet );\r
\r
/* Not public API functions. */\r
-void vQueueWaitForMessageRestricted( xQueueHandle pxQueue, portTickType xTicksToWait );\r
-portBASE_TYPE xQueueGenericReset( xQueueHandle pxQueue, portBASE_TYPE xNewQueue );\r
+void vQueueWaitForMessageRestricted( xQueueHandle xQueue, portTickType xTicksToWait );\r
+portBASE_TYPE xQueueGenericReset( xQueueHandle xQueue, portBASE_TYPE xNewQueue );\r
+void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned char ucQueueNumber ) PRIVILEGED_FUNCTION;\r
+unsigned char ucQueueGetQueueType( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;\r
\r
\r
#ifdef __cplusplus\r
\r
/**\r
* task. h\r
- * <pre>void vTaskDelete( xTaskHandle pxTask );</pre>\r
+ * <pre>void vTaskDelete( xTaskHandle xTask );</pre>\r
*\r
* INCLUDE_vTaskDelete must be defined as 1 for this function to be available.\r
* See the configuration section for more information.\r
* See the demo application file death.c for sample code that utilises\r
* vTaskDelete ().\r
*\r
- * @param pxTask The handle of the task to be deleted. Passing NULL will\r
+ * @param xTask The handle of the task to be deleted. Passing NULL will\r
* cause the calling task to be deleted.\r
*\r
* Example usage:\r
* \defgroup vTaskDelete vTaskDelete\r
* \ingroup Tasks\r
*/\r
-void vTaskDelete( xTaskHandle pxTaskToDelete ) PRIVILEGED_FUNCTION;\r
+void vTaskDelete( xTaskHandle xTaskToDelete ) PRIVILEGED_FUNCTION;\r
\r
/*-----------------------------------------------------------\r
* TASK CONTROL API\r
\r
/**\r
* task. h\r
- * <pre>unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask );</pre>\r
+ * <pre>unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle xTask );</pre>\r
*\r
* INCLUDE_xTaskPriorityGet must be defined as 1 for this function to be available.\r
* See the configuration section for more information.\r
*\r
* Obtain the priority of any task.\r
*\r
- * @param pxTask Handle of the task to be queried. Passing a NULL\r
+ * @param xTask Handle of the task to be queried. Passing a NULL\r
* handle results in the priority of the calling task being returned.\r
*\r
- * @return The priority of pxTask.\r
+ * @return The priority of xTask.\r
*\r
* Example usage:\r
<pre>\r
* \defgroup uxTaskPriorityGet uxTaskPriorityGet\r
* \ingroup TaskCtrl\r
*/\r
-unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask ) PRIVILEGED_FUNCTION;\r
+unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* task. h\r
- * <pre>eTaskState eTaskGetState( xTaskHandle pxTask );</pre>\r
+ * <pre>eTaskState eTaskGetState( xTaskHandle xTask );</pre>\r
*\r
* INCLUDE_eTaskGetState must be defined as 1 for this function to be available.\r
* See the configuration section for more information.\r
* Obtain the state of any task. States are encoded by the eTaskState \r
* enumerated type.\r
*\r
- * @param pxTask Handle of the task to be queried.\r
+ * @param xTask Handle of the task to be queried.\r
*\r
- * @return The state of pxTask at the time the function was called. Note the\r
+ * @return The state of xTask at the time the function was called. Note the\r
* state of the task might change between the function being called, and the\r
* functions return value being tested by the calling task.\r
*/\r
-eTaskState eTaskGetState( xTaskHandle pxTask ) PRIVILEGED_FUNCTION;\r
+eTaskState eTaskGetState( xTaskHandle xTask ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* task. h\r
- * <pre>void vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority );</pre>\r
+ * <pre>void vTaskPrioritySet( xTaskHandle xTask, unsigned portBASE_TYPE uxNewPriority );</pre>\r
*\r
* INCLUDE_vTaskPrioritySet must be defined as 1 for this function to be available.\r
* See the configuration section for more information.\r
* A context switch will occur before the function returns if the priority\r
* being set is higher than the currently executing task.\r
*\r
- * @param pxTask Handle to the task for which the priority is being set.\r
+ * @param xTask Handle to the task for which the priority is being set.\r
* Passing a NULL handle results in the priority of the calling task being set.\r
*\r
* @param uxNewPriority The priority to which the task will be set.\r
* \defgroup vTaskPrioritySet vTaskPrioritySet\r
* \ingroup TaskCtrl\r
*/\r
-void vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority ) PRIVILEGED_FUNCTION;\r
+void vTaskPrioritySet( xTaskHandle xTask, unsigned portBASE_TYPE uxNewPriority ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* task. h\r
- * <pre>void vTaskSuspend( xTaskHandle pxTaskToSuspend );</pre>\r
+ * <pre>void vTaskSuspend( xTaskHandle xTaskToSuspend );</pre>\r
*\r
* INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.\r
* See the configuration section for more information.\r
* i.e. calling vTaskSuspend () twice on the same task still only requires one\r
* call to vTaskResume () to ready the suspended task.\r
*\r
- * @param pxTaskToSuspend Handle to the task being suspended. Passing a NULL\r
+ * @param xTaskToSuspend Handle to the task being suspended. Passing a NULL\r
* handle will cause the calling task to be suspended.\r
*\r
* Example usage:\r
* \defgroup vTaskSuspend vTaskSuspend\r
* \ingroup TaskCtrl\r
*/\r
-void vTaskSuspend( xTaskHandle pxTaskToSuspend ) PRIVILEGED_FUNCTION;\r
+void vTaskSuspend( xTaskHandle xTaskToSuspend ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* task. h\r
- * <pre>void vTaskResume( xTaskHandle pxTaskToResume );</pre>\r
+ * <pre>void vTaskResume( xTaskHandle xTaskToResume );</pre>\r
*\r
* INCLUDE_vTaskSuspend must be defined as 1 for this function to be available.\r
* See the configuration section for more information.\r
* will be made available for running again by a single call to\r
* vTaskResume ().\r
*\r
- * @param pxTaskToResume Handle to the task being readied.\r
+ * @param xTaskToResume Handle to the task being readied.\r
*\r
* Example usage:\r
<pre>\r
* \defgroup vTaskResume vTaskResume\r
* \ingroup TaskCtrl\r
*/\r
-void vTaskResume( xTaskHandle pxTaskToResume ) PRIVILEGED_FUNCTION;\r
+void vTaskResume( xTaskHandle xTaskToResume ) PRIVILEGED_FUNCTION;\r
\r
/**\r
* task. h\r
- * <pre>void xTaskResumeFromISR( xTaskHandle pxTaskToResume );</pre>\r
+ * <pre>void xTaskResumeFromISR( xTaskHandle xTaskToResume );</pre>\r
*\r
* INCLUDE_xTaskResumeFromISR must be defined as 1 for this function to be\r
* available. See the configuration section for more information.\r
* will be made available for running again by a single call to\r
* xTaskResumeFromISR ().\r
*\r
- * @param pxTaskToResume Handle to the task being readied.\r
+ * @param xTaskToResume Handle to the task being readied.\r
*\r
* \defgroup vTaskResumeFromISR vTaskResumeFromISR\r
* \ingroup TaskCtrl\r
*/\r
-portBASE_TYPE xTaskResumeFromISR( xTaskHandle pxTaskToResume ) PRIVILEGED_FUNCTION;\r
+portBASE_TYPE xTaskResumeFromISR( xTaskHandle xTaskToResume ) PRIVILEGED_FUNCTION;\r
\r
/*-----------------------------------------------------------\r
* SCHEDULER CONTROL\r
\r
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
\r
-/* Allocate the memory for the heap. The struct is used to force byte\r
-alignment without using any non-portable code. */\r
-static union xRTOS_HEAP\r
-{\r
- #if portBYTE_ALIGNMENT == 8\r
- volatile portDOUBLE dDummy;\r
- #else\r
- volatile unsigned long ulDummy;\r
- #endif\r
- unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
-} xHeap;\r
+/* A few bytes might be lost to byte aligning the heap start address. */\r
+#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )\r
\r
+/* Allocate the memory for the heap. */\r
+static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
static size_t xNextFreeByte = ( size_t ) 0;\r
+\r
/*-----------------------------------------------------------*/\r
\r
void *pvPortMalloc( size_t xWantedSize )\r
{\r
void *pvReturn = NULL;\r
+static unsigned char *pucAlignedHeap = NULL;\r
\r
/* Ensure that blocks are always aligned to the required number of bytes. */\r
#if portBYTE_ALIGNMENT != 1\r
\r
vTaskSuspendAll();\r
{\r
+ if( pucAlignedHeap == NULL )\r
+ {\r
+ /* Ensure the heap starts on a correctly aligned boundary. */\r
+ pucAlignedHeap = ( unsigned char * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ( portPOINTER_SIZE_TYPE ) ~portBYTE_ALIGNMENT_MASK ) );\r
+ }\r
+\r
/* Check there is enough room left for the allocation. */\r
- if( ( ( xNextFreeByte + xWantedSize ) < configTOTAL_HEAP_SIZE ) &&\r
+ if( ( ( xNextFreeByte + xWantedSize ) < configADJUSTED_HEAP_SIZE ) &&\r
( ( xNextFreeByte + xWantedSize ) > xNextFreeByte ) )/* Check for overflow. */\r
{\r
/* Return the next free byte then increment the index past this\r
block. */\r
- pvReturn = &( xHeap.ucHeap[ xNextFreeByte ] );\r
+ pvReturn = pucAlignedHeap + xNextFreeByte;\r
xNextFreeByte += xWantedSize;\r
}\r
}\r
\r
size_t xPortGetFreeHeapSize( void )\r
{\r
- return ( configTOTAL_HEAP_SIZE - xNextFreeByte );\r
+ return ( configADJUSTED_HEAP_SIZE - xNextFreeByte );\r
}\r
\r
\r
/*\r
FreeRTOS V7.3.0 - Copyright (C) 2012 Real Time Engineers Ltd.\r
\r
- FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT \r
+ FEATURES AND PORTS ARE ADDED TO FREERTOS ALL THE TIME. PLEASE VISIT\r
http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.\r
\r
***************************************************************************\r
FreeRTOS WEB site.\r
\r
1 tab == 4 spaces!\r
- \r
+\r
***************************************************************************\r
* *\r
* Having a problem? Start by reading the FAQ "My application does *\r
* *\r
***************************************************************************\r
\r
- \r
- http://www.FreeRTOS.org - Documentation, training, latest versions, license \r
- and contact details. \r
- \r
+\r
+ http://www.FreeRTOS.org - Documentation, training, latest versions, license\r
+ and contact details.\r
+\r
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,\r
including FreeRTOS+Trace - an indispensable productivity tool.\r
\r
- Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell \r
- the code with commercial support, indemnification, and middleware, under \r
+ Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell\r
+ the code with commercial support, indemnification, and middleware, under\r
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also\r
- provide a safety engineered and independently SIL3 certified version under \r
+ provide a safety engineered and independently SIL3 certified version under\r
the SafeRTOS brand: http://www.SafeRTOS.com.\r
*/\r
\r
/*\r
* A sample implementation of pvPortMalloc() and vPortFree() that permits\r
* allocated blocks to be freed, but does not combine adjacent free blocks\r
- * into a single larger block (and so will fragment memory). See heap_4.c for \r
+ * into a single larger block (and so will fragment memory). See heap_4.c for\r
* an aquivalent that does combine adjacent blocks into single larger blocks.\r
*\r
- * See heap_1.c, heap_3.c and heap_4.c for alternative implementations, and the \r
+ * See heap_1.c, heap_3.c and heap_4.c for alternative implementations, and the\r
* memory management pages of http://www.FreeRTOS.org for more information.\r
*/\r
#include <stdlib.h>\r
\r
#undef MPU_WRAPPERS_INCLUDED_FROM_API_FILE\r
\r
-/* Allocate the memory for the heap. The struct is used to force byte\r
-alignment without using any non-portable code. */\r
-static union xRTOS_HEAP\r
-{\r
- #if portBYTE_ALIGNMENT == 8\r
- volatile portDOUBLE dDummy;\r
- #else\r
- volatile unsigned long ulDummy;\r
- #endif\r
- unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
-} xHeap;\r
+/* A few bytes might be lost to byte aligning the heap start address. */\r
+#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )\r
+\r
+/* \r
+ * Initialises the heap structures into their start condition. \r
+ */\r
+static void prvHeapInit( void );\r
+\r
+/* Allocate the memory for the heap. */\r
+static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
\r
/* Define the linked list structure. This is used to link free blocks in order\r
of their size. */\r
\r
/* Keeps track of the number of free bytes remaining, but says nothing about\r
fragmentation. */\r
-static size_t xFreeBytesRemaining = configTOTAL_HEAP_SIZE;\r
+static size_t xFreeBytesRemaining = configADJUSTED_HEAP_SIZE;\r
\r
/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-#define prvHeapInit() \\r
-{ \\r
-xBlockLink *pxFirstFreeBlock; \\r
- \\r
- /* xStart is used to hold a pointer to the first item in the list of free */ \\r
- /* blocks. The void cast is used to prevent compiler warnings. */ \\r
- xStart.pxNextFreeBlock = ( void * ) xHeap.ucHeap; \\r
- xStart.xBlockSize = ( size_t ) 0; \\r
- \\r
- /* xEnd is used to mark the end of the list of free blocks. */ \\r
- xEnd.xBlockSize = configTOTAL_HEAP_SIZE; \\r
- xEnd.pxNextFreeBlock = NULL; \\r
- \\r
- /* To start with there is a single free block that is sized to take up the \\r
- entire heap space. */ \\r
- pxFirstFreeBlock = ( void * ) xHeap.ucHeap; \\r
- pxFirstFreeBlock->xBlockSize = configTOTAL_HEAP_SIZE; \\r
- pxFirstFreeBlock->pxNextFreeBlock = &xEnd; \\r
-}\r
-/*-----------------------------------------------------------*/\r
-\r
void *pvPortMalloc( size_t xWantedSize )\r
{\r
xBlockLink *pxBlock, *pxPreviousBlock, *pxNewBlockLink;\r
}\r
}\r
\r
- if( ( xWantedSize > 0 ) && ( xWantedSize < configTOTAL_HEAP_SIZE ) )\r
+ if( ( xWantedSize > 0 ) && ( xWantedSize < configADJUSTED_HEAP_SIZE ) )\r
{\r
/* Blocks are stored in byte order - traverse the list from the start\r
(smallest) block until one of adequate size is found. */\r
/* Insert the new block into the list of free blocks. */\r
prvInsertBlockIntoFreeList( ( pxNewBlockLink ) );\r
}\r
- \r
+\r
xFreeBytesRemaining -= pxBlock->xBlockSize;\r
}\r
}\r
before it. */\r
puc -= heapSTRUCT_SIZE;\r
\r
- /* This casting is to keep the compiler from issuing warnings. */\r
+ /* This unexpected casting is to keep some compilers from issuing \r
+ byte alignment warnings. */\r
pxLink = ( void * ) puc;\r
\r
vTaskSuspendAll();\r
{\r
/* This just exists to keep the linker quiet. */\r
}\r
+/*-----------------------------------------------------------*/\r
+\r
+static void prvHeapInit( void )\r
+{\r
+xBlockLink *pxFirstFreeBlock;\r
+unsigned char *pucAlignedHeap;\r
+\r
+ /* Ensure the heap starts on a correctly aligned boundary. */\r
+ pucAlignedHeap = ( unsigned char * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ( portPOINTER_SIZE_TYPE ) ~portBYTE_ALIGNMENT_MASK ) );\r
+\r
+ /* xStart is used to hold a pointer to the first item in the list of free\r
+ blocks. The void cast is used to prevent compiler warnings. */\r
+ xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap;\r
+ xStart.xBlockSize = ( size_t ) 0;\r
+\r
+ /* xEnd is used to mark the end of the list of free blocks. */\r
+ xEnd.xBlockSize = configADJUSTED_HEAP_SIZE;\r
+ xEnd.pxNextFreeBlock = NULL;\r
+\r
+ /* To start with there is a single free block that is sized to take up the\r
+ entire heap space. */\r
+ pxFirstFreeBlock = ( void * ) pucAlignedHeap;\r
+ pxFirstFreeBlock->xBlockSize = configADJUSTED_HEAP_SIZE;\r
+ pxFirstFreeBlock->pxNextFreeBlock = &xEnd;\r
+}\r
+/*-----------------------------------------------------------*/\r
/* Block sizes must not get too small. */\r
#define heapMINIMUM_BLOCK_SIZE ( ( size_t ) ( heapSTRUCT_SIZE * 2 ) )\r
\r
-/* Allocate the memory for the heap. The struct is used to force byte\r
-alignment without using any non-portable code. */\r
-static union xRTOS_HEAP\r
-{\r
- #if portBYTE_ALIGNMENT == 8\r
- volatile portDOUBLE dDummy;\r
- #else\r
- volatile unsigned long ulDummy;\r
- #endif\r
- unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
-} xHeap;\r
+/* A few bytes might be lost to byte aligning the heap start address. */\r
+#define configADJUSTED_HEAP_SIZE ( configTOTAL_HEAP_SIZE - portBYTE_ALIGNMENT )\r
+\r
+/* Allocate the memory for the heap. */\r
+static unsigned char ucHeap[ configTOTAL_HEAP_SIZE ];\r
\r
/* Define the linked list structure. This is used to link free blocks in order\r
of their memory address. */\r
static const unsigned short heapSTRUCT_SIZE = ( sizeof( xBlockLink ) + portBYTE_ALIGNMENT - ( sizeof( xBlockLink ) % portBYTE_ALIGNMENT ) );\r
\r
/* Ensure the pxEnd pointer will end up on the correct byte alignment. */\r
-static const size_t xTotalHeapSize = ( ( size_t ) configTOTAL_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
+static const size_t xTotalHeapSize = ( ( size_t ) configADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
\r
/* Create a couple of list links to mark the start and end of the list. */\r
static xBlockLink xStart, *pxEnd = NULL;\r
\r
/* Keeps track of the number of free bytes remaining, but says nothing about\r
fragmentation. */\r
-static size_t xFreeBytesRemaining = ( ( size_t ) configTOTAL_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
+static size_t xFreeBytesRemaining = ( ( size_t ) configADJUSTED_HEAP_SIZE ) & ( ( size_t ) ~portBYTE_ALIGNMENT_MASK );\r
\r
/* STATIC FUNCTIONS ARE DEFINED AS MACROS TO MINIMIZE THE FUNCTION CALL DEPTH. */\r
\r
static void prvHeapInit( void )\r
{\r
xBlockLink *pxFirstFreeBlock;\r
-unsigned char *pucHeapEnd;\r
+unsigned char *pucHeapEnd, *pucAlignedHeap;\r
\r
- /* Ensure the start of the heap is aligned. */\r
- configASSERT( ( ( ( unsigned long ) xHeap.ucHeap ) & ( ( unsigned long ) portBYTE_ALIGNMENT_MASK ) ) == 0UL );\r
+ /* Ensure the heap starts on a correctly aligned boundary. */\r
+ pucAlignedHeap = ( unsigned char * ) ( ( ( portPOINTER_SIZE_TYPE ) &ucHeap[ portBYTE_ALIGNMENT ] ) & ( ( portPOINTER_SIZE_TYPE ) ~portBYTE_ALIGNMENT_MASK ) );\r
\r
/* xStart is used to hold a pointer to the first item in the list of free\r
blocks. The void cast is used to prevent compiler warnings. */\r
- xStart.pxNextFreeBlock = ( void * ) xHeap.ucHeap;\r
+ xStart.pxNextFreeBlock = ( void * ) pucAlignedHeap;\r
xStart.xBlockSize = ( size_t ) 0;\r
\r
/* pxEnd is used to mark the end of the list of free blocks and is inserted\r
at the end of the heap space. */\r
- pucHeapEnd = xHeap.ucHeap + xTotalHeapSize;\r
+ pucHeapEnd = pucAlignedHeap + xTotalHeapSize;\r
pucHeapEnd -= heapSTRUCT_SIZE;\r
pxEnd = ( void * ) pucHeapEnd;\r
configASSERT( ( ( ( unsigned long ) pxEnd ) & ( ( unsigned long ) portBYTE_ALIGNMENT_MASK ) ) == 0UL );\r
\r
/* To start with there is a single free block that is sized to take up the\r
entire heap space, minus the space taken by pxEnd. */\r
- pxFirstFreeBlock = ( void * ) xHeap.ucHeap;\r
+ pxFirstFreeBlock = ( void * ) pucAlignedHeap;\r
pxFirstFreeBlock->xBlockSize = xTotalHeapSize - heapSTRUCT_SIZE;\r
pxFirstFreeBlock->pxNextFreeBlock = pxEnd;\r
\r
\r
#include "FreeRTOS.h"\r
#include "task.h"\r
+#include "queue.h"\r
\r
#if ( configUSE_CO_ROUTINES == 1 )\r
#include "croutine.h"\r
\r
#define queueERRONEOUS_UNBLOCK ( -1 )\r
\r
-/* For internal use only. */\r
-#define queueSEND_TO_BACK ( 0 )\r
-#define queueSEND_TO_FRONT ( 1 )\r
-\r
/* Effectively make a union out of the xQUEUE structure. */\r
#define pxMutexHolder pcTail\r
#define uxQueueType pcHead\r
#define queueDONT_BLOCK ( ( portTickType ) 0U )\r
#define queueMUTEX_GIVE_BLOCK_TIME ( ( portTickType ) 0U )\r
\r
-/* These definitions *must* match those in queue.h. */\r
-#define queueQUEUE_TYPE_BASE ( 0U )\r
-#define queueQUEUE_TYPE_MUTEX ( 1U )\r
-#define queueQUEUE_TYPE_COUNTING_SEMAPHORE ( 2U )\r
-#define queueQUEUE_TYPE_BINARY_SEMAPHORE ( 3U )\r
-#define queueQUEUE_TYPE_RECURSIVE_MUTEX ( 4U )\r
-#define queueQUEUE_TYPE_SET ( 0U )\r
\r
/*\r
* Definition of the queue used by the scheduler.\r
} xQUEUE;\r
/*-----------------------------------------------------------*/\r
\r
-/*\r
- * Inside this file xQueueHandle and xQueueSetHandle are both pointers to xQUEUE\r
- * structures. To keep the definition private the API header file defines both\r
- * as pointers to void.\r
- */\r
-typedef xQUEUE * xQueueHandle;\r
-typedef xQUEUE * xQueueSetHandle;\r
-\r
-/**\r
- * Queue sets can contain both queues and semaphores, so the\r
- * xQueueSetMemberHandle is defined as a type to be used where a parameter or\r
- * return value can be either an xQueueHandle or an xSemaphoreHandle.\r
- */\r
-typedef xQUEUE * xQueueSetMemberHandle;\r
-\r
-/*\r
- * In order to implement strict data hiding, the queue.h header file defines\r
- * xQueueHandle and xQueueSetHandle as pointers to void. In this file\r
- * xQueueHandle and xQueueSetHandle are defined as pointers to xQUEUE objects.\r
- * Therefore the queue.h header file cannot be included in this source file,\r
- * and the function prototypes are provided directly.\r
- */\r
-xQueueHandle xQueueGenericCreate( unsigned portBASE_TYPE uxQueueLength, unsigned portBASE_TYPE uxItemSize, unsigned char ucQueueType ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueGenericSend( xQueueHandle pxQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;\r
-unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
-void vQueueDelete( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueGenericReceive( xQueueHandle pxQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken ) PRIVILEGED_FUNCTION;\r
-xQueueHandle xQueueCreateMutex( unsigned char ucQueueType ) PRIVILEGED_FUNCTION;\r
-xQueueHandle xQueueCreateCountingSemaphore( unsigned portBASE_TYPE uxCountValue, unsigned portBASE_TYPE uxInitialCount ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlockTime ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle pxQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle pxQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
-signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
-unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
-void vQueueWaitForMessageRestricted( xQueueHandle pxQueue, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
-unsigned char ucQueueGetQueueNumber( xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
-void vQueueSetQueueNumber( xQueueHandle pxQueue, unsigned char ucQueueNumber ) PRIVILEGED_FUNCTION;\r
-unsigned char ucQueueGetQueueType( xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xQueueGenericReset( xQueueHandle pxQueue, portBASE_TYPE xNewQueue ) PRIVILEGED_FUNCTION;\r
-xTaskHandle xQueueGetMutexHolder( xQueueHandle xSemaphore ) PRIVILEGED_FUNCTION;\r
-xQueueSetHandle xQueueCreateSet( unsigned portBASE_TYPE uxEventQueueLength ) PRIVILEGED_FUNCTION;\r
-xQueueSetMemberHandle xQueueSelectFromSet( xQueueSetHandle xQueueSet, portTickType xBlockTimeTicks ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xQueueAddToSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet ) PRIVILEGED_FUNCTION;\r
-portBASE_TYPE xQueueRemoveFromSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet ) PRIVILEGED_FUNCTION;\r
-\r
-/*\r
- * Co-routine queue functions differ from task queue functions. Co-routines are\r
- * an optional component.\r
- */\r
-#if ( configUSE_CO_ROUTINES == 1 )\r
- signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken ) PRIVILEGED_FUNCTION;\r
- signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle pxQueue, void *pvBuffer, signed portBASE_TYPE *pxTaskWoken ) PRIVILEGED_FUNCTION;\r
- signed portBASE_TYPE xQueueCRSend( xQueueHandle pxQueue, const void *pvItemToQueue, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
- signed portBASE_TYPE xQueueCRReceive( xQueueHandle pxQueue, void *pvBuffer, portTickType xTicksToWait ) PRIVILEGED_FUNCTION;\r
-#endif\r
-\r
/*\r
* The queue registry is just a means for kernel aware debuggers to locate\r
* queue structures. It has no other purpose so is an optional component.\r
\r
/* Removes a queue from the registry by simply setting the pcQueueName\r
member to NULL. */\r
- static void vQueueUnregisterQueue( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;\r
- void vQueueAddToRegistry( xQueueHandle xQueue, signed char *pcQueueName ) PRIVILEGED_FUNCTION;\r
-#endif\r
+ static void prvQueueUnregisterQueue( xQueueHandle xQueue ) PRIVILEGED_FUNCTION;\r
+\r
+#endif /* configQUEUE_REGISTRY_SIZE */\r
\r
/*\r
* Unlocks a queue locked by a call to prvLockQueue. Locking a queue does not\r
* to indicate that a task may require unblocking. When the queue in unlocked\r
* these lock counts are inspected, and the appropriate action taken.\r
*/\r
-static void prvUnlockQueue( xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
+static void prvUnlockQueue( xQUEUE *pxQueue ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Uses a critical section to determine if there is any data in a queue.\r
*\r
* @return pdTRUE if the queue contains no items, otherwise pdFALSE.\r
*/\r
-static signed portBASE_TYPE prvIsQueueEmpty( const xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
+static signed portBASE_TYPE prvIsQueueEmpty( const xQUEUE *pxQueue ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Uses a critical section to determine if there is any space in a queue.\r
*\r
* @return pdTRUE if there is no space, otherwise pdFALSE;\r
*/\r
-static signed portBASE_TYPE prvIsQueueFull( const xQueueHandle pxQueue ) PRIVILEGED_FUNCTION;\r
+static signed portBASE_TYPE prvIsQueueFull( const xQUEUE *pxQueue ) PRIVILEGED_FUNCTION;\r
\r
/*\r
* Copies an item into the queue, either at the front of the queue or the\r
taskEXIT_CRITICAL()\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xQueueGenericReset( xQueueHandle pxQueue, portBASE_TYPE xNewQueue )\r
+portBASE_TYPE xQueueGenericReset( xQueueHandle xQueue, portBASE_TYPE xNewQueue )\r
{\r
+xQUEUE *pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
\r
taskENTER_CRITICAL();\r
following critical section exiting and the function returning. */\r
taskENTER_CRITICAL();\r
{\r
- if( xSemaphore->uxQueueType == queueQUEUE_IS_MUTEX )\r
+ if( ( ( xQUEUE * ) xSemaphore )->uxQueueType == queueQUEUE_IS_MUTEX )\r
{\r
- pxReturn = ( void * ) xSemaphore->pxMutexHolder;\r
+ pxReturn = ( void * ) ( ( xQUEUE * ) xSemaphore )->pxMutexHolder;\r
}\r
else\r
{\r
\r
#if ( configUSE_RECURSIVE_MUTEXES == 1 )\r
\r
- portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle pxMutex )\r
+ portBASE_TYPE xQueueGiveMutexRecursive( xQueueHandle xMutex )\r
{\r
portBASE_TYPE xReturn;\r
+ xQUEUE *pxMutex;\r
\r
+ pxMutex = ( xQUEUE * ) xMutex;\r
configASSERT( pxMutex );\r
\r
/* If this is the task that holds the mutex then pxMutexHolder will not\r
\r
#if ( configUSE_RECURSIVE_MUTEXES == 1 )\r
\r
- portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle pxMutex, portTickType xBlockTime )\r
+ portBASE_TYPE xQueueTakeMutexRecursive( xQueueHandle xMutex, portTickType xBlockTime )\r
{\r
portBASE_TYPE xReturn;\r
+ xQUEUE *pxMutex;\r
\r
+ pxMutex = ( xQUEUE * ) xMutex;\r
configASSERT( pxMutex );\r
\r
/* Comments regarding mutual exclusion as per those within\r
\r
xQueueHandle xQueueCreateCountingSemaphore( unsigned portBASE_TYPE uxCountValue, unsigned portBASE_TYPE uxInitialCount )\r
{\r
- xQueueHandle pxHandle;\r
+ xQueueHandle xHandle;\r
\r
- pxHandle = xQueueGenericCreate( ( unsigned portBASE_TYPE ) uxCountValue, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE );\r
+ xHandle = xQueueGenericCreate( ( unsigned portBASE_TYPE ) uxCountValue, queueSEMAPHORE_QUEUE_ITEM_LENGTH, queueQUEUE_TYPE_COUNTING_SEMAPHORE );\r
\r
- if( pxHandle != NULL )\r
+ if( xHandle != NULL )\r
{\r
- pxHandle->uxMessagesWaiting = uxInitialCount;\r
+ ( ( xQUEUE * ) xHandle )->uxMessagesWaiting = uxInitialCount;\r
\r
traceCREATE_COUNTING_SEMAPHORE();\r
}\r
traceCREATE_COUNTING_SEMAPHORE_FAILED();\r
}\r
\r
- configASSERT( pxHandle );\r
- return pxHandle;\r
+ configASSERT( xHandle );\r
+ return xHandle;\r
}\r
\r
#endif /* configUSE_COUNTING_SEMAPHORES */\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueGenericSend( xQueueHandle pxQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition )\r
+signed portBASE_TYPE xQueueGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition )\r
{\r
signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
xTimeOutType xTimeOut;\r
+xQUEUE *pxQueue;\r
\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
\r
\r
#if ( configUSE_ALTERNATIVE_API == 1 )\r
\r
- signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle pxQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition )\r
+ signed portBASE_TYPE xQueueAltGenericSend( xQueueHandle xQueue, const void * const pvItemToQueue, portTickType xTicksToWait, portBASE_TYPE xCopyPosition )\r
{\r
signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
xTimeOutType xTimeOut;\r
+ xQUEUE *pxQueue;\r
\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
\r
\r
#if ( configUSE_ALTERNATIVE_API == 1 )\r
\r
- signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle pxQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
+ signed portBASE_TYPE xQueueAltGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
{\r
signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
xTimeOutType xTimeOut;\r
signed char *pcOriginalReadPosition;\r
+ xQUEUE *pxQueue;\r
\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
\r
#endif /* configUSE_ALTERNATIVE_API */\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle pxQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition )\r
+signed portBASE_TYPE xQueueGenericSendFromISR( xQueueHandle xQueue, const void * const pvItemToQueue, signed portBASE_TYPE *pxHigherPriorityTaskWoken, portBASE_TYPE xCopyPosition )\r
{\r
signed portBASE_TYPE xReturn;\r
unsigned portBASE_TYPE uxSavedInterruptStatus;\r
+xQUEUE *pxQueue;\r
\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
configASSERT( !( ( pvItemToQueue == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueGenericReceive( xQueueHandle pxQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
+signed portBASE_TYPE xQueueGenericReceive( xQueueHandle xQueue, void * const pvBuffer, portTickType xTicksToWait, portBASE_TYPE xJustPeeking )\r
{\r
signed portBASE_TYPE xEntryTimeSet = pdFALSE;\r
xTimeOutType xTimeOut;\r
signed char *pcOriginalReadPosition;\r
+xQUEUE *pxQueue;\r
\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle pxQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken )\r
+signed portBASE_TYPE xQueueReceiveFromISR( xQueueHandle xQueue, void * const pvBuffer, signed portBASE_TYPE *pxHigherPriorityTaskWoken )\r
{\r
signed portBASE_TYPE xReturn;\r
unsigned portBASE_TYPE uxSavedInterruptStatus;\r
+xQUEUE *pxQueue;\r
\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
configASSERT( !( ( pvBuffer == NULL ) && ( pxQueue->uxItemSize != ( unsigned portBASE_TYPE ) 0U ) ) );\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle pxQueue )\r
+unsigned portBASE_TYPE uxQueueMessagesWaiting( const xQueueHandle xQueue )\r
{\r
unsigned portBASE_TYPE uxReturn;\r
\r
- configASSERT( pxQueue );\r
+ configASSERT( xQueue );\r
\r
taskENTER_CRITICAL();\r
- uxReturn = pxQueue->uxMessagesWaiting;\r
+ uxReturn = ( ( xQUEUE * ) xQueue )->uxMessagesWaiting;\r
taskEXIT_CRITICAL();\r
\r
return uxReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle pxQueue )\r
+unsigned portBASE_TYPE uxQueueMessagesWaitingFromISR( const xQueueHandle xQueue )\r
{\r
unsigned portBASE_TYPE uxReturn;\r
\r
- configASSERT( pxQueue );\r
+ configASSERT( xQueue );\r
\r
- uxReturn = pxQueue->uxMessagesWaiting;\r
+ uxReturn = ( ( xQUEUE * ) xQueue )->uxMessagesWaiting;\r
\r
return uxReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-void vQueueDelete( xQueueHandle pxQueue )\r
+void vQueueDelete( xQueueHandle xQueue )\r
{\r
+xQUEUE *pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
configASSERT( pxQueue );\r
\r
traceQUEUE_DELETE( pxQueue );\r
- vQueueUnregisterQueue( pxQueue );\r
+ prvQueueUnregisterQueue( pxQueue );\r
vPortFree( pxQueue->pcHead );\r
vPortFree( pxQueue );\r
}\r
\r
#if ( configUSE_TRACE_FACILITY == 1 )\r
\r
- unsigned char ucQueueGetQueueNumber( xQueueHandle pxQueue )\r
+ unsigned char ucQueueGetQueueNumber( xQueueHandle xQueue )\r
{\r
- return pxQueue->ucQueueNumber;\r
+ return ( ( xQUEUE * ) xQueue )->ucQueueNumber;\r
}\r
\r
#endif /* configUSE_TRACE_FACILITY */\r
\r
#if ( configUSE_TRACE_FACILITY == 1 )\r
\r
- void vQueueSetQueueNumber( xQueueHandle pxQueue, unsigned char ucQueueNumber )\r
+ void vQueueSetQueueNumber( xQueueHandle xQueue, unsigned char ucQueueNumber )\r
{\r
- pxQueue->ucQueueNumber = ucQueueNumber;\r
+ ( ( xQUEUE * ) xQueue )->ucQueueNumber = ucQueueNumber;\r
}\r
\r
#endif /* configUSE_TRACE_FACILITY */\r
\r
#if ( configUSE_TRACE_FACILITY == 1 )\r
\r
- unsigned char ucQueueGetQueueType( xQueueHandle pxQueue )\r
+ unsigned char ucQueueGetQueueType( xQueueHandle xQueue )\r
{\r
- return pxQueue->ucQueueType;\r
+ return ( ( xQUEUE * ) xQueue )->ucQueueType;\r
}\r
\r
#endif /* configUSE_TRACE_FACILITY */\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static void prvUnlockQueue( xQueueHandle pxQueue )\r
+static void prvUnlockQueue( xQUEUE *pxQueue )\r
{\r
/* THIS FUNCTION MUST BE CALLED WITH THE SCHEDULER SUSPENDED. */\r
\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static signed portBASE_TYPE prvIsQueueEmpty( const xQueueHandle pxQueue )\r
+static signed portBASE_TYPE prvIsQueueEmpty( const xQUEUE *pxQueue )\r
{\r
signed portBASE_TYPE xReturn;\r
\r
taskENTER_CRITICAL();\r
- xReturn = ( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 );\r
+ {\r
+ if( pxQueue->uxMessagesWaiting == 0 )\r
+ {\r
+ xReturn = pdTRUE;\r
+ }\r
+ else\r
+ {\r
+ xReturn = pdFALSE;\r
+ }\r
+ }\r
taskEXIT_CRITICAL();\r
\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle pxQueue )\r
+signed portBASE_TYPE xQueueIsQueueEmptyFromISR( const xQueueHandle xQueue )\r
{\r
signed portBASE_TYPE xReturn;\r
\r
- configASSERT( pxQueue );\r
- xReturn = ( pxQueue->uxMessagesWaiting == ( unsigned portBASE_TYPE ) 0 );\r
+ configASSERT( xQueue );\r
+ if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == 0 )\r
+ {\r
+ xReturn = pdTRUE;\r
+ }\r
+ else\r
+ {\r
+ xReturn = pdFALSE;\r
+ }\r
\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-static signed portBASE_TYPE prvIsQueueFull( const xQueueHandle pxQueue )\r
+static signed portBASE_TYPE prvIsQueueFull( const xQUEUE *pxQueue )\r
{\r
signed portBASE_TYPE xReturn;\r
\r
taskENTER_CRITICAL();\r
- xReturn = ( pxQueue->uxMessagesWaiting == pxQueue->uxLength );\r
+ {\r
+ if( pxQueue->uxMessagesWaiting == pxQueue->uxLength )\r
+ {\r
+ xReturn = pdTRUE;\r
+ }\r
+ else\r
+ {\r
+ xReturn = pdFALSE;\r
+ }\r
+ }\r
taskEXIT_CRITICAL();\r
\r
return xReturn;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle pxQueue )\r
+signed portBASE_TYPE xQueueIsQueueFullFromISR( const xQueueHandle xQueue )\r
{\r
signed portBASE_TYPE xReturn;\r
\r
- configASSERT( pxQueue );\r
- xReturn = ( pxQueue->uxMessagesWaiting == pxQueue->uxLength );\r
+ configASSERT( xQueue );\r
+ if( ( ( xQUEUE * ) xQueue )->uxMessagesWaiting == ( ( xQUEUE * ) xQueue )->uxLength )\r
+ {\r
+ xReturn = pdTRUE;\r
+ }\r
+ else\r
+ {\r
+ xReturn = pdFALSE;\r
+ }\r
\r
return xReturn;\r
}\r
\r
#if ( configUSE_CO_ROUTINES == 1 )\r
\r
- signed portBASE_TYPE xQueueCRSend( xQueueHandle pxQueue, const void *pvItemToQueue, portTickType xTicksToWait )\r
+ signed portBASE_TYPE xQueueCRSend( xQueueHandle xQueue, const void *pvItemToQueue, portTickType xTicksToWait )\r
{\r
signed portBASE_TYPE xReturn;\r
+ xQUEUE *pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
\r
/* If the queue is already full we may have to block. A critical section\r
is required to prevent an interrupt removing something from the queue\r
}\r
portENABLE_INTERRUPTS();\r
\r
- portNOP();\r
-\r
portDISABLE_INTERRUPTS();\r
{\r
if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )\r
\r
#if ( configUSE_CO_ROUTINES == 1 )\r
\r
- signed portBASE_TYPE xQueueCRReceive( xQueueHandle pxQueue, void *pvBuffer, portTickType xTicksToWait )\r
+ signed portBASE_TYPE xQueueCRReceive( xQueueHandle xQueue, void *pvBuffer, portTickType xTicksToWait )\r
{\r
signed portBASE_TYPE xReturn;\r
+ xQUEUE *pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
\r
/* If the queue is already empty we may have to block. A critical section\r
is required to prevent an interrupt adding something to the queue\r
}\r
portENABLE_INTERRUPTS();\r
\r
- portNOP();\r
-\r
portDISABLE_INTERRUPTS();\r
{\r
if( pxQueue->uxMessagesWaiting > ( unsigned portBASE_TYPE ) 0 )\r
\r
#if ( configUSE_CO_ROUTINES == 1 )\r
\r
- signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle pxQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken )\r
+ signed portBASE_TYPE xQueueCRSendFromISR( xQueueHandle xQueue, const void *pvItemToQueue, signed portBASE_TYPE xCoRoutinePreviouslyWoken )\r
{\r
+ xQUEUE *pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
+\r
/* Cannot block within an ISR so if there is no space on the queue then\r
exit without doing anything. */\r
if( pxQueue->uxMessagesWaiting < pxQueue->uxLength )\r
\r
#if ( configUSE_CO_ROUTINES == 1 )\r
\r
- signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle pxQueue, void *pvBuffer, signed portBASE_TYPE *pxCoRoutineWoken )\r
+ signed portBASE_TYPE xQueueCRReceiveFromISR( xQueueHandle xQueue, void *pvBuffer, signed portBASE_TYPE *pxCoRoutineWoken )\r
{\r
signed portBASE_TYPE xReturn;\r
+ xQUEUE * pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
\r
/* We cannot block from an ISR, so check there is data available. If\r
not then just leave without doing anything. */\r
\r
#if ( configQUEUE_REGISTRY_SIZE > 0 )\r
\r
- static void vQueueUnregisterQueue( xQueueHandle xQueue )\r
+ static void prvQueueUnregisterQueue( xQueueHandle xQueue )\r
{\r
unsigned portBASE_TYPE ux;\r
\r
\r
#if ( configUSE_TIMERS == 1 )\r
\r
- void vQueueWaitForMessageRestricted( xQueueHandle pxQueue, portTickType xTicksToWait )\r
+ void vQueueWaitForMessageRestricted( xQueueHandle xQueue, portTickType xTicksToWait )\r
{\r
+ xQUEUE *pxQueue;\r
+\r
+ pxQueue = ( xQUEUE * ) xQueue;\r
+\r
/* This function should not be called by application code hence the\r
'Restricted' in its name. It is not part of the public API. It is\r
designed for use by kernel code, and has special calling requirements.\r
\r
xQueueSetHandle xQueueCreateSet( unsigned portBASE_TYPE uxEventQueueLength )\r
{\r
- xQUEUE *pxQueue;\r
+ xQueueSetHandle pxQueue;\r
\r
pxQueue = xQueueGenericCreate( uxEventQueueLength, sizeof( xQUEUE * ), queueQUEUE_TYPE_SET );\r
\r
- return ( xQueueSetHandle ) pxQueue;\r
+ return pxQueue;\r
}\r
\r
#endif /* configUSE_QUEUE_SETS */\r
{\r
portBASE_TYPE xReturn;\r
\r
- if( xQueueOrSemaphore->pxQueueSetContainer != NULL )\r
+ if( ( ( xQUEUE * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )\r
{\r
xReturn = pdFAIL;\r
}\r
{\r
taskENTER_CRITICAL();\r
{\r
- xQueueOrSemaphore->pxQueueSetContainer = xQueueSet;\r
+ ( ( xQUEUE * ) xQueueOrSemaphore )->pxQueueSetContainer = xQueueSet;\r
}\r
taskEXIT_CRITICAL();\r
xReturn = pdPASS;\r
portBASE_TYPE xQueueRemoveFromSet( xQueueSetMemberHandle xQueueOrSemaphore, xQueueSetHandle xQueueSet )\r
{\r
portBASE_TYPE xReturn;\r
+ xQUEUE *pxQueueOrSemaphore;\r
+\r
+ pxQueueOrSemaphore = ( xQUEUE * ) xQueueOrSemaphore;\r
\r
- if( xQueueOrSemaphore->pxQueueSetContainer != xQueueSet )\r
+ if( pxQueueOrSemaphore->pxQueueSetContainer != xQueueSet )\r
{\r
/* The queue was not a member of the set. */\r
xReturn = pdFAIL;\r
}\r
- else if( xQueueOrSemaphore->uxMessagesWaiting != 0 )\r
+ else if( pxQueueOrSemaphore->uxMessagesWaiting != 0 )\r
{\r
/* It is dangerous to remove a queue from a set when the queue is\r
not empty because the queue set will still hold pending events for\r
taskENTER_CRITICAL();\r
{\r
/* The queue is no longer contained in the set. */\r
- xQueueOrSemaphore->pxQueueSetContainer = NULL;\r
+ pxQueueOrSemaphore->pxQueueSetContainer = NULL;\r
}\r
taskEXIT_CRITICAL();\r
xReturn = pdPASS;\r
#define prvGetTCBFromHandle( pxHandle ) ( ( ( pxHandle ) == NULL ) ? ( tskTCB * ) pxCurrentTCB : ( tskTCB * ) ( pxHandle ) )\r
\r
/* Callback function prototypes. --------------------------*/\r
-extern void vApplicationStackOverflowHook( xTaskHandle pxTask, signed char *pcTaskName );\r
+extern void vApplicationStackOverflowHook( xTaskHandle xTask, signed char *pcTaskName );\r
extern void vApplicationTickHook( void );\r
\r
/* File private functions. --------------------------------*/\r
\r
#if ( INCLUDE_vTaskDelete == 1 )\r
\r
- void vTaskDelete( xTaskHandle pxTaskToDelete )\r
+ void vTaskDelete( xTaskHandle xTaskToDelete )\r
{\r
tskTCB *pxTCB;\r
\r
{\r
/* Ensure a yield is performed if the current task is being\r
deleted. */\r
- if( pxTaskToDelete == pxCurrentTCB )\r
+ if( xTaskToDelete == pxCurrentTCB )\r
{\r
- pxTaskToDelete = NULL;\r
+ xTaskToDelete = NULL;\r
}\r
\r
/* If null is passed in here then we are deleting ourselves. */\r
- pxTCB = prvGetTCBFromHandle( pxTaskToDelete );\r
+ pxTCB = prvGetTCBFromHandle( xTaskToDelete );\r
\r
/* Remove task from the ready list and place in the termination list.\r
This will stop the task from be scheduled. The idle task will check\r
/* Force a reschedule if we have just deleted the current task. */\r
if( xSchedulerRunning != pdFALSE )\r
{\r
- if( ( void * ) pxTaskToDelete == NULL )\r
+ if( ( void * ) xTaskToDelete == NULL )\r
{\r
portYIELD_WITHIN_API();\r
}\r
\r
#if ( INCLUDE_eTaskGetState == 1 )\r
\r
- eTaskState eTaskGetState( xTaskHandle pxTask )\r
+ eTaskState eTaskGetState( xTaskHandle xTask )\r
{\r
eTaskState eReturn;\r
xList *pxStateList;\r
tskTCB *pxTCB;\r
\r
- pxTCB = ( tskTCB * ) pxTask;\r
+ pxTCB = ( tskTCB * ) xTask;\r
\r
if( pxTCB == pxCurrentTCB )\r
{\r
\r
#if ( INCLUDE_uxTaskPriorityGet == 1 )\r
\r
- unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle pxTask )\r
+ unsigned portBASE_TYPE uxTaskPriorityGet( xTaskHandle xTask )\r
{\r
tskTCB *pxTCB;\r
unsigned portBASE_TYPE uxReturn;\r
{\r
/* If null is passed in here then we are changing the\r
priority of the calling function. */\r
- pxTCB = prvGetTCBFromHandle( pxTask );\r
+ pxTCB = prvGetTCBFromHandle( xTask );\r
uxReturn = pxTCB->uxPriority;\r
}\r
taskEXIT_CRITICAL();\r
\r
#if ( INCLUDE_vTaskPrioritySet == 1 )\r
\r
- void vTaskPrioritySet( xTaskHandle pxTask, unsigned portBASE_TYPE uxNewPriority )\r
+ void vTaskPrioritySet( xTaskHandle xTask, unsigned portBASE_TYPE uxNewPriority )\r
{\r
tskTCB *pxTCB;\r
unsigned portBASE_TYPE uxCurrentPriority, uxPriorityUsedOnEntry;\r
\r
taskENTER_CRITICAL();\r
{\r
- if( pxTask == pxCurrentTCB )\r
+ if( xTask == pxCurrentTCB )\r
{\r
- pxTask = NULL;\r
+ xTask = NULL;\r
}\r
\r
/* If null is passed in here then we are changing the\r
priority of the calling function. */\r
- pxTCB = prvGetTCBFromHandle( pxTask );\r
+ pxTCB = prvGetTCBFromHandle( xTask );\r
\r
traceTASK_PRIORITY_SET( pxTCB, uxNewPriority );\r
\r
priority than the calling task. */\r
if( uxNewPriority > uxCurrentPriority )\r
{\r
- if( pxTask != NULL )\r
+ if( xTask != NULL )\r
{\r
/* The priority of another task is being raised. If we\r
were raising the priority of the currently running task\r
xYieldRequired = pdTRUE;\r
}\r
}\r
- else if( pxTask == NULL )\r
+ else if( xTask == NULL )\r
{\r
/* Setting our own priority down means there may now be another\r
task of higher priority that is ready to execute. */\r
\r
#if ( INCLUDE_vTaskSuspend == 1 )\r
\r
- void vTaskSuspend( xTaskHandle pxTaskToSuspend )\r
+ void vTaskSuspend( xTaskHandle xTaskToSuspend )\r
{\r
tskTCB *pxTCB;\r
\r
{\r
/* Ensure a yield is performed if the current task is being\r
suspended. */\r
- if( pxTaskToSuspend == pxCurrentTCB )\r
+ if( xTaskToSuspend == pxCurrentTCB )\r
{\r
- pxTaskToSuspend = NULL;\r
+ xTaskToSuspend = NULL;\r
}\r
\r
/* If null is passed in here then we are suspending ourselves. */\r
- pxTCB = prvGetTCBFromHandle( pxTaskToSuspend );\r
+ pxTCB = prvGetTCBFromHandle( xTaskToSuspend );\r
\r
traceTASK_SUSPEND( pxTCB );\r
\r
}\r
taskEXIT_CRITICAL();\r
\r
- if( ( void * ) pxTaskToSuspend == NULL )\r
+ if( ( void * ) xTaskToSuspend == NULL )\r
{\r
if( xSchedulerRunning != pdFALSE )\r
{\r
\r
#if ( INCLUDE_vTaskSuspend == 1 )\r
\r
- void vTaskResume( xTaskHandle pxTaskToResume )\r
+ void vTaskResume( xTaskHandle xTaskToResume )\r
{\r
tskTCB *pxTCB;\r
\r
/* It does not make sense to resume the calling task. */\r
- configASSERT( pxTaskToResume );\r
+ configASSERT( xTaskToResume );\r
\r
/* Remove the task from whichever list it is currently in, and place\r
it in the ready list. */\r
- pxTCB = ( tskTCB * ) pxTaskToResume;\r
+ pxTCB = ( tskTCB * ) xTaskToResume;\r
\r
/* The parameter cannot be NULL as it is impossible to resume the\r
currently executing task. */\r
\r
#if ( ( INCLUDE_xTaskResumeFromISR == 1 ) && ( INCLUDE_vTaskSuspend == 1 ) )\r
\r
- portBASE_TYPE xTaskResumeFromISR( xTaskHandle pxTaskToResume )\r
+ portBASE_TYPE xTaskResumeFromISR( xTaskHandle xTaskToResume )\r
{\r
portBASE_TYPE xYieldRequired = pdFALSE;\r
tskTCB *pxTCB;\r
unsigned portBASE_TYPE uxSavedInterruptStatus;\r
\r
- configASSERT( pxTaskToResume );\r
+ configASSERT( xTaskToResume );\r
\r
- pxTCB = ( tskTCB * ) pxTaskToResume;\r
+ pxTCB = ( tskTCB * ) xTaskToResume;\r
\r
uxSavedInterruptStatus = portSET_INTERRUPT_MASK_FROM_ISR();\r
{\r