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=utf-8">
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
13<H2>Syntax</H2>
14<dl><dd><pre class="construction">
15#include &lt;revolution/os.h&gt;
16
17typedef void (*OSPowerCallback)(void);
18
19OSPowerCallback OSSetPowerCallback(OSPowerCallback callback);
20</pre></dd></dl>
21
22<H2>Arguments</H2>
23<TABLE class="arguments" border="1" >
24  <TBODY>
25    <TR>
26<TH>callback</TH>
27<TD>Pointer to the callback function called at time of power button input.</TD>
28    </TR>
29  </TBODY>
30</TABLE>
31
32<H2>Return Values</H2>
33<P>Returns a pointer to a previously set callback function.</P>
34
35<H2>Description</H2>
36<P>Registers a one-time power button callback. The callback function is called only once when the Power Button on the console is pressed or when the Power Button on the paired Wii Remote is held down, and then callback registration is automatically deleted. In principle, the application receiving the power button callback must execute shutdown procedures within a set amount of time.</P>
37
38<P><B>Note:</B></P>
39<UL>
40<LI>The processes to be performed by the application should be as short as possible because the power button callback is called in an interrupt-prohibited state.</LI>
41
42<LI>In some circumstances, the registered callback function might not get called even when the conditions are fully met. For more information about when this can occur and a workaround, see <a href="../../nand/intro.html#NAND RW NOTICE">Notes Regarding Read/Writes to Wii Console NAND Memory</a>.</LI>
43</UL>
44
45<H2>See Also</H2>
46<P class="reference">
47<A href="../toc.html#Reset Button" target="contents">Reset Button Functions</A>
48</P>
49
50<H2>Revision History</H2>
51<P>
522010/05/28 Added a link for more information to the note regarding the failure to call the registered callback.<BR>2006/08/30 Added a description about the Power Button on the Wii Remote.<BR>2006/08/10 Initial version.<br>
53</P>
54
55<hr><p>CONFIDENTIAL</p></body>
56</HTML>