From 26b076f9eb03bf019268d2e09e90ffc8bce21867 Mon Sep 17 00:00:00 2001 From: Mart Lubbers Date: Thu, 8 Oct 2015 20:35:16 +0200 Subject: [PATCH] initial skeleton ex11 --- mart/ex11/ex11.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) 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