char OsFPutC( char ch, UInt8T stream );
Function OsFPutC() should be called by the client application to send a single character to a stream. The function arguments are the character and the stream identifier. All character values are accepted as the first argument but their effect depends on the stream. If an invalid stream identifier is supplied, the function does nothing. The return value is the value of the first argument, the character written to the stream.
The general form of this function is the same as the ANSI standard C library function fputc().
The example below shows a newline character being sent to UART1 and a form feed character being sent to the display. The newline at UART1 causes two characters to be buffered and send to the UART, first a carriage return and then a newline. The form feed causes the display to be cleared.
OsFPutC( '\n', OS_UART1 );
OsFPutC( '\f', OS_DISPLAY );
Non-printing characters have the following effects on the display stream:
'\r' |
carriage return |
insertion point returns to the start of the current line |
|---|---|---|
'\n' |
newline |
insertion point moves to the start of the next line |
'\t' |
tab |
insertion point moves to the next tab stop |
'\f' |
form feed |
display is cleared, insertion point moves to start of the first line |