summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/modpybuart.c
diff options
context:
space:
mode:
authordaniel-k <github@daniel-krebs.net>2016-07-26 17:56:13 +0200
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-27 21:05:45 +0300
commitaa4ada943a1e08e595630875135a2d7816718194 (patch)
tree878141850bcd4badcb2e75a9fd1c50a45ff195d0 /esp8266/modpybuart.c
parent01816068c8254c3440e8e6afac250ae00e332b91 (diff)
downloadmicropython-aa4ada943a1e08e595630875135a2d7816718194.tar.gz
micropython-aa4ada943a1e08e595630875135a2d7816718194.zip
esp8266/modpybuart: Fix UART parity setting.
The configuration bits for the UART register were wrong and the parity couldn't be enabled, because the exist_parity member hasn't been updated. I took this ESP8266 register description (http://esp8266.ru/esp8266-uart-reg/) as reference. Verification has been done with a logic analyzer.
Diffstat (limited to 'esp8266/modpybuart.c')
-rw-r--r--esp8266/modpybuart.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/esp8266/modpybuart.c b/esp8266/modpybuart.c
index f27ee4e2d2..25320fa1e7 100644
--- a/esp8266/modpybuart.c
+++ b/esp8266/modpybuart.c
@@ -112,9 +112,11 @@ STATIC void pyb_uart_init_helper(pyb_uart_obj_t *self, size_t n_args, const mp_o
if (args[ARG_parity].u_obj != MP_OBJ_NULL) {
if (args[ARG_parity].u_obj == mp_const_none) {
UartDev.parity = UART_NONE_BITS;
+ UartDev.exist_parity = UART_STICK_PARITY_DIS;
self->parity = 0;
} else {
mp_int_t parity = mp_obj_get_int(args[ARG_parity].u_obj);
+ UartDev.exist_parity = UART_STICK_PARITY_EN;
if (parity & 1) {
UartDev.parity = UART_ODD_BITS;
self->parity = 1;