- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the difference between CyEnterCriticalSection, CyGlobalIntDisable, CyDisableInts and their associated exit/enable functions?
Each of the above functions disables all interrupts. I can't find any documentation on which, if any, is preferred - and under what circumstances.
Thanks for any help!
Brian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CyDisableInts writes to the interrupt controller unit. The information which interrupt has been enabled before is lost.
CyGlobalIntDisable sets a bit in the CPU status which prevents (nearly) all interrupts from being processed. Previous state is lost.
CyEnterCriticalSection does the same as CyGlobalIntDisable but returns the current state. So this can be securely nested.
I (personally) start at begin of the initialization phase with CyGlobalIntEnable. Later. only when required I use the critical section scheme to keep the system responsive.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bob,
CyGlobalIntDisable - you wrote nearly all interrupts are disabled, can you specify which ones are still active?
thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Reset, Hardfault and NMI (Non-Maskable Interrupt) will always fire.
See "ARM M0 Generic User Guide" from ARM's website.
Bob