Stream redirection.
More...
#include <stdio.h>
#include "sarmfsw.h"
|
void | stdout_no_buffer (void) |
| Change stdout buffer state to no buffering, allowing to send any char written to stream on the fly.
|
|
Stream redirection.
- Author
- SMFSW
- Copyright
- MIT (c) 2017-2024, SMFSW
- Note
- define ITM_REDIRECT in compiler defines for stings to be printed to ITM0 port
-
define UART_REDIRECT and DBG_SERIAL in compiler defines with an UART instance to send printf likes strings to UART
- Warning
- By default when using syscalls, stdout stream is buffered, meaning that output will only be processed when '\n' (new line) character is sent to buffer. To override this behavior, stdout_no_buffer has to be called once in init routine to disable buffering, thus processing characters as they come.
◆ STDREAM_RDIR_RCV_SYSCALLS
#define STDREAM_RDIR_RCV_SYSCALLS 0 |
- Note
- STDREAM_RDIR_RCV_SYSCALLS can be defined at project level to define redirection behavior
◆ stdout_no_buffer()
void stdout_no_buffer |
( |
void | | ) |
|
|
inline |
Change stdout buffer state to no buffering, allowing to send any char written to stream on the fly.
- Note
- If this inline is not called once, strings will be written to stream only when '\n' (new line) is written to buffer.
-
Please keep in mind that disabling buffering will call _write once for every character vs once for every buffered line when buffering is enabled.