View previous topic :: View next topic |
Author |
Message |
pic_micro
Joined: 07 Feb 2011 Posts: 26
|
import Microchip C18 to CCS C |
Posted: Mon Sep 26, 2011 2:10 pm |
|
|
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
|
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Mon Sep 26, 2011 2:21 pm |
|
|
The implication seems to be:
Code: |
output_bit(PIN_B1,~uchrBitArray[ uchrBitCounter ]);
|
is just ONE of several ways in CCS parlance to convert this. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9168 Location: Greensville,Ontario
|
|
Posted: Mon Sep 26, 2011 5:49 pm |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
bkamen
Joined: 07 Jan 2004 Posts: 1611 Location: Central Illinois, USA
|
|
Posted: Mon Sep 26, 2011 8:08 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|