Skip to content

Commit e7ed764

Browse files
committed
添加TOF传感器描述信息
1 parent 2c964b5 commit e7ed764

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

components/drivers/sensors/sensor.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ static char *const sensor_name_str[] =
3535
"forc_", /* Force sensor */
3636
"dust_", /* Dust sensor */
3737
"eco2_", /* eCO2 sensor */
38-
"gnss_" /* GPS/GNSS sensor */
38+
"gnss_", /* GPS/GNSS sensor */
39+
"tof_" /* TOF sensor */
3940
};
4041

4142
/* Sensor interrupt correlation function */

components/drivers/sensors/sensor.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ extern "C" {
4848
#define RT_SENSOR_CLASS_DUST (14) /* Dust sensor */
4949
#define RT_SENSOR_CLASS_ECO2 (15) /* eCO2 sensor */
5050
#define RT_SENSOR_CLASS_GNSS (16) /* GPS/GNSS sensor */
51+
#define RT_SENSOR_CLASS_TOF (17) /* TOF sensor */
5152

5253
/* Sensor vendor types */
5354

components/drivers/sensors/sensor_cmd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ static void sensor_show_data(rt_size_t num, rt_sensor_t sensor, struct rt_sensor
5050
LOG_I("num:%3d, light:%5d lux, timestamp:%5d", num, sensor_data->data.light, sensor_data->timestamp);
5151
break;
5252
case RT_SENSOR_CLASS_PROXIMITY:
53+
case RT_SENSOR_CLASS_TOF:
5354
LOG_I("num:%3d, distance:%5d, timestamp:%5d", num, sensor_data->data.proximity, sensor_data->timestamp);
5455
break;
5556
case RT_SENSOR_CLASS_HR:

0 commit comments

Comments
 (0)