Fix NSH-related compile errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2133 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
8019b3ba13
commit
d43612e7a1
@ -339,6 +339,31 @@ static inline void up_serialout(struct up_dev_s *priv, int offset, uint32 value)
|
|||||||
putreg16(value, priv->usartbase + offset);
|
putreg16(value, priv->usartbase + offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: up_restoreusartint
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
static void up_restoreusartint(struct up_dev_s *priv, uint16 ie)
|
||||||
|
{
|
||||||
|
uint32 cr;
|
||||||
|
|
||||||
|
/* Save the interrupt mask */
|
||||||
|
|
||||||
|
priv->ie = ie;
|
||||||
|
|
||||||
|
/* And restore the interrupt state (see the interrupt enable/usage table above) */
|
||||||
|
|
||||||
|
cr = up_serialin(priv, STM32_USART_CR1_OFFSET);
|
||||||
|
cr &= ~(USART_CR1_RXNEIE|USART_CR1_TXEIE|USART_CR1_PEIE);
|
||||||
|
cr |= (ie & (USART_CR1_RXNEIE|USART_CR1_TXEIE|USART_CR1_PEIE));
|
||||||
|
up_serialout(priv, STM32_USART_CR1_OFFSET, cr);
|
||||||
|
|
||||||
|
cr = up_serialin(priv, STM32_USART_CR3_OFFSET);
|
||||||
|
cr &= ~USART_CR3_EIE;
|
||||||
|
cr |= (ie & USART_CR3_EIE);
|
||||||
|
up_serialout(priv, STM32_USART_CR3_OFFSET, cr);
|
||||||
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_disableusartint
|
* Name: up_disableusartint
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -384,31 +409,6 @@ static inline void up_disableusartint(struct up_dev_s *priv, uint16 *ie)
|
|||||||
up_restoreusartint(priv, 0);
|
up_restoreusartint(priv, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
|
||||||
* Name: up_restoreusartint
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
static inline void up_restoreusartint(struct up_dev_s *priv, uint16 ie)
|
|
||||||
{
|
|
||||||
uint32 cr;
|
|
||||||
|
|
||||||
/* Save the interrupt mask */
|
|
||||||
|
|
||||||
priv->ie = ie;
|
|
||||||
|
|
||||||
/* And restore the interrupt state (see the interrupt enable/usage table above) */
|
|
||||||
|
|
||||||
cr = up_serialin(priv, STM32_USART_CR1_OFFSET);
|
|
||||||
cr &= ~(USART_CR1_RXNEIE|USART_CR1_TXEIE|USART_CR1_PEIE);
|
|
||||||
cr |= (cr1 & (USART_CR1_RXNEIE|USART_CR1_TXEIE|USART_CR1_PEIE));
|
|
||||||
up_serialout((priv, STM32_USART_CR1_OFFSET, cr)
|
|
||||||
|
|
||||||
cr = up_serialin(priv, STM32_USART_CR3_OFFSET);
|
|
||||||
cr &= ~USART_CR3_EIE;
|
|
||||||
cr |= (cr1 & USART_CR3_EIE);
|
|
||||||
up_serialout((priv, STM32_USART_CR3_OFFSET, cr)
|
|
||||||
}
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Name: up_setup
|
* Name: up_setup
|
||||||
*
|
*
|
||||||
@ -544,7 +544,7 @@ static void up_shutdown(struct uart_dev_s *dev)
|
|||||||
/* Disable Rx, Tx, and the UART */
|
/* Disable Rx, Tx, and the UART */
|
||||||
|
|
||||||
regval = up_serialin(priv, STM32_USART_CR1_OFFSET);
|
regval = up_serialin(priv, STM32_USART_CR1_OFFSET);
|
||||||
regval &= ~(USART_CR1_UE|USART_CR1_TE|USART_CR1_RE
|
regval &= ~(USART_CR1_UE|USART_CR1_TE|USART_CR1_RE);
|
||||||
up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
|
up_serialout(priv, STM32_USART_CR1_OFFSET, regval);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -886,7 +886,6 @@ static void up_txint(struct uart_dev_s *dev, boolean enable)
|
|||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s*)dev->priv;
|
||||||
irqstate_t flags;
|
irqstate_t flags;
|
||||||
uint16 ie;
|
|
||||||
|
|
||||||
/* USART transmit interrupts:
|
/* USART transmit interrupts:
|
||||||
*
|
*
|
||||||
@ -987,17 +986,17 @@ void up_serialinit(void)
|
|||||||
/* Register the console */
|
/* Register the console */
|
||||||
|
|
||||||
#ifdef HAVE_CONSOLE
|
#ifdef HAVE_CONSOLE
|
||||||
(void)usart_register("/dev/console", &CONSOLE_DEV);
|
(void)uart_register("/dev/console", &CONSOLE_DEV);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Register all USARTs */
|
/* Register all USARTs */
|
||||||
|
|
||||||
(void)usart_register("/dev/ttyS0", &TTYS0_DEV);
|
(void)uart_register("/dev/ttyS0", &TTYS0_DEV);
|
||||||
#ifdef TTYS1_DEV
|
#ifdef TTYS1_DEV
|
||||||
(void)usart_register("/dev/ttyS1", &TTYS1_DEV);
|
(void)uart_register("/dev/ttyS1", &TTYS1_DEV);
|
||||||
#endif
|
#endif
|
||||||
#ifdef TTYS2_DEV
|
#ifdef TTYS2_DEV
|
||||||
(void)usart_register("/dev/ttyS2", &TTYS2_DEV);
|
(void)uart_register("/dev/ttyS2", &TTYS2_DEV);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user