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

Stream redirection. More...

#include <stdio.h>
#include "sarmfsw.h"
#include "UART_term.h"
#include "stdream_rdir.h"
Include dependency graph for stdream_rdir.c:

Functions

int _write (int file, char *ptr, int len)
 syscalls implementation of _write
 

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.

Function Documentation

◆ _write()

int _write ( int file,
char * ptr,
int len )

syscalls implementation of _write

Strong Functions
Strong implementation of _write for UART & ITM string send to stream
Parameters
[in]file- unused
[in]ptr- pointer to string to send to stream
[in]len- length of string to send to stream
Returns
length written to stream (-1 otherwise)
Return values
-1is returned in case of failure (UART)
Here is the call graph for this function: