First version under SVN is V4.0.1

This commit is contained in:
Richard Barry 2006-05-02 09:39:15 +00:00
parent 243393860c
commit b6df57c7e3
918 changed files with 269038 additions and 0 deletions

View file

@ -0,0 +1,557 @@
[F29746990]
x=0
y=122
[F10478061]
x=0
y=48
[F15207742]
x=0
y=48
[F20376480]
x=0
y=1332
[F29843090]
x=5
y=23
[F20121086]
x=0
y=84
[F29765107]
x=31
y=45
[F29843242]
x=13
y=8
[F20539803]
x=0
y=266
[F15568046]
x=1
y=293
[F20441499]
x=0
y=105
[F20558577]
x=0
y=4714
[F20528681]
x=0
y=44
[ProjectGroup]
nFiles=1
FileName0=Demo1.PC
[Project]
nFiles=3
UseAD=0
CompatOpts=0
AutoHead=
IdentifierPrint=0
TreePrint=0
StatementResultPrint=0
SourcePrint=0
spoPrint=0
AsmPrint=0
CaseSens=1
Optimise=45
AProcFreq=40000000
LOptBytes=16
LOptBytesReg=6
TopROM=32767
StackPointer=3839
HeapPointer=3584
HasDoneOptionDialog=1
ASMProcessor=18F4620
UseLinker=0
DEBUGADV=1
Column0=-1
Column1=-1
Column2=259
TabIndex=0
ShowIcons=0
WindowState=0
Top=418
Left=0
Width=339
Height=209
FileType0_Name=main.c
FileType0_FileType=0
FileType0_DoLast=0
FileType1_Name=interrupt.c
FileType1_FileType=0
FileType1_DoLast=0
FileType2_Name=fuses.c
FileType2_FileType=0
FileType2_DoLast=0
[Debug]
WindowState=0
Top=0
Left=679
Width=338
Height=626
WinNumberIsIndex0=4097
WinNumberIsIndex1=4096
WinNumberIsIndex2=12
WinNumberIsIndex3=9
WinNumberIsIndex4=8
WinNumberIsIndex5=7
WinNumberIsIndex6=5
WinNumberIsIndex7=4
WinNumberIsIndex8=3
WinNumberIsIndex9=2
WinNumberIsIndex10=1
WinNumberIsIndex11=11
WinNumberIsIndex12=0
nWin=13
HType=0
HFreq=19
ScenixTurbo=1
Watchdog=0
LocalVariables=0
DBPort=3970
DBBit=3
UseICD=0
AutoSet=1
DBVars=3824
DBRate=57600
DBSerPort=4
UsePICKey=2
nTabs=4
Tab0=Main
Tab1=Memory
Tab2=Special
Tab3=History
[Window4097]
aHeight=0
aWidth=0
Height=121
Width=200
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=10
y=427
Left=43
Top=264
Group=0
Page=-1
[ExtDev4097]
Type=2
TypeN=Terminal
Pars0=7
Name=Terminal
FileName=
Layer=0
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars1=0
Pars2=0
[Window4096]
aHeight=0
aWidth=0
Height=200
Width=90
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=0
x=10
y=299
Left=43
Top=131
Group=0
Page=-1
[ExtDev4096]
Type=12
TypeN=Pin Out
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars0=0
Pars1=0
Pars2=0
Name=Pin Out : 18F4620
FileName=
Layer=1
[Window12]
aHeight=274
aWidth=732
Height=141
Width=366
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=38
Left=0
Top=100
Group=0
Page=1
[Window9]
aHeight=250
aWidth=250
Height=247
Width=231
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=0
x=98
y=133
Left=32
Top=149
Group=0
Page=15
[Window8]
aHeight=250
aWidth=250
Height=266
Width=283
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=139
y=105
Left=45
Top=135
Group=0
Page=8
[Window7]
aHeight=947
aWidth=978
Height=490
Width=489
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=16
y=45
Left=8
Top=104
Group=0
Page=3
[Window5]
aHeight=955
aWidth=490
Height=494
Width=161
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=504
y=42
Left=166
Top=102
Group=0
Page=2
[Window4]
aHeight=957
aWidth=498
Height=495
Width=164
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=2
y=40
Left=0
Top=101
Group=0
Page=2
[Window3]
aHeight=191
aWidth=985
Height=98
Width=325
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=666
Left=0
Top=425
Group=0
Page=7
[Window2]
aHeight=1000
aWidth=538
Height=518
Width=177
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=462
y=0
Left=152
Top=81
Group=0
Page=4
[Window1]
aHeight=277
aWidth=998
Height=143
Width=329
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=720
Left=0
Top=453
Group=0
Page=1
[Window11]
aHeight=335
aWidth=560
Height=173
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=436
y=517
Left=143
Top=348
Group=0
Page=9
[Window0]
aHeight=472
aWidth=558
Height=244
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=438
y=42
Left=144
Top=102
Group=0
Page=1
[APPWIZ]
AProcFreq=4000000
nUserTemp=0
Proc=16F84
Left=-118
Top=-5780
Width=750
Heigth=600
nElem=0
[GLOBAL]
LoadCheck=2
SimulateAll=1
[MainWindow]
WindowState=2
Top=-4
Left=-4
Width=1032
Height=748
Update=25000
StopOnError=1
[FindRep]
nTextFind=1
nTextReplace=0
TextFind0=idle
[EditWindow]
Tab=0
nFiles=1
nMRU=9
MarginOn=1
MarginType=2
WindowState=0
Top=0
Left=0
Width=679
Height=418
Files0=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\main.c
MRU0=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo1\main.c
Files1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
Files2=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo1\main.c
MRU1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\Demo1.rep
Files3=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\Demo1.rep
Files4=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\interrupt.c
MRU3=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Tasks.c
MRU4=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\interrupt.c
Files5=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Tasks.c
Files6=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\fuses.c
MRU5=C:\Program Files\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU6=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\fuses.c
MRU7=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Include\portmacro.h
MRU8=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo1\FreeRTOSConfig.h
[PinConnections]
nPins=0
[AssCode]
ProcType=18F4620
[Information]
Column0=-1
Column1=8
Column2=4
Column3=16
Column4=-1
Column5=50
MemoHeight=154
WindowState=0
Top=418
Left=339
Width=339
Height=209
[F29011525]
x=0
y=146
[F28396641]
x=10
y=6
[F29564798]
x=30
y=28
[F29012037]
x=0
y=115
[F28429921]
x=0
y=0
[F29011781]
x=0
y=118
[F29216334]
x=0
y=189
[F28413281]
x=0
y=0
[F30088746]
x=1
y=77
[F30162974]
x=31
y=41
[F29012805]
x=0
y=111
[F30164254]
x=33
y=61
[F29566078]
x=0
y=0
[F28479841]
x=0
y=51
[F30090026]
x=43
y=55
[F29453097]
x=56
y=205
[F29217358]
x=0
y=141
[F20258362]
x=0
y=5698
[F30827659]
x=0
y=4965
[F30243933]
x=0
y=4821
[F20414028]
x=0
y=6113
[F30146592]
x=0
y=75
[F20220814]
x=0
y=534
[F30427679]
x=0
y=46
[F30394911]
x=0
y=0
[F29013061]
x=0
y=113
[F27259933]
x=0
y=37
[F27123467]
x=0
y=193
[F30360431]
x=0
y=4767
[F28496481]
x=8
y=29
[F19387162]
x=0
y=3
[F19809996]
x=22
y=3
[F18298596]
x=0
y=0
[F28396679]
x=0
y=0
[F28930696]
x=0
y=49
[F16522402]
x=0
y=11
[F18298558]
x=6
y=16
[F25371223]
x=7
y=1
[F30161512]
x=0
y=0
[F16524734]
x=0
y=5
[F18599386]
x=0
y=0
[F14954382]
x=0
y=29
[F16904974]
x=0
y=0

View file

@ -0,0 +1,82 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ TickRate reduced to 250Hz.
+ configIDLE_SHOULD_YIELD added.
Changes from V3.0.1
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION ( 1 )
#define configUSE_IDLE_HOOK ( 0 )
#define configUSE_TICK_HOOK ( 0 )
#define configTICK_RATE_HZ ( 250 )
#define configMAX_PRIORITIES ( 1 )
#define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE
#define configMAX_TASK_NAME_LEN ( 3 )
#define configUSE_TRACE_FACILITY ( 0 )
#define configUSE_16_BIT_TICKS ( 1 )
#define configIDLE_SHOULD_YIELD ( 1 )
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the component, or zero
to exclude the component. */
/* Include/exclude the stated API function. */
#define INCLUDE_vTaskPrioritySet ( 0 )
#define INCLUDE_uxTaskPriorityGet ( 0 )
#define INCLUDE_vTaskDelete ( 0 )
#define INCLUDE_vTaskCleanUpResources ( 0 )
#define INCLUDE_vTaskSuspend ( 0 )
#define INCLUDE_vTaskDelayUntil ( 1 )
#define INCLUDE_vTaskDelay ( 0 )
#endif /* FREERTOS_CONFIG_H */

View file

@ -0,0 +1,41 @@
#ifndef _MALLOC_SETTINGS_H
#define _MALLOC_SETTINGS_H
/*********************************************************************
** Title: Dynamic memory (de-)allocation library for wizC.
**
** Author: Marcel van Lieshout
**
** Copyright: (c) 2005, HMCS, Marcel van Lieshout
**
** License: This software is released to the public domain and comes
** without warranty and/or guarantees of any kind. You have
** the right to use, copy, modify and/or (re-)distribute the
** software as long as the reference to the author is
** maintained in the software and a reference to the author
** is included in any documentation of each product in which
** this library (in it's original or in a modified form)
** is used.
*********************************************************************/
/*********************************************************************
** The model to use
*********************************************************************/
//#define MALLOC_SMALL
#define MALLOC_LARGE
/*********************************************************************
** The size of the heap
*********************************************************************/
#define MALLOC_HEAP_SIZE (3200)
/*********************************************************************
** Should released memory be scribbled with 0x55 before releasing it?
*********************************************************************/
//#define MALLOC_SCRIBBLE
/********************************************************************
** Enable Debug-mode?
*********************************************************************/
//#define MALLOC_DEBUG
#endif /* _MALLOC_SETTINGS_H */

View file

@ -0,0 +1,50 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Several modules predefined to avoid linker problems
Changes from V3.0.1
*/
#ifndef _memcpy
#define _memcpy 1
#endif
#ifndef _memset
#define _memset 1
#endif
#ifndef _strncpy
#define _strncpy 1
#endif

View file

@ -0,0 +1,58 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
** Here are the configuration words set. See the PIC datasheet
** and the wizC manual for an explanation
*/
#include <pic.h>
/*
** These fuses are for PIC18F4620
*/
#pragma __config _CONFIG1H,_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_HSPLL_1H
#pragma __config _CONFIG2L,_BORV_21_2L & _BOREN_SBORDIS_2L & _PWRT_ON_2L
#pragma __config _CONFIG2H,_WDTPS_32768_2H & _WDT_OFF_2H
#pragma __config _CONFIG3H,_MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
#pragma __config _CONFIG4L,_DEBUG_OFF_4L & _XINST_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L
#pragma __config _CONFIG5L,_CP3_OFF_5L & _CP2_OFF_5L & _CP1_OFF_5L & _CP0_OFF_5L
#pragma __config _CONFIG5H,_CPD_OFF_5H & _CPB_OFF_5H
#pragma __config _CONFIG6L,_WRT3_OFF_6L & _WRT2_OFF_6L & _WRT1_OFF_6L & _WRT0_OFF_6L
#pragma __config _CONFIG6H,_WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H
#pragma __config _CONFIG7L,_EBTR3_OFF_7L & _EBTR2_OFF_7L & _EBTR1_OFF_7L & _EBTR0_OFF_7L
#pragma __config _CONFIG7H,_EBTRB_OFF_7H

View file

@ -0,0 +1,109 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}

View file

