Fixed bug causing s9 to be same as s8

This commit is contained in:
RZ_MINIX\rober 2025-09-27 20:19:31 -07:00
parent 58308ef7fb
commit e297b6c70f

View File

@ -311,18 +311,18 @@ bool Bme68x::read(struct BME_DATA * data)
data->measurement_bitmask |= (1 << ix);
data->current_profile = m_current_profile;
ESP_LOGI(TAG, "VALID measurement: profile=%d, index=%d, resistance=%0.1f",
m_current_profile, ix, bdata.gas_resistance);
//ESP_LOGI(TAG, "VALID measurement: profile=%d, index=%d, resistance=%0.1f",
// m_current_profile, ix, bdata.gas_resistance);
data->measurement[ix].resistance = bdata.gas_resistance;
if(ix == 0)
data->humidity = bdata.humidity;
else if(ix == 9)
{
ESP_LOGI(TAG, "Index 9 detected for profile %d", m_current_profile);
if (data->measurement[9].resistance != data->measurement[8].resistance) {
//ESP_LOGI(TAG, "Index 9 detected for profile %d", m_current_profile);
index_9_detected = true;
}
data->measurement[ix].resistance = bdata.gas_resistance;
}
}
else if (has_new_data && has_heat_stab)
{
@ -331,16 +331,17 @@ bool Bme68x::read(struct BME_DATA * data)
data->measurement_bitmask |= (1 << ix);
data->current_profile = m_current_profile;
data->measurement[ix].resistance = bdata.gas_resistance;
if(ix == 0)
data->humidity = bdata.humidity;
else if(ix == 9)
{
//ESP_LOGI(TAG, "Index 9 detected (heat stable) for profile %d", m_current_profile);
if (data->measurement[9].resistance != data->measurement[8].resistance) {
//ESP_LOGI(TAG, "Index 9 detected for profile %d", m_current_profile);
index_9_detected = true;
}
}
data->measurement[ix].resistance = bdata.gas_resistance;
}
}
} while(left > 0);