From 8bbe5268a0c12d02683fd01a9dc08031bbc7f1c3 Mon Sep 17 00:00:00 2001 From: Freek van Tienen Date: Thu, 8 May 2014 20:08:17 +0200 Subject: [PATCH] [bmp085] Fix calibration reading with errors --- sw/airborne/peripherals/bmp085.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sw/airborne/peripherals/bmp085.c b/sw/airborne/peripherals/bmp085.c index 2c123ef592..061d2701d2 100644 --- a/sw/airborne/peripherals/bmp085.c +++ b/sw/airborne/peripherals/bmp085.c @@ -72,7 +72,7 @@ static bool_t bmp085_eoc_true(void) void bmp085_read_eeprom_calib(struct Bmp085* bmp) { - if (bmp->status == BMP085_STATUS_UNINIT) { + if (bmp->status == BMP085_STATUS_UNINIT && bmp->i2c_trans.status == I2CTransDone) { bmp->initialized = FALSE; bmp->i2c_trans.buf[0] = BMP085_EEPROM_AC1; i2c_transceive(bmp->i2c_p, &(bmp->i2c_trans), bmp->i2c_trans.slave_addr, 1, 22);