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_SetPeriodicAlarm</TITLE> 8<LINK rel="stylesheet" href="../../css/nitro.css" type="text/css"> 9</HEAD> 10<BODY> 11<H1 align="left">OS_SetPeriodicAlarm <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 <nitro/os.h></CODE></PRE> 16 <PRE><CODE>void OS_SetPeriodicAlarm( 17 OSAlarm* alarm, 18 OSTick start , 19 OSTick period , 20 OSAlarmHandler handler, 21 void* arg ); 22 </CODE></PRE> 23</DL> 24<H2>Arguments</H2> 25<TABLE border="1" width="100%"> 26 <TBODY> 27 <TR> 28 <TD width="13%"><EM><STRONG>alarm</STRONG></EM></TD> 29 <TD width="87%">Pointer to an alarm structure that is initialized for this alarm.</TD> 30 </TR> 31 <TR> 32 <TD width="13%"><EM><STRONG>start</STRONG></EM></TD> 33 <TD width="87%">Tick count for first actuation of the alarm (calling the handler) (This is not a relative value from the current time, but an absolute value.)</TD> 34 </TR> 35 <TR> 36 <TD><EM><STRONG>period</STRONG></EM></TD> 37 <TD>Interval at which the alarm will be activated</TD> 38 </TR> 39 <TR> 40 <TD><EM><STRONG>handler</STRONG></EM></TD> 41 <TD>Alarm handler.</TD> 42 </TR> 43 <TR> 44 <TD><EM><STRONG>arg</STRONG></EM></TD> 45 <TD>Argument used when the alarm handler is called</TD> 46 </TR> 47 </TBODY> 48</TABLE> 49<H2>Return Values</H2> 50<P>None.</P> 51<H2>Description</H2> 52<P>Sets a periodic alarm.</P> 53<P>The alarm handler <B><I>handler</I></B> is first called when the tick value equals <B><I>start </I></B>. The V-Count alarm handler <code><strong><em>handler</em></strong></code> is an <code>OSVAlarmHandler</code> function defined by the following:</P> 54<BLOCKQUOTE><CODE>typedef void (*OSAlarmHandler)( void* );</CODE></BLOCKQUOTE> 55<P> When the <em><strong><code>handler</code></strong></em> is called, it takes <code><strong><em>arg</em></strong></code> as an argument. The <code><strong><em>handler</em></strong></code> argument is passed from the OS timer interrupt handler. Therefore, interrupts are prohibited.</P> 56<P>One tick count unit is 1/64 of the hardware system clock.</P> 57<P>If <em><strong><code>alarm</code></strong></em> specifies the pointer to the <code>OSAlarm</code> structure which the alarm has set, <code>OS_Panic</code> stops the alarm.</P> 58<P><A href="OS_CancelAlarm.html"><code>OS_CancelAlarm</code></A> is used to stop the alarm.</P> 59<H2>See Also</H2> 60<P><CODE><A href="OS_InitAlarm.html">OS_InitAlarm</A>, 61 <A href="OS_CreateAlarm.html">OS_CreateAlarm</A>, 62 <A href="OS_SetAlarm.html">OS_SetAlarm</A>, 63 <A href="OS_CancelAlarm.html">OS_CancelAlarm</A><BR> <A href="../time/OS_SecondsToTicks.html">OS_*SecondsToTick</A><BR></CODE></P> 64<H2>Revision History</H2> 65<P> 662005/03/08 Standardized the use of the term <I>interrupt</I> in Japanese.<br>2004/12/22 Added a statement about the alarm handler's being called from the timer interrupt handler.<br>2004/08/30 Added a statement about not being able to use the set alarm structure.<br>2004/02/25 Changed <CODE>systemClock</CODE> to <I>tick</I>.<br>2004/02/04 Initial version.</P> 67<hr><p>CONFIDENTIAL</p></body> 68</HTML>