Pumpkin, Inc.

Pumpkin User Forums

Compiling under Windows 2003

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®).

Compiling under Windows 2003

Postby richards » Tue May 09, 2006 12:00 am

I tried an example that removed SALVO's macros from the equation.

The problem still existed - so we will pursue this with MicroChip and MicroSoft.

Thanks,

Richard

richards
 
Posts: 3
Joined: Mon May 08, 2006 11:00 pm
Location: Milwaukee, WI, USA

Re: Compiling under Windows 2003

Postby richards » Tue May 09, 2006 5:43 am

I am having problems with SALVO function calls when compiling with MCC18 under Windows 2003. Works OK under 2000/XP.

Here's an example.

#define OS_HALF_SECOND 500/OS_TICK
OS_Delay(OS_HALF_SECOND , NULL);
The compiler returns: Syntax Error

To narrow the problem, I trid the following substitutions:
OS_Delay(500/OS_TICK, NULL); // WORKS
OS_Delay(OS_TICK , NULL); // Syntax Err
OS_Delay(500 , NULL); // WORKS

#defind Richard 500
OS_Delay(Richard, NULL); // Syntax Err

So the pattern so far - If the argument to OS_Delay is starts with a non-numeric character - I get the syntax error.

I've also gotten this with OS_ReadBinSem and OS_WaitBinSem.

Any assistance will be welcome.

richards
 
Posts: 3
Joined: Mon May 08, 2006 11:00 pm
Location: Milwaukee, WI, USA

Re: Compiling under Windows 2003

Postby aek » Tue May 09, 2006 7:38 am

What exactly is "Windows 2003"?

Are you running a Server version of Windows?

Regardless, I'm not sure how the Windows version would affect anything ... I would also advise against using NULL as a label.

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Compiling under Windows 2003

Postby richards » Tue May 09, 2006 9:32 am

Andrew:

Yes, 2003 is running on a server. The folks who do our official builds are converting their servers to WIN2003. During their trials, they encounted this problem.

I can get a clean build if I substitute MACRO calls with the corresponding in-line statements (I'll email some samples separately).

Like you, I'm at a loss to explain how MACRO expansion would be affected by the server's OS, unless the compiler uses some OS text processing library that is different in WIN2003.

FYI - I'm also running this past my MicroChip FAE for an opinion as well. (I'll let our server administrator deal with Microsoft!)

Thanks for your help.

Richard

richards
 
Posts: 3
Joined: Mon May 08, 2006 11:00 pm
Location: Milwaukee, WI, USA

Re: Compiling under Windows 2003

Postby aek » Tue May 09, 2006 9:51 am

Thanks for the feedback.

I would debug this by trying to reproduce the problem in a non-Salvo app, simply with a function that expects an argument of the same type as OS_Delay() (which is normally an 8-bit unsigned value).

What happens if you pass the "bad" macro to OSDelay(x)? Note that OSDelay() is a function (not normally used by the user), which is called via the macro OS_Delay().

Another way I debug this sort of thing is to look at the preprocessor output, though your error may in fact be pre-preprocessor.

Note that C has some rules regarding the first character of a defined constant -- I always avoid a numeric letter as the first character of a defined constant. My gut feeling is that the preprocessor is not seeing the OS_TICK symbol at all, or that the OS_TICK symbol somehow is either already predefined or is badly defined (bad character or something). Try #undefining OS_TICK before you #define it and see if something happens (or check if OS_TICK is already defined before you #define it).

------------------

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron