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.
From my code I need to figure out has my function been called from the ISR or just regular application code. I do know that application is running is the User Thread mode and ISR is in privileged handler mode. Could you anyone please provide me with the sources of C-function(s) or inline assembly which will let me efficiently solve this issue.
Thanks.
whatever you (or someone else) come up with beware that it may fail.
If I found a solution (I am not looking) I would go through EVERY step of the process and check if, when called from main(), an interrupt at that specific place would screw it up. NOTE that the setting og the bit causing the interrupt and the interrupt does not happen at the same time.
These comment are triggered by my bootloader experience.
Explaining it will spark more issues then bring answers. never heard of or seen that one.
Erik
PS why not just two functions, they can both call the same subfunction
void mainfunc(void) { subfunc(1);
void ISRfunc(void) { subfunc(0);
Having two function is too easy for me and requires my user to think more which is always dangerous: remember - thinking makes wrinkles and therefore harmful :)