summaryrefslogtreecommitdiff
path: root/nuttx/arch/z80
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/arch/z80')
-rw-r--r--nuttx/arch/z80/src/z8/z8_lowuart.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/nuttx/arch/z80/src/z8/z8_lowuart.c b/nuttx/arch/z80/src/z8/z8_lowuart.c
index cf3f9b324..730ed1b4c 100644
--- a/nuttx/arch/z80/src/z8/z8_lowuart.c
+++ b/nuttx/arch/z80/src/z8/z8_lowuart.c
@@ -80,11 +80,10 @@ void up_lowserialinit(void)
uint8_t val;
#ifdef CONFIG_UART0_SERIAL_CONSOLE
+ /* Set the baudrate */
brg = (freq +(uint32_t)CONFIG_UART0_BAUD * 8) /((uint32_t)CONFIG_UART0_BAUD * 16) ;
- /* Set the baudrate */
-
putreg8(brg >> 8, U0BRH);
putreg8(brg & 0xff, U0BRL);
@@ -107,6 +106,8 @@ void up_lowserialinit(void)
#elif defined(EZ8_UART1) && defined(CONFIG_UART1_SERIAL_CONSOLE)
/* Set the baudrate */
+ brg = (freq +(uint32_t)CONFIG_UART1_BAUD * 8) /((uint32_t)CONFIG_UART1_BAUD * 16) ;
+
putreg8(brg >> 8, U1BRH);
putreg8(brg & 0xff, U1BRL);