Pumpkin, Inc.

Pumpkin User Forums

Salvo 'OSC' define conflict with '#pragma config'

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

Salvo 'OSC' define conflict with '#pragma config'

Postby DFx_Tech » Wed Sep 07, 2005 3:52 am

Hi Andrew,

I have a problem with migrating my code to use the '#pragma config' commands required by the latest Microchip C18 compiler.

The instruction for setting the oscillator is now:

"#pragma config OSC = xxxx"

Obviously this doesn't work as salvo defines OSC in salvo.h.

I didn't want to try messing with the salvo source myself as I may break something adding a prefix to all instances of OSx.....is there any chance of a bug fix for this?

- Jon

DFx_Tech
 
Posts: 14
Joined: Tue Sep 07, 2004 11:00 pm
Location: Witney, Oxfordshire, England

Re: Salvo 'OSC' define conflict with '#pragma config'

Postby aek » Wed Sep 07, 2005 7:59 am

Hmmm .. that's a good point.

Two ideas:

1) In the file where you declare the pragma, simply

#ifdef OSC
#undef OSC
#endif

before the pragma.

2) Comment out the #define OSC line in salvo.h. I don't think you'll need it for MPLAB-C18. OSC seems to be the only "word" / abbreviation that might conflict with other three-letter "OS?" symbols.

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

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

Re: Salvo 'OSC' define conflict with '#pragma config'

Postby DFx_Tech » Wed Sep 07, 2005 8:25 am

Good point, I had forgoten that you could undefine things

My solution at the momment is to have a seperate C file just for #pragma config's, then I don't have to include salvo.h and can avoid the problem entirely.

DFx_Tech
 
Posts: 14
Joined: Tue Sep 07, 2004 11:00 pm
Location: Witney, Oxfordshire, England

Re: Salvo 'OSC' define conflict with '#pragma config'

Postby Milind » Sat Mar 11, 2006 1:29 am


Thanks for the solution.
I was trying to find a solution
to the same problem , when I came across
this formu, and your discussion.
Milind
 
Posts: 3
Joined: Fri Mar 10, 2006 12:00 am
Location: Pune,Maharashtra,India


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 2 guests

cron