pfournier
Joined: 30 Sep 2003 Posts: 89
|
getenv("DEVICE") question |
Posted: Thu Mar 06, 2014 8:46 am |
|
|
Using PCWHD 5.020
I tried this preproccesor code:
This is right at the top of may main.c file.
Code: |
#if getenv("DEVICE") == "PIC18F4620"
#define STACK_USE_PICDEM_LCD 1
#elif getenv("DEVICE") == "PIC18F87J50"
#define STACK_USE_PICDEM_LCD 0
#else
#error Device not defined
#endif |
It seemed to be working when I put it in the middle of my all day programming session. When I came in this morning and tried a compile it threw up my "Device not defined" error message
For jollies I put:
#device PIC18F87J50
as my first line. The compile worked as expected.
I the REMOVED the #device line and it STILL compiled.
I had hoped getenv("DEVICE") would be reading the processor setup in either the Compile Menu, or the Options/Project/General/Target, but by modifying the #device value it modifies the target in the Compile Menu, and the Options/Project/General/Target.
The big thing that bothers me is that removing the #device value doesn't change anything.
Am I missing something here? _________________ -Pete |
|