完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
扫一扫,分享给好友
源代码inv_mpu.c中应该是没有错误的,直接copy过来的
..eMPLinv_mpu.c(344): error: #40: expected an identifier }; ..eMPLinv_mpu.c(666): error: #20: identifier "st" is undefined if (st.chip_cfg.dmp_on) { ..eMPLinv_mpu.c(671): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->int_enable, 1, &tmp)) ..eMPLinv_mpu.c(683): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->int_enable, 1, &tmp)) ..eMPLinv_mpu.c(699): error: #20: identifier "st" is undefined for (ii = 0; ii < st.hw->num_reg; ii++) { ..eMPLinv_mpu.c(702): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, ii, 1, &data)) ..eMPLinv_mpu.c(718): error: #20: identifier "st" is undefined if (reg == st.reg->fifo_r_w || reg == st.reg->mem_r_w) ..eMPLinv_mpu.c(722): warning: #223-D: function "i2c_read" declared implicitly return i2c_read(st.hw->addr, reg, 1, data); ..eMPLinv_mpu.c(745): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 1, &(data[0]))) ..eMPLinv_mpu.c(745): error: #20: identifier "st" is undefined if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 1, &(data[0]))) ..eMPLinv_mpu.c(740): warning: #177-D: variable "rev" was declared but never referenced unsigned char data[6], rev; ..eMPLinv_mpu.c(882): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 2, tmp)) ..eMPLinv_mpu.c(882): error: #20: identifier "st" is undefined if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 2, tmp)) ..eMPLinv_mpu.c(941): error: #20: identifier "st" is undefined st.chip_cfg.sensors = INV_XYZ_ACCEL; ..eMPLinv_mpu.c(959): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors & INV_XYZ_GYRO)) ..eMPLinv_mpu.c(962): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, st.reg->raw_gyro, 6, tmp)) ..eMPLinv_mpu.c(968): warning: #223-D: function "get_ms" declared implicitly get_ms(timestamp); ..eMPLinv_mpu.c(982): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors & INV_XYZ_ACCEL)) ..eMPLinv_mpu.c(985): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, st.reg->raw_accel, 6, tmp)) ..eMPLinv_mpu.c(991): warning: #223-D: function "get_ms" declared implicitly get_ms(timestamp); ..eMPLinv_mpu.c(1006): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors)) ..eMPLinv_mpu.c(1009): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, st.reg->temp, 2, tmp)) ..eMPLinv_mpu.c(1013): warning: #223-D: function "get_ms" declared implicitly get_ms(timestamp); ..eMPLinv_mpu.c(1038): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, 3, 3, data)) ..eMPLinv_mpu.c(1038): error: #20: identifier "st" is undefined if (i2c_read(st.hw->addr, 3, 3, data)) ..eMPLinv_mpu.c(1066): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, 0x06, 6, data)) ..eMPLinv_mpu.c(1079): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors)) ..eMPLinv_mpu.c(1083): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->int_enable, 1, &data)) ..eMPLinv_mpu.c(1139): error: #20: identifier "st" is undefined switch (st.chip_cfg.gyro_fsr) { ..eMPLinv_mpu.c(1168): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors)) ..eMPLinv_mpu.c(1190): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->gyro_cfg, 1, &data)) ..eMPLinv_mpu.c(1203): error: #20: identifier "st" is undefined switch (st.chip_cfg.accel_fsr) { ..eMPLinv_mpu.c(1233): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors)) ..eMPLinv_mpu.c(1255): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->accel_cfg, 1, &data)) ..eMPLinv_mpu.c(1268): error: #20: identifier "st" is undefined switch (st.chip_cfg.lpf) { ..eMPLinv_mpu.c(1306): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors)) ..eMPLinv_mpu.c(1324): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->lpf, 1, &data)) ..eMPLinv_mpu.c(1337): error: #20: identifier "st" is undefined if (st.chip_cfg.dmp_on) ..eMPLinv_mpu.c(1354): error: #20: identifier "st" is undefined if (!(st.chip_cfg.sensors)) ..eMPLinv_mpu.c(1377): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->rate_div, 1, &data)) ..eMPLinv_mpu.c(1443): error: #20: identifier "st" is undefined switch (st.chip_cfg.gyro_fsr) { ..eMPLinv_mpu.c(1469): error: #20: identifier "st" is undefined switch (st.chip_cfg.accel_fsr) { ..eMPLinv_mpu.c(1501): error: #20: identifier "st" is undefined sensors[0] = st.chip_cfg.fifo_enable; ..eMPLinv_mpu.c(1522): error: #20: identifier "st" is undefined if (st.chip_cfg.dmp_on) ..eMPLinv_mpu.c(1558): error: #20: identifier "st" is undefined if (st.chip_cfg.sensors) ..eMPLinv_mpu.c(1588): warning: #223-D: function "i2c_write" declared implicitly if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 1, &data)) { ..eMPLinv_mpu.c(1588): error: #20: identifier "st" is undefined if (i2c_write(st.hw->addr, st.reg->pwr_mgmt_1, 1, &data)) { ..eMPLinv_mpu.c(1655): error: #20: identifier "st" is undefined if (!st.chip_cfg.sensors) ..eMPLinv_mpu.c(1657): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, st.reg->dmp_int_status, 2, tmp)) ..eMPLinv_mpu.c(1689): error: #20: identifier "st" is undefined if (st.chip_cfg.dmp_on) ..eMPLinv_mpu.c(1707): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, st.reg->fifo_count_h, 2, data)) ..eMPLinv_mpu.c(1722): warning: #223-D: function "get_ms" declared implicitly get_ms((unsigned long*)timestamp); ..eMPLinv_mpu.c(1767): error: #20: identifier "st" is undefined if (!st.chip_cfg.dmp_on) ..eMPLinv_mpu.c(1772): warning: #223-D: function "i2c_read" declared implicitly if (i2c_read(st.hw->addr, st.reg->fifo_count_h, 2, tmp)) ..eMPLinv_mpu.c(1804): error: #20: identifier "st" is undefined if (st.chip_cfg.bypass_mode == bypass_on) ..eMPLinv_mpu.c: 25 warnings, 30 errors ".myled.axf" - 30 Error(s), 25 Warning(s). |
|
相关推荐
9个回答
|
|
这么看来很多都是定义问题啊
|
|
|
|
谢谢分享,共同学习...
|
|
|
|
那个st是不是忘了定义或者没有申明外部变量
|
|
|
|
可以参考一下 正点原子上面的,可以使用的
|
|
|
|
学习中----
|
|
|
|
我也是碰到这个问题
|
|
|
|
解决了,是设置的不对
|
|
|
|
target potion里面c++选项define里面加入MOTION_DRIVER_TARGET_STM32,MPU6050
|
|
|
|
你好,我这么设置了还是不行啊。麻烦说详细点好吗?可能是我其他地方设置有误 |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1330 浏览 1 评论
AD7686芯片不传输数据给STM32,但是手按住就会有数据。
1263 浏览 3 评论
2430 浏览 0 评论
如何解决MPU-9250与STM32通讯时,出现HAL_ERROR = 0x01U
1416 浏览 1 评论
hal库中i2c卡死在HAL_I2C_Master_Transmit
1847 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-1 03:12 , Processed in 1.058583 second(s), Total 59, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号