Add FreeRTOS-Plus directory.

This commit is contained in:
Richard Barry 2012-08-11 21:34:11 +00:00
parent 7bd5f21ad5
commit f508a5f653
6798 changed files with 134949 additions and 19 deletions

View file

@ -0,0 +1,115 @@
/*
FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>NOTE<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel. FreeRTOS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong? *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, training, latest information,
license and contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
#include <iom323.h>
#define configCALL_STACK_SIZE 20
/*-----------------------------------------------------------
* Application specific definitions.
*
* These definitions should be adjusted for your particular hardware and
* application requirements.
*
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
*
* See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( ( unsigned long ) 8000000 )
#define configTICK_RATE_HZ ( ( portTickType ) 1000 )
#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 85 )
#define configTOTAL_HEAP_SIZE ( (size_t ) ( 1500 ) )
#define configMAX_TASK_NAME_LEN ( 8 )
#define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 1
#define configIDLE_SHOULD_YIELD 1
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 1
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */
#define INCLUDE_vTaskPrioritySet 0
#define INCLUDE_uxTaskPriorityGet 0
#define INCLUDE_vTaskDelete 1
#define INCLUDE_vTaskCleanUpResources 0
#define INCLUDE_vTaskSuspend 0
#define INCLUDE_vTaskDelayUntil 1
#define INCLUDE_vTaskDelay 1
#endif /* FREERTOS_CONFIG_H */

View file

@ -0,0 +1,157 @@
/*
FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>NOTE<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel. FreeRTOS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong? *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, training, latest information,
license and contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
/*
Changes from V2.0.0
+ Use scheduler suspends in place of critical sections.
Changes from V2.6.0
+ Replaced the inb() and outb() functions with direct memory
access. This allows the port to be built with the 20050414 build of
WinAVR.
*/
#include "FreeRTOS.h"
#include "task.h"
#include "partest.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines.
*-----------------------------------------------------------*/
#define partstALL_BITS_OUTPUT ( ( unsigned char ) 0xff )
#define partstALL_OUTPUTS_OFF ( ( unsigned char ) 0xff )
#define partstMAX_OUTPUT_LED ( ( unsigned char ) 7 )
static volatile unsigned char ucCurrentOutputValue = partstALL_OUTPUTS_OFF; /*lint !e956 File scope parameters okay here. */
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
ucCurrentOutputValue = partstALL_OUTPUTS_OFF;
/* Set port B direction to outputs. Start with all output off. */
DDRB = partstALL_BITS_OUTPUT;
PORTB = ucCurrentOutputValue;
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue )
{
unsigned char ucBit = ( unsigned char ) 1;
if( uxLED <= partstMAX_OUTPUT_LED )
{
ucBit <<= uxLED;
vTaskSuspendAll();
{
if( xValue == pdTRUE )
{
ucBit ^= ( unsigned char ) 0xff;
ucCurrentOutputValue &= ucBit;
}
else
{
ucCurrentOutputValue |= ucBit;
}
PORTB = ucCurrentOutputValue;
}
xTaskResumeAll();
}
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portBASE_TYPE uxLED )
{
unsigned char ucBit;
if( uxLED <= partstMAX_OUTPUT_LED )
{
ucBit = ( ( unsigned char ) 1 ) << uxLED;
vTaskSuspendAll();
{
if( ucCurrentOutputValue & ucBit )
{
ucCurrentOutputValue &= ~ucBit;
}
else
{
ucCurrentOutputValue |= ucBit;
}
PORTB = ucCurrentOutputValue;
}
xTaskResumeAll();
}
}

View file

