From f2070beb54d828f205dad81ea10127599c5eb79e Mon Sep 17 00:00:00 2001 From: luhuadong Date: Sat, 4 Jul 2020 17:14:31 +0800 Subject: [PATCH] [Sensor] Add two concentration unit ppm & ppb --- components/drivers/sensors/sensor.h | 2 ++ components/drivers/sensors/sensor_cmd.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/components/drivers/sensors/sensor.h b/components/drivers/sensors/sensor.h index 52bbb9bf76..e61b32acba 100755 --- a/components/drivers/sensors/sensor.h +++ b/components/drivers/sensors/sensor.h @@ -82,6 +82,8 @@ extern "C" { #define RT_SENSOR_UNIT_BPM (11) /* Heart rate unit: bpm */ #define RT_SENSOR_UNIT_MM (12) /* Distance unit: mm */ #define RT_SENSOR_UNIT_MN (13) /* Force unit: mN */ +#define RT_SENSOR_UNIT_PPM (14) /* Concentration unit: ppm */ +#define RT_SENSOR_UNIT_PPB (15) /* Concentration unit: ppb */ /* Sensor communication interface types */ diff --git a/components/drivers/sensors/sensor_cmd.c b/components/drivers/sensors/sensor_cmd.c index 4c5509c0b6..d46b23f4cf 100755 --- a/components/drivers/sensors/sensor_cmd.c +++ b/components/drivers/sensors/sensor_cmd.c @@ -384,6 +384,12 @@ static void sensor(int argc, char **argv) case RT_SENSOR_UNIT_MN: rt_kprintf("unit :mN\n"); break; + case RT_SENSOR_UNIT_PPM: + rt_kprintf("unit :ppm\n"); + break; + case RT_SENSOR_UNIT_PPB: + rt_kprintf("unit :ppb\n"); + break; } rt_kprintf("range_max :%d\n", info.range_max); rt_kprintf("range_min :%d\n", info.range_min);