This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

What have changed on multiprotocol/ble_app_gzll example between SDK14.0 and SDK14.2?

FormerMember
FormerMember

Hello, I use the pca10040 and the problem is in 14.0 eaxmple,when I push the button switch the protocol mode like : ble->gzll->ble and then I find the example loop into this function:

static void expired_timers_handler(uint32_t         ticks_elapsed,
                                   uint32_t         ticks_previous,
                                   timer_node_t **  p_restart_list_head)
{
    uint32_t ticks_expired = 0;

while (mp_timer_id_head != NULL)
{
    timer_node_t * p_timer;
    timer_node_t * p_timer_expired;

    // Auto variable for current timer node.
    p_timer = mp_timer_id_head;

    // Do nothing if timer did not expire
    if (ticks_elapsed < p_timer->ticks_to_expire)
    {
        p_timer->ticks_to_expire -= ticks_elapsed;
        break;
    }

    // Decrement ticks_elapsed and collect expired ticks.
    ticks_elapsed -= p_timer->ticks_to_expire;
    ticks_expired += p_timer->ticks_to_expire;

    // Timer expired, set ticks_to_expire zero.
    p_timer->ticks_to_expire = 0;

    // Remove the expired timer from head.
    p_timer_expired  = mp_timer_id_head;
    mp_timer_id_head = p_timer->next;

    // Timer will be restarted if periodic.
    if (p_timer->ticks_periodic_interval != 0)
    {
        p_timer->ticks_at_start       = (ticks_previous + ticks_expired) & MAX_RTC_COUNTER_VAL;
        p_timer->ticks_first_interval = p_timer->ticks_periodic_interval;
        p_timer->next                 = *p_restart_list_head;
        *p_restart_list_head          = p_timer_expired;
    }
    }
}

But when I use the example in the SDK14.2 it never happens. All I to do is just run the two examples without changing anything.And I just want to know why in sdk14.2 the problem has solved. Thank you.

Parents
  • FormerMember
    0 FormerMember

    Hi,Hung Bui. There is no error code reported from the logging.And the behavior of the error is that the mp_timer_id_head value condition never be NULL and the break point at the end of the function will never reached.The comment bellow has the debug info about this value. To reproduce the error is only switching the mode from ble to gazell and gazell to ble for one or two times and the problem is always ocurred by switching gazell mode to ble mode.

Reply
  • FormerMember
    0 FormerMember

    Hi,Hung Bui. There is no error code reported from the logging.And the behavior of the error is that the mp_timer_id_head value condition never be NULL and the break point at the end of the function will never reached.The comment bellow has the debug info about this value. To reproduce the error is only switching the mode from ble to gazell and gazell to ble for one or two times and the problem is always ocurred by switching gazell mode to ble mode.

Children
No Data
Related