EmbeddedRelated.com
Forums

Global Interrupt Enable

Started by Nico Bollen August 1, 2006
Dear,
Does anybody know how to check in IAR C compiler if the GIE(Global
Interrupt Enable)-bit is set?
Thanks

Beginning Microcontrollers with the MSP430

Nico Bollen wrote:
> Dear,
> Does anybody know how to check in IAR C compiler if the GIE(Global
> Interrupt Enable)-bit is set?

It should be something like the following:

#include

void f()
{
if (__get_SR_register() & __SR_GIE)
{
// Jomenvisst.
}
else
{
// Icke sa Nicke.
}
}

-- Anders Lindgren, IAR Systems
--
Disclaimer: Opinions expressed in this posting are strictly my own and
not necessarily those of my employer.
GIE is a bit in the Status register, I presume you open a window for the CPU registers in C-spy.

-- Kris

-----Original Message-----
From: m... [mailto:m...] On Behalf Of Nico Bollen
Sent: Wednesday, 2 August 2006 1:18 AM
To: m...
Subject: [msp430] Global Interrupt Enable

Dear,
Does anybody know how to check in IAR C compiler if the GIE(Global
Interrupt Enable)-bit is set?
Thanks