/* Get a temperature sensor sample. 
If scaled data format is selected for the device, this routine gets a compensated "true temperature" sample. Otherwise, a raw uncompensated temperature reading is returned in "data". */
static bool bmp_get_temperature(sensor_hal_t *hal, sensor_data_t *data)
/* Get a temperature sensor sample. 
If scaled data format is selected for the device, this routine gets a compensated "true temperature" sample. Otherwise, a raw uncompensated temperature reading is returned in "data". */
static bool bmp_get_temperature(sensor_hal_t *hal, sensor_data_t *data)
{
	int32_t const UT = bmp_get_ut(hal);
	if (false == data->scaled) {
		data->temperature.value = UT;
	} else {
		int32_t const x1 = ((UT - AC6) * AC5) >> 15;
		int32_t const x2 = ((int32_t)Mc << 11) / (x1 + Md);
		data->temperature.value = ((x1 + x2) + 8) >> 4;
	}
	return true;
}