From 8ea511cd48f1ebcb2e3c660a89500f34582f5c3c Mon Sep 17 00:00:00 2001 From: Roger Clark Date: Sun, 23 Nov 2014 18:57:59 +1100 Subject: [PATCH] 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 --- STM32F1XX/libraries/SPI/src/SPI.cpp | 5 +++++ STM32F1XX/libraries/SPI/src/SPI.h | 2 ++ STM32F1XX/libraries/Wire/Wire.cpp | 4 ++-- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/STM32F1XX/libraries/SPI/src/SPI.cpp b/STM32F1XX/libraries/SPI/src/SPI.cpp index c61efa4..5ca9447 100644 --- a/STM32F1XX/libraries/SPI/src/SPI.cpp +++ b/STM32F1XX/libraries/SPI/src/SPI.cpp @@ -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 */ diff --git a/STM32F1XX/libraries/SPI/src/SPI.h b/STM32F1XX/libraries/SPI/src/SPI.h index 52951a2..981c8a7 100644 --- a/STM32F1XX/libraries/SPI/src/SPI.h +++ b/STM32F1XX/libraries/SPI/src/SPI.h @@ -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 */ diff --git a/STM32F1XX/libraries/Wire/Wire.cpp b/STM32F1XX/libraries/Wire/Wire.cpp index 9c16606..fb17da9 100644 --- a/STM32F1XX/libraries/Wire/Wire.cpp +++ b/STM32F1XX/libraries/Wire/Wire.cpp @@ -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++;