Is there a way to prevent getchar from echoing the input characters? I tried to write my own implementation of getchar, but the linker doesn't seem to let me do that. - Mike
My "char getchar(void){return 0;};" links just fine. What error message are you getting?
I've taken the Traffic example. If I put "char getchar(void){return 0;}" in Serial.c, at link stage I get *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: getchar MODULE: C:\KEIL\C166\LIB\C167S.LIB (GETCHAR) *** ERROR L118: REFERENCE MADE TO ERRONEOUS EXTERNAL SYMBOL: getchar MODULE: C:\KEIL\C166\LIB\C167S.LIB (SCANF) ADDRESS: 07A6H
I've taken the Traffic example. If I put "char getchar(void){return 0;}" in Serial.c, at link stage I get *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS I believe the reason for the error is that the function is defined as:
extern signed char getchar (void);
Actually, redefining getchar and ungetchar at the same time did the trick. I should have done that in the first place, so stupid of me. Thanks to everyone! - Mike