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.
Just out of curiosity. Is there a way to tell the linker that ISRs have the same priority and thus cannot interrupt each other and can safely be overlayed?
P.S.: And what is the correct passive form of 'to overlay'?
Too bad, because there exist valid reasons for using local in ISRs. So I still think this actually has some merit. I also think I could gain a little performance here and there by using locals instead of operating entirely on globals and SFRs.
E.g. the 3 bits I won, are from the four ISRs backing up RMAP (an SFR paging bit on the XC800), before they reset it. I could use a global bit manually, but well ... it's just bad style so I wouldn't do this unless I actually ran out of bits.
The most compelling example is a result register of the AD-converter. It won't start the next conversion in its queue until it has been read. However I have to store the result somewhere a generic pointer points to. As we all know generic pointers are awfully slow, and it might (and often does) point to XDATA. So the first thing I do is copy the result register into a local variable, so the next AD conversion can start.
#ifdef ISR_GROUP_1 extern U8 Variable_for_group_1 #endif
That's what I meant with that sentence: I could use a global bit manually, but well ... it's just bad style so I wouldn't do this unless I actually ran out of bits.
But that's really just doing the overlaying for the compiler. I think I'll actually implement this. I already have a script that generates my overlaying instructions and updates the .uvproj. I'll extend it to do this for me.