DisableContextSaving

Post your requests and ideas on the future development of mikroPascal PRO for PIC.
Post Reply
Author
Message
ashley
Posts: 6
Joined: 23 Apr 2008 07:36

DisableContextSaving

#1 Post by ashley » 29 Dec 2011 14:44

It you be nice if you could just disable context saving for only the high priority interrupt and let the compiler look after saving everything in the low priority interrupt. I have high priority interrupt that can be triggered frequently (13uS in fact) that is written in assembler and uses the fast return stack. Without the disable context saving directive the compiler adds about 10 times more code than my routine to save/restore things that I don't use. I also have a low priority interrupt for everything else and that's written mainly in Pascal. Because the compiler re-uses all its Rx temporaries you have to hunt through the assembly listing to figure out what needs to be saved. This can easily introduce very hard to find bugs as minor changes to the low priority interrupt can easily introduce an additional Rx reference.

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

Re: DisableContextSaving

#2 Post by jpc » 30 Dec 2011 15:58

did you consider looking in the help ? Check what is provided on the subject of interrupts.
Au royaume des aveugles, les borgnes sont rois.

janni
Posts: 5373
Joined: 18 Feb 2006 13:17
Contact:

Re: DisableContextSaving

#3 Post by janni » 30 Dec 2011 16:44

ashley wrote:It you be nice if you could just disable context saving for only the high priority interrupt and let the compiler look after saving everything in the low priority interrupt.
Yeah, like the DisableContextSaving directive implemented to be only effective locally (in the ISR it's placed), not globally as it is now.

ashley
Posts: 6
Joined: 23 Apr 2008 07:36

Re: DisableContextSaving

#4 Post by ashley » 03 Jan 2012 04:57

JPC. Not really sure what your point is. As far as I'm aware the help mentions no way of disabling context locally (i.e. in the high priority interrupt routine but not the low priority), and provides no guidance into which registers need to be saved if context is disabled. If I've missed something please point it out.

jpc
Posts: 1986
Joined: 22 Apr 2005 17:40
Location: France 87

Re: DisableContextSaving

#5 Post by jpc » 03 Jan 2012 09:23

i misunderstood the original question, thought you just missed the disablecontextsaving function as provided but now understand you wanted a selective disabling on the high priority only .
Au royaume des aveugles, les borgnes sont rois.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: DisableContextSaving

#6 Post by filip » 04 Jan 2012 15:32

Hi,

The disablecontextsaving disables context saving for both high and low priority interrupts.
If you wish to toggle this, I suggest that you use disable context saving (for both interrupts) and manually save the wanted registers values for the desired interrupt.

Regards,
Filip.

Post Reply

Return to “mikroPascal PRO for PIC Wish List”