IRQs...
Posted: Sun Nov 11, 2007 9:28 am
Hi!
I have this code:
My problem is compiler error:
sysapi.cpp:149: error: invalid conversion from ‘void*’ to ‘void (*)(void*)’
Line 149 is "handler = irq_routines[r->int_no - 32]"
How repair this error? Thanks(); k_h;
I have this code:
Code: Select all
void *irq_routines[16] =
{
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0
};
/* This installs a custom IRQ handler for the given IRQ */
void irq_install_handler(int irq, void (*handler)(struct regs *r))
{
irq_routines[irq] = (void *)handler;
}
//...
void irq_handler(regs *r)
{
/* This is a blank function pointer */
void (*handler)(void *r);
/* Find out if we have a custom handler to run for this
* IRQ, and then finally, run it */
handler = irq_routines[r->int_no - 32];
if (handler)
{
handler(r);
}
//...
}
sysapi.cpp:149: error: invalid conversion from ‘void*’ to ‘void (*)(void*)’
Line 149 is "handler = irq_routines[r->int_no - 32]"
How repair this error? Thanks(); k_h;