Fix typo in variable name in serial BREAK logic. Review other serial implementations for similar naming problems.
This commit is contained in:
parent
f4ac5f38ce
commit
050f544782
@ -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)
|
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
|
||||||
{
|
{
|
||||||
uint16_t lcr = up_serialin(priv, UART_LCR);
|
uint16_t lcr = up_serialin(priv, UART_LCR);
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
lcr |= UART_LCR_BOC;
|
lcr |= UART_LCR_BOC;
|
||||||
@ -276,6 +277,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
|
|||||||
{
|
{
|
||||||
lcr &= ~UART_LCR_BOC;
|
lcr &= ~UART_LCR_BOC;
|
||||||
}
|
}
|
||||||
|
|
||||||
up_serialout(priv, UART_LCR, lcr);
|
up_serialout(priv, UART_LCR, lcr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
|
||||||
{
|
{
|
||||||
uint8_t lcr = up_serialin(priv, LPC214X_UART_LCR_OFFSET);
|
uint8_t lcr = up_serialin(priv, LPC214X_UART_LCR_OFFSET);
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
lcr |= LPC214X_LCR_BREAK_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;
|
lcr &= ~LPC214X_LCR_BREAK_ENABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
up_serialout(priv, LPC214X_UART_LCR_OFFSET, lcr);
|
up_serialout(priv, LPC214X_UART_LCR_OFFSET, lcr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
|
||||||
{
|
{
|
||||||
uint8_t lcr = up_serialin(priv, UART_LCR_OFFSET);
|
uint8_t lcr = up_serialin(priv, UART_LCR_OFFSET);
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
lcr |= LCR_BREAK_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;
|
lcr &= ~LCR_BREAK_ENABLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
up_serialout(priv, UART_LCR_OFFSET, lcr);
|
up_serialout(priv, UART_LCR_OFFSET, lcr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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)
|
static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
|
||||||
{
|
{
|
||||||
uint32_t lcr = up_serialin(priv, LPC43_UART_LCR_OFFSET);
|
uint32_t lcr = up_serialin(priv, LPC43_UART_LCR_OFFSET);
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
lcr |= UART_LCR_BRK;
|
lcr |= UART_LCR_BRK;
|
||||||
@ -559,6 +560,7 @@ static inline void up_enablebreaks(struct up_dev_s *priv, bool enable)
|
|||||||
{
|
{
|
||||||
lcr &= ~UART_LCR_BRK;
|
lcr &= ~UART_LCR_BRK;
|
||||||
}
|
}
|
||||||
|
|
||||||
up_serialout(priv, LPC43_UART_LCR_OFFSET, lcr);
|
up_serialout(priv, LPC43_UART_LCR_OFFSET, lcr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2060,8 +2060,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
#ifdef CONFIG_USART_BREAKS
|
#ifdef CONFIG_USART_BREAKS
|
||||||
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
|
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
|
||||||
{
|
{
|
||||||
irqstate_t flags = enter_critical_section();
|
uint32_t cr2;
|
||||||
uint32_t cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
|
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);
|
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 | USART_CR2_LINEN);
|
||||||
leave_critical_section(flags);
|
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 */
|
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
|
||||||
{
|
{
|
||||||
|
uint32_t cr2;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
flags = enter_critical_section();
|
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);
|
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 & ~USART_CR2_LINEN);
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
|
@ -1967,8 +1967,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
#ifdef CONFIG_USART_BREAKS
|
#ifdef CONFIG_USART_BREAKS
|
||||||
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
|
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
|
||||||
{
|
{
|
||||||
irqstate_t flags = enter_critical_section();
|
uint32_t cr2;
|
||||||
uint32_t cr2 = up_serialin(priv, STM32_USART_CR2_OFFSET);
|
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);
|
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 | USART_CR2_LINEN);
|
||||||
leave_critical_section(flags);
|
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 */
|
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
|
||||||
{
|
{
|
||||||
|
uint32_t cr2;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
flags = enter_critical_section();
|
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);
|
up_serialout(priv, STM32_USART_CR2_OFFSET, cr2 & ~USART_CR2_LINEN);
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
|
@ -1723,8 +1723,11 @@ static int up_ioctl(struct file *filep, int cmd, unsigned long arg)
|
|||||||
#ifdef CONFIG_USART_BREAKS
|
#ifdef CONFIG_USART_BREAKS
|
||||||
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
|
case TIOCSBRK: /* BSD compatibility: Turn break on, unconditionally */
|
||||||
{
|
{
|
||||||
irqstate_t flags = enter_critical_section();
|
uint32_t cr2;
|
||||||
uint32_t cr2 = up_serialin(priv, STM32L4_USART_CR2_OFFSET);
|
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);
|
up_serialout(priv, STM32L4_USART_CR2_OFFSET, cr2 | USART_CR2_LINEN);
|
||||||
leave_critical_section(flags);
|
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 */
|
case TIOCCBRK: /* BSD compatibility: Turn break off, unconditionally */
|
||||||
{
|
{
|
||||||
|
uint32_t cr2;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
|
|
||||||
flags = enter_critical_section();
|
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);
|
up_serialout(priv, STM32L4_USART_CR2_OFFSET, cr2 & ~USART_CR2_LINEN);
|
||||||
leave_critical_section(flags);
|
leave_critical_section(flags);
|
||||||
}
|
}
|
||||||
|
@ -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)
|
static inline void u16550_enablebreaks(FAR struct u16550_s *priv, bool enable)
|
||||||
{
|
{
|
||||||
uint32_t lcr = u16550_serialin(priv, UART_LCR_OFFSET);
|
uint32_t lcr = u16550_serialin(priv, UART_LCR_OFFSET);
|
||||||
|
|
||||||
if (enable)
|
if (enable)
|
||||||
{
|
{
|
||||||
lcr |= UART_LCR_BRK;
|
lcr |= UART_LCR_BRK;
|
||||||
@ -528,6 +529,7 @@ static inline void u16550_enablebreaks(FAR struct u16550_s *priv, bool enable)
|
|||||||
{
|
{
|
||||||
lcr &= ~UART_LCR_BRK;
|
lcr &= ~UART_LCR_BRK;
|
||||||
}
|
}
|
||||||
|
|
||||||
u16550_serialout(priv, UART_LCR_OFFSET, lcr);
|
u16550_serialout(priv, UART_LCR_OFFSET, lcr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user