主题中讨论的其他部件:C2000WARE
你(们)好
我正在尝试使用示例i2c_ex4_eeprom_polling创建库。 以下是为静态库创建项目的过程
创建库文件
=================
1.创建新项目
答 输出类型"静态库"
B. 输出格式"eabi (ELF)"
2.在4.0 “属性->常规->产品”下添加产品"C2000Ware(C2000Ware.<xmt-block1>2000 0.00)
3.将i2cLib_Fifo_polloing.c,i2cLib_FIFO_polling.h和2.8002万x_generic_flash_link.cmd复制到项目目录
4.在property->builm->C2000 Archiver ->基本选项下,将输出文件扩展名.lib更改为.a
所有的东西都能正常工作,文件和库都能成功生成。
在项目中使用库
1.在property->buil->C2000链接器->File Search Path下的“将库文件或命令文件作为输入包含”窗口中添加具有完整路径和名称的库
2.define a variable struct I2CHandle asyncCmd wehre I2CHandle is define in i2cLib_FIFO_polling.h
3.但是,编译项目时出现如下错误"。
"../halo_func.c",第399行:警告#225-D:函数"I2CBusScan"隐式声明
"../halo_func.c",第425行:错误#71:不允许不完整的类型
"../halo_func.c",第426行:错误#71:不允许不完整的类型
"../halo_func.c",第427行:错误#71:不允许不完整的类型
"../halo_func.c",第428行:错误#71:不允许不完整的类型
"../halo_func.c",第429行:错误#71:不允许不完整的类型
"../halo_func.c",第430行:错误#71:不允许不完整的类型
"../halo_func.c",第431行:错误#71:不允许不完整的类型
"../halo_func.c",第432行:错误#71:不允许不完整的类型
"../halo_func.c",第433行:错误#71:不允许不完整的类型
"../halo_func.c",第436行:错误#71:不允许不完整的类型
"../halo_define.h",第359行:错误#237:变量"asyncCmd"被声明为从未完成的类型
a.行399为status = I2CBusScan (I2CA_BASE,pAvailableI2C_slaves);
B.第425-436行
asyncCmd. SlaveAddr = 0x59;
asyncCmd. base = I2CA_BASE;
asyncCmd. pControlAddr =&ControlAddr;
asyncCmd. NumOfAddrBytes =1;
asyncCmd. ptx_MsgBuffer = i2c.message.tx;
asyncCmd. prx_MsgBuffer = i2c.message.rx;
asyncCmd. NumOfAttempts =1;
asyncCmd. delay_us = 1000;
asyncCmd. WriteCycleTime_in_us = 1000; //10ms对于EEPROM此代码已测试
C.第359行
外部结构I2CHandle asyncCmd;
请告知我有什么问题,因为这是我第一次构建库。
谢谢
