aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormlundinse <lundin@mlu.mine.nu>2013-08-30 19:19:17 +0200
committermlundinse <lundin@mlu.mine.nu>2013-08-30 19:19:17 +0200
commitee20db06b5116fbaa7bbdfa7a3db9402e85e0c30 (patch)
treeee27012648d723d50bc9de83b2ee89436dce0412
parentd5139323aa5322202261f898113c24b913538c06 (diff)
Handle i2c slave bug (quick fix)
Quick fix for i2c master / slave problems
-rw-r--r--libmaple/i2c.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmaple/i2c.c b/libmaple/i2c.c
index bbbf123..5000cf7 100644
--- a/libmaple/i2c.c
+++ b/libmaple/i2c.c
@@ -348,8 +348,8 @@ void _i2c_irq_handler(i2c_dev *dev) {
* Add Slave support
*/
- /* Check to see if MSL master slave bit is set */
- if ((sr2 & I2C_SR2_MSL) != I2C_SR2_MSL) { /* 0 = slave mode 1 = master */
+ /* Check to see if that a master transfer is not active */
+ if (dev->state != I2C_STATE_BUSY) { /* Master Xfer and no place else sets I2C_STATE_BUSY */
/* Check for address match */
if (sr1 & I2C_SR1_ADDR) {