请问出现这样的错误d:\Keil\C51\Inc\STC\stc15f2k60s2.h(16): error C231: 'ACC': redefinition怎么解决

使用的单片机是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.h在哪加的?上面列出的寄存器定义重复了,是不是加头文件重复了.追问

之前用stc15f2k60s2单片机时,加过stc15f2k60s2.h头文件,但现在改用stc15W401AS单片机了,就把这个头文件都删掉了,没再包含了

追答

那等于什么头文件也没有包含了?//#include 这行也打掉了,那也不行啊,不管是哪个头文件,必须包含一个的,否则那那寄存器就无法编译的,所以,出错了。

温馨提示:答案为网友推荐,仅供参考
相似回答