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

Incorrect ASSERT in nrf_drv_rtc_max_ticks_get()

The assert in the function below breaks the functionality when reliable is set to false (e.g. non SoftDevice code). It exists in (at least) SDK10 and SDK11. Remove the assert and the function works as expected.

uint32_t
nrf_drv_rtc_max_ticks_get(nrf_drv_rtc_t const * const p_instance) {
    ASSERT(m_cb[p_instance->instance_id].reliable);
    uint32_t ticks;
    if (m_cb[p_instance->instance_id].reliable)
    {
        ticks = RTC_COUNTER_COUNTER_Msk - m_cb[p_instance->instance_id].tick_latency;
    }
    else
    {
        ticks = RTC_COUNTER_COUNTER_Msk;
    }
    return ticks; 
}
Parents Reply Children
No Data
Related