This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

about timer event

Hi. I'm using PCA10028, SDK10.0.0, S130.

I made timer(repeated) as below.

void init_timer(void) { uint32_t err_code; err_code = app_timer_create(&m_timer_id, APP_TIMER_MODE_REPEATED, one_msecond_timer_callback); APP_ERROR_CHECK(err_code);

err_code = app_timer_start(m_timer_id, APP_TIMER_TICKS(RTC_EVENT_INTERVAL_MS, RTC_PRESCALER), NULL);
APP_ERROR_CHECK(err_code);

}

It works well.

I called timer stop as below.

init_timer();
app_timer_stop_all();
for (;;)
{
	power_manage();
}

OK. Timer's event handler wasn't called. It looks well.

But in "power_manage" function. If I add gpio toggle function, it works. It's wierd.

static void power_manage(void) {

uint32_t err_code = sd_app_evt_wait();
nrf_gpio_pin_toggle(12);

APP_ERROR_CHECK(err_code);

}

I think, if i stop timer, "sd_app_evt_wait" function can't get any event. So this code never reach to "nrf_gpio_pin_toggle(12);" if there is no event.

As I see the result, event's still alive although I stop all timer.

Can you explain about this? I need your help.

  • That is strange.. it was not supposed to wakeup , what is the interval for the toggle? are you sure that there is nothing else in your application code that has wakeup capabilities? you are using just the timers in your app code and nothing else ?(apart from BLE activity)

    Which version of S130 are you using? v2.0.1?

Related