Seems like there should be a macro defined for that, instead.  Something
like dintp() and eintp() that encapsulates them.  It's unclean to have to
handcode that with asm() each time.  Opens up a window for error, and makes
the code less portable.

        --John

-----Original Message-----
From: [email protected]
[mailto:[email protected]]on Behalf Of
[email protected]
Sent: Friday, October 04, 2002 09:16
To: [email protected]
Subject: RE: [Mspgcc-users] monitor keyword


Hello,

Be careful with using dint() eint(). If interrupts were disabled before your
function is called
you may end up enabling them. I use

asm("push r2");
dint();
....
....
asm("pop r2"); <- that assumes your function does not modify flags in the
body

Regards,
Alexey

> -----Original Message-----
> From: Shehata, Karim [mailto:[email protected]]
> Sent: Friday, October 04, 2002 9:10 AM
> To: 'MSPGCC User List'
> Subject: [Mspgcc-users] monitor keyword
>
>
>
> Hello everyone!
>
> In IAR's icc430 compiler, there's a keyword "monitor" that
> can be used when
> declaring a function to disable all interrupts during it's
> execution.  Does
> mspgcc have anything similar?  I suppose a work-around would
> be to just put
> dint() and eint() at the beginning and end of each monitor
> function, but
> that's a bit of a hassle when trying to port larger sets of code.
>
> For anyone interested, I'm porting over some code that my company has
> developed using Embedded Workbench 2.31E using the windows
> binaries from
> mikrocontroller.net date 10-02-2002 (Thanks Andreas!).  So
> far, I've gotten
> everything to compile with some minor changes (ISR
> declarations, monitor,
> printf), and even tested out some of the functionality on our
> prototype
> device using C-SPY.
>
> Cheers!
>
>
> /***************************************
>  * Karim Shehata                       *
>  * [email protected]   *
>  * Research and Development Engineer   *
>  * Messier-Dowty Toronto               *
>  ***************************************/
>
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mspgcc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users



Reply via email to