使用的单片机是stc15W401AS
batteryadc.c的头文件如下
//#include <reg51.h>
#include "intrins.h"
#include "uart.h"
#include "type.h"
#include "batteryadc.h"
keil编译整个工程文件时出现如下问题:
Build target 'Target 1'
compiling batteryadc.c...
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(16): error C231: 'ACC': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(17): error C231: 'B': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(18): error C231: 'PSW': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(19): error C231: 'CY': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(20): error C231: 'AC': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(21): error C231: 'F0': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(22): error C231: 'RS1': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(23): error C231: 'RS0': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(24): error C231: 'OV': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(25): error C231: 'P': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(26): error C231: 'SP': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(27): error C231: 'DPL': redefinition
d:\Keil\C51\Inc\STC\stc15f2k60s2.h(28): error C231: 'DPH': redefinition
ä¹åç¨stc15f2k60s2åçæºæ¶ï¼å è¿stc15f2k60s2.h头æ件ï¼ä½ç°å¨æ¹ç¨stc15W401ASåçæºäºï¼å°±æè¿ä¸ªå¤´æ件é½å æäºï¼æ²¡åå å«äº
追çé£çäºä»ä¹å¤´æ件ä¹æ²¡æå å«äºï¼//#include è¿è¡ä¹ææäºï¼é£ä¹ä¸è¡åï¼ä¸ç®¡æ¯åªä¸ªå¤´æ件ï¼å¿ é¡»å å«ä¸ä¸ªçï¼å¦åé£é£å¯åå¨å°±æ æ³ç¼è¯çï¼æ以ï¼åºéäºã