您尚未登录。

楼主 #1 2019-07-19 14:12:44

晕哥小弟
会员
注册时间: 2019-04-04
已发帖子: 309
积分: 299.5

uboot 使用i2c

各位朋友,有谁在uboot  下使用了i2c么?
我首先在menuconfig 打开命令行i2c。
编译却报错:

 CC      cmd/gpio.o
  CC      cmd/i2c.o
cmd/i2c.c: In function ‘i2c_get_bus_speed’:
cmd/i2c.c:211:9: error: ‘CONFIG_SYS_I2C_SPEED’ undeclared (first use in this function); did you mean ‘CONFIG_SYS_I2C_SLAVE’?
  return CONFIG_SYS_I2C_SPEED;
         ^~~~~~~~~~~~~~~~~~~~
         CONFIG_SYS_I2C_SLAVE
cmd/i2c.c:211:9: note: each undeclared identifier is reported only once for each function it appears in
cmd/i2c.c: In function ‘i2c_set_bus_speed’:
cmd/i2c.c:230:15: error: ‘CONFIG_SYS_I2C_SPEED’ undeclared (first use in this function); did you mean ‘CONFIG_SYS_I2C_SLAVE’?
  if (speed != CONFIG_SYS_I2C_SPEED)
               ^~~~~~~~~~~~~~~~~~~~
               CONFIG_SYS_I2C_SLAVE
cmd/i2c.c: In function ‘do_i2c_reset’:
cmd/i2c.c:1925:11: error: ‘CONFIG_SYS_I2C_SPEED’ undeclared (first use in this function); did you mean ‘CONFIG_SYS_I2C_SLAVE’?
  i2c_init(CONFIG_SYS_I2C_SPEED, CONFIG_SYS_I2C_SLAVE);
           ^~~~~~~~~~~~~~~~~~~~
           CONFIG_SYS_I2C_SLAVE
cmd/i2c.c: In function ‘i2c_get_bus_speed’:
cmd/i2c.c:212:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make[1]: *** [cmd/i2c.o] Error 1
make: *** [cmd] Error 2

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn