Pumpkin, Inc.

Pumpkin User Forums

syntax error during compiling

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

syntax error during compiling

Postby Salvo Tech Support » Tue Sep 03, 2002 11:09 am

Hello.

Your syntax for interrupt handlers is incompatible with MPLAB-C18. Here's how it's done in salvo ut u1isr.c:

code:
#pragma interrupt ISRHigh save=PROD,section(".tmpdata")

void ISRHigh( void )
{
if ( INTCONbits.TMR0IE && INTCONbits.TMR0IF ) {
INTCONbits.TMR0IF = 0;
TMR0 -= TMR0_RELOAD;

OSTimer();
}
}


Regards,

------------------
--------
Salvo Technical Support
Please request all tech support through the Forums.

--------
Salvo Technical Support
Please request all tech support through the Forums.
Salvo Tech Support
 
Posts: 173
Joined: Sun Nov 19, 2000 12:00 am

Re: syntax error during compiling

Postby MeX » Tue Sep 03, 2002 11:40 am

Hi there,
I recently started working on a Atrial Fibrillation Detector.
The software I use is written in C++. My job is to compile
the C++ program into Microchip C18
environment. I use Mplab IDE a workingarea
and the p18f452 as processor.

When I start compiling the program some errors occurd.
following the program:

/*
* INTER.C
*
* DESCRIPTION
* The 'isr' function is called every time a interrupt is generated.
* Depending on the type of interrupt, the AD is started or the AD
* is read out and passed to the detection algorthms.
*
* CALLS
* interrupt
*
*/
#include <pic18.h>

#include "includeqrsdet.h"
#include "includesram.h"
#include "includeafalgo.h"

/*
* INTERRUPT
*
* DESCRIPTION
* Interrupt Service Routine
*
* CALLS
* interrupt
*
*/
static void interrupt isr(void)
{
bank3 static unsigned char int_count = 0;
bank3 static unsigned char first50 = 0;
bank3 static unsigned char first=1;

unsigned int data=0;
unsigned char RR=0;

//---- Timer0 overflow interrupt ---------------------------------
if(T0IF)
{
T0IF = 0; // Clear the interrupt flag

if(int_count == 4)
{
GODONE = 1; // Set GO-bit
int_count = 0;
}
else int_count++;
}

//---- ADConversion ready --------------------------------------
if(ADIF)
{
ADIF = 0; // Clear the interrupt flag

data = ADRESL | (ADRESH << 8); // Read data from ADC
data = data & 0x03FF; // Shift extra bits to zero

if(first50 < 50) // First 50 samples for init filters
{
if(first)
{
AFDetector(0,1); // Clear memory for AFDetector
RR=QRSdet(0,1); // Init QRS detector
first=0; // Once once at startup, not every time until 50
}
else
{
RR=QRSdet(0,1); // Init QRS detector
}
first50++;
}
else
{
RR=QRSdet(data,0); // Detects QRS peak and returns the interval
RR=AFDetector(RR,0); // Perform the detection algorithm
}
}
}

Compiling INTER.C:
Command line: "C:mcc18inmcc18.exe -ms -Ol+ -Oa- -w2 -Ot- -Ob- -p=18F452 -iC:AFINCLUDE;C:MCCH;C:MCCSRCPROC C:AFINTER.C"
Error[yy] C:AFINTER.C 29 : syntax error

the error occurs when compiling :
static void interrupt isr(void)

does anybody know how I can solve this problem? or where I can info. about the
problem in order to solve it that way?

Regards,
Christian van Lumig
cvanlumig@hotmail.com

MeX
 
Posts: 2
Joined: Mon Sep 02, 2002 11:00 pm
Location: Gronsveld,Limburg,Netherlands


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 2 guests

cron