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

TWI in Soft Device

Hi,

when the micro go in:  idle_state_handle(); I have 2 possibility:

    // Wait for an event.
#ifdef SOFTDEVICE_PRESENT
    if (nrf_sdh_is_enabled())
    {
        ret_code_t ret_code = sd_app_evt_wait();
        ASSERT((ret_code == NRF_SUCCESS) || (ret_code == NRF_ERROR_SOFTDEVICE_NOT_ENABLED));
        UNUSED_VARIABLE(ret_code);
    }
    else
#endif // SOFTDEVICE_PRESENT
    {
        // Wait for an event.
        __WFE();
        // Clear the internal event register.
        __SEV();
        __WFE();
    }

If the soft device is present use the first instructions else the second.

This is correct, but why in the TWI, during reading or writing, the code use only the __WFE ?

    err_code = nrf_drv_twi_tx(&m_twi, ADPD144_ADDR, buff_OXY_TX, 1, false);

    //APP_ERROR_CHECK(err_code);
    do
    {
        __WFE();
    }while (m_xfer_done == false);

If the Soft device is enabled I expected to find something different from __WFE.

Is correct use __WFE with soft device in TWI ?

Marco

Parents Reply Children
No Data
Related