We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I want to add a function handling nested interrupts for the controller. Could you tell me the right position to add this function?
startup-file:
Undef_Handler B Undef_Handler SWI_Handler B SWI_Handler PAbt_Handler B PAbt_Handler DAbt_Handler B DAbt_Handler ;IRQ_Handler B IRQ_Handler IRQ_Handler B irq_fnct FIQ_Handler B FIQ_Handler irq_fnct //do some stuff - nested interrupt
I've add one breakpoint to the irq_fnct but it seems that the programm will not reach this part if a interupt occur.
I'm working with the atmel controller AT91SAM7S.
best regards Peter
If I understand you right, then I have to add this function at the beginning of all ISR. And I have to write this function in one of my c-files.
I thought it would be possible to add this function in the startup file of the processor and if an interrupt occur the progamm counter will go to the addr of the IRQ_Handler (vector) and after that the irq_fnct will be executed...
Undef_Handler B Undef_Handler SWI_Handler B SWI_Handler PAbt_Handler B PAbt_Handler DAbt_Handler B DAbt_Handler ;IRQ_Handler B IRQ_Handler IRQ_Handler B irq_fnct FIQ_Handler B FIQ_Handler irq_fnct //enable nested interrupt, change the mode //execute the ISR //disable interrupts and go back to usr mode
I've seen a example of atmel using keil uvision (but with the GCC compiler) and they add the function (responsibel for adding the availability of using nested interrupts) to the IRQ_Handler (vector) in the startup file.