]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Assume 7-bit address is right-aligned.
authorscipio <scipio>
Mon, 1 Oct 2007 19:19:39 +0000 (19:19 +0000)
committerscipio <scipio>
Mon, 1 Oct 2007 19:19:39 +0000 (19:19 +0000)
tos/chips/atm128/i2c/Atm128I2CMasterPacketP.nc

index 347853c60d81cd4d5a5dff7381a2cca1f18d6f59..e98fc7d19e4ab84debd2777e6adec8cfaacb7b2d 100644 (file)
@@ -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();
       }