You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gn...@apache.org on 2020/05/05 18:21:03 UTC
[incubator-nuttx] 02/03: hdc1008: minor fixes to comments.
This is an automated email from the ASF dual-hosted git repository.
gnutt pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
commit 59fcd9a3eec150d9233699d978ba3da3a3f2ffff
Author: Pelle <ic...@gmail.com>
AuthorDate: Tue May 5 07:04:22 2020 +0200
hdc1008: minor fixes to comments.
---
drivers/sensors/Make.defs | 2 +-
drivers/sensors/hdc1008.c | 24 +++++++++++++++++++++---
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/drivers/sensors/Make.defs b/drivers/sensors/Make.defs
index dbba327..bf730ef 100644
--- a/drivers/sensors/Make.defs
+++ b/drivers/sensors/Make.defs
@@ -291,7 +291,7 @@ ifeq ($(CONFIG_SENSORS_ZEROCROSS),y)
CSRCS += zerocross.c
endif
-# TI HDC100X
+# TI HDC1008
ifeq ($(CONFIG_SENSORS_HDC1008),y)
CSRCS += hdc1008.c
diff --git a/drivers/sensors/hdc1008.c b/drivers/sensors/hdc1008.c
index fd6ccb3..40b56ac 100644
--- a/drivers/sensors/hdc1008.c
+++ b/drivers/sensors/hdc1008.c
@@ -68,7 +68,7 @@
#endif
/* Macros to convert raw temperature and humidity to real values. Temperature
- * is scaled by 100.
+ * is scaled by 100, humidity by 10.
*/
#define RAW_TO_TEMP(x) (((x) * 16500 / 65536) - 4000)
@@ -593,10 +593,14 @@ static int hdc1008_close(FAR struct file *filep)
/****************************************************************************
* Name: hdc1008_read
+ *
+ * Description:
+ * Called when the driver is read from.
+ *
****************************************************************************/
static ssize_t hdc1008_read(FAR struct file *filep, FAR char *buffer,
- size_t buflen)
+ size_t buflen)
{
FAR struct inode *inode = filep->f_inode;
FAR struct hdc1008_dev_s *priv =
@@ -668,8 +672,10 @@ static ssize_t hdc1008_read(FAR struct file *filep, FAR char *buffer,
/****************************************************************************
* Name: hdc1008_measure_current_mode
+ *
* Description:
- * Measure from sensor according to current mode
+ * Measure from sensor according to current mode (temperature, humidity or
+ * both).
*
****************************************************************************/
@@ -723,6 +729,10 @@ static int hdc1008_measure_current_mode(struct hdc1008_dev_s *priv,
/****************************************************************************
* Name: hdc1008_write
+ *
+ * Description:
+ * Called when the driver is written to (not supported).
+ *
****************************************************************************/
static ssize_t hdc1008_write(FAR struct file *filep, FAR const char *buffer,
@@ -733,6 +743,10 @@ static ssize_t hdc1008_write(FAR struct file *filep, FAR const char *buffer,
/****************************************************************************
* Name: hdc1008_ioctl
+ *
+ * Description:
+ * Called when an ioctl() operation is made for the driver.
+ *
****************************************************************************/
static int hdc1008_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
@@ -835,6 +849,10 @@ static int hdc1008_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
/****************************************************************************
* Name: hdc1008_unlink
+ *
+ * Description:
+ * Called when the driver is unlinked.
+ *
****************************************************************************/
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS