Hi,
I am trying to use printf function. It works with “void TERMIO_PutChar(char ch);”, but I need whole string at once. So, I want to use this function: “void TERMIO_PutString(const char *p);”. It doesn’t work even I define this string: “_TERMIO_HAS_PUT_STRING_”.
The original function definition in TERMIO.h:
#ifdef _TERMIO_HAS_PUT_STRING_ void TERMIO_PutString(const char *p); #endif
I tried somethnig like this:
void TERMIO_PutString(const char *p){ while(*p){ vSCI0_send( (signed char) *p); p++; } }
Thanks,
Excuse my English.
已解决! 转到解答。
Hello
This is just a function prototype for a function that can be called by printf to write output to stdout as a whole string.
Idea here is that printf is ready to support that as soon as a programmer implements such a function.
As stated in my previous email the fact that you want to send the whole string at once is probably a requirement from the device you want to use for stdout.
So you need to write the driver for that device.
The SCI we are using as stdout in TermIO.c can only transfer one character at a time. So there is no reason for implementing a PutString function there.
CrasyCat
Hello
This is just a function prototype for a function that can be called by printf to write output to stdout as a whole string.
Idea here is that printf is ready to support that as soon as a programmer implements such a function.
As stated in my previous email the fact that you want to send the whole string at once is probably a requirement from the device you want to use for stdout.
So you need to write the driver for that device.
The SCI we are using as stdout in TermIO.c can only transfer one character at a time. So there is no reason for implementing a PutString function there.
CrasyCat
Hello
THere is no implementation of TERMIO_PutString available in the layout.
You have to implement it yourself.
If you need ability to send the whole string at once, you are probably using something else as a SCI as standard output.
In this case you need to write the low level function for your peripheral yourself.
Implementation will depend on the peripheral used.
CrasyCat