From d1864050eb97c44862c83e5106174e89e1f28dde Mon Sep 17 00:00:00 2001 From: scipio Date: Mon, 1 Oct 2007 19:19:39 +0000 Subject: [PATCH] Assume 7-bit address is right-aligned. --- tos/chips/atm128/i2c/Atm128I2CMasterPacketP.nc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tos/chips/atm128/i2c/Atm128I2CMasterPacketP.nc b/tos/chips/atm128/i2c/Atm128I2CMasterPacketP.nc index 347853c6..e98fc7d1 100644 --- a/tos/chips/atm128/i2c/Atm128I2CMasterPacketP.nc +++ b/tos/chips/atm128/i2c/Atm128I2CMasterPacketP.nc @@ -322,10 +322,10 @@ implementation { } if (state == I2C_ADDR) { if (reading == TRUE) { - call I2C.write((packetAddr & 0xff) | ATM128_I2C_SLA_READ); + call I2C.write(((packetAddr & 0x7f) << 1)) | ATM128_I2C_SLA_READ); } else - call I2C.write((packetAddr & 0xff) | ATM128_I2C_SLA_WRITE); + call I2C.write(((packetAddr & 0x7f) << 1)) | ATM128_I2C_SLA_WRITE); state = I2C_DATA; call I2C.sendCommand(); } -- 2.39.2