update slave
authordopefishh <mart@martlubbers.net>
Fri, 2 Oct 2015 11:11:50 +0000 (13:11 +0200)
committerdopefishh <mart@martlubbers.net>
Fri, 2 Oct 2015 11:11:50 +0000 (13:11 +0200)
mart/ex10/ex10dslave.c

index e1ed89f..0430588 100644 (file)
@@ -17,14 +17,11 @@ RT_TASK task;
 void taskf(void *arg)
 {
        RT_INTR intr;
-       rt_printf("success creation: %d\n", rt_intr_create(&intr, "lpt1 handler", LPT1IRQ, I_PROPAGATE));
+       rt_intr_create(&intr, "lpt1 handler", LPT1IRQ, I_PROPAGATE);
 
        while(1){
-               rt_printf("Waiting for interrupt\n");
                rt_intr_wait(&intr, TM_INFINITE);
-               rt_printf("Setting bit to 0\n");
-               outb(inb(0x378) & 0xEF, 0x378);
-               rt_printf("Setting bit to 1\n");
+               outb(inb(0x378) & 0xFE, 0x378);
                outb(inb(0x378) | 0x01, 0x378);
        }
 }
@@ -35,9 +32,9 @@ int main(int argc, char* argv[])
        mlockall(MCL_CURRENT | MCL_FUTURE);
 
        ioperm(0x37A, 1, 1);
+       outb(inb(0x37A) | 0x10, 0x37A);
        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, &taskf, 0);