From bd90f2ddfcb38af03ff369eccce76178ef42e0d0 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 27 Dec 2014 18:58:18 -0600 Subject: STM32 Serial: PX4 HW workarround for flaky STM32 RTS. From David Sidrane --- nuttx/include/nuttx/serial/serial.h | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'nuttx/include') diff --git a/nuttx/include/nuttx/serial/serial.h b/nuttx/include/nuttx/serial/serial.h index 34eb1cc6d..710345511 100644 --- a/nuttx/include/nuttx/serial/serial.h +++ b/nuttx/include/nuttx/serial/serial.h @@ -1,7 +1,7 @@ /************************************************************************************ * include/nuttx/serial/serial.h * - * Copyright (C) 2007-2008, 2012-2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2008, 2012-2014 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -53,7 +53,7 @@ #include /************************************************************************************ - * Definitions + * Pre-processor Definitions ************************************************************************************/ /* Maximum number of threads than can be waiting for POLL events */ @@ -62,6 +62,32 @@ # define CONFIG_SERIAL_NPOLLWAITERS 2 #endif +/* RX flow control */ + +#ifndef CONFIG_SERIAL_IFLOWCONTROL +# undef CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS +#endif + +#ifndef CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS +# undef CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK +# undef CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK +#endif + +#ifdef CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS +# ifndef CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK +# define CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK 10 +# endif + +# ifndef CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK +# define CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK 90 +# endif + +# if CONFIG_SERIAL_IFLOWCONTROL_LOWER_WATERMARK > \ + CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK +# warning Lower watermark pct exceeds upper watermark pct +# endif +#endif + /* vtable access helpers */ #define uart_setup(dev) dev->ops->setup(dev) -- cgit v1.2.3