summaryrefslogtreecommitdiff
path: root/nuttx/arch/z80
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2013-05-09 14:23:34 -0600
committerGregory Nutt <gnutt@nuttx.org>2013-05-09 14:23:34 -0600
commit17cfb7007f3f4e253d3533ee87349ce1b8e4885e (patch)
treefb175af19fa6835f8929ee075ff16acfeb49f904 /nuttx/arch/z80
parent4495dfb36135744a6f903e32ac2215b1f3ab0452 (diff)
downloadnuttx-17cfb7007f3f4e253d3533ee87349ce1b8e4885e.tar.gz
nuttx-17cfb7007f3f4e253d3533ee87349ce1b8e4885e.tar.bz2
nuttx-17cfb7007f3f4e253d3533ee87349ce1b8e4885e.zip
Various changes and bigfixes for problems detected by CppCheck
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);