drivers/serial/serial_io.c and serial_dma.c: Fix some long lines.

This commit is contained in:
Gregory Nutt 2019-11-06 07:06:36 -06:00
parent 8fb19a4359
commit c8831ac3c8
2 changed files with 45 additions and 39 deletions

View File

@ -1,4 +1,4 @@
/************************************************************************************
/****************************************************************************
* drivers/serial/serial_dma.c
*
* Copyright (C) 2015, 2018 Gregory Nutt. All rights reserved.
@ -31,11 +31,11 @@
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Included Files
************************************************************************************/
****************************************************************************/
#include <nuttx/config.h>
@ -48,25 +48,27 @@
#if defined(CONFIG_SERIAL_TXDMA) || defined(CONFIG_SERIAL_RXDMA)
/************************************************************************************
/****************************************************************************
* Private Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: uart_check_signo
*
* Description:
* Check if the SIGINT or SIGSTP character is in the contiguous Rx DMA buffer
* region. The first signal associated with the first such character is returned.
* Check if the SIGINT or SIGSTP character is in the contiguous Rx DMA
* buffer region. The first signal associated with the first such
* character is returned.
*
* If there multiple such characters in the buffer, only the signal associated
* with the first is returned (this a bug!)
* If there multiple such characters in the buffer, only the signal
* associated with the first is returned (this a bug!)
*
* Returned Value:
* 0 if a signal-related character does not appear in the. Otherwise, SIGKILL or
* SIGSTP may be returned to indicate the appropriate signal action.
* 0 if a signal-related character does not appear in the. Otherwise,
* SIGKILL or SIGSTP may be returned to indicate the appropriate signal
* action.
*
************************************************************************************/
****************************************************************************/
#if defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP)
static int uart_check_signo(const char *buf, size_t size)
@ -94,16 +96,17 @@ static int uart_check_signo(const char *buf, size_t size)
}
#endif
/************************************************************************************
/****************************************************************************
* Name: uart_recvchars_signo
*
* Description:
* Check if the SIGINT character is anywhere in the newly received DMA buffer.
* Check if the SIGINT character is anywhere in the newly received DMA
* buffer.
*
* REVISIT: We must also remove the SIGINT/SIGSTP character from the Rx buffer. It
* should not be read as normal data by the caller.
* REVISIT: We must also remove the SIGINT/SIGSTP character from the Rx
* buffer. It should not be read as normal data by the caller.
*
************************************************************************************/
****************************************************************************/
#if defined(CONFIG_SERIAL_RXDMA) && \
(defined(CONFIG_TTY_SIGINT) || defined(CONFIG_TTY_SIGSTP))
@ -133,17 +136,17 @@ static int uart_recvchars_signo(FAR uart_dev_t *dev)
}
#endif
/************************************************************************************
/****************************************************************************
* Public Functions
************************************************************************************/
****************************************************************************/
/************************************************************************************
/****************************************************************************
* Name: uart_xmitchars_dma
*
* Description:
* Set up to transfer bytes from the TX circular buffer using DMA
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_SERIAL_TXDMA
void uart_xmitchars_dma(FAR uart_dev_t *dev)
@ -176,15 +179,16 @@ void uart_xmitchars_dma(FAR uart_dev_t *dev)
}
#endif
/************************************************************************************
/****************************************************************************
* Name: uart_xmitchars_done
*
* Description:
* Perform operations necessary at the complete of DMA including adjusting the
* TX circular buffer indices and waking up of any threads that may have been
* waiting for space to become available in the TX circular buffer.
* Perform operations necessary at the complete of DMA including adjusting
* the TX circular buffer indices and waking up of any threads that may
* have been waiting for space to become available in the TX circular
* buffer.
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_SERIAL_TXDMA
void uart_xmitchars_done(FAR uart_dev_t *dev)
@ -206,8 +210,8 @@ void uart_xmitchars_done(FAR uart_dev_t *dev)
xfer->length = xfer->nlength = 0;
}
/* If any bytes were removed from the buffer, inform any waiters there there is
* space available.
/* If any bytes were removed from the buffer, inform any waiters there
* there is space available.
*/
if (nbytes)
@ -217,13 +221,13 @@ void uart_xmitchars_done(FAR uart_dev_t *dev)
}
#endif
/************************************************************************************
/****************************************************************************
* Name: uart_recvchars_dma
*
* Description:
* Set up to receive bytes into the RX circular buffer using DMA
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_SERIAL_RXDMA
void uart_recvchars_dma(FAR uart_dev_t *dev)
@ -260,7 +264,8 @@ void uart_recvchars_dma(FAR uart_dev_t *dev)
#ifdef CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS
/* Pre-calcuate the watermark level that we will need to test against. */
watermark = (CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK * rxbuf->size) / 100;
watermark = (CONFIG_SERIAL_IFLOWCONTROL_UPPER_WATERMARK * rxbuf->size) /
100;
#endif
#ifdef CONFIG_SERIAL_IFLOWCONTROL
@ -346,15 +351,16 @@ void uart_recvchars_dma(FAR uart_dev_t *dev)
}
#endif
/************************************************************************************
/****************************************************************************
* Name: uart_recvchars_done
*
* Description:
* Perform operations necessary at the complete of DMA including adjusting the
* RX circular buffer indices and waking up of any threads that may have been
* waiting for new data to become available in the RX circular buffer.
* Perform operations necessary at the complete of DMA including adjusting
* the RX circular buffer indices and waking up of any threads that may
* have been waiting for new data to become available in the RX circular
* buffer.
*
************************************************************************************/
****************************************************************************/
#ifdef CONFIG_SERIAL_RXDMA
void uart_recvchars_done(FAR uart_dev_t *dev)

View File

@ -127,7 +127,7 @@ void uart_xmitchars(FAR uart_dev_t *dev)
* Description:
* This function is called from the UART interrupt handler when an
* interrupt is received indicating that are bytes available in the
* receive fifo. This function will add chars to head of receive buffer.
* receive FIFO. This function will add chars to head of receive buffer.
* Driver read() logic will take characters from the tail of the buffer.
*
****************************************************************************/