arch/renesas/src/sh1/sh1_serial.c: Appease nxstyle
This commit is contained in:
parent
63320733cc
commit
3b58809f9b
@ -274,7 +274,8 @@ static inline uint8_t up_serialin(struct up_dev_s *priv, int offset)
|
|||||||
* Name: up_serialout
|
* Name: up_serialout
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static inline void up_serialout(struct up_dev_s *priv, int offset, uint8_t value)
|
static inline void up_serialout(struct up_dev_s *priv, int offset,
|
||||||
|
uint8_t value)
|
||||||
{
|
{
|
||||||
putreg8(value, priv->scibase + offset);
|
putreg8(value, priv->scibase + offset);
|
||||||
}
|
}
|
||||||
@ -333,6 +334,7 @@ static inline void up_waittxready(struct up_dev_s *priv)
|
|||||||
if ((up_serialin(priv, SH1_SCI_SSR_OFFSET) & SH1_SCISSR_TDRE) != 0)
|
if ((up_serialin(priv, SH1_SCI_SSR_OFFSET) & SH1_SCISSR_TDRE) != 0)
|
||||||
{
|
{
|
||||||
/* The TDR is empty... return */
|
/* The TDR is empty... return */
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -470,9 +472,10 @@ static void up_shutdown(struct uart_dev_s *dev)
|
|||||||
* the setup() method is called, however, the serial console may operate in
|
* the setup() method is called, however, the serial console may operate in
|
||||||
* a non-interrupt driven mode during the boot phase.
|
* a non-interrupt driven mode during the boot phase.
|
||||||
*
|
*
|
||||||
* RX and TX interrupts are not enabled when by the attach method (unless the
|
* RX and TX interrupts are not enabled when by the attach method (unless
|
||||||
* hardware supports multiple levels of interrupt enabling). The RX and TX
|
* the hardware supports multiple levels of interrupt enabling). The RX
|
||||||
* interrupts are not enabled until the txint() and rxint() methods are called.
|
* and TX interrupts are not enabled until the txint() and rxint() methods
|
||||||
|
* are called.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -486,14 +489,17 @@ static int up_attach(struct uart_dev_s *dev)
|
|||||||
ret = irq_attach(priv->irq + SH1_RXI_IRQ_OFFSET, up_interrupt, dev);
|
ret = irq_attach(priv->irq + SH1_RXI_IRQ_OFFSET, up_interrupt, dev);
|
||||||
if (ret == OK)
|
if (ret == OK)
|
||||||
{
|
{
|
||||||
/* The RIE interrupt enable also enables the receive error interrupt (ERI) */
|
/* The RIE interrupt enable also enables the receive error interrupt
|
||||||
|
* (ERI)
|
||||||
|
*/
|
||||||
|
|
||||||
ret = irq_attach(priv->irq + SH1_ERI_IRQ_OFFSET, up_interrupt, dev);
|
ret = irq_attach(priv->irq + SH1_ERI_IRQ_OFFSET, up_interrupt, dev);
|
||||||
if (ret == OK)
|
if (ret == OK)
|
||||||
{
|
{
|
||||||
/* Attach the TDR empty IRQ (TXI) enabled by the TIE SCR bit */
|
/* Attach the TDR empty IRQ (TXI) enabled by the TIE SCR bit */
|
||||||
|
|
||||||
ret = irq_attach(priv->irq + SH1_TXI_IRQ_OFFSET, up_interrupt, dev);
|
ret = irq_attach(priv->irq + SH1_TXI_IRQ_OFFSET, up_interrupt,
|
||||||
|
dev);
|
||||||
if (ret == OK)
|
if (ret == OK)
|
||||||
{
|
{
|
||||||
#ifdef CONFIG_ARCH_IRQPRIO
|
#ifdef CONFIG_ARCH_IRQPRIO
|
||||||
@ -524,8 +530,8 @@ static int up_attach(struct uart_dev_s *dev)
|
|||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Detach SCI interrupts. This method is called when the serial port is
|
* Detach SCI interrupts. This method is called when the serial port is
|
||||||
* closed normally just before the shutdown method is called. The exception is
|
* closed normally just before the shutdown method is called.
|
||||||
* the serial console which is never shutdown.
|
* The exception is the serial console which is never shutdown.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -594,17 +600,21 @@ static int up_interrupt(int irq, void *context, FAR void *arg)
|
|||||||
uart_recvchars(dev);
|
uart_recvchars(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clear all read related events (probably already done in up_receive)) */
|
/* Clear all read related events (probably already done in
|
||||||
|
* up_receive))
|
||||||
|
*/
|
||||||
|
|
||||||
priv->ssr &= ~(SH1_SCISSR_RDRF|SH1_SCISSR_ORER|SH1_SCISSR_FER|SH1_SCISSR_PER);
|
priv->ssr &= ~(SH1_SCISSR_RDRF | SH1_SCISSR_ORER | SH1_SCISSR_FER |
|
||||||
|
SH1_SCISSR_PER);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Handle outgoing, transmit bytes (TDRE: Transmit Data Register Empty)
|
/* Handle outgoing, transmit bytes (TDRE: Transmit Data Register Empty)
|
||||||
* when TIE is enabled. TIE is only enabled when the driver is waiting with
|
* when TIE is enabled. TIE is only enabled when the driver is waiting
|
||||||
* buffered data. Since TDRE is usually true,
|
* with buffered data. Since TDRE is usually true,
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ((priv->ssr & SH1_SCISSR_TDRE) != 0 && (priv->scr & SH1_SCISCR_TIE) != 0)
|
if ((priv->ssr & SH1_SCISSR_TDRE) != 0 &&
|
||||||
|
(priv->scr & SH1_SCISCR_TIE) != 0)
|
||||||
{
|
{
|
||||||
/* Tx data register empty ... process outgoing bytes */
|
/* Tx data register empty ... process outgoing bytes */
|
||||||
|
|
||||||
@ -647,12 +657,13 @@ static int up_receive(struct uart_dev_s *dev, unsigned int *status)
|
|||||||
|
|
||||||
rdr = up_serialin(priv, SH1_SCI_RDR_OFFSET);
|
rdr = up_serialin(priv, SH1_SCI_RDR_OFFSET);
|
||||||
|
|
||||||
/* Clear all read related status in real ssr (so that when when rxavailable
|
/* Clear all read related status in real ssr (so that when when
|
||||||
* is called again, it will return false.
|
* rxavailable is called again, it will return false.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ssr = up_serialin(priv, SH1_SCI_SSR_OFFSET);
|
ssr = up_serialin(priv, SH1_SCI_SSR_OFFSET);
|
||||||
ssr &= ~(SH1_SCISSR_RDRF|SH1_SCISSR_ORER|SH1_SCISSR_FER|SH1_SCISSR_PER);
|
ssr &= ~(SH1_SCISSR_RDRF | SH1_SCISSR_ORER | SH1_SCISSR_FER |
|
||||||
|
SH1_SCISSR_PER);
|
||||||
up_serialout(priv, SH1_SCI_SSR_OFFSET, ssr);
|
up_serialout(priv, SH1_SCI_SSR_OFFSET, ssr);
|
||||||
|
|
||||||
/* For status, return the SSR at the time that the interrupt was received */
|
/* For status, return the SSR at the time that the interrupt was received */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user