From 991f1056adea0c75e878331e2cee3a1212100b67 Mon Sep 17 00:00:00 2001 From: Yourtion Date: Fri, 22 Apr 2016 16:58:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E8=BF=90=E8=A1=8C=E9=80=9F?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 15_day/bootpack.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/15_day/bootpack.c b/15_day/bootpack.c index d2c2e5d..5d51fe4 100644 --- a/15_day/bootpack.c +++ b/15_day/bootpack.c @@ -285,8 +285,8 @@ void make_textbox8(struct SHEET *sht, int x0, int y0, int sx, int sy, int c) void task_b_main(struct SHEET *sht_back) { struct FIFO32 fifo; - struct TIMER *timer_ts, *timer_put; - int i, fifobuf[128], count = 0; + struct TIMER *timer_ts, *timer_put, *timer_1s; + int i, fifobuf[128], count = 0, count0 = 0; char s[12]; fifo32_init(&fifo, 128, fifobuf); @@ -295,7 +295,10 @@ void task_b_main(struct SHEET *sht_back) timer_settime(timer_ts, 2); timer_put = timer_alloc(); timer_init(timer_put, &fifo, 1); - timer_settime(timer_put, 1); + timer_settime(timer_put, 1); + timer_1s = timer_alloc(); + timer_init(timer_1s, &fifo, 100); + timer_settime(timer_1s, 100); for (;;) { count++; @@ -314,6 +317,11 @@ void task_b_main(struct SHEET *sht_back) } else if (i == 2) { farjmp(0, 3 * 8); timer_settime(timer_ts, 2); + } else if (i == 100) { + sprintf(s, "%11d", count - count0); + putfonts8_asc_sht(sht_back, 0, 128, COL8_FFFFFF, COL8_008484, s, 11); + count0 = count; + timer_settime(timer_1s, 100); } } }