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

Including C++ library in C project?

Hi Nordic,

I want to include this library (github.com/.../MPU6050.cpp) in my project, which is an evolution from ant_ broadcast example, in C. However, and after reading several related posts, I am not able to compile my project when I add this library. Can anyone give me some support with this? Otherwise I would have to re-write the whole library in C, and this task is not an easy one..

Thanks a lot for your help!

EDIT: I can properly do, with my own C library, reads of all the registers in MPU6050. What I cannot do is use the DMP at all, and I want the acceleration with no gravity, which can only be done if you mix data from accelerometer and gyroscope and do some kind of filtering. The DMP does it internally, but the library I referred to is needed.

Parents
  • If I put .cpp in the main file, and --cpp11 instead of --c99, I get more errors, look:

    *** Using Compiler 'V5.06 update 4 (build 422)', folder: 'F:\Programs\ARM\ARMCC\Bin' Rebuild target 'nrf51422_xxac' compiling ant_stack_config.c... ............\components\ant\ant_stack_config\ant_stack_config.c(41): error: #29: expected an expression .ucTotalNumberOfChannels = ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED, ............\components\ant\ant_stack_config\ant_stack_config.c(42): error: #29: expected an expression .ucNumberOfEncryptedChannels = ANT_CONFIG_ENCRYPTED_CHANNELS, ............\components\ant\ant_stack_config\ant_stack_config.c(43): error: #29: expected an expression .pucMemoryBlockStartLocation = ant_stack_buffer.u8, ............\components\ant\ant_stack_config\ant_stack_config.c(44): error: #29: expected an expression .usMemoryBlockByteSize = ANT_BUFFER_SIZE_FOR_SD ............\components\ant\ant_stack_config\ant_stack_config.c(32): warning: #177-D: variable "ant_stack_buffer" was declared but never referenced }ant_stack_buffer; /*!< Memory buffer provided in order to support channel configuration */ ............\components\ant\ant_stack_config\ant_stack_config.c: 1 warning, 4 errors compiling ant_channel_config.c... compiling nrf_drv_gpiote.c... ............\components\drivers_nrf\gpiote\nrf_drv_gpiote.c(120): error: #20: identifier "UINT32_MAX" is undefined if (m_cb.handlers[i] == ORBIDDEN_HANDLER_ADDRESS) ............\components\drivers_nrf\gpiote\nrf_drv_gpiote.c(133): error: #20: identifier "UINT32_MAX" is undefined m_cb.handlers[channel_id] = ORBIDDEN_HANDLER_ADDRESS; ............\components\drivers_nrf\gpiote\nrf_drv_gpiote.c: 0 warnings, 2 errors compiling nrf_delay.c... compiling nrf_drv_common.c... compiling nrf_drv_twi.c... ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(238): warning: #550-D: variable "evt_found" was set but never used bool evt_found = false; ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(604): error: #20: identifier "UINT32_MAX" is undefined nrf_twi_shorts_clear(p_instance->p_reg, ISABLE_MASK); ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(636): error: #20: identifier "UINT32_MAX" is undefined nrf_twi_int_disable(p_instance->p_reg, ISABLE_MASK); ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(709): error: #29: expected an expression .type = NRF_DRV_TWI_ERROR, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(710): error: #29: expected an expression .p_data = p_transfer->p_data, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(711): error: #29: expected an expression .length = p_transfer->count, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(713): error: #29: expected an expression .error_src = (nrf_twi_error_source_get(p_reg) & ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(724): error: #29: expected an expression .type = p_transfer->is_tx ? NRF_DRV_TWI_TX_DONE : NRF_DRV_TWI_RX_DONE, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(725): error: #29: expected an expression .p_data = p_transfer->p_data, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(726): error: #29: expected an expression .length = p_transfer->count, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c: 1 warning, 13 errors compiling main.cpp... ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ....\main.cpp(164): error: #29: expected an expression .channel_number = ANT_ACK_CHANNEL_NUMBER, ....\main.cpp(165): error: #29: expected an expression .channel_type = CHANNEL_TYPE_MASTER, ....\main.cpp(166): error: #29: expected an expression .ext_assign = EXT_ASSIGN_NONE, ....\main.cpp(167): error: #29: expected an expression .rf_freq = ANT_FREQUENCY, ....\main.cpp(168): error: #29: expected an expression .transmission_type = ANT_ACK_TRANSMISSION_TYPE, ....\main.cpp(169): error: #29: expected an expression .device_type = ANT_ACK_DEVICE_TYPE, ....\main.cpp(170): error: #29: expected an expression .device_number = device_id, ....\main.cpp(171): error: #29: expected an expression .channel_period = ANT_CHANNEL_PERIOD, ....\main.cpp(172): error: #29: expected an expression .network_number = ANT_NETWORK_NUMBER, ....\main.cpp(159): warning: #550-D: variable "device_id" was set but never used uint16_t device_id; ....\main.cpp(385): error: #20: identifier "MPU6050_getMotion6" is undefined MPU6050_getMotion6(&ax, &ay, &az, &gx, &gy, &gz); ....\main.cpp(392): warning: #177-D: variable "err_code" was declared but never referenced ret_code_t err_code; ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(559): error: #20: identifier "MPU6050_initialize" is undefined MPU6050_initialize(); ....\main.cpp(85): warning: #177-D: variable "p_random_byte" was declared but never referenced static uint8_t * p_random_byte; ....\main.cpp(86): warning: #177-D: variable "random_byte" was declared but never referenced static uint8_t random_byte; ....\main.cpp(110): warning: #550-D: variable "payload" was set but never used static uint8_t payload[(uint8_t)8]; ....\main.cpp(118): warning: #177-D: function "ant_message_send" was declared but never referenced static void ant_message_send(const uint8_t CHANNEL_NUMBER, uint8_t payload) ....\main.cpp(139): warning: #177-D: function "flash_store_p_data" was declared but never referenced static void flash_store_p_data(void) // just in case we need it ....\main.cpp: 8 warnings, 19 errors compiling app_button.c... ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c: 0 warnings, 4 errors compiling bsp.c... compiling nrf_assert.c... compiling app_timer.c... ............\components\libraries\timer\app_timer.c(250): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_current = p_current->next; ............\components\libraries\timer\app_timer.c(287): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_current = p_current->next; ............\components\libraries\timer\app_timer.c(299): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" mp_timer_id_head = mp_timer_id_head->next; ............\components\libraries\timer\app_timer.c(317): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_current = p_previous->next; ............\components\libraries\timer\app_timer.c(396): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_timer = p_timer->next; ............\components\libraries\timer\app_timer.c(507): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" mp_timer_id_head = p_head->next; ............\components\libraries\timer\app_timer.c(952): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_user_t *" mp_users = p_buffer; ............\components\libraries\timer\app_timer.c(965): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_user_op_t " p_user->p_user_op_queue = p_buffer; ............\components\libraries\timer\app_timer.c: 0 warnings, 10 errors compiling app_error.c... assembling arm_startup_nrf51.s... compiling softdevice_handler.c... compiling i2cdev.c... ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.c(30): error: #29: expected an expression .scl = SCL_PIN, ............\components\drivers_ext\i2cdev\i2cdev.c(31): error: #29: expected an expression .sda = SDA_PIN, ............\components\drivers_ext\i2cdev\i2cdev.c(32): error: #29: expected an expression .frequency = NRF_TWI_FREQ_400K, ............\components\drivers_ext\i2cdev\i2cdev.c(33): error: #29: expected an expression .interrupt_priority = APP_IRQ_PRIORITY_HIGH ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.h(1038): warning: #1-D: last line of file ends without a newline #endif / MPU6050_H */ ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3045): error: #20: identifier "malloc" is undefined if (verify) verifyBuffer = (uint8_t *)malloc( PU6050_DMP_MEMORY_CHUNK_SIZE); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3046): error: #20: identifier "malloc" is undefined if (useProgMem) progBuffer = (uint8_t *)malloc( PU6050_DMP_MEMORY_CHUNK_SIZE); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3059): error: #20: identifier "pgm_read_byte" is undefined for (j = 0; j < chunkSize; j++) progBuffer[j] = pgm_read_byte(data + i + j); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3065): error: #20: identifier "i2c_write_bytes" is undefined i2c_write_bytes(devAddr, PU6050_RA_MEM_R_W, chunkSize, progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3072): error: #20: identifier "memcmp" is undefined if (memcmp(progBuffer, verifyBuffer, chunkSize) != 0) { ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3090): error: #20: identifier "free" is undefined free(verifyBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3109): error: #20: identifier "free" is undefined if (verify) free(verifyBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3110): error: #20: identifier "free" is undefined if (useProgMem) free(progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3121): error: #20: identifier "malloc" is undefined progBuffer = (uint8_t *)malloc(8); // assume 8-byte blocks, realloc later if necessary ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3129): error: #20: identifier "pgm_read_byte" is undefined bank = pgm_read_byte(data + i++); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3148): error: #20: identifier "realloc" is undefined if (sizeof(progBuffer) < length) progBuffer = (uint8_t *)realloc(progBuffer, length); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3149): error: #20: identifier "pgm_read_byte" is undefined for (j = 0; j < length; j++) progBuffer[j] = pgm_read_byte(data + i + j); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3162): error: #20: identifier "pgm_read_byte" is undefined special = pgm_read_byte(data + i++); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3185): error: #20: identifier "free" is undefined if (useProgMem) free(progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3189): error: #20: identifier "free" is undefined if (useProgMem) free(progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp: 1 warning, 18 errors compiling system_nrf51.c... "._build\nrf51422_xxac.axf" - 77 Error(s), 10 Warning(s). Target not created. Build Time Elapsed: 00:00:02

Reply
  • If I put .cpp in the main file, and --cpp11 instead of --c99, I get more errors, look:

    *** Using Compiler 'V5.06 update 4 (build 422)', folder: 'F:\Programs\ARM\ARMCC\Bin' Rebuild target 'nrf51422_xxac' compiling ant_stack_config.c... ............\components\ant\ant_stack_config\ant_stack_config.c(41): error: #29: expected an expression .ucTotalNumberOfChannels = ANT_CONFIG_TOTAL_CHANNELS_ALLOCATED, ............\components\ant\ant_stack_config\ant_stack_config.c(42): error: #29: expected an expression .ucNumberOfEncryptedChannels = ANT_CONFIG_ENCRYPTED_CHANNELS, ............\components\ant\ant_stack_config\ant_stack_config.c(43): error: #29: expected an expression .pucMemoryBlockStartLocation = ant_stack_buffer.u8, ............\components\ant\ant_stack_config\ant_stack_config.c(44): error: #29: expected an expression .usMemoryBlockByteSize = ANT_BUFFER_SIZE_FOR_SD ............\components\ant\ant_stack_config\ant_stack_config.c(32): warning: #177-D: variable "ant_stack_buffer" was declared but never referenced }ant_stack_buffer; /*!< Memory buffer provided in order to support channel configuration */ ............\components\ant\ant_stack_config\ant_stack_config.c: 1 warning, 4 errors compiling ant_channel_config.c... compiling nrf_drv_gpiote.c... ............\components\drivers_nrf\gpiote\nrf_drv_gpiote.c(120): error: #20: identifier "UINT32_MAX" is undefined if (m_cb.handlers[i] == ORBIDDEN_HANDLER_ADDRESS) ............\components\drivers_nrf\gpiote\nrf_drv_gpiote.c(133): error: #20: identifier "UINT32_MAX" is undefined m_cb.handlers[channel_id] = ORBIDDEN_HANDLER_ADDRESS; ............\components\drivers_nrf\gpiote\nrf_drv_gpiote.c: 0 warnings, 2 errors compiling nrf_delay.c... compiling nrf_drv_common.c... compiling nrf_drv_twi.c... ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(100): error: #29: expected an expression

    RF_DRV_TWI_DEFAULT_CONFIG(0), ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(238): warning: #550-D: variable "evt_found" was set but never used bool evt_found = false; ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(604): error: #20: identifier "UINT32_MAX" is undefined nrf_twi_shorts_clear(p_instance->p_reg, ISABLE_MASK); ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(636): error: #20: identifier "UINT32_MAX" is undefined nrf_twi_int_disable(p_instance->p_reg, ISABLE_MASK); ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(709): error: #29: expected an expression .type = NRF_DRV_TWI_ERROR, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(710): error: #29: expected an expression .p_data = p_transfer->p_data, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(711): error: #29: expected an expression .length = p_transfer->count, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(713): error: #29: expected an expression .error_src = (nrf_twi_error_source_get(p_reg) & ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(724): error: #29: expected an expression .type = p_transfer->is_tx ? NRF_DRV_TWI_TX_DONE : NRF_DRV_TWI_RX_DONE, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(725): error: #29: expected an expression .p_data = p_transfer->p_data, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c(726): error: #29: expected an expression .length = p_transfer->count, ............\components\drivers_nrf\twi_master\nrf_drv_twi.c: 1 warning, 13 errors compiling main.cpp... ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ....\main.cpp(164): error: #29: expected an expression .channel_number = ANT_ACK_CHANNEL_NUMBER, ....\main.cpp(165): error: #29: expected an expression .channel_type = CHANNEL_TYPE_MASTER, ....\main.cpp(166): error: #29: expected an expression .ext_assign = EXT_ASSIGN_NONE, ....\main.cpp(167): error: #29: expected an expression .rf_freq = ANT_FREQUENCY, ....\main.cpp(168): error: #29: expected an expression .transmission_type = ANT_ACK_TRANSMISSION_TYPE, ....\main.cpp(169): error: #29: expected an expression .device_type = ANT_ACK_DEVICE_TYPE, ....\main.cpp(170): error: #29: expected an expression .device_number = device_id, ....\main.cpp(171): error: #29: expected an expression .channel_period = ANT_CHANNEL_PERIOD, ....\main.cpp(172): error: #29: expected an expression .network_number = ANT_NETWORK_NUMBER, ....\main.cpp(159): warning: #550-D: variable "device_id" was set but never used uint16_t device_id; ....\main.cpp(385): error: #20: identifier "MPU6050_getMotion6" is undefined MPU6050_getMotion6(&ax, &ay, &az, &gx, &gy, &gz); ....\main.cpp(392): warning: #177-D: variable "err_code" was declared but never referenced ret_code_t err_code; ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(540): error: #29: expected an expression nrf_drv_gpiote_in_config_t in_config = PIOTE_CONFIG_IN_SENSE_LOTOHI(true); ....\main.cpp(559): error: #20: identifier "MPU6050_initialize" is undefined MPU6050_initialize(); ....\main.cpp(85): warning: #177-D: variable "p_random_byte" was declared but never referenced static uint8_t * p_random_byte; ....\main.cpp(86): warning: #177-D: variable "random_byte" was declared but never referenced static uint8_t random_byte; ....\main.cpp(110): warning: #550-D: variable "payload" was set but never used static uint8_t payload[(uint8_t)8]; ....\main.cpp(118): warning: #177-D: function "ant_message_send" was declared but never referenced static void ant_message_send(const uint8_t CHANNEL_NUMBER, uint8_t payload) ....\main.cpp(139): warning: #177-D: function "flash_store_p_data" was declared but never referenced static void flash_store_p_data(void) // just in case we need it ....\main.cpp: 8 warnings, 19 errors compiling app_button.c... ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c(143): error: #29: expected an expression nrf_drv_gpiote_in_config_t config = PIOTE_CONFIG_IN_SENSE_TOGGLE(false); ............\components\libraries\button\app_button.c: 0 warnings, 4 errors compiling bsp.c... compiling nrf_assert.c... compiling app_timer.c... ............\components\libraries\timer\app_timer.c(250): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_current = p_current->next; ............\components\libraries\timer\app_timer.c(287): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_current = p_current->next; ............\components\libraries\timer\app_timer.c(299): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" mp_timer_id_head = mp_timer_id_head->next; ............\components\libraries\timer\app_timer.c(317): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_current = p_previous->next; ............\components\libraries\timer\app_timer.c(396): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" p_timer = p_timer->next; ............\components\libraries\timer\app_timer.c(507): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_node_t *" mp_timer_id_head = p_head->next; ............\components\libraries\timer\app_timer.c(952): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_user_t *" mp_users = p_buffer; ............\components\libraries\timer\app_timer.c(965): error: #513: a value of type "void *" cannot be assigned to an entity of type "timer_user_op_t " p_user->p_user_op_queue = p_buffer; ............\components\libraries\timer\app_timer.c: 0 warnings, 10 errors compiling app_error.c... assembling arm_startup_nrf51.s... compiling softdevice_handler.c... compiling i2cdev.c... ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.c(30): error: #29: expected an expression .scl = SCL_PIN, ............\components\drivers_ext\i2cdev\i2cdev.c(31): error: #29: expected an expression .sda = SDA_PIN, ............\components\drivers_ext\i2cdev\i2cdev.c(32): error: #29: expected an expression .frequency = NRF_TWI_FREQ_400K, ............\components\drivers_ext\i2cdev\i2cdev.c(33): error: #29: expected an expression .interrupt_priority = APP_IRQ_PRIORITY_HIGH ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdev\i2cdev.h(24): error: #29: expected an expression static const nrf_drv_twi_t m_twi = RF_DRV_TWI_INSTANCE(0); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.h(1038): warning: #1-D: last line of file ends without a newline #endif / MPU6050_H */ ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3045): error: #20: identifier "malloc" is undefined if (verify) verifyBuffer = (uint8_t *)malloc( PU6050_DMP_MEMORY_CHUNK_SIZE); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3046): error: #20: identifier "malloc" is undefined if (useProgMem) progBuffer = (uint8_t *)malloc( PU6050_DMP_MEMORY_CHUNK_SIZE); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3059): error: #20: identifier "pgm_read_byte" is undefined for (j = 0; j < chunkSize; j++) progBuffer[j] = pgm_read_byte(data + i + j); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3065): error: #20: identifier "i2c_write_bytes" is undefined i2c_write_bytes(devAddr, PU6050_RA_MEM_R_W, chunkSize, progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3072): error: #20: identifier "memcmp" is undefined if (memcmp(progBuffer, verifyBuffer, chunkSize) != 0) { ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3090): error: #20: identifier "free" is undefined free(verifyBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3109): error: #20: identifier "free" is undefined if (verify) free(verifyBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3110): error: #20: identifier "free" is undefined if (useProgMem) free(progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3121): error: #20: identifier "malloc" is undefined progBuffer = (uint8_t *)malloc(8); // assume 8-byte blocks, realloc later if necessary ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3129): error: #20: identifier "pgm_read_byte" is undefined bank = pgm_read_byte(data + i++); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3148): error: #20: identifier "realloc" is undefined if (sizeof(progBuffer) < length) progBuffer = (uint8_t *)realloc(progBuffer, length); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3149): error: #20: identifier "pgm_read_byte" is undefined for (j = 0; j < length; j++) progBuffer[j] = pgm_read_byte(data + i + j); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3162): error: #20: identifier "pgm_read_byte" is undefined special = pgm_read_byte(data + i++); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3185): error: #20: identifier "free" is undefined if (useProgMem) free(progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp(3189): error: #20: identifier "free" is undefined if (useProgMem) free(progBuffer); ............\components\drivers_ext\i2cdevlib\MPU6050\MPU6050.cpp: 1 warning, 18 errors compiling system_nrf51.c... "._build\nrf51422_xxac.axf" - 77 Error(s), 10 Warning(s). Target not created. Build Time Elapsed: 00:00:02

Children
No Data
Related