Merge pull request #3971 from SimpleInit/master

Add sensor vendor MAXIM; Fix temp ptint error
This commit is contained in:
Bernard Xiong 2020-10-21 14:13:49 +08:00 committed by GitHub
commit 017e228248
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -65,6 +65,7 @@ extern "C" {
#define RT_SENSOR_VENDOR_TI (11) /* Texas Instruments */
#define RT_SENSOR_VENDOR_PLANTOWER (12) /* Plantower */
#define RT_SENSOR_VENDOR_AMS (13) /* ams AG */
#define RT_SENSOR_VENDOR_MAXIM (14) /* Maxim Integrated */
/* Sensor unit types */

View File

@ -38,7 +38,7 @@ static void sensor_show_data(rt_size_t num, rt_sensor_t sensor, struct rt_sensor
LOG_I("num:%3d, lon:%5d, lat:%5d, timestamp:%5d", num, sensor_data->data.coord.longitude, sensor_data->data.coord.latitude, sensor_data->timestamp);
break;
case RT_SENSOR_CLASS_TEMP:
LOG_I("num:%3d, temp:%3d.%d C, timestamp:%5d", num, sensor_data->data.temp / 10, sensor_data->data.temp % 10, sensor_data->timestamp);
LOG_I("num:%3d, temp:%3d.%d C, timestamp:%5d", num, sensor_data->data.temp / 10, (rt_uint32_t)sensor_data->data.temp % 10, sensor_data->timestamp);
break;
case RT_SENSOR_CLASS_HUMI:
LOG_I("num:%3d, humi:%3d.%d%%, timestamp:%5d", num, sensor_data->data.humi / 10, sensor_data->data.humi % 10, sensor_data->timestamp);
@ -345,6 +345,9 @@ static void sensor(int argc, char **argv)
case RT_SENSOR_VENDOR_AMS:
rt_kprintf("vendor :AMS\n");
break;
case RT_SENSOR_VENDOR_MAXIM:
rt_kprintf("vendor :Maxim Integrated\n");
break;
}
rt_kprintf("model :%s\n", info.model);
switch (info.unit)