Skip to content

Commit ccba52b

Browse files
committed
NRF5x: Remove duplicate lp ticker initialization from I2C, flash, trng.
1 parent e5e53e5 commit ccba52b

File tree

5 files changed

+3
-10
lines changed

5 files changed

+3
-10
lines changed

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/flash_api.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ int32_t flash_init(flash_t *obj)
7272

7373
if (first_init) {
7474
first_init = false;
75-
lp_ticker_init();
7675
}
7776

7877
return 0;

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/i2c_api.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#include "i2c_api.h"
4141

42-
#if DEVICE_I2C
42+
#if (defined(DEVICE_I2C) && defined(DEVICE_LPTICKER))
4343

4444
#include "mbed_assert.h"
4545
#include "mbed_error.h"

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF51/trng_api.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ void trng_init(trng_t *obj)
7373

7474
if (first_init) {
7575
first_init = false;
76-
lp_ticker_init();
7776
}
7877
}
7978

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/flash_api.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
*
3737
*/
3838

39-
#if DEVICE_FLASH
39+
#if (defined(DEVICE_FLASH) && defined(DEVICE_LPTICKER))
4040

4141
#include "hal/flash_api.h"
4242
#include "hal/lp_ticker_api.h"
@@ -84,8 +84,6 @@ int32_t flash_init(flash_t *obj)
8484
result = nrf_fstorage_init(&nordic_fstorage, &nrf_fstorage_nvmc, NULL);
8585
#endif
8686

87-
/* Initialize low power ticker for timeouts. */
88-
lp_ticker_init();
8987
}
9088

9189
/* Convert Nordic SDK error code to mbed HAL. */

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/i2c_api.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
*
3737
*/
3838

39-
#if DEVICE_I2C
40-
39+
#if (defined(DEVICE_I2C) && defined(DEVICE_LPTICKER))
4140
/* I2C
4241
*
4342
* 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)
131130

132131
if (first_init) {
133132
first_init = false;
134-
/* Initialize low power ticker. Used for timeouts. */
135-
lp_ticker_init();
136133

137134
/* Register interrupt handlers in driver with the NVIC. */
138135
NVIC_SetVector(SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQn, (uint32_t) SPIM0_SPIS0_TWIM0_TWIS0_SPI0_TWI0_IRQHandler);

0 commit comments

Comments
 (0)