From e0c628cbb76623f3184265e0c0f24fc10f78fd45 Mon Sep 17 00:00:00 2001 From: Hugues Kamba Date: Fri, 20 Dec 2019 14:55:47 +0000 Subject: [PATCH] NRF51822: Fix baremetal linker error Ensure the NRF51822 `us_ticker.c` module content is compiled in only if the target supports USTICKER. --- targets/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c | 3 +++ targets/targets.json | 9 +++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c b/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c index da10954257d..eb916c0e8cf 100644 --- a/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c +++ b/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/us_ticker.c @@ -13,6 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +#if DEVICE_USTICKER #include #include #include "us_ticker_api.h" @@ -613,3 +615,4 @@ uint32_t os_tick_val(void) { return clock_cycles_by_tick - ((current_counter - next_tick_cc_value) % clock_cycles_by_tick); } } +#endif // DEVICE_USTICKER diff --git a/targets/targets.json b/targets/targets.json index 2f3823f2228..c6f9556404d 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -5043,8 +5043,13 @@ "SERIAL", "SLEEP", "SPI", - "SPISLAVE" - ] + "SPISLAVE", + "USTICKER" + ], + "overrides": { + "tickless-from-us-ticker" : true, + "boot-stack-size" : "0x400" + } }, "MCU_NRF51_16K_BASE": { "inherits": ["MCU_NRF51"],