implicit declaration of function

i have project app_ble_uart and i want add to it functin read from mpu6050 i add to Makefile Makefile pathes and add #include "mpu6050.h" and InitMPU6050(0x68); into main main.c but i have error

./../../main.c: In function 'main':
../../../main.c:653:5: error: implicit declaration of function 'InitMPU6050' [-Werror=implicit-function-declaration]
     InitMPU6050(0x68);
     ^~~~~~~~~~~
cc1.exe: all warnings being treated as errors
make: *** [_build/nrf52832_xxaa_main.c.o] Error 1
../../../../../../components/toolchain/gcc/Makefile.common:134: recipe for target '_build/nrf52832_xxaa_main.c.o' failed

What i do wrong?

Top Replies

Parents
  • Hi,

    Are you trying to include the MPU6050 driver that is present in the SDK? This driver does not have any functions with the name InitMPU6050. Try with mpu6050_init(0x68) instead.

    If you are trying to add another MPU6050 library, you need to include the path to the correct header files in your Makefile.

    Best regards,

    Jørgen

  • but i fix it and add new patchs into Makefile

      $(SDK_ROOT)/components/drivers_ext/mpu6050/mpu6050.c \
      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/twi_hw_master.c \
      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/twi_sw_master.c \
      $(SDK_ROOT)/components/libraries/uart/app_uart_fifo.c \
    

    and

      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/config \
      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated \
    

    and i have error

    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c: In function 'twi_master_write':
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:81:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 0;
                         ^~
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:83:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 1;
                         ^~
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c: In function 'twi_master_read':
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:154:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 0;
                         ^~
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:156:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 1;
                         ^~
    ../../../../../../components/toolchain/gcc/Makefile.common:134: recipe for target '_build/nrf52832_xxaa_twi_hw_master.c.o' failed
    make: *** [_build/nrf52832_xxaa_twi_hw_master.c.o] Error 1
    

    what i neуd to do?

Reply
  • but i fix it and add new patchs into Makefile

      $(SDK_ROOT)/components/drivers_ext/mpu6050/mpu6050.c \
      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/twi_hw_master.c \
      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/twi_sw_master.c \
      $(SDK_ROOT)/components/libraries/uart/app_uart_fifo.c \
    

    and

      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated/config \
      $(SDK_ROOT)/components/drivers_nrf/twi_master/deprecated \
    

    and i have error

    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c: In function 'twi_master_write':
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:81:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 0;
                         ^~
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:83:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 1;
                         ^~
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c: In function 'twi_master_read':
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:154:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 0;
                         ^~
    ../../../../../../components/drivers_nrf/twi_master/deprecated/twi_hw_master.c:156:21: error: 'NRF_TWI_Type {aka struct <anonymous>}' has no member named 'POWER'
                 NRF_TWI1->POWER        = 1;
                         ^~
    ../../../../../../components/toolchain/gcc/Makefile.common:134: recipe for target '_build/nrf52832_xxaa_twi_hw_master.c.o' failed
    make: *** [_build/nrf52832_xxaa_twi_hw_master.c.o] Error 1
    

    what i neуd to do?

Children
No Data
Related