GPIOPinConfigure(0x00010803);//GPIO_PB2_I2C0SCL
GPIOPinConfigure(0x00010C03);//GPIO_PB3_I2C0SDA
像这样就不会报错;
如果是这样写:
GPIOPinConfigure(GPIO_PB2_I2C0SCL);//0x00010803
GPIOPinConfigure(GPIO_PB3_I2C0SDA);//0x00010C03
就会报错:
Description Resource Path Location Type
#20 identifier "GPIO_PB2_I2C0SCL" is undefined main.c /I2C line 223 C/C++ Problem
Description Resource Path Location Type
#20 identifier "GPIO_PB3_I2C0SDA" is undefined main.c /I2C line 224 C/C++ Problem
这是为什么呢?
zhoufeng zhoufeng:
回复 Michael Sun:
嗯嗯,我发现自己写的预定义的宏是TM4C123GH6PM而不是PART_TM4C123GH6PM,所以就出现了问题,现在解决了,谢谢你
zhoufeng zhoufeng:
回复 Michael Sun:
我想问一下您,这个问题又该怎么解决呢,是这个警告:
Description Resource Path Location Type#10210-D creating ".stack" section with default size of 0x800; use the -stack option to change the default size I2C C/C++ Problem
Michael Sun:
回复 zhoufeng zhoufeng:
楼主的工程里没有设置堆栈大小吧,在工程设置选项里面把堆栈大小填上去。
zhoufeng zhoufeng:
回复 Michael Sun:
在哪个位置,能给一个提示么?
zhoufeng zhoufeng:
回复 Michael Sun:
嗯嗯。。。我找到位置了,谢谢,god sun
jin li2:
回复 zhoufeng zhoufeng:
预定义的宏PART_TM4C123GH6PM,在哪设定