SparkFun Forums 

Where electronics enthusiasts find answers.

Discussions on how to get your MSP JTAG programmer up and running.
By stube40
#132186
My interrupt service routines generally look like this:

#pragma vector = PORT1_VECTOR
__interrupt void PORT1_ISR(void)
{
__disable_interrupt(); // Disable global INTs so nothing can interrupt this ISR

// General content of ISR

__enable_interrupt(); // Re-enable global INTs
}

I was wondering - is it necessary to manually disable/enable interrupts as I currently do, or does IAR automatically look after this for you when it compiles hence making my calls to __disable_interrupt() and __enable_interrupt() redundant?
By UhClem
#132214
stube40 wrote: I was wondering - is it necessary to manually disable/enable interrupts as I currently do, or does IAR automatically look after this for you when it compiles hence making my calls to __disable_interrupt() and __enable_interrupt() redundant?
Read the user guide for the particular MSP430 family you are using. I checked one to verify my memory of interrupt processing:

"The SR is cleared. This terminates any low-power mode. Because the GIE bit is cleared, further
interrupts are disabled."

The hardware does it.
By stube40
#132257
UhClem wrote:
stube40 wrote: I was wondering - is it necessary to manually disable/enable interrupts as I currently do, or does IAR automatically look after this for you when it compiles hence making my calls to __disable_interrupt() and __enable_interrupt() redundant?
Read the user guide for the particular MSP430 family you are using. I checked one to verify my memory of interrupt processing:

"The SR is cleared. This terminates any low-power mode. Because the GIE bit is cleared, further
interrupts are disabled."

The hardware does it.
Many thanks!