\r
A special exception to the GPL can be applied should you wish to distribute\r
a combined work that includes FreeRTOS.org, without being obliged to provide\r
- the source code for any proprietary components. See the licensing section \r
+ the source code for any proprietary components. See the licensing section\r
of http://www.FreeRTOS.org for full details of how and when the exception\r
can be applied.\r
\r
***************************************************************************\r
- See http://www.FreeRTOS.org for documentation, latest information, license \r
- and contact details. Please ensure to read the configuration and relevant \r
+ See http://www.FreeRTOS.org for documentation, latest information, license\r
+ and contact details. Please ensure to read the configuration and relevant\r
port sections of the online documentation.\r
***************************************************************************\r
*/\r
* application requirements.\r
*\r
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE\r
- * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. \r
+ * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.\r
*----------------------------------------------------------*/\r
\r
#define configUSE_PREEMPTION 1\r
-#define configUSE_IDLE_HOOK 0\r
+#define configUSE_IDLE_HOOK 1\r
#define configUSE_TICK_HOOK 0\r
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 8000000 )\r
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )\r
#define configIDLE_SHOULD_YIELD 1\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
/* Scheduler include files. */\r
#include "FreeRTOS.h"\r
#include "task.h"\r
+#include "croutine.h"\r
\r
/* Demo file headers. */\r
#include "PollQ.h"\r
#include "integer.h"\r
#include "serial.h"\r
#include "comtest.h"\r
-#include "flash.h"\r
+#include "crflash.h"\r
#include "print.h"\r
#include "partest.h"\r
+#include "regtest.h"\r
\r
/* Priority definitions for most of the tasks in the demo application. Some\r
tasks just use the idle priority. */\r
the demo application is not unexpectedly resetting. */\r
#define mainRESET_COUNT_ADDRESS ( ( void * ) 0x50 )\r
\r
+/* The number of coroutines to create. */\r
+#define mainNUM_FLASH_COROUTINES ( 3 )\r
+\r
/*\r
* The task function for the "Check" task.\r
*/\r
*/\r
static void prvIncrementResetCount( void );\r
\r
+/*\r
+ * Idle hook is used to scheduler co-routines.\r
+ */\r
+void vApplicationIdleHook( void ); \r
+\r
portSHORT main( void )\r
{\r
prvIncrementResetCount();\r
/* Setup the LED's for output. */\r
vParTestInitialise();\r
\r
+ /* Create the standard demo tasks. */\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
- vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
-\r
+ vStartRegTestTasks();\r
+ \r
+ /* Create the tasks defined within this file. */\r
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
+ /* Create the co-routines that flash the LED's. */\r
+ vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );\r
+ \r
/* In this port, to use preemptive scheduler define configUSE_PREEMPTION\r
as 1 in portmacro.h. To use the cooperative scheduler define\r
configUSE_PREEMPTION as 0. */\r
xErrorHasOccurred = pdTRUE;\r
}\r
\r
+ if( xAreRegTestTasksStillRunning() != pdTRUE )\r
+ {\r
+ xErrorHasOccurred = pdTRUE;\r
+ }\r
+ \r
if( xErrorHasOccurred == pdFALSE )\r
{\r
/* Toggle the LED if everything is okay so we know if an error occurs even if not\r
EECR = ucWrite1;\r
EECR = ( ucWrite1 | ucWrite2 );\r
}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationIdleHook( void )\r
+{\r
+ vCoRoutineSchedule();\r
+}\r
\r
<?xml version="1.0" encoding="iso-8859-1"?>\r
\r
<project>\r
- <fileVersion>1</fileVersion>\r
+ <fileVersion>2</fileVersion>\r
<configuration>\r
<name>Debug</name>\r
+ <outputs>\r
+ <file>$PROJ_DIR$\..\Common\Minimal\flash.c</file>\r
+ <file>$PROJ_DIR$\Output\Obj\flash.pbi</file>\r
+ <file>$TOOLKIT_DIR$\inc\clib\sysmac.h</file>\r
+ <file>$TOOLKIT_DIR$\inc\clib\stdarg.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\regtest.pbi</file>\r
+ <file>$PROJ_DIR$\..\..\Source\include\FreeRTOS.h</file>\r
+ <file>$PROJ_DIR$\..\Common\include\PollQ.h</file>\r
+ <file>$TOOLKIT_DIR$\inc\clib\stddef.h</file>\r
+ <file>$TOOLKIT_DIR$\inc\iomacro.h</file>\r
+ <file>$PROJ_DIR$\Output\List\PollQ.lst</file>\r
+ <file>$PROJ_DIR$\..\Common\include\partest.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\queue.pbi</file>\r
+ <file>$PROJ_DIR$\..\Common\include\flash.h</file>\r
+ <file>$TOOLKIT_DIR$\inc\clib\string.h</file>\r
+ <file>$TOOLKIT_DIR$\inc\clib\stdlib.h</file>\r
+ <file>$PROJ_DIR$\..\..\Source\include\queue.h</file>\r
+ <file>$PROJ_DIR$\..\..\Source\include\croutine.h</file>\r
+ <file>$PROJ_DIR$\..\Common\include\print.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\ParTest.r90</file>\r
+ <file>$PROJ_DIR$\..\Common\include\serial.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\main.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\PollQ.r90</file>\r
+ <file>$PROJ_DIR$\FreeRTOSConfig.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\heap_1.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\integer.r90</file>\r
+ <file>$TOOLKIT_DIR$\inc\clib\stdio.h</file>\r
+ <file>$PROJ_DIR$\Output\List\tasks.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\queue.lst</file>\r
+ <file>$PROJ_DIR$\..\Common\include\integer.h</file>\r
+ <file>$TOOLKIT_DIR$\src\template\cfgm323.xcl</file>\r
+ <file>$PROJ_DIR$\Output\List\ParTest.lst</file>\r
+ <file>$PROJ_DIR$\Output\List\comtest.lst</file>\r
+ <file>$PROJ_DIR$\Output\List\tasks.lst</file>\r
+ <file>$TOOLKIT_DIR$\inc\iom323.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\comtest.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\list.pbi</file>\r
+ <file>$PROJ_DIR$\Output\Obj\serial.r90</file>\r
+ <file>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.h</file>\r
+ <file>$PROJ_DIR$\regtest.c</file>\r
+ <file>$PROJ_DIR$\Output\Obj\crflash.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\rtosdemo.pbd</file>\r
+ <file>$PROJ_DIR$\Output\Obj\heap_1.pbi</file>\r
+ <file>$PROJ_DIR$\Output\Exe\rtosdemo.d90</file>\r
+ <file>$TOOLKIT_DIR$\lib\clib\cl3s-ec-sf.r90</file>\r
+ <file>$PROJ_DIR$\Output\List\integer.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\serial.lst</file>\r
+ <file>$PROJ_DIR$\Output\Obj\integer.pbi</file>\r
+ <file>$PROJ_DIR$\Output\Exe\rtosdemo.a90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\main.pbi</file>\r
+ <file>$PROJ_DIR$\..\..\Source\include\projdefs.h</file>\r
+ <file>$PROJ_DIR$\Output\List\regtest.lst</file>\r
+ <file>$PROJ_DIR$\Output\Obj\flash.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\list.r90</file>\r
+ <file>$PROJ_DIR$\..\..\Source\include\list.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\tasks.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\ParTest.pbi</file>\r
+ <file>$PROJ_DIR$\..\Common\include\comtest.h</file>\r
+ <file>$PROJ_DIR$\Output\List\main.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\serial.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\port.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\heap_1.lst</file>\r
+ <file>$PROJ_DIR$\Output\Exe\rtosdemo.cof</file>\r
+ <file>$PROJ_DIR$\Output\List\queue.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\PollQ.s90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\port.pbi</file>\r
+ <file>$PROJ_DIR$\Output\List\ParTest.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\integer.lst</file>\r
+ <file>$PROJ_DIR$\Output\Obj\port.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\comtest.pbi</file>\r
+ <file>$PROJ_DIR$\..\..\Source\include\task.h</file>\r
+ <file>$TOOLKIT_DIR$\src\template\cfg3soim.xcl</file>\r
+ <file>$PROJ_DIR$\Output\List\comtest.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\main.lst</file>\r
+ <file>$PROJ_DIR$\Output\List\flash.lst</file>\r
+ <file>$PROJ_DIR$\Output\List\flash.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\port.lst</file>\r
+ <file>$PROJ_DIR$\Output\List\heap_1.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\list.lst</file>\r
+ <file>$PROJ_DIR$\Output\List\rtosdemo.map</file>\r
+ <file>$PROJ_DIR$\Output\Obj\tasks.pbi</file>\r
+ <file>$PROJ_DIR$\Output\Obj\serial.pbi</file>\r
+ <file>$PROJ_DIR$\Output\List\list.s90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\PollQ.pbi</file>\r
+ <file>$PROJ_DIR$\Output\List\regtest.s90</file>\r
+ <file>$PROJ_DIR$\Output\List\crflash.s90</file>\r
+ <file>$PROJ_DIR$\..\..\Source\list.c</file>\r
+ <file>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.s90</file>\r
+ <file>$PROJ_DIR$\..\Common\Minimal\PollQ.c</file>\r
+ <file>$PROJ_DIR$\ParTest\ParTest.c</file>\r
+ <file>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</file>\r
+ <file>$PROJ_DIR$\..\..\Source\queue.c</file>\r
+ <file>$PROJ_DIR$\Output\Obj\portmacro.r90</file>\r
+ <file>$PROJ_DIR$\..\..\Source\tasks.c</file>\r
+ <file>$PROJ_DIR$\serial\serial.c</file>\r
+ <file>$PROJ_DIR$\..\..\Source\include\portable.h</file>\r
+ <file>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</file>\r
+ <file>$PROJ_DIR$\main.c</file>\r
+ <file>$PROJ_DIR$\Output\Exe\rtosdemo.elf</file>\r
+ <file>$PROJ_DIR$\..\Common\Minimal\comtest.c</file>\r
+ <file>$PROJ_DIR$\Output\Exe\rtosdemo.dbg</file>\r
+ <file>$PROJ_DIR$\..\Common\include\crflash.h</file>\r
+ <file>$PROJ_DIR$\Output\Obj\queue.r90</file>\r
+ <file>$PROJ_DIR$\Output\List\croutine.lst</file>\r
+ <file>$PROJ_DIR$\..\Common\Minimal\integer.c</file>\r
+ <file>$PROJ_DIR$\Output\Obj\croutine.r90</file>\r
+ <file>$PROJ_DIR$\Output\List\croutine.s90</file>\r
+ <file>$PROJ_DIR$\regtest.h</file>\r
+ <file>$PROJ_DIR$\..\..\Source\croutine.c</file>\r
+ <file>$PROJ_DIR$\Output\List\crflash.lst</file>\r
+ <file>$PROJ_DIR$\Output\Obj\croutine.pbi</file>\r
+ <file>$PROJ_DIR$\..\Common\Minimal\crflash.c</file>\r
+ <file>$PROJ_DIR$\Output\Obj\regtest.r90</file>\r
+ <file>$PROJ_DIR$\Output\Obj\crflash.pbi</file>\r
+ </outputs>\r
<file>\r
- <name>$PROJ_DIR$\ParTest\ParTest.c</name>\r
+ <name>[ROOT_NODE]</name>\r
+ <outputs>\r
+ <tool>\r
+ <name>XLINK</name>\r
+ <file> 47 78</file>\r
+ </tool>\r
+ </outputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\ParTest.r90</file>\r
+ <file> 51 74 73</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 1</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 10 12</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 10 12</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\serial\serial.c</name>\r
+ <name>$PROJ_DIR$\regtest.c</name>\r
+ <outputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 111 83 50</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 4</file>\r
+ </tool>\r
+ </outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 69 53 106</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 69 53 106</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\Output\Obj\rtosdemo.pbd</name>\r
+ <inputs>\r
+ <tool>\r
+ <name>BILINK</name>\r
+ <file> 55 82 68 112 109 41 46 35 48 64 11 4 80 79</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\Output\Exe\rtosdemo.d90</name>\r
+ <inputs>\r
+ <tool>\r
+ <name>XLINK</name>\r
+ <file> 29 70 18 21 34 51 23 24 52 20 67 91 101 36 54 43</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\Output\Exe\rtosdemo.a90</name>\r
+ <outputs>\r
+ <tool>\r
+ <name>XLINK</name>\r
+ <file> 78</file>\r
+ </tool>\r
+ </outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>XLINK</name>\r
+ <file> 29 70 18 21 34 39 104 23 24 52 20 67 91 101 111 36 54 43</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\Output\Exe\rtosdemo.cof</name>\r
+ <inputs>\r
+ <tool>\r
+ <name>XLINK</name>\r
+ <file> 29 70 18 21 34 51 23 24 52 20 67 91 101 36 54 43</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\list.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\serial.r90</file>\r
+ <file> 52 81 77</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 35</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 53</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 53</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
<name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.s90</name>\r
<outputs>\r
<tool>\r
<name>AAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\portmacro.r90</file>\r
+ <file> 91</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>AAVR</name>\r
+ <file> 33 8</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\comtest.r90</file>\r
+ <file> 21 63 9</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 82</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 15 6</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 15 6</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\..\Source\tasks.c</name>\r
+ <name>$PROJ_DIR$\ParTest\ParTest.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\tasks.r90</file>\r
+ <file> 18 65 30</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 55</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 69 53 10</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 69 53 10</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>\r
+ <name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\integer.r90</file>\r
+ <file> 67 59 75</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 64</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</name>\r
+ <name>$PROJ_DIR$\..\..\Source\queue.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\heap_1.r90</file>\r
+ <file> 101 62 27</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 11</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</name>\r
+ <name>$PROJ_DIR$\..\..\Source\tasks.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\port.r90</file>\r
+ <file> 54 26 32</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 79</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 25 3 2 14 13 5 7 49 22 33 8 94 37 69 53</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 25 3 2 14 13 5 7 49 22 33 8 94 37 69 53</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>\r
+ <name>$PROJ_DIR$\serial\serial.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\PollQ.r90</file>\r
+ <file> 36 58 45</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 80</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 15 69 53 19</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 15 69 53 19</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\..\Source\queue.c</name>\r
+ <name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\queue.r90</file>\r
+ <file> 23 76 60</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 41</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>\r
+ <name>$PROJ_DIR$\main.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\flash.r90</file>\r
+ <file> 20 57 72</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 48</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16 6 28 19 56 100 17 10 106</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16 6 28 19 56 100 17 10 106</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\main.c</name>\r
+ <name>$PROJ_DIR$\Output\Exe\rtosdemo.elf</name>\r
+ <inputs>\r
+ <tool>\r
+ <name>XLINK</name>\r
+ <file> 29 70 18 21 34 51 23 24 52 20 67 91 101 36 54 43</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\main.r90</file>\r
+ <file> 34 71 31</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 68</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 19 56 10</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 19 56 10</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>$PROJ_DIR$\..\..\Source\list.c</name>\r
+ <name>$PROJ_DIR$\Output\Exe\rtosdemo.dbg</name>\r
+ <inputs>\r
+ <tool>\r
+ <name>XLINK</name>\r
+ <file> 29 70 18 21 34 39 104 23 24 52 20 67 91 101 36 54 43</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>\r
<outputs>\r
<tool>\r
<name>ICCAVR</name>\r
- <file>$PROJ_DIR$\Output\Obj\list.r90</file>\r
+ <file> 24 44 66</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 46</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 28</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 14 2 5 7 49 22 33 8 94 37 69 53 28</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
<file>\r
- <name>[ROOT_NODE]</name>\r
+ <name>$PROJ_DIR$\..\..\Source\croutine.c</name>\r
<outputs>\r
<tool>\r
- <name>XLINK</name>\r
- <file>$PROJ_DIR$\Output\Exe\rtosdemo.a90</file>\r
- <file>$PROJ_DIR$\Output\Exe\rtosdemo.d90</file>\r
+ <name>ICCAVR</name>\r
+ <file> 104 105 102</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 109</file>\r
</tool>\r
</outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 69 53 16</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 69 53 16</file>\r
+ </tool>\r
+ </inputs>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\crflash.c</name>\r
+ <outputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 39 84 108</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 112</file>\r
+ </tool>\r
+ </outputs>\r
+ <inputs>\r
+ <tool>\r
+ <name>ICCAVR</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 16 53 15 10 100</file>\r
+ </tool>\r
+ <tool>\r
+ <name>BICOMP</name>\r
+ <file> 5 7 2 49 22 33 8 94 37 16 53 15 10 100</file>\r
+ </tool>\r
+ </inputs>\r
</file>\r
- <forcedrebuild>\r
- <name>[MULTI_TOOL]</name>\r
- <tool>XLINK</tool>\r
- </forcedrebuild>\r
</configuration>\r
</project>\r
\r
<debug>1</debug>\r
<settings>\r
<name>C-SPY</name>\r
- <archiveVersion>2</archiveVersion>\r
+ <archiveVersion>3</archiveVersion>\r
<data>\r
- <version>11</version>\r
+ <version>12</version>\r
<wantNonLocal>1</wantNonLocal>\r
<debug>1</debug>\r
<option>\r
<name>CDynDriver</name>\r
<state>SIMAVR</state>\r
</option>\r
+ <option>\r
+ <name>DebuggerUseUbrofResetVector</name>\r
+ <state>0</state>\r
+ </option>\r
</data>\r
</settings>\r
<settings>\r
</settings>\r
<settings>\r
<name>JTAGICEAVR</name>\r
- <archiveVersion>2</archiveVersion>\r
+ <archiveVersion>3</archiveVersion>\r
<data>\r
- <version>1</version>\r
+ <version>2</version>\r
<wantNonLocal>1</wantNonLocal>\r
<debug>1</debug>\r
<option>\r
<name>OJTAGICEAVRJtagIcedownloadToData</name>\r
<state>0</state>\r
</option>\r
+ <option>\r
+ <name>ExitBreakpointP7</name>\r
+ <state>0</state>\r
+ </option>\r
+ <option>\r
+ <name>PutcharBreakpointP7</name>\r
+ <state>1</state>\r
+ </option>\r
+ <option>\r
+ <name>GetcharBreakpointP7</name>\r
+ <state>1</state>\r
+ </option>\r
</data>\r
</settings>\r
<settings>\r
<name>JTAGICEMKIIAVR</name>\r
- <archiveVersion>1</archiveVersion>\r
+ <archiveVersion>2</archiveVersion>\r
<data>\r
- <version>3</version>\r
+ <version>4</version>\r
<wantNonLocal>1</wantNonLocal>\r
<debug>1</debug>\r
<option>\r
<name>OJTAGICEMKIIAVRJtagSoftwareBreak</name>\r
<state>0</state>\r
</option>\r
+ <option>\r
+ <name>ExitBreakpointP7</name>\r
+ <state>0</state>\r
+ </option>\r
+ <option>\r
+ <name>PutcharBreakpointP7</name>\r
+ <state>1</state>\r
+ </option>\r
+ <option>\r
+ <name>GetcharBreakpointP7</name>\r
+ <state>1</state>\r
+ </option>\r
</data>\r
</settings>\r
<settings>\r
<loadFlag>1</loadFlag>\r
</plugin>\r
<plugin>\r
- <file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>\r
- <loadFlag>1</loadFlag>\r
+ <file>$EW_DIR$\common\plugins\Orti\Orti.ewplugin</file>\r
+ <loadFlag>0</loadFlag>\r
</plugin>\r
<plugin>\r
- <file>$EW_DIR$\common\plugins\Trace\Trace.ewplugin</file>\r
+ <file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>\r
<loadFlag>1</loadFlag>\r
</plugin>\r
<plugin>\r
- <file>$EW_DIR$\common\plugins\Orti\Orti.ewplugin</file>\r
- <loadFlag>0</loadFlag>\r
+ <file>$EW_DIR$\common\plugins\Stack\stack.ewplugin</file>\r
+ <loadFlag>1</loadFlag>\r
</plugin>\r
</debuggerPlugins>\r
</configuration>\r
</option>\r
<option>\r
<name>New Variant Processor</name>\r
- <version>13</version>\r
- <state>41</state>\r
+ <version>15</version>\r
+ <state>47</state>\r
</option>\r
<option>\r
<name>GRuntimeLibSelect</name>\r
<name>XLINK</name>\r
<archiveVersion>2</archiveVersion>\r
<data>\r
- <version>12</version>\r
+ <version>13</version>\r
<wantNonLocal>1</wantNonLocal>\r
<debug>1</debug>\r
<option>\r
</option>\r
<option>\r
<name>OutputFile</name>\r
- <state>rtosdemo.d90</state>\r
+ <state>rtosdemo.a90</state>\r
</option>\r
<option>\r
<name>OutputFormat</name>\r
- <version>10</version>\r
+ <version>11</version>\r
<state>23</state>\r
</option>\r
<option>\r
<name>FormatVariant</name>\r
- <version>6</version>\r
+ <version>7</version>\r
<state>2</state>\r
</option>\r
<option>\r
</option>\r
<option>\r
<name>DebugInformation</name>\r
- <state>0</state>\r
+ <state>1</state>\r
</option>\r
<option>\r
<name>RuntimeControl</name>\r
</option>\r
<option>\r
<name>ExtraOutputFile</name>\r
- <state>rtosdemo.a90</state>\r
+ <state>rtosdemo.elf</state>\r
</option>\r
<option>\r
<name>ExtraOutputFormat</name>\r
- <version>10</version>\r
- <state>25</state>\r
+ <version>11</version>\r
+ <state>16</state>\r
</option>\r
<option>\r
<name>ExtraFormatVariant</name>\r
- <version>6</version>\r
+ <version>7</version>\r
<state>2</state>\r
</option>\r
<option>\r
<name>RawBinaryAlign</name>\r
<state></state>\r
</option>\r
+ <option>\r
+ <name>CrcAlign</name>\r
+ <state>1</state>\r
+ </option>\r
+ <option>\r
+ <name>CrcInitialValue</name>\r
+ <state>0x00</state>\r
+ </option>\r
</data>\r
</settings>\r
<settings>\r
<data/>\r
</settings>\r
</configuration>\r
- <file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\..\Source\list.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\main.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\ParTest\ParTest.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.s90</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\..\Source\queue.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\serial\serial.c</name>\r
- </file>\r
- <file>\r
- <name>$PROJ_DIR$\..\..\Source\tasks.c</name>\r
- </file>\r
+ <group>\r
+ <name>Demo Source</name>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\crflash.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\main.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\ParTest\ParTest.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\regtest.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\serial\serial.c</name>\r
+ </file>\r
+ </group>\r
+ <group>\r
+ <name>Kernel Source</name>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\croutine.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\list.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.s90</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\queue.c</name>\r
+ </file>\r
+ <file>\r
+ <name>$PROJ_DIR$\..\..\Source\tasks.c</name>\r
+ </file>\r
+ </group>\r
</project>\r
\r
\r
Wnd9=_ "Terminal I/O" "closed" 44 0 1 -1 -1 -1 -1 1138 522 1595 826\r
Maximized=_ 0\r
Count=_ 10\r
-[Log file]\r
+[TermIOLog]\r
LoggingEnabled=_ 0\r
LogFile=_ ""\r
-Category=_ 0\r
-[TermIOLog]\r
+[Log file]\r
LoggingEnabled=_ 0\r
LogFile=_ ""\r
+Category=_ 0\r
[Breakpoints]\r
Count=0\r
+[TraceHelper]\r
+Enabled=0\r
+ShowSource=1\r
\r
\r
\r
- <Column0>109</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>\r
+ <Column0>246</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>\r
</Workspace>\r
- <Build><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1153</ColumnWidth1><ColumnWidth2>307</ColumnWidth2><ColumnWidth3>76</ColumnWidth3></Build></Static>\r
+ <Build><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1153</ColumnWidth1><ColumnWidth2>307</ColumnWidth2><ColumnWidth3>76</ColumnWidth3></Build><Debug-Log/></Static>\r
<Windows>\r
\r
- <Wnd0>\r
+ <Wnd2>\r
<Tabs>\r
<Tab>\r
<Identity>TabID-12388-19520</Identity>\r
<Factory>Workspace</Factory>\r
<Session>\r
\r
- <NodeDict><ExpandedNode>rtosdemo</ExpandedNode><ExpandedNode>rtosdemo/portheap.c</ExpandedNode></NodeDict></Session>\r
+ <NodeDict><ExpandedNode>rtosdemo</ExpandedNode><ExpandedNode>rtosdemo/Demo Source</ExpandedNode><ExpandedNode>rtosdemo/Kernel Source</ExpandedNode><ExpandedNode>rtosdemo/portheap.c</ExpandedNode></NodeDict></Session>\r
</Tab>\r
</Tabs>\r
\r
- <SelectedTab>0</SelectedTab></Wnd0><Wnd1><Tabs><Tab><Identity>TabID-19172-8303</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd1></Windows>\r
+ <SelectedTab>0</SelectedTab></Wnd2><Wnd3><Tabs><Tab><Identity>TabID-19172-8303</Identity><TabName>Build</TabName><Factory>Build</Factory><Session/></Tab><Tab><Identity>TabID-954-28216</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd3></Windows>\r
<Editor>\r
\r
\r
\r
\r
- <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>C:\E\Dev\FreeRTOS\Demo\AVR_ATMega323_IAR\regtest.c</Filename><XPos>0</XPos><YPos>190</YPos><SelStart>6619</SelStart><SelEnd>6619</SelEnd></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Demo\AVR_ATMega323_IAR\main.c</Filename><XPos>0</XPos><YPos>123</YPos><SelStart>5500</SelStart><SelEnd>5500</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\Demo\Common\Minimal\crflash.c</Filename><XPos>0</XPos><YPos>170</YPos><SelStart>6807</SelStart><SelEnd>6807</SelEnd></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-0084f828><key>iaridepm1</key></Toolbar-0084f828></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>718</Bottom><Right>183</Right><x>-2</x><y>-2</y><xscreen>185</xscreen><yscreen>185</yscreen><sizeHorzCX>115625</sizeHorzCX><sizeHorzCY>165326</sizeHorzCY><sizeVertCX>115625</sizeVertCX><sizeVertCY>643431</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>354</Bottom><Right>1602</Right><x>-2</x><y>-2</y><xscreen>1604</xscreen><yscreen>356</yscreen><sizeHorzCX>1002500</sizeHorzCX><sizeHorzCY>318141</sizeHorzCY><sizeVertCX>116250</sizeVertCX><sizeVertCY>166219</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
+ <Top><Row0><Sizes><Toolbar-00a0bb70><key>iaridepm1</key></Toolbar-00a0bb70></Sizes></Row0></Top><Left><Row0><Sizes><Wnd2><Rect><Top>-2</Top><Left>-2</Left><Bottom>619</Bottom><Right>320</Right><x>-2</x><y>-2</y><xscreen>162</xscreen><yscreen>161</yscreen><sizeHorzCX>115714</sizeHorzCX><sizeHorzCY>165638</sizeHorzCY><sizeVertCX>230000</sizeVertCX><sizeVertCY>638889</sizeVertCY></Rect></Wnd2></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd3><Rect><Top>-2</Top><Left>-2</Left><Bottom>307</Bottom><Right>1402</Right><x>-2</x><y>-2</y><xscreen>1404</xscreen><yscreen>309</yscreen><sizeHorzCX>1002857</sizeHorzCX><sizeHorzCY>317901</sizeHorzCY><sizeVertCX>116429</sizeVertCX><sizeVertCY>166667</sizeVertCY></Rect></Wnd3></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>\r
</Desktop>\r
</Workspace>\r
\r
*----------------------------------------------------------*/\r
\r
#define configUSE_PREEMPTION 1\r
-#define configUSE_IDLE_HOOK 0\r
+#define configUSE_IDLE_HOOK 1\r
#define configUSE_TICK_HOOK 0\r
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 8000000 )\r
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )\r
#define configIDLE_SHOULD_YIELD 1\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
/* Scheduler include files. */\r
#include "FreeRTOS.h"\r
#include "task.h"\r
+#include "croutine.h"\r
\r
/* Demo file headers. */\r
#include "PollQ.h"\r
#include "integer.h"\r
#include "serial.h"\r
#include "comtest.h"\r
-#include "flash.h"\r
+#include "crflash.h"\r
#include "print.h"\r
#include "partest.h"\r
+#include "regtest.h"\r
\r
/* Priority definitions for most of the tasks in the demo application. Some\r
tasks just use the idle priority. */\r
the demo application is not unexpectedly resetting. */\r
#define mainRESET_COUNT_ADDRESS ( ( void * ) 0x50 )\r
\r
+/* The number of coroutines to create. */\r
+#define mainNUM_FLASH_COROUTINES ( 3 )\r
+\r
/*\r
* The task function for the "Check" task.\r
*/\r
*/\r
static void prvIncrementResetCount( void );\r
\r
+/*\r
+ * The idle hook is used to scheduler co-routines.\r
+ */\r
+void vApplicationIdleHook( void );\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
portSHORT main( void )\r
{\r
prvIncrementResetCount();\r
/* Setup the LED's for output. */\r
vParTestInitialise();\r
\r
+ /* Create the standard demo tasks. */\r
vStartIntegerMathTasks( tskIDLE_PRIORITY );\r
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );\r
- vStartLEDFlashTasks( mainLED_TASK_PRIORITY );\r
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );\r
-\r
+ vStartRegTestTasks();\r
+ \r
+ /* Create the tasks defined within this file. */\r
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );\r
\r
+ /* Create the co-routines that flash the LED's. */\r
+ vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );\r
+ \r
/* In this port, to use preemptive scheduler define configUSE_PREEMPTION \r
as 1 in portmacro.h. To use the cooperative scheduler define \r
configUSE_PREEMPTION as 0. */\r
xErrorHasOccurred = pdTRUE;\r
}\r
\r
+ if( xAreRegTestTasksStillRunning() != pdTRUE )\r
+ {\r
+ xErrorHasOccurred = pdTRUE;\r
+ }\r
+ \r
if( xErrorHasOccurred == pdFALSE )\r
{\r
/* Toggle the LED if everything is okay so we know if an error occurs even if not\r
ucCount++;\r
eeprom_write_byte( mainRESET_COUNT_ADDRESS, ucCount );\r
}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vApplicationIdleHook( void )\r
+{\r
+ vCoRoutineSchedule();\r
+}\r
\r
main.c \\r
ParTest/ParTest.c \\r
serial/serial.c \\r
+regtest.c \\r
$(SOURCE_DIR)/tasks.c \\r
$(SOURCE_DIR)/queue.c \\r
$(SOURCE_DIR)/list.c \\r
+$(SOURCE_DIR)/croutine.c \\r
$(SOURCE_DIR)/portable/MemMang/heap_1.c \\r
$(PORT_DIR)/port.c \\r
-$(DEMO_DIR)/flash.c \\r
+$(DEMO_DIR)/crflash.c \\r
$(DEMO_DIR)/integer.c \\r
$(DEMO_DIR)/PollQ.c \\r
$(DEMO_DIR)/comtest.c\r
* the same queue. The controlling task writes data to the queue, then checks\r
* to see which of the event tasks read the data from the queue. The\r
* controlling task has the lowest priority of all the tasks so is guaranteed\r
- * to always get preempted immediately upon writhing to the queue.\r
+ * to always get preempted immediately upon writing to the queue.\r
*\r
* By selectively suspending and resuming the event tasks the controlling task\r
* can check that the highest priority task that is blocked on the queue is the\r
the counter specific to this task instance. */\r
( *pxCounter )++;\r
}\r
+ else\r
+ {\r
+ xHealthStatus = pdFAIL;\r
+ }\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
A special exception to the GPL can be applied should you wish to distribute\r
a combined work that includes FreeRTOS.org, without being obliged to provide\r
- the source code for any proprietary components. See the licensing section \r
+ the source code for any proprietary components. See the licensing section\r
of http://www.FreeRTOS.org for full details of how and when the exception\r
can be applied.\r
\r
***************************************************************************\r
- See http://www.FreeRTOS.org for documentation, latest information, license \r
- and contact details. Please ensure to read the configuration and relevant \r
+ See http://www.FreeRTOS.org for documentation, latest information, license\r
+ and contact details. Please ensure to read the configuration and relevant\r
port sections of the online documentation.\r
***************************************************************************\r
*/\r
\r
-/* \r
+/*\r
* This demo application file demonstrates the use of queues to pass data\r
* between co-routines.\r
*\r
* N represents the number of 'fixed delay' co-routines that are created and\r
* is set during initialisation.\r
*\r
- * N 'fixed delay' co-routines are created that just block for a fixed \r
+ * N 'fixed delay' co-routines are created that just block for a fixed\r
* period then post the number of an LED onto a queue. Each such co-routine\r
- * uses a different block period. A single 'flash' co-routine is also created \r
- * that blocks on the same queue, waiting for the number of the next LED it \r
- * should flash. Upon receiving a number it simply toggle the instructed LED \r
- * then blocks on the queue once more. In this manner each LED from LED 0 to \r
+ * uses a different block period. A single 'flash' co-routine is also created\r
+ * that blocks on the same queue, waiting for the number of the next LED it\r
+ * should flash. Upon receiving a number it simply toggle the instructed LED\r
+ * then blocks on the queue once more. In this manner each LED from LED 0 to\r
* LED N-1 is caused to flash at a different rate.\r
*\r
* The 'fixed delay' co-routines are created with co-routine priority 0. The\r
* flash co-routine is created with co-routine priority 1. This means that\r
* the queue should never contain more than a single item. This is because\r
* posting to the queue will unblock the 'flash' co-routine, and as this has\r
- * a priority greater than the tasks posting to the queue it is guaranteed to \r
+ * a priority greater than the tasks posting to the queue it is guaranteed to\r
* have emptied the queue and blocked once again before the queue can contain\r
- * any more date. An error is indicated if an attempt to post data to the \r
+ * any more date. An error is indicated if an attempt to post data to the\r
* queue fails - indicating that the queue is already full.\r
*\r
*/\r
/* We don't want to block when posting to the queue. */\r
#define crfPOSTING_BLOCK_TIME 0\r
\r
-/* \r
+/*\r
* The 'fixed delay' co-routine as described at the top of the file.\r
*/\r
static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex );\r
{\r
/* Even though this is a co-routine the xResult variable does not need to be\r
static as we do not need it to maintain its state between blocks. */\r
-portBASE_TYPE xResult;\r
-/* The uxIndex parameter of the co-routine function is used as an index into \r
+signed portBASE_TYPE xResult;\r
+/* The uxIndex parameter of the co-routine function is used as an index into\r
the xFlashRates array to obtain the delay period to use. */\r
-static const portTickType xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_RATE_MS, \r
- 200 / portTICK_RATE_MS, \r
- 250 / portTICK_RATE_MS, \r
- 300 / portTICK_RATE_MS, \r
+static const portTickType xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_RATE_MS,\r
+ 200 / portTICK_RATE_MS,\r
+ 250 / portTICK_RATE_MS,\r
+ 300 / portTICK_RATE_MS,\r
350 / portTICK_RATE_MS,\r
- 400 / portTICK_RATE_MS, \r
- 450 / portTICK_RATE_MS, \r
+ 400 / portTICK_RATE_MS,\r
+ 450 / portTICK_RATE_MS,\r
500 / portTICK_RATE_MS };\r
\r
/* Co-routines MUST start with a call to crSTART. */\r
\r
for( ;; )\r
{\r
- /* Post our uxIndex value onto the queue. This is used as the LED to \r
+ /* Post our uxIndex value onto the queue. This is used as the LED to\r
flash. */\r
crQUEUE_SEND( xHandle, xFlashQueue, ( void * ) &uxIndex, crfPOSTING_BLOCK_TIME, &xResult );\r
\r
{\r
/* Even though this is a co-routine the variable do not need to be\r
static as we do not need it to maintain their state between blocks. */\r
-portBASE_TYPE xResult;\r
+signed portBASE_TYPE xResult;\r
unsigned portBASE_TYPE uxLEDToFlash;\r
\r
/* Co-routines MUST start with a call to crSTART. */\r
crSTART( xHandle );\r
-\r
+ ( void ) uxIndex;\r
+ \r
for( ;; )\r
{\r
/* Block to wait for the number of the LED to flash. */\r
#define corINITIAL_STATE ( 0 )\r
\r
/*\r
- * Place the co-routine represented by pxCRCB into the appropriate ready queue \r
- * for the priority. It is inserted at the end of the list. \r
+ * Place the co-routine represented by pxCRCB into the appropriate ready queue\r
+ * for the priority. It is inserted at the end of the list.\r
*\r
* This macro accesses the co-routine ready lists and therefore must not be\r
* used from within an ISR.\r
static inline void prvCheckPendingReadyList( void );\r
\r
/*\r
- * Macro that looks at the list of co-routines that are currently delayed to \r
+ * Macro that looks at the list of co-routines that are currently delayed to\r
* see if any require waking.\r
*\r
- * Co-routines are stored in the queue in the order of their wake time - \r
- * meaning once one co-routine has been found whose timer has not expired \r
+ * Co-routines are stored in the queue in the order of their wake time -\r
+ * meaning once one co-routine has been found whose timer has not expired\r
* we need not look any further down the list.\r
*/\r
static inline void prvCheckDelayedList( void );\r
\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex )\r
+signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex )\r
{\r
-portBASE_TYPE xReturn;\r
+signed portBASE_TYPE xReturn;\r
corCRCB *pxCoRoutine;\r
\r
/* Allocate the memory that will store the co-routine control block. */\r
vListInitialiseItem( &( pxCoRoutine->xGenericListItem ) );\r
vListInitialiseItem( &( pxCoRoutine->xEventListItem ) );\r
\r
- /* Set the co-routine control block as a link back from the xListItem. \r
- This is so we can get back to the containing CRCB from a generic item \r
+ /* Set the co-routine control block as a link back from the xListItem.\r
+ This is so we can get back to the containing CRCB from a generic item\r
in a list. */\r
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xGenericListItem ), pxCoRoutine );\r
listSET_LIST_ITEM_OWNER( &( pxCoRoutine->xEventListItem ), pxCoRoutine );\r
static inline void prvCheckPendingReadyList( void )\r
{\r
/* Are there any co-routines waiting to get moved to the ready list? These\r
- are co-routines that have been readied by an ISR. The ISR cannot access \r
+ are co-routines that have been readied by an ISR. The ISR cannot access\r
the ready lists itself. */\r
while( !listLIST_IS_EMPTY( &xPendingReadyList ) )\r
{\r
\r
portDISABLE_INTERRUPTS();\r
{\r
- /* The event could have occurred just before this critical \r
+ /* The event could have occurred just before this critical\r
section. If this is the case then the generic list item will\r
- have been moved to the pending ready list and the following \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
vListRemove( &( pxCRCB->xGenericListItem ) ); \r
vListInitialise( ( xList * ) &xDelayedCoRoutineList2 );\r
vListInitialise( ( xList * ) &xPendingReadyList );\r
\r
- /* Start with pxDelayedCoRoutineList using list1 and the \r
+ /* Start with pxDelayedCoRoutineList using list1 and the\r
pxOverflowDelayedCoRoutineList using list2. */\r
pxDelayedCoRoutineList = &xDelayedCoRoutineList1;\r
pxOverflowDelayedCoRoutineList = &xDelayedCoRoutineList2;\r
}\r
/*-----------------------------------------------------------*/\r
\r
-portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList )\r
+signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList )\r
{\r
corCRCB *pxUnblockedCRCB;\r
-portBASE_TYPE xReturn;\r
+signed portBASE_TYPE xReturn;\r
\r
/* This function is called from within an interrupt. It can only access\r
event lists and the pending ready list. */\r
\r
#include "list.h"\r
\r
-/* Used to hide the implementation of the co-routine control block. The \r
-control block structure however has to be included in the header due to \r
+/* Used to hide the implementation of the co-routine control block. The\r
+control block structure however has to be included in the header due to\r
the macro implementation of the co-routine functionality. */\r
typedef void * xCoRoutineHandle;\r
\r
unsigned portBASE_TYPE uxIndex\r
);</pre>\r
*\r
- * Create a new co-routine and add it to the list of co-routines that are \r
+ * Create a new co-routine and add it to the list of co-routines that are\r
* ready to run.\r
*\r
- * @param pxCoRoutineCode Pointer to the co-routine function. Co-routine \r
- * functions require special syntax - see the co-routine section of the WEB \r
+ * @param pxCoRoutineCode Pointer to the co-routine function. Co-routine\r
+ * functions require special syntax - see the co-routine section of the WEB\r
* documentation for more information.\r
*\r
- * @param uxPriority The priority with respect to other co-routines at which \r
+ * @param uxPriority The priority with respect to other co-routines at which\r
* the co-routine will run.\r
*\r
* @param uxIndex Used to distinguish between different co-routines that\r
for( uxIndex = 0; uxIndex < 2; uxIndex++ )\r
{\r
xCoRoutineCreate( vFlashCoRoutine, 0, uxIndex );\r
- } \r
+ }\r
}\r
</pre>\r
* \defgroup xCoRoutineCreate xCoRoutineCreate\r
* \ingroup Tasks\r
*/\r
-portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex );\r
+signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex );\r
\r
\r
/**\r
void vCoRoutineSchedule( void );</pre>\r
*\r
* Run a co-routine.\r
- * \r
+ *\r
* vCoRoutineSchedule() executes the highest priority co-routine that is able\r
* to run. The co-routine will execute until it either blocks, yields or is\r
- * preempted by a task. Co-routines execute cooperatively so one \r
+ * preempted by a task. Co-routines execute cooperatively so one\r
* co-routine cannot be preempted by another, but can be preempted by a task.\r
*\r
- * If an application comprises of both tasks and co-routines then \r
- * vCoRoutineSchedule should be called from the idle task (in an idle task \r
+ * If an application comprises of both tasks and co-routines then\r
+ * vCoRoutineSchedule should be called from the idle task (in an idle task\r
* hook).\r
*\r
* Example usage:\r
vCoRoutineSchedule();\r
}\r
\r
- // Alternatively, if you do not require any other part of the idle task to \r
+ // Alternatively, if you do not require any other part of the idle task to\r
// execute, the idle task hook can call vCoRoutineScheduler() within an\r
// infinite loop.\r
void vApplicationIdleHook( void )\r
#define crEND() }\r
\r
/*\r
- * These macros are intended for internal use by the co-routine implementation \r
+ * These macros are intended for internal use by the co-routine implementation\r
* only. The macros should not be used directly by application writers.\r
*/\r
#define crSET_STATE0( xHandle ) ( ( corCRCB * )xHandle)->uxState = (__LINE__ * 2); return; case (__LINE__ * 2):\r
* @param xHandle The handle of the co-routine to delay. This is the xHandle\r
* parameter of the co-routine function.\r
*\r
- * @param xTickToDelay The number of ticks that the co-routine should delay \r
- * for. The actual amount of time this equates to is defined by \r
+ * @param xTickToDelay The number of ticks that the co-routine should delay\r
+ * for. The actual amount of time this equates to is defined by\r
* configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant portTICK_RATE_MS\r
* can be used to convert ticks to milliseconds.\r
*\r
\r
/**\r
* <pre>\r
- crQUEUE_SEND( \r
- xCoRoutineHandle xHandle, \r
- xQueueHandle pxQueue, \r
- void *pvItemToQueue, \r
- portTickType xTicksToWait, \r
- portBASE_TYPE *pxResult \r
+ crQUEUE_SEND(\r
+ xCoRoutineHandle xHandle,\r
+ xQueueHandle pxQueue,\r
+ void *pvItemToQueue,\r
+ portTickType xTicksToWait,\r
+ portBASE_TYPE *pxResult\r
)</pre>\r
*\r
- * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine \r
- * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks. \r
+ * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine\r
+ * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.\r
*\r
- * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas \r
+ * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas\r
* xQueueSend() and xQueueReceive() can only be used from tasks.\r
*\r
* crQUEUE_SEND can only be called from the co-routine function itself - not\r
* from within a function called by the co-routine function. This is because\r
* co-routines do not maintain their own stack.\r
*\r
- * See the co-routine section of the WEB documentation for information on \r
- * passing data between tasks and co-routines and between ISR's and \r
+ * See the co-routine section of the WEB documentation for information on\r
+ * passing data between tasks and co-routines and between ISR's and\r
* co-routines.\r
*\r
* @param xHandle The handle of the calling co-routine. This is the xHandle\r
* parameter of the co-routine function.\r
*\r
- * @param pxQueue The handle of the queue on which the data will be posted. \r
- * The handle is obtained as the return value when the queue is created using \r
+ * @param pxQueue The handle of the queue on which the data will be posted.\r
+ * The handle is obtained as the return value when the queue is created using\r
* the xQueueCreate() API function.\r
*\r
* @param pvItemToQueue A pointer to the data being posted onto the queue.\r
* created. This number of bytes is copied from pvItemToQueue into the queue\r
* itself.\r
*\r
- * @param xTickToDelay The number of ticks that the co-routine should block \r
+ * @param xTickToDelay The number of ticks that the co-routine should block\r
* to wait for space to become available on the queue, should space not be\r
- * available immediately. The actual amount of time this equates to is defined \r
- * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant \r
+ * available immediately. The actual amount of time this equates to is defined\r
+ * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant\r
* portTICK_RATE_MS can be used to convert ticks to milliseconds (see example\r
* below).\r
*\r
* @param pxResult The variable pointed to by pxResult will be set to pdPASS if\r
- * data was successfully posted onto the queue, otherwise it will be set to an \r
+ * data was successfully posted onto the queue, otherwise it will be set to an\r
* error defined within ProjDefs.h.\r
*\r
* Example usage:\r
\r
// Increment the number to be posted onto the queue.\r
xNumberToPost++;\r
- \r
+\r
// Delay for 100 ticks.\r
crDELAY( xHandle, 100 );\r
}\r
/**\r
* croutine. h\r
* <pre>\r
- crQUEUE_RECEIVE( \r
- xCoRoutineHandle xHandle, \r
- xQueueHandle pxQueue, \r
- void *pvBuffer, \r
- portTickType xTicksToWait, \r
- portBASE_TYPE *pxResult \r
+ crQUEUE_RECEIVE(\r
+ xCoRoutineHandle xHandle,\r
+ xQueueHandle pxQueue,\r
+ void *pvBuffer,\r
+ portTickType xTicksToWait,\r
+ portBASE_TYPE *pxResult\r
)</pre>\r
*\r
- * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine \r
- * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks. \r
+ * The macro's crQUEUE_SEND() and crQUEUE_RECEIVE() are the co-routine\r
+ * equivalent to the xQueueSend() and xQueueReceive() functions used by tasks.\r
*\r
- * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas \r
+ * crQUEUE_SEND and crQUEUE_RECEIVE can only be used from a co-routine whereas\r
* xQueueSend() and xQueueReceive() can only be used from tasks.\r
*\r
* crQUEUE_RECEIVE can only be called from the co-routine function itself - not\r
* from within a function called by the co-routine function. This is because\r
* co-routines do not maintain their own stack.\r
*\r
- * See the co-routine section of the WEB documentation for information on \r
- * passing data between tasks and co-routines and between ISR's and \r
+ * See the co-routine section of the WEB documentation for information on\r
+ * passing data between tasks and co-routines and between ISR's and\r
* co-routines.\r
*\r
* @param xHandle The handle of the calling co-routine. This is the xHandle\r
* parameter of the co-routine function.\r
*\r
- * @param pxQueue The handle of the queue from which the data will be received. \r
- * The handle is obtained as the return value when the queue is created using \r
+ * @param pxQueue The handle of the queue from which the data will be received.\r
+ * The handle is obtained as the return value when the queue is created using\r
* the xQueueCreate() API function.\r
*\r
* @param pvBuffer The buffer into which the received item is to be copied.\r
* The number of bytes of each queued item is specified when the queue is\r
* created. This number of bytes is copied into pvBuffer.\r
*\r
- * @param xTickToDelay The number of ticks that the co-routine should block \r
+ * @param xTickToDelay The number of ticks that the co-routine should block\r
* to wait for data to become available from the queue, should data not be\r
- * available immediately. The actual amount of time this equates to is defined \r
- * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant \r
+ * available immediately. The actual amount of time this equates to is defined\r
+ * by configTICK_RATE_HZ (set in FreeRTOSConfig.h). The constant\r
* portTICK_RATE_MS can be used to convert ticks to milliseconds (see the\r
* crQUEUE_SEND example).\r
*\r
*\r
* Example usage:\r
<pre>\r
- // A co-routine receives the number of an LED to flash from a queue. It \r
+ // A co-routine receives the number of an LED to flash from a queue. It\r
// blocks on the queue until the number is received.\r
static void prvCoRoutineFlashWorkTask( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
/**\r
* croutine. h\r
* <pre>\r
- crQUEUE_SEND_FROM_ISR( \r
- xQueueHandle pxQueue, \r
- void *pvItemToQueue, \r
+ crQUEUE_SEND_FROM_ISR(\r
+ xQueueHandle pxQueue,\r
+ void *pvItemToQueue,\r
portBASE_TYPE xCoRoutinePreviouslyWoken\r
)</pre>\r
*\r
- * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the \r
- * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR() \r
- * functions used by tasks. \r
+ * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the\r
+ * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()\r
+ * functions used by tasks.\r
*\r
* crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to\r
- * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and \r
+ * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and\r
* xQueueReceiveFromISR() can only be used to pass data between a task and and\r
* ISR.\r
*\r
* crQUEUE_SEND_FROM_ISR can only be called from an ISR to send data to a queue\r
* that is being used from within a co-routine.\r
*\r
- * See the co-routine section of the WEB documentation for information on \r
- * passing data between tasks and co-routines and between ISR's and \r
+ * See the co-routine section of the WEB documentation for information on\r
+ * passing data between tasks and co-routines and between ISR's and\r
* co-routines.\r
*\r
* @param xQueue The handle to the queue on which the item is to be posted.\r
- * \r
- * @param pvItemToQueue A pointer to the item that is to be placed on the \r
+ *\r
+ * @param pvItemToQueue A pointer to the item that is to be placed on the\r
* queue. The size of the items the queue will hold was defined when the\r
* queue was created, so this many bytes will be copied from pvItemToQueue\r
* into the queue storage area.\r
* @param xCoRoutinePreviouslyWoken This is included so an ISR can post onto\r
* the same queue multiple times from a single interrupt. The first call\r
* should always pass in pdFALSE. Subsequent calls should pass in\r
- * the value returned from the previous call. \r
+ * the value returned from the previous call.\r
*\r
- * @return pdTRUE if a co-routine was woken by posting onto the queue. This is \r
+ * @return pdTRUE if a co-routine was woken by posting onto the queue. This is\r
* used by the ISR to determine if a context switch may be required following\r
* the ISR.\r
*\r
// Wait for data to become available on the queue. This assumes the\r
// queue xCommsRxQueue has already been created!\r
crQUEUE_RECEIVE( xHandle, xCommsRxQueue, &uxLEDToFlash, portMAX_DELAY, &xResult );\r
- \r
+\r
// Was a character received?\r
if( xResult == pdPASS )\r
{\r
{\r
// Obtain the character from the UART.\r
cRxedChar = UART_RX_REG;\r
- \r
- // Post the character onto a queue. xCRWokenByPost will be pdFALSE \r
+\r
+ // Post the character onto a queue. xCRWokenByPost will be pdFALSE\r
// the first time around the loop. If the post causes a co-routine\r
// to be woken (unblocked) then xCRWokenByPost will be set to pdTRUE.\r
// In this manner we can ensure that if more than one co-routine is\r
/**\r
* croutine. h\r
* <pre>\r
- crQUEUE_SEND_FROM_ISR( \r
- xQueueHandle pxQueue, \r
- void *pvBuffer, \r
+ crQUEUE_SEND_FROM_ISR(\r
+ xQueueHandle pxQueue,\r
+ void *pvBuffer,\r
portBASE_TYPE * pxCoRoutineWoken\r
)</pre>\r
*\r
- * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the \r
- * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR() \r
- * functions used by tasks. \r
+ * The macro's crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() are the\r
+ * co-routine equivalent to the xQueueSendFromISR() and xQueueReceiveFromISR()\r
+ * functions used by tasks.\r
*\r
* crQUEUE_SEND_FROM_ISR() and crQUEUE_RECEIVE_FROM_ISR() can only be used to\r
- * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and \r
+ * pass data between a co-routine and and ISR, whereas xQueueSendFromISR() and\r
* xQueueReceiveFromISR() can only be used to pass data between a task and and\r
* ISR.\r
*\r
- * crQUEUE_RECEIVE_FROM_ISR can only be called from an ISR to receive data \r
+ * crQUEUE_RECEIVE_FROM_ISR can only be called from an ISR to receive data\r
* from a queue that is being used from within a co-routine (a co-routine\r
* posted to the queue).\r
*\r
- * See the co-routine section of the WEB documentation for information on \r
- * passing data between tasks and co-routines and between ISR's and \r
+ * See the co-routine section of the WEB documentation for information on\r
+ * passing data between tasks and co-routines and between ISR's and\r
* co-routines.\r
*\r
* @param xQueue The handle to the queue on which the item is to be posted.\r
- * \r
+ *\r
* @param pvBuffer A pointer to a buffer into which the received item will be\r
* placed. The size of the items the queue will hold was defined when the\r
* queue was created, so this many bytes will be copied from the queue into\r
* pvBuffer.\r
*\r
* @param pxCoRoutineWoken A co-routine may be blocked waiting for space to become\r
- * available on the queue. If crQUEUE_RECEIVE_FROM_ISR causes such a \r
- * co-routine to unblock *pxCoRoutineWoken will get set to pdTRUE, otherwise \r
+ * available on the queue. If crQUEUE_RECEIVE_FROM_ISR causes such a\r
+ * co-routine to unblock *pxCoRoutineWoken will get set to pdTRUE, otherwise\r
* *pxCoRoutineWoken will remain unchanged.\r
*\r
* @return pdTRUE an item was successfully received from the queue, otherwise\r
*\r
* Example usage:\r
<pre>\r
- // A co-routine that posts a character to a queue then blocks for a fixed \r
+ // A co-routine that posts a character to a queue then blocks for a fixed\r
// period. The character is incremented each time.\r
static void vSendingCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex )\r
{\r
{\r
// Send the next character to the queue.\r
crQUEUE_SEND( xHandle, xCoRoutineQueue, &cCharToTx, NO_DELAY, &xResult );\r
- \r
+\r
if( xResult == pdPASS )\r
{\r
// The character was successfully posted to the queue.\r
// from the queue and send it.\r
ENABLE_RX_INTERRUPT();\r
\r
- // Increment to the next character then block for a fixed period. \r
+ // Increment to the next character then block for a fixed period.\r
// cCharToTx will maintain its value across the delay as it is\r
// declared static.\r
cCharToTx++;\r
\r
/*\r
* This function is intended for internal use by the co-routine macros only.\r
- * The macro nature of the co-routine implementation requires that the \r
- * prototype appears here. The function should not be used by application \r
+ * The macro nature of the co-routine implementation requires that the\r
+ * prototype appears here. The function should not be used by application\r
* writers.\r
*\r
- * Removes the current co-routine from its ready list and places it in the \r
+ * Removes the current co-routine from its ready list and places it in the\r
* appropriate delayed list.\r
*/\r
void vCoRoutineAddToDelayedList( portTickType xTicksToDelay, xList *pxEventList );\r
* Removes the highest priority co-routine from the event list and places it in\r
* the pending ready list.\r
*/\r
-portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList );\r
+signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList );\r
\r
\r
#endif /* CO_ROUTINE_H */\r
#define portBYTES_USED_BY_RETURN_ADDRESS ( 2 )\r
/*-----------------------------------------------------------*/\r
\r
+/* Stores the critical section nesting. This must not be initialised to 0.\r
+It will be initialised when a task starts. */\r
+#define portNO_CRITICAL_NESTING ( ( unsigned portBASE_TYPE ) 0 )\r
+unsigned portBASE_TYPE uxCriticalNesting = 0x50;\r
+\r
+\r
/*\r
* Perform hardware setup to enable ticks from timer 1, compare match A.\r
*/\r
pxTopOfStack--;\r
*pxTopOfStack = ( portSTACK_TYPE ) 0x031; /* R31 */\r
\r
+ pxTopOfStack--;\r
+ *pxTopOfStack = portNO_CRITICAL_NESTING; /* Critical nesting is zero when the task starts. */\r
+\r
/*lint +e950 +e611 +e923 */\r
\r
return pxTopOfStack;\r
vTaskIncrementTick();\r
}\r
#endif\r
+/*-----------------------------------------------------------*/\r
\r
+void vPortEnterCritical( void )\r
+{\r
+ portDISABLE_INTERRUPTS();\r
+ uxCriticalNesting++;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+void vPortExitCritical( void )\r
+{\r
+ uxCriticalNesting--;\r
+ if( uxCriticalNesting == portNO_CRITICAL_NESTING )\r
+ {\r
+ portENABLE_INTERRUPTS();\r
+ }\r
+}\r
\r
\r
/*-----------------------------------------------------------*/ \r
\r
/* Critical section management. */\r
-#define portENTER_CRITICAL() asm( "in r15, 3fh" ); \\r
- asm( "cli" ); \\r
- asm( "st -y, r15" )\r
+extern void vPortEnterCritical( void );\r
+extern void vPortExitCritical( void );\r
+#define portENTER_CRITICAL() vPortEnterCritical()\r
+#define portEXIT_CRITICAL() vPortExitCritical()\r
\r
-#define portEXIT_CRITICAL() asm( "ld r15, y+" ); \\r
- asm( "out 3fh, r15" )\r
-\r
-#define portDISABLE_INTERRUPTS() asm( "cli" );\r
-#define portENABLE_INTERRUPTS() asm( "sti" );\r
+#define portDISABLE_INTERRUPTS() asm( "cli" )\r
+#define portENABLE_INTERRUPTS() asm( "sei" )\r
/*-----------------------------------------------------------*/\r
\r
/* Architecture specifics. */\r
/* Setup the 8245 to tick at the wanted frequency. */\r
portOUTPUT_BYTE( usPIT_MODE, us8254_CTR0_MODE3 );\r
ulOutput = ulPIT_CONST / ulTickRateHz;\r
- \r
+ \r
portOUTPUT_BYTE( usPIT0, ( unsigned portSHORT )( ulOutput & ( unsigned portLONG ) 0xff ) );\r
ulOutput >>= 8;\r
portOUTPUT_BYTE( usPIT0, ( unsigned portSHORT ) ( ulOutput & ( unsigned portLONG ) 0xff ) );\r