From b915b98a3430a5af46e1044a5215e5c8238d9464 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Fri, 9 Oct 2015 11:29:29 +0200 Subject: [PATCH] update ex11 --- mart/ex11/ex11.c | 108 +++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/mart/ex11/ex11.c b/mart/ex11/ex11.c index 520777a..0dbd214 100644 --- a/mart/ex11/ex11.c +++ b/mart/ex11/ex11.c @@ -19,41 +19,41 @@ RTIME ticks[TICKS+1]; RTIME tocks[TICKS+1]; unsigned char data[MAXX] = { - 1, 2, 4, 8, 16, 32, 64, 128, 256, - 1, 2, 4, 8, 16, 32, 64, 128, 256 + 1, 2, 4, 8, 16, 32, 64, 128, 256, + 1, 2, 4, 8, 16, 32, 64, 128, 256 }; void add_tick(RTIME *t, RTIME tnew) { - unsigned int i = 0; - t[TICKS] = 0; - for(i=TICKS-1; i>0; i--){ - t[i] = t[i-1]; - t[TICKS] += t[i]; - } - t[0] = tnew; - t[TICKS] = t[TICKS]/TICKS; + unsigned int i = 0; + t[TICKS] = 0; + for(i=TICKS-1; i>0; i--){ + t[i] = t[i-1]; + t[TICKS] += t[i]; + } + t[0] = tnew; + t[TICKS] = t[TICKS]/TICKS; } void taskd(void *arg) { - RTIME time = *(RTIME *)arg; - RTIME step = time/(2*MAXX+2); - unsigned int i; + RTIME time = *(RTIME *)arg; + RTIME step = time/(2*MAXX+2); + unsigned int i; - //To the right + //To the right outb(0x00, 0x378); - rt_task_sleep(step*2); - for(i=0; i