#include <revolution/sc.h> typedef void (*SCFlushCallback)(u32 result); u32 SCFlush(void); void SCFlushAsync(SCFlushCallback callback);
There are no arguments to the SCFlush function.
The arguments for the SCFlushAsync function are shown below.
| callback | Callback function called when processing ends. No callback function is called if NULL is specified. |
|---|
One of the SC_STATUS_* values is returned for the SCFlush function.
There are no return values for the SCFlushAsync function.
Console settings maintained in RAM are reflected in internal flash memory. After console settings change, be sure to call the SCFlush or the SCFlushAsync function.
The SCFlush function does not return until processing to reflect settings has completed. Therefore, do not call the SCFlush function from the interrupt handler or a callback.
The SCFlushAsync function executes processing to reflect settings in the background. The callback function specified by the callback argument is called on success and failure. No callback function is called if NULL is specified.
Flash memory is not accessed if there are no changes to the console settings maintained in RAM.
When more than one setting is changed in the same cycle, you only need to call the SCFlush* functions once at the end of the cycle.
The return value of the SCFlush function has the same meaning as the result argument of the SCFlushAsync callback function, as follows.
| Return Values and Arguments | Results |
| SC_STATUS_OK | Processing succeeded. |
|---|---|
| SC_STATUS_BUSY | Could not launch process. There is an update process currently executing.(This value is not returned in SCFlush.) |
| SC_STATUS_ERROR | Processing failed. |
The return value of the SCCheckStatus function is updated regardless of which function was called.
If the SCFlush function is called while update processing is running in the background after the SCFlushAsync function has been called, the system waits in the SCFlush function until update processing completes.
Depending on active libraries and interrupts, update processing may be executing at unexpected times when the SCFlush* functions are called. In order to accurately apply console settings that you have changed, be sure to call the SCCheckStatus function after changing the settings and make sure that the return code is SC_STATUS_OK. If you call the SCFlush* 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.
2006/08/31 Corrected a problem with SCFlush. Corrected a problem with SCFlushAsync and added a callback function.
2006/05/29 Initial version.
CONFIDENTIAL