@ -0,0 +1,202 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
* Instead of the normal single demo application, the PIC18F demo is split
* into several smaller programs of which this is the first. This enables the
* demo's to be executed on the RAM limited PIC-devices.
*
* The Demo1 project is configured for a PIC18F4620 device. Main.c starts 9
* tasks (including the idle task).
* This first demo is included to do a quick check on the FreeRTOS
* installation. It is also included to demonstrate a minimal project-setup
* to use FreeRTOS in a wizC environment.
*
* Eight independant tasks are created. All tasks share the same taskcode.
* Each task blinks a different led on portB. The blinkrate for each task
* is different, but chosen in such a way that portB will show a binary
* counter pattern. All blinkrates are derived from a single master-rate.
* By default, this masterrate is set to 100 milliseconds. Although such
* a low value will make it almost impossible to see some of the leds
* actually blink, it is a good value when using the wizC-simulator.
* When testing on a real chip, changing the value to eg. 500 milliseconds
* would be appropiate.
*/
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#define mainBLINK_LED_INTERVAL ( ( portTickType ) 100 / ( portTICK_RATE_MS ) )
/* The LED that is flashed by the B0 task. */
#define mainBLINK_LED0_PORT LATD
#define mainBLINK_LED0_TRIS TRISD
#define mainBLINK_LED0_PIN 0
#define mainBLINK_LED0_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED0_PIN))
/* The LED that is flashed by the B1 task. */
#define mainBLINK_LED1_PORT LATD
#define mainBLINK_LED1_TRIS TRISD
#define mainBLINK_LED1_PIN 1
#define mainBLINK_LED1_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED1_PIN))
/* The LED that is flashed by the B2 task. */
#define mainBLINK_LED2_PORT LATD
#define mainBLINK_LED2_TRIS TRISD
#define mainBLINK_LED2_PIN 2
#define mainBLINK_LED2_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED2_PIN))
/* The LED that is flashed by the B3 task. */
#define mainBLINK_LED3_PORT LATD
#define mainBLINK_LED3_TRIS TRISD
#define mainBLINK_LED3_PIN 3
#define mainBLINK_LED3_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED3_PIN))
/* The LED that is flashed by the B4 task. */
#define mainBLINK_LED4_PORT LATD
#define mainBLINK_LED4_TRIS TRISD
#define mainBLINK_LED4_PIN 4
#define mainBLINK_LED4_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED4_PIN))
/* The LED that is flashed by the B5 task. */
#define mainBLINK_LED5_PORT LATD
#define mainBLINK_LED5_TRIS TRISD
#define mainBLINK_LED5_PIN 5
#define mainBLINK_LED5_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED5_PIN))
/* The LED that is flashed by the B6 task. */
#define mainBLINK_LED6_PORT LATD
#define mainBLINK_LED6_TRIS TRISD
#define mainBLINK_LED6_PIN 6
#define mainBLINK_LED6_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED6_PIN))
/* The LED that is flashed by the B7 task. */
#define mainBLINK_LED7_PORT LATD
#define mainBLINK_LED7_TRIS TRISD
#define mainBLINK_LED7_PIN 7
#define mainBLINK_LED7_INTERVAL ((mainBLINK_LED_INTERVAL) << (mainBLINK_LED7_PIN))
typedef struct {
unsigned char *port;
unsigned char *tris;
unsigned char pin;
portTickType interval;
} SBLINK;
const SBLINK sled0 = {&mainBLINK_LED0_PORT, &mainBLINK_LED0_TRIS, mainBLINK_LED0_PIN, mainBLINK_LED0_INTERVAL};
const SBLINK sled1 = {&mainBLINK_LED1_PORT, &mainBLINK_LED1_TRIS, mainBLINK_LED1_PIN, mainBLINK_LED1_INTERVAL};
const SBLINK sled2 = {&mainBLINK_LED2_PORT, &mainBLINK_LED2_TRIS, mainBLINK_LED2_PIN, mainBLINK_LED2_INTERVAL};
const SBLINK sled3 = {&mainBLINK_LED3_PORT, &mainBLINK_LED3_TRIS, mainBLINK_LED3_PIN, mainBLINK_LED3_INTERVAL};
const SBLINK sled4 = {&mainBLINK_LED4_PORT, &mainBLINK_LED4_TRIS, mainBLINK_LED4_PIN, mainBLINK_LED4_INTERVAL};
const SBLINK sled5 = {&mainBLINK_LED5_PORT, &mainBLINK_LED5_TRIS, mainBLINK_LED5_PIN, mainBLINK_LED5_INTERVAL};
const SBLINK sled6 = {&mainBLINK_LED6_PORT, &mainBLINK_LED6_TRIS, mainBLINK_LED6_PIN, mainBLINK_LED6_INTERVAL};
const SBLINK sled7 = {&mainBLINK_LED7_PORT, &mainBLINK_LED7_TRIS, mainBLINK_LED7_PIN, mainBLINK_LED7_INTERVAL};
/*
* The task code for the "vBlink" task.
*/
static portTASK_FUNCTION_PROTO(vBlink, pvParameters);
/*-----------------------------------------------------------*/
/*
* Creates the tasks, then starts the scheduler.
*/
void main( void )
{
/*
* Start the blink tasks defined in this file.
*/
xTaskCreate( vBlink, "B0", configMINIMAL_STACK_SIZE, &sled0, tskIDLE_PRIORITY, NULL );
xTaskCreate( vBlink, "B1", configMINIMAL_STACK_SIZE, &sled1, tskIDLE_PRIORITY, NULL );
xTaskCreate( vBlink, "B2", configMINIMAL_STACK_SIZE, &sled2, tskIDLE_PRIORITY, NULL );
xTaskCreate( vBlink, "B3", configMINIMAL_STACK_SIZE, &sled3, tskIDLE_PRIORITY, NULL );
xTaskCreate( vBlink, "B4", configMINIMAL_STACK_SIZE, &sled4, tskIDLE_PRIORITY, NULL );
xTaskCreate( vBlink, "B5", configMINIMAL_STACK_SIZE, &sled5, tskIDLE_PRIORITY, NULL );
xTaskCreate( vBlink, "B6", configMINIMAL_STACK_SIZE, &sled6, tskIDLE_PRIORITY, NULL );
xTaskCreate( vBlink, "B7", configMINIMAL_STACK_SIZE, &sled7, tskIDLE_PRIORITY, NULL );
/*
* Start the scheduler.
*/
vTaskStartScheduler( );
while(1) /* This point should never be reached. */
{
}
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION(vBlink, pvParameters)
{
unsigned char *Port = ((SBLINK *)pvParameters)->port;
unsigned char *Tris = ((SBLINK *)pvParameters)->tris;
unsigned char Pin = ((SBLINK *)pvParameters)->pin;
portTickType Interval = ((SBLINK *)pvParameters)->interval;
portTickType xLastWakeTime;
/*
* Initialize the hardware
*/
*Tris &= ~(1<<Pin); // Set the pin that is used by this task to ouput
*Port &= ~(1<<Pin); // Drive the pin low
/*
* Initialise the xLastWakeTime variable with the current time.
*/
xLastWakeTime = xTaskGetTickCount();
/*
* Cycle for ever, delaying then toggle the LED.
*/
for( ;; )
{
/*
* Wait until it is time to toggle
*/
vTaskDelayUntil( &xLastWakeTime, Interval );
/*
* Toggle the LED for visual feedback.
*/
*Port ^= 1<<Pin;
}
}

View file

@ -0,0 +1,528 @@
[F29011525]
x=0
y=145
[F10478061]
x=0
y=48
[F28396641]
x=10
y=6
[ProjectGroup]
nFiles=1
FileName0=Demo2.PC
[Project]
nFiles=9
UseAD=0
CompatOpts=0
AutoHead=
IdentifierPrint=0
TreePrint=0
StatementResultPrint=0
SourcePrint=0
spoPrint=0
AsmPrint=0
CaseSens=1
Optimise=45
AProcFreq=40000000
LOptBytes=16
LOptBytesReg=6
TopROM=32767
StackPointer=3839
HeapPointer=3584
HasDoneOptionDialog=1
ASMProcessor=18F4620
UseLinker=0
DEBUGADV=1
Column0=-1
Column1=-1
Column2=259
TabIndex=0
ShowIcons=0
WindowState=0
Top=418
Left=0
Width=339
Height=209
FileType0_Name=main.c
FileType0_FileType=0
FileType0_DoLast=0
FileType1_Name=interrupt.c
FileType1_FileType=0
FileType1_DoLast=0
FileType2_Name=fuses.c
FileType2_FileType=0
FileType2_DoLast=0
FileType3_Name=..\..\Common\Minimal\PollQ.c
FileType3_FileType=0
FileType3_DoLast=0
FileType4_Name=..\..\Common\Minimal\integer.c
FileType4_FileType=0
FileType4_DoLast=0
FileType5_Name=..\..\Common\Minimal\flash.c
FileType5_FileType=0
FileType5_DoLast=0
FileType6_Name=..\..\Common\Minimal\semtest.c
FileType6_FileType=0
FileType6_DoLast=0
FileType7_Name=..\ParTest\ParTest.c
FileType7_FileType=0
FileType7_DoLast=0
FileType8_Name=..\serial\serial.c
FileType8_FileType=0
FileType8_DoLast=0
[Debug]
WindowState=0
Top=0
Left=679
Width=338
Height=626
WinNumberIsIndex0=4097
WinNumberIsIndex1=4096
WinNumberIsIndex2=12
WinNumberIsIndex3=9
WinNumberIsIndex4=8
WinNumberIsIndex5=7
WinNumberIsIndex6=5
WinNumberIsIndex7=4
WinNumberIsIndex8=3
WinNumberIsIndex9=2
WinNumberIsIndex10=1
WinNumberIsIndex11=11
WinNumberIsIndex12=0
nWin=13
HType=0
HFreq=19
ScenixTurbo=1
Watchdog=0
LocalVariables=0
DBPort=3970
DBBit=3
UseICD=0
AutoSet=1
DBVars=3824
DBRate=19200
DBSerPort=4
UsePICKey=2
nTabs=4
Tab0=Main
Tab1=Memory
Tab2=Special
Tab3=History
[Window4097]
aHeight=0
aWidth=0
Height=200
Width=90
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=0
x=10
y=299
Left=43
Top=131
Group=0
Page=-1
[ExtDev4097]
Type=12
TypeN=Pin Out
Pars0=0
Name=Pin Out : 18F4620
FileName=
Layer=1
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars1=0
Pars2=0
[Window4096]
aHeight=0
aWidth=0
Height=121
Width=200
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=10
y=427
Left=43
Top=264
Group=0
Page=-1
[ExtDev4096]
Type=2
TypeN=Terminal
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars0=7
Pars1=0
Pars2=0
Name=Terminal
FileName=
Layer=0
[Window12]
aHeight=274
aWidth=732
Height=141
Width=241
isMinimised=1
isVisible=0
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=36
Left=0
Top=99
Group=0
Page=1
[Window9]
aHeight=250
aWidth=250
Height=247
Width=231
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=0
x=98
y=133
Left=49
Top=149
Group=0
Page=15
[Window8]
aHeight=250
aWidth=250
Height=266
Width=283
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=21
y=5
Left=6
Top=83
Group=0
Page=8
[Window7]
aHeight=947
aWidth=978
Height=490
Width=489
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=16
y=45
Left=8
Top=104
Group=0
Page=3
[Window5]
aHeight=955
aWidth=490
Height=494
Width=161
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=504
y=42
Left=166
Top=102
Group=0
Page=2
[Window4]
aHeight=957
aWidth=800
Height=495
Width=264
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=2
y=40
Left=0
Top=101
Group=0
Page=2
[Window3]
aHeight=191
aWidth=985
Height=98
Width=325
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=666
Left=0
Top=425
Group=0
Page=7
[Window2]
aHeight=1000
aWidth=538
Height=518
Width=177
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=457
y=0
Left=150
Top=81
Group=0
Page=4
[Window1]
aHeight=469
aWidth=998
Height=242
Width=329
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=528
Left=0
Top=354
Group=0
Page=1
[Window11]
aHeight=335
aWidth=560
Height=173
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=436
y=517
Left=143
Top=348
Group=0
Page=9
[Window0]
aHeight=472
aWidth=558
Height=244
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=421
y=127
Left=138
Top=146
Group=0
Page=1
[APPWIZ]
AProcFreq=4000000
nUserTemp=0
Proc=16F84
Left=-66
Top=-3388
Width=750
Heigth=600
nElem=0
[GLOBAL]
LoadCheck=2
SimulateAll=1
[MainWindow]
WindowState=2
Top=-4
Left=-4
Width=1032
Height=748
Update=60000
StopOnError=1
[FindRep]
nTextFind=2
nTextReplace=0
TextFind0=xSerialPortInitMinimal
TextFind1=interrupt
[EditWindow]
Tab=0
nFiles=1
nMRU=9
MarginOn=1
MarginType=2
WindowState=0
Top=0
Left=0
Width=679
Height=418
Files0=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo2\main.c
MRU0=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo2\main.c
Files1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
Files2=C:\Program Files\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo2\Demo2.rep
Files3=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo2\Demo2.rep
Files4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo2\INTERRUPT.C
MRU3=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\semtest.c
MRU4=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialRx.c
MRU5=C:\Program Files\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU6=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo2\INTERRUPT.C
MRU7=C:\DOCUMENTS AND SETTINGS\MARCEL\MY DOCUMENTS\PIC\FREERTOS\FREERTOS\DEMO\PIC18_WIZC\DEMO2\INTERRUPT_pp.asm
MRU8=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialTx.c
Files5=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\semtest.c
Files6=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Drivers\Tick\isrTick.c
Files7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialRx.c
Files8=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialTx.c
Files9=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Port.c
Files10=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Include\Portmacro.h
Files11=C:\DOCUMENTS AND SETTINGS\MARCEL\MY DOCUMENTS\PIC\FREERTOS\FREERTOS\DEMO\PIC18_WIZC\DEMO2\INTERRUPT_pp.asm
Files12=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Include\Portmacro.h
[PinConnections]
nPins=0
[AssCode]
ProcType=18F4620
[Information]
Column0=-1
Column1=8
Column2=4
Column3=16
Column4=-1
Column5=50
MemoHeight=154
WindowState=0
Top=418
Left=339
Width=339
Height=209
[F29011781]
x=0
y=117
[F30242909]
x=0
y=4855
[F27163403]
x=0
y=71
[F29216334]
x=0
y=189
[F15207742]
x=0
y=48
[F28413281]
x=0
y=0
[F29055566]
x=0
y=102
[F20539803]
x=18
y=216
[F29012293]
x=0
y=162
[F28446561]
x=0
y=0
[F20376480]
x=0
y=1323
[F29012037]
x=0
y=115
[F28429921]
x=0
y=0
[F30163230]
x=31
y=44
[F29565054]
x=0
y=0
[F30162974]
x=0
y=0
[F29564798]
x=30
y=28
[F30089002]
x=35
y=79
[F30163486]
x=0
y=0
[F29565310]
x=0
y=0
[F30089258]
x=21
y=70
[F20441499]
x=0
y=93
[F28930952]
x=59
y=1
[F28413319]
x=31
y=5106
[F29453097]
x=37
y=69
[F20220814]
x=0
y=423
[F20413807]
x=0
y=0
[F15568046]
x=0
y=302
[F20528681]
x=0
y=0
[F30146592]
x=0
y=0
[F15679330]
x=0
y=111
[F20122654]
x=0
y=44
[F29801181]
x=2
y=61
[F29801213]
x=4
y=59
[F30164098]
x=0
y=4816

View file

@ -0,0 +1,82 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*
Changes from V3.0.0
+ TickRate reduced to 250Hz.
+ configIDLE_SHOULD_YIELD added.
Changes from V3.0.1
*/
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION ( 1 )
#define configUSE_IDLE_HOOK ( 0 )
#define configUSE_TICK_HOOK ( 0 )
#define configTICK_RATE_HZ ( 250 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE
#define configMAX_TASK_NAME_LEN ( 3 )
#define configUSE_TRACE_FACILITY ( 0 )
#define configUSE_16_BIT_TICKS ( 1 )
#define configIDLE_SHOULD_YIELD ( 1 )
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the component, or zero
to exclude the component. */
/* Include/exclude the stated API function. */
#define INCLUDE_vTaskPrioritySet ( 0 )
#define INCLUDE_uxTaskPriorityGet ( 0 )
#define INCLUDE_vTaskDelete ( 0 )
#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,41 @@
#ifndef _MALLOC_SETTINGS_H
#define _MALLOC_SETTINGS_H
/*********************************************************************
** Title: Dynamic memory (de-)allocation library for wizC.
**
** Author: Marcel van Lieshout
**
** Copyright: (c) 2005, HMCS, Marcel van Lieshout
**
** License: This software is released to the public domain and comes
** without warranty and/or guarantees of any kind. You have
** the right to use, copy, modify and/or (re-)distribute the
** software as long as the reference to the author is
** maintained in the software and a reference to the author
** is included in any documentation of each product in which
** this library (in it's original or in a modified form)
** is used.
*********************************************************************/
/*********************************************************************
** The model to use
*********************************************************************/
//#define MALLOC_SMALL
#define MALLOC_LARGE
/*********************************************************************
** The size of the heap
*********************************************************************/
#define MALLOC_HEAP_SIZE (3200)
/*********************************************************************
** Should released memory be scribbled with 0x55 before releasing it?
*********************************************************************/
//#define MALLOC_SCRIBBLE
/********************************************************************
** Enable Debug-mode?
*********************************************************************/
//#define MALLOC_DEBUG
#endif /* _MALLOC_SETTINGS_H */

View file

@ -0,0 +1,53 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Several modules predefined to avoid linker problems
Changes from V3.0.1
*/
#ifndef _memcpy
#define _memcpy 1
#endif
#ifndef _memset
#define _memset 1
#endif
#ifndef _strncpy
#define _strncpy 1
#endif
#pragma wizcpp searchpath <../../Common/Include/>

View file

@ -0,0 +1,58 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
** Here are the configuration words set. See the PIC datasheet
** and the wizC manual for an explanation
*/
#include <pic.h>
/*
** These fuses are for PIC18F4620
*/
#pragma __config _CONFIG1H,_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_HSPLL_1H
#pragma __config _CONFIG2L,_BORV_21_2L & _BOREN_SBORDIS_2L & _PWRT_ON_2L
#pragma __config _CONFIG2H,_WDTPS_32768_2H & _WDT_OFF_2H
#pragma __config _CONFIG3H,_MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
#pragma __config _CONFIG4L,_DEBUG_OFF_4L & _XINST_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L
#pragma __config _CONFIG5L,_CP3_OFF_5L & _CP2_OFF_5L & _CP1_OFF_5L & _CP0_OFF_5L
#pragma __config _CONFIG5H,_CPD_OFF_5H & _CPB_OFF_5H
#pragma __config _CONFIG6L,_WRT3_OFF_6L & _WRT2_OFF_6L & _WRT1_OFF_6L & _WRT0_OFF_6L
#pragma __config _CONFIG6H,_WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H
#pragma __config _CONFIG7L,_EBTR3_OFF_7L & _EBTR2_OFF_7L & _EBTR1_OFF_7L & _EBTR0_OFF_7L
#pragma __config _CONFIG7H,_EBTRB_OFF_7H

View file

@ -0,0 +1,118 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*
* Was the interrupt a byte being received?
*/
#include "../Serial/isrSerialRx.c"
/*
* Was the interrupt the Tx register becoming empty?
*/
#include "../Serial/isrSerialTx.c"
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}

View file

