Modified Hardware with patch file from timschuerewegen, which addresses isues with the hardware Wire constructor
This commit is contained in:
parent
05130a7db9
commit
4fc5bbe8a8
|
@ -57,10 +57,13 @@ HardWire::HardWire(uint8 dev_sel, uint8 flags) {
|
||||||
ASSERT(1);
|
ASSERT(1);
|
||||||
}
|
}
|
||||||
dev_flags=flags;
|
dev_flags=flags;
|
||||||
i2c_master_enable(sel_hard, flags);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HardWire::~HardWire() {
|
HardWire::~HardWire() {
|
||||||
i2c_disable(sel_hard);
|
i2c_disable(sel_hard);
|
||||||
sel_hard = 0;
|
sel_hard = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HardWire::begin(uint8 self_addr) {
|
||||||
|
i2c_master_enable(sel_hard, dev_flags);
|
||||||
|
}
|
||||||
|
|
|
@ -64,6 +64,8 @@ public:
|
||||||
* Disables the I2C device and remove the device address.
|
* Disables the I2C device and remove the device address.
|
||||||
*/
|
*/
|
||||||
~HardWire();
|
~HardWire();
|
||||||
|
|
||||||
|
void begin(uint8 = 0x00);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _HARDWIRE_H_
|
#endif // _HARDWIRE_H_
|
||||||
|
|
Loading…
Reference in New Issue