summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
authorWayne Lin <[email protected]>2020-12-25 18:30:22 +0800
committerWayne Lin <[email protected]>2020-12-25 18:30:22 +0800
commit89c1c3f271a77fb73636009d44397e453e235324 (patch)
treecee2f7041cb884ed01393bf3029b8f040f918e53 /components
parent8d90cfadf0d9a602e5e9e92a73b459cf354e8249 (diff)
parent9a59737b5fd2dd8aaeb5f4810ddab32f5d5fd470 (diff)
Merge branch 'master' of https://github.com/RT-Thread/rt-thread into nuvoton
Diffstat (limited to 'components')
-rw-r--r--components/drivers/sensors/sensor.c3
-rwxr-xr-xcomponents/drivers/sensors/sensor.h1
-rwxr-xr-xcomponents/drivers/sensors/sensor_cmd.c1
3 files changed, 4 insertions, 1 deletions
diff --git a/components/drivers/sensors/sensor.c b/components/drivers/sensors/sensor.c
index eb5c97a574..bbfcea97be 100644
--- a/components/drivers/sensors/sensor.c
+++ b/components/drivers/sensors/sensor.c
@@ -35,7 +35,8 @@ static char *const sensor_name_str[] =
"forc_", /* Force sensor */
"dust_", /* Dust sensor */
"eco2_", /* eCO2 sensor */
- "gnss_" /* GPS/GNSS sensor */
+ "gnss_", /* GPS/GNSS sensor */
+ "tof_" /* TOF sensor */
};
/* Sensor interrupt correlation function */
diff --git a/components/drivers/sensors/sensor.h b/components/drivers/sensors/sensor.h
index 5a069edc25..b180e36a73 100755
--- a/components/drivers/sensors/sensor.h
+++ b/components/drivers/sensors/sensor.h
@@ -48,6 +48,7 @@ extern "C" {
#define RT_SENSOR_CLASS_DUST (14) /* Dust sensor */
#define RT_SENSOR_CLASS_ECO2 (15) /* eCO2 sensor */
#define RT_SENSOR_CLASS_GNSS (16) /* GPS/GNSS sensor */
+#define RT_SENSOR_CLASS_TOF (17) /* TOF sensor */
/* Sensor vendor types */
diff --git a/components/drivers/sensors/sensor_cmd.c b/components/drivers/sensors/sensor_cmd.c
index 284db75cf6..cbf7d233c6 100755
--- a/components/drivers/sensors/sensor_cmd.c
+++ b/components/drivers/sensors/sensor_cmd.c
@@ -50,6 +50,7 @@ static void sensor_show_data(rt_size_t num, rt_sensor_t sensor, struct rt_sensor
LOG_I("num:%3d, light:%5d lux, timestamp:%5d", num, sensor_data->data.light, sensor_data->timestamp);
break;
case RT_SENSOR_CLASS_PROXIMITY:
+ case RT_SENSOR_CLASS_TOF:
LOG_I("num:%3d, distance:%5d, timestamp:%5d", num, sensor_data->data.proximity, sensor_data->timestamp);
break;
case RT_SENSOR_CLASS_HR: