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

error: incompatible type for argument 3 of 'lps22hb_data_read'

I'm trying to get readings from an LPS22HB sensor with the nrf52810 using the lps22hb driver in SDK 17.0.2_d674dde.

NRF_TWI_MNGR_DEF(m_nrf_twi_mngr, MAX_PENDING_TRANSACTIONS, TWI_INSTANCE_ID);
NRF_TWI_SENSOR_DEF(m_twi_sensor, &m_nrf_twi_mngr, 128);
LPS22HB_INSTANCE_DEF(m_lps22b, &m_twi_sensor, TWI_ADDRESS);

lps22hb_data_t baro_data;

int main(void) {

//other code removed
    lps22hb_init(&m_lps22b);
    lps22hb_data_read(&m_lps22b,&barometer_callback,baro_data,1);
    
    // Enter main loop.
    for (;;)
    {
        idle_state_handle();
    }
    
}
The lps22hb_init() call completes without any errors, but when I add the call to lps22hb_data_read() I get a compilation error:

../../../main.c: In function 'main':
../../../main.c:1513:53: error: incompatible type for argument 3 of 'lps22hb_data_read'
     lps22hb_data_read(&m_lps22b,&barometer_callback,baro_data,1);
                                                     ^~~~~~~~~
In file included from ../../../main.c:94:0:
../../../../../../components/drivers_ext/lps22hb/lps22hb.h:314:12: note: expected 'lps22hb_data_t * {aka struct <anonymous> *}' but argument is of type 'lps22hb_data_t {aka struct <anonymous>}'
 ret_code_t lps22hb_data_read(lps22hb_instance_t *       p_instance,
            ^~~~~~~~~~~~~~~~~
make: *** [../../../../../../components/toolchain/gcc/Makefile.common:272: _build/nrf52810_xxaa/main.c.o] Error 1

Any ideas on why we're getting this error?

Related