编译一个STC8串口例程,出现好多错误
2023-12-28 15:38 来自 caishifu 发布 @ 综合讨论
[attach]31194[/attach]//========================================================================
// 函数: void timer0_ISR (void) interrupt TIMER0_VECTOR
// 描述: timer0中断函数.
// 参数: none.
// 返回: none.
// 版本: V1.0, 2016-5-12
//========================================================================
void timer0_ISR (void) interrupt TIMER0_VECTOR
{
if(RX1_TimeOut != 0)
{
if(--RX1_TimeOut==0) //超时
{
if(RX1_cnt != 0) //接收有数据
{
B_RX1_OK = 1; //标志已收到数据块
}
}
}
}
compiling MODBUS.c...
MODBUS.C(304): error C141: syntax error near 'TIMER0_VECTOR', expected 'const'
MODBUS.C(305): error C132: 'TIMER0_VECTOR': not in formal parameter list
MODBUS.C(305): error C141: syntax error near '{'
MODBUS.C(308): error C132: 'RX1_TimeOut': not in formal parameter list
MODBUS.C(312): error C244: 'B_RX1_OK': can't initialize, bad type or class
MODBUS.C(312): error C132: 'B_RX1_OK': not in formal parameter list
MODBUS.C(313): error C141: syntax error near '}'
MODBUS.c - 7 Error(s), 0 Warning(s).
// 函数: void timer0_ISR (void) interrupt TIMER0_VECTOR
// 描述: timer0中断函数.
// 参数: none.
// 返回: none.
// 版本: V1.0, 2016-5-12
//========================================================================
void timer0_ISR (void) interrupt TIMER0_VECTOR
{
if(RX1_TimeOut != 0)
{
if(--RX1_TimeOut==0) //超时
{
if(RX1_cnt != 0) //接收有数据
{
B_RX1_OK = 1; //标志已收到数据块
}
}
}
}
compiling MODBUS.c...
MODBUS.C(304): error C141: syntax error near 'TIMER0_VECTOR', expected 'const'
MODBUS.C(305): error C132: 'TIMER0_VECTOR': not in formal parameter list
MODBUS.C(305): error C141: syntax error near '{'
MODBUS.C(308): error C132: 'RX1_TimeOut': not in formal parameter list
MODBUS.C(312): error C244: 'B_RX1_OK': can't initialize, bad type or class
MODBUS.C(312): error C132: 'B_RX1_OK': not in formal parameter list
MODBUS.C(313): error C141: syntax error near '}'
MODBUS.c - 7 Error(s), 0 Warning(s).
- 最近查阅:
免责声明:
本平台旨在开源共享精神,请勿发布敏感信息,任何违法信息我们将移交公安机关;
上一篇: 投诉一下