From e5b10e808bea418852d070aec0b54bc60ac98379 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Mon, 19 Dec 2016 12:44:36 -1000 Subject: [PATCH] Pickup 2 Upstream NuttX PX4 contributions 1) Ensure if CONFIG_SERIAL_DMA is set that cdcacm uart_ops is initalized with correct functions in correct slots. This was detected only with PX4 build flags 2) C&P error from F7 would prevent CONFIG_STM32_SERIALBRK_BSDCOMPAT ifdefed code from being included. --- nuttx-patches/wip_inflight_to_upstream.patch | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/nuttx-patches/wip_inflight_to_upstream.patch b/nuttx-patches/wip_inflight_to_upstream.patch index e69de29bb2..f02e65b8c0 100644 --- a/nuttx-patches/wip_inflight_to_upstream.patch +++ b/nuttx-patches/wip_inflight_to_upstream.patch @@ -0,0 +1,35 @@ +diff --git NuttX/nuttx/drivers/usbdev/cdcacm.c NuttX/nuttx/drivers/usbdev/cdcacm.c +index 64e2e68..15f92dd 100644 +--- NuttX/nuttx/drivers/usbdev/cdcacm.c ++++ NuttX/nuttx/drivers/usbdev/cdcacm.c +@@ -243,6 +243,12 @@ static const struct uart_ops_s g_uartops = + #ifdef CONFIG_SERIAL_IFLOWCONTROL + cdcuart_rxflowcontrol, /* rxflowcontrol */ + #endif ++#ifdef CONFIG_SERIAL_DMA ++ NULL, /* dmasend */ ++ NULL, /* dmareceive */ ++ NULL, /* dmarxfree */ ++ NULL, /* dmatxavail */ ++#endif + NULL, /* send */ + cdcuart_txint, /* txinit */ + NULL, /* txready */ +diff --git NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c +index 644c810..10919e8 100644 +--- NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c ++++ NuttX/nuttx/arch/arm/src/stm32/stm32_serial.c +@@ -1945,11 +1945,11 @@ static int up_interrupt_common(struct up_dev_s *priv) + static int up_ioctl(struct file *filep, int cmd, unsigned long arg) + { + #if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_SERIAL_TIOCSERGSTRUCT) \ +- || defined(CONFIG_STM32F7_SERIALBRK_BSDCOMPAT) ++ || defined(CONFIG_STM32_SERIALBRK_BSDCOMPAT) + struct inode *inode = filep->f_inode; + struct uart_dev_s *dev = inode->i_private; + #endif +-#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_STM32F7_SERIALBRK_BSDCOMPAT) ++#if defined(CONFIG_SERIAL_TERMIOS) || defined(CONFIG_STM32_SERIALBRK_BSDCOMPAT) + struct up_dev_s *priv = (struct up_dev_s *)dev->priv; + #endif + int ret = OK;