Fixed bug causing s9 to be same as s8
This commit is contained in:
parent
58308ef7fb
commit
e297b6c70f
@ -311,18 +311,18 @@ bool Bme68x::read(struct BME_DATA * data)
|
|||||||
data->measurement_bitmask |= (1 << ix);
|
data->measurement_bitmask |= (1 << ix);
|
||||||
data->current_profile = m_current_profile;
|
data->current_profile = m_current_profile;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "VALID measurement: profile=%d, index=%d, resistance=%0.1f",
|
//ESP_LOGI(TAG, "VALID measurement: profile=%d, index=%d, resistance=%0.1f",
|
||||||
m_current_profile, ix, bdata.gas_resistance);
|
// m_current_profile, ix, bdata.gas_resistance);
|
||||||
|
data->measurement[ix].resistance = bdata.gas_resistance;
|
||||||
if(ix == 0)
|
if(ix == 0)
|
||||||
data->humidity = bdata.humidity;
|
data->humidity = bdata.humidity;
|
||||||
else if(ix == 9)
|
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) {
|
||||||
index_9_detected = true;
|
//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)
|
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->measurement_bitmask |= (1 << ix);
|
||||||
data->current_profile = m_current_profile;
|
data->current_profile = m_current_profile;
|
||||||
|
data->measurement[ix].resistance = bdata.gas_resistance;
|
||||||
if(ix == 0)
|
if(ix == 0)
|
||||||
data->humidity = bdata.humidity;
|
data->humidity = bdata.humidity;
|
||||||
else if(ix == 9)
|
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) {
|
||||||
index_9_detected = true;
|
//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);
|
} while(left > 0);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user