libctru/libctru/include/3ds/services
StapleButter 1f413a7d44 Add synchronization mechanism for entering sleep mode.
When the APT status is APP_PREPARE_SLEEPMODE, the application main thread should call aptSignalReadyForSleep() to signal that it is ready to enter sleep mode, and then call aptWaitStatusEvent() as usual.

Example code:

APP_STATUS status;
while ((status = aptGetStatus()) != APP_EXITING)
{
	if(status==APP_RUNNING)
	{
		// application logic here
	}
	else if(status == APP_SUSPENDING)
	{
		aptReturnToMenu();
	}
	else if(status == APP_PREPARE_SLEEPMODE)
	{
		aptSignalReadyForSleep();
		aptWaitStatusEvent();
	}
}

This maybe isn't the proper/recommended way to do sleep mode, but I tested it multiple times and it always worked reliably.

(note: maybe the sample code above will not work if GPU drawing is done in a separate thread, haven't tested that)
2014-09-18 22:09:15 +02:00
..
ac.h Reorganize includes 2014-08-26 23:18:14 +02:00
apt.h Add synchronization mechanism for entering sleep mode. 2014-09-18 22:09:15 +02:00
cfgnor.h Reorganize includes 2014-08-26 23:18:14 +02:00
csnd.h Reorganize includes 2014-08-26 23:18:14 +02:00
fs.h Add FSUSER_GetSdmcArchiveResource(). 2014-08-26 19:01:00 -05:00
gsp.h * Make the GSP event handler signal events in the right order (essential for proper PICA200 sync) 2014-09-13 17:01:20 +02:00
hid.h Improved HID code, and added Accelerometer/Gyroscope support. 2014-08-30 20:41:09 -04:00
httpc.h Reorganize includes 2014-08-26 23:18:14 +02:00
ir.h Reorganize includes 2014-08-26 23:18:14 +02:00
mic.h Added code for using the microphone and an example app for it. 2014-09-03 14:36:05 -04:00
ptm.h Reorganize includes 2014-08-26 23:18:14 +02:00
soc.h Reorganize includes 2014-08-26 23:18:14 +02:00