Put fix from leaflabs into Wire.cpp to replace my fix, and added stub function for setClockDivider into SPI.cpp and .h so that it compiles under 1.5.7

This commit is contained in:
Roger Clark 2014-11-23 18:57:59 +11:00
parent a2493c2c48
commit 8ea511cd48
3 changed files with 9 additions and 2 deletions

View File

@ -283,6 +283,11 @@ uint8 SPIClass::recv(void) {
return this->read();
}
/* Roger Clark. Added stub function so it will compile on 1.5.7 */
void SPIClass::setClockDivider(uint8_t rate)
{
}
/*
* Auxiliary functions
*/

View File

@ -243,6 +243,8 @@ public:
void beginTransaction(uint8_t pin, SPISettings settings);
void endTransaction(void);
static void setClockDivider(uint8_t); /* Roger Clark. Added stub function so it will compile on 1.5.7 */
/*
* I/O
*/

View File

@ -133,7 +133,7 @@ uint8 TwoWire::process() {
i2c_shift_out(sla_addr);
if (!i2c_get_ack())
{
set_scl(HIGH);// Roger Clark. 20141110 added to set clock high again, as it will be left in a low state otherwise
i2c_stop();// Roger Clark. 20141110 added to set clock high again, as it will be left in a low state otherwise
return ENACKADDR;
}
// Recieving
@ -156,7 +156,7 @@ uint8 TwoWire::process() {
i2c_shift_out(itc_msg.data[i]);
if (!i2c_get_ack())
{
set_scl(HIGH);// Roger Clark. 20141110 added to set clock high again, as it will be left in a low state otherwise
i2c_stop();// Roger Clark. 20141110 added to set clock high again, as it will be left in a low state otherwise
return ENACKTRNS;
}
itc_msg.xferred++;