Modified Hardware with patch file from timschuerewegen, which addresses isues with the hardware Wire constructor

This commit is contained in:
Roger Clark 2015-02-22 14:58:48 +11:00
parent 05130a7db9
commit 4fc5bbe8a8
2 changed files with 6 additions and 1 deletions

View File

@ -57,10 +57,13 @@ HardWire::HardWire(uint8 dev_sel, uint8 flags) {
ASSERT(1);
}
dev_flags=flags;
i2c_master_enable(sel_hard, flags);
}
HardWire::~HardWire() {
i2c_disable(sel_hard);
sel_hard = 0;
}
void HardWire::begin(uint8 self_addr) {
i2c_master_enable(sel_hard, dev_flags);
}

View File

@ -64,6 +64,8 @@ public:
* Disables the I2C device and remove the device address.
*/
~HardWire();
void begin(uint8 = 0x00);
};
#endif // _HARDWIRE_H_