From b46bc68e96eb099b338c5ffd5ef9e1822a875cfd Mon Sep 17 00:00:00 2001 From: FredericG Date: Wed, 18 Aug 2010 10:04:55 +0000 Subject: [PATCH] "addr" field of I2C transaction struct now takes real I2C address, and not address that is pre-shifted to accommodate the R/W bit git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@1321 ebee16cc-31ac-478f-84a7-5cbb03baadba --- flight/OpenPilot/Modules/Osd/OsdEtStd/OsdEtStd.c | 2 +- flight/PiOS/STM32F10x/pios_i2c.c | 4 ++-- flight/PiOS/inc/pios_bmp085.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flight/OpenPilot/Modules/Osd/OsdEtStd/OsdEtStd.c b/flight/OpenPilot/Modules/Osd/OsdEtStd/OsdEtStd.c index 5aa759533..bea2dc023 100644 --- a/flight/OpenPilot/Modules/Osd/OsdEtStd/OsdEtStd.c +++ b/flight/OpenPilot/Modules/Osd/OsdEtStd/OsdEtStd.c @@ -962,7 +962,7 @@ static void Task(void* parameters) { const struct pios_i2c_txn txn_list[] = { { - .addr = 0x30<<1, + .addr = 0x30, .rw = PIOS_I2C_TXN_WRITE, .len = sizeof(msg), .buf = msg, diff --git a/flight/PiOS/STM32F10x/pios_i2c.c b/flight/PiOS/STM32F10x/pios_i2c.c index fd98fc465..dcc175872 100644 --- a/flight/PiOS/STM32F10x/pios_i2c.c +++ b/flight/PiOS/STM32F10x/pios_i2c.c @@ -338,7 +338,7 @@ static void go_r_any_txn_addr (struct pios_i2c_adapter * i2c_adapter) PIOS_DEBUG_Assert(i2c_adapter->active_txn->rw == PIOS_I2C_TXN_READ); - I2C_Send7bitAddress(i2c_adapter->cfg->regs, i2c_adapter->active_txn->addr, I2C_Direction_Receiver); + I2C_Send7bitAddress(i2c_adapter->cfg->regs, (i2c_adapter->active_txn->addr)<<1, I2C_Direction_Receiver); } static void go_r_more_txn_pre_one (struct pios_i2c_adapter * i2c_adapter) @@ -436,7 +436,7 @@ static void go_w_any_txn_addr (struct pios_i2c_adapter * i2c_adapter) PIOS_DEBUG_Assert(i2c_adapter->active_txn->rw == PIOS_I2C_TXN_WRITE); - I2C_Send7bitAddress(i2c_adapter->cfg->regs, i2c_adapter->active_txn->addr, I2C_Direction_Transmitter); + I2C_Send7bitAddress(i2c_adapter->cfg->regs, (i2c_adapter->active_txn->addr)<<1, I2C_Direction_Transmitter); } static void go_w_any_txn_middle (struct pios_i2c_adapter * i2c_adapter) diff --git a/flight/PiOS/inc/pios_bmp085.h b/flight/PiOS/inc/pios_bmp085.h index 4d2d75012..52d35e810 100644 --- a/flight/PiOS/inc/pios_bmp085.h +++ b/flight/PiOS/inc/pios_bmp085.h @@ -32,7 +32,7 @@ #define PIOS_BMP085_H /* BMP085 Addresses */ -#define BMP085_I2C_ADDR 0xEE +#define BMP085_I2C_ADDR 0x77 #define BMP085_CALIB_ADDR 0xAA #define BMP085_CALIB_LEN 22 #define BMP085_CTRL_ADDR 0xF4