use mbed os

Dependents:   Seeed_Grove_I2C_Touch_Example

Fork of MPR121 by Sam Grove

Revision:
6:b6bb38744edd
Parent:
5:3934358ec2b7
Parent:
4:c1bc00c5e8e5
Child:
9:8cb5ce483be3
Child:
10:fb2d2454fea4
--- a/MPR121.cpp	Fri Aug 15 23:00:13 2014 +0000
+++ b/MPR121.cpp	Fri Aug 15 23:04:08 2014 +0000
@@ -194,9 +194,9 @@
     uint8_t result = 0;
 
     result = _i2c->write(_i2c_addr, buf, 2);
-
-    if(result && DEBUG) {
-        debug("I2c write failed\n");
+    if(result && DEBUG)
+    {
+        debug("I2C write failed\n");
     }
 
     return;
@@ -208,10 +208,11 @@
     uint8_t result = 1;
 
     result &= _i2c->write(_i2c_addr, buf, 1, true);
-    result &= _i2c->read(_i2c_addr, &data, 1);
-
-    if(result && DEBUG) {
-        debug("I2c read failed\n");
+    result &= _i2c->read(_i2c_addr, &data, 1); 
+    
+    if(result && DEBUG)
+    {
+        debug("I2C read failed\n");
     }
 
     return data;