mbed library sources
Dependents: frdm_kl05z_gpio_test
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/i2c_api.c
- Revision:
- 227:7bd0639b8911
- Parent:
- 215:83cf97a28428
- Child:
- 247:135e3186a638
diff -r b062af740e40 -r 7bd0639b8911 targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/i2c_api.c --- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/i2c_api.c Wed Jun 11 09:45:09 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L152RE/i2c_api.c Wed Jun 11 16:00:09 2014 +0100 @@ -27,13 +27,14 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************* */ +#include "mbed_assert.h" #include "i2c_api.h" #if DEVICE_I2C #include "cmsis.h" #include "pinmap.h" -#include "error.h" + /* Timeout values for flags and events waiting loops. These timeouts are not based on accurate values, they just guarantee that the application will @@ -61,10 +62,7 @@ I2CName i2c_scl = (I2CName)pinmap_peripheral(scl, PinMap_I2C_SCL); obj->i2c = (I2CName)pinmap_merge(i2c_sda, i2c_scl); - - if (obj->i2c == (I2CName)NC) { - error("I2C pin mapping failed"); - } + MBED_ASSERT(obj->i2c != (I2CName)NC); // Enable I2C clock if (obj->i2c == I2C_1) {