raskolnikov 0 Posted September 23, 2010 Report Share Posted September 23, 2010 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 Quote Link to post Share on other sites
Dave 0 Posted September 25, 2010 Report Share Posted September 25, 2010 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 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.