Hi, I'm using CW 11.1 because my processor is MC9S08DZ60A. I am porting some code from another compiler. The existing code tied its serial port driver into printf by coding a function named putchar. But when I try to build that function, I get a whole bunch of weird compiler errors.
Here is the code:
int putchar( char c ) /* stdio - for printf to use */
{
sci_write(c);
return(c);
}
The errors I get on the first line of the function are:
Multiple markers at this line
- C2801 ')' missing
- C2801 ';' missing
- C1815 c not declared (or typename)
- C5002 Illegal type
- Syntax error
I am so confused. Is putchar a macro and not a function? What is the right way to tell printf I want it to use my serial driver? Any suggestions appreciated.
Thanks,
Lloyd