@ -0,0 +1,313 @@
/*
FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>NOTE<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel. FreeRTOS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong? *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, training, latest information,
license and contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
/*
* Creates all the demo application tasks, then starts the scheduler. The WEB
* documentation provides more details of the demo application tasks.
*
* Main. c also creates a task called "Check". This only executes every three
* seconds but has the highest priority so is guaranteed to get processor time.
* Its main function is to check that all the other tasks are still operational.
* Each task that does not flash an LED maintains a unique count that is
* incremented each time the task successfully completes its function. Should
* any error occur within such a task the count is permanently halted. The
* check task inspects the count of each task to ensure it has changed since
* the last time the check task executed. If all the count variables have
* changed all the tasks are still executing error free, and the check task
* toggles an LED. Should any task contain an error at any time the LED toggle
* will stop.
*
* The LED flash and communications test tasks do not maintain a count.
*/
/*
Changes from V1.2.0
+ Changed the baud rate for the serial test from 19200 to 57600.
Changes from V1.2.3
+ The integer and comtest tasks are now used when the cooperative scheduler
is being used. Previously they were only used with the preemptive
scheduler.
Changes from V1.2.5
+ Set the baud rate to 38400. This has a smaller error percentage with an
8MHz clock (according to the manual).
Changes from V2.0.0
+ Delay periods are now specified using variables and constants of
portTickType rather than unsigned long.
Changes from V2.2.0
+ File can now be built using either the IAR or WinAVR compiler.
Changes from V2.6.1
+ The IAR and WinAVR AVR ports are now maintained separately.
Changes from V4.0.5
+ Modified to demonstrate the use of co-routines.
*/
#include <stdlib.h>
#include <string.h>
#ifdef GCC_MEGA_AVR
/* EEPROM routines used only with the WinAVR compiler. */
#include <avr/eeprom.h>
#endif
/* 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 "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. */
#define mainLED_TASK_PRIORITY ( tskIDLE_PRIORITY + 1 )
#define mainCOM_TEST_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 )
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 )
/* Baud rate used by the serial port tasks. */
#define mainCOM_TEST_BAUD_RATE ( ( unsigned long ) 38400 )
/* LED used by the serial port tasks. This is toggled on each character Tx,
and mainCOM_TEST_LED + 1 is toggles on each character Rx. */
#define mainCOM_TEST_LED ( 4 )
/* LED that is toggled by the check task. The check task periodically checks
that all the other tasks are operating without error. If no errors are found
the LED is toggled. If an error is found at any time the LED is never toggles
again. */
#define mainCHECK_TASK_LED ( 7 )
/* The period between executions of the check task. */
#define mainCHECK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS )
/* An address in the EEPROM used to count resets. This is used to check that
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.
*/
static void vErrorChecks( void *pvParameters );
/*
* Checks the unique counts of other tasks to ensure they are still operational.
* Flashes an LED if everything is okay.
*/
static void prvCheckOtherTasksAreStillRunning( void );
/*
* Called on boot to increment a count stored in the EEPROM. This is used to
* ensure the CPU does not reset unexpectedly.
*/
static void prvIncrementResetCount( void );
/*
* Idle hook is used to scheduler co-routines.
*/
void vApplicationIdleHook( void );
short main( void )
{
prvIncrementResetCount();
/* 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 );
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. */
vTaskStartScheduler();
return 0;
}
/*-----------------------------------------------------------*/
static void vErrorChecks( void *pvParameters )
{
static volatile unsigned long ulDummyVariable = 3UL;
/* The parameters are not used. */
( void ) pvParameters;
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
vTaskDelay( mainCHECK_PERIOD );
/* Perform a bit of 32bit maths to ensure the registers used by the
integer tasks get some exercise. The result here is not important -
see the demo application documentation for more info. */
ulDummyVariable *= 3;
prvCheckOtherTasksAreStillRunning();
}
}
/*-----------------------------------------------------------*/
static void prvCheckOtherTasksAreStillRunning( void )
{
static portBASE_TYPE xErrorHasOccurred = pdFALSE;
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
if( xAreComTestTasksStillRunning() != pdTRUE )
{
xErrorHasOccurred = pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
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
using console IO. */
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static void prvIncrementResetCount( void )
{
unsigned char ucCount;
const unsigned char ucReadBit = ( unsigned char ) 0x01;
const unsigned char ucWrite1 = ( unsigned char ) 0x04;
const unsigned char ucWrite2 = ( unsigned char ) 0x02;
/* Increment the EEPROM value at 0x00.
Setup the EEPROM address. */
EEARH = 0x00;
EEARL = 0x00;
/* Set the read enable bit. */
EECR |= ucReadBit;
/* Wait for the read. */
while( EECR & ucReadBit );
/* The byte is ready. */
ucCount = EEDR;
/* Increment the reset count, then write the byte back. */
ucCount++;
EEDR = ucCount;
EECR = ucWrite1;
EECR = ( ucWrite1 | ucWrite2 );
}
/*-----------------------------------------------------------*/
void vApplicationIdleHook( void )
{
vCoRoutineSchedule();
}

View file

@ -0,0 +1,396 @@
/*
FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>NOTE<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel. FreeRTOS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong? *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, training, latest information,
license and contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
/* Scheduler include files. */
#include "FreeRTOS.h"
#include "task.h"
/* Demo file headers. */
#include "regtest.h"
/*
* Test tasks that sets registers to known values, then checks to ensure the
* values remain as expected. Test 1 and test 2 use different values.
*/
static void prvRegisterCheck1( void *pvParameters );
static void prvRegisterCheck2( void *pvParameters );
/* Set to a non zero value should an error be found. */
portBASE_TYPE xRegTestError = pdFALSE;
/*-----------------------------------------------------------*/
void vStartRegTestTasks( void )
{
xTaskCreate( prvRegisterCheck1, "Reg1", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
xTaskCreate( prvRegisterCheck2, "Reg2", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL );
}
/*-----------------------------------------------------------*/
portBASE_TYPE xAreRegTestTasksStillRunning( void )
{
portBASE_TYPE xReturn;
/* If a register was found to contain an unexpected value then the
xRegTestError variable would have been set to a non zero value. */
if( xRegTestError == pdFALSE )
{
xReturn = pdTRUE;
}
else
{
xReturn = pdFALSE;
}
return xReturn;
}
/*-----------------------------------------------------------*/
static void prvRegisterCheck1( void *pvParameters )
{
( void ) pvParameters;
for( ;; )
{
asm( "LDI r31, 5" );
asm( "MOV r0, r31" );
asm( "LDI r31, 6" );
asm( "MOV r1, r31" );
asm( "LDI r31, 7" );
asm( "MOV r2, r31" );
asm( "LDI r31, 8" );
asm( "MOV r3, r31" );
asm( "LDI r31, 9" );
asm( "MOV r4, r31" );
asm( "LDI r31, 10" );
asm( "MOV r5, r31" );
asm( "LDI r31, 11" );
asm( "MOV r6, r31" );
asm( "LDI r31, 12" );
asm( "MOV r7, r31" );
asm( "LDI r31, 13" );
asm( "MOV r8, r31" );
asm( "LDI r31, 14" );
asm( "MOV r9, r31" );
asm( "LDI r31, 15" );
asm( "MOV r10, r31" );
asm( "LDI r31, 16" );
asm( "MOV r11, r31" );
asm( "LDI r31, 17" );
asm( "MOV r12, r31" );
asm( "LDI r31, 18" );
asm( "MOV r13, r31" );
asm( "LDI r31, 19" );
asm( "MOV r14, r31" );
asm( "LDI r31, 20" );
asm( "MOV r15, r31" );
asm( "LDI r16, 21" );
asm( "LDI r17, 22" );
asm( "LDI r18, 23" );
asm( "LDI r19, 24" );
asm( "LDI r20, 25" );
asm( "LDI r21, 26" );
asm( "LDI r22, 27" );
asm( "LDI r23, 28" );
asm( "LDI r24, 29" );
asm( "LDI r25, 30" );
asm( "LDI r26, 31" );
asm( "LDI r27, 32" );
asm( "LDI r30, 33" );
asm( "LDI r31, 5" );
asm( "CPSE r31, r0" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 6" );
asm( "CPSE r31, r1" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 7" );
asm( "CPSE r31, r2" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 8" );
asm( "CPSE r31, r3" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 9" );
asm( "CPSE r31, r4" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 10" );
asm( "CPSE r31, r5" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 11" );
asm( "CPSE r31, r6" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 12" );
asm( "CPSE r31, r7" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 13" );
asm( "CPSE r31, r8" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 14" );
asm( "CPSE r31, r9" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 15" );
asm( "CPSE r31, r10" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 16" );
asm( "CPSE r31, r11" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 17" );
asm( "CPSE r31, r12" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 18" );
asm( "CPSE r31, r13" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 19" );
asm( "CPSE r31, r14" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 20" );
asm( "CPSE r31, r15" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 21" );
asm( "CPSE r31, r16" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 22" );
asm( "CPSE r31, r17" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 23" );
asm( "CPSE r31, r18" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 24" );
asm( "CPSE r31, r19" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 25" );
asm( "CPSE r31, r20" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 26" );
asm( "CPSE r31, r21" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 27" );
asm( "CPSE r31, r22" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 28" );
asm( "CPSE r31, r23" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 29" );
asm( "CPSE r31, r24" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 30" );
asm( "CPSE r31, r25" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 31" );
asm( "CPSE r31, r26" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 32" );
asm( "CPSE r31, r27" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 33" );
asm( "CPSE r31, r30" );
asm( "STS xRegTestError, r0" );
}
}
/*-----------------------------------------------------------*/
static void prvRegisterCheck2( void *pvParameters )
{
( void ) pvParameters;
for( ;; )
{
asm( "LDI r31, 1" );
asm( "MOV r0, r31" );
asm( "LDI r31, 2" );
asm( "MOV r1, r31" );
asm( "LDI r31, 3" );
asm( "MOV r2, r31" );
asm( "LDI r31, 4" );
asm( "MOV r3, r31" );
asm( "LDI r31, 5" );
asm( "MOV r4, r31" );
asm( "LDI r31, 6" );
asm( "MOV r5, r31" );
asm( "LDI r31, 7" );
asm( "MOV r6, r31" );
asm( "LDI r31, 8" );
asm( "MOV r7, r31" );
asm( "LDI r31, 9" );
asm( "MOV r8, r31" );
asm( "LDI r31, 10" );
asm( "MOV r9, r31" );
asm( "LDI r31, 11" );
asm( "MOV r10, r31" );
asm( "LDI r31, 12" );
asm( "MOV r11, r31" );
asm( "LDI r31, 13" );
asm( "MOV r12, r31" );
asm( "LDI r31, 14" );
asm( "MOV r13, r31" );
asm( "LDI r31, 15" );
asm( "MOV r14, r31" );
asm( "LDI r31, 16" );
asm( "MOV r15, r31" );
asm( "LDI r16, 17" );
asm( "LDI r17, 18" );
asm( "LDI r18, 19" );
asm( "LDI r19, 20" );
asm( "LDI r20, 21" );
asm( "LDI r21, 22" );
asm( "LDI r22, 23" );
asm( "LDI r23, 24" );
asm( "LDI r24, 25" );
asm( "LDI r25, 26" );
asm( "LDI r26, 27" );
asm( "LDI r27, 28" );
asm( "LDI r30, 29" );
asm( "LDI r31, 1" );
asm( "CPSE r31, r0" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 2" );
asm( "CPSE r31, r1" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 3" );
asm( "CPSE r31, r2" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 4" );
asm( "CPSE r31, r3" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 5" );
asm( "CPSE r31, r4" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 6" );
asm( "CPSE r31, r5" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 7" );
asm( "CPSE r31, r6" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 8" );
asm( "CPSE r31, r7" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 9" );
asm( "CPSE r31, r8" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 10" );
asm( "CPSE r31, r9" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 11" );
asm( "CPSE r31, r10" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 12" );
asm( "CPSE r31, r11" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 13" );
asm( "CPSE r31, r12" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 14" );
asm( "CPSE r31, r13" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 15" );
asm( "CPSE r31, r14" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 16" );
asm( "CPSE r31, r15" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 17" );
asm( "CPSE r31, r16" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 18" );
asm( "CPSE r31, r17" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 19" );
asm( "CPSE r31, r18" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 20" );
asm( "CPSE r31, r19" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 21" );
asm( "CPSE r31, r20" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 22" );
asm( "CPSE r31, r21" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 23" );
asm( "CPSE r31, r22" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 24" );
asm( "CPSE r31, r23" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 25" );
asm( "CPSE r31, r24" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 26" );
asm( "CPSE r31, r25" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 27" );
asm( "CPSE r31, r26" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 28" );
asm( "CPSE r31, r27" );
asm( "STS xRegTestError, r0" );
asm( "LDI r31, 29" );
asm( "CPSE r31, r30" );
asm( "STS xRegTestError, r0" );
}
}

View file

@ -0,0 +1,74 @@
/*
FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>NOTE<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel. FreeRTOS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong? *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, training, latest information,
license and contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
#ifndef REG_TEST_H
#define REG_TEST_H
void vStartRegTestTasks( void );
portBASE_TYPE xAreRegTestTasksStillRunning( void );
#endif

View file

@ -0,0 +1,767 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<toolchain>
<name>AVR</name>
</toolchain>
<debug>1</debug>
<settings>
<name>C-SPY</name>
<archiveVersion>3</archiveVersion>
<data>
<version>12</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CSVariantProcessor</name>
<state>0</state>
</option>
<option>
<name>MacOverride</name>
<state>0</state>
</option>
<option>
<name>MacFile</name>
<state>$TOOLKIT_DIR$\*.mac</state>
</option>
<option>
<name>DDFile</name>
<state>$TOOLKIT_DIR$\Config\iom323.ddf</state>
</option>
<option>
<name>CInput</name>
<state>1</state>
</option>
<option>
<name>OCEnhancedCore</name>
<state>1</state>
</option>
<option>
<name>OC64BitDoubles</name>
<state>1</state>
</option>
<option>
<name>DdfFileSlave</name>
<state></state>
</option>
<option>
<name>RunToEnable</name>
<state>1</state>
</option>
<option>
<name>RunToName</name>
<state>main</state>
</option>
<option>
<name>newDDFileOverride</name>
<state>0</state>
</option>
<option>
<name>CSVariantEepromSize</name>
<state>0</state>
</option>
<option>
<name>CSVariant64KFlash</name>
<state>0</state>
</option>
<option>
<name>CdDllSlave</name>
<state>0</state>
</option>
<option>
<name>CDynDriver</name>
<state>SIMAVR</state>
</option>
<option>
<name>DebuggerUseUbrofResetVector</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>CCRAVR</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OCCRAVRDriver</name>
<state>1</state>
</option>
<option>
<name>OCCRAVRExtraOptions</name>
<state></state>
</option>
<option>
<name>OCCRAVRExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>OCCRAVRPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OCCRAVRBaud</name>
<version>0</version>
<state>5</state>
</option>
<option>
<name>OCCRAVRParity</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OCCRAVRDataBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OCCRAVRStopBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OCCRAVRHandshake</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OCCRAVRAllComm</name>
<state>1</state>
</option>
<option>
<name>OCCRAVRDoLogfile</name>
<state>0</state>
</option>
<option>
<name>OCCRAVRLogFile</name>
<state>cspycomm.log</state>
</option>
<option>
<name>OCCRAVRSuppressLoad</name>
<state>0</state>
</option>
<option>
<name>OCCRAVRFastDownload</name>
<state>1</state>
</option>
<option>
<name>OCCRAVRTargetCCheck</name>
<state>0</state>
</option>
<option>
<name>OCCRAVRdownloadToData</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICE200AVR</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OICE200AVRDriver</name>
<state>1</state>
</option>
<option>
<name>OICE200AVRExtraOptions</name>
<state></state>
</option>
<option>
<name>OICE200AVRExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>OICE200AVRPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OICE200AVRBaud</name>
<version>0</version>
<state>5</state>
</option>
<option>
<name>OICE200AVRParity</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OICE200AVRDataBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OICE200AVRStopBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OICE200AVRHandshake</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OICE200AVRAllComm</name>
<state>1</state>
</option>
<option>
<name>OICE200AVRDoLogfile</name>
<state>0</state>
</option>
<option>
<name>OICE200AVRLogFile</name>
<state>cspycomm.log</state>
</option>
<option>
<name>OICE200AVRHighSpeed</name>
<state>1</state>
</option>
<option>
<name>OICE200AVRSingleStepTimers</name>
<state>0</state>
</option>
<option>
<name>OICE200AVRRestoreEEPROM</name>
<state>0</state>
</option>
<option>
<name>OICE200AVRComPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OICE200AVRSuppLoad</name>
<state>0</state>
</option>
<option>
<name>OICE200AVRConsCheck</name>
<state>0</state>
</option>
<option>
<name>OICE200AVRIce200ResetDelayList</name>
<version>8</version>
<state>0</state>
</option>
<option>
<name>OICE200AVRIce200downloadToData</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>JTAGICEAVR</name>
<archiveVersion>3</archiveVersion>
<data>
<version>2</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OJTAGICEAVRDriver</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEAVRExtraOptions</name>
<state></state>
</option>
<option>
<name>OJTAGICEAVRExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRBaud</name>
<version>0</version>
<state>5</state>
</option>
<option>
<name>OJTAGICEAVRParity</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRDataBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRStopBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRHandshake</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRAllComm</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEAVRDoLogfile</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRLogFile</name>
<state>cspycomm.log</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceDefaultCom</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceComPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceSuppLoad</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceConsCheck</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceJtagFreqRadio</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceJtagFreqManually</name>
<state>100000</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceJtagFreq</name>
<version>0</version>
<state>5</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceJtagDeviceBefore</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceJtagDeviceAfter</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceJtagInstrBitsBefore</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceJtagInstrBitsAfter</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagIceDaisyChain</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagDebugTimers</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEAVRJtagDebugEeprom</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagDebugReset</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEAVRJtagDebugFuses</name>
<state>0</state>
</option>
<option>
<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>3</archiveVersion>
<data>
<version>5</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OJTAGICEMKIIAVRDriver</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEMKIIAVRExtraOptions</name>
<state></state>
</option>
<option>
<name>OJTAGICEMKIIAVRExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRBaud</name>
<version>0</version>
<state>5</state>
</option>
<option>
<name>OJTAGICEMKIIAVRParity</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRDataBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRStopBits</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRHandshake</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRAllComm</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEMKIIAVRDoLogfile</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRLogFile</name>
<state>cspycomm.log</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceDefaultCom</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceComPort</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceSuppLoad</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceConsCheck</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceJtagFreqRadio</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceJtagFreqManually</name>
<state>100000</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceJtagFreq</name>
<version>0</version>
<state>8</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceJtagDeviceBefore</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceJtagDeviceAfter</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceJtagInstrBitsBefore</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceJtagInstrBitsAfter</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIceDaisyChain</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagDebugTimers</name>
<state>1</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagDebugEeprom</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagDebugReset</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagDebugFuses</name>
<state>0</state>
</option>
<option>
<name>OJTAGICEMKIIAVRJtagIcedownloadToData</name>
<state>0</state>
</option>
<option>
<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>
<option>
<name>OJTAGICEMKIIAVRCommunicationNew</name>
<state>2</state>
</option>
<option>
<name>OJTAGICEMKIIAVRCommunicationUsbEditId</name>
<state></state>
</option>
</data>
</settings>
<settings>
<name>DRAGONAVR</name>
<archiveVersion>1</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>ODRAGONAVRDriver</name>
<state>1</state>
</option>
<option>
<name>ODRAGONAVRExtraOptions</name>
<state></state>
</option>
<option>
<name>ODRAGONAVRExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRDoLogfile</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRLogFile</name>
<state>cspycomm.log</state>
</option>
<option>
<name>ODRAGONAVRJtagIceSuppLoad</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIceConsCheck</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIceJtagFreqRadio</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIceJtagFreqManually</name>
<state>100000</state>
</option>
<option>
<name>ODRAGONAVRJtagIceJtagFreq</name>
<version>0</version>
<state>8</state>
</option>
<option>
<name>ODRAGONAVRJtagIceJtagDeviceBefore</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIceJtagDeviceAfter</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIceJtagInstrBitsBefore</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIceJtagInstrBitsAfter</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIceDaisyChain</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagDebugTimers</name>
<state>1</state>
</option>
<option>
<name>ODRAGONAVRJtagDebugEeprom</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagDebugReset</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagDebugFuses</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagIcedownloadToData</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRJtagSoftwareBreak</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>
<option>
<name>ODRAGONAVRCommunicationNew</name>
<state>0</state>
</option>
<option>
<name>ODRAGONAVRCommunicationUsbEditId</name>
<state></state>
</option>
</data>
</settings>
<settings>
<name>SIMAVR</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OSIMAVRDriver</name>
<state>1</state>
</option>
<option>
<name>OSIMAVRExtraOptions</name>
<state></state>
</option>
<option>
<name>OSIMAVRExtraOptionsCheck</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>THIRDPARTYAVR</name>
<archiveVersion>2</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OTHIRDPARTYAVRDriver</name>
<state>1</state>
</option>
<option>
<name>OTHIRDPARTYAVRExtraOptions</name>
<state></state>
</option>
<option>
<name>OTHIRDPARTYAVRExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>OTHIRDPARTYAVRDriverDll</name>
<state>Browse to your Third party driver</state>
</option>
<option>
<name>OTHIRDPARTYAVRSuppress</name>
<state>0</state>
</option>
<option>
<name>OTHIRDPARTYAVRVerify</name>
<state>0</state>
</option>
<option>
<name>OTHIRDPARTYAVRLogFileCheck</name>
<state>0</state>
</option>
<option>
<name>OTHIRDPARTYAVRLogFileEditB</name>
<state>$TOOLKIT_DIR$\cspycomm.log</state>
</option>
</data>
</settings>
<debuggerPlugins>
<plugin>
<file>$TOOLKIT_DIR$\plugins\rtos\uCOS-II\uCOS-II-KA-CSpy.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\CodeCoverage\CodeCoverage.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Orti\Orti.ENU.ewplugin</file>
<loadFlag>0</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Profiling\Profiling.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\Stack\Stack.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
<plugin>
<file>$EW_DIR$\common\plugins\SymList\SymList.ENU.ewplugin</file>
<loadFlag>1</loadFlag>
</plugin>
</debuggerPlugins>
</configuration>
</project>

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<workspace>
<project>
<path>$WS_DIR$\rtosdemo.ewp</path>
</project>
<batchBuild/>
</workspace>

View file

@ -0,0 +1,231 @@
/*
FreeRTOS V7.1.1 - Copyright (C) 2012 Real Time Engineers Ltd.
***************************************************************************
* *
* FreeRTOS tutorial books are available in pdf and paperback. *
* Complete, revised, and edited pdf reference manuals are also *
* available. *
* *
* Purchasing FreeRTOS documentation will not only help you, by *
* ensuring you get running as quickly as possible and with an *
* in-depth knowledge of how to use FreeRTOS, it will also help *
* the FreeRTOS project to continue with its mission of providing *
* professional grade, cross platform, de facto standard solutions *
* for microcontrollers - completely free of charge! *
* *
* >>> See http://www.FreeRTOS.org/Documentation for details. <<< *
* *
* Thank you for using FreeRTOS, and thank you for your support! *
* *
***************************************************************************
This file is part of the FreeRTOS distribution.
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
>>>NOTE<<< The modification to the GPL is included to allow you to
distribute a combined work that includes FreeRTOS without being obliged to
provide the source code for proprietary components outside of the FreeRTOS
kernel. FreeRTOS is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
1 tab == 4 spaces!
***************************************************************************
* *
* Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong? *
* *
* http://www.FreeRTOS.org/FAQHelp.html *
* *
***************************************************************************
http://www.FreeRTOS.org - Documentation, training, latest information,
license and contact details.
http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
including FreeRTOS+Trace - an indispensable productivity tool.
Real Time Engineers ltd license FreeRTOS to High Integrity Systems, who sell
the code with commercial support, indemnification, and middleware, under
the OpenRTOS brand: http://www.OpenRTOS.com. High Integrity Systems also
provide a safety engineered and independently SIL3 certified version under
the SafeRTOS brand: http://www.SafeRTOS.com.
*/
/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER FOR IAR AVR PORT. */
#include <stdlib.h>
#include "FreeRTOS.h"
#include "queue.h"
#include "task.h"
#include "serial.h"
#define serBAUD_DIV_CONSTANT ( ( unsigned long ) 16 )
/* Constants for writing to UCSRB. */
#define serRX_INT_ENABLE ( ( unsigned char ) 0x80 )
#define serRX_ENABLE ( ( unsigned char ) 0x10 )
#define serTX_ENABLE ( ( unsigned char ) 0x08 )
#define serTX_INT_ENABLE ( ( unsigned char ) 0x20 )
/* Constants for writing to UCSRC. */
#define serUCSRC_SELECT ( ( unsigned char ) 0x80 )
#define serEIGHT_DATA_BITS ( ( unsigned char ) 0x06 )
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
#define vInterruptOn() \
{ \
unsigned char ucByte; \
\
ucByte = UCSRB; \
ucByte |= serTX_INT_ENABLE; \
outb( UCSRB, ucByte ); \
}
/*-----------------------------------------------------------*/
#define vInterruptOff() \
{ \
unsigned char ucByte; \
\
ucByte = UCSRB; \
ucByte &= ~serTX_INT_ENABLE; \
outb( UCSRB, ucByte ); \
}
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
unsigned long ulBaudRateCounter;
unsigned char ucByte;
portENTER_CRITICAL();
{
/* Create the queues used by the com test task. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );
xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) );
/* Calculate the baud rate register value from the equation in the
data sheet. */
ulBaudRateCounter = ( configCPU_CLOCK_HZ / ( serBAUD_DIV_CONSTANT * ulWantedBaud ) ) - ( unsigned long ) 1;
/* Set the baud rate. */
ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff );
outb( UBRRL, ucByte );
ulBaudRateCounter >>= ( unsigned long ) 8;
ucByte = ( unsigned char ) ( ulBaudRateCounter & ( unsigned long ) 0xff );
outb( UBRRH, ucByte );
/* Enable the Rx interrupt. The Tx interrupt will get enabled
later. Also enable the Rx and Tx. */
outb( UCSRB, serRX_INT_ENABLE | serRX_ENABLE | serTX_ENABLE );
/* Set the data bits to 8. */
outb( UCSRC, serUCSRC_SELECT | serEIGHT_DATA_BITS );
}
portEXIT_CRITICAL();
/* Unlike other ports, this serial code does not allow for more than one
com port. We therefore don't return a pointer to a port structure and can
instead just return NULL. */
return NULL;
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
{
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
{
/* Return false if after the block time there is no room on the Tx queue. */
if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS )
{
return pdFAIL;
}
vInterruptOn();
return pdPASS;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
unsigned char ucByte;
/* Turn off the interrupts. We may also want to delete the queues and/or
re-install the original ISR. */
portENTER_CRITICAL();
{
vInterruptOff();
ucByte = UCSRB;
ucByte &= ~serRX_INT_ENABLE;
outb( UCSRB, ucByte );
}
portEXIT_CRITICAL();
}
/*-----------------------------------------------------------*/
__interrupt void SIG_UART_RECV( void )
{
signed char ucChar, xHigherPriorityTaskWoken = pdFALSE;
/* Get the character and post it on the queue of Rxed characters.
If the post causes a task to wake force a context switch as the woken task
may have a higher priority than the task we have interrupted. */
ucChar = UDR;
xQueueSendFromISR( xRxedChars, &ucChar, &xHigherPriorityTaskWoken );
if( xHigherPriorityTaskWoken != pdFALSE )
{
taskYIELD();
}
}
/*-----------------------------------------------------------*/
__interrupt void SIG_UART_DATA( void )
{
signed char cChar, cTaskWoken = pdFALSE;
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &cTaskWoken ) == pdTRUE )
{
/* Send the next character queued for Tx. */
outb( UDR, cChar );
}
else
{
/* Queue empty, nothing to send. */
vInterruptOff();
}
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Project/>

View file

@ -0,0 +1,41 @@
[DisAssemblyWindow]
NumStates=_ 1
State 1=_ 1
[Watch]
Watch 1=_ 1 "usCurrentNumberOfTasks"
Watch 2=
Watch 3=
[CodeCoverage]
State=_ 0
[Profiling]
State=_ 0
[TermIOSettings]
Filename=_ ""
InputMode=_ 1
[QWatch]
WindowContent=_ 100 100 100 100
[Desktop-Debug]
Wnd0=_ "Watch" "open" 44 0 1 -1 -1 -1 -1 1139 276 1595 524 100 100 100 100
Wnd1=_ "Memory" "open" 44 0 1 -1 -1 -1 -1 1139 217 1591 939 1 1872 0 1872 0 1 0 1 0
Wnd2=_ "CallStack" "open" 44 0 1 -1 -1 -1 -1 30 699 277 1037 1
Wnd3=_ "Register" "open" 44 0 1 -1 -1 -1 -1 1237 0 1569 1019 0 0 0 0
Wnd4=_ "Register" "open" 44 0 1 -1 -1 -1 -1 40 264 1312 986 0 0 0 0
Wnd5=_ "Editor-DebugSource" "open" 44 0 1 -1 -1 -1 -1 169 991 1062 2036 "E:\Dev\FreeRTOS\Source\portable\IAR\ATMega323\portmacro.s90" 1 1 0 206 6825 6825
Wnd6=_ "Disassembly" "open" 44 0 1 -1 -1 -4 -28 586 28 1196 854
Wnd7=_ "Log" "closed" 44 0 1 -1 -1 -4 -28 872 845 1595 1069
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
[TermIOLog]
LoggingEnabled=_ 0
LogFile=_ ""
[Log file]
LoggingEnabled=_ 0
LogFile=_ ""
Category=_ 0
[Breakpoints]
Count=0
[TraceHelper]
Enabled=0
ShowSource=1

View file

@ -0,0 +1,4 @@
[struct types]
Count=_ 0
[watch formats]
Count=_ 0

View file

@ -0,0 +1,10 @@
[WorkspaceWindow]
ExpandedNodes=_ 1 "rtosdemo" 1 "rtosdemo/Debug"
SelectedTab=_ 0
[Desktop-Workspace]
Wnd0=_ "TextEditor" "open" 44 0 1 -1 -1 -1 -1 378 14 1227 671 "E:\Dev\FreeRTOS\Source\tasks.c" 1 1 0 1170 37742 37742
Wnd1=_ "TextEditor" "open" 44 0 1 -1 -1 -1 -1 81 81 930 738 "E:\Dev\FreeRTOS\Source\portable\IAR\ATMega323\portmacro.h" 1 1 0 66 3233 3233
Wnd2=_ "Workspace2" "open" 44 0 1 -1 -1 -4 -28 0 0 352 713 276 27 27
Wnd3=_ "Messages2" "open" 44 0 1 -1 -1 -4 -28 -6 714 1590 1104 5 "Build\Messages" 1580 "Find in Files\Line" 79 "Find in Files\Path" 474 "Find in Files\String" 948 "Tool Output\Output" 1560
Maximized=_ 0
Count=_ 4

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<Workspace>
<ConfigDictionary>
<CurrentConfigs><Project>rtosdemo/Debug</Project></CurrentConfigs></ConfigDictionary>
<Desktop>
<Static>
<Workspace>
<ColumnWidths>
<Column0>310</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><Debug-Log/></Static>
<Windows>
<Wnd0>
<Tabs>
<Tab>
<Identity>TabID-12388-19520</Identity>
<TabName>Workspace</TabName>
<Factory>Workspace</Factory>
<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><Tab><Identity>TabID-954-28216</Identity><TabName>Debug Log</TabName><Factory>Debug-Log</Factory><Session/></Tab></Tabs><SelectedTab>0</SelectedTab></Wnd1></Windows>
<Editor>
<Pane><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\WorkingCopy3\Demo\AVR_ATMega323_IAR\serial\serial.c</Filename><XPos>0</XPos><YPos>174</YPos><SelStart>6386</SelStart><SelEnd>6386</SelEnd></Tab><ActiveTab>0</ActiveTab><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\WorkingCopy3\Source\include\queue.h</Filename><XPos>45</XPos><YPos>975</YPos><SelStart>33703</SelStart><SelEnd>33727</SelEnd></Tab><Tab><Factory>TextEditor</Factory><Filename>C:\E\Dev\FreeRTOS\WorkingCopy3\Source\queue.c</Filename><XPos>0</XPos><YPos>814</YPos><SelStart>28555</SelStart><SelEnd>28555</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-00aa9bc8><key>iaridepm.enu1</key></Toolbar-00aa9bc8></Sizes></Row0></Top><Left><Row0><Sizes><Wnd0><Rect><Top>-2</Top><Left>-2</Left><Bottom>628</Bottom><Right>384</Right><x>-2</x><y>-2</y><xscreen>194</xscreen><yscreen>163</yscreen><sizeHorzCX>115476</sizeHorzCX><sizeHorzCY>165988</sizeHorzCY><sizeVertCX>229762</sizeVertCX><sizeVertCY>641548</sizeVertCY></Rect></Wnd0></Sizes></Row0></Left><Right><Row0><Sizes/></Row0></Right><Bottom><Row0><Sizes><Wnd1><Rect><Top>-2</Top><Left>-2</Left><Bottom>310</Bottom><Right>1682</Right><x>-2</x><y>-2</y><xscreen>1684</xscreen><yscreen>312</yscreen><sizeHorzCX>1002381</sizeHorzCX><sizeHorzCY>317719</sizeHorzCY><sizeVertCX>116667</sizeVertCX><sizeVertCY>167006</sizeVertCY></Rect></Wnd1></Sizes></Row0></Bottom><Float><Sizes/></Float></Positions>
</Desktop>
</Workspace>