Pumpkin, Inc.

Pumpkin User Forums

OSCreateTask

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

OSCreateTask

Postby dfleck » Mon May 13, 2002 9:03 am

OSCreateTask sets GIE to 1 before it returns, even if GIE was 0 when this function was called. How can I prevent OSCreateTask from modifying GIE?

------------------
Donald A. Fleck

Donald A. Fleck
dfleck
 
Posts: 28
Joined: Sun May 12, 2002 11:00 pm
Location: Breinigsville, PA, USA

Re: OSCreateTask

Postby aek » Tue May 14, 2002 7:44 am

Hi Donald.

Currently, with Salvo for PICmicro(R) MCUs, you can't. That's because there's no stack to push the current interrupt status onto and then restore from. Other Salvo ports (e.g. TI's MSP430) don't have this problem.

For now, I suggest:

1) Create your task(s) very late in the game, after all your interrupts are in place, or

2) Keep the particular interrupt(s) disabled via its own IE flag, and then enable it(them) after OSCreateTask() has been called, just before the infinite loop that calls OSSched(), or

3) IIRC, you have Salvo Pro. If you're not already doing a source-code build for your particular project, you could switch to a source-code build now (see salvo ut u6sysa u6.pjt for an example). Then, you can define your own OSEi() in your project's salvocfg.h, and it will override those in portpicc.h for this particular project only, i.e. don't modify portpicc.h directly. You could do something like

code:
#define OSEi() do { if (flagReady) GIE = 1; } while(0)

. You initialize flagReady to FALSE, and then, after the calls to OSCreateTask(), etc., you set it to TRUE.

Solution 3) is best way to go. I have an idea brewing for how to save and restore PIC GIE status with minimal code and RAM, but it's not ready for release yet.

Regards,

------------------

[This message has been edited by aek (edited May 14, 2002).]

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: OSCreateTask

Postby dfleck » Tue May 14, 2002 7:51 am

Thanks. I'm doing 2) since it is simple and it works. Perhaps when I become more familiar with Salvo I will try 3).

------------------
Donald A. Fleck

Donald A. Fleck
dfleck
 
Posts: 28
Joined: Sun May 12, 2002 11:00 pm
Location: Breinigsville, PA, USA


Return to PICmicro MCUs

Who is online

Users browsing this forum: No registered users and 2 guests

cron