Fix nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
a0ce81d659
commit
ae94688dc4
7 changed files with 97 additions and 64 deletions
|
@ -65,12 +65,15 @@
|
|||
/********************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
********************************************************************************************/
|
||||
|
||||
/* Configuration ****************************************************************************/
|
||||
|
||||
/* Reference counting is partially implemented, but not needed in the current design. */
|
||||
|
||||
#undef CONFIG_ADS7843E_REFCNT
|
||||
|
||||
/* ADS7843E Interfaces *********************************************************************/
|
||||
/* ADS7843E Interfaces **********************************************************************/
|
||||
|
||||
/* ADS7843E command bit settings */
|
||||
|
||||
#define ADS7843E_CMD_PD0 (1 << 0) /* Bit 0: Power down mode select bit 0 */
|
||||
|
@ -90,7 +93,8 @@
|
|||
#define ADS7843_CMD_ENABPENIRQ \
|
||||
((1 << ADS7843E_CMD_CHAN_SHIFT)| ADS7843E_CMD_START)
|
||||
|
||||
/* Driver support **************************************************************************/
|
||||
/* Driver support ***************************************************************************/
|
||||
|
||||
/* This format is used to construct the /dev/input[n] device driver path. It
|
||||
* defined here so that it will be used consistently in all places.
|
||||
*/
|
||||
|
@ -165,7 +169,8 @@ struct ads7843e_dev_s
|
|||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
|
|
@ -61,7 +61,7 @@
|
|||
* Pre-processor Definitions
|
||||
********************************************************************************************/
|
||||
|
||||
/* MAX11802 Interfaces *********************************************************************/
|
||||
/* MAX11802 Interfaces **********************************************************************/
|
||||
|
||||
/* LSB of register addresses specifies read (1) or write (0). */
|
||||
|
||||
|
@ -85,7 +85,8 @@
|
|||
#define MAX11802_DELAY 0x55
|
||||
#define MAX11802_PULL 0x33
|
||||
|
||||
/* Driver support **************************************************************************/
|
||||
/* Driver support ***************************************************************************/
|
||||
|
||||
/* This format is used to construct the /dev/input[n] device driver path. It
|
||||
* defined here so that it will be used consistently in all places.
|
||||
*/
|
||||
|
@ -157,7 +158,8 @@ struct max11802_dev_s
|
|||
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C" {
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
* "STMPE811 S-Touch® advanced resistive touchscreen controller with 8-bit
|
||||
* "STMPE811 S-Touch advanced resistive touchscreen controller with 8-bit
|
||||
* GPIO expander," Doc ID 14489 Rev 6, CD00186725, STMicroelectronics"
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
|
@ -57,9 +57,10 @@
|
|||
/********************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
********************************************************************************************/
|
||||
|
||||
/* Configuration ****************************************************************************/
|
||||
/* Reference counting is partially implemented, but not needed in the current design.
|
||||
*/
|
||||
|
||||
/* Reference counting is partially implemented, but not needed in the current design. */
|
||||
|
||||
#undef CONFIG_STMPE811_REFCNT
|
||||
|
||||
|
@ -70,6 +71,7 @@
|
|||
#endif
|
||||
|
||||
/* Driver support ***************************************************************************/
|
||||
|
||||
/* This format is used to construct the /dev/input[n] device driver path. It defined here
|
||||
* so that it will be used consistently in all places.
|
||||
*/
|
||||
|
@ -77,7 +79,7 @@
|
|||
#define DEV_FORMAT "/dev/input%d"
|
||||
#define DEV_NAMELEN 16
|
||||
|
||||
/* STMPE811 Resources ************************************************************************/
|
||||
/* STMPE811 Resources ***********************************************************************/
|
||||
#ifndef CONFIG_STMPE811_TSC_DISABLE
|
||||
# define STMPE811_ADC_NPINS 4 /* Only pins 0-3 can be used for ADC */
|
||||
# define STMPE811_GPIO_NPINS 4 /* Only pins 0-3 can be used as GPIOs */
|
||||
|
@ -100,6 +102,7 @@
|
|||
/********************************************************************************************
|
||||
* Public Types
|
||||
********************************************************************************************/
|
||||
|
||||
/* This describes the state of one contact */
|
||||
|
||||
enum stmpe811_contact_3
|
||||
|
@ -127,41 +130,41 @@ struct stmpe811_sample_s
|
|||
struct stmpe811_dev_s
|
||||
{
|
||||
#ifdef CONFIG_STMPE811_MULTIPLE
|
||||
FAR struct stmpe811_dev_s *flink; /* Supports a singly linked list of drivers */
|
||||
FAR struct stmpe811_dev_s *flink; /* Supports a singly linked list of drivers */
|
||||
#endif
|
||||
|
||||
/* Common fields */
|
||||
|
||||
FAR struct stmpe811_config_s *config; /* Board configuration data */
|
||||
sem_t exclsem; /* Manages exclusive access to this structure */
|
||||
sem_t exclsem; /* Manages exclusive access to this structure */
|
||||
#ifdef CONFIG_STMPE811_SPI
|
||||
FAR struct spi_dev_s *spi; /* Saved SPI driver instance */
|
||||
FAR struct spi_dev_s *spi; /* Saved SPI driver instance */
|
||||
#else
|
||||
FAR struct i2c_master_s *i2c; /* Saved I2C driver instance */
|
||||
FAR struct i2c_master_s *i2c; /* Saved I2C driver instance */
|
||||
#endif
|
||||
|
||||
uint8_t inuse; /* STMPE811 pins in use */
|
||||
uint8_t flags; /* See STMPE811_FLAGS_* definitions */
|
||||
struct work_s work; /* Supports the interrupt handling "bottom half" */
|
||||
uint8_t inuse; /* STMPE811 pins in use */
|
||||
uint8_t flags; /* See STMPE811_FLAGS_* definitions */
|
||||
struct work_s work; /* Supports the interrupt handling "bottom half" */
|
||||
|
||||
/* Fields that may be disabled to save size if touchscreen support is not used. */
|
||||
|
||||
#ifndef CONFIG_STMPE811_TSC_DISABLE
|
||||
#ifdef CONFIG_STMPE811_REFCNT
|
||||
uint8_t crefs; /* Number of times the device has been opened */
|
||||
uint8_t crefs; /* Number of times the device has been opened */
|
||||
#endif
|
||||
uint8_t nwaiters; /* Number of threads waiting for STMPE811 data */
|
||||
uint8_t id; /* Current touch point ID */
|
||||
uint8_t minor; /* Touchscreen minor device number */
|
||||
volatile bool penchange; /* An unreported event is buffered */
|
||||
uint8_t nwaiters; /* Number of threads waiting for STMPE811 data */
|
||||
uint8_t id; /* Current touch point ID */
|
||||
uint8_t minor; /* Touchscreen minor device number */
|
||||
volatile bool penchange; /* An unreported event is buffered */
|
||||
|
||||
uint16_t threshx; /* Thresholded X value */
|
||||
uint16_t threshy; /* Thresholded Y value */
|
||||
sem_t waitsem; /* Used to wait for the availability of data */
|
||||
uint16_t threshx; /* Thresholded X value */
|
||||
uint16_t threshy; /* Thresholded Y value */
|
||||
sem_t waitsem; /* Used to wait for the availability of data */
|
||||
|
||||
struct work_s timeout; /* Supports tiemeout work */
|
||||
struct wdog_s wdog; /* Timeout to detect missing pen down events */
|
||||
struct stmpe811_sample_s sample; /* Last sampled touch point data */
|
||||
struct work_s timeout; /* Supports tiemeout work */
|
||||
struct wdog_s wdog; /* Timeout to detect missing pen down events */
|
||||
struct stmpe811_sample_s sample; /* Last sampled touch point data */
|
||||
|
||||
/* The following is a list if poll structures of threads waiting for
|
||||
* driver events. The 'struct pollfd' reference for each open is also
|
||||
|
|
|
@ -59,6 +59,7 @@
|
|||
********************************************************************************************/
|
||||
|
||||
/* Configuration ****************************************************************************/
|
||||
|
||||
/* Prerequisites:
|
||||
* CONFIG_I2C
|
||||
* I2C support is required
|
||||
|
|
|
@ -63,6 +63,7 @@
|
|||
********************************************************************************************/
|
||||
|
||||
/* Configuration ****************************************************************************/
|
||||
|
||||
/* Prerequisites:
|
||||
* CONFIG_I2C
|
||||
* I2C support is required
|
||||
|
@ -201,10 +202,10 @@ struct tca64_part_s
|
|||
|
||||
struct tca64_callback_s
|
||||
{
|
||||
ioe_pinset_t pinset; /* Set of pin interrupts that will generate
|
||||
* the callback. */
|
||||
ioe_callback_t cbfunc; /* The saved callback function pointer */
|
||||
FAR void *cbarg; /* Callback argument */
|
||||
ioe_pinset_t pinset; /* Set of pin interrupts that will generate
|
||||
* the callback. */
|
||||
ioe_callback_t cbfunc; /* The saved callback function pointer */
|
||||
FAR void *cbarg; /* Callback argument */
|
||||
};
|
||||
#endif
|
||||
|
||||
|
|
|
@ -36,6 +36,10 @@
|
|||
#ifndef __DRIVERS_WIRELESS_IEEE80211_BCMF_DRIVER_H
|
||||
#define __DRIVERS_WIRELESS_IEEE80211_BCMF_DRIVER_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -54,12 +58,20 @@ struct bcmf_frame_s;
|
|||
|
||||
struct bcmf_bus_dev_s;
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Chip interfaces */
|
||||
|
||||
#define CHIP_STA_INTERFACE 0
|
||||
#define CHIP_AP_INTERFACE 1
|
||||
#define CHIP_P2P_INTERFACE 2
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/* This structure contains the unique state of the Broadcom FullMAC driver */
|
||||
|
||||
struct bcmf_dev_s
|
||||
|
@ -80,7 +92,6 @@ struct bcmf_dev_s
|
|||
|
||||
event_handler_t event_handlers[BCMF_EVENT_COUNT];
|
||||
|
||||
// FIXME use mutex instead of semaphore
|
||||
sem_t control_mutex; /* Cannot handle multiple control requests */
|
||||
sem_t control_timeout; /* Semaphore to wait for control frame rsp */
|
||||
uint16_t control_reqid; /* Current control request id */
|
||||
|
@ -89,7 +100,8 @@ struct bcmf_dev_s
|
|||
uint32_t control_status; /* Last received frame status */
|
||||
|
||||
/* AP Scan state machine.
|
||||
* During scan, control_mutex is locked to prevent control requests */
|
||||
* During scan, control_mutex is locked to prevent control requests
|
||||
*/
|
||||
|
||||
int scan_status; /* Current scan status */
|
||||
struct wdog_s scan_timeout; /* Scan timeout timer */
|
||||
|
@ -114,11 +126,13 @@ struct bcmf_bus_dev_s
|
|||
* control - true if control frame else false
|
||||
* block - true to block until free frame is available
|
||||
*/
|
||||
|
||||
struct bcmf_frame_s *(*allocate_frame)(FAR struct bcmf_dev_s *priv,
|
||||
unsigned int len, bool block,
|
||||
bool control);
|
||||
|
||||
void (*free_frame)(FAR struct bcmf_dev_s *priv, struct bcmf_frame_s *frame);
|
||||
void (*free_frame)(FAR struct bcmf_dev_s *priv,
|
||||
FAR struct bcmf_frame_s *frame);
|
||||
};
|
||||
|
||||
/* bcmf frame definition */
|
||||
|
@ -130,6 +144,10 @@ struct bcmf_frame_s
|
|||
uint16_t len; /* Frame buffer size */
|
||||
};
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* IOCTLs network interface implementation */
|
||||
|
||||
int bcmf_wl_set_mac_address(FAR struct bcmf_dev_s *priv, struct ifreq *req);
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration *************************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
#if !defined(CONFIG_SCHED_HPWORK) || !defined(CONFIG_SCHED_LPWORK)
|
||||
# error Both Low and High priority work queues are required for this driver
|
||||
|
@ -93,8 +93,8 @@
|
|||
#define XBEE_COORDASSOCFLAGS_CHAN_REASSIGN 2
|
||||
#define XBEE_COORDASSOCFLAGS_ALLOWASSOC 4
|
||||
|
||||
/* Size of read buffer active for all of the transaction. i.e. must be big enough
|
||||
* to handle full transmit and receive.
|
||||
/* Size of read buffer active for all of the transaction. i.e. must be big
|
||||
* enough to handle full transmit and receive.
|
||||
*/
|
||||
|
||||
#define XBEE_RXBUF_SIZE 256
|
||||
|
@ -159,7 +159,7 @@ struct xbee_priv_s
|
|||
FAR struct xbee_maccb_s *cb; /* Head of a list of XBee MAC callbacks */
|
||||
uint8_t nclients; /* Number of registered callbacks */
|
||||
FAR struct iob_s *rx_apiframes; /* List of incoming API frames to process */
|
||||
struct work_s notifwork; /* For deferring notifications to LPWORK queue*/
|
||||
struct work_s notifwork; /* For deferring notifications to LPWORK queue */
|
||||
struct work_s attnwork; /* For deferring interrupt work to work queue */
|
||||
volatile bool attn_latched; /* Latched state of ATTN */
|
||||
sem_t primitive_sem; /* Exclusive access to the primitive queue */
|
||||
|
@ -171,7 +171,7 @@ struct xbee_priv_s
|
|||
sem_t atquery_sem; /* Only allow one AT query at a time */
|
||||
sem_t atresp_sem; /* For signaling pending AT response received */
|
||||
char querycmd[2]; /* Stores the pending AT Query command */
|
||||
bool querydone; /* Used to tell waiting thread query is done*/
|
||||
bool querydone; /* Used to tell waiting thread query is done */
|
||||
struct wdog_s atquery_wd; /* Support AT Query timeout and retry */
|
||||
struct wdog_s reqdata_wd; /* Support send timeout and retry */
|
||||
uint8_t frameid; /* For differentiating AT request/response */
|
||||
|
@ -180,28 +180,28 @@ struct xbee_priv_s
|
|||
bool txdone;
|
||||
#ifdef CONFIG_XBEE_LOCKUP_WORKAROUND
|
||||
struct wdog_s lockup_wd; /* Watchdog to protect for XBee lockup */
|
||||
struct work_s lockupwork; /* For deferring lockup query check to LPWORK queue*/
|
||||
struct work_s backupwork; /* For deferring backing up parameters to LPWORK queue*/
|
||||
struct work_s lockupwork; /* For deferring lockup query check to LPWORK queue */
|
||||
struct work_s backupwork; /* For deferring backing up parameters to LPWORK queue */
|
||||
#endif
|
||||
|
||||
/******************* Fields related to Xbee radio ***************************/
|
||||
/******************* Fields related to Xbee radio *************************/
|
||||
|
||||
uint16_t firmwareversion;
|
||||
|
||||
/************* Fields related to addressing and coordinator *****************/
|
||||
/************* Fields related to addressing and coordinator ***************/
|
||||
|
||||
/* Holds all address information (Extended, Short, and PAN ID) for the MAC. */
|
||||
/* Holds all address information(Extended, Short, and PAN ID) for the MAC */
|
||||
|
||||
struct ieee802154_addr_s addr;
|
||||
struct ieee802154_pandesc_s pandesc;
|
||||
|
||||
/****************** Uncategorized MAC PIB attributes ***********************/
|
||||
/****************** Uncategorized MAC PIB attributes **********************/
|
||||
|
||||
/* What type of device is this node acting as */
|
||||
|
||||
enum ieee802154_devmode_e devmode : 2;
|
||||
|
||||
/****************** PHY attributes ***********************/
|
||||
/****************** PHY attributes ****************************************/
|
||||
|
||||
uint8_t chan;
|
||||
uint8_t pwrlvl;
|
||||
|
@ -220,9 +220,10 @@ struct xbee_priv_s
|
|||
* Name: xbee_next_frameid
|
||||
*
|
||||
* Description:
|
||||
* Increment the frame id. This is used to coordinate TX requests with subsequent
|
||||
* TX status frames received by the XBee device. We must skip value 0 since
|
||||
* that value is to tell the XBee not to provide a status response.
|
||||
* Increment the frame id. This is used to coordinate TX requests with
|
||||
* subsequent TX status frames received by the XBee device. We must skip
|
||||
* value 0 since that value is to tell the XBee not to provide a status
|
||||
* response.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -249,7 +250,8 @@ static inline uint8_t xbee_next_frameid(FAR struct xbee_priv_s *priv)
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
static inline void xbee_insert_checksum(FAR uint8_t *frame, uint16_t framelen)
|
||||
static inline void xbee_insert_checksum(FAR uint8_t *frame,
|
||||
uint16_t framelen)
|
||||
{
|
||||
int i;
|
||||
uint8_t checksum = 0;
|
||||
|
@ -263,7 +265,7 @@ static inline void xbee_insert_checksum(FAR uint8_t *frame, uint16_t framelen)
|
|||
checksum += frame[i];
|
||||
}
|
||||
|
||||
frame[framelen - 1] = 0xFF - checksum;
|
||||
frame[framelen - 1] = 0xff - checksum;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
@ -299,14 +301,15 @@ int xbee_atquery(FAR struct xbee_priv_s *priv, FAR const char *atcommand);
|
|||
*
|
||||
****************************************************************************/
|
||||
|
||||
void xbee_send_atquery(FAR struct xbee_priv_s *priv, FAR const char *atcommand);
|
||||
void xbee_send_atquery(FAR struct xbee_priv_s *priv,
|
||||
FAR const char *atcommand);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: xbee_query_firmwareversion
|
||||
*
|
||||
* Description:
|
||||
* Sends API frame with AT command request in order to get the firmware version
|
||||
* from the device.
|
||||
* Sends API frame with AT command request in order to get the firmware
|
||||
* version from the device.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -327,8 +330,8 @@ void xbee_send_atquery(FAR struct xbee_priv_s *priv, FAR const char *atcommand);
|
|||
* Name: xbee_query_eaddr
|
||||
*
|
||||
* Description:
|
||||
* Sends API frame with AT command request in order to get the IEEE 802.15.4
|
||||
* Extended Address. (Serial Number) from the device.
|
||||
* Sends API frame with AT command request in order to get the IEEE
|
||||
* 802.15.4 Extended Address. (Serial Number) from the device.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -372,8 +375,8 @@ void xbee_send_atquery(FAR struct xbee_priv_s *priv, FAR const char *atcommand);
|
|||
* Name: xbee_query_powermode
|
||||
*
|
||||
* Description:
|
||||
* Sends API frame with AT command request in order to get the RF Power Mode
|
||||
* from the device.
|
||||
* Sends API frame with AT command request in order to get the RF Power
|
||||
* Mode from the device.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -416,8 +419,8 @@ void xbee_set_panid(FAR struct xbee_priv_s *priv, FAR const uint8_t *panid);
|
|||
* Name: xbee_set_saddr
|
||||
*
|
||||
* Description:
|
||||
* Sends API frame with AT command request in order to set the Short Address
|
||||
* (Source Address (MY)) of the device
|
||||
* Sends API frame with AT command request in order to set the Short
|
||||
* Address (Source Address (MY)) of the device
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -438,8 +441,8 @@ void xbee_set_chan(FAR struct xbee_priv_s *priv, uint8_t chan);
|
|||
* Name: xbee_set_powerlevel
|
||||
*
|
||||
* Description:
|
||||
* Sends API frame with AT command request in order to set the RF power level
|
||||
* of the device.
|
||||
* Sends API frame with AT command request in order to set the RF power
|
||||
* level of the device.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
@ -491,7 +494,7 @@ void xbee_enable_coord(FAR struct xbee_priv_s *priv, bool enable);
|
|||
* Name: xbee_regdump
|
||||
*
|
||||
* Description:
|
||||
* Perform a series of queries updating struct and printing settings to SYSLOG.
|
||||
* Perform a series of queries updating struct and printing settings.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
|
Loading…
Reference in a new issue