CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

getenv("DEVICE") question

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pfournier



Joined: 30 Sep 2003
Posts: 89

View user's profile Send private message

getenv("DEVICE") question
PostPosted: Thu Mar 06, 2014 8:46 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group