From 37eb729596bdcd336c41f05094bd69f52b9f0ae5 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Wed, 20 Apr 2016 13:10:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 13_day/bootpack.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/13_day/bootpack.c b/13_day/bootpack.c index 837bffb..4a39b35 100644 --- a/13_day/bootpack.c +++ b/13_day/bootpack.c @@ -12,7 +12,7 @@ void HariMain(void) struct FIFO8 timerfifo, timerfifo2, timerfifo3; char s[40], keybuf[32], mousebuf[128], timerbuf[8], timerbuf2[8], timerbuf3[8]; struct TIMER *timer, *timer2, *timer3; - int mx, my, i; + int mx, my, i, count = 0; unsigned int memtotal; struct MOUSE_DEC mdec; struct MEMMAN *memman = (struct MEMMAN *) MEMMAN_ADDR; @@ -75,8 +75,7 @@ void HariMain(void) putfonts8_asc_sht(sht_back, 0, 32, COL8_FFFFFF, COL8_008484, s, 40); for (;;) { - sprintf(s, "%010d", timerctl.count); - putfonts8_asc_sht(sht_win, 40, 28, COL8_000000, COL8_C6C6C6, s, 10); + count++; io_cli(); if (fifo8_status(&keyfifo) + fifo8_status(&mousefifo) + fifo8_status(&timerfifo) == 0) { @@ -127,7 +126,10 @@ void HariMain(void) io_sti(); if (i == 10) { putfonts8_asc_sht(sht_back, 0, 64, COL8_FFFFFF, COL8_008484, "10[sec]", 7); + sprintf(s, "%010d", count); + putfonts8_asc_sht(sht_win, 40, 28, COL8_000000, COL8_C6C6C6, s, 10); } else if (i == 3) { + count = 0; /* 开始测定 */ putfonts8_asc_sht(sht_back, 0, 80, COL8_FFFFFF, COL8_008484, "3[sec]", 6); } else { /* 0还是1 */