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="Microsoft FrontPage 5.0"> 6<META http-equiv="Content-Style-Type" content="text/css"> 7<LINK rel="stylesheet" type="text/css" href="../../CSS/revolution.css"> 8<TITLE>OSSetPowerCallback</TITLE> 9</HEAD> 10<BODY> 11<H1>OSSetPowerCallback</H1> 12<H2>C Specification</H2> 13<DL> 14 <DD> 15<PRE><CODE>#include <revolution/os.h></CODE></PRE> 16 <DD> 17<PRE><CODE>typedef void (*OSPowerCallback)(void);</CODE></PRE> 18 <DD> 19<PRE><CODE>OSPowerCallback OSSetPowerCallback(OSPowerCallback callback);</CODE></PRE> 20</DL> 21<H2>Arguments</H2> 22<TABLE border="1" cellpadding="3" cellspacing="0.1"> 23 <TBODY> 24 <TR> 25<TD width="120" valign="top" bgcolor="#ffffe8"><EM><FONT face="Courier New"><STRONG>callback</STRONG></FONT></EM></TD> 26<TD width="520">Pointer to the callback function called at time of power button input.</TD> 27 </TR> 28 </TBODY> 29</TABLE> 30<H2>Return Values</H2> 31<P>Returns a pointer to a previously set callback function.</P> 32<H2>Description</H2> 33<P>Registers a one time power button callback. The callback function is called only once when the power button is pressed. The callback is then automatically unregistered. In principle, the application receiving the power button callback must execute shutdown procedures within a set amount of time.</P> 34 35<P><B><B>Note:</B></B>Because the power button callback is called in a state that prohibits interrupts, you should keep the process performed by the application as short as possible.</P> 36 37<H2>See Also</H2> 38<P><a href="../toc.html#Reset Button" target="contents">Reset Button Functions</a>,<br> 39<H2>Revision History</H2> 40<P> 4108/10/2006 Initial version. 42</P> 43<hr> 44<P>CONFIDENTIAL</p> 45</BODY> 46</HTML>