Skip to content

Commit

Permalink
Merge branch 'feature/add_configurate_console_uart_swap_io_v3.0' into…
Browse files Browse the repository at this point in the history
… 'release/v3.0'

Add configuration for UART swap I/O pins

See merge request sdk/ESP8266_RTOS_SDK!464
  • Loading branch information
donghengqaz committed Sep 7, 2018
2 parents 5557ecf + f2025ab commit 39e5551
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/bootloader_support/src/bootloader_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,16 @@ static void update_flash_config(const esp_image_header_t* pfhdr);

static void uart_console_configure(void)
{
#if CONFIG_CONSOLE_UART_SWAP_IO
while (READ_PERI_REG(UART_STATUS(0)) & (UART_TXFIFO_CNT << UART_TXFIFO_CNT_S));

PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTCK_U, FUNC_UART0_CTS);
PIN_FUNC_SELECT(PERIPHS_IO_MUX_MTDO_U, FUNC_UART0_RTS);

// UART0: TXD <-> RTS and RXD <-> CTS
SET_PERI_REG_MASK(UART_SWAP_REG, 0x4);
#endif

#if CONFIG_CONSOLE_UART_NUM == 1
PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO2_U, FUNC_U1TXD_BK);

Expand Down
6 changes: 6 additions & 0 deletions components/esp8266/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ config CONSOLE_UART_BAUDRATE
default 74880
range 1200 4000000

config CONSOLE_UART_SWAP_IO
bool "Swap UART0 I/O pins"
default n
help
Enable this option, UART0's I/O pins are swaped: TXD <-> RTS, RTX <-> CTS.

endmenu

menu WIFI
Expand Down

0 comments on commit 39e5551

Please sign in to comment.