Changes to the AVR demo's. IAR demo updated with new critical section method.

pull/4/head
Richard Barry 19 years ago
parent 41b142bae4
commit 97a570fa10

@ -48,7 +48,7 @@
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 8000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
@ -61,7 +61,7 @@
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configUSE_CO_ROUTINES 1
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero

@ -90,15 +90,17 @@ Changes from V2.6.1
/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
#include "croutine.h"
/* Demo file headers. */
#include "PollQ.h"
#include "integer.h"
#include "serial.h"
#include "comtest.h"
#include "flash.h"
#include "crflash.h"
#include "print.h"
#include "partest.h"
#include "regtest.h"
/* Priority definitions for most of the tasks in the demo application. Some
tasks just use the idle priority. */
@ -127,6 +129,9 @@ again. */
the demo application is not unexpectedly resetting. */
#define mainRESET_COUNT_ADDRESS ( ( void * ) 0x50 )
/* The number of coroutines to create. */
#define mainNUM_FLASH_COROUTINES ( 3 )
/*
* The task function for the "Check" task.
*/
@ -144,6 +149,11 @@ static void prvCheckOtherTasksAreStillRunning( void );
*/
static void prvIncrementResetCount( void );
/*
* Idle hook is used to scheduler co-routines.
*/
void vApplicationIdleHook( void );
portSHORT main( void )
{
prvIncrementResetCount();
@ -151,13 +161,18 @@ portSHORT main( void )
/* Setup the LED's for output. */
vParTestInitialise();
/* Create the standard demo tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartRegTestTasks();
/* Create the tasks defined within this file. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Create the co-routines that flash the LED's. */
vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );
/* In this port, to use preemptive scheduler define configUSE_PREEMPTION
as 1 in portmacro.h. To use the cooperative scheduler define
configUSE_PREEMPTION as 0. */
@ -209,6 +224,11 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE;
xErrorHasOccurred = pdTRUE;
}
if( xAreRegTestTasksStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
if( xErrorHasOccurred == pdFALSE )
{
/* Toggle the LED if everything is okay so we know if an error occurs even if not
@ -246,4 +266,10 @@ const unsigned portCHAR ucWrite2 = ( unsigned portCHAR ) 0x02;
EECR = ucWrite1;
EECR = ( ucWrite1 | ucWrite2 );
}
/*-----------------------------------------------------------*/
void vApplicationIdleHook( void )
{
vCoRoutineSchedule();
}

@ -1,140 +1,553 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<project>
<fileVersion>1</fileVersion>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<outputs>
<file>$PROJ_DIR$\..\Common\Minimal\flash.c</file>
<file>$PROJ_DIR$\Output\Obj\flash.pbi</file>
<file>$TOOLKIT_DIR$\inc\clib\sysmac.h</file>
<file>$TOOLKIT_DIR$\inc\clib\stdarg.h</file>
<file>$PROJ_DIR$\Output\Obj\regtest.pbi</file>
<file>$PROJ_DIR$\..\..\Source\include\FreeRTOS.h</file>
<file>$PROJ_DIR$\..\Common\include\PollQ.h</file>
<file>$TOOLKIT_DIR$\inc\clib\stddef.h</file>
<file>$TOOLKIT_DIR$\inc\iomacro.h</file>
<file>$PROJ_DIR$\Output\List\PollQ.lst</file>
<file>$PROJ_DIR$\..\Common\include\partest.h</file>
<file>$PROJ_DIR$\Output\Obj\queue.pbi</file>
<file>$PROJ_DIR$\..\Common\include\flash.h</file>
<file>$TOOLKIT_DIR$\inc\clib\string.h</file>
<file>$TOOLKIT_DIR$\inc\clib\stdlib.h</file>
<file>$PROJ_DIR$\..\..\Source\include\queue.h</file>
<file>$PROJ_DIR$\..\..\Source\include\croutine.h</file>
<file>$PROJ_DIR$\..\Common\include\print.h</file>
<file>$PROJ_DIR$\Output\Obj\ParTest.r90</file>
<file>$PROJ_DIR$\..\Common\include\serial.h</file>
<file>$PROJ_DIR$\Output\Obj\main.r90</file>
<file>$PROJ_DIR$\Output\Obj\PollQ.r90</file>
<file>$PROJ_DIR$\FreeRTOSConfig.h</file>
<file>$PROJ_DIR$\Output\Obj\heap_1.r90</file>
<file>$PROJ_DIR$\Output\Obj\integer.r90</file>
<file>$TOOLKIT_DIR$\inc\clib\stdio.h</file>
<file>$PROJ_DIR$\Output\List\tasks.s90</file>
<file>$PROJ_DIR$\Output\List\queue.lst</file>
<file>$PROJ_DIR$\..\Common\include\integer.h</file>
<file>$TOOLKIT_DIR$\src\template\cfgm323.xcl</file>
<file>$PROJ_DIR$\Output\List\ParTest.lst</file>
<file>$PROJ_DIR$\Output\List\comtest.lst</file>
<file>$PROJ_DIR$\Output\List\tasks.lst</file>
<file>$TOOLKIT_DIR$\inc\iom323.h</file>
<file>$PROJ_DIR$\Output\Obj\comtest.r90</file>
<file>$PROJ_DIR$\Output\Obj\list.pbi</file>
<file>$PROJ_DIR$\Output\Obj\serial.r90</file>
<file>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.h</file>
<file>$PROJ_DIR$\regtest.c</file>
<file>$PROJ_DIR$\Output\Obj\crflash.r90</file>
<file>$PROJ_DIR$\Output\Obj\rtosdemo.pbd</file>
<file>$PROJ_DIR$\Output\Obj\heap_1.pbi</file>
<file>$PROJ_DIR$\Output\Exe\rtosdemo.d90</file>
<file>$TOOLKIT_DIR$\lib\clib\cl3s-ec-sf.r90</file>
<file>$PROJ_DIR$\Output\List\integer.s90</file>
<file>$PROJ_DIR$\Output\List\serial.lst</file>
<file>$PROJ_DIR$\Output\Obj\integer.pbi</file>
<file>$PROJ_DIR$\Output\Exe\rtosdemo.a90</file>
<file>$PROJ_DIR$\Output\Obj\main.pbi</file>
<file>$PROJ_DIR$\..\..\Source\include\projdefs.h</file>
<file>$PROJ_DIR$\Output\List\regtest.lst</file>
<file>$PROJ_DIR$\Output\Obj\flash.r90</file>
<file>$PROJ_DIR$\Output\Obj\list.r90</file>
<file>$PROJ_DIR$\..\..\Source\include\list.h</file>
<file>$PROJ_DIR$\Output\Obj\tasks.r90</file>
<file>$PROJ_DIR$\Output\Obj\ParTest.pbi</file>
<file>$PROJ_DIR$\..\Common\include\comtest.h</file>
<file>$PROJ_DIR$\Output\List\main.s90</file>
<file>$PROJ_DIR$\Output\List\serial.s90</file>
<file>$PROJ_DIR$\Output\List\port.s90</file>
<file>$PROJ_DIR$\Output\List\heap_1.lst</file>
<file>$PROJ_DIR$\Output\Exe\rtosdemo.cof</file>
<file>$PROJ_DIR$\Output\List\queue.s90</file>
<file>$PROJ_DIR$\Output\List\PollQ.s90</file>
<file>$PROJ_DIR$\Output\Obj\port.pbi</file>
<file>$PROJ_DIR$\Output\List\ParTest.s90</file>
<file>$PROJ_DIR$\Output\List\integer.lst</file>
<file>$PROJ_DIR$\Output\Obj\port.r90</file>
<file>$PROJ_DIR$\Output\Obj\comtest.pbi</file>
<file>$PROJ_DIR$\..\..\Source\include\task.h</file>
<file>$TOOLKIT_DIR$\src\template\cfg3soim.xcl</file>
<file>$PROJ_DIR$\Output\List\comtest.s90</file>
<file>$PROJ_DIR$\Output\List\main.lst</file>
<file>$PROJ_DIR$\Output\List\flash.lst</file>
<file>$PROJ_DIR$\Output\List\flash.s90</file>
<file>$PROJ_DIR$\Output\List\port.lst</file>
<file>$PROJ_DIR$\Output\List\heap_1.s90</file>
<file>$PROJ_DIR$\Output\List\list.lst</file>
<file>$PROJ_DIR$\Output\List\rtosdemo.map</file>
<file>$PROJ_DIR$\Output\Obj\tasks.pbi</file>
<file>$PROJ_DIR$\Output\Obj\serial.pbi</file>
<file>$PROJ_DIR$\Output\List\list.s90</file>
<file>$PROJ_DIR$\Output\Obj\PollQ.pbi</file>
<file>$PROJ_DIR$\Output\List\regtest.s90</file>
<file>$PROJ_DIR$\Output\List\crflash.s90</file>
<file>$PROJ_DIR$\..\..\Source\list.c</file>
<file>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.s90</file>
<file>$PROJ_DIR$\..\Common\Minimal\PollQ.c</file>
<file>$PROJ_DIR$\ParTest\ParTest.c</file>
<file>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</file>
<file>$PROJ_DIR$\..\..\Source\queue.c</file>
<file>$PROJ_DIR$\Output\Obj\portmacro.r90</file>
<file>$PROJ_DIR$\..\..\Source\tasks.c</file>
<file>$PROJ_DIR$\serial\serial.c</file>
<file>$PROJ_DIR$\..\..\Source\include\portable.h</file>
<file>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</file>
<file>$PROJ_DIR$\main.c</file>
<file>$PROJ_DIR$\Output\Exe\rtosdemo.elf</file>
<file>$PROJ_DIR$\..\Common\Minimal\comtest.c</file>
<file>$PROJ_DIR$\Output\Exe\rtosdemo.dbg</file>
<file>$PROJ_DIR$\..\Common\include\crflash.h</file>
<file>$PROJ_DIR$\Output\Obj\queue.r90</file>
<file>$PROJ_DIR$\Output\List\croutine.lst</file>
<file>$PROJ_DIR$\..\Common\Minimal\integer.c</file>
<file>$PROJ_DIR$\Output\Obj\croutine.r90</file>
<file>$PROJ_DIR$\Output\List\croutine.s90</file>
<file>$PROJ_DIR$\regtest.h</file>
<file>$PROJ_DIR$\..\..\Source\croutine.c</file>
<file>$PROJ_DIR$\Output\List\crflash.lst</file>
<file>$PROJ_DIR$\Output\Obj\croutine.pbi</file>
<file>$PROJ_DIR$\..\Common\Minimal\crflash.c</file>
<file>$PROJ_DIR$\Output\Obj\regtest.r90</file>
<file>$PROJ_DIR$\Output\Obj\crflash.pbi</file>
</outputs>
<file>
<name>$PROJ_DIR$\ParTest\ParTest.c</name>
<name>[ROOT_NODE]</name>
<outputs>
<tool>
<name>XLINK</name>
<file> 47 78</file>
</tool>
</outputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\ParTest.r90</file>
<file> 51 74 73</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 1</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 10 12</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 10 12</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\serial\serial.c</name>
<name>$PROJ_DIR$\regtest.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\serial.r90</file>
<file> 111 83 50</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 4</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 5 7 2 49 22 33 8 94 37 69 53 106</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 5 7 2 49 22 33 8 94 37 69 53 106</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\Output\Obj\rtosdemo.pbd</name>
<inputs>
<tool>
<name>BILINK</name>
<file> 55 82 68 112 109 41 46 35 48 64 11 4 80 79</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\Output\Exe\rtosdemo.d90</name>
<inputs>
<tool>
<name>XLINK</name>
<file> 29 70 18 21 34 51 23 24 52 20 67 91 101 36 54 43</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\Output\Exe\rtosdemo.a90</name>
<outputs>
<tool>
<name>XLINK</name>
<file> 78</file>
</tool>
</outputs>
<inputs>
<tool>
<name>XLINK</name>
<file> 29 70 18 21 34 39 104 23 24 52 20 67 91 101 111 36 54 43</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\Output\Exe\rtosdemo.cof</name>
<inputs>
<tool>
<name>XLINK</name>
<file> 29 70 18 21 34 51 23 24 52 20 67 91 101 36 54 43</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\list.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file> 52 81 77</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 35</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 53</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 53</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\portmacro.s90</name>
<outputs>
<tool>
<name>AAVR</name>
<file>$PROJ_DIR$\Output\Obj\portmacro.r90</file>
<file> 91</file>
</tool>
</outputs>
<inputs>
<tool>
<name>AAVR</name>
<file> 33 8</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>
<name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\comtest.r90</file>
<file> 21 63 9</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 82</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 15 6</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 15 6</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\tasks.c</name>
<name>$PROJ_DIR$\ParTest\ParTest.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\tasks.r90</file>
<file> 18 65 30</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 55</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 5 7 2 49 22 33 8 94 37 69 53 10</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 5 7 2 49 22 33 8 94 37 69 53 10</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>
<name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\integer.r90</file>
<file> 67 59 75</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 64</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</name>
<name>$PROJ_DIR$\..\..\Source\queue.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\heap_1.r90</file>
<file> 101 62 27</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 11</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</name>
<name>$PROJ_DIR$\..\..\Source\tasks.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\port.r90</file>
<file> 54 26 32</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 79</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 25 3 2 14 13 5 7 49 22 33 8 94 37 69 53</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 25 3 2 14 13 5 7 49 22 33 8 94 37 69 53</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>
<name>$PROJ_DIR$\serial\serial.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\PollQ.r90</file>
<file> 36 58 45</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 80</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 15 69 53 19</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 15 69 53 19</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\queue.c</name>
<name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\queue.r90</file>
<file> 23 76 60</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 41</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>
<name>$PROJ_DIR$\main.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\flash.r90</file>
<file> 20 57 72</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 48</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16 6 28 19 56 100 17 10 106</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 13 5 7 49 22 33 8 94 37 69 53 16 6 28 19 56 100 17 10 106</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\main.c</name>
<name>$PROJ_DIR$\Output\Exe\rtosdemo.elf</name>
<inputs>
<tool>
<name>XLINK</name>
<file> 29 70 18 21 34 51 23 24 52 20 67 91 101 36 54 43</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\main.r90</file>
<file> 34 71 31</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 68</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 19 56 10</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 19 56 10</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\list.c</name>
<name>$PROJ_DIR$\Output\Exe\rtosdemo.dbg</name>
<inputs>
<tool>
<name>XLINK</name>
<file> 29 70 18 21 34 39 104 23 24 52 20 67 91 101 36 54 43</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file>$PROJ_DIR$\Output\Obj\list.r90</file>
<file> 24 44 66</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 46</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 28</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 14 2 5 7 49 22 33 8 94 37 69 53 28</file>
</tool>
</inputs>
</file>
<file>
<name>[ROOT_NODE]</name>
<name>$PROJ_DIR$\..\..\Source\croutine.c</name>
<outputs>
<tool>
<name>XLINK</name>
<file>$PROJ_DIR$\Output\Exe\rtosdemo.a90</file>
<file>$PROJ_DIR$\Output\Exe\rtosdemo.d90</file>
<name>ICCAVR</name>
<file> 104 105 102</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 109</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 5 7 2 49 22 33 8 94 37 69 53 16</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 5 7 2 49 22 33 8 94 37 69 53 16</file>
</tool>
</inputs>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\crflash.c</name>
<outputs>
<tool>
<name>ICCAVR</name>
<file> 39 84 108</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 112</file>
</tool>
</outputs>
<inputs>
<tool>
<name>ICCAVR</name>
<file> 5 7 2 49 22 33 8 94 37 16 53 15 10 100</file>
</tool>
<tool>
<name>BICOMP</name>
<file> 5 7 2 49 22 33 8 94 37 16 53 15 10 100</file>
</tool>
</inputs>
</file>
<forcedrebuild>
<name>[MULTI_TOOL]</name>
<tool>XLINK</tool>
</forcedrebuild>
</configuration>
</project>

@ -10,9 +10,9 @@
<debug>1</debug>
<settings>
<name>C-SPY</name>
<archiveVersion>2</archiveVersion>
<archiveVersion>3</archiveVersion>
<data>
<version>11</version>
<version>12</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -75,6 +75,10 @@
<name>CDynDriver</name>
<state>SIMAVR</state>
</option>
<option>
<name>DebuggerUseUbrofResetVector</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
@ -255,9 +259,9 @@
</settings>
<settings>
<name>JTAGICEAVR</name>
<archiveVersion>2</archiveVersion>
<archiveVersion>3</archiveVersion>
<data>
<version>1</version>
<version>2</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -384,13 +388,25 @@
<name>OJTAGICEAVRJtagIcedownloadToData</name>
<state>0</state>
</option>
<option>
<name>ExitBreakpointP7</name>
<state>0</state>
</option>
<option>
<name>PutcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>GetcharBreakpointP7</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>JTAGICEMKIIAVR</name>
<archiveVersion>1</archiveVersion>
<archiveVersion>2</archiveVersion>
<data>
<version>3</version>
<version>4</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -525,6 +541,18 @@
<name>OJTAGICEMKIIAVRJtagSoftwareBreak</name>
<state>0</state>
</option>
<option>
<name>ExitBreakpointP7</name>
<state>0</state>
</option>
<option>
<name>PutcharBreakpointP7</name>
<state>1</state>
</option>
<option>
<name>GetcharBreakpointP7</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
@ -595,16 +623,16 @@
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>
<loadFlag>1</loadFlag>
<file>$EW_DIR$\common\plugins\Orti\Orti.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Trace\Trace.ewplugin</file>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ewplugin</file>
<loadFlag>0</loadFlag>
<file>$EW_DIR$\common\plugins\Stack\stack.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>
</configuration>

@ -127,8 +127,8 @@
</option>
<option>
<name>New Variant Processor</name>
<version>13</version>
<state>41</state>
<version>15</version>
<state>47</state>
</option>
<option>
<name>GRuntimeLibSelect</name>
@ -682,7 +682,7 @@
<name>XLINK</name>
<archiveVersion>2</archiveVersion>
<data>
<version>12</version>
<version>13</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
@ -691,16 +691,16 @@
</option>
<option>
<name>OutputFile</name>
<state>rtosdemo.d90</state>
<state>rtosdemo.a90</state>
</option>
<option>
<name>OutputFormat</name>
<version>10</version>
<version>11</version>
<state>23</state>
</option>
<option>
<name>FormatVariant</name>
<version>6</version>
<version>7</version>
<state>2</state>
</option>
<option>
@ -849,7 +849,7 @@
</option>
<option>
<name>DebugInformation</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>RuntimeControl</name>
@ -873,16 +873,16 @@
</option>
<option>
<name>ExtraOutputFile</name>
<state>rtosdemo.a90</state>
<state>rtosdemo.elf</state>
</option>
<option>
<name>ExtraOutputFormat</name>
<version>10</version>
<state>25</state>
<version>11</version>
<state>16</state>
</option>
<option>
<name>ExtraFormatVariant</name>
<version>6</version>
<version>7</version>
<state>2</state>
</option>
<option>
@ -933,6 +933,14 @@
<name>RawBinaryAlign</name>
<state></state>
</option>
<option>
<name>CrcAlign</name>
<state>1</state>
</option>
<option>
<name>CrcInitialValue</name>
<state>0x00</state>
</option>
</data>
</settings>
<settings>
@ -962,11 +970,13 @@
<data/>
</settings>
</configuration>
<group>
<name>Demo Source</name>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\comtest.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\Common\Minimal\flash.c</name>
<name>$PROJ_DIR$\..\Common\Minimal\crflash.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\portable\MemMang\heap_1.c</name>
@ -974,9 +984,6 @@
<file>
<name>$PROJ_DIR$\..\Common\Minimal\integer.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\list.c</name>
</file>
<file>
<name>$PROJ_DIR$\main.c</name>
</file>
@ -986,6 +993,21 @@
<file>
<name>$PROJ_DIR$\..\Common\Minimal\PollQ.c</name>
</file>
<file>
<name>$PROJ_DIR$\regtest.c</name>
</file>
<file>
<name>$PROJ_DIR$\serial\serial.c</name>
</file>
</group>
<group>
<name>Kernel Source</name>
<file>
<name>$PROJ_DIR$\..\..\Source\croutine.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\list.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\portable\IAR\ATMega323\port.c</name>
</file>
@ -995,12 +1017,10 @@
<file>
<name>$PROJ_DIR$\..\..\Source\queue.c</name>
</file>
<file>
<name>$PROJ_DIR$\serial\serial.c</name>
</file>
<file>
<name>$PROJ_DIR$\..\..\Source\tasks.c</name>
</file>
</group>
</project>

@ -27,12 +27,15 @@ Wnd8=_ "Locals" "closed" 44 0 1 -1 -1 -1 -1 1139 0 1595 276 100 100 100 100
Wnd9=_ "Terminal I/O" "closed" 44 0 1 -1 -1 -1 -1 1138 522 1595 826
Maximized=_ 0
Count=_ 10
[Log file]
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[TermIOLog]
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[Breakpoints]
Count=0
[TraceHelper]
Enabled=0
ShowSource=1

@ -12,12 +12,12 @@
<Column0>109</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
<Column0>246</Column0><Column1>27</Column1><Column2>27</Column2><Column3>27</Column3></ColumnWidths>
</Workspace>
<Build><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1153</ColumnWidth1><ColumnWidth2>307</ColumnWidth2><ColumnWidth3>76</ColumnWidth3></Build></Static>
<Build><ColumnWidth0>20</ColumnWidth0><ColumnWidth1>1153</ColumnWidth1><ColumnWidth2>307</ColumnWidth2><ColumnWidth3>76</ColumnWidth3></Build><Debug-Log/></Static>
<Windows>
<Wnd0>
<Wnd2>
<Tabs>
<Tab>
<Identity>TabID-12388-19520</Identity>
@ -25,24 +25,24 @@
<Factory>Workspace</Factory>
<Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode><ExpandedNode>rtosdemo/portheap.c</ExpandedNode></NodeDict></Session>
<NodeDict><ExpandedNode>rtosdemo</ExpandedNode><ExpandedNode>rtosdemo/Demo Source</ExpandedNode><ExpandedNode>rtosdemo/Kernel Source</ExpandedNode><ExpandedNode>rtosdemo/portheap.c</ExpandedNode></NodeDict></Session>
</Tab>
</Tabs>
<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>
<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>
<Editor>
<Pane/><ActivePane>0</ActivePane><Sizes><Pane><X>1000000</X><Y>1000000</Y></Pane></Sizes><SplitMode>1</SplitMode></Editor>
<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>
<Positions>
<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>
<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>
</Desktop>
</Workspace>

@ -46,7 +46,7 @@
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 0
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned portLONG ) 8000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
@ -59,7 +59,7 @@
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configUSE_CO_ROUTINES 1
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero

@ -86,15 +86,17 @@ Changes from V2.6.1
/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
#include "croutine.h"
/* Demo file headers. */
#include "PollQ.h"
#include "integer.h"
#include "serial.h"
#include "comtest.h"
#include "flash.h"
#include "crflash.h"
#include "print.h"
#include "partest.h"
#include "regtest.h"
/* Priority definitions for most of the tasks in the demo application. Some
tasks just use the idle priority. */
@ -123,6 +125,9 @@ again. */
the demo application is not unexpectedly resetting. */
#define mainRESET_COUNT_ADDRESS ( ( void * ) 0x50 )
/* The number of coroutines to create. */
#define mainNUM_FLASH_COROUTINES ( 3 )
/*
* The task function for the "Check" task.
*/
@ -140,6 +145,13 @@ static void prvCheckOtherTasksAreStillRunning( void );
*/
static void prvIncrementResetCount( void );
/*
* The idle hook is used to scheduler co-routines.
*/
void vApplicationIdleHook( void );
/*-----------------------------------------------------------*/
portSHORT main( void )
{
prvIncrementResetCount();
@ -147,13 +159,18 @@ portSHORT main( void )
/* Setup the LED's for output. */
vParTestInitialise();
/* Create the standard demo tasks. */
vStartIntegerMathTasks( tskIDLE_PRIORITY );
vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED );
vStartLEDFlashTasks( mainLED_TASK_PRIORITY );
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartRegTestTasks();
/* Create the tasks defined within this file. */
xTaskCreate( vErrorChecks, "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Create the co-routines that flash the LED's. */
vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES );
/* In this port, to use preemptive scheduler define configUSE_PREEMPTION
as 1 in portmacro.h. To use the cooperative scheduler define
configUSE_PREEMPTION as 0. */
@ -205,6 +222,11 @@ static portBASE_TYPE xErrorHasOccurred = pdFALSE;
xErrorHasOccurred = pdTRUE;
}
if( xAreRegTestTasksStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
if( xErrorHasOccurred == pdFALSE )
{
/* Toggle the LED if everything is okay so we know if an error occurs even if not
@ -222,4 +244,10 @@ unsigned portCHAR ucCount;
ucCount++;
eeprom_write_byte( mainRESET_COUNT_ADDRESS, ucCount );
}
/*-----------------------------------------------------------*/
void vApplicationIdleHook( void )
{
vCoRoutineSchedule();
}

@ -53,12 +53,14 @@ SRC = \
main.c \
ParTest/ParTest.c \
serial/serial.c \
regtest.c \
$(SOURCE_DIR)/tasks.c \
$(SOURCE_DIR)/queue.c \
$(SOURCE_DIR)/list.c \
$(SOURCE_DIR)/croutine.c \
$(SOURCE_DIR)/portable/MemMang/heap_1.c \
$(PORT_DIR)/port.c \
$(DEMO_DIR)/flash.c \
$(DEMO_DIR)/crflash.c \
$(DEMO_DIR)/integer.c \
$(DEMO_DIR)/PollQ.c \
$(DEMO_DIR)/comtest.c

@ -39,7 +39,7 @@
* the same queue. The controlling task writes data to the queue, then checks
* to see which of the event tasks read the data from the queue. The
* controlling task has the lowest priority of all the tasks so is guaranteed
* to always get preempted immediately upon writhing to the queue.
* to always get preempted immediately upon writing to the queue.
*
* By selectively suspending and resuming the event tasks the controlling task
* can check that the highest priority task that is blocked on the queue is the
@ -172,6 +172,10 @@ const portCHAR * const pcTaskStartMsg = "Multi event task started.\r\n";
the counter specific to this task instance. */
( *pxCounter )++;
}
else
{
xHealthStatus = pdFAIL;
}
}
}
/*-----------------------------------------------------------*/

