Fix typo in variable name in serial BREAK logic. Review other serial implementations for similar naming problems.

This commit is contained in:
Gregory Nutt
2016-05-05 11:30:47 -06:00
parent f4ac5f38ce
commit 050f544782
8 changed files with 34 additions and 9 deletions
+2
View File
@@ -268,6 +268,7 @@ static inline void up_waittxready(struct up_dev_s *priv)
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
uint16_t lcr = up_serialin(priv, UART_LCR);
if (enable)
{
lcr |= UART_LCR_BOC;
@@ -276,6 +277,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
lcr &= ~UART_LCR_BOC;
}
up_serialout(priv, UART_LCR, lcr);
}
+2
View File
@@ -272,6 +272,7 @@ static inline void up_waittxready(struct up_dev_s *priv)
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
uint8_t lcr = up_serialin(priv, LPC214X_UART_LCR_OFFSET);
if (enable)
{
lcr |= LPC214X_LCR_BREAK_ENABLE;
@@ -280,6 +281,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
lcr &= ~LPC214X_LCR_BREAK_ENABLE;
}
up_serialout(priv, LPC214X_UART_LCR_OFFSET, lcr);
}
+2
View File
@@ -290,6 +290,7 @@ static inline void up_waittxready(struct up_dev_s *priv)
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
uint8_t lcr = up_serialin(priv, UART_LCR_OFFSET);
if (enable)
{
lcr |= LCR_BREAK_ENABLE;
@@ -298,6 +299,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
lcr &= ~LCR_BREAK_ENABLE;
}
up_serialout(priv, UART_LCR_OFFSET, lcr);
}
+2
View File
@@ -551,6 +551,7 @@ static inline void up_restoreuartint(struct up_dev_s *priv, uint32_t ier)
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
uint32_t lcr = up_serialin(priv, LPC43_UART_LCR_OFFSET);
if (enable)
{
lcr |= UART_LCR_BRK;
@@ -559,6 +560,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
{
lcr &= ~UART_LCR_BRK;
}
up_serialout(priv, LPC43_UART_LCR_OFFSET, lcr);
}
+8 -3
View File
@@ -2060,8 +2060,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
#ifdef CONFIG_USART_BREAKS
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{
irqstate_t flags = enter_critical_section();
uint32_t cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
uint32_t cr2;
irqstate_t flags;
flags = enter_critical_section();
cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 | USART_CR2_LINEN);
leave_critical_section(flags);
}
@@ -2069,9 +2072,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
{
uint32_t cr2;
irqstate_t flags;
flags = enter_critical_section();
uint32_t cr1 = up_serialin(priv, STM32_USART_CR2_OFFSET);
cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 & ~USART_CR2_LINEN);
leave_critical_section(flags);
}
+8 -3
View File
@@ -1967,8 +1967,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
#ifdef CONFIG_USART_BREAKS
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{
irqstate_t flags = enter_critical_section();
uint32_t cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
uint32_t cr2;
irqstate_t flags;
flags = enter_critical_section();
cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 | USART_CR2_LINEN);
leave_critical_section(flags);
}
@@ -1976,9 +1979,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
{
uint32_t cr2;
irqstate_t flags;
flags = enter_critical_section();
uint32_t cr1 = up_serialin(priv, STM32_USART_CR2_OFFSET);
cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 & ~USART_CR2_LINEN);
leave_critical_section(flags);
}
+8 -3
View File
@@ -1723,8 +1723,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
#ifdef CONFIG_USART_BREAKS
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
{
irqstate_t flags = enter_critical_section();
uint32_t cr2 = up_serialin(priv, STM32L4_USART_CR2_OFFSET);
uint32_t cr2;
irqstate_t flags;
flags = enter_critical_section();
cr2 = up_serialin(priv, STM32L4_USART_CR2_OFFSET);
up_serialout(priv, STM32L4_USART_CR2_OFFSET, cr2 | USART_CR2_LINEN);
leave_critical_section(flags);
}
@@ -1732,9 +1735,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
{
uint32_t cr2;
irqstate_t flags;
flags = enter_critical_section();
uint32_t cr1 = up_serialin(priv, STM32L4_USART_CR2_OFFSET);
cr2 = up_serialin(priv, STM32L4_USART_CR2_OFFSET);
up_serialout(priv, STM32L4_USART_CR2_OFFSET, cr2 & ~USART_CR2_LINEN);
leave_critical_section(flags);
}
+2
View File
@@ -520,6 +520,7 @@ static inline void u16550_restoreuartint(FAR struct u16550_s *priv, uint32_t ier
static inline void u16550_enablebreaks(FAR struct u16550_s *priv, bool enable)
{
uint32_t lcr = u16550_serialin(priv, UART_LCR_OFFSET);
if (enable)
{
lcr |= UART_LCR_BRK;
@@ -528,6 +529,7 @@ static inline void u16550_enablebreaks(FAR struct u16550_s *priv, bool enable)
{
lcr &= ~UART_LCR_BRK;
}
u16550_serialout(priv, UART_LCR_OFFSET, lcr);
}