@@ -1483,10 +1483,11 @@ static void webserver_values() {
1483
1483
page_content += FPSTR (EMPTY_ROW);
1484
1484
}
1485
1485
if (cfg::bmx280_read) {
1486
- add_table_t_value (FPSTR (SENSORS_BMX280), FPSTR (INTL_TEMPERATURE), last_value_BMX280_T);
1487
- add_table_value (FPSTR (SENSORS_BMX280), FPSTR (INTL_PRESSURE), check_display_value (last_value_BMX280_P / 100 .0f , (-1 / 100 .0f ), 2 , 0 ), unit_P);
1486
+ const char * const sensor_name = (bmx280.sensorID () == BME280_SENSOR_ID) ? SENSORS_BME280 : SENSORS_BMP280;
1487
+ add_table_t_value (FPSTR (sensor_name), FPSTR (INTL_TEMPERATURE), last_value_BMX280_T);
1488
+ add_table_value (FPSTR (sensor_name), FPSTR (INTL_PRESSURE), check_display_value (last_value_BMX280_P / 100 .0f , (-1 / 100 .0f ), 2 , 0 ), unit_P);
1488
1489
if (bmx280.sensorID () == BME280_SENSOR_ID) {
1489
- add_table_h_value (FPSTR (SENSORS_BMX280 ), FPSTR (INTL_HUMIDITY), last_value_BME280_H);
1490
+ add_table_h_value (FPSTR (sensor_name ), FPSTR (INTL_HUMIDITY), last_value_BME280_H);
1490
1491
}
1491
1492
page_content += FPSTR (EMPTY_ROW);
1492
1493
}
@@ -2389,7 +2390,8 @@ static void fetchSensorSHT3x(String& s) {
2389
2390
* read BMP280/BME280 sensor values *
2390
2391
*****************************************************************/
2391
2392
static void fetchSensorBMX280 (String& s) {
2392
- debug_outln_verbose (FPSTR (DBG_TXT_START_READING), FPSTR (SENSORS_BMX280));
2393
+ const char * const sensor_name = (bmx280.sensorID () == BME280_SENSOR_ID) ? SENSORS_BME280 : SENSORS_BMP280;
2394
+ debug_outln_verbose (FPSTR (DBG_TXT_START_READING), FPSTR (sensor_name));
2393
2395
2394
2396
bmx280.takeForcedMeasurement ();
2395
2397
const auto t = bmx280.readTemperature ();
@@ -2414,7 +2416,7 @@ static void fetchSensorBMX280(String& s) {
2414
2416
}
2415
2417
}
2416
2418
debug_outln_info (FPSTR (DBG_TXT_SEP));
2417
- debug_outln_verbose (FPSTR (DBG_TXT_END_READING), FPSTR (SENSORS_BMX280 ));
2419
+ debug_outln_verbose (FPSTR (DBG_TXT_END_READING), FPSTR (sensor_name ));
2418
2420
}
2419
2421
2420
2422
/* ****************************************************************
@@ -3595,11 +3597,11 @@ static void display_values() {
3595
3597
p_value = last_value_BMP_P;
3596
3598
}
3597
3599
if (cfg::bmx280_read) {
3598
- t_sensor = p_sensor = FPSTR (SENSORS_BMX280 );
3600
+ t_sensor = p_sensor = FPSTR (SENSORS_BMP280 );
3599
3601
t_value = last_value_BMX280_T;
3600
3602
p_value = last_value_BMX280_P;
3601
3603
if (bmx280.sensorID () == BME280_SENSOR_ID) {
3602
- h_sensor = FPSTR (SENSORS_BMX280 );
3604
+ h_sensor = t_sensor = FPSTR (SENSORS_BME280 );
3603
3605
h_value = last_value_BME280_H;
3604
3606
}
3605
3607
}
@@ -3848,7 +3850,7 @@ static void init_display() {
3848
3850
* Init BMP280/BME280 *
3849
3851
*****************************************************************/
3850
3852
static bool initBMX280 (char addr) {
3851
- debug_out (String (F (" Trying BMP280/BME280 sensor on " )) + String (addr, HEX), DEBUG_MIN_INFO);
3853
+ debug_out (String (F (" Trying BMx280 sensor on " )) + String (addr, HEX), DEBUG_MIN_INFO);
3852
3854
3853
3855
if (bmx280.begin (addr)) {
3854
3856
debug_outln_info (FPSTR (DBG_TXT_FOUND));
@@ -4031,9 +4033,9 @@ static void powerOnTestSensors() {
4031
4033
}
4032
4034
4033
4035
if (cfg::bmx280_read) {
4034
- debug_outln_info (F (" Read BMP280/BME280 ..." ));
4036
+ debug_outln_info (F (" Read BMxE280 ..." ));
4035
4037
if (!initBMX280 (0x76 ) && !initBMX280 (0x77 )) {
4036
- debug_outln_error (F (" Check BMP280/BME280 wiring" ));
4038
+ debug_outln_error (F (" Check BMx280 wiring" ));
4037
4039
bmx280_init_failed = true ;
4038
4040
}
4039
4041
}
@@ -4431,9 +4433,9 @@ void loop(void) {
4431
4433
fetchSensorBMX280 (result);
4432
4434
data += result;
4433
4435
if (bmx280.sensorID () == BME280_SENSOR_ID) {
4434
- sum_send_time += sendSensorCommunity (result, BME280_API_PIN, FPSTR (SENSORS_BMX280 ), " BME280_" );
4436
+ sum_send_time += sendSensorCommunity (result, BME280_API_PIN, FPSTR (SENSORS_BME280 ), " BME280_" );
4435
4437
} else {
4436
- sum_send_time += sendSensorCommunity (result, BMP280_API_PIN, FPSTR (SENSORS_BMX280 ), " BMP280_" );
4438
+ sum_send_time += sendSensorCommunity (result, BMP280_API_PIN, FPSTR (SENSORS_BMP280 ), " BMP280_" );
4437
4439
}
4438
4440
result = emptyString;
4439
4441
}
0 commit comments