@ -0,0 +1,198 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
* Instead of the normal single demo application, the PIC18F demo is split
* into several smaller programs of which this is the second. This enables the
* demo's to be executed on the RAM limited PIC-devices.
*
* The Demo2 project is configured for a PIC18F4620 device. Main.c starts 12
* tasks (including the idle task). See the indicated files in the demo/common
* directory for more information.
*
* demo/common/minimal/integer.c: Creates 1 task
* demo/common/minimal/PollQ.c: Creates 2 tasks
* demo/common/minimal/semtest.c: Creates 4 tasks
* demo/common/minimal/flash.c: Creates 3 tasks
*
* Main.c also creates a check task. This periodically checks that all the
* other tasks are still running and have not experienced any unexpected
* results. If all the other tasks are executing correctly an LED is flashed
* once every mainCHECK_PERIOD milliseconds. If any of the tasks have not
* executed, or report an error, the frequency of the LED flash will increase
* to mainERROR_FLASH_RATE.
*
* On entry to main an 'X' is transmitted. Monitoring the serial port using a
* dumb terminal allows for verification that the device is not continuously
* being reset (no more than one 'X' should be transmitted).
*
* http://www.FreeRTOS.org contains important information on the use of the
* wizC PIC18F port.
*/
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
/* Demo app include files. */
#include "integer.h"
#include "pollq.h"
#include "semtest.h"
#include "flash.h"
#include "partest.h"
#include "serial.h"
/* The period between executions of the check task before and after an error
has been discovered. If an error has been discovered the check task runs
more frequently - increasing the LED flash rate. */
#define mainNO_ERROR_CHECK_PERIOD ( ( portTickType ) 10000 / portTICK_RATE_MS )
#define mainERROR_CHECK_PERIOD ( ( portTickType ) 1000 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( ( unsigned portCHAR ) 3 )
/* Priority definitions for some of the tasks. Other tasks just use the idle
priority. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 3 )
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 2 )
#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 1 )
#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 1 )
#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 0 )
/* Constants required for the communications. Only one character is ever
transmitted. */
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portCHAR ) 5 )
#define mainNO_BLOCK ( ( portTickType ) 0 )
#define mainBAUD_RATE ( ( unsigned portLONG ) 57600 )
/*
* The task function for the "Check" task.
*/
static portTASK_FUNCTION_PROTO( vErrorChecks, pvParameters );
/*
* Checks the unique counts of other tasks to ensure they are still operational.
* Returns pdTRUE if an error is detected, otherwise pdFALSE.
*/
static portCHAR prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/* Creates the tasks, then starts the scheduler. */
void main( void )
{
/* Initialise the required hardware. */
vParTestInitialise();
/* Send a character so we have some visible feedback of a reset. */
xSerialPortInitMinimal( mainBAUD_RATE, mainCOMMS_QUEUE_LENGTH );
xSerialPutChar( NULL, 'X', mainNO_BLOCK );
/* Start a few of the standard demo tasks found in the demo\common directory. */
vStartIntegerMathTasks( mainINTEGER_PRIORITY);
vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY );
vStartSemaphoreTasks( mainSEM_TEST_PRIORITY );
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );
/* Start the check task defined in this file. */
xTaskCreate( vErrorChecks, ( const portCHAR * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler. Will never return here. */
vTaskStartScheduler();
while(1) /* This point should never be reached. */
{
}
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION( vErrorChecks, pvParameters )
{
portTickType xLastCheckTime;
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;
portCHAR cErrorOccurred;
/* We need to initialise xLastCheckTime prior to the first call to
vTaskDelayUntil(). */
xLastCheckTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
/* Wait until it is time to check the other tasks again. */
vTaskDelayUntil( &xLastCheckTime, xDelayTime );
/* Check all the other tasks are running, and running without ever
having an error. */
cErrorOccurred = prvCheckOtherTasksAreStillRunning();
/* If an error was detected increase the frequency of the LED flash. */
if( cErrorOccurred == pdTRUE )
{
xDelayTime = mainERROR_CHECK_PERIOD;
}
/* Flash the LED for visual feedback. */
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portCHAR prvCheckOtherTasksAreStillRunning( void )
{
portCHAR cErrorHasOccurred = ( portCHAR ) pdFALSE;
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
if( xArePollingQueuesStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
if( xAreSemaphoreTasksStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
return cErrorHasOccurred;
}
/*-----------------------------------------------------------*/

View file

@ -0,0 +1,503 @@
[F29011781]
x=0
y=118
[F29216334]
x=0
y=189
[F15207742]
x=0
y=48
[F28413281]
x=0
y=0
[ProjectGroup]
nFiles=1
FileName0=Demo3.PC
[Project]
nFiles=8
UseAD=0
CompatOpts=0
AutoHead=
IdentifierPrint=0
TreePrint=0
StatementResultPrint=0
SourcePrint=0
spoPrint=0
AsmPrint=0
CaseSens=1
Optimise=45
AProcFreq=40000000
LOptBytes=16
LOptBytesReg=6
TopROM=32767
StackPointer=3839
HeapPointer=3584
HasDoneOptionDialog=1
ASMProcessor=18F4620
UseLinker=0
DEBUGADV=1
Column0=-1
Column1=-1
Column2=259
TabIndex=0
ShowIcons=0
WindowState=0
Top=418
Left=0
Width=339
Height=209
FileType0_Name=main.c
FileType0_FileType=0
FileType0_DoLast=0
FileType1_Name=interrupt.c
FileType1_FileType=0
FileType1_DoLast=0
FileType2_Name=fuses.c
FileType2_FileType=0
FileType2_DoLast=0
FileType3_Name=..\..\Common\Minimal\flash.c
FileType3_FileType=0
FileType3_DoLast=0
FileType4_Name=..\..\Common\Minimal\BlockQ.c
FileType4_FileType=0
FileType4_DoLast=0
FileType5_Name=..\ParTest\ParTest.c
FileType5_FileType=0
FileType5_DoLast=0
FileType6_Name=..\serial\serial.c
FileType6_FileType=0
FileType6_DoLast=0
FileType7_Name=..\..\Common\Minimal\integer.c
FileType7_FileType=0
FileType7_DoLast=0
[Debug]
WindowState=0
Top=0
Left=679
Width=338
Height=626
WinNumberIsIndex0=4097
WinNumberIsIndex1=4096
WinNumberIsIndex2=12
WinNumberIsIndex3=9
WinNumberIsIndex4=8
WinNumberIsIndex5=7
WinNumberIsIndex6=5
WinNumberIsIndex7=4
WinNumberIsIndex8=3
WinNumberIsIndex9=2
WinNumberIsIndex10=1
WinNumberIsIndex11=11
WinNumberIsIndex12=0
nWin=13
HType=0
HFreq=19
ScenixTurbo=1
Watchdog=0
LocalVariables=0
DBPort=3970
DBBit=3
UseICD=0
AutoSet=1
DBVars=3824
DBRate=19200
DBSerPort=1
UsePICKey=0
nTabs=4
Tab0=Main
Tab1=Memory
Tab2=Special
Tab3=History
[Window4097]
aHeight=0
aWidth=0
Height=121
Width=200
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=10
y=427
Left=43
Top=264
Group=0
Page=-1
[ExtDev4097]
Type=2
TypeN=Terminal
Pars0=7
Name=Terminal
FileName=
Layer=0
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars1=0
Pars2=0
[Window4096]
aHeight=0
aWidth=0
Height=200
Width=90
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=0
x=10
y=299
Left=43
Top=131
Group=0
Page=-1
[ExtDev4096]
Type=12
TypeN=Pin Out
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars0=0
Pars1=0
Pars2=0
Name=Pin Out : 18F4620
FileName=
Layer=1
[Window12]
aHeight=274
aWidth=732
Height=141
Width=366
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=38
Left=0
Top=100
Group=0
Page=1
[Window9]
aHeight=250
aWidth=250
Height=247
Width=231
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=0
x=98
y=133
Left=49
Top=149
Group=0
Page=15
[Window8]
aHeight=250
aWidth=250
Height=266
Width=283
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=84
y=0
Left=27
Top=81
Group=0
Page=8
[Window7]
aHeight=947
aWidth=978
Height=490
Width=489
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=16
y=45
Left=8
Top=104
Group=0
Page=3
[Window5]
aHeight=955
aWidth=490
Height=494
Width=161
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=504
y=42
Left=166
Top=102
Group=0
Page=2
[Window4]
aHeight=957
aWidth=498
Height=495
Width=164
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=2
y=40
Left=0
Top=101
Group=0
Page=2
[Window3]
aHeight=191
aWidth=985
Height=98
Width=325
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=666
Left=0
Top=425
Group=0
Page=7
[Window2]
aHeight=1000
aWidth=538
Height=518
Width=177
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=462
y=0
Left=152
Top=81
Group=0
Page=4
[Window1]
aHeight=389
aWidth=998
Height=201
Width=329
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=608
Left=0
Top=395
Group=0
Page=1
[Window11]
aHeight=335
aWidth=560
Height=173
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=436
y=517
Left=143
Top=348
Group=0
Page=9
[Window0]
aHeight=472
aWidth=558
Height=244
Width=279
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=438
y=42
Left=219
Top=102
Group=0
Page=1
[APPWIZ]
AProcFreq=4000000
nUserTemp=0
Proc=16F84
Left=-48
Top=-2560
Width=750
Heigth=600
nElem=0
[GLOBAL]
LoadCheck=2
SimulateAll=1
[MainWindow]
WindowState=2
Top=-4
Left=-4
Width=1032
Height=748
Update=25000
StopOnError=1
[FindRep]
nTextFind=0
nTextReplace=0
[EditWindow]
Tab=0
nFiles=1
nMRU=9
MarginOn=1
MarginType=2
WindowState=0
Top=0
Left=0
Width=679
Height=418
Files0=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo3\main.c
MRU0=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo3\main.c
Files1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
Files2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo3\Demo3.rep
MRU1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo3\Demo3.rep
Files3=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\List.c
Files4=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
Files5=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FREERTOS 2005-06-04 01\Demo\PIC18_WIZC\Demo3\main.c
MRU3=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
MRU4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FREERTOS 2005-06-04 01\Demo\PIC18_WIZC\Demo3\INTERRUPT.C
MRU5=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS 2005-06-04 01\Demo\PIC18_WizC\serial\serial.c
MRU6=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FREERTOS 2005-06-04 01\Demo\PIC18_WIZC\Demo3\main.c
MRU7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS 2005-06-04 01\Demo\PIC18_WizC\Demo3\Demo3.rep
MRU8=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo3\INTERRUPT.C
Files6=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FREERTOS 2005-06-04 01\Demo\PIC18_WIZC\Demo3\INTERRUPT.C
Files7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS 2005-06-04 01\Demo\PIC18_WizC\serial\serial.c
[PinConnections]
nPins=0
[AssCode]
ProcType=18F4620
[Information]
Column0=-1
Column1=8
Column2=4
Column3=16
Column4=-1
Column5=50
MemoHeight=154
WindowState=0
Top=418
Left=339
Width=339
Height=209
[F29012037]
x=0
y=114
[F20441499]
x=0
y=119
[F20539803]
x=37
y=82
[F20376480]
x=0
y=1323
[F28429921]
x=0
y=0
[F16524754]
x=0
y=10
[F10478061]
x=0
y=48
[F14733113]
x=21
y=61
[F15556403]
x=0
y=85
[F18602004]
x=49
y=1124
[F18601966]
x=0
y=0
[F20220814]
x=0
y=628
[F29055566]
x=0
y=137
[F30163230]
x=33
y=61
[F29565054]
x=0
y=0
[F30163486]
x=32
y=44
[F29565310]
x=0
y=0
[F30089258]
x=0
y=107
[F29012293]
x=0
y=114
[F28446561]
x=0
y=0
[F30243165]
x=0
y=4852
[F27125515]
x=0
y=0
[F15568046]
x=0
y=0
[F20528681]
x=0
y=0
[F30163742]
x=0
y=20
[F33200396]
x=0
y=107
[F32375968]
x=0
y=0
[F28917072]
x=0
y=114
[F31779807]
x=0
y=0

View file

@ -0,0 +1,82 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ TickRate reduced to 250Hz.
+ configIDLE_SHOULD_YIELD added.
Changes from V3.0.1
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION ( 1 )
#define configUSE_IDLE_HOOK ( 0 )
#define configUSE_TICK_HOOK ( 0 )
#define configTICK_RATE_HZ ( 250 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE
#define configMAX_TASK_NAME_LEN ( 3 )
#define configUSE_TRACE_FACILITY ( 0 )
#define configUSE_16_BIT_TICKS ( 1 )
#define configIDLE_SHOULD_YIELD ( 1 )
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the component, or zero
to exclude the component. */
/* Include/exclude the stated API function. */
#define INCLUDE_vTaskPrioritySet ( 0 )
#define INCLUDE_uxTaskPriorityGet ( 0 )
#define INCLUDE_vTaskDelete ( 0 )
#define INCLUDE_vTaskCleanUpResources ( 0 )
#define INCLUDE_vTaskSuspend ( 0 )
#define INCLUDE_vTaskDelayUntil ( 1 )
#define INCLUDE_vTaskDelay ( 0 )
#endif /* FREERTOS_CONFIG_H */

View file

@ -0,0 +1,41 @@
#ifndef _MALLOC_SETTINGS_H
#define _MALLOC_SETTINGS_H
/*********************************************************************
** Title: Dynamic memory (de-)allocation library for wizC.
**
** Author: Marcel van Lieshout
**
** Copyright: (c) 2005, HMCS, Marcel van Lieshout
**
** License: This software is released to the public domain and comes
** without warranty and/or guarantees of any kind. You have
** the right to use, copy, modify and/or (re-)distribute the
** software as long as the reference to the author is
** maintained in the software and a reference to the author
** is included in any documentation of each product in which
** this library (in it's original or in a modified form)
** is used.
*********************************************************************/
/*********************************************************************
** The model to use
*********************************************************************/
//#define MALLOC_SMALL
#define MALLOC_LARGE
/*********************************************************************
** The size of the heap
*********************************************************************/
#define MALLOC_HEAP_SIZE (3200)
/*********************************************************************
** Should released memory be scribbled with 0x55 before releasing it?
*********************************************************************/
//#define MALLOC_SCRIBBLE
/********************************************************************
** Enable Debug-mode?
*********************************************************************/
//#define MALLOC_DEBUG
#endif /* _MALLOC_SETTINGS_H */

View file

@ -0,0 +1,53 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Several modules predefined to avoid linker problems
Changes from V3.0.1
*/
#ifndef _memcpy
#define _memcpy 1
#endif
#ifndef _memset
#define _memset 1
#endif
#ifndef _strncpy
#define _strncpy 1
#endif
#pragma wizcpp searchpath <../../Common/Include/>

View file

@ -0,0 +1,58 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
** Here are the configuration words set. See the PIC datasheet
** and the wizC manual for an explanation
*/
#include <pic.h>
/*
** These fuses are for PIC18F4620
*/
#pragma __config _CONFIG1H,_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_HSPLL_1H
#pragma __config _CONFIG2L,_BORV_21_2L & _BOREN_SBORDIS_2L & _PWRT_ON_2L
#pragma __config _CONFIG2H,_WDTPS_32768_2H & _WDT_OFF_2H
#pragma __config _CONFIG3H,_MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
#pragma __config _CONFIG4L,_DEBUG_OFF_4L & _XINST_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L
#pragma __config _CONFIG5L,_CP3_OFF_5L & _CP2_OFF_5L & _CP1_OFF_5L & _CP0_OFF_5L
#pragma __config _CONFIG5H,_CPD_OFF_5H & _CPB_OFF_5H
#pragma __config _CONFIG6L,_WRT3_OFF_6L & _WRT2_OFF_6L & _WRT1_OFF_6L & _WRT0_OFF_6L
#pragma __config _CONFIG6H,_WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H
#pragma __config _CONFIG7L,_EBTR3_OFF_7L & _EBTR2_OFF_7L & _EBTR1_OFF_7L & _EBTR0_OFF_7L
#pragma __config _CONFIG7H,_EBTRB_OFF_7H

View file

@ -0,0 +1,118 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*
* Was the interrupt a byte being received?
*/
#include "../Serial/isrSerialRx.c"
/*
* Was the interrupt the Tx register becoming empty?
*/
#include "../Serial/isrSerialTx.c"
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}

View file

@ -0,0 +1,190 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
* Instead of the normal single demo application, the PIC18F demo is split
* into several smaller programs of which this is the third. This enables the
* demo's to be executed on the RAM limited PIC-devices.
*
* The Demo3 project is configured for a PIC18F4620 device. Main.c starts 12
* tasks (including the idle task). See the indicated files in the demo/common
* directory for more information.
*
* demo/common/minimal/integer.c: Creates 1 task
* demo/common/minimal/BlockQ.c: Creates 6 tasks
* demo/common/minimal/flash.c: Creates 3 tasks
*
* Main.c also creates a check task. This periodically checks that all the
* other tasks are still running and have not experienced any unexpected
* results. If all the other tasks are executing correctly an LED is flashed
* once every mainCHECK_PERIOD milliseconds. If any of the tasks have not
* executed, or report an error, the frequency of the LED flash will increase
* to mainERROR_FLASH_RATE.
*
* On entry to main an 'X' is transmitted. Monitoring the serial port using a
* dumb terminal allows for verification that the device is not continuously
* being reset (no more than one 'X' should be transmitted).
*
* http://www.FreeRTOS.org contains important information on the use of the
* wizC PIC18F port.
*/
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
/* Demo app include files. */
#include "integer.h"
#include "BlockQ.h"
#include "flash.h"
#include "partest.h"
#include "serial.h"
/* The period between executions of the check task before and after an error
has been discovered. If an error has been discovered the check task runs
more frequently - increasing the LED flash rate. */
#define mainNO_ERROR_CHECK_PERIOD ( ( portTickType ) 10000 / portTICK_RATE_MS )
#define mainERROR_CHECK_PERIOD ( ( portTickType ) 1000 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( ( unsigned portCHAR ) 3 )
/* Priority definitions for some of the tasks. Other tasks just use the idle
priority. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 3 )
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 2 )
#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 1 )
#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 0 )
/* Constants required for the communications. Only one character is ever
transmitted. */
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portCHAR ) 5 )
#define mainNO_BLOCK ( ( portTickType ) 0 )
#define mainBAUD_RATE ( ( unsigned portLONG ) 57600 )
/*
* The task function for the "Check" task.
*/
static portTASK_FUNCTION_PROTO( vErrorChecks, pvParameters );
/*
* Checks the unique counts of other tasks to ensure they are still operational.
* Returns pdTRUE if an error is detected, otherwise pdFALSE.
*/
static portCHAR prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/* Creates the tasks, then starts the scheduler. */
void main( void )
{
/* Initialise the required hardware. */
vParTestInitialise();
/* Send a character so we have some visible feedback of a reset. */
xSerialPortInitMinimal( mainBAUD_RATE, mainCOMMS_QUEUE_LENGTH );
xSerialPutChar( NULL, 'X', mainNO_BLOCK );
/* Start the standard demo tasks found in the demo\common directory. */
vStartIntegerMathTasks( mainINTEGER_PRIORITY);
vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY );
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );
/* Start the check task defined in this file. */
xTaskCreate( vErrorChecks, ( const portCHAR * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler. Will never return here. */
vTaskStartScheduler( );
while(1) /* This point should never be reached. */
{
}
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION( vErrorChecks, pvParameters )
{
portTickType xLastCheckTime;
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;
portCHAR cErrorOccurred;
/* We need to initialise xLastCheckTime prior to the first call to
vTaskDelayUntil(). */
xLastCheckTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
/* Wait until it is time to check the other tasks again. */
vTaskDelayUntil( &xLastCheckTime, xDelayTime );
/* Check all the other tasks are running, and running without ever
having an error. */
cErrorOccurred = prvCheckOtherTasksAreStillRunning();
/* If an error was detected increase the frequency of the LED flash. */
if( cErrorOccurred == pdTRUE )
{
xDelayTime = mainERROR_CHECK_PERIOD;
}
/* Flash the LED for visual feedback. */
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portCHAR prvCheckOtherTasksAreStillRunning( void )
{
portCHAR cErrorHasOccurred = ( portCHAR ) pdFALSE;
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
if( xAreBlockingQueuesStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
return cErrorHasOccurred;
}
/*-----------------------------------------------------------*/

View file

@ -0,0 +1,475 @@
[F29012037]
x=0
y=115
[F15207742]
x=0
y=48
[F10478061]
x=0
y=48
[F28429921]
x=0
y=0
[ProjectGroup]
nFiles=1
FileName0=Demo4.PC
[Project]
nFiles=8
UseAD=0
CompatOpts=0
AutoHead=
IdentifierPrint=0
TreePrint=0
StatementResultPrint=0
SourcePrint=0
spoPrint=0
AsmPrint=0
CaseSens=1
Optimise=45
AProcFreq=40000000
LOptBytes=16
LOptBytesReg=6
TopROM=32767
StackPointer=3839
HeapPointer=3584
HasDoneOptionDialog=1
ASMProcessor=18F4620
UseLinker=0
DEBUGADV=1
Column0=-1
Column1=-1
Column2=259
TabIndex=0
ShowIcons=0
WindowState=0
Top=418
Left=0
Width=339
Height=209
FileType0_Name=main.c
FileType0_FileType=0
FileType0_DoLast=0
FileType1_Name=interrupt.c
FileType1_FileType=0
FileType1_DoLast=0
FileType2_Name=fuses.c
FileType2_FileType=0
FileType2_DoLast=0
FileType3_Name=..\serial\serial.c
FileType3_FileType=0
FileType3_DoLast=0
FileType4_Name=..\ParTest\ParTest.c
FileType4_FileType=0
FileType4_DoLast=0
FileType5_Name=..\..\Common\Minimal\integer.c
FileType5_FileType=0
FileType5_DoLast=0
FileType6_Name=..\..\Common\Minimal\dynamic.c
FileType6_FileType=0
FileType6_DoLast=0
FileType7_Name=..\..\Common\Minimal\flash.c
FileType7_FileType=0
FileType7_DoLast=0
[Debug]
WindowState=0
Top=0
Left=679
Width=338
Height=626
WinNumberIsIndex0=4097
WinNumberIsIndex1=4096
WinNumberIsIndex2=12
WinNumberIsIndex3=9
WinNumberIsIndex4=8
WinNumberIsIndex5=7
WinNumberIsIndex6=5
WinNumberIsIndex7=4
WinNumberIsIndex8=3
WinNumberIsIndex9=2
WinNumberIsIndex10=1
WinNumberIsIndex11=11
WinNumberIsIndex12=0
nWin=13
HType=0
HFreq=19
ScenixTurbo=1
Watchdog=0
LocalVariables=0
DBPort=3970
DBBit=3
UseICD=0
AutoSet=1
DBVars=3824
DBRate=19200
DBSerPort=1
UsePICKey=0
nTabs=4
Tab0=Main
Tab1=Memory
Tab2=Special
Tab3=History
[Window4097]
aHeight=0
aWidth=0
Height=121
Width=200
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=10
y=427
Left=43
Top=264
Group=0
Page=-1
[ExtDev4097]
Type=2
TypeN=Terminal
Pars0=7
Name=Terminal
FileName=
Layer=0
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars1=0
Pars2=0
[Window4096]
aHeight=0
aWidth=0
Height=200
Width=90
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=0
x=10
y=299
Left=43
Top=131
Group=0
Page=-1
[ExtDev4096]
Type=12
TypeN=Pin Out
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars0=0
Pars1=0
Pars2=0
Name=Pin Out : 18F4620
FileName=
Layer=1
[Window12]
aHeight=274
aWidth=732
Height=141
Width=366
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=38
Left=0
Top=100
Group=0
Page=1
[Window9]
aHeight=250
aWidth=250
Height=247
Width=231
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=0
x=98
y=133
Left=49
Top=149
Group=0
Page=15
[Window8]
aHeight=250
aWidth=250
Height=266
Width=283
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=130
y=3
Left=42
Top=82
Group=0
Page=8
[Window7]
aHeight=947
aWidth=978
Height=490
Width=489
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=16
y=45
Left=8
Top=104
Group=0
Page=3
[Window5]
aHeight=955
aWidth=490
Height=494
Width=161
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=504
y=42
Left=166
Top=102
Group=0
Page=2
[Window4]
aHeight=957
aWidth=498
Height=495
Width=164
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=2
y=40
Left=0
Top=101
Group=0
Page=2
[Window3]
aHeight=191
aWidth=985
Height=98
Width=325
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=666
Left=0
Top=425
Group=0
Page=7
[Window2]
aHeight=1000
aWidth=538
Height=518
Width=177
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=462
y=0
Left=152
Top=81
Group=0
Page=4
[Window1]
aHeight=480
aWidth=998
Height=248
Width=329
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=517
Left=0
Top=348
Group=0
Page=1
[Window11]
aHeight=335
aWidth=560
Height=173
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=436
y=517
Left=143
Top=348
Group=0
Page=9
[Window0]
aHeight=472
aWidth=558
Height=244
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=442
y=92
Left=145
Top=128
Group=0
Page=1
[APPWIZ]
AProcFreq=4000000
nUserTemp=0
Proc=16F84
Left=-44
Top=-2376
Width=750
Heigth=600
nElem=0
[GLOBAL]
LoadCheck=2
SimulateAll=1
[MainWindow]
WindowState=2
Top=-4
Left=-4
Width=1032
Height=748
Update=25000
StopOnError=1
[FindRep]
nTextFind=0
nTextReplace=0
[EditWindow]
Tab=0
nFiles=1
nMRU=9
MarginOn=1
MarginType=2
WindowState=0
Top=0
Left=0
Width=679
Height=418
Files0=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo4\main.c
MRU0=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo4\main.c
Files1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
Files2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo4\Demo4.rep
MRU1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo4\Demo4.rep
Files3=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
Files4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo4\INTERRUPT.C
MRU3=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\integer.c
MRU4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo4\INTERRUPT.C
Files5=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\integer.c
MRU5=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
MRU6=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo4\FreeRTOSConfig.h
MRU7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\flash.c
MRU8=C:\Program Files\FED\PIXIE\Libs\LibCore\Bit16.asm
Files6=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo4\interrupt.c
[PinConnections]
nPins=0
[AssCode]
ProcType=18F4620
[Information]
Column0=-1
Column1=8
Column2=4
Column3=16
Column4=-1
Column5=50
MemoHeight=154
WindowState=0
Top=418
Left=339
Width=339
Height=209
[F29012293]
x=0
y=113
[F28446561]
x=0
y=0
[F20376480]
x=0
y=1205
[F20539803]
x=0
y=256
[F29011781]
x=0
y=118
[F28413281]
x=0
y=0
[F30163230]
x=33
y=61
[F29565054]
x=0
y=0
[F29055566]
x=0
y=137
[F30163742]
x=32
y=44
[F29565566]
x=0
y=0
[F30163486]
x=0
y=0
[F29565310]
x=0
y=0
[F30089258]
x=21
y=70
[F30089514]
x=0
y=107
[F29012549]
x=0
y=111
[F26101515]
x=0
y=269
[F28463201]
x=0
y=0
[F20220814]
x=0
y=423
[F27125515]
x=0
y=0

View file

@ -0,0 +1,82 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ TickRate reduced to 250Hz.
+ configIDLE_SHOULD_YIELD added.
Changes from V3.0.1
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION ( 1 )
#define configUSE_IDLE_HOOK ( 0 )
#define configUSE_TICK_HOOK ( 0 )
#define configTICK_RATE_HZ ( 250 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE
#define configMAX_TASK_NAME_LEN ( 3 )
#define configUSE_TRACE_FACILITY ( 0 )
#define configUSE_16_BIT_TICKS ( 1 )
#define configIDLE_SHOULD_YIELD ( 1 )
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the component, or zero
to exclude the component. */
/* Include/exclude the stated API function. */
#define INCLUDE_vTaskPrioritySet ( 1 )
#define INCLUDE_uxTaskPriorityGet ( 1 )
#define INCLUDE_vTaskDelete ( 0 )
#define INCLUDE_vTaskCleanUpResources ( 0 )
#define INCLUDE_vTaskSuspend ( 1 )
#define INCLUDE_vTaskDelayUntil ( 1 )
#define INCLUDE_vTaskDelay ( 1 )
#endif /* FREERTOS_CONFIG_H */

View file

@ -0,0 +1,41 @@
#ifndef _MALLOC_SETTINGS_H
#define _MALLOC_SETTINGS_H
/*********************************************************************
** Title: Dynamic memory (de-)allocation library for wizC.
**
** Author: Marcel van Lieshout
**
** Copyright: (c) 2005, HMCS, Marcel van Lieshout
**
** License: This software is released to the public domain and comes
** without warranty and/or guarantees of any kind. You have
** the right to use, copy, modify and/or (re-)distribute the
** software as long as the reference to the author is
** maintained in the software and a reference to the author
** is included in any documentation of each product in which
** this library (in it's original or in a modified form)
** is used.
*********************************************************************/
/*********************************************************************
** The model to use
*********************************************************************/
//#define MALLOC_SMALL
#define MALLOC_LARGE
/*********************************************************************
** The size of the heap
*********************************************************************/
#define MALLOC_HEAP_SIZE (3200)
/*********************************************************************
** Should released memory be scribbled with 0x55 before releasing it?
*********************************************************************/
//#define MALLOC_SCRIBBLE
/********************************************************************
** Enable Debug-mode?
*********************************************************************/
//#define MALLOC_DEBUG
#endif /* _MALLOC_SETTINGS_H */

View file

@ -0,0 +1,53 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Several modules predefined to avoid linker problems
Changes from V3.0.1
*/
#ifndef _memcpy
#define _memcpy 1
#endif
#ifndef _memset
#define _memset 1
#endif
#ifndef _strncpy
#define _strncpy 1
#endif
#pragma wizcpp searchpath <../../Common/Include/>

View file

@ -0,0 +1,58 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
** Here are the configuration words set. See the PIC datasheet
** and the wizC manual for an explanation
*/
#include <pic.h>
/*
** These fuses are for PIC18F4620
*/
#pragma __config _CONFIG1H,_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_HSPLL_1H
#pragma __config _CONFIG2L,_BORV_21_2L & _BOREN_SBORDIS_2L & _PWRT_ON_2L
#pragma __config _CONFIG2H,_WDTPS_32768_2H & _WDT_OFF_2H
#pragma __config _CONFIG3H,_MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
#pragma __config _CONFIG4L,_DEBUG_OFF_4L & _XINST_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L
#pragma __config _CONFIG5L,_CP3_OFF_5L & _CP2_OFF_5L & _CP1_OFF_5L & _CP0_OFF_5L
#pragma __config _CONFIG5H,_CPD_OFF_5H & _CPB_OFF_5H
#pragma __config _CONFIG6L,_WRT3_OFF_6L & _WRT2_OFF_6L & _WRT1_OFF_6L & _WRT0_OFF_6L
#pragma __config _CONFIG6H,_WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H
#pragma __config _CONFIG7L,_EBTR3_OFF_7L & _EBTR2_OFF_7L & _EBTR1_OFF_7L & _EBTR0_OFF_7L
#pragma __config _CONFIG7H,_EBTRB_OFF_7H

View file

@ -0,0 +1,118 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*
* Was the interrupt a byte being received?
*/
#include "../Serial/isrSerialRx.c"
/*
* Was the interrupt the Tx register becoming empty?
*/
#include "../Serial/isrSerialTx.c"
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}

View file

@ -0,0 +1,189 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
* Instead of the normal single demo application, the PIC18F demo is split
* into several smaller programs of which this is the fourth. This enables the
* demo's to be executed on the RAM limited PIC-devices.
*
* The Demo4 project is configured for a PIC18F4620 device. Main.c starts 11
* tasks (including the idle task). See the indicated files in the demo/common
* directory for more information.
*
* demo/common/minimal/integer.c: Creates 1 task
* demo/common/minimal/dynamic.c: Creates 5 tasks
* demo/common/minimal/flash.c: Creates 3 tasks
*
* Main.c also creates a check task. This periodically checks that all the
* other tasks are still running and have not experienced any unexpected
* results. If all the other tasks are executing correctly an LED is flashed
* once every mainCHECK_PERIOD milliseconds. If any of the tasks have not
* executed, or report an error, the frequency of the LED flash will increase
* to mainERROR_FLASH_RATE.
*
* On entry to main an 'X' is transmitted. Monitoring the serial port using a
* dumb terminal allows for verification that the device is not continuously
* being reset (no more than one 'X' should be transmitted).
*
* http://www.FreeRTOS.org contains important information on the use of the
* wizC PIC18F port.
*/
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
/* Demo app include files. */
#include "integer.h"
#include "dynamic.h"
#include "flash.h"
#include "partest.h"
#include "serial.h"
/* The period between executions of the check task before and after an error
has been discovered. If an error has been discovered the check task runs
more frequently - increasing the LED flash rate. */
#define mainNO_ERROR_CHECK_PERIOD ( ( portTickType ) 10000 / portTICK_RATE_MS )
#define mainERROR_CHECK_PERIOD ( ( portTickType ) 1000 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( ( unsigned portCHAR ) 3 )
/* Priority definitions for some of the tasks. Other tasks just use the idle
priority. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 3 )
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 2 )
#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 0 )
/* Constants required for the communications. Only one character is ever
transmitted. */
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portCHAR ) 5 )
#define mainNO_BLOCK ( ( portTickType ) 0 )
#define mainBAUD_RATE ( ( unsigned portLONG ) 57600 )
/*
* The task function for the "Check" task.
*/
static portTASK_FUNCTION_PROTO( vErrorChecks, pvParameters );
/*
* Checks the unique counts of other tasks to ensure they are still operational.
* Returns pdTRUE if an error is detected, otherwise pdFALSE.
*/
static portCHAR prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/* Creates the tasks, then starts the scheduler. */
void main( void )
{
/* Initialise the required hardware. */
vParTestInitialise();
/* Send a character so we have some visible feedback of a reset. */
xSerialPortInitMinimal( mainBAUD_RATE, mainCOMMS_QUEUE_LENGTH );
xSerialPutChar( NULL, 'X', mainNO_BLOCK );
/* Start the standard demo tasks found in the demo\common directory. */
vStartIntegerMathTasks( mainINTEGER_PRIORITY);
vStartDynamicPriorityTasks();
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );
/* Start the check task defined in this file. */
xTaskCreate( vErrorChecks, ( const portCHAR * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler. Will never return here. */
vTaskStartScheduler( );
while(1) /* This point should never be reached. */
{
}
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION( vErrorChecks, pvParameters )
{
portTickType xLastCheckTime;
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;
portCHAR cErrorOccurred;
/* We need to initialise xLastCheckTime prior to the first call to
vTaskDelayUntil(). */
xLastCheckTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
/* Wait until it is time to check the other tasks again. */
vTaskDelayUntil( &xLastCheckTime, xDelayTime );
/* Check all the other tasks are running, and running without ever
having an error. */
cErrorOccurred = prvCheckOtherTasksAreStillRunning();
/* If an error was detected increase the frequency of the LED flash. */
if( cErrorOccurred == pdTRUE )
{
xDelayTime = mainERROR_CHECK_PERIOD;
}
/* Flash the LED for visual feedback. */
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portCHAR prvCheckOtherTasksAreStillRunning( void )
{
portCHAR cErrorHasOccurred = ( portCHAR ) pdFALSE;
if( xAreIntegerMathsTaskStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
if( xAreDynamicPriorityTasksStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
return cErrorHasOccurred;
}
/*-----------------------------------------------------------*/

View file

@ -0,0 +1,536 @@
[F29012293]
x=0
y=114
[F10478061]
x=0
y=48
[F15207742]
x=0
y=48
[F28446561]
x=0
y=0
[F30163742]
x=38
y=56
[F29565566]
x=0
y=0
[ProjectGroup]
nFiles=1
FileName0=Demo5.PC
[Project]
nFiles=7
UseAD=0
CompatOpts=0
AutoHead=
IdentifierPrint=0
TreePrint=0
StatementResultPrint=0
SourcePrint=0
spoPrint=0
AsmPrint=0
CaseSens=1
Optimise=45
AProcFreq=40000000
LOptBytes=16
LOptBytesReg=6
TopROM=32767
StackPointer=3839
HeapPointer=3584
HasDoneOptionDialog=1
ASMProcessor=18F4620
UseLinker=0
DEBUGADV=1
Column0=-1
Column1=-1
Column2=259
TabIndex=0
ShowIcons=0
WindowState=0
Top=418
Left=0
Width=339
Height=209
FileType0_Name=main.c
FileType0_FileType=0
FileType0_DoLast=0
FileType1_Name=interrupt.c
FileType1_FileType=0
FileType1_DoLast=0
FileType2_Name=fuses.c
FileType2_FileType=0
FileType2_DoLast=0
FileType3_Name=..\..\Common\Minimal\flop.c
FileType3_FileType=0
FileType3_DoLast=0
FileType4_Name=..\serial\serial.c
FileType4_FileType=0
FileType4_DoLast=0
FileType5_Name=..\ParTest\ParTest.c
FileType5_FileType=0
FileType5_DoLast=0
FileType6_Name=..\..\Common\Minimal\flash.c
FileType6_FileType=0
FileType6_DoLast=0
[Debug]
WindowState=0
Top=0
Left=679
Width=338
Height=626
WinNumberIsIndex0=4097
WinNumberIsIndex1=4096
WinNumberIsIndex2=12
WinNumberIsIndex3=9
WinNumberIsIndex4=8
WinNumberIsIndex5=7
WinNumberIsIndex6=5
WinNumberIsIndex7=4
WinNumberIsIndex8=3
WinNumberIsIndex9=2
WinNumberIsIndex10=1
WinNumberIsIndex11=11
WinNumberIsIndex12=0
nWin=13
HType=0
HFreq=19
ScenixTurbo=1
Watchdog=0
LocalVariables=0
DBPort=3970
DBBit=3
UseICD=0
AutoSet=1
DBVars=3824
DBRate=19200
DBSerPort=1
UsePICKey=2
nTabs=4
Tab0=Main
Tab1=Memory
Tab2=Special
Tab3=History
[Window4097]
aHeight=0
aWidth=0
Height=200
Width=90
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=0
x=10
y=299
Left=43
Top=131
Group=0
Page=-1
[ExtDev4097]
Type=12
TypeN=Pin Out
Pars0=0
Name=Pin Out : 18F4620
FileName=
Layer=1
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars1=0
Pars2=0
[Window4096]
aHeight=0
aWidth=0
Height=121
Width=200
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=10
y=427
Left=43
Top=264
Group=0
Page=-1
[ExtDev4096]
Type=2
TypeN=Terminal
Ports0=0
Bit0=3
ConLev0=-1
Ports1=0
Bit1=2
ConLev1=-1
Pars0=7
Pars1=0
Pars2=0
Name=Terminal
FileName=
Layer=0
[Window12]
aHeight=274
aWidth=732
Height=141
Width=366
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=38
Left=0
Top=100
Group=0
Page=1
[Window9]
aHeight=250
aWidth=250
Height=247
Width=231
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=0
x=98
y=133
Left=49
Top=149
Group=0
Page=15
[Window8]
aHeight=250
aWidth=250
Height=266
Width=283
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=57
y=162
Left=18
Top=164
Group=0
Page=8
[Window7]
aHeight=947
aWidth=978
Height=490
Width=489
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=16
y=45
Left=8
Top=104
Group=0
Page=3
[Window5]
aHeight=955
aWidth=490
Height=494
Width=161
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=504
y=42
Left=166
Top=102
Group=0
Page=2
[Window4]
aHeight=957
aWidth=966
Height=495
Width=318
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=3
y=38
Left=0
Top=100
Group=0
Page=2
[Window3]
aHeight=191
aWidth=985
Height=98
Width=325
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=12
y=428
Left=3
Top=302
Group=0
Page=7
[Window2]
aHeight=1000
aWidth=538
Height=518
Width=177
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=462
y=0
Left=152
Top=81
Group=0
Page=4
[Window1]
aHeight=270
aWidth=998
Height=139
Width=329
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=332
Left=0
Top=252
Group=0
Page=1
[Window11]
aHeight=335
aWidth=845
Height=173
Width=278
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=148
y=638
Left=48
Top=411
Group=0
Page=9
[Window0]
aHeight=472
aWidth=558
Height=244
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=418
y=189
Left=137
Top=178
Group=0
Page=1
[APPWIZ]
AProcFreq=4000000
nUserTemp=0
Proc=16F84
Left=-72
Top=-3664
Width=750
Heigth=600
nElem=0
[GLOBAL]
LoadCheck=2
SimulateAll=1
[MainWindow]
WindowState=2
Top=-4
Left=-4
Width=1032
Height=748
Update=25000
StopOnError=1
[FindRep]
nTextFind=0
nTextReplace=0
[EditWindow]
Tab=0
nFiles=1
nMRU=9
MarginOn=1
MarginType=2
WindowState=0
Top=0
Left=0
Width=679
Height=418
Files0=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo5\main.c
MRU0=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo5\main.c
Files1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
Files2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo5\Demo5.rep
Files3=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo5\INTERRUPT.C
MRU2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo5\Demo5.rep
MRU3=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\flop.c
Files4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\flop.c
MRU4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo5\INTERRUPT.C
Files5=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Drivers\Tick\isrTick.c
Files6=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialRx.c
MRU5=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
MRU6=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialTx.c
MRU7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo5\Demo5.LST
MRU8=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialRx.c
Files7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialTx.c
Files8=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
Files9=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo5\Demo5.LST
Files10=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Drivers\Tick\isrTick.c
Files11=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialRx.c
Files12=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialTx.c
Files13=C:\DOCUMENTS AND SETTINGS\MARCEL\MY DOCUMENTS\PIC\FREERTOS\FREERTOS\DEMO\PIC18_WIZC\DEMO5\INTERRUPT_pp.asm
Files14=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Drivers\Tick\Tick.c
Files15=C:\PROGRAM FILES\FED\PIXIE\LIBS\LIBSUSER\LIBFREERTOS\MODULES\TASKS_pp.asm
Files16=C:\DOCUMENTS AND SETTINGS\MARCEL\MY DOCUMENTS\PIC\FREERTOS\FREERTOS\DEMO\PIC18_WIZC\SERIAL\SERIAL_pp.asm
[PinConnections]
nPins=0
[AssCode]
ProcType=18F4620
[Information]
Column0=-1
Column1=8
Column2=4
Column3=16
Column4=-1
Column5=50
MemoHeight=154
WindowState=0
Top=418
Left=339
Width=339
Height=209
[F29012549]
x=0
y=110
[F26101515]
x=0
y=117
[F30427679]
x=0
y=46
[F30089770]
x=0
y=107
[F30243677]
x=0
y=4706
[F28463201]
x=40
y=52
[F20539803]
x=0
y=267
[F30163998]
x=34
y=45
[F29565822]
x=2
y=23
[F20121086]
x=0
y=65
[F20376480]
x=0
y=1222
[F29011525]
x=0
y=145
[F28396641]
x=10
y=9
[F29012805]
x=0
y=111
[F30090026]
x=43
y=55
[F28479841]
x=0
y=51
[F27125515]
x=33
y=70
[F20009642]
x=22
y=34
[F29227302]
x=0
y=6009
[F30394911]
x=0
y=46
[F30164866]
x=0
y=4525
[F20009002]
x=0
y=0
[F20414028]
x=0
y=6994
[F29471871]
x=0
y=5044
[F20558577]
x=0
y=4660
[F29453097]
x=0
y=54
[F20127774]
x=8
y=62
[F29801853]
x=29
y=76
[F29801821]
x=4
y=84
[F20220814]
x=0
y=536
[F20122654]
x=0
y=44
[F29801181]
x=0
y=51
[F29801213]
x=0
y=56
[F10825025]
x=0
y=47
[F15679330]
x=0
y=36
[F28463239]
x=29
y=1526

View file

@ -0,0 +1,82 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ TickRate reduced to 250Hz.
+ configIDLE_SHOULD_YIELD added.
Changes from V3.0.1
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION ( 1 )
#define configUSE_IDLE_HOOK ( 0 )
#define configUSE_TICK_HOOK ( 0 )
#define configTICK_RATE_HZ ( 250 )
#define configMAX_PRIORITIES ( 3 )
#define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE
#define configMAX_TASK_NAME_LEN ( 3 )
#define configUSE_TRACE_FACILITY ( 0 )
#define configUSE_16_BIT_TICKS ( 1 )
#define configIDLE_SHOULD_YIELD ( 1 )
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the component, or zero
to exclude the component. */
/* Include/exclude the stated API function. */
#define INCLUDE_vTaskPrioritySet ( 0 )
#define INCLUDE_uxTaskPriorityGet ( 0 )
#define INCLUDE_vTaskDelete ( 0 )
#define INCLUDE_vTaskCleanUpResources ( 0 )
#define INCLUDE_vTaskSuspend ( 0 )
#define INCLUDE_vTaskDelayUntil ( 1 )
#define INCLUDE_vTaskDelay ( 0 )
#endif /* FREERTOS_CONFIG_H */

View file

@ -0,0 +1,41 @@
#ifndef _MALLOC_SETTINGS_H
#define _MALLOC_SETTINGS_H
/*********************************************************************
** Title: Dynamic memory (de-)allocation library for wizC.
**
** Author: Marcel van Lieshout
**
** Copyright: (c) 2005, HMCS, Marcel van Lieshout
**
** License: This software is released to the public domain and comes
** without warranty and/or guarantees of any kind. You have
** the right to use, copy, modify and/or (re-)distribute the
** software as long as the reference to the author is
** maintained in the software and a reference to the author
** is included in any documentation of each product in which
** this library (in it's original or in a modified form)
** is used.
*********************************************************************/
/*********************************************************************
** The model to use
*********************************************************************/
//#define MALLOC_SMALL
#define MALLOC_LARGE
/*********************************************************************
** The size of the heap
*********************************************************************/
#define MALLOC_HEAP_SIZE (3200)
/*********************************************************************
** Should released memory be scribbled with 0x55 before releasing it?
*********************************************************************/
//#define MALLOC_SCRIBBLE
/********************************************************************
** Enable Debug-mode?
*********************************************************************/
//#define MALLOC_DEBUG
#endif /* _MALLOC_SETTINGS_H */

View file

@ -0,0 +1,53 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Several modules predefined to avoid linker problems
Changes from V3.0.1
*/
#ifndef _memcpy
#define _memcpy 1
#endif
#ifndef _memset
#define _memset 1
#endif
#ifndef _strncpy
#define _strncpy 1
#endif
#pragma wizcpp searchpath <../../Common/Include/>

View file

@ -0,0 +1,58 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
** Here are the configuration words set. See the PIC datasheet
** and the wizC manual for an explanation
*/
#include <pic.h>
/*
** These fuses are for PIC18F4620
*/
#pragma __config _CONFIG1H,_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_HSPLL_1H
#pragma __config _CONFIG2L,_BORV_21_2L & _BOREN_SBORDIS_2L & _PWRT_ON_2L
#pragma __config _CONFIG2H,_WDTPS_32768_2H & _WDT_OFF_2H
#pragma __config _CONFIG3H,_MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
#pragma __config _CONFIG4L,_DEBUG_OFF_4L & _XINST_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L
#pragma __config _CONFIG5L,_CP3_OFF_5L & _CP2_OFF_5L & _CP1_OFF_5L & _CP0_OFF_5L
#pragma __config _CONFIG5H,_CPD_OFF_5H & _CPB_OFF_5H
#pragma __config _CONFIG6L,_WRT3_OFF_6L & _WRT2_OFF_6L & _WRT1_OFF_6L & _WRT0_OFF_6L
#pragma __config _CONFIG6H,_WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H
#pragma __config _CONFIG7L,_EBTR3_OFF_7L & _EBTR2_OFF_7L & _EBTR1_OFF_7L & _EBTR0_OFF_7L
#pragma __config _CONFIG7H,_EBTRB_OFF_7H

View file

@ -0,0 +1,118 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*
* Was the interrupt a byte being received?
*/
#include "../Serial/isrSerialRx.c"
/*
* Was the interrupt the Tx register becoming empty?
*/
#include "../Serial/isrSerialTx.c"
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}

View file

@ -0,0 +1,178 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
* Instead of the normal single demo application, the PIC18F demo is split
* into several smaller programs of which this is the fifth. This enables the
* demo's to be executed on the RAM limited PIC-devices.
*
* The Demo5 project is configured for a PIC18F4620 device. Main.c starts 13
* tasks (including the idle task). See the indicated files in the demo/common
* directory for more information.
*
* demo/common/minimal/flop.c: Creates 8 tasks
* demo/common/minimal/flash.c: Creates 3 tasks
*
* Main.c also creates a check task. This periodically checks that all the
* other tasks are still running and have not experienced any unexpected
* results. If all the other tasks are executing correctly an LED is flashed
* once every mainCHECK_PERIOD milliseconds. If any of the tasks have not
* executed, or report an error, the frequency of the LED flash will increase
* to mainERROR_FLASH_RATE.
*
* On entry to main an 'X' is transmitted. Monitoring the serial port using a
* dumb terminal allows for verification that the device is not continuously
* being reset (no more than one 'X' should be transmitted).
*
* http://www.FreeRTOS.org contains important information on the use of the
* wizC PIC18F port.
*/
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
/* Demo app include files. */
#include "flop.h"
#include "flash.h"
#include "partest.h"
#include "serial.h"
/* The period between executions of the check task before and after an error
has been discovered. If an error has been discovered the check task runs
more frequently - increasing the LED flash rate. */
#define mainNO_ERROR_CHECK_PERIOD ( ( portTickType ) 10000 / portTICK_RATE_MS )
#define mainERROR_CHECK_PERIOD ( ( portTickType ) 1000 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( ( unsigned portCHAR ) 3 )
/* Priority definitions for some of the tasks. Other tasks just use the idle
priority. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 2 )
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 1 )
/* Constants required for the communications. Only one character is ever
transmitted. */
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portCHAR ) 5 )
#define mainNO_BLOCK ( ( portTickType ) 0 )
#define mainBAUD_RATE ( ( unsigned portLONG ) 57600 )
/*
* The task function for the "Check" task.
*/
static portTASK_FUNCTION_PROTO( vErrorChecks, pvParameters );
/*
* Checks the unique counts of other tasks to ensure they are still operational.
* Returns pdTRUE if an error is detected, otherwise pdFALSE.
*/
static portCHAR prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/* Creates the tasks, then starts the scheduler. */
void main( void )
{
/* Initialise the required hardware. */
vParTestInitialise();
/* Send a character so we have some visible feedback of a reset. */
xSerialPortInitMinimal( mainBAUD_RATE, mainCOMMS_QUEUE_LENGTH );
xSerialPutChar( NULL, 'X', mainNO_BLOCK );
/* Start a few of the standard demo tasks found in the demo\common directory. */
vStartMathTasks( tskIDLE_PRIORITY );
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );
/* Start the check task defined in this file. */
xTaskCreate( vErrorChecks, ( const portCHAR * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler. Will never return here. */
vTaskStartScheduler();
while(1) /* This point should never be reached. */
{
}
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION( vErrorChecks, pvParameters )
{
portTickType xLastCheckTime;
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;
portCHAR cErrorOccurred;
/* We need to initialise xLastCheckTime prior to the first call to
vTaskDelayUntil(). */
xLastCheckTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
/* Wait until it is time to check the other tasks again. */
vTaskDelayUntil( &xLastCheckTime, xDelayTime );
/* Check all the other tasks are running, and running without ever
having an error. */
cErrorOccurred = prvCheckOtherTasksAreStillRunning();
/* If an error was detected increase the frequency of the LED flash. */
if( cErrorOccurred == pdTRUE )
{
xDelayTime = mainERROR_CHECK_PERIOD;
}
/* Flash the LED for visual feedback. */
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portCHAR prvCheckOtherTasksAreStillRunning( void )
{
portCHAR cErrorHasOccurred = ( portCHAR ) pdFALSE;
if( xAreMathsTaskStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
return cErrorHasOccurred;
}
/*-----------------------------------------------------------*/

View file

@ -0,0 +1,632 @@
[F29012549]
x=0
y=111
[F15207742]
x=0
y=48
[F28463201]
x=0
y=0
[F30163998]
x=60
y=44
[F29565822]
x=2
y=23
[F26101515]
x=0
y=269
[ProjectGroup]
nFiles=1
FileName0=Demo6.PC
[Project]
nFiles=6
UseAD=0
CompatOpts=0
AutoHead=
IdentifierPrint=0
TreePrint=0
StatementResultPrint=0
SourcePrint=0
spoPrint=0
AsmPrint=0
CaseSens=1
Optimise=45
AProcFreq=40000000
LOptBytes=16
LOptBytesReg=6
TopROM=32767
StackPointer=3839
HeapPointer=3584
HasDoneOptionDialog=1
ASMProcessor=18F4620
UseLinker=0
DEBUGADV=1
Column0=-1
Column1=-1
Column2=258
TabIndex=0
ShowIcons=0
WindowState=0
Top=418
Left=0
Width=339
Height=209
FileType0_Name=main.c
FileType0_FileType=0
FileType0_DoLast=0
FileType1_Name=interrupt.c
FileType1_FileType=0
FileType1_DoLast=0
FileType2_Name=fuses.c
FileType2_FileType=0
FileType2_DoLast=0
FileType3_Name=..\..\Common\Minimal\comtest.c
FileType3_FileType=0
FileType3_DoLast=0
FileType4_Name=..\serial\serial.c
FileType4_FileType=0
FileType4_DoLast=0
FileType5_Name=..\ParTest\ParTest.c
FileType5_FileType=0
FileType5_DoLast=0
[Debug]
WindowState=0
Top=0
Left=679
Width=338
Height=626
WinNumberIsIndex0=4097
WinNumberIsIndex1=4096
WinNumberIsIndex2=12
WinNumberIsIndex3=9
WinNumberIsIndex4=8
WinNumberIsIndex5=7
WinNumberIsIndex6=5
WinNumberIsIndex7=4
WinNumberIsIndex8=3
WinNumberIsIndex9=2
WinNumberIsIndex10=1
WinNumberIsIndex11=11
WinNumberIsIndex12=0
nWin=13
HType=0
HFreq=19
ScenixTurbo=1
Watchdog=0
LocalVariables=0
DBPort=3970
DBBit=3
UseICD=0
AutoSet=1
DBVars=3824
DBRate=19200
DBSerPort=4
UsePICKey=2
nTabs=4
Tab0=Main
Tab1=Memory
Tab2=Special
Tab3=History
WinNumberIsIndex13=0
WinNumberIsIndex14=0
LocalVariablesTop=31
LocalVariablesLeft=681
[Window4097]
aHeight=0
aWidth=0
Height=121
Width=200
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=10
y=299
Left=0
Top=157
Group=0
Page=-1
[ExtDev4097]
Type=2
TypeN=Terminal
Pars0=10
Name=Terminal
FileName=
Layer=0
Ports0=2
Bit0=6
ConLev0=-1
Ports1=2
Bit1=7
ConLev1=-1
Pars1=0
Pars2=0
[Window4096]
aHeight=0
aWidth=0
Height=200
Width=90
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=0
x=10
y=299
Left=43
Top=131
Group=0
Page=-1
[ExtDev4096]
Type=12
TypeN=Pin Out
Ports0=2
Bit0=6
ConLev0=-1
Ports1=2
Bit1=7
ConLev1=-1
Pars0=0
Pars1=0
Pars2=0
Name=Pin Out : 18F4620
FileName=
Layer=1
ConPars0_0=1
[Window12]
aHeight=274
aWidth=732
Height=141
Width=241
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=38
Left=0
Top=100
Group=0
Page=1
[Window9]
aHeight=250
aWidth=250
Height=247
Width=231
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=0
x=98
y=133
Left=49
Top=149
Group=0
Page=15
[Window8]
aHeight=250
aWidth=250
Height=266
Width=283
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=139
y=0
Left=45
Top=81
Group=0
Page=8
[Window7]
aHeight=947
aWidth=978
Height=490
Width=322
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=16
y=45
Left=5
Top=104
Group=0
Page=3
[Window5]
aHeight=955
aWidth=490
Height=494
Width=161
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=504
y=42
Left=166
Top=102
Group=0
Page=2
[Window4]
aHeight=766
aWidth=1000
Height=396
Width=330
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=0
Left=0
Top=81
Group=0
Page=2
[Window3]
aHeight=306
aWidth=985
Height=158
Width=325
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=577
Left=0
Top=379
Group=0
Page=7
[Window2]
aHeight=1000
aWidth=538
Height=518
Width=177
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=462
y=0
Left=152
Top=81
Group=0
Page=4
[Window1]
aHeight=283
aWidth=998
Height=146
Width=329
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=714
Left=0
Top=450
Group=0
Page=1
[Window11]
aHeight=335
aWidth=560
Height=173
Width=184
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=200
y=666
Left=66
Top=425
Group=0
Page=11
[Window0]
aHeight=550
aWidth=930
Height=284
Width=306
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=9
y=73
Left=2
Top=118
Group=0
Page=1
[APPWIZ]
AProcFreq=4000000
nUserTemp=0
Proc=16F84
Left=-92
Top=-4584
Width=750
Heigth=600
nElem=0
[GLOBAL]
LoadCheck=2
SimulateAll=1
[MainWindow]
WindowState=2
Top=-4
Left=-4
Width=1032
Height=748
Update=25000
StopOnError=1
[FindRep]
nTextFind=4
nTextReplace=0
TextFind0=USERisrs
TextFind1=spbrg16
TextFind2=xSerialPortInitMinimal
TextFind3=bgie
[EditWindow]
Tab=0
nFiles=1
nMRU=9
MarginOn=1
MarginType=2
WindowState=0
Top=0
Left=0
Width=679
Height=418
Files0=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo6\main.c
MRU0=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo6\main.c
Files1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
Files2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo6\Demo6.rep
MRU2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo6\Demo6.rep
Files3=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\serial\serial.c
MRU3=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Tasks.c
MRU4=C:\Program Files\FED\PIXIE\Libs\LibsUser\FreeRTOS.h
MRU5=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Port.c
MRU6=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
MRU7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialTx.c
Files4=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
MRU8=C:\DOCUMENTS AND SETTINGS\MARCEL\MY DOCUMENTS\PIC\FREERTOS\FREERTOS\DEMO\PIC18_WIZC\DEMO6\INTERRUPT_pp.asm
Files5=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Drivers\Tick\isrTick.c
Files6=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Modules\Port.c
Files7=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo6\interrupt.c
Files8=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialRx.c
Files9=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrSerialTx.c
Files10=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo6\FreeRTOSConfig.h
Files11=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\ParTest\ParTest.c
Files12=C:\DOCUMENTS AND SETTINGS\MARCEL\MY DOCUMENTS\PIC\FREERTOS\FREERTOS\DEMO\PIC18_WIZC\DEMO6\INTERRUPT_pp.asm
Files13=C:\DOCUMENTS AND SETTINGS\MARCEL\MY DOCUMENTS\PIC\FREERTOS\FREERTOS\DEMO\PIC18_WIZC\SERIAL\SERIAL_pp.asm
Files14=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Tasks.c
Files15=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\tasks.c
Files16=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\tasks.c
Files17=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\port.c
Files18=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBMALLOC\Malloc.c
Files19=C:\PROGRAM FILES\FED\PIXIE\Libs\LIBSTRINGS\STRINGS16.C
[PinConnections]
nPins=0
[AssCode]
ProcType=18F4620
[Information]
Column0=-1
Column1=8
Column2=4
Column3=16
Column4=-1
Column5=50
MemoHeight=154
WindowState=0
Top=418
Left=339
Width=339
Height=209
[F29012805]
x=0
y=110
[F29217358]
x=0
y=163
[F30243933]
x=0
y=4673
[F29217125]
x=17
y=37
[F30827659]
x=0
y=4704
[F20376480]
x=0
y=1329
[F30164254]
x=57
y=45
[F29566078]
x=30
y=28
[Window4098]
aHeight=0
aWidth=0
Height=38
Width=25
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=1
x=10
y=299
Left=13
Top=137
Group=0
Page=-1
[ExtDev4098]
Type=4
TypeN=PushButton
Ports0=2
Bit0=6
ConLev0=-1
ConPars0_0=1
Ports1=2
Bit1=7
ConLev1=-1
Pars0=0
Pars1=1
Name=PushButton
FileName=
Layer=0
Pars2=0
[F28479841]
x=0
y=78
[F30090026]
x=13
y=50
[F29453097]
x=0
y=144
[F20121086]
x=23
y=71
[F20258362]
x=0
y=7159
[F20414028]
x=0
y=6113
[F10478061]
x=0
y=48
[F29011525]
x=0
y=145
[F28396641]
x=10
y=9
[F30162974]
x=0
y=0
[F29564798]
x=30
y=28
[F30146592]
x=0
y=59
[F20220814]
x=0
y=497
[F20539803]
x=0
y=228
[F15568046]
x=1
y=293
[Window4099]
aHeight=0
aWidth=0
Height=38
Width=25
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=1
x=10
y=299
Left=13
Top=137
Group=0
Page=-1
[ExtDev4099]
Type=4
TypeN=PushButton
Ports0=2
Bit0=6
ConLev0=-1
ConPars0_0=1
Ports1=2
Bit1=7
ConLev1=-1
Pars0=0
Pars1=1
Name=PushButton
FileName=
Layer=0
[F15679330]
x=0
y=112
[F30165122]
x=0
y=4469
[F30427679]
x=0
y=46
[F30394911]
x=0
y=0
[F20441499]
x=0
y=0
[F29730335]
x=0
y=78
[F24752775]
x=40
y=52
[F24752903]
x=40
y=52
[F29013061]
x=0
y=113
[F27123467]
x=55
y=67
[F28496481]
x=8
y=29
[F20528681]
x=18
y=94
[F28479879]
x=49
y=2522
[F28931976]
x=0
y=0
[F29801213]
x=24
y=36
[F29801181]
x=24
y=36
[F24754146]
x=0
y=0
[F20122654]
x=0
y=44
[F20558577]
x=6
y=5403
[F29471871]
x=13
y=4972
[F15787712]
x=0
y=47

View file

@ -0,0 +1,82 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ TickRate reduced to 250Hz.
+ configIDLE_SHOULD_YIELD added.
Changes from V3.0.1
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION ( 1 )
#define configUSE_IDLE_HOOK ( 0 )
#define configUSE_TICK_HOOK ( 0 )
#define configTICK_RATE_HZ ( 250 )
#define configMAX_PRIORITIES ( 3 )
#define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE
#define configMAX_TASK_NAME_LEN ( 3 )
#define configUSE_TRACE_FACILITY ( 0 )
#define configUSE_16_BIT_TICKS ( 1 )
#define configIDLE_SHOULD_YIELD ( 1 )
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the component, or zero
to exclude the component. */
/* Include/exclude the stated API function. */
#define INCLUDE_vTaskPrioritySet ( 0 )
#define INCLUDE_uxTaskPriorityGet ( 0 )
#define INCLUDE_vTaskDelete ( 0 )
#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,41 @@
#ifndef _MALLOC_SETTINGS_H
#define _MALLOC_SETTINGS_H
/*********************************************************************
** Title: Dynamic memory (de-)allocation library for wizC.
**
** Author: Marcel van Lieshout
**
** Copyright: (c) 2005, HMCS, Marcel van Lieshout
**
** License: This software is released to the public domain and comes
** without warranty and/or guarantees of any kind. You have
** the right to use, copy, modify and/or (re-)distribute the
** software as long as the reference to the author is
** maintained in the software and a reference to the author
** is included in any documentation of each product in which
** this library (in it's original or in a modified form)
** is used.
*********************************************************************/
/*********************************************************************
** The model to use
*********************************************************************/
//#define MALLOC_SMALL
#define MALLOC_LARGE
/*********************************************************************
** The size of the heap
*********************************************************************/
#define MALLOC_HEAP_SIZE (3200)
/*********************************************************************
** Should released memory be scribbled with 0x55 before releasing it?
*********************************************************************/
//#define MALLOC_SCRIBBLE
/********************************************************************
** Enable Debug-mode?
*********************************************************************/
//#define MALLOC_DEBUG
#endif /* _MALLOC_SETTINGS_H */

View file

@ -0,0 +1,53 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Several modules predefined to avoid linker problems
Changes from V3.0.1
*/
#ifndef _memcpy
#define _memcpy 1
#endif
#ifndef _memset
#define _memset 1
#endif
#ifndef _strncpy
#define _strncpy 1
#endif
#pragma wizcpp searchpath <../../Common/Include/>

View file

@ -0,0 +1,58 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
** Here are the configuration words set. See the PIC datasheet
** and the wizC manual for an explanation
*/
#include <pic.h>
/*
** These fuses are for PIC18F4620
*/
#pragma __config _CONFIG1H,_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_HSPLL_1H
#pragma __config _CONFIG2L,_BORV_21_2L & _BOREN_SBORDIS_2L & _PWRT_ON_2L
#pragma __config _CONFIG2H,_WDTPS_32768_2H & _WDT_OFF_2H
#pragma __config _CONFIG3H,_MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
#pragma __config _CONFIG4L,_DEBUG_OFF_4L & _XINST_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L
#pragma __config _CONFIG5L,_CP3_OFF_5L & _CP2_OFF_5L & _CP1_OFF_5L & _CP0_OFF_5L
#pragma __config _CONFIG5H,_CPD_OFF_5H & _CPB_OFF_5H
#pragma __config _CONFIG6L,_WRT3_OFF_6L & _WRT2_OFF_6L & _WRT1_OFF_6L & _WRT0_OFF_6L
#pragma __config _CONFIG6H,_WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H
#pragma __config _CONFIG7L,_EBTR3_OFF_7L & _EBTR2_OFF_7L & _EBTR1_OFF_7L & _EBTR0_OFF_7L
#pragma __config _CONFIG7H,_EBTRB_OFF_7H

View file

@ -0,0 +1,118 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*
* Was the interrupt a byte being received?
*/
#include "../Serial/isrSerialRx.c"
/*
* Was the interrupt the Tx register becoming empty?
*/
#include "../Serial/isrSerialTx.c"
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}

View file

@ -0,0 +1,170 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
* Instead of the normal single demo application, the PIC18F demo is split
* into several smaller programs of which this is the sixth. This enables the
* demo's to be executed on the RAM limited PIC-devices.
*
* The Demo6 project is configured for a PIC18F4620 device. Main.c starts 4
* tasks (including the idle task). See the indicated files in the demo/common
* directory for more information.
*
* demo/common/minimal/comtest.c: Creates 2 tasks
* ATTENTION: Comtest needs a loopback-connector on the serial port.
*
* Main.c also creates a check task. This periodically checks that all the
* other tasks are still running and have not experienced any unexpected
* results. If all the other tasks are executing correctly an LED is flashed
* once every mainCHECK_PERIOD milliseconds. If any of the tasks have not
* executed, or report an error, the frequency of the LED flash will increase
* to mainERROR_FLASH_RATE.
*
* http://www.FreeRTOS.org contains important information on the use of the
* wizC PIC18F port.
*/
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
/* Demo app include files. */
#include "partest.h"
#include "serial.h"
#include "comtest.h"
/* The period between executions of the check task before and after an error
has been discovered. If an error has been discovered the check task runs
more frequently - increasing the LED flash rate. */
#define mainNO_ERROR_CHECK_PERIOD ( ( portTickType ) 10000 / portTICK_RATE_MS )
#define mainERROR_CHECK_PERIOD ( ( portTickType ) 1000 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( ( unsigned portCHAR ) 3 )
/* Priority definitions for some of the tasks. Other tasks just use the idle
priority. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 2 )
#define mainCOMM_TEST_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 1 )
/* The LED that is toggled whenever a character is transmitted.
mainCOMM_TX_RX_LED + 1 will be toggled every time a character is received. */
#define mainCOMM_TX_RX_LED ( ( unsigned portCHAR ) 0 )
/* Constants required for the communications. */
#define mainBAUD_RATE ( ( unsigned portLONG ) 57600 )
/*
* The task function for the "Check" task.
*/
static portTASK_FUNCTION_PROTO( vErrorChecks, pvParameters );
/*
* Checks the unique counts of other tasks to ensure they are still operational.
* Returns pdTRUE if an error is detected, otherwise pdFALSE.
*/
static portCHAR prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/* Creates the tasks, then starts the scheduler. */
void main( void )
{
/* Initialise the required hardware. */
vParTestInitialise();
/* Start a few of the standard demo tasks found in the demo\common directory. */
vAltStartComTestTasks( mainCOMM_TEST_PRIORITY, mainBAUD_RATE, mainCOMM_TX_RX_LED );
/* Start the check task defined in this file. */
xTaskCreate( vErrorChecks, ( const portCHAR * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* Start the scheduler. Will never return here. */
vTaskStartScheduler();
while(1) /* This point should never be reached. */
{
}
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION( vErrorChecks, pvParameters )
{
portTickType xLastCheckTime;
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;
portCHAR cErrorOccurred;
/* We need to initialise xLastCheckTime prior to the first call to
vTaskDelayUntil(). */
xLastCheckTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
/* Wait until it is time to check the other tasks again. */
vTaskDelayUntil( &xLastCheckTime, xDelayTime );
/* Check all the other tasks are running, and running without ever
having an error. */
cErrorOccurred = prvCheckOtherTasksAreStillRunning();
/* If an error was detected increase the frequency of the LED flash. */
if( cErrorOccurred == pdTRUE )
{
xDelayTime = mainERROR_CHECK_PERIOD;
}
/* Flash the LED for visual feedback. */
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portCHAR prvCheckOtherTasksAreStillRunning( void )
{
portCHAR cErrorHasOccurred = ( portCHAR ) pdFALSE;
if( xAreComTestTasksStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
return cErrorHasOccurred;
}
/*-----------------------------------------------------------*/

View file

@ -0,0 +1,546 @@
[F29012549]
x=0
y=111
[F15207742]
x=0
y=48
[F26101515]
x=0
y=269
[F28463201]
x=0
y=0
[F20539803]
x=0
y=233
[ProjectGroup]
nFiles=1
FileName0=Demo7.PC
[Project]
nFiles=7
UseAD=0
CompatOpts=0
AutoHead=
IdentifierPrint=0
TreePrint=0
StatementResultPrint=0
SourcePrint=0
spoPrint=0
AsmPrint=0
CaseSens=1
Optimise=45
AProcFreq=40000000
LOptBytes=16
LOptBytesReg=6
TopROM=32767
StackPointer=3839
HeapPointer=3584
HasDoneOptionDialog=1
ASMProcessor=18F4620
UseLinker=0
DEBUGADV=1
Column0=-1
Column1=-1
Column2=259
TabIndex=0
ShowIcons=0
WindowState=0
Top=418
Left=0
Width=339
Height=209
FileType0_Name=main.c
FileType0_FileType=0
FileType0_DoLast=0
FileType1_Name=interrupt.c
FileType1_FileType=0
FileType1_DoLast=0
FileType2_Name=fuses.c
FileType2_FileType=0
FileType2_DoLast=0
FileType3_Name=..\..\Common\Minimal\death.c
FileType3_FileType=0
FileType3_DoLast=0
FileType4_Name=..\..\Common\Minimal\flash.c
FileType4_FileType=0
FileType4_DoLast=0
FileType5_Name=..\serial\serial.c
FileType5_FileType=0
FileType5_DoLast=0
FileType6_Name=..\ParTest\ParTest.c
FileType6_FileType=0
FileType6_DoLast=0
[Debug]
WindowState=0
Top=0
Left=679
Width=338
Height=626
WinNumberIsIndex0=4097
WinNumberIsIndex1=4096
WinNumberIsIndex2=12
WinNumberIsIndex3=9
WinNumberIsIndex4=8
WinNumberIsIndex5=7
WinNumberIsIndex6=5
WinNumberIsIndex7=4
WinNumberIsIndex8=3
WinNumberIsIndex9=2
WinNumberIsIndex10=1
WinNumberIsIndex11=11
WinNumberIsIndex12=0
nWin=13
HType=0
HFreq=1
ScenixTurbo=1
Watchdog=0
LocalVariables=0
DBPort=3970
DBBit=3
UseICD=0
AutoSet=1
DBVars=3824
DBRate=19200
DBSerPort=4
UsePICKey=2
nTabs=4
Tab0=Main
Tab1=Memory
Tab2=Special
Tab3=History
LocalVariablesTop=48
LocalVariablesLeft=615
[Window4097]
aHeight=0
aWidth=0
Height=200
Width=90
isMinimised=0
isVisible=1
ShowBorder=0
ShowCaption=0
Sizeable=0
x=10
y=299
Left=43
Top=131
Group=0
Page=-1
[ExtDev4097]
Type=12
TypeN=Pin Out
Pars0=0
Name=Pin Out : 18F4620
FileName=
Layer=1
Ports0=2
Bit0=6
ConLev0=-1
Ports1=2
Bit1=7
ConLev1=-1
Pars1=0
Pars2=0
[Window4096]
aHeight=0
aWidth=0
Height=121
Width=200
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=10
y=427
Left=127
Top=181
Group=0
Page=-1
[ExtDev4096]
Type=2
TypeN=Terminal
Ports0=2
Bit0=6
ConLev0=-1
Ports1=2
Bit1=7
ConLev1=-1
Pars0=7
Pars1=0
Pars2=0
Name=Terminal
FileName=
Layer=0
[Window12]
aHeight=274
aWidth=732
Height=141
Width=366
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=38
Left=0
Top=100
Group=0
Page=1
[Window9]
aHeight=250
aWidth=250
Height=247
Width=231
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=0
x=98
y=133
Left=49
Top=149
Group=0
Page=15
[Window8]
aHeight=250
aWidth=250
Height=455
Width=489
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=1
Left=-159
Top=81
Group=0
Page=8
[Window7]
aHeight=947
aWidth=978
Height=490
Width=489
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=16
y=45
Left=8
Top=104
Group=0
Page=3
[Window5]
aHeight=955
aWidth=490
Height=494
Width=161
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=504
y=42
Left=166
Top=102
Group=0
Page=2
[Window4]
aHeight=957
aWidth=839
Height=495
Width=276
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=2
y=40
Left=0
Top=101
Group=0
Page=2
[Window3]
aHeight=191
aWidth=985
Height=98
Width=325
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=0
y=666
Left=0
Top=425
Group=0
Page=7
[Window2]
aHeight=1000
aWidth=538
Height=518
Width=177
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=462
y=0
Left=152
Top=81
Group=0
Page=4
[Window1]
aHeight=357
aWidth=998
Height=184
Width=329
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=2
y=644
Left=0
Top=414
Group=0
Page=1
[Window11]
aHeight=335
aWidth=821
Height=173
Width=270
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=72
y=571
Left=23
Top=376
Group=0
Page=9
[Window0]
aHeight=472
aWidth=558
Height=244
Width=279
isMinimised=1
isVisible=1
ShowBorder=1
ShowCaption=1
Sizeable=1
x=438
y=42
Left=219
Top=102
Group=0
Page=1
[APPWIZ]
AProcFreq=4000000
nUserTemp=0
Proc=16F84
Left=-72
Top=-3664
Width=750
Heigth=600
nElem=0
[GLOBAL]
LoadCheck=2
SimulateAll=1
[MainWindow]
WindowState=2
Top=-4
Left=-4
Width=1032
Height=748
Update=25000
StopOnError=1
[FindRep]
nTextFind=2
nTextReplace=0
TextFind0=vTaskStartScheduler
TextFind1=switch
[EditWindow]
Tab=0
nFiles=1
nMRU=9
MarginOn=1
MarginType=2
WindowState=0
Top=0
Left=0
Width=680
Height=418
Files0=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo7\main.c
MRU0=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo7\main.c
Files1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
Files2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo7\Demo7.rep
MRU1=C:\PROGRA~1\FED\PIXIE\Libs\LibCore\Bit16.asm
MRU2=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo7\Demo7.rep
Files3=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Tasks.c
MRU3=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Tasks.c
Files4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo7\INTERRUPT.C
Files5=C:\PROGRAM FILES\FED\PIXIE\LIBS\LIBSUSER\LIBFREERTOS\MODULES\LIST_pp.asm
MRU4=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\Demo7\INTERRUPT.C
MRU5=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\ParTest\ParTest.c
Files6=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Tasks.c
MRU6=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo7\Demo7.LST
Files7=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Port.c
Files8=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Drivers\Tick\Tick.c
MRU7=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\death.c
MRU8=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\flash.c
Files9=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\ParTest\ParTest.c
Files10=C:\PROGRAM FILES\FED\PIXIE\LIBS\LIBSUSER\LIBFREERTOS\MODULES\TASKS_pp.asm
Files11=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WIZC\serial\serial.c
Files12=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\Queue.c
Files13=C:\PROGRAM FILES\FED\PIXIE\Libs\LIBSTRINGS\STRINGS16.C
Files14=C:\DOCUMENTS AND SETTINGS\marcel\MY DOCUMENTS\pic\FreeRTOS\FreeRTOS\Demo\Common\Minimal\flash.c
Files15=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\Demo7\Demo7.LST
Files16=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrTxTest.h
Files17=C:\Documents and Settings\marcel\My Documents\pic\FreeRTOS\FreeRTOS\Demo\PIC18_WizC\serial\isrRxTest.h
Files18=C:\PROGRAM FILES\FED\PIXIE\Libs\LibsUser\LIBFREERTOS\Modules\list.c
Files19=C:\PROGRAM FILES\FED\PIXIE\LIBS\LIBSUSER\LIBFREERTOS\MODULES\LIST_pp.asm
Files20=C:\Program Files\FED\PIXIE\Libs\LibsUser\libFreeRTOS\Include\portmacro.h
Files21=C:\PROGRAM FILES\FED\PIXIE\LIBS\LIBSUSER\LIBMALLOC\MALLOC_pp.asm
Files22=C:\PROGRAM FILES\FED\PIXIE\Libs\libMem\Mem.c
Files23=C:\PROGRAM FILES\FED\PIXIE\LIBS\LIBMEM\MEM_pp.asm
Files24=C:\PROGRAM FILES\FED\PIXIE\Libs\LIBSTRINGS\STRINGS16.C
Files25=C:\PROGRAM FILES\FED\PIXIE\LIBS\LIBSUSER\LIBFREERTOS\MODULES\PORT_pp.asm
[PinConnections]
nPins=0
[AssCode]
ProcType=18F4620
[Information]
Column0=50
Column1=50
Column2=50
Column3=50
Column4=50
Column5=50
MemoHeight=154
WindowState=0
Top=418
Left=339
Width=339
Height=209
[F29013061]
x=0
y=112
[F27259933]
x=0
y=37
[F27123467]
x=0
y=106
[F30360431]
x=0
y=4990
[F28496481]
x=40
y=51
[F29012805]
x=0
y=111
[F20376480]
x=0
y=1329
[F30090026]
x=43
y=55
[F28479841]
x=0
y=51
[F10478061]
x=0
y=48
[F20009002]
x=0
y=143
[F30090282]
x=0
y=107
[F15568046]
x=0
y=307
[F30362479]
x=0
y=4782
[F20414028]
x=0
y=6476
[F30120750]
x=0
y=0
[F28496519]
x=61
y=3356
[F30165378]
x=0
y=0
[F30427679]
x=0
y=0
[F30394911]
x=0
y=46
[F20441499]
x=0
y=117
[F20460273]
x=0
y=4466
[F20528681]
x=0
y=0
[F20374190]
x=0
y=127
[F10825025]
x=0
y=48
[F15391118]
x=0
y=55
[F15679330]
x=0
y=112
[F20558577]
x=0
y=4736
[F29011525]
x=0
y=145
[F28396641]
x=10
y=9
[F27125515]
x=1
y=93
[F29566334]
x=0
y=0
[F30164510]
x=31
y=41
[F30146592]
x=0
y=65
[F29453097]
x=0
y=165
[F20220814]
x=0
y=366

View file

@ -0,0 +1,82 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ TickRate reduced to 250Hz.
+ configIDLE_SHOULD_YIELD added.
Changes from V3.0.1
*/
#ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H
/*-----------------------------------------------------------
* 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.
*----------------------------------------------------------*/
#define configUSE_PREEMPTION ( 1 )
#define configUSE_IDLE_HOOK ( 0 )
#define configUSE_TICK_HOOK ( 0 )
#define configTICK_RATE_HZ ( 250 )
#define configMAX_PRIORITIES ( 4 )
#define configMINIMAL_STACK_SIZE portMINIMAL_STACK_SIZE
#define configMAX_TASK_NAME_LEN ( 3 )
#define configUSE_TRACE_FACILITY ( 0 )
#define configUSE_16_BIT_TICKS ( 1 )
#define configIDLE_SHOULD_YIELD ( 1 )
/* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 )
/* Set the following definitions to 1 to include the component, or zero
to exclude the component. */
/* Include/exclude the stated 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,41 @@
#ifndef _MALLOC_SETTINGS_H
#define _MALLOC_SETTINGS_H
/*********************************************************************
** Title: Dynamic memory (de-)allocation library for wizC.
**
** Author: Marcel van Lieshout
**
** Copyright: (c) 2005, HMCS, Marcel van Lieshout
**
** License: This software is released to the public domain and comes
** without warranty and/or guarantees of any kind. You have
** the right to use, copy, modify and/or (re-)distribute the
** software as long as the reference to the author is
** maintained in the software and a reference to the author
** is included in any documentation of each product in which
** this library (in it's original or in a modified form)
** is used.
*********************************************************************/
/*********************************************************************
** The model to use
*********************************************************************/
//#define MALLOC_SMALL
#define MALLOC_LARGE
/*********************************************************************
** The size of the heap
*********************************************************************/
#define MALLOC_HEAP_SIZE (3200)
/*********************************************************************
** Should released memory be scribbled with 0x55 before releasing it?
*********************************************************************/
//#define MALLOC_SCRIBBLE
/********************************************************************
** Enable Debug-mode?
*********************************************************************/
//#define MALLOC_DEBUG
#endif /* _MALLOC_SETTINGS_H */

View file

@ -0,0 +1,53 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Several modules predefined to avoid linker problems
Changes from V3.0.1
*/
#ifndef _memcpy
#define _memcpy 1
#endif
#ifndef _memset
#define _memset 1
#endif
#ifndef _strncpy
#define _strncpy 1
#endif
#pragma wizcpp searchpath <../../Common/Include/>

View file

@ -0,0 +1,58 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
** Here are the configuration words set. See the PIC datasheet
** and the wizC manual for an explanation
*/
#include <pic.h>
/*
** These fuses are for PIC18F4620
*/
#pragma __config _CONFIG1H,_IESO_OFF_1H & _FCMEN_OFF_1H & _OSC_HSPLL_1H
#pragma __config _CONFIG2L,_BORV_21_2L & _BOREN_SBORDIS_2L & _PWRT_ON_2L
#pragma __config _CONFIG2H,_WDTPS_32768_2H & _WDT_OFF_2H
#pragma __config _CONFIG3H,_MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
#pragma __config _CONFIG4L,_DEBUG_OFF_4L & _XINST_OFF_4L & _LVP_OFF_4L & _STVREN_OFF_4L
#pragma __config _CONFIG5L,_CP3_OFF_5L & _CP2_OFF_5L & _CP1_OFF_5L & _CP0_OFF_5L
#pragma __config _CONFIG5H,_CPD_OFF_5H & _CPB_OFF_5H
#pragma __config _CONFIG6L,_WRT3_OFF_6L & _WRT2_OFF_6L & _WRT1_OFF_6L & _WRT0_OFF_6L
#pragma __config _CONFIG6H,_WRTD_OFF_6H & _WRTB_OFF_6H & _WRTC_OFF_6H
#pragma __config _CONFIG7L,_EBTR3_OFF_7L & _EBTR2_OFF_7L & _EBTR1_OFF_7L & _EBTR0_OFF_7L
#pragma __config _CONFIG7H,_EBTRB_OFF_7H

View file

@ -0,0 +1,118 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Included Filenames changed to a .c extension to allow stepping through
code using F7.
Changes from V3.0.1
*/
#include <pic.h>
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
#include <queue.h>
static bit uxSwitchRequested;
/*
* Vector for the ISR.
*/
void pointed Interrupt()
{
/*
* Save the context of the current task.
*/
portSAVE_CONTEXT( portINTERRUPTS_FORCED );
/*
* No contextswitch requested yet
*/
uxSwitchRequested = pdFALSE;
/*
* Was the interrupt the FreeRTOS SystemTick?
*/
#include <libFreeRTOS/Drivers/Tick/isrTick.c>
/*******************************************************************************
** DO NOT MODIFY ANYTHING ABOVE THIS LINE
********************************************************************************
** Enter the includes for the ISR-code of the FreeRTOS drivers below.
**
** You cannot use local variables. Alternatives are:
** - Use static variables (Global RAM usage increases)
** - Call a function (Additional cycles are needed)
** - Use unused SFR's (preferred, no additional overhead)
** See "../Serial/isrSerialTx.c" for an example of this last option
*******************************************************************************/
/*
* Was the interrupt a byte being received?
*/
#include "../Serial/isrSerialRx.c"
/*
* Was the interrupt the Tx register becoming empty?
*/
#include "../Serial/isrSerialTx.c"
/*******************************************************************************
** DO NOT MODIFY ANYTHING BELOW THIS LINE
*******************************************************************************/
/*
* Was a contextswitch requested by one of the
* interrupthandlers?
*/
if ( uxSwitchRequested )
{
vTaskSwitchContext();
}
/*
* Restore the context of the (possibly other) task.
*/
portRESTORE_CONTEXT();
#pragma asmline retfie 0
}

View file

@ -0,0 +1,184 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/*
* Instead of the normal single demo application, the PIC18F demo is split
* into several smaller programs of which this is the seventh. This enables the
* demo's to be executed on the RAM limited PIC-devices.
*
* The Demo7 project is configured for a PIC18F4620 device. Main.c starts 10
* tasks (including the idle task). See the indicated files in the demo/common
* directory for more information.
*
* demo/common/minimal/flash.c: Creates 3 tasks
* demo/common/minimal/death.c: Creates 1 controltask and
* creates/deletes 4 suicidaltasks
*
* Main.c also creates a check task. This periodically checks that all the
* other tasks are still running and have not experienced any unexpected
* results. If all the other tasks are executing correctly an LED is flashed
* once every mainCHECK_PERIOD milliseconds. If any of the tasks have not
* executed, or report an error, the frequency of the LED flash will increase
* to mainERROR_FLASH_RATE.
*
* On entry to main an 'X' is transmitted. Monitoring the serial port using a
* dumb terminal allows for verification that the device is not continuously
* being reset (no more than one 'X' should be transmitted).
*
* http://www.FreeRTOS.org contains important information on the use of the
* wizC PIC18F port.
*/
/* Scheduler include files. */
#include <FreeRTOS.h>
#include <task.h>
/* Demo app include files. */
#include "death.h"
#include "flash.h"
#include "partest.h"
#include "serial.h"
/* The period between executions of the check task before and after an error
has been discovered. If an error has been discovered the check task runs
more frequently - increasing the LED flash rate. */
#define mainNO_ERROR_CHECK_PERIOD ( ( portTickType ) 10000 / portTICK_RATE_MS )
#define mainERROR_CHECK_PERIOD ( ( portTickType ) 1000 / portTICK_RATE_MS )
#define mainCHECK_TASK_LED ( ( unsigned portCHAR ) 3 )
/* Priority definitions for some of the tasks. Other tasks just use the idle
priority. */
#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 2 )
#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 2 )
#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portCHAR ) 1 )
/* Constants required for the communications. Only one character is ever
transmitted. */
#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portCHAR ) 5 )
#define mainNO_BLOCK ( ( portTickType ) 0 )
#define mainBAUD_RATE ( ( unsigned portLONG ) 57600 )
/*
* The task function for the "Check" task.
*/
static portTASK_FUNCTION_PROTO( vErrorChecks, pvParameters );
/*
* Checks the unique counts of other tasks to ensure they are still operational.
* Returns pdTRUE if an error is detected, otherwise pdFALSE.
*/
static portCHAR prvCheckOtherTasksAreStillRunning( void );
/*-----------------------------------------------------------*/
/* Creates the tasks, then starts the scheduler. */
void main( void )
{
/* Initialise the required hardware. */
vParTestInitialise();
/* Send a character so we have some visible feedback of a reset. */
xSerialPortInitMinimal( mainBAUD_RATE, mainCOMMS_QUEUE_LENGTH );
xSerialPutChar( NULL, 'X', mainNO_BLOCK );
/* Start a few of the standard demo tasks found in the demo\common directory. */
vStartLEDFlashTasks( mainLED_FLASH_PRIORITY );
/* Start the check task defined in this file. */
xTaskCreate( vErrorChecks, ( const portCHAR * const ) "Check", portMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL );
/* This task has to be created last as it keeps account of the number of tasks
it expects to see running. */
vCreateSuicidalTasks( mainCREATOR_TASK_PRIORITY );
/* Start the scheduler. Will never return here. */
vTaskStartScheduler();
while(1) /* This point should never be reached. */
{
}
}
/*-----------------------------------------------------------*/
static portTASK_FUNCTION( vErrorChecks, pvParameters )
{
portTickType xLastCheckTime;
portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD;
portCHAR cErrorOccurred;
/* We need to initialise xLastCheckTime prior to the first call to
vTaskDelayUntil(). */
xLastCheckTime = xTaskGetTickCount();
/* Cycle for ever, delaying then checking all the other tasks are still
operating without error. */
for( ;; )
{
/* Wait until it is time to check the other tasks again. */
vTaskDelayUntil( &xLastCheckTime, xDelayTime );
/* Check all the other tasks are running, and running without ever
having an error. */
cErrorOccurred = prvCheckOtherTasksAreStillRunning();
/* If an error was detected increase the frequency of the LED flash. */
if( cErrorOccurred == pdTRUE )
{
xDelayTime = mainERROR_CHECK_PERIOD;
}
/* Flash the LED for visual feedback. */
vParTestToggleLED( mainCHECK_TASK_LED );
}
}
/*-----------------------------------------------------------*/
static portCHAR prvCheckOtherTasksAreStillRunning( void )
{
portCHAR cErrorHasOccurred = ( portCHAR ) pdFALSE;
if( xIsCreateTaskStillRunning() != pdTRUE )
{
cErrorHasOccurred = ( portCHAR ) pdTRUE;
}
return cErrorHasOccurred;
}
/*-----------------------------------------------------------*/

View file

@ -0,0 +1,125 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
Changes from V3.0.1
*/
/* Scheduler include files. */
#include "FreeRTOS.h"
#include <task.h>
#include "partest.h"
/*-----------------------------------------------------------
* Simple parallel port IO routines for the FED 40pin demo board.
* The four LED's are connected to D4 to D7.
*-----------------------------------------------------------*/
#define partstBIT_AS_OUTPUT ( ( unsigned portSHORT ) 0 )
#define partstSET_OUTPUT ( ( unsigned portSHORT ) 1 )
#define partstCLEAR_OUTPUT ( ( unsigned portSHORT ) 0 )
#define partstENABLE_GENERAL_IO ( ( unsigned portCHAR ) 7 )
/*-----------------------------------------------------------*/
void vParTestInitialise( void )
{
/* Set the top four bits of port D to output. */
bTRD7 = partstBIT_AS_OUTPUT;
bTRD6 = partstBIT_AS_OUTPUT;
bTRD5 = partstBIT_AS_OUTPUT;
bTRD4 = partstBIT_AS_OUTPUT;
/* Start with all bits off. */
bRD7 = partstCLEAR_OUTPUT;
bRD6 = partstCLEAR_OUTPUT;
bRD5 = partstCLEAR_OUTPUT;
bRD4 = partstCLEAR_OUTPUT;
/* Enable the driver. */
ADCON1 = partstENABLE_GENERAL_IO;
bTRE2 = partstBIT_AS_OUTPUT;
bRE2 = partstSET_OUTPUT;
}
/*-----------------------------------------------------------*/
void vParTestSetLED( unsigned portCHAR ucLED, portCHAR cValue )
{
/* We are only using the top nibble, so LED 0 corresponds to bit 4. */
vTaskSuspendAll();
{
switch( ucLED )
{
case 3 : bRD7 = ( portSHORT ) cValue;
break;
case 2 : bRD6 = ( portSHORT ) cValue;
break;
case 1 : bRD5 = ( portSHORT ) cValue;
break;
case 0 : bRD4 = ( portSHORT ) cValue;
break;
default : /* There are only 4 LED's. */
break;
}
}
xTaskResumeAll();
}
/*-----------------------------------------------------------*/
void vParTestToggleLED( unsigned portCHAR ucLED )
{
/* We are only using the top nibble, so LED 0 corresponds to bit 4. */
vTaskSuspendAll();
{
switch( ucLED )
{
case 3 : bRD7 = !bRD7;
break;
case 2 : bRD6 = !bRD6;
break;
case 1 : bRD5 = !bRD5;
break;
case 0 : bRD4 = !bRD4 );
break;
default : /* There are only 4 LED's. */
break;
}
}
xTaskResumeAll();
}

View file

@ -0,0 +1,106 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ ISRcode pulled inline to reduce stack-usage.
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Filename changed to a .c extension to allow stepping through code
using F7.
Changes from V3.0.1
*/
#ifndef _FREERTOS_SERIAL_ISRSERIALRX_C
#define _FREERTOS_SERIAL_ISRSERIALRX_C
#define serCONTINUOUS_RX ( 1 )
#define serCLEAR_OVERRUN ( 0 )
{
/*
* Was the interrupt a byte being received?
*/
if( bRCIF && bRCIE)
{
/*
* Queue to interface between comms API and interrupt routine.
*/
extern xQueueHandle xRxedChars;
/*
* Because we are not allowed to use local variables here,
* PRODL is (ab)used as temporary storage. This is allowed
* because this SFR will be restored before exiting the ISR.
*/
extern portCHAR cChar;
#pragma locate cChar &PRODL
/*
* If there was a framing error, just get and ignore
* the character
*/
if( bFERR )
{
cChar = RCREG;
}
else
{
/*
* Get the character and post it on the queue of Rxed
* characters. If the post causes a task to wake ask
* for a context switch as the woken task may have a
* higher priority than the task we have interrupted.
*/
cChar = RCREG;
/*
* Clear any overrun errors.
*/
if( bOERR )
{
bCREN = serCLEAR_OVERRUN;
bCREN = serCONTINUOUS_RX;
}
if( xQueueSendFromISR( xRxedChars, ( const void * ) &cChar, pdFALSE ) )
{
uxSwitchRequested = pdTRUE;
}
}
}
}
#endif /* _FREERTOS_SERIAL_ISRSERIALRX_C */

View file

@ -0,0 +1,99 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ ISRcode pulled inline to reduce stack-usage.
+ Added functionality to only call vTaskSwitchContext() once
when handling multiple interruptsources in a single interruptcall.
+ Filename changed to a .c extension to allow stepping through code
using F7.
Changes from V3.0.1
*/
#ifndef _FREERTOS_SERIAL_ISRSERIALTX_C
#define _FREERTOS_SERIAL_ISRSERIALTX_C
#define serINTERRUPT_DISABLED ( 0 )
{
/*
* Was the interrupt the Tx register becoming empty?
*/
if( bTXIF && bTXIE)
{
/*
* Queue to interface between comms API and interrupt routine.
*/
extern xQueueHandle xCharsForTx;
/*
* Because we are not allowed to use local variables here,
* PRODL and PRODH are (ab)used as temporary storage. This
* is allowed because these SFR's will be restored before
* exiting the ISR.
*/
extern portCHAR cChar;
#pragma locate cChar &PRODL
extern portBASE_TYPE pxTaskWoken;
#pragma locate pxTaskWoken &PRODH
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &pxTaskWoken ) == pdTRUE )
{
/*
* Send the next character queued for Tx.
*/
TXREG = cChar;
}
else
{
/*
* Queue empty, nothing to send.
*/
bTXIE = serINTERRUPT_DISABLED;
}
/*
* If we woke another task, ask for a contextswitch
*/
if( pxTaskWoken == pdTRUE )
{
uxSwitchRequested = pdTRUE;
}
}
}
#endif /* _FREERTOS_SERIAL_ISRSERIALTX_C */

View file

@ -0,0 +1,177 @@
/*
FreeRTOS V4.0.1 - Copyright (C) 2003-2006 Richard Barry.
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 as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
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
along with FreeRTOS; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
A special exception to the GPL can be applied should you wish to distribute
a combined work that includes FreeRTOS, without being obliged to provide
the source code for any proprietary components. See the licensing section
of http://www.FreeRTOS.org for full details of how and when the exception
can be applied.
***************************************************************************
See http://www.FreeRTOS.org for documentation, latest information, license
and contact details. Please ensure to read the configuration and relevant
port sections of the online documentation.
***************************************************************************
*/
/*
Changes from V3.0.0
+ ISRcode removed. Is now pulled inline to reduce stack-usage.
Changes from V3.0.1
*/
/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. */
/* Scheduler header files. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "serial.h"
/* Hardware pin definitions. */
#define serTX_PIN bTRC6
#define serRX_PIN bTRC7
/* Bit/register definitions. */
#define serINPUT ( 1 )
#define serOUTPUT ( 0 )
#define serINTERRUPT_ENABLED ( 1 )
/* All ISR's use the PIC18 low priority interrupt. */
#define serLOW_PRIORITY ( 0 )
/*-----------------------------------------------------------*/
/* Queues to interface between comms API and interrupt routines. */
xQueueHandle xRxedChars;
xQueueHandle xCharsForTx;
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInitMinimal( unsigned portLONG ulWantedBaud, unsigned portCHAR ucQueueLength )
{
unsigned portSHORT usSPBRG;
/* Create the queues used by the ISR's to interface to tasks. */
xRxedChars = xQueueCreate( ucQueueLength, ( unsigned portBASE_TYPE ) sizeof( portCHAR ) );
xCharsForTx = xQueueCreate( ucQueueLength, ( unsigned portBASE_TYPE ) sizeof( portCHAR ) );
portENTER_CRITICAL();
/* Setup the IO pins to enable the USART IO. */
serTX_PIN = serINPUT; // YES really! See datasheet
serRX_PIN = serINPUT;
/* Set the TX config register. */
TXSTA = 0b00100000;
// ||||||||--bit0: TX9D = n/a
// |||||||---bit1: TRMT = ReadOnly
// ||||||----bit2: BRGH = High speed
// |||||-----bit3: SENDB = n/a
// ||||------bit4: SYNC = Asynchronous mode
// |||-------bit5: TXEN = Transmit enable
// ||--------bit6: TX9 = 8-bit transmission
// |---------bit7: CSRC = n/a
/* Set the Receive config register. */
RCSTA = 0b10010000;
// ||||||||--bit0: RX9D = ReadOnly
// |||||||---bit1: OERR = ReadOnly
// ||||||----bit2: FERR = ReadOnly
// |||||-----bit3: ADDEN = n/a
// ||||------bit4: CREN = Enable receiver
// |||-------bit5: SREN = n/a
// ||--------bit6: RX9 = 8-bit reception
// |---------bit7: SPEN = Serial port enabled
/* Calculate the baud rate generator value.
We use low-speed (BRGH=0), the formula is
SPBRG = ( ( FOSC / Desired Baud Rate ) / 64 ) - 1 */
usSPBRG = ( ( APROCFREQ / ulWantedBaud ) / 64 ) - 1;
if( usSPBRG > 255 )
{
SPBRG = 255;
}
else
{
SPBRG = usSPBRG;
}
/* Set the serial interrupts to use the same priority as the tick. */
bTXIP = serLOW_PRIORITY;
bRCIP = serLOW_PRIORITY;
/* Enable the Rx interrupt now, the Tx interrupt will get enabled when
we have data to send. */
bRCIE = serINTERRUPT_ENABLED;
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;
}
/*-----------------------------------------------------------*/
xComPortHandle xSerialPortInit( eCOMPort ePort, eBaud eWantedBaud, eParity eWantedParity, eDataBits eWantedDataBits, eStopBits eWantedStopBits, unsigned portCHAR ucBufferLength )
{
/* This is not implemented in this port.
Use xSerialPortInitMinimal() instead. */
return NULL;
}
/*-----------------------------------------------------------*/
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, portCHAR *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 ( portCHAR ) pdTRUE;
}
return ( portCHAR ) pdFALSE;
}
/*-----------------------------------------------------------*/
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, portCHAR cOutChar, portTickType xBlockTime )
{
/* Return false if after the block time there is no room on the Tx queue. */
if( xQueueSend( xCharsForTx, ( const void * ) &cOutChar, xBlockTime ) != ( portCHAR ) pdPASS )
{
return pdFAIL;
}
/* Turn interrupt on - ensure the compiler only generates a single
instruction for this. */
bTXIE = serINTERRUPT_ENABLED;
return pdPASS;
}
/*-----------------------------------------------------------*/
void vSerialClose( xComPortHandle xPort )
{
/* Not implemented for this port.
To implement, turn off the interrupts and delete the memory
allocated to the queues. */
}