OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/rtos/freertos-6.1.1/Demo
    from Rev 586 to Rev 587
    Reverse comparison

Rev 586 → Rev 587

/PIC18_MPLAB/serial/serial.c
0,0 → 1,252
/*
FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.
 
***************************************************************************
* *
* If you are: *
* *
* + New to FreeRTOS, *
* + Wanting to learn FreeRTOS or multitasking in general quickly *
* + Looking for basic training, *
* + Wanting to improve your FreeRTOS skills and productivity *
* *
* then take a look at the FreeRTOS books - available as PDF or paperback *
* *
* "Using the FreeRTOS Real Time Kernel - a Practical Guide" *
* http://www.FreeRTOS.org/Documentation *
* *
* A pdf reference manual is also available. Both are usually delivered *
* to your inbox within 20 minutes to two hours when purchased between 8am *
* and 8pm GMT (although please allow up to 24 hours in case of *
* exceptional circumstances). Thank you for your support! *
* *
***************************************************************************
 
This file is part of the FreeRTOS distribution.
 
FreeRTOS is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License (version 2) as published by the
Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
***NOTE*** The exception to the GPL is included to allow you to distribute
a combined work that includes FreeRTOS without being obliged to provide the
source code for proprietary components outside of the FreeRTOS kernel.
FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details. You should have received a copy of the GNU General Public
License and the FreeRTOS license exception along with FreeRTOS; if not it
can be viewed here: http://www.freertos.org/a00114.html and also obtained
by writing to Richard Barry, contact details for whom are available on the
FreeRTOS WEB site.
 
1 tab == 4 spaces!
 
http://www.FreeRTOS.org - Documentation, latest information, license and
contact details.
 
http://www.SafeRTOS.com - A version that is certified for use in safety
critical systems.
 
http://www.OpenRTOS.com - Commercial support, development, porting,
licensing and training services.
*/
 
/*
Changes from V1.2.5
 
+ Clear overrun errors in the Rx ISR. Overrun errors prevent any further
characters being received.
 
Changes from V2.0.0
 
+ Use portTickType in place of unsigned pdLONG for delay periods.
+ cQueueReieveFromISR() used in place of xQueueReceive() in ISR.
*/
 
/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. */
 
/* Scheduler header files. */
#include "FreeRTOS.h"
#include "task.h"
#include "serial.h"
#include "queue.h"
 
/*
* Prototypes for ISR's. The PIC architecture means that these functions
* have to be called from port.c. The prototypes are not however included
* in the header as the header is common to all ports.
*/
void vSerialTxISR( void );
void vSerialRxISR( void );
 
/* Hardware pin definitions. */
#define serTX_PIN TRISCbits.TRISC6
#define serRX_PIN TRISCbits.TRISC7
 
/* Bit/register definitions. */
#define serINPUT ( 1 )
#define serOUTPUT ( 0 )
#define serTX_ENABLE ( ( unsigned short ) 1 )
#define serRX_ENABLE ( ( unsigned short ) 1 )
#define serHIGH_SPEED ( ( unsigned short ) 1 )
#define serCONTINUOUS_RX ( ( unsigned short ) 1 )
#define serCLEAR_OVERRUN ( ( unsigned short ) 0 )
#define serINTERRUPT_ENABLED ( ( unsigned short ) 1 )
#define serINTERRUPT_DISABLED ( ( unsigned short ) 0 )
 
/* All ISR's use the PIC18 low priority interrupt. */
#define serLOW_PRIORITY ( 0 )
 
/*-----------------------------------------------------------*/
 
/* Queues to interface between comms API and interrupt routines. */
static xQueueHandle xRxedChars;
static xQueueHandle xCharsForTx;
 
/*-----------------------------------------------------------*/
 
xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength )
{
unsigned long ulBaud;
 
/* Calculate the baud rate generator constant.
SPBRG = ( (FOSC / Desired Baud Rate) / 16 ) - 1 */
ulBaud = configCPU_CLOCK_HZ / ulWantedBaud;
ulBaud /= ( unsigned long ) 16;
ulBaud -= ( unsigned long ) 1;
 
/* Create the queues used by the ISR's to interface to tasks. */
xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) );
xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) );
 
portENTER_CRITICAL();
{
/* Start with config registers cleared, so we can just set the wanted
bits. */
TXSTA = ( unsigned short ) 0;
RCSTA = ( unsigned short ) 0;
 
/* Set the baud rate generator using the above calculated constant. */
SPBRG = ( unsigned char ) ulBaud;
 
/* Setup the IO pins to enable the USART IO. */
serTX_PIN = serOUTPUT;
serRX_PIN = serINPUT;
 
/* Set the serial interrupts to use the same priority as the tick. */
IPR1bits.TXIP = serLOW_PRIORITY;
IPR1bits.RCIP = serLOW_PRIORITY;
 
/* Setup Tx configuration. */
TXSTAbits.BRGH = serHIGH_SPEED;
TXSTAbits.TXEN = serTX_ENABLE;
 
/* Setup Rx configuration. */
RCSTAbits.SPEN = serRX_ENABLE;
RCSTAbits.CREN = serCONTINUOUS_RX;
 
/* Enable the Rx interrupt now, the Tx interrupt will get enabled when
we have data to send. */
PIE1bits.RCIE = 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 portBASE_TYPE uxBufferLength )
{
/* This is not implemented in this port.
Use xSerialPortInitMinimal() instead. */
}
/*-----------------------------------------------------------*/
 
portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime )
{
/* Get the next character from the buffer. Return false if no characters
are available, or arrive before xBlockTime expires. */
if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) )
{
return pdTRUE;
}
else
{
return pdFALSE;
}
}
/*-----------------------------------------------------------*/
 
portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime )
{
/* Return false if after the block time there is no room on the Tx queue. */
if( xQueueSend( xCharsForTx, ( const void * ) &cOutChar, xBlockTime ) != pdPASS )
{
return pdFAIL;
}
 
/* Turn interrupt on - ensure the compiler only generates a single
instruction for this. */
PIE1bits.TXIE = 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. */
}
/*-----------------------------------------------------------*/
 
#pragma interruptlow vSerialRxISR save=PRODH, PRODL, TABLAT, section(".tmpdata")
void vSerialRxISR( void )
{
char cChar;
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
 
/* Get the character and post it on the queue of Rxed characters.
If the post causes a task to wake force a context switch as the woken task
may have a higher priority than the task we have interrupted. */
cChar = RCREG;
 
/* Clear any overrun errors. */
if( RCSTAbits.OERR )
{
RCSTAbits.CREN = serCLEAR_OVERRUN;
RCSTAbits.CREN = serCONTINUOUS_RX;
}
 
xQueueSendFromISR( xRxedChars, ( const void * ) &cChar, &xHigherPriorityTaskWoken );
 
if( xHigherPriorityTaskWoken )
{
taskYIELD();
}
}
/*-----------------------------------------------------------*/
 
#pragma interruptlow vSerialTxISR save=PRODH, PRODL, TABLAT, section(".tmpdata")
void vSerialTxISR( void )
{
char cChar, cTaskWoken = pdFALSE;
 
if( xQueueReceiveFromISR( xCharsForTx, &cChar, &cTaskWoken ) == pdTRUE )
{
/* Send the next character queued for Tx. */
TXREG = cChar;
}
else
{
/* Queue empty, nothing to send. */
PIE1bits.TXIE = serINTERRUPT_DISABLED;
}
}
 
 
 
/PIC18_MPLAB/18f452.lkr
0,0 → 1,24
// $Id: 18f452.lkr 2 2011-07-17 20:13:17Z filepang@gmail.com $
// File: 18f452.lkr
// Sample linker script for the PIC18F452 processor
 
LIBPATH .
 
FILES c018i.o
FILES clib.lib
FILES p18f452.lib
 
CODEPAGE NAME=vectors START=0x0 END=0x39 PROTECTED
CODEPAGE NAME=page START=0x3A END=0x7FFF
CODEPAGE NAME=idlocs START=0x200000 END=0x200007 PROTECTED
CODEPAGE NAME=config START=0x300000 END=0x30000D PROTECTED
CODEPAGE NAME=devid START=0x3FFFFE END=0x3FFFFF PROTECTED
CODEPAGE NAME=eedata START=0xF00000 END=0xF000FF PROTECTED
 
ACCESSBANK NAME=accessram START=0x0 END=0x7F
DATABANK NAME=BIG_BLOCK START=0x80 END=0x5FF
ACCESSBANK NAME=accesssfr START=0xF80 END=0xFFF PROTECTED
 
SECTION NAME=CONFIG ROM=config
 
