Jump to content
Sign in to follow this  
raskolnikov

Changing Critical Section Macros

Recommended Posts

I need to change the critical section macros to use GIEL and GIEH instead of GIE. When I do this is it enough to simply change the file novo.c then follow the instructions in the NOVO RTOS users guide under "Building Custom Novo Libraries"? Would I need to include all the following files in a project to build a library with the critical section macro changes?

 

1) novo.c

2) novo.h

3) novom.h

4) novolib_picwhatever.c

5) novocfg_picwhatever.h

 

If I want to use the ISR callable macros in either the high or low priority interrupts I'm thinking of something along these lines in novo.h

 

#ifdef _PIC18

#ifndef GIEL

volatile char intcon@ 0xFF2;

#define GIEL 0x0006

#endif

#ifndef GIEH

#define GIEH 0x0007

#endif

#endif

 

Then, depending on which ISR I want to use (interrupt or interrupt_low) I would define the SysCriticalSectionBegin/End() with intcon.GIEL or intcon.GIEH

 

Will this give me the results I want?

 

Thanks,

 

raskolnikov

Share this post


Link to post
Share on other sites
I need to change the critical section macros to use GIEL and GIEH instead of GIE. When I do this is it enough to simply change the file novo.c then follow the instructions in the NOVO RTOS users guide under "Building Custom Novo Libraries"? Would I need to include all the following files in a project to build a library with the critical section macro changes?

 

1) novo.c

2) novo.h

3) novom.h

4) novolib_picwhatever.c

5) novocfg_picwhatever.h

 

If I want to use the ISR callable macros in either the high or low priority interrupts I'm thinking of something along these lines in novo.h

 

#ifdef _PIC18

#ifndef GIEL

volatile char intcon@ 0xFF2;

#define GIEL 0x0006

#endif

#ifndef GIEH

#define GIEH 0x0007

#endif

#endif

 

Then, depending on which ISR I want to use (interrupt or interrupt_low) I would define the SysCriticalSectionBegin/End() with intcon.GIEL or intcon.GIEH

 

Will this give me the results I want?

There are some supplied project files to build all the supplied novo RTOS libraries.

 

They have a .c file that contains the following

// build novo library with appropriate configuration

#include "novocfg_pic16t3e1ts2.h"
#include "novo.c"

 

The novocfg_pic16t3e1ts2.h file contains the configuration information for the build, in this case it is for a PIC16 library with 3 tasks, 1 event and timer size of 2 bytes.

If both high and low priority interrupts are using Novo RTOS functions (macros or true functions) then to protect from corruption the high priority and low priority interrupts will both need to be disabled.

Critical Sections will needed in the low priority interrupt routine around any Novo RTOS functions calls (or macro invocation) to prevent corruption by the high priority routine.

 

I hope that helps.

 

Regards

Dave

Share this post


Link to post
Share on other sites

Your content will need to be approved by a moderator

Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×