1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-27 18:02:17 +03:00

Implement invert for HardwareSerial (#6816)

* Simple i/f to turn on inverted logic on UART0.

* Refactor invert from HardwareSerial to uart

* Final refactoring of invert bits into config bitmap.

* Overload instead of default arg for subclassing.

* Prevent unwanted effects if setting invert on other than UART0 - only that has these flags defined and documented.
This commit is contained in:
Dirk O. Kaar
2019-11-20 17:17:42 +01:00
committed by Earle F. Philhower, III
parent b478429fe4
commit 007e495e0d
5 changed files with 19 additions and 9 deletions

View File

@ -323,10 +323,11 @@ uart_get_bit_length(const int uart_nr)
}
uart_t*
uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size)
uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin, size_t rx_size, bool invert)
{
(void) config;
(void) tx_pin;
(void) invert;
uart_t* uart = (uart_t*) malloc(sizeof(uart_t));
if(uart == NULL)
return NULL;