hallo
authordopefishh <mart@martlubbers.net>
Fri, 2 Oct 2015 10:56:35 +0000 (12:56 +0200)
committerdopefishh <mart@martlubbers.net>
Fri, 2 Oct 2015 10:56:35 +0000 (12:56 +0200)
mart/ex10/ex10dmaster.c

index b95d7e2..ca05678 100644 (file)
 RT_TASK task;
 RTIME times[SAMPLES];
 
-void lpt1_handler(void *arg)
+void taskf(void *arg)
 {
        RT_INTR intr;
-       rt_intr_create(&intr, "lpt1 handler", LPT1IRQ, 0);
+       rt_printf("Succes creation: %d\n", rt_intr_create(&intr, "lpt1 handler", LPT1IRQ, I_PROPAGATE));
        rt_task_set_periodic(NULL, TM_NOW, 1e5);
        rt_printf("Sending\n");
 
        unsigned int i;
        for(i = 0; i<SAMPLES; i++){
                times[i] = rt_timer_read();     
+        rt_printf("Set bit to 0\n");
                outb(inb(0x378) & 0xEF, 0x378);
+        rt_printf("Set bit to 1\n");
                outb(inb(0x378) | 0x01, 0x378);
-               // Signal other machine
+        rt_printf("Wait for interrupt\n");
                rt_intr_wait(&intr, TM_INFINITE);
                times[i] = rt_timer_read()-times[i];
                rt_task_wait_period(NULL);
@@ -51,10 +53,10 @@ int main(int argc, char* argv[])
        ioperm(0x37A, 1, 1);
        ioperm(0x378, 1, 1);
        outb(inb(0x37A) | 0x01, 0x37A);
-       outb(inb(0x378) | 0x01, 0x378);
+//     outb(inb(0x378) | 0x01, 0x378);
 
        rt_task_create(&task, "task", 0, 50, 0);
-       rt_task_start(&task, &lpt1_handler, 0);
+       rt_task_start(&task, &taskf, 0);
 
     pause();
     outb(inb(0x37A) & 0xEF, 0x37A);