From 7e222f2994e8831ce284b768ed937b267e80cc2d Mon Sep 17 00:00:00 2001 From: Przemyslaw Stekiel Date: Fri, 25 May 2018 12:55:54 +0200 Subject: [PATCH] NRF5x: Add bug fix for the first timer read. It has been noticed that first read value can not be trusted. --- targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c b/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c index 255c5394ef..30107554a5 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/us_ticker.c @@ -100,6 +100,9 @@ void us_ticker_init(void) nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_START); + /* Bug fix. First value can't be trusted. */ + nrf_timer_task_trigger(NRF_TIMER1, NRF_TIMER_TASK_CAPTURE1); + us_ticker_initialized = true; }