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 support@ccsinfo.com

use special function registers by name?

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



Joined: 21 Sep 2009
Posts: 21

View user's profile Send private message

use special function registers by name?
PostPosted: Thu Sep 09, 2010 1:40 pm     Reply with quote

OK, right now I have a series of these:

Code:
#ifdef PIC18F25K11
  #byte TXREG=0xFAE
  #byte RCREG=0xFAF
#else
  #byte TXREG=0xFAD
  #byte RCREG=0xFAE
#endif


I want do to something like this:
Code:

#byte TXREG=something("TXREG")
#byte RCREG=something("RCREG")


How do I do this in CCS C? I'm running V4.112
Ttelmah



Joined: 11 Mar 2010
Posts: 19369

View user's profile Send private message

PostPosted: Thu Sep 09, 2010 2:38 pm     Reply with quote

Getenv.
A lot of the examples 'predate' this, but for the last few years, the compiler has supported commands like:

#byte TXREG=getenv("TXREG")

which will work on all the PIC families.

Best Wishes
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