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

import Microchip C18 to CCS C

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



Joined: 07 Feb 2011
Posts: 26

View user's profile Send private message

import Microchip C18 to CCS C
PostPosted: Mon Sep 26, 2011 2:10 pm     Reply with quote

The following is a Microchip C18, What is the equivalent
in CCS C

Code:
 
   
      PORTBbits.RB1 = ~uchrBitArray[ uchrBitCounter ];
      
   


I have tried
Code:
PIN_B1 = ~uchrBitArray[ uchrBitCounter ];



But I got an error Expecting LVALUE such as a variable name or * expression
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Sep 26, 2011 2:21 pm     Reply with quote

The implication seems to be:
Code:

output_bit(PIN_B1,~uchrBitArray[ uchrBitCounter ]);


is just ONE of several ways in CCS parlance to convert this.
temtronic



Joined: 01 Jul 2010
Posts: 9225
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Mon Sep 26, 2011 5:49 pm     Reply with quote

The easiest way to figure it out is to compile the C18 code, dump the listing and see what the code is. Then cut a CCS C program, compile, dump the listing and compare. Once the listings agree, you'll have the exact CCS equal to C18.

Should take 1/2 hr, maybe 1 hr. max.
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Mon Sep 26, 2011 8:08 pm     Reply with quote

Actually, if you import the structure and assign it with #byte, then the original C18 syntax continues to work.

I've done that in the past and it's a lot easier since changing the header files to work allows all the .C files to fall in line.

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
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