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 http-equiv="Content-Style-Type" content="text/css"> 7 8<LINK rel="stylesheet" type="text/css" href="../CSS/revolution.css"> 9 10<TITLE>SCFlush*</TITLE> 11 12</HEAD> 13 14<BODY> 15 16 17<H1>SCFlush*</H1> 18 19 20 21<H2>Syntax</H2> 22<dl><dd><pre class="construction"> 23#include <revolution/sc.h> 24 25typedef void (*SCFlushCallback)(u32 result); 26 27u32 SCFlush(void); 28void SCFlushAsync(SCFlushCallback callback); 29</pre></dd></dl> 30 31 32<H2>Arguments</H2> 33<p>There are no arguments to the <code>SCFlush</code> function.</p> 34<p>The arguments for the <code>SCFlushAsync</code> function are shown below.</p> 35<TABLE class="arguments" border="1" > 36 <TBODY> 37 <TR> 38<TH>callback</TH> 39<TD>Callback function called when processing ends. No callback function is called if <code>NULL</code> is specified.</TD> 40 </TR> 41 </TBODY> 42</TABLE> 43 44<H2>Return Values</H2> 45<P>One of the <code>SC_STATUS_*</code> values is returned for the <code>SCFlush</code> function.</P> 46 47<p>There are no return values for the <code>SCFlushAsync</code> function.</p> 48 49<H2>Description</H2> 50<p> 51Console settings maintained in RAM are reflected in internal flash memory. After console settings change, be sure to call the <code>SCFlush</code> or the <code>SCFlushAsync</code> function. 52</p> 53 54<p> 55The <code>SCFlush</code> function does not return until processing to reflect settings has completed. Therefore, do not call the <code>SCFlush</code> function from the interrupt handler or a callback. 56</p> 57 58<p> 59The <code>SCFlushAsync</code> function executes processing to reflect settings in the background. The callback function specified by the <SPAN class="argument">callback</SPAN> argument is called on success and failure. No callback function is called if <code>NULL</code> is specified. 60</p> 61 62<p> 63Flash memory is not accessed if there are no changes to the console settings maintained in RAM. 64</p> 65 66<p> 67When more than one setting is changed in the same cycle, you only need to call the <code>SCFlush*</code> functions once at the end of the cycle. 68</p> 69 70<p> 71The return value of the <code>SCFlush</code> function has the same meaning as the <SPAN class="argument">result</SPAN> argument of the <code>SCFlushAsync</code> callback function, as follows. 72</p> 73 74<TABLE class="arguments" border="1" > 75 <TBODY> 76 <TR> 77<TD width="30%" valign="middle" bgcolor="#C0C0C0"><STRONG>Return Values and Arguments</STRONG></TD> 78<TD width="*" valign="middle" bgcolor="#C0C0C0"><STRONG>Results</STRONG></TD> 79 </TR> 80 <TR> 81<TH>SC_STATUS_OK</TH> 82<TD>Processing succeeded.</TD> 83 </TR> 84 <TR> 85<TH>SC_STATUS_BUSY</TH> 86<TD>Could not launch process. There is an update process currently executing.(This value is not returned in <code>SCFlush</code>.)</TD> 87 </TR> 88 <TR> 89<TH>SC_STATUS_ERROR</TH> 90<TD>Processing failed.</TD> 91 </TR> 92 </TBODY> 93</TABLE> 94 95<p> 96The return value of the <a href="SCCheckStatus.html"><code>SCCheckStatus</code></a> function is updated regardless of which function was called. 97</p> 98 99<p> 100If the <code>SCFlush</code> function is called while update processing is running in the background after the <code>SCFlushAsync</code> function has been called, the system waits in the <code>SCFlush</code> function until update processing completes. 101</p> 102 103<p> 104Depending on active libraries and interrupts, update processing may be executing at unexpected times when the <code>SCFlush*</code> functions are called. In order to accurately apply console settings that you have changed, be sure to call the <code>SCCheckStatus</code> function after changing the settings and make sure that the return code is <code>SC_STATUS_OK</code>. If you call the <code>SCFlush*</code> functions afterward, even if you cannot launch update processing yourself, your changes will be applied because someone else is executing update processing along with your changes. 105</p> 106 107<H2>See Also</H2> 108<p class="reference"> 109<a href="SCCheckStatus.html">SCCheckStatus</a> 110</p> 111 112<H2>Revision History</H2> 113<P> 1142006/08/31 Corrected a problem with <code>SCFlush</code>. Corrected a problem with <code>SCFlushAsync</code> and added a callback function.<br>2006/05/29 Initial version.<br> 115</P> 116 117<hr><p>CONFIDENTIAL</p></body> 118</HTML> 119