1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3 4<head> 5<META http-equiv="Content-Type" content="text/html; charset=windows-1252"> 6<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows"> 7<META http-equiv="Content-Style-Type" content="text/css"> 8<title>OS_WaitInterrupt</title> 9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 10</head> 11 12<body> 13 14<h1 align="left">OS_WaitInterrupt <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></h1> 15<h2>Syntax</h2> 16 17<dl> 18 <dd> 19<CODE>#include <nitro/os.h></CODE><BR> 20 <BR> 21 <CODE>void OS_WaitInterrupt( BOOL clear, OSIrqMask irqFlags );</CODE></dd> 22</dl><h2>Arguments</h2> 23<TABLE border="1"> 24 <TBODY> 25 <TR> 26 <TD><B><I>clear</I></B></TD> 27 <TD>Indicates whether check flags should be cleared.</TD> 28 </TR> 29 <TR> 30 <TD><B><I>irqFlags</I></B></TD> 31 <TD>The mask value of the interrupt generation for which the function is waiting. You can specify more than one by using a logical sum.</TD> 32 </TR> 33 </TBODY> 34</TABLE> 35<h2>Return Values</h2> 36<p>None.</p> 37<H2>Description</H2> 38<p>Waits for the generation of a specified IRQ interrupt cause.</p> 39<p>In <code>irqFlags</code> 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. Refer to the following information for the types of interrupts.</p> 40<p>? <A href="../irq/interrupts_list.html">Types of Interrupts</A></p> 41<BLOCKQUOTE style="background-color:#ffffcc;"><CODE>(Example) Waits for either VBLANK or TIMER0.</CODE><BR> <BR> <CODE>OS_WaitInterrupt( TRUE, OS_IE_V_BLANK | OS_IE_TIMER0 );</CODE></BLOCKQUOTE> 42<p>To determine if an interrupt occurred, examine whether the interrupt check flag has been set. To set this flag, the user must explicitly call <code><a href="../irq/OS_SetIrqCheckFlag.html">OS_SetIrqCheckFlag</a></code> from the interrupt handler.</p> 43<p>If <B><I>clear</I></B> is set to <CODE>TRUE</CODE>, the interrupt check flags specified in <B><I>irqFlags</I></B> will be reset before waiting for the interrupt to occur. If FALSE, they will not be reset. If they are not reset, and the check flag you want to wait on is set when this function is reached, control will return from this function immediately.</p> 44<H3><BR> <BR> Differences Between <CODE>OS_WaitInterrupt()</CODE> and <CODE><A href="../irq/OS_WaitIrq.html">OS_WaitIrq()</A></CODE></H3> 45<p>The difference between <A href= "../system/OS_WaitInterrupt.html"><code>OS_WaitInterrupt()</code></a> and <A href="../irq/OS_WaitIrq.html"><CODE>OS_WaitIrq()</CODE></A> is this: While <code>OS_WaitInterrupt()</code> is waiting for an interrupt cause, it uses <a href="../system/OS_Halt.html"><code>OS_Halt()</code></a> to stop. While <code>OS_WaitIrq()</code> is waiting for an interrupt cause, it switches processing to another thread. It restarts operation after an interrupt is generated. If no threads are used, both functions behave the same.</p> 46<h2>See Also</h2> 47<p><code><a href="../irq/OS_SetIrqCheckFlag.html">OS_SetIrqCheckFlag</a></code>, <code><a href="../irq/OS_WaitIrq.html">OS_WaitIrq</a></code></p> 48<H2>Revision History</H2> 49<P> 502005/03/08 Standardized the Japanese term for "interrupt."<br> 2004/05/24 Initial version.</P> 51<hr><p>CONFIDENTIAL</p></body> 52</html> 53