mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-22 21:23:07 +03:00
* Add code to select the UART for Boot ROM ets_putc which is used by ::printf, ets_printf_P in core_esp_postmortem.cpp and others. ets_putc is a wrapper for uart_tx_one_char. uart_tx_one_char uses the element buff_uart_no in UartDev (A structure in data area of the Boot ROM) to select UART0 or UART1. uart_buff_switch is used to set that entry. The structure for UartDev can be found in uart.h from the ESP8266_NONOS_SDK. As best I can tell the Boot ROM always defaults to UART0. * Fixes debug UART selection for ets_putc This addresses an issue of UART selection for ROM function ets_putc, which is used by ::printf, ets_printf_P in core_esp_postmortem.cpp and others. Currently ets_putc stays on UART0 after Serial1.setDebugOutput(true) is called. ets_putc() is not affected by calls to ets_install_putc1. Its UART selection is controlled by the ROM function uart_buff_switch. Updated uart_set_debug() to call uart_buff_switch whenever debug is enabled on an UART. For the case of disabling, a call to select UART0 is made, because there is no disable option for this print method. * Removed fp_putc_t typedef, save for a later PR