在做CAN通信,单片机用的是ST公司的ST10F276Z5Q3,KEIL工程里CPU选的是ST10F276,添加的文件为:
ST10f27x_can.c
ST10F27x_can.h
st10f27x_types.h
reg276.h
InterruptExample.c
编译的结果是:
Rebuild target 'Target 1'
assembling START167.A66...
compiling ST10F27x_can.c...
ST10F27x_can.c(635): warning C192: '=': value truncated
ST10F27x_can.c(732): warning C192: '=': value truncated
compiling InterruptExample.c...
C:\Keil\C166\Inc\REG276.H(52): warning C34: 'TFR': missing declaration specifiers
C:\Keil\C166\Inc\REG276.H(52): error C42: 'TFR': not in formal parameter list
是ST公司的例子,但是头文件出错,求相关大侠指导啊
------解决方案--------------------
试一下头文件改成<st10F276.h>
http://read.pudn.com/downloads167/sourcecode/asm/767238/common.h__.htm
http://www.st.com/mcu/modules/Splatt_Forums/downloadtemp/reg276.h
http://www.tasking.com/support/c166-classic/ver7.shtml