Allow changing write function of stdout.
Required for stdout redirection. Works on blocks, not chars - does _not_ use sdk_os_putc ! Should work even when linking with SPIFFS.
This commit is contained in:
parent
53f85d0a2c
commit
194b8e420a
3 changed files with 69 additions and 28 deletions
24
core/include/stdout_redirect.h
Normal file
24
core/include/stdout_redirect.h
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/*
|
||||
* Part of esp-open-rtos
|
||||
* Copyright (C) 2016 Oto Petrik <oto.petrik@gmail.com>
|
||||
* BSD Licensed as described in the file LICENSE
|
||||
*/
|
||||
|
||||
#ifndef _STDOUT_REDIRECT_H_
|
||||
#define _STDOUT_REDIRECT_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
typedef long _WriteFunction(struct _reent *r, int fd, const char *ptr, int len );
|
||||
|
||||
void set_write_stdout(_WriteFunction *f);
|
||||
_WriteFunction *get_write_stdout();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _STDOUT_REDIRECT_H_ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue