Ver código fonte

修改BME280传感器输出范围信息错误问题

wangk-ge 6 anos atrás
pai
commit
372502648b
1 arquivos alterados com 4 adições e 4 exclusões
  1. 4 4
      sensor_bosch_bme280.c

+ 4 - 4
sensor_bosch_bme280.c

@@ -287,8 +287,8 @@ int rt_hw_bme280_init(const char *name, struct rt_sensor_config *cfg)
         sensor_temp->info.model      = "bme280_temp";
         sensor_temp->info.unit       = RT_SENSOR_UNIT_DCELSIUS;
         sensor_temp->info.intf_type  = RT_SENSOR_INTF_I2C;
-        sensor_baro->info.range_max  = 850;
-        sensor_baro->info.range_min  = -400;
+        sensor_temp->info.range_max  = 850;
+        sensor_temp->info.range_min  = -400;
         sensor_temp->info.period_min = 100;
 
         rt_memcpy(&sensor_temp->config, cfg, sizeof(struct rt_sensor_config));
@@ -315,8 +315,8 @@ int rt_hw_bme280_init(const char *name, struct rt_sensor_config *cfg)
         sensor_humi->info.model      = "bme280_humi";
         sensor_humi->info.unit       = RT_SENSOR_UNIT_PERMILLAGE;
         sensor_humi->info.intf_type  = RT_SENSOR_INTF_I2C;
-        sensor_baro->info.range_max  = 1000;
-        sensor_baro->info.range_min  = 0;
+        sensor_humi->info.range_max  = 1000;
+        sensor_humi->info.range_min  = 0;
         sensor_humi->info.period_min = 100;
 
         rt_memcpy(&sensor_humi->config, cfg, sizeof(struct rt_sensor_config));