![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Guest
|
Trouble compiling a module.... |
Posted: Wed Aug 12, 2009 4:19 pm |
|
|
Hi All,
I've got a module associated with a project I'm working on that contains all the one wire routines I'll need. When I compile my project, I get lots of errors for this module that I'm not sure how to deal with. Here is the first routine in the module, and the errors that are generated for this block:
Code: |
//=====< Hardware Control Subroutines >===================================
// The following are standard 1-Wire routines.
void 1w_init(int8 sensor)
{
output_high(40 + sensor);
output_low(40 + sensor);
delay_us(500);
output_high(40 + sensor);
delay_us(500);
}
|
*** Error 81 “C:\PICC Projects\1_wire.c” Line 4(6,7): Expecting a basic type
*** Error 43 “C:\PICC Projects\1_wire.c” Line 4(13,14): Expecting a declaration
*** Error 36 “C:\PICC Projects\1_wire.c” Line 5(1,2): Expecting a ; or , *** Error 28 “C:\PICC Projects\1_wire.c” Line 6(19,21): Expecting an identifier
*** Error 48 “C:\PICC Projects\1_wire.c” Line 6(21,27): Expecting a (
*** Error 43 “C:\PICC Projects\1_wire.c” Line 6(28,29): Expecting a declaration
*** Error 28 “C:\PICC Projects\1_wire.c” Line 7(18,20): Expecting an identifier
*** Error 48 “C:\PICC Projects\1_wire.c” Line 7(20,26): Expecting a (
*** Error 43 “C:\PICC Projects\1_wire.c” Line 7(27,28): Expecting a declaration
*** Error 28 “C:\PICC Projects\1_wire.c” Line 8(13,16): Expecting an identifier
*** Error 43 “C:\PICC Projects\1_wire.c” Line 8(17,18): Expecting a declaration
*** Error 28 “C:\PICC Projects\1_wire.c” Line 9(19,21): Expecting an identifier
*** Error 48 “C:\PICC Projects\1_wire.c” Line 9(21,27): Expecting a (
*** Error 43 “C:\PICC Projects\1_wire.c” Line 9(28,29): Expecting a declaration
*** Error 28 “C:\PICC Projects\1_wire.c” Line 10(13,16): Expecting an identifier
*** Error 43 “C:\PICC Projects\1_wire.c” Line 10(17,18): Expecting a declaration
*** Error 43 “C:\PICC Projects\1_wire.c” Line 11(1,2): Expecting a declaration
Thoughts?
Dave |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Aug 12, 2009 4:33 pm |
|
|
You got that code from this thread I suppose:
http://www.ccsinfo.com/forum/viewtopic.php?t=19795&start=18
If so, you've changed it. You have removed the '_' from the
beginning of the function name. C function names and other identifiers
cannot begin with a number. It's not allowed. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Thu Aug 13, 2009 9:36 am |
|
|
Hi,
Yes, that fixed the problem!
I used the Peter Andersen code as a framework, but rewrote the code extensively. I didn't like the fact that he wasn't using the built in CCS functions, and that he was using in-line ASM code.
We'll see if my implementation works.....
Dave |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|