//编程:jumpmysoul
#include
#define ulong unsigned long
char tab[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};//共阳数码管数字码
char tab_dp[10]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x70,0x10};//共阳数码管数字码(带小数点)
#define LED P0 //P0为数码管的段选
#define LIGHT P1 //P1为时分秒位的指示灯
#define WS P2 //P2为数码管的位选
sbit time_change=P3^0; //P3^0为“调时”按键
sbit time_choose=P3^1; //P3^1为“选择时分秒”按键
sbit time_inc=P3^2; //P3^2为“增加”按键
sbit time_ok=P3^3; //P3^3为“完成”按键
ulong t;
ulong sec,min,hour,sec_ge,sec_shi,min_ge,min_shi,hour_ge,hour_shi; //定义秒,分,时,秒的个位,十位,分的个位,十位,时的个位,十位
int choose_n; //按下“选择时分秒”按键的次数
int flag; //定义“调时”按键的标志位
//---------------------------------------------------------------------
void init();
void