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

When EVENTS_ERROR become True ?

Hi. I have troubles. I'm using nRF52 DK and V0.9.0. I'm making program that does TWI communication between MPU9250 what is 9-axis sensor. error is false every time. When it become True? Please help me!

static bool twi_action_wait(nrf_drv_twi_t const * const p_instance)
{
    bool     *error*;
    bool     done;
    uint32_t timeout = 0;
    volatile transfer_t * p_transfer = &(m_cb[p_instance->instance_id].transfer);

    do
    {
        done  = nrf_twi_event_check(p_instance->p_reg, p_transfer->end_event);
        *error* = nrf_twi_event_check(p_instance->p_reg, NRF_TWI_EVENTS_ERROR);
        *error* |= (++timeout < BUSY_LOOP_TIMEOUT) ? false : true;
    } while (!(*error* | done));
    return !*error*;
}

//Question Update at 2/29. It's my program.******************** TWI_main.c

//Question Update at 3/8. It's MPU9150 program.******************** main.c

Parents Reply Children
No Data
Related