On Tue, 24 Nov 2009, Michel Bouissou wrote:

Le mardi 24 novembre 2009, Gordon Henderson a écrit :
Any thoughts, anyone?

As a workaround,  you might disable (mask) interrupts in your main() code just
before the instruction that calls _mullong, and re-enable them immediately
after, so you're sure that an interrupt will never call _mullong while it's
already being executed outside of the interrupt service routine...

i.e

while (INTCONbits.GIEL!=0) INTCONbits.GIEL=0;
some_code_that_calls_mullong;
INTCONbits.GIEL=1

(Use GIEL/GIEH or GIE/PEIE depending upon if you run with interrupt priorities
enabled, or in compatibility mode)

That's my current workaround for this case - which is rather trivial.. However I have lots and lots of floating point code to "guard" and that's going to need some consinderations

(See PIC app notes to see why you should "while()" test that interrupts are
effectively disabled before continuing)

Intersting. I wasn't aware of this. Thanks.

http://ww1.microchip.com/downloads/en/AppNotes/00576B.pdf

for anyone else...

fortunately, I have macros for this already, as I need to enable/disable at various points, so:

#define DISABLE_INTS_IF_SET { uint8_t _intFlag = INTCONbits.GIE ; while (INTCONbits.GIE != 0) INTCONbits.GIE = 0 ;


#define ENABLE_INTS_IF_SET      INTCONbits.GIE = _intFlag ; }

Email will line-wrap it, but you get the idea...

Gordon
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to