View previous topic :: View next topic |
Author |
Message |
JBM
Joined: 12 May 2004 Posts: 54 Location: edinburgh, Scotland
|
CCS FAQ #25 has a syntax error |
Posted: Wed May 26, 2004 1:57 pm |
|
|
I wanted to write a funciton that waited for a character over the RS232 link, but I spotted the answer here.
I copied + pasted the code into my program and tried compiling, but it kept telling me that kbhit is an "Undefined identifier".
I checked the paper manual and compared it to the online version:
Manual
Code: | while(!kbhit()&&(++timeout<50000)) // 1/2 second |
Online version
Code: | while(!kbhit&&(++timeout<50000)) // 1/2 second |
The vital difference is that the online version is missing (), meaning kbhit is not recognised as a funciton by the complier.
CCS people, could we please get it sorted? |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Wed May 26, 2004 3:14 pm |
|
|
Please report this kind of bugs also to CCS directly. This forum is mainly for users of CCS so reporting bugs here can be useful to other users, but CCS employees are not likely to see it. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Thu May 27, 2004 1:23 am |
|
|
Quote: | (from CCS C Compiler Help)
KBHIT()
Syntax:
value = kbhit()
Requires
#use rs232
|
Did u #use rs232? |
|
![](templates/subSilver/images/spacer.gif) |
JBM
Joined: 12 May 2004 Posts: 54 Location: edinburgh, Scotland
|
Re: guest |
Posted: Thu May 27, 2004 5:10 am |
|
|
Yes I did #use RS232.
If I hadn't, when the kbhit() function apperas a few lines later the compiler would have given me an error saying that the funciton kbhit() had not been defined.
The proof of the pudding is in the eating, and by adding the () to the line I quoted in my first post made everthing work fine. |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Thu May 27, 2004 5:41 am |
|
|
I like your pudding ![Laughing](images/smiles/icon_lol.gif) |
|
![](templates/subSilver/images/spacer.gif) |
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Thu May 27, 2004 8:04 am |
|
|
Fixed |
|
![](templates/subSilver/images/spacer.gif) |
Guest
|
|
Posted: Thu May 27, 2004 8:10 am |
|
|
Darren, are you from CCS?
page 109 is OK
page 222 is not |
|
![](templates/subSilver/images/spacer.gif) |
Darren Rook
Joined: 06 Sep 2003 Posts: 287 Location: Milwaukee, WI
|
|
Posted: Thu May 27, 2004 12:17 pm |
|
|
Yes I am, but I have no control over the manual if that's what you're asking. |
|
![](templates/subSilver/images/spacer.gif) |
|