AnsweredAssumed Answered

CW 5.1 Error Messages

Question asked by SRuggles on Jul 30, 2007
Latest reply on Jul 30, 2007 by SRuggles
I get the error: "C2801: ')' missing" when I try to compile the following code segment.  I am using CW5.1 with the latest patches and am targeting the JB16. 
 
/******************************************************************************
 cputchar
  wait for RTS then send a single byte to the SCI transmitter */
 
char cputchar(unsigned char scbyte){
 if (ReadyToSend()) return 1;  // wait for TX Empty bit to set
 SCDR = scbyte;     // send char out TX
 return 0;
}
 
/****************************************************************************
 cputch
 check for end of line marker and send CR/LF, else, send input char */
 
void cputch(unsigned char ch){
 if (ch == ('\n')){
  cputchar(LF);
  cputchar(CR);
 } else {
  cputchar(ch);
 }
}
/*void cputch(unsigned char ch){
 unsigned char i, j;
 
 i = LF;
 j = CR;
 if (ch == '\n') {
  cputchar(i);
  cputchar(j);
 }
}*/
/****************************************************************************
I have included all the .h files necessary to define program variables including the sci.h file where I have defined LF and CR. 
 
The code segment I have commented out compiles with no errors.  Why am I getting this error?  Why will this code segment not compile?  Any suggestions will be appreciated. 
 
Thanks

Outcomes