Synopsis
unsigned __enable_interrupt(void);
Description

__enable_interrupt enables global interrupts by setting the IGE bit in the interrupt control register IC and returns the value of the interrupt control register before the IGE bit is set. You can restore the state of the IGE bit from the value returned from __enable_interrupt by using the __restore_interrupt intrinsic function.

__enable_interrupt is an intrinsic function, produces inline code, and you can use it on any MAXQ30 device.

void run_with_interrupts_enabled(void)
{
// \em{Enable interrupts and save interrupt enable state}
unsigned char state = __enable_interrupt();

// \em{Processing with interrupts enabled here}

// em{Restore interrupt enable state from saved value}
__restore_interrupt(state);
}