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'?
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?
I do not think so, (there is no automatic grouping of 'using') but a very intersting idea
Erik
I emulated the effect for register bank 1:
void foo(void) using 1 { }
I added the following to my overlays, to make foo a root node and append all the ISRs with the same using directive.
* ! foo, foo ! (ISR_hsk_timer0, ISR_hsk_isr5, ISR_hsk_isr6, ISR_hsk_isr9)
The effect was very minimal:
Before: Program Size: data=61.3 xdata=246 const=231 code=15429 After: Program Size: data=61.0 xdata=246 const=231 code=15425
In hindsight, it's obvious. I think I've only got a single ISR with local variables around. There's not much to optimise. But this might actually allow using more of them, creating more readable code.
Which, particularly on an 8051, rather strongly hints at an alternative approach following the "Well, don't do that, then!" pattern: just don't use local variables in ISRs, and there will be no need to worry about how best to organize their overlay strategry.
Interrupts should always be kept as simple as possible. The need for local variables indicates that that principle may have been violated already. RAM consumption that's hard to reduce could be seen as adequate "punishment" for such a transgression.
Now that was constructive.
It wouldn't be a proper Keil forum thread unless either Hans or Erik have gone out of their way to add an unnecessary comment that doesn't add anything to the conversation but still allows them to post.
It's usually just bait to get people to respond so they can pretend to be the victims of an attack and then leverage it put other people down and make them feel better about themselves. Happens all the time around here.
You missed Mr Indeed man who really (and I do mean really) likes to feel smug with frequent RTFMs.
View all questions in Keil forum