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.
I see functions like enable and disable, but I need to know the current state.
Eg. If interrupts are enabled at the start of a particular function, disable them for the duration of the function, but if the interrupts are disabled, they must stay disabled.
You can use intrinsic functions which provide information also about interrupt mask state.
Example:
int was_masked = __disable_irq(); /* ... */ if (!was_masked) __enable_irq();
More details: www.keil.com/.../armccref_cjafbcbb.htm