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'm attempting to opimise my xdata usage on an 8051 eWarp project. i'm working with a large memory model. when i view my linker file i see multiple new roots eg: *** NEW ROOT ******************************** VPIPINTERRUPT_STATSISR/VPIPINTERRUPT ----- ----- ----- ----- ----- ----- +--> ?PR?FPALU_SAVECONTEXT?FPALU +--> ?PR?EXPSTATSENGINEMANAGER_EXTRACTMEAN... +--> ?PR?WBSTATSENGINEMANAGER_EXTRACTMEANS... +--> ?PR?EXPOSURECONTROL_MAIN?EXPOSURECONTROL +--> ?PR?_WHITEBALANCE_UPDATECONTROLS?WHIT... +--> ?PR?INPUTPROCESSOR_CALCULATEALLCHANNE... +--> ?PR?FPALU_RESTORECONTEXT?FPALU *** NEW ROOT ******************************** VPIPINTERRUPT_SOF_EOF_ISR/VPIPINTERRUPT ----- ----- ----- ----- ----- ----- +--> ?PR?FPALU_SAVECONTEXT?FPALU +--> ?PR?EXPSTATSENGINEMANAGER_SETUPEXPOSU... +--> ?PR?WBSTATSENGINEMANAGER_SETUPWHITEBA... +--> ?PR?INPUTPROCESSOR_SETUPALLCHANNELS?I... +--> ?PR?_FLASHGUNMANAGER_SETGPIO?FLASHGUN... +--> ?PR?_EXPOSURECONTROL_CALCULATETOTALIN... +--> ?PR?_EXPSENSOR_GETANALOGGAINFROMCODED... +--> ?PR?_EXPOSURECONTROL_UPDATECURRENTEXP... +--> ?PR?_FLASHGUNMANAGER_CLEARGPIO?FLASHG... +--> ?PR?FPALU_RESTORECONTEXT?FPALU obviously the fns on different roots are not overlayed. however since i know that my interrupts are running at the same priority could these call trees not be merged into one? this would give me a large saving in ram due to the increased overlaying which would occur. is there a low level directive that can be used to force this to occur? i realise that the overlay directive is a powerful tool for this kind of thing, but i can't see how i can make it do what i want. can anybody help? thanks, robert
It looks like you're doing rather a lot of stuff in your ISRs - this is usually a Bad Thing. Might it be better to restructure your code along the conventional lines of minimising the ISRs, and leaving the bulk of the processing to the "main-line" code? That would also have the advantage of letting the Linker do its overlaying in its normal way - without you having to mess with it.
Andy, thanks for the input. i'll consider it for my codebase. we do stuff in the isr's for good reason, but perhaps we can get around it. thanks. robert
is there a low level directive that can be used to force this to occur? "OVERLAY", as you say. How about assigning all of the ISR functions to be "called" by just one of them? Perhaps a dummy top-level function with no auto usage? Each ISR priority is effectively a new context, needing a new root for the call tree, in addition to the main routine.