pub fn IntrWait(ignore_existing: bool, target_irqs: IrqBits)
Expand description

0x04: Waits for a specific interrupt type(s) to happen.

Pauses the CPU until any of the interrupt types set in target_irqs to occur. This can create a significant savings of the battery while you’re waiting, so use this function when possible.

Important: This function forces IME on.

Your interrupt handler (if any) will be run before this function returns.

If none of the interrupts specified in target_irqs are properly configured to fire then this function will loop forever without returning.

This function uses a special BIOS variable to track what interrupts have occured recently.

  • If ignore_existing is set, then any previous interrupts (since IntrWait was last called) that match target_irqs are ignored and this function will wait for a new target interrupt to occur.
  • Otherwise, any previous interrupts that match target_irqs will cause the function to return immediately without waiting for a new interrupt.