event void I2CResource.granted() {
if (read) {
- call I2CPacket.write(I2C_START,devAddr,1,mI2CBuffer);
+ call I2CPacket.write(I2C_START | I2C_STOP,devAddr,1,mI2CBuffer);
} else {
- call I2CPacket.write((I2C_START | I2C_STOP),devAddr,2,mI2CBuffer);
+ call I2CPacket.write(I2C_START | I2C_STOP,devAddr,2,mI2CBuffer);
}
}
}
implementation {
- components new SoftI2CBatteryMonitorRTCC() as I2C;
+ components new SoftwareI2C2C() as I2C;
components new HplDS2782LogicP(0x68) as Logic;
Logic.I2CPacket -> I2C;
implementation
{
components RV8564P as RTCP,
- new SoftI2CBatteryMonitorRTCC() as I2C,
+ new SoftwareI2C2C() as I2C,
HplM16c62pGeneralIOC as IOs,
HplM16c62pInterruptC as Irqs,
new M16c62pInterruptC() as Irq;
atomic {
if (state == READING)
{
- call I2C.write(I2C_START, RV8564_ADDR, 1, &read_register);
+ call I2C.write(I2C_START | I2C_STOP, RV8564_ADDR, 1, &read_register);
}
else if (state == WRITING)
{