?? interrupt.c
字號:
#include <reg51.h>
#include <stdio.h>
#define SECOND 4000
unsigned int count;
struct time {
unsigned char hour;
unsigned char min;
unsigned char sec;
} clocktime;
void timer() interrupt 1 using 2
{
if (++count == SECOND) {
count=0;
update(&clocktime);
if (++clocktime.sec==60) {
clocktime.sec=0;
if (++clocktime.min==60) {
clocktime.min=0;
if (++clocktime.hour==25) {
clocktime.hour=1;
}
}
}
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -