/* Read BMA222 temperature data. 
This function reads temperature data, where center temperature 24 C corresponds to a value 0x00 read from the temperature register with temperature slope 0.5 C/LSB. */
static bool bma222_get_temperature(sensor_hal_t *hal, sensor_data_t *data)
/* Read BMA222 temperature data. 
This function reads temperature data, where center temperature 24 C corresponds to a value 0x00 read from the temperature register with temperature slope 0.5 C/LSB. */
static bool bma222_get_temperature(sensor_hal_t *hal, sensor_data_t *data)
{
	int8_t const temp_data = (int8_t)sensor_bus_get(hal, BMA222_TEMP);
	if (data->scaled) {
		data->temperature.value = BMA222_TEMP_OFFSET + (temp_data / 2);
	} else {
		data->temperature.value = temp_data;
	}
	return (STATUS_OK == hal->bus.status);
}