| View previous topic :: View next topic |
| Author |
Message |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Sat Mar 01, 2008 5:31 am Post subject: Standby switch detection. |
|
|
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. |
|
| Back to top |
|
 |
SilverSpring
Joined: 27 Feb 2007 Posts: 115
|
Posted: Sat Mar 01, 2008 5:45 am Post subject: |
|
|
0xf775bc34 sceSysconGetWakeUpFactor
| Code: | int val;
sceSysconGetWakeUpFactor(&val);
if (val & 0x40)
{
// is from coldboot
}
else if (val & 0x80)
{
// is waking from sleep mode
} |
|
|
| Back to top |
|
 |
moonlight
Joined: 26 Oct 2005 Posts: 567
|
Posted: Sat Mar 01, 2008 8:28 am Post subject: |
|
|
| SilverSpring wrote: | 0xf775bc34 sceSysconGetWakeUpFactor
| Code: | 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 |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Sat Mar 01, 2008 9:02 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sat Mar 01, 2008 12:09 pm Post subject: |
|
|
Power callback should do what you want.
There's a sample in the SDK. |
|
| Back to top |
|
 |
|