Hi:
I 'm working with Keil and GNU Compiler, and I try to use the printf
function. I initialised the UART0 and the putchar function works
fine. But the printf doesn't work. It only works if I use it as printf
("H"), but if I use printf("Hello"), it doesn't work.
This is the putchar function...
int putchar(int ch) { /* Write character to Serial
Port */
if (ch == '\n') {
while (!(U0LSR & 0x20));
U0THR = CR; /* output CR */
}
while (!(U0LSR & 0x20));
return (U0THR = ch);
}
I also include the stdio.h library. Do I have to include something
else to have the printf function working correctly?
ThanksMessage
Printf Problem
2004-12-14 by gustavo_sagasti
Attachments
- No local attachments were found for this message.