mirror of
https://github.com/apache/nuttx.git
synced 2026-09-28 03:09:13 +08:00
Run tools/nxstyle against some files.
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* arch/sim/src/sim/up_head.c
|
* arch/sim/src/sim/up_head.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011-2013, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011-2013, 2016 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
|||||||
@@ -117,10 +117,10 @@ void pm_activity(int domain, int priority)
|
|||||||
|
|
||||||
/* Check the elapsed time. In periods of low activity, time slicing is
|
/* Check the elapsed time. In periods of low activity, time slicing is
|
||||||
* controlled by IDLE loop polling; in periods of higher activity, time
|
* controlled by IDLE loop polling; in periods of higher activity, time
|
||||||
* slicing is controlled by driver activity. In either case, the duration
|
* slicing is controlled by driver activity. In either case, the
|
||||||
* of the time slice is only approximate; during times of heavy activity,
|
* duration of the time slice is only approximate; during times of
|
||||||
* time slices may be become longer and the activity level may be over-
|
* heavy activity, time slices may be become longer and the activity
|
||||||
* estimated.
|
* level may be over-estimated.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
now = clock_systimer();
|
now = clock_systimer();
|
||||||
|
|||||||
+34
-30
@@ -1,7 +1,8 @@
|
|||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* drivers/serial/serial_io.c
|
* drivers/serial/serial_io.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2009, 2011, 2015, 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2007-2009, 2011, 2015, 2018 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@@ -31,11 +32,11 @@
|
|||||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Included Files
|
* Included Files
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
@@ -51,20 +52,21 @@
|
|||||||
|
|
||||||
#include <nuttx/serial/serial.h>
|
#include <nuttx/serial/serial.h>
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Functions
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: uart_xmitchars
|
* Name: uart_xmitchars
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called from the UART interrupt handler when an interrupt
|
* This function is called from the UART interrupt handler when an
|
||||||
* is received indicating that there is more space in the transmit FIFO. This
|
* interrupt is received indicating that there is more space in the
|
||||||
* function will send characters from the tail of the xmit buffer while the driver
|
* transmit FIFO. This function will send characters from the tail of
|
||||||
* write() logic adds data to the head of the xmit buffer.
|
* the xmit buffer while the driver write() logic adds data to the head
|
||||||
|
* of the xmit buffer.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uart_xmitchars(FAR uart_dev_t *dev)
|
void uart_xmitchars(FAR uart_dev_t *dev)
|
||||||
{
|
{
|
||||||
@@ -105,8 +107,8 @@ void uart_xmitchars(FAR uart_dev_t *dev)
|
|||||||
uart_disabletxint(dev);
|
uart_disabletxint(dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If any bytes were removed from the buffer, inform any waiters there there is
|
/* If any bytes were removed from the buffer, inform any waiters that
|
||||||
* space available.
|
* there is space available.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (nbytes)
|
if (nbytes)
|
||||||
@@ -119,16 +121,16 @@ void uart_xmitchars(FAR uart_dev_t *dev)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/************************************************************************************
|
/****************************************************************************
|
||||||
* Name: uart_receivechars
|
* Name: uart_receivechars
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* This function is called from the UART interrupt handler when an interrupt
|
* This function is called from the UART interrupt handler when an
|
||||||
* is received indicating that are bytes available in the receive fifo. This
|
* interrupt is received indicating that are bytes available in the
|
||||||
* function will add chars to head of receive buffer. Driver read() logic will
|
* receive fifo. This function will add chars to head of receive buffer.
|
||||||
* take characters from the tail of the buffer.
|
* Driver read() logic will take characters from the tail of the buffer.
|
||||||
*
|
*
|
||||||
************************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
void uart_recvchars(FAR uart_dev_t *dev)
|
void uart_recvchars(FAR uart_dev_t *dev)
|
||||||
{
|
{
|
||||||
@@ -151,11 +153,12 @@ void uart_recvchars(FAR uart_dev_t *dev)
|
|||||||
#ifdef CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS
|
#ifdef CONFIG_SERIAL_IFLOWCONTROL_WATERMARKS
|
||||||
/* Pre-calculate the watermark level that we will need to test against. */
|
/* Pre-calculate 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
|
#endif
|
||||||
|
|
||||||
/* Loop putting characters into the receive buffer until there are no further
|
/* Loop putting characters into the receive buffer until there are no
|
||||||
* characters to available.
|
* further characters to available.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
while (uart_rxavailable(dev))
|
while (uart_rxavailable(dev))
|
||||||
@@ -248,12 +251,13 @@ void uart_recvchars(FAR uart_dev_t *dev)
|
|||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* If the RX buffer becomes full, then the serial data is discarded. This is
|
/* If the RX buffer becomes full, then the serial data is discarded.
|
||||||
* necessary because on most serial hardware, you must read the data in order
|
* This is necessary because on most serial hardware, you must read
|
||||||
* to clear the RX interrupt. An option on some hardware might be to simply
|
* the data in order to clear the RX interrupt. An option on some
|
||||||
* disable RX interrupts until the RX buffer becomes non-FULL. However, that
|
* hardware might be to simply disable RX interrupts until the RX
|
||||||
* would probably just cause the overrun to occur in hardware (unless it has
|
* buffer becomes non-FULL. However, that would probably just cause
|
||||||
* some large internal buffering).
|
* the overrun to occur in hardware (unless it has some large internal
|
||||||
|
* buffering).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (!is_full)
|
if (!is_full)
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Definition of terms. Various "sleep" and low power consumption states
|
/* Definition of terms. Various "sleep" and low power consumption states
|
||||||
* have various names and are sometimes used in conflicting ways. In the
|
* have various names and are sometimes used in conflicting ways. In the
|
||||||
* PM logic, we will use the following terminology:
|
* PM logic, we will use the following terminology:
|
||||||
@@ -77,7 +78,9 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Configuration ************************************************************/
|
/* Configuration ************************************************************/
|
||||||
|
|
||||||
/* CONFIG_PM_NDOMAINS. Defines the number of "domains" that activity may be
|
/* CONFIG_PM_NDOMAINS. Defines the number of "domains" that activity may be
|
||||||
* monitored on. For example, you may want to separately manage the power
|
* monitored on. For example, you may want to separately manage the power
|
||||||
* from the Network domain, shutting down the network when it is not be used,
|
* from the Network domain, shutting down the network when it is not be used,
|
||||||
@@ -238,7 +241,8 @@ enum pm_state_e
|
|||||||
{
|
{
|
||||||
PM_RESTORE = -1, /* PM_RESTORE is not a low power state.
|
PM_RESTORE = -1, /* PM_RESTORE is not a low power state.
|
||||||
*
|
*
|
||||||
* PM_RESTORE is used to notify for restore from low power state.
|
* PM_RESTORE is used to notify for restore from low power
|
||||||
|
* state.
|
||||||
*/
|
*/
|
||||||
PM_NORMAL = 0, /* Normal full power operating mode. If the driver is in
|
PM_NORMAL = 0, /* Normal full power operating mode. If the driver is in
|
||||||
* a reduced power usage mode, it should immediately re-
|
* a reduced power usage mode, it should immediately re-
|
||||||
@@ -248,9 +252,9 @@ enum pm_state_e
|
|||||||
*/
|
*/
|
||||||
PM_IDLE, /* Drivers will receive this state change if it is
|
PM_IDLE, /* Drivers will receive this state change if it is
|
||||||
* appropriate to enter a simple IDLE power state. This
|
* appropriate to enter a simple IDLE power state. This
|
||||||
* would include simple things such as reducing display back-
|
* would include simple things such as reducing display
|
||||||
* lighting. The driver should be ready to resume normal
|
* back-lighting. The driver should be ready to resume
|
||||||
* activity instantly.
|
* normal activity instantly.
|
||||||
*
|
*
|
||||||
* PM_IDLE may be followed by PM_STANDBY or PM_NORMAL.
|
* PM_IDLE may be followed by PM_STANDBY or PM_NORMAL.
|
||||||
*/
|
*/
|
||||||
@@ -263,11 +267,11 @@ enum pm_state_e
|
|||||||
*
|
*
|
||||||
* PM_STANDBY may be followed PM_SLEEP or by PM_NORMAL
|
* PM_STANDBY may be followed PM_SLEEP or by PM_NORMAL
|
||||||
*/
|
*/
|
||||||
PM_SLEEP, /* The system is entering deep sleep mode. The most drastic
|
PM_SLEEP, /* The system is entering deep sleep mode. The most
|
||||||
* power reduction measures possible should be taken in this
|
* drastic power reduction measures possible should be
|
||||||
* state. It may require some time to get back to normal
|
* taken in this state. It may require some time to get
|
||||||
* operation from SLEEP (some MCUs may even require going
|
* back to normal operation from SLEEP (some MCUs may
|
||||||
* through reset).
|
* even require going through reset).
|
||||||
*
|
*
|
||||||
* PM_SLEEP may be following by PM_NORMAL
|
* PM_SLEEP may be following by PM_NORMAL
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -398,8 +398,8 @@ struct boardioc_nxterm_create_s
|
|||||||
|
|
||||||
struct boardioc_nxterm_ioctl_s
|
struct boardioc_nxterm_ioctl_s
|
||||||
{
|
{
|
||||||
int cmd; /* IOCTL command */
|
int cmd; /* IOCTL command */
|
||||||
uintptr_t arg; /* IOCTL argument */
|
uintptr_t arg; /* IOCTL argument */
|
||||||
};
|
};
|
||||||
#endif /* CONFIG_NXTERM */
|
#endif /* CONFIG_NXTERM */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user