From 6cbe716db09aa8b8cb3dea741984cec80f3f0583 Mon Sep 17 00:00:00 2001 From: devsaurus Date: Mon, 14 Dec 2015 20:17:04 +0100 Subject: [PATCH] uart: fix parity and stopbit generation --- app/driver/uart.c | 8 ++--- app/include/driver/uart.h | 14 ++++----- app/include/driver/uart_register.h | 50 ++++++++++++++++++------------ app/modules/uart.c | 14 ++++++--- app/platform/platform.c | 7 +++-- app/platform/platform.h | 16 +++++----- 6 files changed, 64 insertions(+), 45 deletions(-) diff --git a/app/driver/uart.c b/app/driver/uart.c index 0785dff6..0b216ef2 100755 --- a/app/driver/uart.c +++ b/app/driver/uart.c @@ -60,10 +60,10 @@ uart_config(uint8 uart_no) uart_div_modify(uart_no, UART_CLK_FREQ / (UartDev.baut_rate)); - WRITE_PERI_REG(UART_CONF0(uart_no), UartDev.exist_parity - | UartDev.parity - | (UartDev.stop_bits << UART_STOP_BIT_NUM_S) - | (UartDev.data_bits << UART_BIT_NUM_S)); + WRITE_PERI_REG(UART_CONF0(uart_no), ((UartDev.exist_parity & UART_PARITY_EN_M) << UART_PARITY_EN_S) //SET BIT AND PARITY MODE + | ((UartDev.parity & UART_PARITY_M) <