I would find it enormously useful if the interrupt service routine you specify with irqSet has a void pointer to custom user data.
This allows the irq initializer to pass an object to the ISR without using global variables.
For example, the current way to go is:
[code]
void* global_data;
void isr()
{
// do stuff with global_data
}
void myclass::setupIrq()
{
// assume data a member of myclass here
// but since we can't pass a pointer
// to isr we have to store it in a global variable
global_data = &data;
irqSet(IRQ_HBLANK, isr);
}
[/code]
But imo it's more useful and also cleaner this way:
[code]
void isr(void* userdata)
{
// do stuff with userdata aka data
}
void myclass::setupIrq()
{
// assume data a member of myclass here
irqSet(IRQ_HBLANK, isq, &data);
}
[/code]