forked from Archive/PX4-Autopilot
If serial DMA enabled, re-initialize serial console
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5106 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
parent
e74b6c382c
commit
b53b1fa813
|
@ -1835,8 +1835,15 @@ 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);
|
||||
|
||||
/* 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 */
|
||||
|
||||
strcpy(devname, "/dev/ttySx");
|
||||
|
|
|
@ -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…
Reference in New Issue