@ -134,7 +134,7 @@ static void prvFixedDelayCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_
{
/* Even though this is a co-routine the xResult variable does not need to be
static as we do not need it to maintain its state between blocks. */
portBASE_TYPE xResult;
signed portBASE_TYPE xResult;
/* The uxIndex parameter of the co-routine function is used as an index into
the xFlashRates array to obtain the delay period to use. */
static const portTickType xFlashRates[ crfMAX_FLASH_TASKS ] = { 150 / portTICK_RATE_MS,
@ -175,11 +175,12 @@ static void prvFlashCoRoutine( xCoRoutineHandle xHandle, unsigned portBASE_TYPE
{
/* Even though this is a co-routine the variable do not need to be
static as we do not need it to maintain their state between blocks. */
portBASE_TYPE xResult;
signed portBASE_TYPE xResult;
unsigned portBASE_TYPE uxLEDToFlash;
/* Co-routines MUST start with a call to crSTART. */
crSTART( xHandle );
( void ) uxIndex;
for( ;; )
{

@ -92,9 +92,9 @@ static inline void prvCheckDelayedList( void );
/*-----------------------------------------------------------*/
portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex )
signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex )
{
portBASE_TYPE xReturn;
signed portBASE_TYPE xReturn;
corCRCB *pxCoRoutine;
/* Allocate the memory that will store the co-routine control block. */
@ -317,10 +317,10 @@ unsigned portBASE_TYPE uxPriority;
}
/*-----------------------------------------------------------*/
portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList )
signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList )
{
corCRCB *pxUnblockedCRCB;
portBASE_TYPE xReturn;
signed portBASE_TYPE xReturn;
/* This function is called from within an interrupt. It can only access
event lists and the pending ready list. */

@ -124,7 +124,7 @@ typedef struct corCoRoutineControlBlock
* \defgroup xCoRoutineCreate xCoRoutineCreate
* \ingroup Tasks
*/
portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex );
signed portBASE_TYPE xCoRoutineCreate( crCOROUTINE_CODE pxCoRoutineCode, unsigned portBASE_TYPE uxPriority, unsigned portBASE_TYPE uxIndex );
/**
@ -707,7 +707,7 @@ void vCoRoutineAddToDelayedList( portTickType xTicksToDelay, xList *pxEventList
* Removes the highest priority co-routine from the event list and places it in
* the pending ready list.
*/
portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList );
signed portBASE_TYPE xCoRoutineRemoveFromEventList( const xList *pxEventList );
#endif /* CO_ROUTINE_H */

@ -52,6 +52,12 @@
#define portBYTES_USED_BY_RETURN_ADDRESS ( 2 )
/*-----------------------------------------------------------*/
/* Stores the critical section nesting. This must not be initialised to 0.
It will be initialised when a task starts. */
#define portNO_CRITICAL_NESTING ( ( unsigned portBASE_TYPE ) 0 )
unsigned portBASE_TYPE uxCriticalNesting = 0x50;
/*
* Perform hardware setup to enable ticks from timer 1, compare match A.
*/
@ -221,6 +227,9 @@ portSTACK_TYPE *pxTopOfHardwareStack;
pxTopOfStack--;
*pxTopOfStack = ( portSTACK_TYPE ) 0x031; /* R31 */
pxTopOfStack--;
*pxTopOfStack = portNO_CRITICAL_NESTING; /* Critical nesting is zero when the task starts. */
/*lint +e950 +e611 +e923 */
return pxTopOfStack;
@ -315,6 +324,22 @@ unsigned portCHAR ucHighByte, ucLowByte;
vTaskIncrementTick();
}
#endif
/*-----------------------------------------------------------*/
void vPortEnterCritical( void )
{
portDISABLE_INTERRUPTS();
uxCriticalNesting++;
}
/*-----------------------------------------------------------*/
void vPortExitCritical( void )
{
uxCriticalNesting--;
if( uxCriticalNesting == portNO_CRITICAL_NESTING )
{
portENABLE_INTERRUPTS();
}
}

@ -70,15 +70,13 @@ Changes from V1.2.3
/*-----------------------------------------------------------*/
/* Critical section management. */
#define portENTER_CRITICAL() asm( "in r15, 3fh" ); \
asm( "cli" ); \
asm( "st -y, r15" )
extern void vPortEnterCritical( void );
extern void vPortExitCritical( void );
#define portENTER_CRITICAL() vPortEnterCritical()
#define portEXIT_CRITICAL() vPortExitCritical()
#define portEXIT_CRITICAL() asm( "ld r15, y+" ); \
asm( "out 3fh, r15" )
#define portDISABLE_INTERRUPTS() asm( "cli" );
#define portENABLE_INTERRUPTS() asm( "sti" );
#define portDISABLE_INTERRUPTS() asm( "cli" )
#define portENABLE_INTERRUPTS() asm( "sei" )
/*-----------------------------------------------------------*/
/* Architecture specifics. */

Loading…
Cancel
Save