c4f472b0c8948e24c06ff9ea071ee80a51734bea
5 #include <native/intr.h>
7 #include <native/task.h>
9 const RTIME period
= 100000;
10 const int nsamples
= 10000;
19 void enable_interupt()
23 byte
= byte
| 0x10; /* hex 10 = 00010000 */
29 byte
= byte
| 0x01; /* hex 10 = 00010000 */
33 void disable_interupt()
36 byte
= byte
& 0xEF; /* hex EF = binary 11101111 */
40 void send_parallel_port_intrp()
42 outb(inb(0x378) & 0xFE, 0x378);
43 outb(inb(0x378) | 0x01, 0x378); /* enable interrupt */
46 void do_task(void *arg
)
50 send_parallel_port_intrp();
52 rt_intr_wait(&intr
,TM_INFINITE
);
59 rt_intr_create(&intr
, NULL
, PARPORT_IRQ
, I_PROPAGATE
);
62 rt_task_create(&task
, NULL
,0,50,0);
63 rt_task_start(&task
, &do_task
, NULL
);
67 /* Avoids memory swapping for this program */
68 mlockall(MCL_CURRENT
|MCL_FUTURE
);
70 /* Perform auto-init of rt_print buffers if the task doesn't do so */
71 rt_print_auto_init(1);
74 int main(int argc
, char* argv
[])
76 printf("\nType CTRL-C to end this program\n\n" );
78 // code to set things to run xenomai
84 // wait for CTRL-c is typed to end the program