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_SetIrqFunction</title>
9<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
10</head>
11
12<body>
13
14<h1 align="left">OS_SetIrqFunction <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 &lt;nitro/os.h&gt;</CODE><BR>
20  <BR>
21  <CODE>void OS_SetIrqFunction( OSIrqMask intr, OSIrqFunction function );</CODE></dd>
22</dl><h2>Arguments</h2>
23<TABLE border="1">
24  <TBODY>
25    <TR>
26      <TD><B><I>intr</I></B></TD>
27      <TD>The IRQ interrupt cause(s) to set.</TD>
28    </TR>
29    <TR>
30      <TD><B><I>function</I></B></TD>
31      <TD>Interrupt handler.</TD>
32    </TR>
33  </TBODY>
34</TABLE>
35<h2>Return Values</h2>
36<p>None.</p>
37<H2>Description</H2>
38<P>This function sets the interrupt handler.</P>
39<P>This function sets the function (that is, the interrupt handler) to which control jumps when the specified IRQ interrupt(s) occur. In <EM><STRONG>intr</STRONG></EM>, specify the IRQ interrupt cause for which to set a handler. In <B><I>function</I></B>, specify the handler.</P>
40<P>The interrupt handler belongs to the <code>OSIrqFunction</code> type . It is a <CODE>void</CODE> function, without arguments.</P>
41<H3><BR>Types of Interrupts</H3>
42<P>See below for information on the types of interrupts.</P>
43<P>? <A href="interrupts_list.html">Types of Interrupts</A></P>
44<H3><BR> For example:</H3>
45<BLOCKQUOTE style="background-color:#ffffd0;"><CODE>main()<BR> {<BR> :<BR>OS_InitIrqTable();<BR> OS_SetIrqFunction( OS_IE_V_BLANK, vhandler );<BR> :<BR>}<BR> <BR> void vhandler( void )<BR> {<BR> // V-Blank interrupt process<BR> }</CODE></BLOCKQUOTE>
46<H3><BR> Note:</H3>
47<P>You need to be cautious about timer interrupts. With the hardware timer specifications, the set timer interrupts are generated repeatedly. With the OS, the settings for the registered handler are released when the first interrupt is generated, so only that first timer interrupt is generated. To generate repeated timer interrupts, processing to carry out settings needs to be done again in the interrupt handler.</P>
48<h2>See Also</h2>
49<p><a href="OS_SetIrqMask.html"><code>OS_SetIrqMask</code></a>, <a href="OS_InitIrqTable.html"><code>OS_InitIrqTable</code></a>, <a href="OS_GetIrqFunction.html"><code>OS_GetIrqFunction</code></a></p>
50<H2>Revision History</H2>
51<P>
522005/03/08 Standardized the Japanese term for &quot;interrupt.&quot;<br /> 2004/06/03 Added note about timer interrupts.<BR>2003/12/01 Initial version.</P>
53<hr><p>CONFIDENTIAL</p></body>
54</html>
55