Hi Dialog Team,
I am using 3 timers in my ble_app_peripheral project. Initially, I start a systick timer of duration 2ms, then in the callback of systick timer, I start a kernel timer by using the api app_easy_timer(), of 100ms. I continue calling this function, and upto this point the project works fine. Now, when I call another kernel timer of 5 seconds as follows, device execution stops abruptly. This is the code I am using :
systick_register_callback(handle_2ms_timer);
void abc (void)
{
.....
systick_start(2000,1);
}
void handle_2ms_timer(void)
{
systick_stop();
listen_interval = 50;
timer_listen_interval = app_easy_timer((listen_interval*10),handle_listen_interval_timer);
user_adv();
}
void user_adv()
{
struct gapm_start_advertise_cmd* cmd;
cmd = app_easy_gap_non_connectable_advertise_get_active();
set_parser_data();
set_beacon_data(cmd);
app_easy_gap_non_connectable_advertise_start();
timer_adv_interval = app_easy_timer((adv_interval*10),handle_adv_interval_timer);
}
The execution doesnt reach the callback handler of either kernel timers.
When just 2 timers, systick and adv_interval_timer are called, device functioning is fine. Problem starts when I am introducing a second kernel timer concurrently.
Thanks in advance,
wisilica
Hi wisilica,
There is no issue in setting two kernel timers at the same time, few things that you should keep in mind is:
When you say that your code execution stops, where is it stopping ?
Thanks MT_dialog
Hi Dialog,
I have found that the time duration I am setting for both the timers are the same. Is this the reason why the device execution stops? If I am setting different time duration for both the timers, the execution doesnt stop.
Thanks,
Wisilica
Hi wisilica,
No, this should not happen, you will have to check exactly where the code stalls, in which function, in order to see why this is happening.
Thanks MT_dialog