From: Mart Lubbers Date: Thu, 8 Oct 2015 18:35:16 +0000 (+0200) Subject: initial skeleton ex11 X-Git-Url: https://git.martlubbers.net/?a=commitdiff_plain;h=26b076f9eb03bf019268d2e09e90ffc8bce21867;p=des2015.git initial skeleton ex11 --- diff --git a/mart/ex11/ex11.c b/mart/ex11/ex11.c index e69de29..a9fd350 100644 --- a/mart/ex11/ex11.c +++ b/mart/ex11/ex11.c @@ -0,0 +1,54 @@ +#include +#include +#include +#include +#include + +#include +#include +#include + +#include + +#define LPT1IRQ 7 +#define TESTSAMPLES 20 + +RT_TASK task; +RTIME times[SAMPLES]; + +void taskf(void *arg) +{ + //Register as interrupt handler + RT_INTR intr; + rt_intr_create(&intr, NULL, LPT1IRQ, 0); + + //Measure average time of the clock + RTIME dur = rt_timer_read(); + unsigned int i; + for(i = 0; i