mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
arch/arm/src/: Fix a error in last commit that was cloned in three places.
This commit is contained in:
+12
-5
@@ -945,9 +945,9 @@ static ssize_t tsc2007_read(FAR struct file *filep, FAR char *buffer, size_t len
|
||||
ret = tsc2007_sample(priv, &sample);
|
||||
if (ret < 0)
|
||||
{
|
||||
/* Sample data is not available now. We would ave to wait to get
|
||||
* receive sample data. If the user has specified the O_NONBLOCK
|
||||
* option, then just return an error.
|
||||
/* Sample data is not available now. We would ave to wait to receive
|
||||
* sample data. If the user has specified the O_NONBLOCK option, then
|
||||
* just return an error.
|
||||
*/
|
||||
|
||||
if (filep->f_oflags & O_NONBLOCK)
|
||||
@@ -1259,11 +1259,18 @@ int tsc2007_register(FAR struct i2c_master_s *dev,
|
||||
/* Initialize the TSC2007 device driver instance */
|
||||
|
||||
memset(priv, 0, sizeof(struct tsc2007_dev_s));
|
||||
priv->i2c = dev; /* Save the I2C device handle */
|
||||
priv->config = config; /* Save the board configuration */
|
||||
priv->i2c = dev; /* Save the I2C device handle */
|
||||
priv->config = config; /* Save the board configuration */
|
||||
|
||||
nxsem_init(&priv->devsem, 0, 1); /* Initialize device structure semaphore */
|
||||
nxsem_init(&priv->waitsem, 0, 0); /* Initialize pen event wait semaphore */
|
||||
|
||||
/* The event wait semaphore is used for signaling and, hence, should not
|
||||
* have priority inheritance enabled.
|
||||
*/
|
||||
|
||||
nxsem_setprotocol(&priv->waitsem, SEM_PRIO_NONE);
|
||||
|
||||
/* Make sure that interrupts are disabled */
|
||||
|
||||
config->clear(config);
|
||||
|
||||
Reference in New Issue
Block a user