Standby switch detection.

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Standby switch detection.

Post by Art »

Hi Guys,
I'm hoping to catch a flick of the standby (suspend) action
to set a variable in the instant before the PSP actualy suspends,
so that whn an app wakes up, it knows that it was woken from suspend.
is it possible to read the switch state without any other action?

I know I'm supposed to be able to take over suspend and standby functions,
but this has introduced other problems in another app, which caused me to
just lock the power switch completely.
Cheers, Art.
If not actually, then potentially.
SilverSpring
Posts: 110
Joined: Tue Feb 27, 2007 9:43 pm
Contact:

Post by SilverSpring »

0xf775bc34 sceSysconGetWakeUpFactor

Code: Select all

int val;

sceSysconGetWakeUpFactor(&val);

if (val & 0x40)
{
    // is from coldboot
}
else if (val & 0x80)
{
    // is waking from sleep mode
}
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

SilverSpring wrote:0xf775bc34 sceSysconGetWakeUpFactor

Code: Select all

int val;

sceSysconGetWakeUpFactor(&val);

if (val & 0x40)
{
    // is from coldboot
}
else if (val & 0x80)
{
    // is waking from sleep mode
}
So you found the name. Cool, that's the func I was using in the timemachine ipl to distinguish sleep mode ipl boot from normal :P
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Thanks, that will be most helpful :)
I guess it doesn't really matter if the program knows before it happens,
or after it happens, as long as it knows.
If not actually, then potentially.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Power callback should do what you want.

There's a sample in the SDK.
Post Reply