Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12471 Discussions

questions for interrupt register function:alt_irq_register

Altera_Forum
Honored Contributor II
1,348 Views

hi everyone: 

the interrupt register function in nios: 

int alt_ic_isr_register (alt_u32 ic_id, 

alt_u32 irq,  

alt_isr_func isr,  

void* isr_context,  

void* flags) 

isr_context is the input argument to isr . isr_context points to a data structure  

associated with the device driver instance. 

 

 

i do not understand what is "isr_context " , so i find some codes from internet: 

some people write base_addr to the void* isr_context; 

some people write NULLto the void* isr_context; 

and nois examples write others. 

 

in my project, i write base_addr, and the interrupt works 

 

what is the meaning of isr_context ?  

is it right to write base_addr to it? 

 

thanks,qd0090.
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
296 Views

Interrupt function looks something like: 

 

void ISR_Handler (void* isr_context){ *** code here *** }  

 

isr_context is a pointer which gets passed to the interrupt function, you can use it as a data storage.
Reply