mbed library sources

Dependents:   Encrypted my_mbed lklk CyaSSL_DTLS_Cellular ... more

Superseded

This library was superseded by mbed-dev - https://os.mbed.com/users/mbed_official/code/mbed-dev/.

Development branch of the mbed library sources. This library is kept in synch with the latest changes from the mbed SDK and it is not guaranteed to work.

If you are looking for a stable and tested release, please import one of the official mbed library releases:

Import librarymbed

The official Mbed 2 C/C++ SDK provides the software platform and libraries to build your applications.

Revision:
598:2d5fc5624619
Parent:
395:bfce16e86ea4
--- a/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c	Mon Jul 27 09:45:08 2015 +0100
+++ b/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/i2c_api.c	Wed Jul 29 09:45:09 2015 +0100
@@ -17,6 +17,7 @@
 #include "i2c_api.h"
 #include "cmsis.h"
 #include "pinmap.h"
+#include "twi_master.h"
 #include "mbed_error.h"
 
 // nRF51822's I2C_0 and SPI_0 (I2C_1, SPI_1 and SPIS1) share the same address.
@@ -53,7 +54,8 @@
 
 void i2c_init(i2c_t *obj, PinName sda, PinName scl)
 {
-    NRF_TWI_Type *i2c;
+    twi_master_init_and_clear();
+    NRF_TWI_Type *i2c = NULL;
   
     if (i2c0_spi0_peripheral.usage == I2C_SPI_PERIPHERAL_FOR_I2C &&
             i2c0_spi0_peripheral.sda_mosi == (uint8_t)sda &&