1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<HTML>
3<HEAD>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<TITLE>OS_SetPeriodicVAlarm</TITLE>
8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css">
9</HEAD>
10<BODY>
11<H1 align="left">OS_SetPeriodicVAlarm <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></H1>
12<H2>Syntax</H2>
13<DL>
14  <DD>
15  <PRE><CODE>#include &lt;nitro/os.h&gt;</CODE></PRE>
16  <PRE><CODE>void OS_SetPeriodicVAlarm(
17                OSVAlarm*           alarm ,
18                s16                 count ,
19                s16              delay ,
20                OSVAlarmHandler     handler ,
21                void*            arg ); </CODE></PRE>
22</DL>
23<H2>Arguments</H2>
24<TABLE border="1" width="100%">
25  <TBODY>
26    <TR>
27      <TD width="13%"><EM><STRONG>alarm</STRONG></EM></TD>
28      <TD width="87%">Pointer to the V-Count alarm structure for setting V-Count alarm</TD>
29    </TR>
30    <TR>
31      <TD width="13%"><EM><STRONG>count</STRONG></EM></TD>
32      <TD width="87%">The V-Count at which the V-Count alarm will be actuated (handler will be called) in each frame.</TD>
33    </TR>
34    <TR>
35      <TD><EM><STRONG>delay</STRONG></EM></TD>
36      <TD>The maximum permissible number of V-Counts for delay.</TD>
37    </TR>
38    <TR>
39      <TD><EM><STRONG>handler</STRONG></EM></TD>
40      <TD>The V-Count alarm handler</TD>
41    </TR>
42    <TR>
43      <TD><EM><STRONG>arg</STRONG></EM></TD>
44      <TD>The argument used when the V-Count alarm handler is called</TD>
45    </TR>
46  </TBODY>
47</TABLE>
48<H2>Return Values</H2>
49<P>None.</P>
50<H2>Description</H2>
51<P>Sets a periodic V-Count alarm.</P>
52<P>In each frame, <code><strong><em>handler</em></strong></code> is called when the V-Count reaches <code><strong><em>count</em></strong></code>. The V-Count alarm handler <code>handler</code> is an <code>OSVAlarmHandler</code> function defined by the following:</P>
53<P>  <CODE>typedef void (*OSVAlarmHandler)( void* );</CODE></P>
54<P>  <B><I>handler</I></B> is called from the OS V-Count interrupt handler. Therefore, interrupts are prohibited. When the <em><strong><code>handler</code></strong></em> is called, it takes <code><strong><em>arg</em></strong></code> as an argument.</P>
55<P>It is possible to specify the amount of permissible delay when the hander cannot be called at the exact number of specified V-Count because of another V-Count alarm or interrupt. For example, at count=100 and delay=5, V-Count is called if it is possible to call it by count 105, even if it was not possible to call it by count 100. When you specify <code>0</code>, the alarm is called only at the specified V-Count. If <code>OS_VALARM_DELAY_MAX</code>, it is always called when a call is possible for the specified V-Count and subsequent V-Counts. For details, see the description in <a href="about_VAlarm.html">VAlarm Overview</a>.</P>
56<P>If <em><strong><code>alarm</code></strong></em> is specified for the pointer to the <code>OSAlarm</code> structure in which the V-Count has been set, it stops with <a href="../debug/OS_Panic.html"><code>OS_Panic()</code></a>.</P>
57<P><code><a href="OS_CancelVAlarm.html">OS_CancelVAlarm()</a></code> or <code><a href="OS_CancelVAlarms.html">OS_CancelVAlarms()</a></code> is used to stop the V-Count alarm.</P>
58<H2>See Also</H2>
59<P><CODE><A href="OS_InitVAlarm.html">OS_InitVAlarm</A>,
60 <A href="OS_CreateVAlarm.html">OS_CreateVAlarm</A>,
61 <A href="OS_SetVAlarm.html">OS_SetVAlarm</A>,<BR> <A href="OS_CancelVAlarm.html">OS_CancelVAlarm</A>, <A href="OS_CancelVAlarms.html">OS_CancelVAlarms</A><BR></CODE></P>
62<H2>Revision History</H2>
63<P>
642005/03/08 Standardized the use of the term 'interrupt' in Japanese.<br>2004/08/30 Added statement about not being able to use the set V alarm structure.<br>2004/07/06 Added statement about delay.<br>2004/02/24 Initial version</P>
65<hr><p>CONFIDENTIAL</p></body>
66</HTML>