mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
drivers/: Fixes to spacing and alignement
This commit is contained in:
@@ -395,7 +395,7 @@ static int ads7843e_sample(FAR struct ads7843e_dev_s *priv,
|
||||
* sampled data.
|
||||
*/
|
||||
|
||||
memcpy(sample, &priv->sample, sizeof(struct ads7843e_sample_s ));
|
||||
memcpy(sample, &priv->sample, sizeof(struct ads7843e_sample_s));
|
||||
|
||||
/* Now manage state transitions */
|
||||
|
||||
@@ -480,7 +480,7 @@ static int ads7843e_waitsample(FAR struct ads7843e_dev_s *priv,
|
||||
|
||||
ivdbg("Sampled\n");
|
||||
|
||||
/* Re-acquire the semaphore that manages mutually exclusive access to
|
||||
/* Re-acquire the semaphore that manages mutually exclusive access to
|
||||
* the device structure. We may have to wait here. But we have our sample.
|
||||
* Interrupts and pre-emption will be re-enabled while we wait.
|
||||
*/
|
||||
@@ -974,10 +974,10 @@ static ssize_t ads7843e_read(FAR struct file *filep, FAR char *buffer, size_t le
|
||||
|
||||
if (sample.contact == CONTACT_UP)
|
||||
{
|
||||
/* Pen is now up. Is the positional data valid? This is important to
|
||||
* know because the release will be sent to the window based on its
|
||||
* last positional data.
|
||||
*/
|
||||
/* Pen is now up. Is the positional data valid? This is important to
|
||||
* know because the release will be sent to the window based on its
|
||||
* last positional data.
|
||||
*/
|
||||
|
||||
if (sample.valid)
|
||||
{
|
||||
|
||||
@@ -143,7 +143,8 @@ static void ajoy_sample(FAR struct ajoy_upperhalf_s *priv);
|
||||
|
||||
static int ajoy_open(FAR struct file *filep);
|
||||
static int ajoy_close(FAR struct file *filep);
|
||||
static ssize_t ajoy_read(FAR struct file *, FAR char *, size_t);
|
||||
static ssize_t ajoy_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen);
|
||||
static int ajoy_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
|
||||
@@ -143,7 +143,8 @@ static void djoy_sample(FAR struct djoy_upperhalf_s *priv);
|
||||
|
||||
static int djoy_open(FAR struct file *filep);
|
||||
static int djoy_close(FAR struct file *filep);
|
||||
static ssize_t djoy_read(FAR struct file *, FAR char *, size_t);
|
||||
static ssize_t djoy_read(FAR struct file *filep, FAR char *buffer,
|
||||
size_t buflen);
|
||||
static int djoy_ioctl(FAR struct file *filep, int cmd,
|
||||
unsigned long arg);
|
||||
#ifndef CONFIG_DISABLE_POLL
|
||||
@@ -585,7 +586,7 @@ static ssize_t djoy_read(FAR struct file *filep, FAR char *buffer,
|
||||
lower = priv->du_lower;
|
||||
DEBUGASSERT(lower && lower->dl_sample);
|
||||
priv->du_sample = lower->dl_sample(lower);
|
||||
*(djoy_buttonset_t*)buffer = priv->du_sample;
|
||||
*(FAR djoy_buttonset_t *)buffer = priv->du_sample;
|
||||
ret = sizeof(djoy_buttonset_t);
|
||||
|
||||
djoy_givesem(&priv->du_exclsem);
|
||||
|
||||
@@ -285,7 +285,7 @@ static uint16_t max11802_sendcmd(FAR struct max11802_dev_s *priv,
|
||||
|
||||
result = ((uint16_t)buffer[0] << 8) | (uint16_t)buffer[1];
|
||||
*tags = result & 0xF;
|
||||
result >>= 4; // Get rid of tags
|
||||
result >>= 4; /* Get rid of tags */
|
||||
|
||||
ivdbg("cmd:%02x response:%04x\n", cmd, result);
|
||||
return result;
|
||||
@@ -359,7 +359,7 @@ static int max11802_sample(FAR struct max11802_dev_s *priv,
|
||||
* sampled data.
|
||||
*/
|
||||
|
||||
memcpy(sample, &priv->sample, sizeof(struct max11802_sample_s ));
|
||||
memcpy(sample, &priv->sample, sizeof(struct max11802_sample_s));
|
||||
|
||||
/* Now manage state transitions */
|
||||
|
||||
@@ -980,10 +980,10 @@ static ssize_t max11802_read(FAR struct file *filep, FAR char *buffer,
|
||||
|
||||
if (sample.contact == CONTACT_UP)
|
||||
{
|
||||
/* Pen is now up. Is the positional data valid? This is important to
|
||||
* know because the release will be sent to the window based on its
|
||||
* last positional data.
|
||||
*/
|
||||
/* Pen is now up. Is the positional data valid? This is important to
|
||||
* know because the release will be sent to the window based on its
|
||||
* last positional data.
|
||||
*/
|
||||
|
||||
if (sample.valid)
|
||||
{
|
||||
|
||||
+3
-3
@@ -92,8 +92,8 @@
|
||||
*/
|
||||
|
||||
#define MXT_GETUINT16(p) \
|
||||
(((uint16_t)(((FAR uint8_t*)(p))[1]) << 8) | \
|
||||
(uint16_t)(((FAR uint8_t*)(p))[0]))
|
||||
(((uint16_t)(((FAR uint8_t *)(p))[1]) << 8) | \
|
||||
(uint16_t)(((FAR uint8_t *)(p))[0]))
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
@@ -1368,7 +1368,7 @@ static ssize_t mxt_read(FAR struct file *filep, FAR char *buffer, size_t len)
|
||||
memset(report, 0, SIZEOF_TOUCH_SAMPLE_S(ncontacts));
|
||||
report->npoints = ncontacts;
|
||||
|
||||
for (i = 0, j= 0; i < priv->nslots && j < ncontacts; i++)
|
||||
for (i = 0, j = 0; i < priv->nslots && j < ncontacts; i++)
|
||||
{
|
||||
FAR struct mxt_sample_s *sample = &priv->sample[i];
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ static void stmpe811_worker(FAR void *arg)
|
||||
/* Check for a touchscreen interrupt */
|
||||
|
||||
#ifndef CONFIG_STMPE811_TSC_DISABLE
|
||||
if ((regval & (INT_TOUCH_DET|INT_FIFO_TH|INT_FIFO_OFLOW)) != 0)
|
||||
if ((regval & (INT_TOUCH_DET | INT_FIFO_TH | INT_FIFO_OFLOW)) != 0)
|
||||
{
|
||||
/* Dispatch the touchscreen interrupt if it was brought into the link */
|
||||
|
||||
@@ -112,8 +112,9 @@ static void stmpe811_worker(FAR void *arg)
|
||||
stmpe811_tscworker(priv, regval);
|
||||
}
|
||||
|
||||
stmpe811_putreg8(priv, STMPE811_INT_STA, (INT_TOUCH_DET|INT_FIFO_TH|INT_FIFO_OFLOW));
|
||||
regval &= ~(INT_TOUCH_DET|INT_FIFO_TH|INT_FIFO_OFLOW);
|
||||
stmpe811_putreg8(priv, STMPE811_INT_STA,
|
||||
(INT_TOUCH_DET | INT_FIFO_TH | INT_FIFO_OFLOW));
|
||||
regval &= ~(INT_TOUCH_DET | INT_FIFO_TH | INT_FIFO_OFLOW);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -101,7 +101,8 @@ int stmpe811_tempinitialize(STMPE811_HANDLE handle)
|
||||
|
||||
/* Aquire data enable */
|
||||
|
||||
stmpe811_putreg8(priv, STMPE811_TEMP_CTRL, (TEMP_CTRL_ACQ|TEMP_CTRL_ENABLE));
|
||||
stmpe811_putreg8(priv, STMPE811_TEMP_CTRL,
|
||||
(TEMP_CTRL_ACQ | TEMP_CTRL_ENABLE));
|
||||
|
||||
return OK;
|
||||
}
|
||||
@@ -130,7 +131,8 @@ uint16_t stmpe811_tempread(STMPE811_HANDLE handle)
|
||||
|
||||
/* Acquire data enable */
|
||||
|
||||
stmpe811_putreg8(priv, STMPE811_TEMP_CTRL, (TEMP_CTRL_ACQ|TEMP_CTRL_ENABLE));
|
||||
stmpe811_putreg8(priv, STMPE811_TEMP_CTRL,
|
||||
(TEMP_CTRL_ACQ | TEMP_CTRL_ENABLE));
|
||||
|
||||
/* Read the temperature */
|
||||
|
||||
|
||||
@@ -307,7 +307,7 @@ static inline int stmpe811_waitsample(FAR struct stmpe811_dev_s *priv,
|
||||
if (ret < 0)
|
||||
{
|
||||
#ifdef CONFIG_DEBUG
|
||||
// Sample the errno (debug output could change it)
|
||||
/* Sample the errno (debug output could change it) */
|
||||
|
||||
int errval = errno;
|
||||
|
||||
@@ -577,11 +577,11 @@ errout:
|
||||
|
||||
/****************************************************************************
|
||||
* Name: stmpe811_ioctl
|
||||
*
|
||||
*
|
||||
* Description:
|
||||
* Standard character driver ioctl method.
|
||||
*
|
||||
****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static int stmpe811_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
||||
{
|
||||
@@ -860,7 +860,7 @@ static inline void stmpe811_tscinitialize(FAR struct stmpe811_dev_s *priv)
|
||||
stmpe811_putreg8(priv, STMPE811_TSC_IDRIVE, TSC_IDRIVE_50MA);
|
||||
|
||||
/* Enable the TSC. Use no tracking index, touch-screen controller
|
||||
* operation mode (XYZ).
|
||||
* operation mode (XYZ).
|
||||
*/
|
||||
|
||||
stmpe811_putreg8(priv, STMPE811_TSC_CTRL, TSC_CTRL_EN);
|
||||
@@ -1019,7 +1019,7 @@ void stmpe811_tscworker(FAR struct stmpe811_dev_s *priv, uint8_t intsta)
|
||||
|
||||
/* The pen is down... check for data in the FIFO */
|
||||
|
||||
else if ((intsta & (INT_FIFO_TH|INT_FIFO_OFLOW)) != 0)
|
||||
else if ((intsta & (INT_FIFO_TH | INT_FIFO_OFLOW)) != 0)
|
||||
{
|
||||
/* Read the next x and y positions from the FIFO. */
|
||||
|
||||
|
||||
@@ -309,7 +309,7 @@ static int tsc2007_sample(FAR struct tsc2007_dev_s *priv,
|
||||
* sampled data.
|
||||
*/
|
||||
|
||||
memcpy(sample, &priv->sample, sizeof(struct tsc2007_sample_s ));
|
||||
memcpy(sample, &priv->sample, sizeof(struct tsc2007_sample_s));
|
||||
|
||||
/* Now manage state transitions */
|
||||
|
||||
@@ -539,10 +539,10 @@ static int tsc2007_transfer(FAR struct tsc2007_dev_s *priv, uint8_t cmd)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* Get the MS 8 bits from the first byte and the remaining LS 4 bits from
|
||||
* the second byte. The valid range of data is then from 0 to 4095 with
|
||||
* the LSB unit corresponding to Vref/4096.
|
||||
*/
|
||||
/* Get the MS 8 bits from the first byte and the remaining LS 4 bits from
|
||||
* the second byte. The valid range of data is then from 0 to 4095 with
|
||||
* the LSB unit corresponding to Vref/4096.
|
||||
*/
|
||||
|
||||
ret = (unsigned int)data12[0] << 4 | (unsigned int)data12[1] >> 4;
|
||||
ivdbg("data: 0x%04x\n", ret);
|
||||
@@ -971,8 +971,8 @@ static ssize_t tsc2007_read(FAR struct file *filep, FAR char *buffer, size_t len
|
||||
|
||||
if (sample.contact == CONTACT_UP)
|
||||
{
|
||||
/* Pen is now up. Is the positional data valid? This is important to
|
||||
* know because the release will be sent to the window based on its
|
||||
/* Pen is now up. Is the positional data valid? This is important to
|
||||
* know because the release will be sent to the window based on its
|
||||
* last positional data.
|
||||
*/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user