Understanding a C prototype -


a function prototype is

int alt_irq_register (alt_u32 id, void* context, void (*isr)(void*, alt_u32));

what last part mean? *isr doing?

it pointer function. must use function parameter of alt_irq_register function. example:

void irq_handler(void *ptr, alt_u32 val) { /* function */     /* i'm handling interupt */ } int alt_irq_register (alt_u32 id, void* context, void (*isr)(void*, alt_u32)); 

in code, must use alt_irq_register function in way:

/* code */ ret = alt_irq_register(id, context_ptr, irq_handler); /* other code */ 

i supposing function register , interrupt handler, during registration passing system function must uses when associated interrupt occur.


Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -