#include<reg51.h>
#include <intrins.h>
#include <stdio.h>
#define uint unsigned int
#define uchar unsigned char
char handle_1 ;
extern handle_1
uchar shi=12, fen=59, miao=0, green=0,beep=0 // 十分秒的初始值
void main() //主函数
{
TMOD=0x11;
TH0=(65536- -50000)/256;
TL0=(65536-50000)%256;
EA=1;
ET0=1;
TR0=1;
char handle_1(shi);
handle_2(fen);
display_1();//显示时钟初始值
display_2();//显示分钟初始值
while(1)
{
scan_key(); //调用按键扫描函数
time_1(); //调用时钟函数
handle_1(long shi); //对小时拆分
handle_2(long fen); //对分钟拆分
display_1();//显示小时
display_2();//显示分钟
}
//函数名: clock
//函数功能:定时器T0定时中断,interrupt 1
//形式参数:无
//返回值:无
void clock() interrupt 1
{
EA=0;//关中断
if(msec1!=0x28)
msec1++; //到 10毫秒否,不到则msec1加1
else
{
msec1=0;
if(msec2!= 100)msec2++; //到 1秒否,不到则msec2加1 .
else
{
if(rtimbit== 1 )count++;
msec2=0;
if(clockbuf[2]!=59)
clockbuf[2]++; //到 1分否,不到则clockbuf[2]加1
else
{ clockbuf[2]=0;
if(clockbuf[1]!=59)
clockbuf[1]++; // 到1小时否,不到则clockbuf[1]加1
else
{ clockbuf[1]=0;
if(clockbuf[0]!=23)
clockbuf[0]++; // 到24时否,不到则clockbuf[0]加1
else clockbuf[0]=0; }
}
}
}
EA=1;//开中断
}
编译输出: error C192:missing ' ; ' before 'unsigned
#define uint unsigned int
#define uchar unsigned char
改成
typedef unsigned int uint;
typedef unsigned char uchar;
注意要加分号
extern handle_1 这句,既没有声明类型,也没有结尾的分号,后面问题也多
C语言基础啊,建议成从头学起吧。