mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Files at this revision

API Documentation at this revision

Comitter:
mbed_official
Date:
Mon Dec 14 08:45:10 2015 +0000
Parent:
36:fae6b962219e
Child:
38:a3b3bdc2ad2c
Commit message:
Synchronized with git revision eed91bce3bf5c845b4e99272116989b82f7bea99

Full URL: https://github.com/mbedmicro/mbed/commit/eed91bce3bf5c845b4e99272116989b82f7bea99/

Issue #666 LPC1768 i2c_slave_read fix

Changed in this revision

targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.c Show annotated file Show diff for this revision Revisions of this file
--- a/targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.c	Sun Dec 13 21:45:09 2015 +0000
+++ b/targets/hal/TARGET_NXP/TARGET_LPC176X/i2c_api.c	Mon Dec 14 08:45:10 2015 +0000
@@ -350,11 +350,18 @@
         count++;
     } while (((status == 0x80) || (status == 0x90) ||
             (status == 0x060) || (status == 0x70)) && (count < length));
-    
+ 
+    // Clear old status and wait for Serial Interrupt. 
+    i2c_clear_SI(obj);
+    i2c_wait_SI(obj);
+ 
+    // Obtain new status.
+    status = i2c_status(obj);
+ 
     if(status != 0xA0) {
         i2c_stop(obj);
     }
-    
+ 
     i2c_clear_SI(obj);
     
     return count;