HARMcksL: ARM HAL toolbox (yet STM32 oriented) 1.6
SMFSW collection of HAL hacks for STM32
Loading...
Searching...
No Matches
stdream_rdir.h File Reference

Stream redirection. More...

#include <stdio.h>
#include "sarmfsw.h"
Include dependency graph for stdream_rdir.h:
This graph shows which files directly or indirectly include this file:

Macros

#define STDREAM_RDIR_RCV_SYSCALLS   0
 

Functions

void stdout_no_buffer (void)
 Change stdout buffer state to no buffering, allowing to send any char written to stream on the fly.
 

Detailed Description

Stream redirection.

Author
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.

Macro Definition Documentation

◆ 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

Function Documentation

◆ 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.