STACK SIZE=0x60 RAM=BIG_BLOCK
/PIC18_MPLAB/rtosdemo.mcw Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream
PIC18_MPLAB/rtosdemo.mcw Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: PIC18_MPLAB/ParTest/ParTest.c =================================================================== --- PIC18_MPLAB/ParTest/ParTest.c (nonexistent) +++ PIC18_MPLAB/ParTest/ParTest.c (revision 587) @@ -0,0 +1,144 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +Changes from V2.0.0 + + + Use scheduler suspends in place of critical sections. +*/ + +#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 short ) 0 ) +#define partstSET_OUTPUT ( ( unsigned short ) 1 ) +#define partstCLEAR_OUTPUT ( ( unsigned short ) 0 ) + +#define partstENABLE_GENERAL_IO ( ( unsigned char ) 7 ) + +/*-----------------------------------------------------------*/ + +void vParTestInitialise( void ) +{ + /* Set the top four bits of port D to output. */ + TRISDbits.TRISD7 = partstBIT_AS_OUTPUT; + TRISDbits.TRISD6 = partstBIT_AS_OUTPUT; + TRISDbits.TRISD5 = partstBIT_AS_OUTPUT; + TRISDbits.TRISD4 = partstBIT_AS_OUTPUT; + + /* Start with all bits off. */ + PORTDbits.RD7 = partstCLEAR_OUTPUT; + PORTDbits.RD6 = partstCLEAR_OUTPUT; + PORTDbits.RD5 = partstCLEAR_OUTPUT; + PORTDbits.RD4 = partstCLEAR_OUTPUT; + + /* Enable the driver. */ + ADCON1 = partstENABLE_GENERAL_IO; + TRISEbits.TRISE2 = partstBIT_AS_OUTPUT; + PORTEbits.RE2 = partstSET_OUTPUT; +} +/*-----------------------------------------------------------*/ + +void vParTestSetLED( unsigned portBASE_TYPE uxLED, portBASE_TYPE xValue ) +{ + /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ + vTaskSuspendAll(); + { + switch( uxLED ) + { + case 3 : PORTDbits.RD7 = ( short ) xValue; + break; + case 2 : PORTDbits.RD6 = ( short ) xValue; + break; + case 1 : PORTDbits.RD5 = ( short ) xValue; + break; + case 0 : PORTDbits.RD4 = ( short ) xValue; + break; + default : /* There are only 4 LED's. */ + break; + } + } + xTaskResumeAll(); +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) +{ + /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ + vTaskSuspendAll(); + { + switch( uxLED ) + { + case 3 : PORTDbits.RD7 = !( PORTDbits.RD7 ); + break; + case 2 : PORTDbits.RD6 = !( PORTDbits.RD6 ); + break; + case 1 : PORTDbits.RD5 = !( PORTDbits.RD5 ); + break; + case 0 : PORTDbits.RD4 = !( PORTDbits.RD4 ); + break; + default : /* There are only 4 LED's. */ + break; + } + } + xTaskResumeAll(); +} + + + Index: PIC18_MPLAB/FreeRTOSConfig.h =================================================================== --- PIC18_MPLAB/FreeRTOSConfig.h (nonexistent) +++ PIC18_MPLAB/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,100 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +#include + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 0 +#define configUSE_TICK_HOOK 0 +#define configTICK_RATE_HZ ( ( portTickType ) 1000 ) +#define configCPU_CLOCK_HZ ( ( unsigned long ) 20000000 ) +#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 ) +#define configMINIMAL_STACK_SIZE ( 105 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) 1024 ) +#define configMAX_TASK_NAME_LEN ( 4 ) +#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 API function, or zero +to exclude the API function. */ + +#define INCLUDE_vTaskPrioritySet 0 +#define INCLUDE_uxTaskPriorityGet 0 +#define INCLUDE_vTaskDelete 1 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 0 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 + + +#endif /* FREERTOS_CONFIG_H */ Index: PIC18_MPLAB/main1.c =================================================================== --- PIC18_MPLAB/main1.c (nonexistent) +++ PIC18_MPLAB/main1.c (revision 587) @@ -0,0 +1,207 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* + * 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 40 pin devices. The 64 and 80 pin + * devices require a more costly development platform and are not so readily + * available. + * + * The RTOSDemo1 project is configured for a PIC18F452 device. Main1.c starts 5 + * tasks (including the idle task). + * + * The first task runs at the idle priority. It repeatedly performs a 32bit + * calculation and checks it's result against the expected value. This checks + * that the temporary storage utilised by the compiler to hold intermediate + * results does not get corrupted when the task gets switched in and out. See + * demo/common/minimal/integer.c for more information. + * + * The second and third tasks pass an incrementing value between each other on + * a message queue. See demo/common/minimal/PollQ.c for more information. + * + * Main1.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 and 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 + * PIC18F port. + */ + +/* +Changes from V2.0.0 + + + Delay periods are now specified using variables and constants of + portTickType rather than unsigned long. +*/ + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Demo app include files. */ +#include "PollQ.h" +#include "integer.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 ) 1000 / portTICK_RATE_MS ) +#define mainERROR_CHECK_PERIOD ( ( portTickType ) 100 / portTICK_RATE_MS ) + +/* Priority definitions for some of the tasks. Other tasks just use the idle +priority. */ +#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 ) + +/* The LED that is flashed by the check task. */ +#define mainCHECK_TASK_LED ( 0 ) + +/* Constants required for the communications. Only one character is ever +transmitted. */ +#define mainCOMMS_QUEUE_LENGTH ( 5 ) +#define mainNO_BLOCK ( ( portTickType ) 0 ) +#define mainBAUD_RATE ( ( unsigned long ) 9600 ) + +/* + * The task function for the "Check" task. + */ +static void vErrorChecks( void *pvParameters ); + +/* + * Checks the unique counts of other tasks to ensure they are still operational. + * Returns pdTRUE if an error is detected, otherwise pdFALSE. + */ +static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ); + +/*-----------------------------------------------------------*/ + +/* Creates the tasks, then starts the scheduler. */ +void main( void ) +{ + /* Initialise the required hardware. */ + vParTestInitialise(); + vPortInitialiseBlocks(); + + /* 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( tskIDLE_PRIORITY ); + vStartPolledQueueTasks( mainQUEUE_POLL_PRIORITY ); + + /* Start the check task defined in this file. */ + xTaskCreate( vErrorChecks, ( const char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* Start the scheduler. Will never return here. */ + vTaskStartScheduler(); +} +/*-----------------------------------------------------------*/ + +static void vErrorChecks( void *pvParameters ) +{ +portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD; +portBASE_TYPE xErrorOccurred; + + /* 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. */ + vTaskDelay( xDelayTime ); + + /* Check all the other tasks are running, and running without ever + having an error. */ + xErrorOccurred = prvCheckOtherTasksAreStillRunning(); + + /* If an error was detected increase the frequency of the LED flash. */ + if( xErrorOccurred == pdTRUE ) + { + xDelayTime = mainERROR_CHECK_PERIOD; + } + + /* Flash the LED for visual feedback. */ + vParTestToggleLED( mainCHECK_TASK_LED ); + } +} +/*-----------------------------------------------------------*/ + +static portBASE_TYPE prvCheckOtherTasksAreStillRunning( void ) +{ +portBASE_TYPE xErrorHasOccurred = pdFALSE; + + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + xErrorHasOccurred = pdTRUE; + } + + if( xArePollingQueuesStillRunning() != pdTRUE ) + { + xErrorHasOccurred = pdTRUE; + } + + return xErrorHasOccurred; +} +/*-----------------------------------------------------------*/ + + Index: PIC18_MPLAB/main2.c =================================================================== --- PIC18_MPLAB/main2.c (nonexistent) +++ PIC18_MPLAB/main2.c (revision 587) @@ -0,0 +1,182 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* + * 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 40 pin devices. The 64 and 80 pin + * devices require a more costly development platform and are not so readily + * available. + * + * The RTOSDemo2 project is configured for a PIC18F452 device. Main2.c starts + * 5 tasks (including the idle task). + * + * The first, second and third tasks do nothing but flash an LED. This gives + * visual feedback that everything is executing as expected. One task flashes + * an LED every 333ms (i.e. on and off every 333/2 ms), then next every 666ms + * and the last every 999ms. + * + * The last task runs at the idle priority. It repeatedly performs a 32bit + * calculation and checks it's result against the expected value. This checks + * that the temporary storage utilised by the compiler to hold intermediate + * results does not get corrupted when the task gets switched in and out. + * should the calculation ever provide an incorrect result the final LED is + * turned on. + * + * 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 + * PIC18F port. + */ + +/* +Changes from V2.0.0 + + + Delay periods are now specified using variables and constants of + portTickType rather than unsigned long. +*/ + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Demo app include files. */ +#include "flash.h" +#include "partest.h" +#include "serial.h" + +/* Priority definitions for the LED tasks. Other tasks just use the idle +priority. */ +#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portBASE_TYPE ) 1 ) + +/* The LED that is lit when should the calculation fail. */ +#define mainCHECK_TASK_LED ( ( unsigned portBASE_TYPE ) 3 ) + +/* Constants required for the communications. Only one character is ever +transmitted. */ +#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portBASE_TYPE ) 5 ) +#define mainNO_BLOCK ( ( portTickType ) 0 ) +#define mainBAUD_RATE ( ( unsigned long ) 9600 ) + +/* + * The task that performs the 32 bit calculation at the idle priority. + */ +static void vCalculationTask( void *pvParameters ); + +/*-----------------------------------------------------------*/ + +/* Creates the tasks, then starts the scheduler. */ +void main( void ) +{ + /* Initialise the required hardware. */ + vParTestInitialise(); + vPortInitialiseBlocks(); + + /* 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 LED flash tasks as defined in demo/common/minimal. */ + vStartLEDFlashTasks( mainLED_FLASH_PRIORITY ); + + /* Start the check task defined in this file. */ + xTaskCreate( vCalculationTask, ( const char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY, NULL ); + + /* Start the scheduler. */ + vTaskStartScheduler(); +} +/*-----------------------------------------------------------*/ + +static void vCalculationTask( void *pvParameters ) +{ +volatile unsigned long ulCalculatedValue; /* Volatile to ensure optimisation is minimal. */ + + /* Continuously perform a calculation. If the calculation result is ever + incorrect turn the LED on. */ + for( ;; ) + { + /* A good optimising compiler would just remove all this! */ + ulCalculatedValue = 1234UL; + ulCalculatedValue *= 99UL; + + if( ulCalculatedValue != 122166UL ) + { + vParTestSetLED( mainCHECK_TASK_LED, pdTRUE ); + } + + ulCalculatedValue *= 9876UL; + + if( ulCalculatedValue != 1206511416UL ) + { + vParTestSetLED( mainCHECK_TASK_LED, pdTRUE ); + } + + ulCalculatedValue /= 15UL; + + if( ulCalculatedValue != 80434094UL ) + { + vParTestSetLED( mainCHECK_TASK_LED, pdTRUE ); + } + + ulCalculatedValue += 918273UL; + + if( ulCalculatedValue != 81352367UL ) + { + vParTestSetLED( mainCHECK_TASK_LED, pdTRUE ); + } + } +} +/*-----------------------------------------------------------*/ + Index: PIC18_MPLAB/main3.c =================================================================== --- PIC18_MPLAB/main3.c (nonexistent) +++ PIC18_MPLAB/main3.c (revision 587) @@ -0,0 +1,211 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* + * THIS DEMO APPLICATION REQUIRES A LOOPBACK CONNECTOR TO BE FITTED TO THE PIC + * USART PORT - connect pin 2 to pin 3 on J2. + * + * 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 40 pin devices. The 64 and 80 pin + * devices require a more costly development platform and are not so readily + * available. + * + * The RTOSDemo3 project is configured for a PIC18F452 device. Main3.c starts + * 5 tasks (including the idle task). + * + * The first task repeatedly transmits a string of characters on the PIC USART + * port. The second task receives the characters, checking that the correct + * sequence is maintained (i.e. what is transmitted is identical to that + * received). Each transmitted and each received character causes an LED to + * flash. See demo/common/minimal/comtest. c for more information. + * + * The third task continuously performs a 32 bit calculation. This is a good + * test of the context switch mechanism as the 8 bit architecture requires + * the use of several file registers to perform the 32 bit operations. See + * demo/common/minimal/integer. c for more information. + * + * The third task is the check task. This periodically checks that the other + * tasks are still running and have not experienced any errors. If no errors + * have been reported by either the comms or integer tasks an LED is flashed + * with a frequency mainNO_ERROR_CHECK_PERIOD. If an error is discovered the + * frequency is increased to mainERROR_FLASH_RATE. + * + * The check task also provides a visual indication of a system reset by + * flashing the one remaining LED (mainRESET_LED) when it starts. After + * this initial flash mainRESET_LED should remain off. + * + * http://www.FreeRTOS.org contains important information on the use of the + * PIC18F port. + */ + +/* +Changes from V2.0.0 + + + Delay periods are now specified using variables and constants of + portTickType rather than unsigned long. +*/ + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "task.h" + +/* Demo app include files. */ +#include "partest.h" +#include "serial.h" +#include "comtest.h" +#include "integer.h" + +/* Priority definitions for the LED tasks. Other tasks just use the idle +priority. */ +#define mainCOMM_TEST_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portBASE_TYPE ) 2 ) +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned portBASE_TYPE ) 3 ) + +/* 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 ) 1000 / portTICK_RATE_MS ) +#define mainERROR_CHECK_PERIOD ( ( portTickType ) 100 / portTICK_RATE_MS ) + +/* The period for which mainRESET_LED remain on every reset. */ +#define mainRESET_LED_PERIOD ( ( portTickType ) 500 / portTICK_RATE_MS ) + +/* 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 portBASE_TYPE ) 2 ) + +/* The LED that is flashed by the check task at a rate that indicates the +error status. */ +#define mainCHECK_TASK_LED ( ( unsigned portBASE_TYPE ) 1 ) + +/* The LED that is flashed once upon every reset. */ +#define mainRESET_LED ( ( unsigned portBASE_TYPE ) 0 ) + +/* Constants required for the communications. */ +#define mainCOMMS_QUEUE_LENGTH ( ( unsigned portBASE_TYPE ) 5 ) +#define mainBAUD_RATE ( ( unsigned long ) 57600 ) +/*-----------------------------------------------------------*/ + +/* + * Task function which periodically checks the other tasks for errors. Flashes + * an LED at a rate that indicates whether an error has ever been detected. + */ +static void vErrorChecks( void *pvParameters ); + +/*-----------------------------------------------------------*/ + +/* Creates the tasks, then starts the scheduler. */ +void main( void ) +{ + /* Initialise the required hardware. */ + vParTestInitialise(); + + /* Initialise the block memory allocator. */ + vPortInitialiseBlocks(); + + /* Start the standard comtest tasks as defined in demo/common/minimal. */ + vAltStartComTestTasks( mainCOMM_TEST_PRIORITY, mainBAUD_RATE, mainCOMM_TX_RX_LED ); + + /* Start the standard 32bit calculation task as defined in + demo/common/minimal. */ + vStartIntegerMathTasks( tskIDLE_PRIORITY ); + + /* Start the check task defined in this file. */ + xTaskCreate( vErrorChecks, ( const char * const ) "Check", configMINIMAL_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* Start the scheduler. This will never return. */ + vTaskStartScheduler(); +} +/*-----------------------------------------------------------*/ + +static void vErrorChecks( void *pvParameters ) +{ +portTickType xDelayTime = mainNO_ERROR_CHECK_PERIOD; +volatile unsigned long ulDummy = 3UL; + + /* Toggle the LED so we can see when a reset occurs. */ + vParTestSetLED( mainRESET_LED, pdTRUE ); + vTaskDelay( mainRESET_LED_PERIOD ); + vParTestSetLED( mainRESET_LED, pdFALSE ); + + /* 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. */ + vTaskDelay( xDelayTime ); + + /* Perform an integer calculation - just to ensure the registers + get used. The result is not important. */ + ulDummy *= 3UL; + + /* Check all the other tasks are running, and running without ever + having an error. The delay period is lowered if an error is reported, + causing the LED to flash at a higher rate. */ + if( xAreIntegerMathsTaskStillRunning() == pdFALSE ) + { + xDelayTime = mainERROR_CHECK_PERIOD; + } + + if( xAreComTestTasksStillRunning() == pdFALSE ) + { + xDelayTime = mainERROR_CHECK_PERIOD; + } + + /* Flash the LED for visual feedback. The rate of the flash will + indicate the health of the system. */ + vParTestToggleLED( mainCHECK_TASK_LED ); + } +} +/*-----------------------------------------------------------*/ + Index: PIC18_MPLAB/rtosdemo1.mcp =================================================================== --- PIC18_MPLAB/rtosdemo1.mcp (nonexistent) +++ PIC18_MPLAB/rtosdemo1.mcp (revision 587) @@ -0,0 +1,74 @@ +[HEADER] +magic_cookie={66E99B07-E706-4689-9E80-9B2582898A13} +file_version=1.0 +[PATH_INFO] +BuildDirPolicy=BuildDirIsSourceDir +dir_src= +dir_bin= +dir_tmp= +dir_sin= +dir_inc=.;.\include;..\include;..\..\include;..\..\..\include;..\..\Source\include;..\..\..\Source\include;..\Demo\PIC18_MPLAB;..\..\..\Demo\PIC18_MPLAB;..\..\..\..\Demo\PIC18_MPLAB;C:\Devtools\Microchip\MCC18\h;..\Common\include;..\..\Common\include +dir_lib=C:\Devtools\Microchip\MCC18\lib +dir_lkr= +[CAT_FILTERS] +filter_src=*.asm;*.c +filter_inc=*.h;*.inc +filter_obj=*.o +filter_lib=*.lib +filter_lkr=*.lkr +[OTHER_FILES] +file_000=no +file_001=no +file_002=no +file_003=no +file_004=no +file_005=no +file_006=no +file_007=no +file_008=no +file_009=no +file_010=no +file_011=no +file_012=no +file_013=no +file_014=no +file_015=no +file_016=no +file_017=no +file_018=no +file_019=no +file_020=no +[FILE_INFO] +file_000=..\..\Source\tasks.c +file_001=..\..\Source\queue.c +file_002=..\..\Source\list.c +file_003=..\..\Source\portable\MPLAB\PIC18F\port.c +file_004=..\Common\Minimal\PollQ.c +file_005=main1.c +file_006=ParTest\ParTest.c +file_007=serial\serial.c +file_008=..\Common\Minimal\integer.c +file_009=..\..\Source\portable\MemMang\heap_1.c +file_010=..\..\Source\portable\MPLAB\PIC18F\portmacro.h +file_011=..\..\Source\include\task.h +file_012=..\..\Source\include\list.h +file_013=..\..\Source\include\portable.h +file_014=..\..\Source\include\projdefs.h +file_015=..\..\Source\include\queue.h +file_016=..\Common\include\integer.h +file_017=..\Common\include\PollQ.h +file_018=..\Common\include\serial.h +file_019=FreeRTOSConfig.h +file_020=18f452.lkr +[SUITE_INFO] +suite_guid={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +suite_state= +[TOOL_SETTINGS] +TS{DD2213A8-6310-47B1-8376-9430CDFC013F}=/aINHX8M +TS{BFD27FBA-4A02-4C0E-A5E5-B812F3E7707C}=/m"$(BINDIR_)$(TARGETBASE).map" /aINHX8M /o"$(TARGETBASE).cof" +TS{C2AF05E7-1416-4625-923D-E114DB6E2B96}=-w3 -DMPLAB_PIC18F_PORT -Ls -Opa- -nw 2074 -nw 2066 +TS{ADE93A55-C7C7-4D4D-A4BA-59305F7D0391}= +[INSTRUMENTED_TRACE] +enable=0 +transport=0 +format=0 Index: PIC18_MPLAB/readme.txt =================================================================== --- PIC18_MPLAB/readme.txt (nonexistent) +++ PIC18_MPLAB/readme.txt (revision 587) @@ -0,0 +1,12 @@ +Unfortunately the project files: + +RTOSDemo1.mcp +RTOSDemo2.mcp +and RTOSDemo3.mcp + +contain absolute paths. I don't know how to get around this, so if somebody knows, let me know! + +Edit the paths in a text editor before use. + +See the PIC port section of www.FreeRTOS.org for more information. + Index: PIC18_MPLAB/rtosdemo2.mcp =================================================================== --- PIC18_MPLAB/rtosdemo2.mcp (nonexistent) +++ PIC18_MPLAB/rtosdemo2.mcp (revision 587) @@ -0,0 +1,68 @@ +[HEADER] +magic_cookie={66E99B07-E706-4689-9E80-9B2582898A13} +file_version=1.0 +[PATH_INFO] +dir_src= +dir_bin= +dir_tmp= +dir_sin= +dir_inc=.;.\include;..\include;..\..\include;..\..\..\include;..\..\Source\include;..\..\..\Source\include;..\Demo\PIC18_MPLAB;..\..\..\Demo\PIC18_MPLAB;..\..\..\..\Demo\PIC18_MPLAB;C:\Devtools\Microchip\MCC18\h;..\Common\include;..\..\Common\include +dir_lib=C:\Devtools\Microchip\MCC18\lib +dir_lkr= +[CAT_FILTERS] +filter_src=*.asm;*.c +filter_inc=*.h;*.inc +filter_obj=*.o +filter_lib=*.lib +filter_lkr=*.lkr +[OTHER_FILES] +file_000=no +file_001=no +file_002=no +file_003=no +file_004=no +file_005=no +file_006=no +file_007=no +file_008=no +file_009=no +file_010=no +file_011=no +file_012=no +file_013=no +file_014=no +file_015=no +file_016=no +file_017=no +file_018=no +[FILE_INFO] +file_000=main2.c +file_001=serial\serial.c +file_002=ParTest\ParTest.c +file_003=..\..\Source\tasks.c +file_004=..\..\Source\queue.c +file_005=..\..\Source\list.c +file_006=..\..\Source\portable\MemMang\heap_1.c +file_007=..\Common\Minimal\flash.c +file_008=..\..\Source\portable\MPLAB\PIC18F\port.c +file_009=..\..\Source\portable\MPLAB\PIC18F\portmacro.h +file_010=..\..\Source\include\task.h +file_011=..\..\Source\include\list.h +file_012=..\..\Source\include\portable.h +file_013=..\..\Source\include\projdefs.h +file_014=..\..\Source\include\queue.h +file_015=..\Common\include\serial.h +file_016=..\Common\include\flash.h +file_017=FreeRTOSConfig.h +file_018=18f452.lkr +[SUITE_INFO] +suite_guid={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +suite_state= +[TOOL_SETTINGS] +TS{DD2213A8-6310-47B1-8376-9430CDFC013F}=/aINHX8M +TS{BFD27FBA-4A02-4C0E-A5E5-B812F3E7707C}=/m"$(BINDIR_)$(TARGETBASE).map" /aINHX8M /o"$(TARGETBASE).cof" +TS{C2AF05E7-1416-4625-923D-E114DB6E2B96}=-DMPLAB_PIC18F_PORT -Ls -Opa- -nw 2074 -nw 2066 +TS{ADE93A55-C7C7-4D4D-A4BA-59305F7D0391}= +[TOOL_LOC_STAMPS] +tool_loc{96C98149-AA1B-4CF9-B967-FAE79CAB663C}=D:\DevTools\mcc18\bin\mplink.exe +tool_loc{E56A1C86-9D32-4DF6-8C34-FE0388B1B644}=D:\DevTools\mcc18\bin\mcc18.exe Index: PIC18_MPLAB/makebin1.bat =================================================================== --- PIC18_MPLAB/makebin1.bat (nonexistent) +++ PIC18_MPLAB/makebin1.bat (revision 587) @@ -0,0 +1,3 @@ +del rtosdemo.hex +copy rtosdemo1.hex rtosdemo.hex +hex2bin rtosdemo.hex Index: PIC18_MPLAB/rtosdemo3.mcp =================================================================== --- PIC18_MPLAB/rtosdemo3.mcp (nonexistent) +++ PIC18_MPLAB/rtosdemo3.mcp (revision 587) @@ -0,0 +1,70 @@ +[HEADER] +magic_cookie={66E99B07-E706-4689-9E80-9B2582898A13} +file_version=1.0 +[PATH_INFO] +dir_src= +dir_bin= +dir_tmp= +dir_sin= +dir_inc=.;.\include;..\include;..\..\include;..\..\..\include;..\..\Source\include;..\..\..\Source\include;..\Demo\PIC18_MPLAB;..\..\..\Demo\PIC18_MPLAB;..\..\..\..\Demo\PIC18_MPLAB;C:\Devtools\Microchip\MCC18\h;..\Common\include;..\..\Common\include +dir_lib=C:\Devtools\Microchip\MCC18\lib +dir_lkr= +[CAT_FILTERS] +filter_src=*.asm;*.c +filter_inc=*.h;*.inc +filter_obj=*.o +filter_lib=*.lib +filter_lkr=*.lkr +[OTHER_FILES] +file_000=no +file_001=no +file_002=no +file_003=no +file_004=no +file_005=no +file_006=no +file_007=no +file_008=no +file_009=no +file_010=no +file_011=no +file_012=no +file_013=no +file_014=no +file_015=no +file_016=no +file_017=no +file_018=no +file_019=no +[FILE_INFO] +file_000=..\..\Source\tasks.c +file_001=..\..\Source\queue.c +file_002=..\..\Source\list.c +file_003=..\..\Source\portable\MPLAB\PIC18F\port.c +file_004=serial\serial.c +file_005=main3.c +file_006=..\Common\Minimal\comtest.c +file_007=..\Common\Minimal\integer.c +file_008=..\..\Source\portable\MemMang\heap_1.c +file_009=ParTest\ParTest.c +file_010=..\..\Source\portable\MPLAB\PIC18F\portmacro.h +file_011=..\..\Source\include\task.h +file_012=..\..\Source\include\list.h +file_013=..\..\Source\include\portable.h +file_014=..\..\Source\include\projdefs.h +file_015=..\..\Source\include\queue.h +file_016=..\Common\include\serial.h +file_017=..\Common\include\comtest.h +file_018=FreeRTOSConfig.h +file_019=18f452.lkr +[SUITE_INFO] +suite_guid={5B7D72DD-9861-47BD-9F60-2BE967BF8416} +suite_state= +[TOOL_SETTINGS] +TS{DD2213A8-6310-47B1-8376-9430CDFC013F}=/aINHX8M +TS{BFD27FBA-4A02-4C0E-A5E5-B812F3E7707C}=/m"$(BINDIR_)$(TARGETBASE).map" /aINHX8M /o"$(TARGETBASE).cof" +TS{C2AF05E7-1416-4625-923D-E114DB6E2B96}=-DMPLAB_PIC18F_PORT -Ls -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw 2074 -nw 2066 +TS{ADE93A55-C7C7-4D4D-A4BA-59305F7D0391}= +[TOOL_LOC_STAMPS] +tool_loc{96C98149-AA1B-4CF9-B967-FAE79CAB663C}=D:\DevTools\mcc18\bin\mplink.exe +tool_loc{E56A1C86-9D32-4DF6-8C34-FE0388B1B644}=D:\DevTools\mcc18\bin\mcc18.exe Index: PIC18_MPLAB/makebin2.bat =================================================================== --- PIC18_MPLAB/makebin2.bat (nonexistent) +++ PIC18_MPLAB/makebin2.bat (revision 587) @@ -0,0 +1,3 @@ +del rtosdemo.hex +copy rtosdemo2.hex rtosdemo.hex +hex2bin rtosdemo.hex Index: PIC18_MPLAB/makebin3.bat =================================================================== --- PIC18_MPLAB/makebin3.bat (nonexistent) +++ PIC18_MPLAB/makebin3.bat (revision 587) @@ -0,0 +1,3 @@ +del rtosdemo.hex +copy rtosdemo3.hex rtosdemo.hex +hex2bin rtosdemo.hex Index: PIC18_WizC/serial/serial.c =================================================================== --- PIC18_WizC/serial/serial.c (nonexistent) +++ PIC18_WizC/serial/serial.c (revision 587) @@ -0,0 +1,199 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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; +portBASE_TYPE xHigherPriorityTaskWoken; + +/*-----------------------------------------------------------*/ + +xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned char ucQueueLength ) +{ + unsigned short usSPBRG; + + /* Create the queues used by the ISR's to interface to tasks. */ + xRxedChars = xQueueCreate( ucQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) ); + xCharsForTx = xQueueCreate( ucQueueLength, ( unsigned portBASE_TYPE ) sizeof( char ) ); + + 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 char ucBufferLength ) +{ + /* This is not implemented in this port. + Use xSerialPortInitMinimal() instead. */ + return NULL; +} +/*-----------------------------------------------------------*/ + +portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, char *pcRxedChar, portTickType xBlockTime ) +{ + /* Get the next character from the buffer. Return false if no characters + are available, or arrive before xBlockTime expires. */ + if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) ) + { + return ( char ) pdTRUE; + } + + return ( char ) pdFALSE; +} +/*-----------------------------------------------------------*/ + +portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, char 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 ) != ( char ) 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. */ +} Index: PIC18_WizC/serial/isrSerialRx.c =================================================================== --- PIC18_WizC/serial/isrSerialRx.c (nonexistent) +++ PIC18_WizC/serial/isrSerialRx.c (revision 587) @@ -0,0 +1,131 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 char cChar; + extern portBASE_TYPE xHigherPriorityTaskWoken; + #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; + } + + xHigherPriorityTaskWoken = pdFALSE; + xQueueSendFromISR( xRxedChars, ( const void * ) &cChar, &xHigherPriorityTaskWoken ); + + if( xHigherPriorityTaskWoken ) + { + uxSwitchRequested = pdTRUE; + } + } + } +} + +#endif /* _FREERTOS_SERIAL_ISRSERIALRX_C */ Index: PIC18_WizC/serial/isrSerialTx.c =================================================================== --- PIC18_WizC/serial/isrSerialTx.c (nonexistent) +++ PIC18_WizC/serial/isrSerialTx.c (revision 587) @@ -0,0 +1,120 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 char 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 */ Index: PIC18_WizC/ParTest/ParTest.c =================================================================== --- PIC18_WizC/ParTest/ParTest.c (nonexistent) +++ PIC18_WizC/ParTest/ParTest.c (revision 587) @@ -0,0 +1,146 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +Changes from V3.0.0 + +Changes from V3.0.1 +*/ + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include + +#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 short ) 0 ) +#define partstSET_OUTPUT ( ( unsigned short ) 1 ) +#define partstCLEAR_OUTPUT ( ( unsigned short ) 0 ) + +#define partstENABLE_GENERAL_IO ( ( unsigned char ) 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 char ucLED, char cValue ) +{ + /* We are only using the top nibble, so LED 0 corresponds to bit 4. */ + vTaskSuspendAll(); + { + switch( ucLED ) + { + case 3 : bRD7 = ( short ) cValue; + break; + case 2 : bRD6 = ( short ) cValue; + break; + case 1 : bRD5 = ( short ) cValue; + break; + case 0 : bRD4 = ( short ) cValue; + break; + default : /* There are only 4 LED's. */ + break; + } + } + xTaskResumeAll(); +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned char 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(); +} + + + Index: PIC18_WizC/Demo1/WIZCmake.h =================================================================== --- PIC18_WizC/Demo1/WIZCmake.h (nonexistent) +++ PIC18_WizC/Demo1/WIZCmake.h (revision 587) @@ -0,0 +1,71 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 Index: PIC18_WizC/Demo1/MallocConfig.h =================================================================== --- PIC18_WizC/Demo1/MallocConfig.h (nonexistent) +++ PIC18_WizC/Demo1/MallocConfig.h (revision 587) @@ -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 */ Index: PIC18_WizC/Demo1/FreeRTOSConfig.h =================================================================== --- PIC18_WizC/Demo1/FreeRTOSConfig.h (nonexistent) +++ PIC18_WizC/Demo1/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,105 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#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 */ Index: PIC18_WizC/Demo1/main.c =================================================================== --- PIC18_WizC/Demo1/main.c (nonexistent) +++ PIC18_WizC/Demo1/main.c (revision 587) @@ -0,0 +1,223 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 +#include + +#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< + +/* +** 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 Index: PIC18_WizC/Demo1/Demo1.PC =================================================================== --- PIC18_WizC/Demo1/Demo1.PC (nonexistent) +++ PIC18_WizC/Demo1/Demo1.PC (revision 587) @@ -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 Index: PIC18_WizC/Demo1/interrupt.c =================================================================== --- PIC18_WizC/Demo1/interrupt.c (nonexistent) +++ PIC18_WizC/Demo1/interrupt.c (revision 587) @@ -0,0 +1,130 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* Scheduler include files. */ +#include +#include +#include + +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 + +/******************************************************************************* +** 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 +} Index: PIC18_WizC/Demo2/WIZCmake.h =================================================================== --- PIC18_WizC/Demo2/WIZCmake.h (nonexistent) +++ PIC18_WizC/Demo2/WIZCmake.h (revision 587) @@ -0,0 +1,74 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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/> Index: PIC18_WizC/Demo2/MallocConfig.h =================================================================== --- PIC18_WizC/Demo2/MallocConfig.h (nonexistent) +++ PIC18_WizC/Demo2/MallocConfig.h (revision 587) @@ -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 */ Index: PIC18_WizC/Demo2/main.c =================================================================== --- PIC18_WizC/Demo2/main.c (nonexistent) +++ PIC18_WizC/Demo2/main.c (revision 587) @@ -0,0 +1,219 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 +#include + +/* 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 char ) 3 ) + +/* Priority definitions for some of the tasks. Other tasks just use the idle +priority. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 3 ) +#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 ) +#define mainQUEUE_POLL_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 ) +#define mainSEM_TEST_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 ) +#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 0 ) + +/* Constants required for the communications. Only one character is ever +transmitted. */ +#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 ) +#define mainNO_BLOCK ( ( portTickType ) 0 ) +#define mainBAUD_RATE ( ( unsigned long ) 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 char 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 char * 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; +char 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 char prvCheckOtherTasksAreStillRunning( void ) +{ + char cErrorHasOccurred = ( char ) pdFALSE; + + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + if( xArePollingQueuesStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + if( xAreSemaphoreTasksStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + return cErrorHasOccurred; +} +/*-----------------------------------------------------------*/ + + Index: PIC18_WizC/Demo2/FreeRTOSConfig.h =================================================================== --- PIC18_WizC/Demo2/FreeRTOSConfig.h (nonexistent) +++ PIC18_WizC/Demo2/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,105 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +#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. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#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 */ Index: PIC18_WizC/Demo2/fuses.c =================================================================== --- PIC18_WizC/Demo2/fuses.c (nonexistent) +++ PIC18_WizC/Demo2/fuses.c (revision 587) @@ -0,0 +1,79 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* +** 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 Index: PIC18_WizC/Demo2/Demo2.PC =================================================================== --- PIC18_WizC/Demo2/Demo2.PC (nonexistent) +++ PIC18_WizC/Demo2/Demo2.PC (revision 587) @@ -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 Index: PIC18_WizC/Demo2/interrupt.c =================================================================== --- PIC18_WizC/Demo2/interrupt.c (nonexistent) +++ PIC18_WizC/Demo2/interrupt.c (revision 587) @@ -0,0 +1,139 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* Scheduler include files. */ +#include +#include +#include + +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 + +/******************************************************************************* +** 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 +} Index: PIC18_WizC/Demo3/WIZCmake.h =================================================================== --- PIC18_WizC/Demo3/WIZCmake.h (nonexistent) +++ PIC18_WizC/Demo3/WIZCmake.h (revision 587) @@ -0,0 +1,74 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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/> Index: PIC18_WizC/Demo3/MallocConfig.h =================================================================== --- PIC18_WizC/Demo3/MallocConfig.h (nonexistent) +++ PIC18_WizC/Demo3/MallocConfig.h (revision 587) @@ -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 */ Index: PIC18_WizC/Demo3/main.c =================================================================== --- PIC18_WizC/Demo3/main.c (nonexistent) +++ PIC18_WizC/Demo3/main.c (revision 587) @@ -0,0 +1,211 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 +#include + +/* 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 char ) 3 ) + +/* Priority definitions for some of the tasks. Other tasks just use the idle +priority. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 3 ) +#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 ) +#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 ) +#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 0 ) + +/* Constants required for the communications. Only one character is ever +transmitted. */ +#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 ) +#define mainNO_BLOCK ( ( portTickType ) 0 ) +#define mainBAUD_RATE ( ( unsigned long ) 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 char 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 char * 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; + char 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 char prvCheckOtherTasksAreStillRunning( void ) +{ + char cErrorHasOccurred = ( char ) pdFALSE; + + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + return cErrorHasOccurred; +} +/*-----------------------------------------------------------*/ + + Index: PIC18_WizC/Demo3/FreeRTOSConfig.h =================================================================== --- PIC18_WizC/Demo3/FreeRTOSConfig.h (nonexistent) +++ PIC18_WizC/Demo3/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,105 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#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 */ Index: PIC18_WizC/Demo3/fuses.c =================================================================== --- PIC18_WizC/Demo3/fuses.c (nonexistent) +++ PIC18_WizC/Demo3/fuses.c (revision 587) @@ -0,0 +1,79 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* +** 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 Index: PIC18_WizC/Demo3/Demo3.PC =================================================================== --- PIC18_WizC/Demo3/Demo3.PC (nonexistent) +++ PIC18_WizC/Demo3/Demo3.PC (revision 587) @@ -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 Index: PIC18_WizC/Demo3/interrupt.c =================================================================== --- PIC18_WizC/Demo3/interrupt.c (nonexistent) +++ PIC18_WizC/Demo3/interrupt.c (revision 587) @@ -0,0 +1,139 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* Scheduler include files. */ +#include +#include +#include + +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 + +/******************************************************************************* +** 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 +} Index: PIC18_WizC/Demo4/WIZCmake.h =================================================================== --- PIC18_WizC/Demo4/WIZCmake.h (nonexistent) +++ PIC18_WizC/Demo4/WIZCmake.h (revision 587) @@ -0,0 +1,74 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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/> Index: PIC18_WizC/Demo4/MallocConfig.h =================================================================== --- PIC18_WizC/Demo4/MallocConfig.h (nonexistent) +++ PIC18_WizC/Demo4/MallocConfig.h (revision 587) @@ -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 */ Index: PIC18_WizC/Demo4/FreeRTOSConfig.h =================================================================== --- PIC18_WizC/Demo4/FreeRTOSConfig.h (nonexistent) +++ PIC18_WizC/Demo4/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,105 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#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 */ Index: PIC18_WizC/Demo4/main.c =================================================================== --- PIC18_WizC/Demo4/main.c (nonexistent) +++ PIC18_WizC/Demo4/main.c (revision 587) @@ -0,0 +1,210 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 +#include + +/* 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 char ) 3 ) + +/* Priority definitions for some of the tasks. Other tasks just use the idle +priority. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 3 ) +#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 ) +#define mainINTEGER_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 0 ) + +/* Constants required for the communications. Only one character is ever +transmitted. */ +#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 ) +#define mainNO_BLOCK ( ( portTickType ) 0 ) +#define mainBAUD_RATE ( ( unsigned long ) 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 char 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 char * 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; + char 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 char prvCheckOtherTasksAreStillRunning( void ) +{ + char cErrorHasOccurred = ( char ) pdFALSE; + + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + if( xAreDynamicPriorityTasksStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + return cErrorHasOccurred; +} +/*-----------------------------------------------------------*/ + + Index: PIC18_WizC/Demo4/fuses.c =================================================================== --- PIC18_WizC/Demo4/fuses.c (nonexistent) +++ PIC18_WizC/Demo4/fuses.c (revision 587) @@ -0,0 +1,79 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* +** 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 Index: PIC18_WizC/Demo4/Demo4.PC =================================================================== --- PIC18_WizC/Demo4/Demo4.PC (nonexistent) +++ PIC18_WizC/Demo4/Demo4.PC (revision 587) @@ -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 Index: PIC18_WizC/Demo4/interrupt.c =================================================================== --- PIC18_WizC/Demo4/interrupt.c (nonexistent) +++ PIC18_WizC/Demo4/interrupt.c (revision 587) @@ -0,0 +1,139 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* Scheduler include files. */ +#include +#include +#include + +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 + +/******************************************************************************* +** 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 +} Index: PIC18_WizC/Demo5/WIZCmake.h =================================================================== --- PIC18_WizC/Demo5/WIZCmake.h (nonexistent) +++ PIC18_WizC/Demo5/WIZCmake.h (revision 587) @@ -0,0 +1,74 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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/> Index: PIC18_WizC/Demo5/MallocConfig.h =================================================================== --- PIC18_WizC/Demo5/MallocConfig.h (nonexistent) +++ PIC18_WizC/Demo5/MallocConfig.h (revision 587) @@ -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 */ Index: PIC18_WizC/Demo5/main.c =================================================================== --- PIC18_WizC/Demo5/main.c (nonexistent) +++ PIC18_WizC/Demo5/main.c (revision 587) @@ -0,0 +1,199 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 +#include + +/* 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 char ) 3 ) + +/* Priority definitions for some of the tasks. Other tasks just use the idle +priority. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 ) +#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 ) + +/* Constants required for the communications. Only one character is ever +transmitted. */ +#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 ) +#define mainNO_BLOCK ( ( portTickType ) 0 ) +#define mainBAUD_RATE ( ( unsigned long ) 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 char 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 char * 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; +char 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 char prvCheckOtherTasksAreStillRunning( void ) +{ + char cErrorHasOccurred = ( char ) pdFALSE; + + if( xAreMathsTaskStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + return cErrorHasOccurred; +} +/*-----------------------------------------------------------*/ + + Index: PIC18_WizC/Demo5/FreeRTOSConfig.h =================================================================== --- PIC18_WizC/Demo5/FreeRTOSConfig.h (nonexistent) +++ PIC18_WizC/Demo5/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,105 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#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 */ Index: PIC18_WizC/Demo5/fuses.c =================================================================== --- PIC18_WizC/Demo5/fuses.c (nonexistent) +++ PIC18_WizC/Demo5/fuses.c (revision 587) @@ -0,0 +1,79 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* +** 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 Index: PIC18_WizC/Demo5/Demo5.PC =================================================================== --- PIC18_WizC/Demo5/Demo5.PC (nonexistent) +++ PIC18_WizC/Demo5/Demo5.PC (revision 587) @@ -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 Index: PIC18_WizC/Demo5/interrupt.c =================================================================== --- PIC18_WizC/Demo5/interrupt.c (nonexistent) +++ PIC18_WizC/Demo5/interrupt.c (revision 587) @@ -0,0 +1,139 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* Scheduler include files. */ +#include +#include +#include + +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 + +/******************************************************************************* +** 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 +} Index: PIC18_WizC/Demo6/WIZCmake.h =================================================================== --- PIC18_WizC/Demo6/WIZCmake.h (nonexistent) +++ PIC18_WizC/Demo6/WIZCmake.h (revision 587) @@ -0,0 +1,74 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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/> Index: PIC18_WizC/Demo6/MallocConfig.h =================================================================== --- PIC18_WizC/Demo6/MallocConfig.h (nonexistent) +++ PIC18_WizC/Demo6/MallocConfig.h (revision 587) @@ -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 */ Index: PIC18_WizC/Demo6/main.c =================================================================== --- PIC18_WizC/Demo6/main.c (nonexistent) +++ PIC18_WizC/Demo6/main.c (revision 587) @@ -0,0 +1,191 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 +#include + +/* 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 char ) 3 ) + +/* Priority definitions for some of the tasks. Other tasks just use the idle +priority. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 ) +#define mainCOMM_TEST_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 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 char ) 0 ) + +/* Constants required for the communications. */ +#define mainBAUD_RATE ( ( unsigned long ) 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 char 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 char * 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; +char 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 char prvCheckOtherTasksAreStillRunning( void ) +{ + char cErrorHasOccurred = ( char ) pdFALSE; + + if( xAreComTestTasksStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + return cErrorHasOccurred; +} +/*-----------------------------------------------------------*/ + + Index: PIC18_WizC/Demo6/FreeRTOSConfig.h =================================================================== --- PIC18_WizC/Demo6/FreeRTOSConfig.h (nonexistent) +++ PIC18_WizC/Demo6/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,105 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#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 */ Index: PIC18_WizC/Demo6/fuses.c =================================================================== --- PIC18_WizC/Demo6/fuses.c (nonexistent) +++ PIC18_WizC/Demo6/fuses.c (revision 587) @@ -0,0 +1,79 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* +** 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 Index: PIC18_WizC/Demo6/Demo6.PC =================================================================== --- PIC18_WizC/Demo6/Demo6.PC (nonexistent) +++ PIC18_WizC/Demo6/Demo6.PC (revision 587) @@ -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 Index: PIC18_WizC/Demo6/interrupt.c =================================================================== --- PIC18_WizC/Demo6/interrupt.c (nonexistent) +++ PIC18_WizC/Demo6/interrupt.c (revision 587) @@ -0,0 +1,139 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* Scheduler include files. */ +#include +#include +#include + +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 + +/******************************************************************************* +** 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 +} Index: PIC18_WizC/Demo7/WIZCmake.h =================================================================== --- PIC18_WizC/Demo7/WIZCmake.h (nonexistent) +++ PIC18_WizC/Demo7/WIZCmake.h (revision 587) @@ -0,0 +1,74 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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/> Index: PIC18_WizC/Demo7/MallocConfig.h =================================================================== --- PIC18_WizC/Demo7/MallocConfig.h (nonexistent) +++ PIC18_WizC/Demo7/MallocConfig.h (revision 587) @@ -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 */ Index: PIC18_WizC/Demo7/main.c =================================================================== --- PIC18_WizC/Demo7/main.c (nonexistent) +++ PIC18_WizC/Demo7/main.c (revision 587) @@ -0,0 +1,205 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 +#include + +/* 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 char ) 3 ) + +/* Priority definitions for some of the tasks. Other tasks just use the idle +priority. */ +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 ) +#define mainLED_FLASH_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 2 ) +#define mainCREATOR_TASK_PRIORITY ( tskIDLE_PRIORITY + ( unsigned char ) 1 ) + +/* Constants required for the communications. Only one character is ever +transmitted. */ +#define mainCOMMS_QUEUE_LENGTH ( ( unsigned char ) 5 ) +#define mainNO_BLOCK ( ( portTickType ) 0 ) +#define mainBAUD_RATE ( ( unsigned long ) 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 char 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 char * 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; +char 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 char prvCheckOtherTasksAreStillRunning( void ) +{ + char cErrorHasOccurred = ( char ) pdFALSE; + + if( xIsCreateTaskStillRunning() != pdTRUE ) + { + cErrorHasOccurred = ( char ) pdTRUE; + } + + return cErrorHasOccurred; +} +/*-----------------------------------------------------------*/ + + Index: PIC18_WizC/Demo7/FreeRTOSConfig.h =================================================================== --- PIC18_WizC/Demo7/FreeRTOSConfig.h (nonexistent) +++ PIC18_WizC/Demo7/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,105 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#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 */ Index: PIC18_WizC/Demo7/fuses.c =================================================================== --- PIC18_WizC/Demo7/fuses.c (nonexistent) +++ PIC18_WizC/Demo7/fuses.c (revision 587) @@ -0,0 +1,79 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* +** 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 Index: PIC18_WizC/Demo7/Demo7.PC =================================================================== --- PIC18_WizC/Demo7/Demo7.PC (nonexistent) +++ PIC18_WizC/Demo7/Demo7.PC (revision 587) @@ -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 Index: PIC18_WizC/Demo7/interrupt.c =================================================================== --- PIC18_WizC/Demo7/interrupt.c (nonexistent) +++ PIC18_WizC/Demo7/interrupt.c (revision 587) @@ -0,0 +1,139 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* +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 + +/* Scheduler include files. */ +#include +#include +#include + +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 + +/******************************************************************************* +** 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 +} Index: PIC24_MPLAB/serial/serial.c =================================================================== --- PIC24_MPLAB/serial/serial.c (nonexistent) +++ PIC24_MPLAB/serial/serial.c (revision 587) @@ -0,0 +1,253 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + + +/* BASIC INTERRUPT DRIVEN SERIAL PORT DRIVER. + +NOTE: This driver is primarily to test the scheduler functionality. It does +not effectively use the buffers or DMA and is therefore not intended to be +an example of an efficient driver. */ + +/* Standard include file. */ +#include + +/* Scheduler include files. */ +#include "FreeRTOS.h" +#include "queue.h" +#include "task.h" + +/* Demo app include files. */ +#include "serial.h" + +/* Hardware setup. */ +#define serOUTPUT 0 +#define serINPUT 1 +#define serLOW_SPEED 0 +#define serONE_STOP_BIT 0 +#define serEIGHT_DATA_BITS_NO_PARITY 0 +#define serNORMAL_IDLE_STATE 0 +#define serAUTO_BAUD_OFF 0 +#define serLOOPBACK_OFF 0 +#define serWAKE_UP_DISABLE 0 +#define serNO_HARDWARE_FLOW_CONTROL 0 +#define serSTANDARD_IO 0 +#define serNO_IRDA 0 +#define serCONTINUE_IN_IDLE_MODE 0 +#define serUART_ENABLED 1 +#define serINTERRUPT_ON_SINGLE_CHAR 0 +#define serTX_ENABLE 1 +#define serINTERRUPT_ENABLE 1 +#define serINTERRUPT_DISABLE 0 +#define serCLEAR_FLAG 0 +#define serSET_FLAG 1 + + +/* The queues used to communicate between tasks and ISR's. */ +static xQueueHandle xRxedChars; +static xQueueHandle xCharsForTx; + +static portBASE_TYPE xTxHasEnded; +/*-----------------------------------------------------------*/ + +xComPortHandle xSerialPortInitMinimal( unsigned long ulWantedBaud, unsigned portBASE_TYPE uxQueueLength ) +{ +char cChar; + + /* Create the queues used by the com test task. */ + xRxedChars = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); + xCharsForTx = xQueueCreate( uxQueueLength, ( unsigned portBASE_TYPE ) sizeof( signed char ) ); + + /* Setup the UART. */ + U2MODEbits.BRGH = serLOW_SPEED; + U2MODEbits.STSEL = serONE_STOP_BIT; + U2MODEbits.PDSEL = serEIGHT_DATA_BITS_NO_PARITY; + U2MODEbits.RXINV = serNORMAL_IDLE_STATE; + U2MODEbits.ABAUD = serAUTO_BAUD_OFF; + U2MODEbits.LPBACK = serLOOPBACK_OFF; + U2MODEbits.WAKE = serWAKE_UP_DISABLE; + U2MODEbits.UEN = serNO_HARDWARE_FLOW_CONTROL; + U2MODEbits.IREN = serNO_IRDA; + U2MODEbits.USIDL = serCONTINUE_IN_IDLE_MODE; + U2MODEbits.UARTEN = serUART_ENABLED; + + U2BRG = (unsigned short)(( (float)configCPU_CLOCK_HZ / ( (float)16 * (float)ulWantedBaud ) ) - (float)0.5); + + U2STAbits.URXISEL = serINTERRUPT_ON_SINGLE_CHAR; + U2STAbits.UTXEN = serTX_ENABLE; + U2STAbits.UTXINV = serNORMAL_IDLE_STATE; + U2STAbits.UTXISEL0 = serINTERRUPT_ON_SINGLE_CHAR; + U2STAbits.UTXISEL1 = serINTERRUPT_ON_SINGLE_CHAR; + + /* It is assumed that this function is called prior to the scheduler being + started. Therefore interrupts must not be allowed to occur yet as they + may attempt to perform a context switch. */ + portDISABLE_INTERRUPTS(); + + IFS1bits.U2RXIF = serCLEAR_FLAG; + IFS1bits.U2TXIF = serCLEAR_FLAG; + IPC7bits.U2RXIP = configKERNEL_INTERRUPT_PRIORITY; + IPC7bits.U2TXIP = configKERNEL_INTERRUPT_PRIORITY; + IEC1bits.U2TXIE = serINTERRUPT_ENABLE; + IEC1bits.U2RXIE = serINTERRUPT_ENABLE; + + /* Clear the Rx buffer. */ + while( U2STAbits.URXDA == serSET_FLAG ) + { + cChar = U2RXREG; + } + + xTxHasEnded = pdTRUE; + + return NULL; +} +/*-----------------------------------------------------------*/ + +signed portBASE_TYPE xSerialGetChar( xComPortHandle pxPort, signed char *pcRxedChar, portTickType xBlockTime ) +{ + /* Only one port is supported. */ + ( void ) pxPort; + + /* Get the next character from the buffer. Return false if no characters + are available or arrive before xBlockTime expires. */ + if( xQueueReceive( xRxedChars, pcRxedChar, xBlockTime ) ) + { + return pdTRUE; + } + else + { + return pdFALSE; + } +} +/*-----------------------------------------------------------*/ + +signed portBASE_TYPE xSerialPutChar( xComPortHandle pxPort, signed char cOutChar, portTickType xBlockTime ) +{ + /* Only one port is supported. */ + ( void ) pxPort; + + /* Return false if after the block time there is no room on the Tx queue. */ + if( xQueueSend( xCharsForTx, &cOutChar, xBlockTime ) != pdPASS ) + { + return pdFAIL; + } + + /* A critical section should not be required as xTxHasEnded will not be + written to by the ISR if it is already 0 (is this correct?). */ + if( xTxHasEnded ) + { + xTxHasEnded = pdFALSE; + IFS1bits.U2TXIF = serSET_FLAG; + } + + return pdPASS; +} +/*-----------------------------------------------------------*/ + +void vSerialClose( xComPortHandle xPort ) +{ +} +/*-----------------------------------------------------------*/ + +void __attribute__((__interrupt__, auto_psv)) _U2RXInterrupt( void ) +{ +char cChar; +portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; + + /* Get the character and post it on the queue of Rxed characters. + If the post causes a task to wake force a context switch as the woken task + may have a higher priority than the task we have interrupted. */ + IFS1bits.U2RXIF = serCLEAR_FLAG; + while( U2STAbits.URXDA ) + { + cChar = U2RXREG; + xQueueSendFromISR( xRxedChars, &cChar, &xHigherPriorityTaskWoken ); + } + + if( xHigherPriorityTaskWoken != pdFALSE ) + { + taskYIELD(); + } +} +/*-----------------------------------------------------------*/ + +void __attribute__((__interrupt__, auto_psv)) _U2TXInterrupt( void ) +{ +signed char cChar; +portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; + + /* If the transmit buffer is full we cannot get the next character. + Another interrupt will occur the next time there is space so this does + not matter. */ + IFS1bits.U2TXIF = serCLEAR_FLAG; + while( !( U2STAbits.UTXBF ) ) + { + if( xQueueReceiveFromISR( xCharsForTx, &cChar, &xHigherPriorityTaskWoken ) == pdTRUE ) + { + /* Send the next character queued for Tx. */ + U2TXREG = cChar; + } + else + { + /* Queue empty, nothing to send. */ + xTxHasEnded = pdTRUE; + break; + } + } + + if( xHigherPriorityTaskWoken != pdFALSE ) + { + taskYIELD(); + } +} + + Index: PIC24_MPLAB/timertest.c =================================================================== --- PIC24_MPLAB/timertest.c (nonexistent) +++ PIC24_MPLAB/timertest.c (revision 587) @@ -0,0 +1,162 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* High speed timer test as described in main.c. */ + + +/* Scheduler includes. */ +#include "FreeRTOS.h" + +/* Demo includes. */ +#include "partest.h" + +/* The number of interrupts to pass before we start looking at the jitter. */ +#define timerSETTLE_TIME 5 + +/* The maximum value the 16bit timer can contain. */ +#define timerMAX_COUNT 0xffff + +/*-----------------------------------------------------------*/ + +/* + * Measure the time between this interrupt and the previous interrupt to + * calculate the timing jitter. Remember the maximum value the jitter has + * ever been calculated to be. + */ +static void prvCalculateAndStoreJitter( void ); + +/*-----------------------------------------------------------*/ + +/* The maximum time (in processor clocks) between two consecutive timer +interrupts so far. */ +unsigned portSHORT usMaxJitter = 0; + +/*-----------------------------------------------------------*/ + +void vSetupTimerTest( unsigned portSHORT usFrequencyHz ) +{ + /* T2 is used to generate interrupts. T4 is used to provide an accurate + time measurement. */ + T2CON = 0; + T4CON = 0; + TMR2 = 0; + TMR4 = 0; + + /* Timer 2 is going to interrupt at usFrequencyHz Hz. */ + PR2 = ( unsigned portSHORT ) ( configCPU_CLOCK_HZ / ( unsigned portLONG ) usFrequencyHz ); + + /* Timer 4 is going to free run from minimum to maximum value. */ + PR4 = ( unsigned portSHORT ) timerMAX_COUNT; + + /* Setup timer 2 interrupt priority to be above the kernel priority so + the timer jitter is not effected by the kernel activity. */ + IPC1bits.T2IP = configKERNEL_INTERRUPT_PRIORITY + 1; + + /* Clear the interrupt as a starting condition. */ + IFS0bits.T2IF = 0; + + /* Enable the interrupt. */ + IEC0bits.T2IE = 1; + + /* Start both timers. */ + T2CONbits.TON = 1; + T4CONbits.TON = 1; +} +/*-----------------------------------------------------------*/ + +static void prvCalculateAndStoreJitter( void ) +{ +static unsigned portSHORT usLastCount = 0, usSettleCount = 0; +unsigned portSHORT usThisCount, usDifference; + + /* Capture the timer value as we enter the interrupt. */ + usThisCount = TMR4; + + if( usSettleCount >= timerSETTLE_TIME ) + { + /* What is the difference between the timer value in this interrupt + and the value from the last interrupt. */ + usDifference = usThisCount - usLastCount; + + /* Store the difference in the timer values if it is larger than the + currently stored largest value. The difference over and above the + expected difference will give the 'jitter' in the processing of these + interrupts. */ + if( usDifference > usMaxJitter ) + { + usMaxJitter = usDifference; + } + } + else + { + /* Don't bother storing any values for the first couple of + interrupts. */ + usSettleCount++; + } + + /* Remember what the timer value was this time through, so we can calculate + the difference the next time through. */ + usLastCount = usThisCount; +} +/*-----------------------------------------------------------*/ + +void __attribute__((__interrupt__, auto_psv)) _T2Interrupt( void ) +{ + /* Work out the time between this and the previous interrupt. */ + prvCalculateAndStoreJitter(); + + /* Clear the timer interrupt. */ + IFS0bits.T2IF = 0; +} + + Index: PIC24_MPLAB/RTOSDemo.mcw =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: PIC24_MPLAB/RTOSDemo.mcw =================================================================== --- PIC24_MPLAB/RTOSDemo.mcw (nonexistent) +++ PIC24_MPLAB/RTOSDemo.mcw (revision 587)
PIC24_MPLAB/RTOSDemo.mcw Property changes : Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: PIC24_MPLAB/ParTest/ParTest.c =================================================================== --- PIC24_MPLAB/ParTest/ParTest.c (nonexistent) +++ PIC24_MPLAB/ParTest/ParTest.c (revision 587) @@ -0,0 +1,124 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* Scheduler includes. */ +#include "FreeRTOS.h" + +/* Demo app includes. */ +#include "partest.h" + +#define ptOUTPUT 0 +#define ptALL_OFF 0 + +/*----------------------------------------------------------- + * Simple parallel port IO routines. + *-----------------------------------------------------------*/ + +void vParTestInitialise( void ) +{ + /* The explorer 16 board has LED's on port A. All bits are set as output + so PORTA is read-modified-written directly. */ + TRISA = ptOUTPUT; + PORTA = ptALL_OFF; +} +/*-----------------------------------------------------------*/ + +void vParTestSetLED( unsigned portBASE_TYPE uxLED, signed portBASE_TYPE xValue ) +{ +unsigned portBASE_TYPE uxLEDBit; + + /* Which port A bit is being modified? */ + uxLEDBit = 1 << uxLED; + + if( xValue ) + { + /* Turn the LED on. */ + portENTER_CRITICAL(); + { + PORTA |= uxLEDBit; + } + portEXIT_CRITICAL(); + } + else + { + /* Turn the LED off. */ + portENTER_CRITICAL(); + { + PORTA &= ~uxLEDBit; + } + portEXIT_CRITICAL(); + } +} +/*-----------------------------------------------------------*/ + +void vParTestToggleLED( unsigned portBASE_TYPE uxLED ) +{ +unsigned portBASE_TYPE uxLEDBit; + + uxLEDBit = 1 << uxLED; + portENTER_CRITICAL(); + { + /* If the LED is already on - turn it off. If the LED is already + off, turn it on. */ + if( PORTA & uxLEDBit ) + { + PORTA &= ~uxLEDBit; + } + else + { + PORTA |= uxLEDBit; + } + } + portEXIT_CRITICAL(); +} + Index: PIC24_MPLAB/lcd.c =================================================================== --- PIC24_MPLAB/lcd.c (nonexistent) +++ PIC24_MPLAB/lcd.c (revision 587) @@ -0,0 +1,228 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" + +/* Demo includes. */ +#include "lcd.h" + +/* + * The LCD is written to by more than one task so is controlled by this + * 'gatekeeper' task. This is the only task that is actually permitted to + * access the LCD directly. Other tasks wanting to display a message send + * the message to the gatekeeper. + */ +static void vLCDTask( void *pvParameters ); + +/* + * Setup the peripherals required to communicate with the LCD. + */ +static void prvSetupLCD( void ); + +/* + * Move to the first (0) or second (1) row of the LCD. + */ +static void prvLCDGotoRow( unsigned portSHORT usRow ); + +/* + * Write a string of text to the LCD. + */ +static void prvLCDPutString( portCHAR *pcString ); + +/* + * Clear the LCD. + */ +static void prvLCDClear( void ); + +/*-----------------------------------------------------------*/ + +/* Brief delay to permit the LCD to catch up with commands. */ +#define lcdSHORT_DELAY 3 + +/* SFR that seems to be missing from the standard header files. */ +#define PMAEN *( ( unsigned short * ) 0x60c ) + +/* LCD commands. */ +#define lcdDEFAULT_FUNCTION 0x3c +#define lcdDISPLAY_CONTROL 0x0c +#define lcdCLEAR_DISPLAY 0x01 +#define lcdENTRY_MODE 0x06 + +/* The length of the queue used to send messages to the LCD gatekeeper task. */ +#define lcdQUEUE_SIZE 3 +/*-----------------------------------------------------------*/ + +/* The queue used to send messages to the LCD task. */ +xQueueHandle xLCDQueue; + + +/*-----------------------------------------------------------*/ + +xQueueHandle xStartLCDTask( void ) +{ + /* Create the queue used by the LCD task. Messages for display on the LCD + are received via this queue. */ + xLCDQueue = xQueueCreate( lcdQUEUE_SIZE, sizeof( xLCDMessage ) ); + + /* Start the task that will write to the LCD. The LCD hardware is + initialised from within the task itself so delays can be used. */ + xTaskCreate( vLCDTask, ( signed portCHAR * ) "LCD", configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL ); + + return xLCDQueue; +} +/*-----------------------------------------------------------*/ + +static void prvLCDGotoRow( unsigned portSHORT usRow ) +{ + if( usRow == 0 ) + { + PMADDR = 0x0000; + PMDIN1 = 0x02; + } + else + { + PMADDR = 0x0000; + PMDIN1 = 0xc0; + } + + vTaskDelay( lcdSHORT_DELAY ); +} +/*-----------------------------------------------------------*/ + +static void prvLCDPutString( portCHAR *pcString ) +{ + /* Write out each character with appropriate delay between each. */ + while( *pcString ) + { + PMADDR = 0x0001; + PMDIN1 = *pcString; + pcString++; + vTaskDelay( lcdSHORT_DELAY ); + } +} +/*-----------------------------------------------------------*/ + +static void prvLCDClear( void ) +{ + /* Clear the display. */ + PMADDR = 0x0000; + PMDIN1 = lcdCLEAR_DISPLAY; + vTaskDelay( lcdSHORT_DELAY ); +} +/*-----------------------------------------------------------*/ + +static void prvSetupLCD( void ) +{ + /* Setup the PMP. */ + PMCON = 0x83BF; + PMMODE = 0x3FF; + PMAEN = 1; + PMADDR = 0x0000; + vTaskDelay( lcdSHORT_DELAY ); + + /* Set the default function. */ + PMDIN1 = lcdDEFAULT_FUNCTION; + vTaskDelay( lcdSHORT_DELAY ); + + /* Set the display control. */ + PMDIN1 = lcdDISPLAY_CONTROL; + vTaskDelay( lcdSHORT_DELAY ); + + /* Clear the display. */ + PMDIN1 = lcdCLEAR_DISPLAY; + vTaskDelay( lcdSHORT_DELAY ); + + /* Set the entry mode. */ + PMDIN1 = lcdENTRY_MODE; + vTaskDelay( lcdSHORT_DELAY ); +} +/*-----------------------------------------------------------*/ + +static void vLCDTask( void *pvParameters ) +{ +xLCDMessage xMessage; +unsigned portSHORT usRow = 0; + + /* Initialise the hardware. This uses delays so must not be called prior + to the scheduler being started. */ + prvSetupLCD(); + + /* Welcome message. */ + prvLCDPutString( "www.FreeRTOS.org" ); + + for( ;; ) + { + /* Wait for a message to arrive that requires displaying. */ + while( xQueueReceive( xLCDQueue, &xMessage, portMAX_DELAY ) != pdPASS ); + + /* Clear the current display value. */ + prvLCDClear(); + + /* Switch rows each time so we can see that the display is still being + updated. */ + prvLCDGotoRow( usRow & 0x01 ); + usRow++; + prvLCDPutString( xMessage.pcMessage ); + + /* Delay the requested amount of time to ensure the text just written + to the LCD is not overwritten. */ + vTaskDelay( xMessage.xMinDisplayTime ); + } +} + + + + Index: PIC24_MPLAB/main.c =================================================================== --- PIC24_MPLAB/main.c (nonexistent) +++ PIC24_MPLAB/main.c (revision 587) @@ -0,0 +1,273 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +/* + * Creates all the demo application tasks, then starts the scheduler. The WEB + * documentation provides more details of the standard demo application tasks. + * In addition to the standard demo tasks, the following tasks and tests are + * defined and/or created within this file: + * + * "Fast Interrupt Test" - A high frequency periodic interrupt is generated + * using a free running timer to demonstrate the use of the + * configKERNEL_INTERRUPT_PRIORITY configuration constant. The interrupt + * service routine measures the number of processor clocks that occur between + * each interrupt - and in so doing measures the jitter in the interrupt + * timing. The maximum measured jitter time is latched in the usMaxJitter + * variable, and displayed on the LCD by the 'Check' as described below. + * The fast interrupt is configured and handled in the timer_test.c source + * file. + * + * "LCD" task - the LCD task is a 'gatekeeper' task. It is the only task that + * is permitted to access the LCD directly. Other tasks wishing to write a + * message to the LCD send the message on a queue to the LCD task instead of + * accessing the LCD themselves. The LCD task just blocks on the queue waiting + * for messages - waking and displaying the messages as they arrive. The LCD + * task is defined in lcd.c. + * + * "Check" task - This only executes every three seconds but has the highest + * priority so is guaranteed to get processor time. Its main function is to + * check that all the standard demo tasks are still operational. Should any + * unexpected behaviour within a demo task be discovered the 'check' task will + * write "FAIL #n" to the LCD (via the LCD task). If all the demo tasks are + * executing with their expected behaviour then the check task writes the max + * jitter time to the LCD (again via the LCD task), as described above. + */ + +/* Standard includes. */ +#include + +/* Scheduler includes. */ +#include "FreeRTOS.h" +#include "task.h" +#include "queue.h" +#include "croutine.h" + +/* Demo application includes. */ +#include "BlockQ.h" +#include "crflash.h" +#include "blocktim.h" +#include "integer.h" +#include "comtest2.h" +#include "partest.h" +#include "lcd.h" +#include "timertest.h" + +/* Demo task priorities. */ +#define mainBLOCK_Q_PRIORITY ( tskIDLE_PRIORITY + 2 ) +#define mainCHECK_TASK_PRIORITY ( tskIDLE_PRIORITY + 3 ) +#define mainCOM_TEST_PRIORITY ( 2 ) + +/* The check task may require a bit more stack as it calls sprintf(). */ +#define mainCHECK_TAKS_STACK_SIZE ( configMINIMAL_STACK_SIZE * 2 ) + +/* The execution period of the check task. */ +#define mainCHECK_TASK_PERIOD ( ( portTickType ) 3000 / portTICK_RATE_MS ) + +/* The number of flash co-routines to create. */ +#define mainNUM_FLASH_COROUTINES ( 5 ) + +/* Baud rate used by the comtest tasks. */ +#define mainCOM_TEST_BAUD_RATE ( 19200 ) + +/* The LED used by the comtest tasks. mainCOM_TEST_LED + 1 is also used. +See the comtest.c file for more information. */ +#define mainCOM_TEST_LED ( 6 ) + +/* The frequency at which the "fast interrupt test" interrupt will occur. */ +#define mainTEST_INTERRUPT_FREQUENCY ( 20000 ) + +/* The number of processor clocks we expect to occur between each "fast +interrupt test" interrupt. */ +#define mainEXPECTED_CLOCKS_BETWEEN_INTERRUPTS ( configCPU_CLOCK_HZ / mainTEST_INTERRUPT_FREQUENCY ) + +/* The number of nano seconds between each processor clock. */ +#define mainNS_PER_CLOCK ( ( unsigned short ) ( ( 1.0 / ( double ) configCPU_CLOCK_HZ ) * 1000000000.0 ) ) + +/* Dimension the buffer used to hold the value of the maximum jitter time when +it is converted to a string. */ +#define mainMAX_STRING_LENGTH ( 20 ) + +/*-----------------------------------------------------------*/ + +/* + * The check task as described at the top of this file. + */ +static void vCheckTask( void *pvParameters ); + +/* + * Setup the processor ready for the demo. + */ +static void prvSetupHardware( void ); + +/*-----------------------------------------------------------*/ + +/* The queue used to send messages to the LCD task. */ +static xQueueHandle xLCDQueue; + +/*-----------------------------------------------------------*/ + +/* + * Create the demo tasks then start the scheduler. + */ +int main( void ) +{ + /* Configure any hardware required for this demo. */ + prvSetupHardware(); + + /* Create the standard demo tasks. */ + vStartBlockingQueueTasks( mainBLOCK_Q_PRIORITY ); + vStartIntegerMathTasks( tskIDLE_PRIORITY ); + vStartFlashCoRoutines( mainNUM_FLASH_COROUTINES ); + vAltStartComTestTasks( mainCOM_TEST_PRIORITY, mainCOM_TEST_BAUD_RATE, mainCOM_TEST_LED ); + vCreateBlockTimeTasks(); + + /* Create the test tasks defined within this file. */ + xTaskCreate( vCheckTask, ( signed char * ) "Check", mainCHECK_TAKS_STACK_SIZE, NULL, mainCHECK_TASK_PRIORITY, NULL ); + + /* Start the task that will control the LCD. This returns the handle + to the queue used to write text out to the task. */ + xLCDQueue = xStartLCDTask(); + + /* Start the high frequency interrupt test. */ + vSetupTimerTest( mainTEST_INTERRUPT_FREQUENCY ); + + /* Finally start the scheduler. */ + vTaskStartScheduler(); + + /* Will only reach here if there is insufficient heap available to start + the scheduler. */ + return 0; +} +/*-----------------------------------------------------------*/ + +static void prvSetupHardware( void ) +{ + vParTestInitialise(); +} +/*-----------------------------------------------------------*/ + +static void vCheckTask( void *pvParameters ) +{ +/* Used to wake the task at the correct frequency. */ +portTickType xLastExecutionTime; + +/* The maximum jitter time measured by the fast interrupt test. */ +extern unsigned short usMaxJitter ; + +/* Buffer into which the maximum jitter time is written as a string. */ +static char cStringBuffer[ mainMAX_STRING_LENGTH ]; + +/* The message that is sent on the queue to the LCD task. The first +parameter is the minimum time (in ticks) that the message should be +left on the LCD without being overwritten. The second parameter is a pointer +to the message to display itself. */ +xLCDMessage xMessage = { 0, cStringBuffer }; + +/* Set to pdTRUE should an error be detected in any of the standard demo tasks. */ +unsigned short usErrorDetected = pdFALSE; + + /* Initialise xLastExecutionTime so the first call to vTaskDelayUntil() + works correctly. */ + xLastExecutionTime = xTaskGetTickCount(); + + for( ;; ) + { + /* Wait until it is time for the next cycle. */ + vTaskDelayUntil( &xLastExecutionTime, mainCHECK_TASK_PERIOD ); + + /* Has an error been found in any of the standard demo tasks? */ + + if( xAreIntegerMathsTaskStillRunning() != pdTRUE ) + { + usErrorDetected = pdTRUE; + sprintf( cStringBuffer, "FAIL #1" ); + } + + if( xAreComTestTasksStillRunning() != pdTRUE ) + { + usErrorDetected = pdTRUE; + sprintf( cStringBuffer, "FAIL #2" ); + } + + if( xAreBlockTimeTestTasksStillRunning() != pdTRUE ) + { + usErrorDetected = pdTRUE; + sprintf( cStringBuffer, "FAIL #3" ); + } + + if( xAreBlockingQueuesStillRunning() != pdTRUE ) + { + usErrorDetected = pdTRUE; + sprintf( cStringBuffer, "FAIL #4" ); + } + + if( usErrorDetected == pdFALSE ) + { + /* No errors have been discovered, so display the maximum jitter + timer discovered by the "fast interrupt test". */ + sprintf( cStringBuffer, "%dns max jitter", ( short ) ( usMaxJitter - mainEXPECTED_CLOCKS_BETWEEN_INTERRUPTS ) * mainNS_PER_CLOCK ); + } + + /* Send the message to the LCD gatekeeper for display. */ + xQueueSend( xLCDQueue, &xMessage, portMAX_DELAY ); + } +} +/*-----------------------------------------------------------*/ + +void vApplicationIdleHook( void ) +{ + /* Schedule the co-routines from within the idle task hook. */ + vCoRoutineSchedule(); +} +/*-----------------------------------------------------------*/ + Index: PIC24_MPLAB/FreeRTOSConfig.h =================================================================== --- PIC24_MPLAB/FreeRTOSConfig.h (nonexistent) +++ PIC24_MPLAB/FreeRTOSConfig.h (revision 587) @@ -0,0 +1,102 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +#ifndef FREERTOS_CONFIG_H +#define FREERTOS_CONFIG_H + +#include + +/*----------------------------------------------------------- + * Application specific definitions. + * + * These definitions should be adjusted for your particular hardware and + * application requirements. + * + * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE + * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. + * + * See http://www.freertos.org/a00110.html. + *----------------------------------------------------------*/ + +#define configUSE_PREEMPTION 1 +#define configUSE_IDLE_HOOK 1 +#define configUSE_TICK_HOOK 0 +#define configTICK_RATE_HZ ( ( portTickType ) 1000 ) +#define configCPU_CLOCK_HZ ( ( unsigned long ) 16000000 ) /* Fosc / 2 */ +#define configMAX_PRIORITIES ( ( unsigned portBASE_TYPE ) 4 ) +#define configMINIMAL_STACK_SIZE ( 115 ) +#define configTOTAL_HEAP_SIZE ( ( size_t ) 5120 ) +#define configMAX_TASK_NAME_LEN ( 4 ) +#define configUSE_TRACE_FACILITY 0 +#define configUSE_16_BIT_TICKS 1 +#define configIDLE_SHOULD_YIELD 1 + +/* Co-routine definitions. */ +#define configUSE_CO_ROUTINES 1 +#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) + +/* Set the following definitions to 1 to include the API function, or zero +to exclude the API function. */ + +#define INCLUDE_vTaskPrioritySet 1 +#define INCLUDE_uxTaskPriorityGet 0 +#define INCLUDE_vTaskDelete 0 +#define INCLUDE_vTaskCleanUpResources 0 +#define INCLUDE_vTaskSuspend 1 +#define INCLUDE_vTaskDelayUntil 1 +#define INCLUDE_vTaskDelay 1 + + +#define configKERNEL_INTERRUPT_PRIORITY 0x01 + +#endif /* FREERTOS_CONFIG_H */ Index: PIC24_MPLAB/timertest.h =================================================================== --- PIC24_MPLAB/timertest.h (nonexistent) +++ PIC24_MPLAB/timertest.h (revision 587) @@ -0,0 +1,63 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +#ifndef TIMER_TEST_H +#define TIMER_TEST_H + +/* Setup the high frequency timer interrupt. */ +void vSetupTimerTest( unsigned short usFrequencyHz ); + +#endif /* TIMER_TEST_H */ + + + Index: PIC24_MPLAB/lcd.h =================================================================== --- PIC24_MPLAB/lcd.h (nonexistent) +++ PIC24_MPLAB/lcd.h (revision 587) @@ -0,0 +1,75 @@ +/* + FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd. + + *************************************************************************** + * * + * If you are: * + * * + * + New to FreeRTOS, * + * + Wanting to learn FreeRTOS or multitasking in general quickly * + * + Looking for basic training, * + * + Wanting to improve your FreeRTOS skills and productivity * + * * + * then take a look at the FreeRTOS books - available as PDF or paperback * + * * + * "Using the FreeRTOS Real Time Kernel - a Practical Guide" * + * http://www.FreeRTOS.org/Documentation * + * * + * A pdf reference manual is also available. Both are usually delivered * + * to your inbox within 20 minutes to two hours when purchased between 8am * + * and 8pm GMT (although please allow up to 24 hours in case of * + * exceptional circumstances). Thank you for your support! * + * * + *************************************************************************** + + This file is part of the FreeRTOS distribution. + + FreeRTOS is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License (version 2) as published by the + Free Software Foundation AND MODIFIED BY the FreeRTOS exception. + ***NOTE*** The exception to the GPL is included to allow you to distribute + a combined work that includes FreeRTOS without being obliged to provide the + source code for proprietary components outside of the FreeRTOS kernel. + FreeRTOS is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. You should have received a copy of the GNU General Public + License and the FreeRTOS license exception along with FreeRTOS; if not it + can be viewed here: http://www.freertos.org/a00114.html and also obtained + by writing to Richard Barry, contact details for whom are available on the + FreeRTOS WEB site. + + 1 tab == 4 spaces! + + http://www.FreeRTOS.org - Documentation, latest information, license and + contact details. + + http://www.SafeRTOS.com - A version that is certified for use in safety + critical systems. + + http://www.OpenRTOS.com - Commercial support, development, porting, + licensing and training services. +*/ + +#ifndef LCD_INC_H +#define LCD_INC_H + +/* Create the task that will control the LCD. Returned is a handle to the queue +on which messages to get written to the LCD should be written. */ +xQueueHandle xStartLCDTask( void ); + +typedef struct +{ + /* The minimum amount of time the message should remain on the LCD without + being overwritten. */ + portTickType xMinDisplayTime; + + /* A pointer to the string to be displayed. */ + char *pcMessage; + +} xLCDMessage; + + +#endif /* LCD_INC_H */ + + Index: PIC24_MPLAB/RTOSDemo_PIC24.mcp =================================================================== --- PIC24_MPLAB/RTOSDemo_PIC24.mcp (nonexistent) +++ PIC24_MPLAB/RTOSDemo_PIC24.mcp (revision 587) @@ -0,0 +1,138 @@ +[HEADER] +magic_cookie={66E99B07-E706-4689-9E80-9B2582898A13} +file_version=1.0 +[PATH_INFO] +BuildDirPolicy=BuildDirIsSourceDir +dir_src= +dir_bin= +dir_tmp= +dir_sin= +dir_inc=.;.\include;..\include;..\..\include;..\..\..\include;..\..\Source\include;..\..\..\Source\include;..\Demo\PIC24_MPLAB;..\..\..\Demo\PIC24_MPLAB;..\..\..\..\Demo\PIC24_MPLAB;.\FileSystem;..\Common\include;..\..\Common\include +dir_lib= +dir_lkr= +[CAT_FILTERS] +filter_src=*.s;*.c +filter_inc=*.h;*.inc +filter_obj=*.o +filter_lib=*.a +filter_lkr=*.gld +[CAT_SUBFOLDERS] +subfolder_src= +subfolder_inc= +subfolder_obj= +subfolder_lib= +subfolder_lkr= +[FILE_SUBFOLDERS] +file_000=. +file_001=. +file_002=. +file_003=. +file_004=. +file_005=. +file_006=. +file_007=. +file_008=. +file_009=. +file_010=. +file_011=. +file_012=. +file_013=. +file_014=. +file_015=. +file_016=. +file_017=. +file_018=. +file_019=. +file_020=. +file_021=. +file_022=. +[GENERATED_FILES] +file_000=no +file_001=no +file_002=no +file_003=no +file_004=no +file_005=no +file_006=no +file_007=no +file_008=no +file_009=no +file_010=no +file_011=no +file_012=no +file_013=no +file_014=no +file_015=no +file_016=no +file_017=no +file_018=no +file_019=no +file_020=no +file_021=no +file_022=no +[OTHER_FILES] +file_000=no +file_001=no +file_002=no +file_003=no +file_004=no +file_005=no +file_006=no +file_007=no +file_008=no +file_009=no +file_010=no +file_011=no +file_012=no +file_013=no +file_014=no +file_015=no +file_016=no +file_017=no +file_018=no +file_019=no +file_020=no +file_021=no +file_022=no +[FILE_INFO] +file_000=main.c +file_001=..\..\source\list.c +file_002=..\..\source\queue.c +file_003=..\..\source\tasks.c +file_004=..\..\source\portable\MPLAB\PIC24_dsPIC\port.c +file_005=..\..\source\portable\MemMang\heap_1.c +file_006=..\Common\Minimal\BlockQ.c +file_007=..\..\source\croutine.c +file_008=..\Common\Minimal\crflash.c +file_009=ParTest\ParTest.c +file_010=..\Common\Minimal\blocktim.c +file_011=..\Common\Minimal\integer.c +file_012=..\Common\Minimal\comtest.c +file_013=serial\serial.c +file_014=timertest.c +file_015=lcd.c +file_016=..\..\Source\portable\MPLAB\PIC24_dsPIC\portasm_PIC24.S +file_017=..\..\source\include\semphr.h +file_018=..\..\source\include\task.h +file_019=..\..\source\include\croutine.h +file_020=..\..\source\include\queue.h +file_021=FreeRTOSConfig.h +file_022=p24FJ128GA010.gld +[SUITE_INFO] +suite_guid={479DDE59-4D56-455E-855E-FFF59A3DB57E} +suite_state= +[TOOL_SETTINGS] +TS{7D9C6ECE-785D-44CB-BA22-17BF2E119622}=-g +TS{25AC22BD-2378-4FDB-BFB6-7345A15512D3}=-fno-omit-frame-pointer -g -Wall -DMPLAB_PIC24_PORT -mlarge-code -O1 -fno-schedule-insns -fno-schedule-insns2 +TS{25AC22BD-2378-4FDB-BFB6-7345A15512D3}_alt=yes +TS{7DAC9A1D-4C45-45D6-B25A-D117C74E8F5A}=--defsym=__ICD2RAM=1 -Map="$(TARGETBASE).map" -o"$(TARGETBASE).$(TARGETSUFFIX)" +TS{509E5861-1E2A-483B-8B6B-CA8DB7F2DD78}= +[INSTRUMENTED_TRACE] +enable=0 +transport=0 +format=0 +[CUSTOM_BUILD] +Pre-Build= +Pre-BuildEnabled=1 +Post-Build= +Post-BuildEnabled=1 Index: PIC24_MPLAB/RTOSDemo.mcs =================================================================== --- PIC24_MPLAB/RTOSDemo.mcs (nonexistent) +++ PIC24_MPLAB/RTOSDemo.mcs (revision 587) @@ -0,0 +1,3 @@ +[Header] +MagicCookie={0b13fe8c-dfe0-40eb-8900-6712719559a7} +Version=1.0 Index: PIC24_MPLAB/p24FJ128GA010.gld =================================================================== --- PIC24_MPLAB/p24FJ128GA010.gld (nonexistent) +++ PIC24_MPLAB/p24FJ128GA010.gld (revision 587) @@ -0,0 +1,1333 @@ +/* +** Linker script for PIC24FJ128GA010 +*/ + +OUTPUT_ARCH("24FJ128GA010") +EXTERN(__resetPRI) +EXTERN(__resetALT) + + +/* +** Memory Regions +*/ +MEMORY +{ + data (a!xr) : ORIGIN = 0x800, LENGTH = 0x2000 + reset : ORIGIN = 0x0, LENGTH = 0x4 + ivt : ORIGIN = 0x4, LENGTH = 0xFC + aivt : ORIGIN = 0x104, LENGTH = 0xFC + program (xr) : ORIGIN = 0x200, LENGTH = 0x155FC + config2 : ORIGIN = 0x157FC, LENGTH = 0x2 + config1 : ORIGIN = 0x157FE, LENGTH = 0x2 +} +__IVT_BASE = 0x4; +__AIVT_BASE = 0x104; +__DATA_BASE = 0x800; +__CODE_BASE = 0x200; + + +/* +** ==================== Section Map ====================== +*/ +SECTIONS +{ + /* + ** ========== Program Memory ========== + */ + + + /* + ** Reset Instruction + */ + .reset : + { + SHORT(ABSOLUTE(__reset)); + SHORT(0x04); + SHORT((ABSOLUTE(__reset) >> 16) & 0x7F); + SHORT(0); + } >reset + + + /* + ** Interrupt Vector Tables + ** + ** The primary and alternate tables are loaded + ** here, between sections .reset and .text. + ** Vector table source code appears below. + */ + + + /* + ** User Code and Library Code + */ + .text __CODE_BASE : + { + *(.handle); + *(.libc) *(.libm) *(.libdsp); /* keep together in this order */ + *(.lib*); + *(.text); + } >program + + + /* + ** Configuration Words + */ + __CONFIG2 : + { *(__CONFIG2.sec) } >config2 + __CONFIG1 : + { *(__CONFIG1.sec) } >config1 + + + /* + ** =========== Data Memory =========== + */ + + + /* + ** ICD Debug Exec + ** + ** This section provides optional storage for + ** the ICD2 debugger. Define a global symbol + ** named __ICD2RAM to enable ICD2. This section + ** must be loaded at data address 0x800. + */ + .icd __DATA_BASE (NOLOAD): + { + . += (DEFINED (__ICD2RAM) ? 0x50 : 0 ); + } > data + + + /* + ** Other sections in data memory are not explicitly mapped. + ** Instead they are allocated according to their section + ** attributes, which is most efficient. + ** + ** If a specific arrangement of sections is required + ** (other than what can be achieved using attributes) + ** additional sections may be defined here. See chapter + ** 10.5 in the MPLAB ASM30/LINK30 User's Guide (DS51317) + ** for more information. + */ + + + /* + ** ========== Debug Info ============== + */ + + .comment 0 : { *(.comment) } + + /* + ** DWARF-2 + */ + .debug_info 0 : { *(.debug_info) *(.gnu.linkonce.wi.*) } + .debug_abbrev 0 : { *(.debug_abbrev) } + .debug_line 0 : { *(.debug_line) } + .debug_frame 0 : { *(.debug_frame) } + .debug_str 0 : { *(.debug_str) } + .debug_loc 0 : { *(.debug_loc) } + .debug_macinfo 0 : { *(.debug_macinfo) } + .debug_pubnames 0 : { *(.debug_pubnames) } + .debug_ranges 0 : { *(.debug_ranges) } + .debug_aranges 0 : { *(.debug_aranges) } + +} /* SECTIONS */ + +/* +** ================= End of Section Map ================ +*/ + +/* +** Section Map for Interrupt Vector Tables +*/ +SECTIONS +{ + +/* +** Interrupt Vector Table +*/ +.ivt __IVT_BASE : + { + LONG( DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__AddressError) ? ABSOLUTE(__AddressError) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__StackError) ? ABSOLUTE(__StackError) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__MathError) ? ABSOLUTE(__MathError) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__ReservedTrap5) ? ABSOLUTE(__ReservedTrap5) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__ReservedTrap6) ? ABSOLUTE(__ReservedTrap6) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__ReservedTrap7) ? ABSOLUTE(__ReservedTrap7) : + ABSOLUTE(__DefaultInterrupt)); + + LONG( DEFINED(__INT0Interrupt) ? ABSOLUTE(__INT0Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__IC1Interrupt) ? ABSOLUTE(__IC1Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__OC1Interrupt) ? ABSOLUTE(__OC1Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__T1Interrupt) ? ABSOLUTE(__T1Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt4) ? ABSOLUTE(__Interrupt4) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__IC2Interrupt) ? ABSOLUTE(__IC2Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__OC2Interrupt) ? ABSOLUTE(__OC2Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__T2Interrupt) ? ABSOLUTE(__T2Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__T3Interrupt) ? ABSOLUTE(__T3Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__SPI1ErrInterrupt) ? ABSOLUTE(__SPI1ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__SPI1TInterrupt) ? ABSOLUTE(__SPI1TInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__U1TXInterrupt) ? ABSOLUTE(__U1TXInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__ADC1Interrupt) ? ABSOLUTE(__ADC1Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt14) ? ABSOLUTE(__Interrupt14) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt15) ? ABSOLUTE(__Interrupt15) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__SI2C1Interrupt) ? ABSOLUTE(__SI2C1Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__MI2C1Interrupt) ? ABSOLUTE(__MI2C1Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__CompInterrupt) ? ABSOLUTE(__CompInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__CNInterrupt) ? ABSOLUTE(__CNInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__INT1Interrupt) ? ABSOLUTE(__INT1Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt21) ? ABSOLUTE(__Interrupt21) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt22) ? ABSOLUTE(__Interrupt22) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt23) ? ABSOLUTE(__Interrupt23) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt24) ? ABSOLUTE(__Interrupt24) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__OC3Interrupt) ? ABSOLUTE(__OC3Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__OC4Interrupt) ? ABSOLUTE(__OC4Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__T4Interrupt) ? ABSOLUTE(__T4Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__T5Interrupt) ? ABSOLUTE(__T5Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__INT2Interrupt) ? ABSOLUTE(__INT2Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__U2RXInterrupt) ? ABSOLUTE(__U2RXInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__U2TXInterrupt) ? ABSOLUTE(__U2TXInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__SPI2ErrInterrupt) ? ABSOLUTE(__SPI2ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__SPI2Interrupt) ? ABSOLUTE(__SPI2Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt34) ? ABSOLUTE(__Interrupt34) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt35) ? ABSOLUTE(__Interrupt35) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt36) ? ABSOLUTE(__Interrupt36) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__IC3Interrupt) ? ABSOLUTE(__IC3Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__IC4Interrupt) ? ABSOLUTE(__IC4Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__IC5Interrupt) ? ABSOLUTE(__IC5Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt40) ? ABSOLUTE(__Interrupt40) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__OC5Interrupt) ? ABSOLUTE(__OC5Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt42) ? ABSOLUTE(__Interrupt42) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt43) ? ABSOLUTE(__Interrupt43) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt44) ? ABSOLUTE(__Interrupt44) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__PMPInterrupt) ? ABSOLUTE(__PMPInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt46) ? ABSOLUTE(__Interrupt46) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt47) ? ABSOLUTE(__Interrupt47) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt48) ? ABSOLUTE(__Interrupt48) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__SI2C2Interrupt) ? ABSOLUTE(__SI2C2Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__MI2C2Interrupt) ? ABSOLUTE(__MI2C2Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt51) ? ABSOLUTE(__Interrupt51) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt52) ? ABSOLUTE(__Interrupt52) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__INT3Interrupt) ? ABSOLUTE(__INT3Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__INT4Interrupt) ? ABSOLUTE(__INT4Interrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt55) ? ABSOLUTE(__Interrupt55) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt56) ? ABSOLUTE(__Interrupt56) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt57) ? ABSOLUTE(__Interrupt57) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt58) ? ABSOLUTE(__Interrupt58) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt59) ? ABSOLUTE(__Interrupt59) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt60) ? ABSOLUTE(__Interrupt60) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt61) ? ABSOLUTE(__Interrupt61) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__RTCCInterrupt) ? ABSOLUTE(__RTCCInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt63) ? ABSOLUTE(__Interrupt63) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt64) ? ABSOLUTE(__Interrupt64) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__U1ErrInterrupt) ? ABSOLUTE(__U1ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__U2ErrInterrupt) ? ABSOLUTE(__U2ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__CRCInterrupt) ? ABSOLUTE(__CRCInterrupt) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt68) ? ABSOLUTE(__Interrupt68) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt69) ? ABSOLUTE(__Interrupt69) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt70) ? ABSOLUTE(__Interrupt70) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt71) ? ABSOLUTE(__Interrupt71) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt72) ? ABSOLUTE(__Interrupt72) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt73) ? ABSOLUTE(__Interrupt73) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt74) ? ABSOLUTE(__Interrupt74) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt75) ? ABSOLUTE(__Interrupt75) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt76) ? ABSOLUTE(__Interrupt76) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt77) ? ABSOLUTE(__Interrupt77) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt78) ? ABSOLUTE(__Interrupt78) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt79) ? ABSOLUTE(__Interrupt79) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt80) ? ABSOLUTE(__Interrupt80) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt81) ? ABSOLUTE(__Interrupt81) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt82) ? ABSOLUTE(__Interrupt82) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt83) ? ABSOLUTE(__Interrupt83) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt84) ? ABSOLUTE(__Interrupt84) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt85) ? ABSOLUTE(__Interrupt85) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt86) ? ABSOLUTE(__Interrupt86) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt87) ? ABSOLUTE(__Interrupt87) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt88) ? ABSOLUTE(__Interrupt88) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt89) ? ABSOLUTE(__Interrupt89) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt90) ? ABSOLUTE(__Interrupt90) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt91) ? ABSOLUTE(__Interrupt91) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt92) ? ABSOLUTE(__Interrupt92) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt93) ? ABSOLUTE(__Interrupt93) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt94) ? ABSOLUTE(__Interrupt94) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt95) ? ABSOLUTE(__Interrupt95) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt96) ? ABSOLUTE(__Interrupt96) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt97) ? ABSOLUTE(__Interrupt97) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt98) ? ABSOLUTE(__Interrupt98) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt99) ? ABSOLUTE(__Interrupt99) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt100) ? ABSOLUTE(__Interrupt100) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt101) ? ABSOLUTE(__Interrupt101) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt102) ? ABSOLUTE(__Interrupt102) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt103) ? ABSOLUTE(__Interrupt103) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt104) ? ABSOLUTE(__Interrupt104) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt105) ? ABSOLUTE(__Interrupt105) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt106) ? ABSOLUTE(__Interrupt106) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt107) ? ABSOLUTE(__Interrupt107) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt108) ? ABSOLUTE(__Interrupt108) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt109) ? ABSOLUTE(__Interrupt109) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt110) ? ABSOLUTE(__Interrupt110) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt111) ? ABSOLUTE(__Interrupt111) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt112) ? ABSOLUTE(__Interrupt112) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt113) ? ABSOLUTE(__Interrupt113) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt114) ? ABSOLUTE(__Interrupt114) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt115) ? ABSOLUTE(__Interrupt115) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt116) ? ABSOLUTE(__Interrupt116) : + ABSOLUTE(__DefaultInterrupt)); + LONG( DEFINED(__Interrupt117) ? ABSOLUTE(__Interrupt117) : + ABSOLUTE(__DefaultInterrupt)); + } >ivt + + +/* +** Alternate Interrupt Vector Table +*/ +.aivt __AIVT_BASE : + { + LONG( DEFINED(__AltReservedTrap0) ? ABSOLUTE(__AltReservedTrap0) : + (DEFINED(__ReservedTrap0) ? ABSOLUTE(__ReservedTrap0) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltOscillatorFail) ? ABSOLUTE(__AltOscillatorFail) : + (DEFINED(__OscillatorFail) ? ABSOLUTE(__OscillatorFail) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltAddressError) ? ABSOLUTE(__AltAddressError) : + (DEFINED(__AddressError) ? ABSOLUTE(__AddressError) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltStackError) ? ABSOLUTE(__AltStackError) : + (DEFINED(__StackError) ? ABSOLUTE(__StackError) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltMathError) ? ABSOLUTE(__AltMathError) : + (DEFINED(__MathError) ? ABSOLUTE(__MathError) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltReservedTrap5) ? ABSOLUTE(__AltReservedTrap5) : + (DEFINED(__ReservedTrap5) ? ABSOLUTE(__ReservedTrap5) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltReservedTrap6) ? ABSOLUTE(__AltReservedTrap6) : + (DEFINED(__ReservedTrap6) ? ABSOLUTE(__ReservedTrap6) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltReservedTrap7) ? ABSOLUTE(__AltReservedTrap7) : + (DEFINED(__ReservedTrap7) ? ABSOLUTE(__ReservedTrap7) : + ABSOLUTE(__DefaultInterrupt))); + + LONG( DEFINED(__AltINT0Interrupt) ? ABSOLUTE(__AltINT0Interrupt) : + (DEFINED(__INT0Interrupt) ? ABSOLUTE(__INT0Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltIC1Interrupt) ? ABSOLUTE(__AltIC1Interrupt) : + (DEFINED(__IC1Interrupt) ? ABSOLUTE(__IC1Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltOC1Interrupt) ? ABSOLUTE(__AltOC1Interrupt) : + (DEFINED(__OC1Interrupt) ? ABSOLUTE(__OC1Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltT1Interrupt) ? ABSOLUTE(__AltT1Interrupt) : + (DEFINED(__T1Interrupt) ? ABSOLUTE(__T1Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt4) ? ABSOLUTE(__AltInterrupt4) : + (DEFINED(__Interrupt4) ? ABSOLUTE(__Interrupt4) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltIC2Interrupt) ? ABSOLUTE(__AltIC2Interrupt) : + (DEFINED(__IC2Interrupt) ? ABSOLUTE(__IC2Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltOC2Interrupt) ? ABSOLUTE(__AltOC2Interrupt) : + (DEFINED(__OC2Interrupt) ? ABSOLUTE(__OC2Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltT2Interrupt) ? ABSOLUTE(__AltT2Interrupt) : + (DEFINED(__T2Interrupt) ? ABSOLUTE(__T2Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltT3Interrupt) ? ABSOLUTE(__AltT3Interrupt) : + (DEFINED(__T3Interrupt) ? ABSOLUTE(__T3Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltSPI1ErrInterrupt) ? ABSOLUTE(__AltSPI1ErrInterrupt) : + (DEFINED(__SPI1ErrInterrupt) ? ABSOLUTE(__SPI1ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltSPI1TInterrupt) ? ABSOLUTE(__AltSPI1TInterrupt) : + (DEFINED(__SPI1TInterrupt) ? ABSOLUTE(__SPI1TInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltU1RXInterrupt) ? ABSOLUTE(__AltU1RXInterrupt) : + (DEFINED(__U1RXInterrupt) ? ABSOLUTE(__U1RXInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltU1TXInterrupt) ? ABSOLUTE(__AltU1TXInterrupt) : + (DEFINED(__U1TXInterrupt) ? ABSOLUTE(__U1TXInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltADC1Interrupt) ? ABSOLUTE(__AltADC1Interrupt) : + (DEFINED(__ADC1Interrupt) ? ABSOLUTE(__ADC1Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt14) ? ABSOLUTE(__AltInterrupt14) : + (DEFINED(__Interrupt14) ? ABSOLUTE(__Interrupt14) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt15) ? ABSOLUTE(__AltInterrupt15) : + (DEFINED(__Interrupt15) ? ABSOLUTE(__Interrupt15) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltSI2C1Interrupt) ? ABSOLUTE(__AltSI2C1Interrupt) : + (DEFINED(__SI2C1Interrupt) ? ABSOLUTE(__SI2C1Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltMI2C1Interrupt) ? ABSOLUTE(__AltMI2C1Interrupt) : + (DEFINED(__MI2C1Interrupt) ? ABSOLUTE(__MI2C1Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltCompInterrupt) ? ABSOLUTE(__AltCompInterrupt) : + (DEFINED(__CompInterrupt) ? ABSOLUTE(__CompInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltCNInterrupt) ? ABSOLUTE(__AltCNInterrupt) : + (DEFINED(__CNInterrupt) ? ABSOLUTE(__CNInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltINT1Interrupt) ? ABSOLUTE(__AltINT1Interrupt) : + (DEFINED(__INT1Interrupt) ? ABSOLUTE(__INT1Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt21) ? ABSOLUTE(__AltInterrupt21) : + (DEFINED(__Interrupt21) ? ABSOLUTE(__Interrupt21) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt22) ? ABSOLUTE(__AltInterrupt22) : + (DEFINED(__Interrupt22) ? ABSOLUTE(__Interrupt22) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt23) ? ABSOLUTE(__AltInterrupt23) : + (DEFINED(__Interrupt23) ? ABSOLUTE(__Interrupt23) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt24) ? ABSOLUTE(__AltInterrupt24) : + (DEFINED(__Interrupt24) ? ABSOLUTE(__Interrupt24) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltOC3Interrupt) ? ABSOLUTE(__AltOC3Interrupt) : + (DEFINED(__OC3Interrupt) ? ABSOLUTE(__OC3Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltOC4Interrupt) ? ABSOLUTE(__AltOC4Interrupt) : + (DEFINED(__OC4Interrupt) ? ABSOLUTE(__OC4Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltT4Interrupt) ? ABSOLUTE(__AltT4Interrupt) : + (DEFINED(__T4Interrupt) ? ABSOLUTE(__T4Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltT5Interrupt) ? ABSOLUTE(__AltT5Interrupt) : + (DEFINED(__T5Interrupt) ? ABSOLUTE(__T5Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltINT2Interrupt) ? ABSOLUTE(__AltINT2Interrupt) : + (DEFINED(__INT2Interrupt) ? ABSOLUTE(__INT2Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltU2RXInterrupt) ? ABSOLUTE(__AltU2RXInterrupt) : + (DEFINED(__U2RXInterrupt) ? ABSOLUTE(__U2RXInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltU2TXInterrupt) ? ABSOLUTE(__AltU2TXInterrupt) : + (DEFINED(__U2TXInterrupt) ? ABSOLUTE(__U2TXInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltSPI2ErrInterrupt) ? ABSOLUTE(__AltSPI2ErrInterrupt) : + (DEFINED(__SPI2ErrInterrupt) ? ABSOLUTE(__SPI2ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltSPI2Interrupt) ? ABSOLUTE(__AltSPI2Interrupt) : + (DEFINED(__SPI2Interrupt) ? ABSOLUTE(__SPI2Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt34) ? ABSOLUTE(__AltInterrupt34) : + (DEFINED(__Interrupt34) ? ABSOLUTE(__Interrupt34) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt35) ? ABSOLUTE(__AltInterrupt35) : + (DEFINED(__Interrupt35) ? ABSOLUTE(__Interrupt35) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt36) ? ABSOLUTE(__AltInterrupt36) : + (DEFINED(__Interrupt36) ? ABSOLUTE(__Interrupt36) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltIC3Interrupt) ? ABSOLUTE(__AltIC3Interrupt) : + (DEFINED(__IC3Interrupt) ? ABSOLUTE(__IC3Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltIC4Interrupt) ? ABSOLUTE(__AltIC4Interrupt) : + (DEFINED(__IC4Interrupt) ? ABSOLUTE(__IC4Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltIC5Interrupt) ? ABSOLUTE(__AltIC5Interrupt) : + (DEFINED(__IC5Interrupt) ? ABSOLUTE(__IC5Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt40) ? ABSOLUTE(__AltInterrupt40) : + (DEFINED(__Interrupt40) ? ABSOLUTE(__Interrupt40) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltOC5Interrupt) ? ABSOLUTE(__AltOC5Interrupt) : + (DEFINED(__OC5Interrupt) ? ABSOLUTE(__OC5Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt42) ? ABSOLUTE(__AltInterrupt42) : + (DEFINED(__Interrupt42) ? ABSOLUTE(__Interrupt42) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt43) ? ABSOLUTE(__AltInterrupt43) : + (DEFINED(__Interrupt43) ? ABSOLUTE(__Interrupt43) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt44) ? ABSOLUTE(__AltInterrupt44) : + (DEFINED(__Interrupt44) ? ABSOLUTE(__Interrupt44) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltPMPInterrupt) ? ABSOLUTE(__AltPMPInterrupt) : + (DEFINED(__PMPInterrupt) ? ABSOLUTE(__PMPInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt46) ? ABSOLUTE(__AltInterrupt46) : + (DEFINED(__Interrupt46) ? ABSOLUTE(__Interrupt46) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt47) ? ABSOLUTE(__AltInterrupt47) : + (DEFINED(__Interrupt47) ? ABSOLUTE(__Interrupt47) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt48) ? ABSOLUTE(__AltInterrupt48) : + (DEFINED(__Interrupt48) ? ABSOLUTE(__Interrupt48) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltSI2C2Interrupt) ? ABSOLUTE(__AltSI2C2Interrupt) : + (DEFINED(__SI2C2Interrupt) ? ABSOLUTE(__SI2C2Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltMI2C2Interrupt) ? ABSOLUTE(__AltMI2C2Interrupt) : + (DEFINED(__MI2C2Interrupt) ? ABSOLUTE(__MI2C2Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt51) ? ABSOLUTE(__AltInterrupt51) : + (DEFINED(__Interrupt51) ? ABSOLUTE(__Interrupt51) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt52) ? ABSOLUTE(__AltInterrupt52) : + (DEFINED(__Interrupt52) ? ABSOLUTE(__Interrupt52) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltINT3Interrupt) ? ABSOLUTE(__AltINT3Interrupt) : + (DEFINED(__INT3Interrupt) ? ABSOLUTE(__INT3Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltINT4Interrupt) ? ABSOLUTE(__AltINT4Interrupt) : + (DEFINED(__INT4Interrupt) ? ABSOLUTE(__INT4Interrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt55) ? ABSOLUTE(__AltInterrupt55) : + (DEFINED(__Interrupt55) ? ABSOLUTE(__Interrupt55) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt56) ? ABSOLUTE(__AltInterrupt56) : + (DEFINED(__Interrupt56) ? ABSOLUTE(__Interrupt56) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt57) ? ABSOLUTE(__AltInterrupt57) : + (DEFINED(__Interrupt57) ? ABSOLUTE(__Interrupt57) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt58) ? ABSOLUTE(__AltInterrupt58) : + (DEFINED(__Interrupt58) ? ABSOLUTE(__Interrupt58) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt59) ? ABSOLUTE(__AltInterrupt59) : + (DEFINED(__Interrupt59) ? ABSOLUTE(__Interrupt59) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt60) ? ABSOLUTE(__AltInterrupt60) : + (DEFINED(__Interrupt60) ? ABSOLUTE(__Interrupt60) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt61) ? ABSOLUTE(__AltInterrupt61) : + (DEFINED(__Interrupt61) ? ABSOLUTE(__Interrupt61) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltRTCCInterrupt) ? ABSOLUTE(__AltRTCCInterrupt) : + (DEFINED(__RTCCInterrupt) ? ABSOLUTE(__RTCCInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt63) ? ABSOLUTE(__AltInterrupt63) : + (DEFINED(__Interrupt63) ? ABSOLUTE(__Interrupt63) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt64) ? ABSOLUTE(__AltInterrupt64) : + (DEFINED(__Interrupt64) ? ABSOLUTE(__Interrupt64) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltU1ErrInterrupt) ? ABSOLUTE(__AltU1ErrInterrupt) : + (DEFINED(__U1ErrInterrupt) ? ABSOLUTE(__U1ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltU2ErrInterrupt) ? ABSOLUTE(__AltU2ErrInterrupt) : + (DEFINED(__U2ErrInterrupt) ? ABSOLUTE(__U2ErrInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltCRCInterrupt) ? ABSOLUTE(__AltCRCInterrupt) : + (DEFINED(__CRCInterrupt) ? ABSOLUTE(__CRCInterrupt) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt68) ? ABSOLUTE(__AltInterrupt68) : + (DEFINED(__Interrupt68) ? ABSOLUTE(__Interrupt68) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt69) ? ABSOLUTE(__AltInterrupt69) : + (DEFINED(__Interrupt69) ? ABSOLUTE(__Interrupt69) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt70) ? ABSOLUTE(__AltInterrupt70) : + (DEFINED(__Interrupt70) ? ABSOLUTE(__Interrupt70) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt71) ? ABSOLUTE(__AltInterrupt71) : + (DEFINED(__Interrupt71) ? ABSOLUTE(__Interrupt71) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt72) ? ABSOLUTE(__AltInterrupt72) : + (DEFINED(__Interrupt72) ? ABSOLUTE(__Interrupt72) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt73) ? ABSOLUTE(__AltInterrupt73) : + (DEFINED(__Interrupt73) ? ABSOLUTE(__Interrupt73) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt74) ? ABSOLUTE(__AltInterrupt74) : + (DEFINED(__Interrupt74) ? ABSOLUTE(__Interrupt74) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt75) ? ABSOLUTE(__AltInterrupt75) : + (DEFINED(__Interrupt75) ? ABSOLUTE(__Interrupt75) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt76) ? ABSOLUTE(__AltInterrupt76) : + (DEFINED(__Interrupt76) ? ABSOLUTE(__Interrupt76) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt77) ? ABSOLUTE(__AltInterrupt77) : + (DEFINED(__Interrupt77) ? ABSOLUTE(__Interrupt77) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt78) ? ABSOLUTE(__AltInterrupt78) : + (DEFINED(__Interrupt78) ? ABSOLUTE(__Interrupt78) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt79) ? ABSOLUTE(__AltInterrupt79) : + (DEFINED(__Interrupt79) ? ABSOLUTE(__Interrupt79) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt80) ? ABSOLUTE(__AltInterrupt80) : + (DEFINED(__Interrupt80) ? ABSOLUTE(__Interrupt80) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt81) ? ABSOLUTE(__AltInterrupt81) : + (DEFINED(__Interrupt81) ? ABSOLUTE(__Interrupt81) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt82) ? ABSOLUTE(__AltInterrupt82) : + (DEFINED(__Interrupt82) ? ABSOLUTE(__Interrupt82) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt83) ? ABSOLUTE(__AltInterrupt83) : + (DEFINED(__Interrupt83) ? ABSOLUTE(__Interrupt83) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt84) ? ABSOLUTE(__AltInterrupt84) : + (DEFINED(__Interrupt84) ? ABSOLUTE(__Interrupt84) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt85) ? ABSOLUTE(__AltInterrupt85) : + (DEFINED(__Interrupt85) ? ABSOLUTE(__Interrupt85) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt86) ? ABSOLUTE(__AltInterrupt86) : + (DEFINED(__Interrupt86) ? ABSOLUTE(__Interrupt86) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt87) ? ABSOLUTE(__AltInterrupt87) : + (DEFINED(__Interrupt87) ? ABSOLUTE(__Interrupt87) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt88) ? ABSOLUTE(__AltInterrupt88) : + (DEFINED(__Interrupt88) ? ABSOLUTE(__Interrupt88) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt89) ? ABSOLUTE(__AltInterrupt89) : + (DEFINED(__Interrupt89) ? ABSOLUTE(__Interrupt89) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt90) ? ABSOLUTE(__AltInterrupt90) : + (DEFINED(__Interrupt90) ? ABSOLUTE(__Interrupt90) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt91) ? ABSOLUTE(__AltInterrupt91) : + (DEFINED(__Interrupt91) ? ABSOLUTE(__Interrupt91) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt92) ? ABSOLUTE(__AltInterrupt92) : + (DEFINED(__Interrupt92) ? ABSOLUTE(__Interrupt92) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt93) ? ABSOLUTE(__AltInterrupt93) : + (DEFINED(__Interrupt93) ? ABSOLUTE(__Interrupt93) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt94) ? ABSOLUTE(__AltInterrupt94) : + (DEFINED(__Interrupt94) ? ABSOLUTE(__Interrupt94) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt95) ? ABSOLUTE(__AltInterrupt95) : + (DEFINED(__Interrupt95) ? ABSOLUTE(__Interrupt95) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt96) ? ABSOLUTE(__AltInterrupt96) : + (DEFINED(__Interrupt96) ? ABSOLUTE(__Interrupt96) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt97) ? ABSOLUTE(__AltInterrupt97) : + (DEFINED(__Interrupt97) ? ABSOLUTE(__Interrupt97) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt98) ? ABSOLUTE(__AltInterrupt98) : + (DEFINED(__Interrupt98) ? ABSOLUTE(__Interrupt98) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt99) ? ABSOLUTE(__AltInterrupt99) : + (DEFINED(__Interrupt99) ? ABSOLUTE(__Interrupt99) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt100) ? ABSOLUTE(__AltInterrupt100) : + (DEFINED(__Interrupt100) ? ABSOLUTE(__Interrupt100) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt101) ? ABSOLUTE(__AltInterrupt101) : + (DEFINED(__Interrupt101) ? ABSOLUTE(__Interrupt101) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt102) ? ABSOLUTE(__AltInterrupt102) : + (DEFINED(__Interrupt102) ? ABSOLUTE(__Interrupt102) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt103) ? ABSOLUTE(__AltInterrupt103) : + (DEFINED(__Interrupt103) ? ABSOLUTE(__Interrupt103) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt104) ? ABSOLUTE(__AltInterrupt104) : + (DEFINED(__Interrupt104) ? ABSOLUTE(__Interrupt104) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt105) ? ABSOLUTE(__AltInterrupt105) : + (DEFINED(__Interrupt105) ? ABSOLUTE(__Interrupt105) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt106) ? ABSOLUTE(__AltInterrupt106) : + (DEFINED(__Interrupt106) ? ABSOLUTE(__Interrupt106) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt107) ? ABSOLUTE(__AltInterrupt107) : + (DEFINED(__Interrupt107) ? ABSOLUTE(__Interrupt107) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt108) ? ABSOLUTE(__AltInterrupt108) : + (DEFINED(__Interrupt108) ? ABSOLUTE(__Interrupt108) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt109) ? ABSOLUTE(__AltInterrupt109) : + (DEFINED(__Interrupt109) ? ABSOLUTE(__Interrupt109) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt110) ? ABSOLUTE(__AltInterrupt110) : + (DEFINED(__Interrupt110) ? ABSOLUTE(__Interrupt110) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt111) ? ABSOLUTE(__AltInterrupt111) : + (DEFINED(__Interrupt111) ? ABSOLUTE(__Interrupt111) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt112) ? ABSOLUTE(__AltInterrupt112) : + (DEFINED(__Interrupt112) ? ABSOLUTE(__Interrupt112) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt113) ? ABSOLUTE(__AltInterrupt113) : + (DEFINED(__Interrupt113) ? ABSOLUTE(__Interrupt113) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt114) ? ABSOLUTE(__AltInterrupt114) : + (DEFINED(__Interrupt114) ? ABSOLUTE(__Interrupt114) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt115) ? ABSOLUTE(__AltInterrupt115) : + (DEFINED(__Interrupt115) ? ABSOLUTE(__Interrupt115) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt116) ? ABSOLUTE(__AltInterrupt116) : + (DEFINED(__Interrupt116) ? ABSOLUTE(__Interrupt116) : + ABSOLUTE(__DefaultInterrupt))); + LONG( DEFINED(__AltInterrupt117) ? ABSOLUTE(__AltInterrupt117) : + (DEFINED(__Interrupt117) ? ABSOLUTE(__Interrupt117) : + ABSOLUTE(__DefaultInterrupt))); + } >aivt +} /* SECTIONS */ + + +/* +** ============== Equates for SFR Addresses ============= +*/ + + WREG0 = 0x0; +_WREG0 = 0x0; + WREG1 = 0x2; +_WREG1 = 0x2; + WREG2 = 0x4; +_WREG2 = 0x4; + WREG3 = 0x6; +_WREG3 = 0x6; + WREG4 = 0x8; +_WREG4 = 0x8; + WREG5 = 0xA; +_WREG5 = 0xA; + WREG6 = 0xC; +_WREG6 = 0xC; + WREG7 = 0xE; +_WREG7 = 0xE; + WREG8 = 0x10; +_WREG8 = 0x10; + WREG9 = 0x12; +_WREG9 = 0x12; + WREG10 = 0x14; +_WREG10 = 0x14; + WREG11 = 0x16; +_WREG11 = 0x16; + WREG12 = 0x18; +_WREG12 = 0x18; + WREG13 = 0x1A; +_WREG13 = 0x1A; + WREG14 = 0x1C; +_WREG14 = 0x1C; + WREG15 = 0x1E; +_WREG15 = 0x1E; + SPLIM = 0x20; +_SPLIM = 0x20; + PCL = 0x2E; +_PCL = 0x2E; + PCH = 0x30; +_PCH = 0x30; + TBLPAG = 0x32; +_TBLPAG = 0x32; + PSVPAG = 0x34; +_PSVPAG = 0x34; + RCOUNT = 0x36; +_RCOUNT = 0x36; + SR = 0x42; +_SR = 0x42; +_SRbits = 0x42; + CORCON = 0x44; +_CORCON = 0x44; +_CORCONbits = 0x44; + DISICNT = 0x52; +_DISICNT = 0x52; + CNEN1 = 0x60; +_CNEN1 = 0x60; +_CNEN1bits = 0x60; + CNEN2 = 0x62; +_CNEN2 = 0x62; +_CNEN2bits = 0x62; + CNPU1 = 0x68; +_CNPU1 = 0x68; +_CNPU1bits = 0x68; + CNPU2 = 0x6A; +_CNPU2 = 0x6A; +_CNPU2bits = 0x6A; + INTCON1 = 0x80; +_INTCON1 = 0x80; +_INTCON1bits = 0x80; + INTCON2 = 0x82; +_INTCON2 = 0x82; +_INTCON2bits = 0x82; + IFS0 = 0x84; +_IFS0 = 0x84; +_IFS0bits = 0x84; + IFS1 = 0x86; +_IFS1 = 0x86; +_IFS1bits = 0x86; + IFS2 = 0x88; +_IFS2 = 0x88; +_IFS2bits = 0x88; + IFS3 = 0x8A; +_IFS3 = 0x8A; +_IFS3bits = 0x8A; + IFS4 = 0x8C; +_IFS4 = 0x8C; +_IFS4bits = 0x8C; + IEC0 = 0x94; +_IEC0 = 0x94; +_IEC0bits = 0x94; + IEC1 = 0x96; +_IEC1 = 0x96; +_IEC1bits = 0x96; + IEC2 = 0x98; +_IEC2 = 0x98; +_IEC2bits = 0x98; + IEC3 = 0x9A; +_IEC3 = 0x9A; +_IEC3bits = 0x9A; + IEC4 = 0x9C; +_IEC4 = 0x9C; +_IEC4bits = 0x9C; + IPC0 = 0xA4; +_IPC0 = 0xA4; +_IPC0bits = 0xA4; + IPC1 = 0xA6; +_IPC1 = 0xA6; +_IPC1bits = 0xA6; + IPC2 = 0xA8; +_IPC2 = 0xA8; +_IPC2bits = 0xA8; + IPC3 = 0xAA; +_IPC3 = 0xAA; +_IPC3bits = 0xAA; + IPC4 = 0xAC; +_IPC4 = 0xAC; +_IPC4bits = 0xAC; + IPC5 = 0xAE; +_IPC5 = 0xAE; +_IPC5bits = 0xAE; + IPC6 = 0xB0; +_IPC6 = 0xB0; +_IPC6bits = 0xB0; + IPC7 = 0xB2; +_IPC7 = 0xB2; +_IPC7bits = 0xB2; + IPC8 = 0xB4; +_IPC8 = 0xB4; +_IPC8bits = 0xB4; + IPC9 = 0xB6; +_IPC9 = 0xB6; +_IPC9bits = 0xB6; + IPC10 = 0xB8; +_IPC10 = 0xB8; +_IPC10bits = 0xB8; + IPC11 = 0xBA; +_IPC11 = 0xBA; +_IPC11bits = 0xBA; + IPC12 = 0xBC; +_IPC12 = 0xBC; +_IPC12bits = 0xBC; + IPC13 = 0xBE; +_IPC13 = 0xBE; +_IPC13bits = 0xBE; + IPC15 = 0xC2; +_IPC15 = 0xC2; +_IPC15bits = 0xC2; + IPC16 = 0xC4; +_IPC16 = 0xC4; +_IPC16bits = 0xC4; + TMR1 = 0x100; +_TMR1 = 0x100; + PR1 = 0x102; +_PR1 = 0x102; + T1CON = 0x104; +_T1CON = 0x104; +_T1CONbits = 0x104; + TMR2 = 0x106; +_TMR2 = 0x106; + TMR3HLD = 0x108; +_TMR3HLD = 0x108; + TMR3 = 0x10A; +_TMR3 = 0x10A; + PR2 = 0x10C; +_PR2 = 0x10C; + PR3 = 0x10E; +_PR3 = 0x10E; + T2CON = 0x110; +_T2CON = 0x110; +_T2CONbits = 0x110; + T3CON = 0x112; +_T3CON = 0x112; +_T3CONbits = 0x112; + TMR4 = 0x114; +_TMR4 = 0x114; + TMR5HLD = 0x116; +_TMR5HLD = 0x116; + TMR5 = 0x118; +_TMR5 = 0x118; + PR4 = 0x11A; +_PR4 = 0x11A; + PR5 = 0x11C; +_PR5 = 0x11C; + T4CON = 0x11E; +_T4CON = 0x11E; +_T4CONbits = 0x11E; + T5CON = 0x120; +_T5CON = 0x120; +_T5CONbits = 0x120; + IC1BUF = 0x140; +_IC1BUF = 0x140; + IC1CON = 0x142; +_IC1CON = 0x142; +_IC1CONbits = 0x142; + IC2BUF = 0x144; +_IC2BUF = 0x144; + IC2CON = 0x146; +_IC2CON = 0x146; +_IC2CONbits = 0x146; + IC3BUF = 0x148; +_IC3BUF = 0x148; + IC3CON = 0x14A; +_IC3CON = 0x14A; +_IC3CONbits = 0x14A; + IC4BUF = 0x14C; +_IC4BUF = 0x14C; + IC4CON = 0x14E; +_IC4CON = 0x14E; +_IC4CONbits = 0x14E; + IC5BUF = 0x150; +_IC5BUF = 0x150; + IC5CON = 0x152; +_IC5CON = 0x152; +_IC5CONbits = 0x152; + OC1RS = 0x180; +_OC1RS = 0x180; + OC1R = 0x182; +_OC1R = 0x182; + OC1CON = 0x184; +_OC1CON = 0x184; +_OC1CONbits = 0x184; + OC2RS = 0x186; +_OC2RS = 0x186; + OC2R = 0x188; +_OC2R = 0x188; + OC2CON = 0x18A; +_OC2CON = 0x18A; +_OC2CONbits = 0x18A; + OC3RS = 0x18C; +_OC3RS = 0x18C; + OC3R = 0x18E; +_OC3R = 0x18E; + OC3CON = 0x190; +_OC3CON = 0x190; +_OC3CONbits = 0x190; + OC4RS = 0x192; +_OC4RS = 0x192; + OC4R = 0x194; +_OC4R = 0x194; + OC4CON = 0x196; +_OC4CON = 0x196; +_OC4CONbits = 0x196; + OC5RS = 0x198; +_OC5RS = 0x198; + OC5R = 0x19A; +_OC5R = 0x19A; + OC5CON = 0x19C; +_OC5CON = 0x19C; +_OC5CONbits = 0x19C; + I2C1RCV = 0x200; +_I2C1RCV = 0x200; + I2C1TRN = 0x202; +_I2C1TRN = 0x202; + I2C1BRG = 0x204; +_I2C1BRG = 0x204; + I2C1CON = 0x206; +_I2C1CON = 0x206; +_I2C1CONbits = 0x206; + I2C1STAT = 0x208; +_I2C1STAT = 0x208; +_I2C1STATbits = 0x208; + I2C1ADD = 0x20A; +_I2C1ADD = 0x20A; + I2C1MSK = 0x20C; +_I2C1MSK = 0x20C; + I2C2RCV = 0x210; +_I2C2RCV = 0x210; + I2C2TRN = 0x212; +_I2C2TRN = 0x212; + I2C2BRG = 0x214; +_I2C2BRG = 0x214; + I2C2CON = 0x216; +_I2C2CON = 0x216; +_I2C2CONbits = 0x216; + I2C2STAT = 0x218; +_I2C2STAT = 0x218; +_I2C2STATbits = 0x218; + I2C2ADD = 0x21A; +_I2C2ADD = 0x21A; + I2C2MSK = 0x21C; +_I2C2MSK = 0x21C; + U1MODE = 0x220; +_U1MODE = 0x220; +_U1MODEbits = 0x220; + U1STA = 0x222; +_U1STA = 0x222; +_U1STAbits = 0x222; + U1TXREG = 0x224; +_U1TXREG = 0x224; + U1RXREG = 0x226; +_U1RXREG = 0x226; + U1BRG = 0x228; +_U1BRG = 0x228; + U2MODE = 0x230; +_U2MODE = 0x230; +_U2MODEbits = 0x230; + U2STA = 0x232; +_U2STA = 0x232; +_U2STAbits = 0x232; + U2TXREG = 0x234; +_U2TXREG = 0x234; + U2RXREG = 0x236; +_U2RXREG = 0x236; + U2BRG = 0x238; +_U2BRG = 0x238; + SPI1STAT = 0x240; +_SPI1STAT = 0x240; +_SPI1STATbits = 0x240; + SPI1CON1 = 0x242; +_SPI1CON1 = 0x242; +_SPI1CON1bits = 0x242; + SPI1CON2 = 0x244; +_SPI1CON2 = 0x244; +_SPI1CON2bits = 0x244; + SPI1BUF = 0x248; +_SPI1BUF = 0x248; + SPI2STAT = 0x260; +_SPI2STAT = 0x260; +_SPI2STATbits = 0x260; + SPI2CON1 = 0x262; +_SPI2CON1 = 0x262; +_SPI2CON1bits = 0x262; + SPI2CON2 = 0x264; +_SPI2CON2 = 0x264; +_SPI2CON2bits = 0x264; + SPI2BUF = 0x268; +_SPI2BUF = 0x268; + TRISA = 0x2C0; +_TRISA = 0x2C0; +_TRISAbits = 0x2C0; + PORTA = 0x2C2; +_PORTA = 0x2C2; +_PORTAbits = 0x2C2; + LATA = 0x2C4; +_LATA = 0x2C4; +_LATAbits = 0x2C4; + TRISB = 0x2C6; +_TRISB = 0x2C6; +_TRISBbits = 0x2C6; + PORTB = 0x2C8; +_PORTB = 0x2C8; +_PORTBbits = 0x2C8; + LATB = 0x2CA; +_LATB = 0x2CA; +_LATBbits = 0x2CA; + TRISC = 0x2CC; +_TRISC = 0x2CC; +_TRISCbits = 0x2CC; + PORTC = 0x2CE; +_PORTC = 0x2CE; +_PORTCbits = 0x2CE; + LATC = 0x2D0; +_LATC = 0x2D0; +_LATCbits = 0x2D0; + TRISD = 0x2D2; +_TRISD = 0x2D2; +_TRISDbits = 0x2D2; + PORTD = 0x2D4; +_PORTD = 0x2D4; +_PORTDbits = 0x2D4; + LATD = 0x2D6; +_LATD = 0x2D6; +_LATDbits = 0x2D6; + TRISE = 0x2D8; +_TRISE = 0x2D8; +_TRISEbits = 0x2D8; + PORTE = 0x2DA; +_PORTE = 0x2DA; +_PORTEbits = 0x2DA; + LATE = 0x2DC; +_LATE = 0x2DC; +_LATEbits = 0x2DC; + TRISF = 0x2DE; +_TRISF = 0x2DE; +_TRISFbits = 0x2DE; + PORTF = 0x2E0; +_PORTF = 0x2E0; +_PORTFbits = 0x2E0; + LATF = 0x2E2; +_LATF = 0x2E2; +_LATFbits = 0x2E2; + TRISG = 0x2E4; +_TRISG = 0x2E4; +_TRISGbits = 0x2E4; + PORTG = 0x2E6; +_PORTG = 0x2E6; +_PORTGbits = 0x2E6; + LATG = 0x2E8; +_LATG = 0x2E8; +_LATGbits = 0x2E8; + PADCFG1 = 0x2FC; +_PADCFG1 = 0x2FC; +_PADCFG1bits = 0x2FC; + ADC1BUF0 = 0x300; +_ADC1BUF0 = 0x300; + ADC1BUF1 = 0x302; +_ADC1BUF1 = 0x302; + ADC1BUF2 = 0x304; +_ADC1BUF2 = 0x304; + ADC1BUF3 = 0x306; +_ADC1BUF3 = 0x306; + ADC1BUF4 = 0x308; +_ADC1BUF4 = 0x308; + ADC1BUF5 = 0x30A; +_ADC1BUF5 = 0x30A; + ADC1BUF6 = 0x30C; +_ADC1BUF6 = 0x30C; + ADC1BUF7 = 0x30E; +_ADC1BUF7 = 0x30E; + ADC1BUF8 = 0x310; +_ADC1BUF8 = 0x310; + ADC1BUF9 = 0x312; +_ADC1BUF9 = 0x312; + ADC1BUFA = 0x314; +_ADC1BUFA = 0x314; + ADC1BUFB = 0x316; +_ADC1BUFB = 0x316; + ADC1BUFC = 0x318; +_ADC1BUFC = 0x318; + ADC1BUFD = 0x31A; +_ADC1BUFD = 0x31A; + ADC1BUFE = 0x31C; +_ADC1BUFE = 0x31C; + ADC1BUFF = 0x31E; +_ADC1BUFF = 0x31E; + AD1CON1 = 0x320; +_AD1CON1 = 0x320; +_AD1CON1bits = 0x320; + AD1CON2 = 0x322; +_AD1CON2 = 0x322; +_AD1CON2bits = 0x322; + AD1CON3 = 0x324; +_AD1CON3 = 0x324; +_AD1CON3bits = 0x324; + AD1CHS = 0x328; +_AD1CHS = 0x328; +_AD1CHSbits = 0x328; + AD1PCFG = 0x32C; +_AD1PCFG = 0x32C; +_AD1PCFGbits = 0x32C; + AD1CSSL = 0x330; +_AD1CSSL = 0x330; +_AD1CSSLbits = 0x330; + PMCON = 0x600; +_PMCON = 0x600; +_PMCONbits = 0x600; + PMMODE = 0x602; +_PMMODE = 0x602; +_PMMODEbits = 0x602; + PMADDR = 0x604; +_PMADDR = 0x604; +_PMADDRbits = 0x604; + PMDOUT1 = 0x604; +_PMDOUT1 = 0x604; + PMDOUT2 = 0x606; +_PMDOUT2 = 0x606; + PMDIN1 = 0x608; +_PMDIN1 = 0x608; + PMDIN2 = 0x60A; +_PMDIN2 = 0x60A; + PMPEN = 0x60C; +_PMPEN = 0x60C; +_PMPENbits = 0x60C; + PMSTAT = 0x60E; +_PMSTAT = 0x60E; +_PMSTATbits = 0x60E; + ALRMVAL = 0x620; +_ALRMVAL = 0x620; + ALCFGRPT = 0x622; +_ALCFGRPT = 0x622; +_ALCFGRPTbits = 0x622; + RTCVAL = 0x624; +_RTCVAL = 0x624; + RCFGCAL = 0x626; +_RCFGCAL = 0x626; +_RCFGCALbits = 0x626; + CMCON = 0x630; +_CMCON = 0x630; +_CMCONbits = 0x630; + CVRCON = 0x632; +_CVRCON = 0x632; +_CVRCONbits = 0x632; + CRCCON = 0x640; +_CRCCON = 0x640; +_CRCCONbits = 0x640; + CRCXOR = 0x642; +_CRCXOR = 0x642; + CRCDAT = 0x644; +_CRCDAT = 0x644; + CRCWDAT = 0x646; +_CRCWDAT = 0x646; + ODCA = 0x6C0; +_ODCA = 0x6C0; +_ODCAbits = 0x6C0; + ODCB = 0x6C6; +_ODCB = 0x6C6; +_ODCBbits = 0x6C6; + ODCC = 0x6CC; +_ODCC = 0x6CC; +_ODCCbits = 0x6CC; + ODCD = 0x6D2; +_ODCD = 0x6D2; +_ODCDbits = 0x6D2; + ODCE = 0x6D8; +_ODCE = 0x6D8; +_ODCEbits = 0x6D8; + ODCF = 0x6DE; +_ODCF = 0x6DE; +_ODCFbits = 0x6DE; + ODCG = 0x6E4; +_ODCG = 0x6E4; +_ODCGbits = 0x6E4; + RCON = 0x740; +_RCON = 0x740; +_RCONbits = 0x740; + OSCCON = 0x742; +_OSCCON = 0x742; +_OSCCONbits = 0x742; + CLKDIV = 0x744; +_CLKDIV = 0x744; +_CLKDIVbits = 0x744; + OSCTUN = 0x748; +_OSCTUN = 0x748; +_OSCTUNbits = 0x748; + NVMCON = 0x760; +_NVMCON = 0x760; +_NVMCONbits = 0x760; + NVMKEY = 0x766; +_NVMKEY = 0x766; + PMD1 = 0x770; +_PMD1 = 0x770; +_PMD1bits = 0x770; + PMD2 = 0x772; +_PMD2 = 0x772; +_PMD2bits = 0x772; + PMD3 = 0x774; +_PMD3 = 0x774; +_PMD3bits = 0x774; Index: PIC24_MPLAB/RTOSDemo_PIC24.mcs =================================================================== --- PIC24_MPLAB/RTOSDemo_PIC24.mcs (nonexistent) +++ PIC24_MPLAB/RTOSDemo_PIC24.mcs (revision 587) @@ -0,0 +1,7 @@ +[Header] +MagicCookie={0b13fe8c-dfe0-40eb-8900-6712719559a7} +Version=1.0 +[TOOL_LOC_STAMPS] +tool_loc{DE18EB1A-B46B-486B-B96F-A811A635DFAC}=C:\Devtools\Microchip\MPLAB C30\bin\pic30-as.exe +tool_loc{069BD372-6CA0-40D4-BF2F-5DC806D05083}=C:\Devtools\Microchip\MPLAB C30\bin\pic30-gcc.exe +tool_loc{433C3D55-811D-409D-A6BF-159CF9355B42}=C:\Devtools\Microchip\MPLAB C30\bin\pic30-ld.exe

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.