Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions components/esp8266/include/esp_libc.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,20 @@ int ets_putc(int c);
*/
int ets_vprintf(const char *fmt, va_list ap);

/**
* libnet80211.a produces some debug output using ets_printf(), and continues
* to use this function well after bootup. If the serial port is used for other
* purposes than logging, it disrupts serial communication at arbitraty moments.
* The output looks like:
* I (5504) wifi:state: 0 -> 2 (b0)
* I (5545) wifi:state: 2 -> 3 (0)
* I (5551) wifi:state: 3 -> 5 (10)
* This flag is a quick stopgap solution. If set by the app, ets_vprintf() output
* is completely supressed.
* See https://github.com/espressif/ESP8266_RTOS_SDK/issues/1082
*/
extern int __ets_vprintf_disable;

#ifndef os_printf
#define os_printf printf
#endif
Expand Down
5 changes: 5 additions & 0 deletions components/esp8266/source/ets_printf.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,13 @@ static int ets_printf_int(val_attr_t * const attr, uint8_t hex)
return 0;
}

int __ets_vprintf_disable = 0;

int ets_vprintf(const char *fmt, va_list va)
{
if (__ets_vprintf_disable)
return 0;

for (; ;) {
const char *ps = fmt;
val_attr_t attr;
Expand Down