forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Standby switch detection.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sat Mar 01, 2008 5:31 am    Post subject: Standby switch detection. Reply with quote

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
View user's profile Send private message
SilverSpring



Joined: 27 Feb 2007
Posts: 115

PostPosted: Sat Mar 01, 2008 5:45 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Sat Mar 01, 2008 8:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Art



Joined: 09 Nov 2005
Posts: 647

PostPosted: Sat Mar 01, 2008 9:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Sat Mar 01, 2008 12:09 pm    Post subject: Reply with quote

Power callback should do what you want.

There's a sample in the SDK.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group