When using the APP_TIMER in SDK14 I am having a problem with the application stopping. I was using the APP_TIMER to flash LEDs and watch for timeouts in SDK13. when porting the code to SDK14 I am having a problem with the timer functions stopping. I have cut the functions down to the minimum for testing am still having the problem with both the APP_TIMER_MODE_REPEATED and APP_TIMER_MODE_SINGLE_SHOT.
I started with a repeated timer but changed to a single shot for testing. I increased the timer interval from 150 to 2000. I am also using the timer to trigger sensor a reading so the use of soft_led will not solve the issue.
I have been using the timer in SDK14 to watch for loss of signal while doing range testing and have had no problem using the timer in single mode and constantly resetting it, but there were very few timeout events.
on dev board: nrf52840-Preview-DK softdevice s140_nrf52840_6.0.0-6.alpha_softdevice.hex
setting up the timer
define LED_FLASH_TIME 2000
static void timers_init(void) {
ret_code_t err_code = app_timer_init();
APP_ERROR_CHECK(err_code);
err_code = app_timer_create(&low_gate_led_timer_id, APP_TIMER_MODE_SINGLE_SHOT,
&low_led_timer);
APP_ERROR_CHECK(err_code);
}
and the timer service routine
void low_led_timer(void * p_context) {
UNUSED_PARAMETER(p_context);
nrf_gpio_pin_toggle(GATE_DOWN_LED);
ret_code_t err_code = app_timer_start(low_gate_led_timer_id,LED_FLASH_TIME,NULL);
}