This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

putchar and getchar

i have read Mark Odell's UART driver.
However,the code size is too large for me.

can i just using the simple function call:

char x,y;
getchar(y); //get char from urat
x=y;
putchar(x); //put char to urat

is it possible to do that in keil?

Parents
  • Too large? Code or data? If code, eliminate all the access functions for setting UART options. Just hard code the thing for a given baud, EOL translation, etc. That'll save you some code space.

    Next, reduce the ring buffer sizes for better data compactness. Let me know what size you hope for in code and data, I'll see if I can get you there.

Reply
  • Too large? Code or data? If code, eliminate all the access functions for setting UART options. Just hard code the thing for a given baud, EOL translation, etc. That'll save you some code space.

    Next, reduce the ring buffer sizes for better data compactness. Let me know what size you hope for in code and data, I'll see if I can get you there.

Children