arch/risc-v/src/mpfs/mpfs_serial.c: Allow switching uart output to console off
By setting "isconsole" to false, mpfs_serial stops outputting to console. This can be used to disable output to debug console in low level. Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
parent
a28f6716d5
commit
888dc229fa
|
@ -1027,6 +1027,13 @@ static void up_send(struct uart_dev_s *dev, int ch)
|
||||||
{
|
{
|
||||||
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
struct up_dev_s *priv = (struct up_dev_s *)dev->priv;
|
||||||
|
|
||||||
|
#ifdef HAVE_SERIAL_CONSOLE
|
||||||
|
if (dev == &CONSOLE_DEV && !dev->isconsole)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
while ((up_serialin(priv, MPFS_UART_LSR_OFFSET)
|
while ((up_serialin(priv, MPFS_UART_LSR_OFFSET)
|
||||||
& UART_LSR_THRE) == 0);
|
& UART_LSR_THRE) == 0);
|
||||||
|
|
||||||
|
@ -1198,6 +1205,12 @@ int up_putc(int ch)
|
||||||
#ifdef HAVE_SERIAL_CONSOLE
|
#ifdef HAVE_SERIAL_CONSOLE
|
||||||
struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv;
|
struct up_dev_s *priv = (struct up_dev_s *)CONSOLE_DEV.priv;
|
||||||
uint32_t ier;
|
uint32_t ier;
|
||||||
|
|
||||||
|
if (!CONSOLE_DEV.isconsole)
|
||||||
|
{
|
||||||
|
return ch;
|
||||||
|
}
|
||||||
|
|
||||||
up_disableuartint(priv, &ier);
|
up_disableuartint(priv, &ier);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue