Merge pull request #4181 from Prry/develop

[sensor] support TOF sensor class
This commit is contained in:
Bernard Xiong 2020-12-22 14:05:04 +08:00 committed by GitHub
commit 10823e54b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 1 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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: