Results 1 to 1 of 1
Hello ,
After read several post and documents, I have tried to develop a easy linux diver to use interrupt.
Code:
#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-15-2010 #1Just Joined!
- Join Date
- May 2007
- Posts
- 23
Doubt with interrupts handler.
Hello ,
After read several post and documents, I have tried to develop a easy linux diver to use interrupt.
After compile this divers and insmod it, I have connected a square wave to INT 10 but nothing happen.Code:#include <linux/slab.h> #include <linux/sched.h> #include <linux/module.h> #include <linux/interrupt.h> #include <asm/io.h> #include <linux/time.h> #include <linux/ioport.h> #include <linux/signal.h> #include <linux/fcntl.h> #include <linux/fs.h> #define INTERRUPT_10 10 unsigned int contador1; irq_handler_t handler_10(void) { contador1++; printk("Interrupcion %d ejecutada %d.\n", INTERRUPT_10, contador1); return 0; } int xinit_module(void) { int ret; contador = 0; contador1 = 0; // Request IRQ 10 ret = request_irq(INTERRUPT_10, (irq_handler_t) handler_10, IRQF_DISABLED, "LEICIF_10", NULL); if (ret < 0) { printk("Error, can not request irq %d", INTERRUPT_10); return (ret); } enable_irq(INTERRUPT_10); printk("wait for interrupt\n"); printk("return code %d \n", ret); return 0; } void xcleanup_module(void) { disable_irq(INTERRUPT_10); free_irq(INTERRUPT_10, NULL); printk("closed\n"); } module_init(xinit_module); module_exit(xcleanup_module); MODULE_LICENSE("GPL");
So, Could somebody tell if I need to configure anything else to use INT10???
Best regards


Reply With Quote
