NRF5x: Remove duplicate lp ticker initialization from I2C, flash, trng.

pull/7172/head
Przemyslaw Stekiel 2018-05-23 13:25:41 +02:00
parent e5e53e5e48
commit ccba52b45b
5 changed files with 3 additions and 10 deletions

View File

@ -72,7 +72,6 @@ int32_t flash_init(flash_t *obj)
if (first_init) {
first_init = false;
lp_ticker_init();
}
return 0;

View File

@ -39,7 +39,7 @@
#include "i2c_api.h"
#if DEVICE_I2C
#if (defined(DEVICE_I2C) && defined(DEVICE_LPTICKER))
#include "mbed_assert.h"
#include "mbed_error.h"

View File

@ -73,7 +73,6 @@ void trng_init(trng_t *obj)
if (first_init) {
first_init = false;
lp_ticker_init();
}
}

View File

@ -36,7 +36,7 @@
*
*/
#if DEVICE_FLASH
#if (defined(DEVICE_FLASH) && defined(DEVICE_LPTICKER))
#include "hal/flash_api.h"
#include "hal/lp_ticker_api.h"
@ -84,8 +84,6 @@ int32_t flash_init(flash_t *obj)
result = nrf_fstorage_init(&nordic_fstorage, &nrf_fstorage_nvmc, NULL);
#endif
/* Initialize low power ticker for timeouts. */
lp_ticker_init();
}
/* Convert Nordic SDK error code to mbed HAL. */

View File

@ -36,8 +36,7 @@
*
*/
#if DEVICE_I2C
#if (defined(DEVICE_I2C) && defined(DEVICE_LPTICKER))
/* I2C
*
* This HAL implementation uses the nrf_drv_twi.h API primarily but switches to TWI for the
@ -131,8 +130,6 @@ void i2c_init(i2c_t *obj, PinName sda, PinName scl)
if (first_init) {
first_init = false;
/* Initialize low power ticker. Used for timeouts. */
lp_ticker_init();
/* Register interrupt handlers in driver with the NVIC. */
NVIC_SetVector(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, (uint32_t) SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler);