Synopsis
#include <inmaxq.h>
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 and produces inline code.

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

  // Processing with interrupts enabled here

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

__enable_interrupt can be used on any MAXQ device.

See Also

__restore_interrupt