ProcUIInit / ProcUIInitEx

Syntax

#include <cafe/procui.h>

typedef void (*ProcUISaveCallbackFunction)(void);
typedef u32 (*ProcUISaveCallbackFunctionEx)(void*);

void ProcUIInit(ProcUISaveCallbackFunction func);
void ProcUIInitEx(ProcUISaveCallbackFunctionEx func, void* data);

Parameters

None.

Parameters

func The callback that is called from the main thread as soon as all of the release callbacks are called and just before releasing the foreground. This callback must call OSSavesDone_ReadyToRelease.
data The data that is passed to the callback. This data is application-defined.

Return Values

None.

Description

Initializes the threads and memory used by the ProcUI library. When initialized, ProcUI issues a callback thread on each of the cores. These threads are responsible for calling the callback functions set by the user. They have a priority of 16, and a default stack size of 8×1024.

You must supply return values when returning from the callback function pointed to by ProcUISaveCallbackFunctionEx. If the code in your callback fails, you should return a nonzero value. If it succeeds, you should return 0. The value is returned in the callback thread.

If you pass TRUE as the argument to the ProcUIProcessMessages function, you need to call only the following four functions used by ProcUI:

The DEMO library includes an implementation that offers one possible solution for process switching by using the ProcUI library. For information, see:

$CAFE_ROOT/system/src/lib/demo/demoSystem.c

Do Not Call From

ProcUIInit

Background Do not call this function from the background.
Multiple threads This function is not thread-safe.

ProcUIInitEx

Background Do not call this function from the background.
Multiple threads This function is not thread-safe.

See Also

Process Switching and Shutdown Tips
ProcUISetCallbackStackSize
ProcUIProcessMessages
ProcUIDrawDoneRelease
ProcUIShutdown

Revision History

2014/01/20 Terminology fix.
2013/05/08 Automated cleanup pass.
2012/08/21 Cleanup Pass
2012/05/04 Initial version.


CONFIDENTIAL