- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi. I have a number of critical placesin my code i am trying to make interupt safe. I guess the way to do, if using HAL functions alt_irq_register() , it is to brucket the critical code with alt_irq_disable_all() and alt_irq_enable_all(), the problem is those function pass a parametr. Is there way to create a macro which just will enable and disable all interrupts without passing status flags.? Do i still have ability to use HAL alt_irq_register function?
Thanks gera.Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you look in the altera_nios2 component then you will find, in the HAL directory, the header files which define alt_irq_enable_all and alt_irq_disable (try using find or windows "find in files" if you can't go to the right header file immediately).
This will explain what the context parameter is being used for, and will show you some examples of its use (within the alt_irq_enable function for example). Is there a reason why you don't want to use a parameter? The functions usually optimise down to three instructions so I'm assuming space and speed aren't the reason.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for the advice. I found the code. I was trying to convert NIOS1 code to the NIOS2 with minimum changes. I had a macro in the nios1 enabling and disabling interrupts, so i hoped just to change the macro defenition.O well, i guess i will search the code for the macro pair and switch it to the function use. Good point about optimisation. thanks again gera.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page