# OS_WaitIrq

## C Specification

  `#include <nitro/os.h>`
  `void OS_WaitIrq( BOOL clear, OSIrqMask irqFlags );`

## Arguments

clear | Indicates whether or not check flags should be cleared.
irqFlags | The mask value of the interrupt generation for which the function is waiting. You can specify more than one by using a logical sum.

## Return Values

None.

## Description

Waits for the generation of a specified IRQ interrupt source In `irqFlags` you can specify multiple interrupt sources by logical OR-ing the mask values. Generation of any of the interrupts included here will cause a return from the function.

A check flag can be set after an IRQ interrupt is generated it indicate that interrupt. To set this flag, the user must explicitly call `OS_SetIrqCheckFlag` from the interrupt handler.

If you set `clear` to `TRUE`, before waiting, this resets interrupt flags that are specified by `irqFlags` from amongst the interrupt check flags. If a relevant check flag has been preset, and there are no flags to reset, return from the function will be immediate.

The difference between `OS_WaitInterrupt()` and `OS_WaitIrq()` is this: While `OS_WaitInterrupt()` is waiting for an interrupt, it it uses `OS_Halt()` to stop. While `OS_WaitIrq()` is waiting for an interrupt, it switches processing to another thread. It restarts operation after an interrupt is generated. If no threads are used, both functions behave the same.

## See Also

`OS_SetIrqCheckFlag()`, `OS_WaitInterrupt`

## Revision History

03/08/2005 Standardized the Japanese term for "interrupt"
05/24/2004 Clarified the differences from`OS_WaitInterrupt()`
05/01/2004 Initial version