From 99f4961325087e3bfb45e26878415fd279beca1d Mon Sep 17 00:00:00 2001 From: Martin Kojtal <0xc0170@gmail.com> Date: Fri, 27 Oct 2017 17:46:24 +0100 Subject: [PATCH] ncs36510: fire interrupt correct timer fix Use Timer1, it is used for us ticker isr handling. Plus reset target counter, that should be 0, go to upper ticker isr handler immediately. --- targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_us_ticker_api.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_us_ticker_api.c b/targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_us_ticker_api.c index 75fa1b398bf..e0b07b9cbce 100644 --- a/targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_us_ticker_api.c +++ b/targets/TARGET_ONSEMI/TARGET_NCS36510/ncs36510_us_ticker_api.c @@ -130,7 +130,8 @@ uint32_t us_ticker_read() void us_ticker_fire_interrupt(void) { - NVIC_SetPendingIRQ(Tim0_IRQn); + us_ticker_target = 0; + NVIC_SetPendingIRQ(Tim1_IRQn); } /*******************************************************************************