libctru/libctru/source
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
..
allocator Add proper linear heap allocator 2014-09-17 00:22:30 +02:00
gpu some GSP and GPU fixes 2014-08-28 22:53:45 -07:00
services Add synchronization mechanism for entering sleep mode. 2014-09-18 22:09:15 +02:00
gfx.c Refactor linear heap code (formerly known as GSP heap) 2014-08-27 23:44:38 +02:00
initSystem.c initSystem: fix global ctor/dtor code 2014-08-28 00:00:53 +02:00
os.c os: Added osGetTime(). 2014-09-06 21:07:26 +02:00
srv.c Reorganize includes 2014-08-26 23:18:14 +02:00
svc.s use svcDuplicateHandle in handle override 2014-08-17 13:37:49 -07:00