mbed library sources

Dependents:   frdm_kl05z_gpio_test

Fork of mbed-src by mbed official

Revision:
247:135e3186a638
Parent:
227:7bd0639b8911
Child:
305:1f0269907d8b
--- a/targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/i2c_api.c	Tue Jul 01 06:15:07 2014 +0100
+++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_F103RB/i2c_api.c	Tue Jul 01 15:00:09 2014 +0100
@@ -139,8 +139,6 @@
     int count;
     int value;
 
-    if (length == 0) return 0;
-
     i2c_start(obj);
 
     // Send slave address for read
@@ -151,7 +149,7 @@
     while (I2C_CheckEvent(i2c, I2C_EVENT_MASTER_RECEIVER_MODE_SELECTED) == ERROR) {
         timeout--;
         if (timeout == 0) {
-            return 0;
+            return -1;
         }
     }
 
@@ -189,7 +187,7 @@
     while (I2C_CheckEvent(i2c, I2C_EVENT_MASTER_TRANSMITTER_MODE_SELECTED) == ERROR) {
         timeout--;
         if (timeout == 0) {
-            return 0;
+            return -1;
         }
     }
 
@@ -226,7 +224,7 @@
     while (I2C_GetFlagStatus(i2c, I2C_FLAG_RXNE) == RESET) {
         timeout--;
         if (timeout == 0) {
-            return 0;
+            return -1;
         }
     }