mirror of
https://github.com/apache/nuttx.git
synced 2026-10-08 06:45:19 +00:00
If serial DMA enabled, re-initialize serial console
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5106 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
d4ed23bdb5
commit
66c101bf6d
2 changed files with 25 additions and 1 deletions
|
|
@ -1835,7 +1835,14 @@ void up_serialinit(void)
|
|||
#if CONSOLE_UART > 0
|
||||
(void)uart_register("/dev/console", &uart_devs[CONSOLE_UART - 1]->dev);
|
||||
(void)uart_register("/dev/ttyS0", &uart_devs[CONSOLE_UART - 1]->dev);
|
||||
#endif
|
||||
|
||||
/* If we need to re-initialise the console to enable DMA do that here. */
|
||||
|
||||
# ifdef SERIAL_HAVE_CONSOLE_DMA
|
||||
up_dma_setup(&uart_devs[CONSOLE_UART - 1]->dev);
|
||||
# endif
|
||||
|
||||
#endif /* CONSOLE_UART > 0 */
|
||||
|
||||
/* Register all remaining USARTs */
|
||||
|
||||
|
|
|
|||
|
|
@ -189,6 +189,23 @@
|
|||
# define SERIAL_HAVE_DMA 1
|
||||
#endif
|
||||
|
||||
/* Is DMA used on the console UART? */
|
||||
|
||||
#undef SERIAL_HAVE_CONSOLE_DMA
|
||||
#if defined(CONFIG_USART1_SERIAL_CONSOLE) && defined(CONFIG_USART1_RXDMA)
|
||||
# define SERIAL_HAVE_CONSOLE_DMA 1
|
||||
#elif defined(CONFIG_USART2_SERIAL_CONSOLE) && defined(CONFIG_USART2_RXDMA)
|
||||
# define SERIAL_HAVE_CONSOLE_DMA 1
|
||||
#elif defined(CONFIG_USART3_SERIAL_CONSOLE) && defined(CONFIG_USART3_RXDMA)
|
||||
# define SERIAL_HAVE_CONSOLE_DMA 1
|
||||
#elif defined(CONFIG_UART4_SERIAL_CONSOLE) && !efined(CONFIG_UART4_RXDMA)
|
||||
# define SERIAL_HAVE_CONSOLE_DMA 1
|
||||
#elif defined(CONFIG_UART5_SERIAL_CONSOLE) && defined(CONFIG_UART5_RXDMA)
|
||||
# define SERIAL_HAVE_CONSOLE_DMA 1
|
||||
#elif defined(CONFIG_USART6_SERIAL_CONSOLE) && !efined(CONFIG_USART6_RXDMA)
|
||||
# define SERIAL_HAVE_CONSOLE_DMA 1
|
||||
#endif
|
||||
|
||||
/* Is DMA used on all (enabled) USARTs */
|
||||
|
||||
#define SERIAL_HAVE_ONLY_DMA 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue