/* Get an uncompensated pressure (UP) reading. 
This routine gets a raw pressure sample reading from a Bosch BMP085 or BMP180 device. In the event of a sensor or bus error, a 32-bit value of -1 (all bits set) may be returned from this routine. */
static int32_t bmp_get_up(sensor_hal_t *hal)
/* Get an uncompensated pressure (UP) reading. 
This routine gets a raw pressure sample reading from a Bosch BMP085 or BMP180 device. In the event of a sensor or bus error, a 32-bit value of -1 (all bits set) may be returned from this routine. */
static int32_t bmp_get_up(sensor_hal_t *hal)
{
	int32_t UP = -1;
	uint8_t buff[3];
	sensor_bus_put(hal, BMP_CONTROL, BMP_PRESS_READ + (sensor_oss << 6));
	bmp_eoc_wait(hal);
	if (sensor_bus_read(hal, BMP_DATA_MSB, buff, sizeof(buff))) {
		UP = ((uint32_t)buff[0] << 16) | ((uint32_t)buff[1] << 8) | buff[2];
	}
	return (UP >> (8 - sensor_oss));
}