Skip to content

Commit 32df297

Browse files
author
Marti Bolivar
committed
Revert "Added I2C slave echo example in examples folder. Using another maple, write a byte and then read."
This reverts commit 5947249. Reverting pull request #54, which breaks examples/i2c-mcp4725-dac.cpp. Signed-off-by: Marti Bolivar <[email protected]>
1 parent 3b2ce8a commit 32df297

File tree

4 files changed

+6
-121
lines changed

4 files changed

+6
-121
lines changed

CREDITS

+6-6
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ E: [email protected]
1818
D: Current libmaple maintainer
1919
D: Random libmaple hacks
2020

21-
N: Barry Carter ("ginge")
22-
23-
D: Added I2C slave support
24-
W: headfuzz.co.uk
25-
2621
N: Anton Eltchaninov
2722
2823
D: STM32F1 value line support
@@ -86,4 +81,9 @@ W: http://sarup.dk/index.html
8681
N: Andy Scott ("xttocs")
8782
8883
D: LiquidCrystal library
89-
84+
85+
N: Barry Carter ("ginge")
86+
87+
D: Added i2C slave support
88+
W: headfuzz.co.uk
89+

examples/i2c_slave_example.cpp

-110
This file was deleted.

libmaple/i2c.c

-4
Original file line numberDiff line numberDiff line change
@@ -458,10 +458,6 @@ void _i2c_irq_handler(i2c_dev *dev) {
458458
if (sr1 & I2C_SR1_RXNE) {
459459
if (dev->config_flags & I2C_SLAVE_USE_RX_BUFFER) {
460460
/* Fill the buffer with the contents of the data register */
461-
/* These is potential for buffer overflow here, so we should
462-
* really store the size of the array. This is expensive in
463-
* the ISR so left out for now. We must trust the implementor!
464-
*/
465461
dev->i2c_slave_msg->data[dev->i2c_slave_msg->xferred++] = dev->regs->DR;
466462
dev->i2c_slave_msg->length++;
467463
}

libmaple/include/libmaple/i2c.h

-1
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,6 @@ typedef struct i2c_msg {
210210
#define I2C_SLAVE_DUAL_ADDRESS 0x40 // Enable the dual slave address scheme
211211
#define I2C_SLAVE_GENERAL_CALL 0x80 // Enable the general call on address 0x00
212212
void i2c_master_enable(i2c_dev *dev, uint32 flags);
213-
void i2c_slave_enable(i2c_dev *dev, uint32 flags);
214213

215214
#define I2C_ERROR_PROTOCOL (-1)
216215
#define I2C_ERROR_TIMEOUT (-2)

0 commit comments

Comments
 (0)