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 

Freeze after getting time 2x

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



Joined: 24 Aug 2007
Posts: 88

PostPosted: Wed Jun 18, 2008 12:43 am    Post subject: Freeze after getting time 2x Reply with quote

Got a problem.
I want to make a timer, so at the begin of a function i get the current minutes, and i copy it in a string.
Then at the end of the function, i get the minutes and copy them in a string, but then it freezes. .

Can anyone help ?

Code to get time :

pspTime time;
sceRtcGetCurrentClockLocalTime(&time);
sprintf(StartMin, "%d", time.minutes);

. . . (function)


the same code as above but i print it in EndMin and without 'pspTime time;'
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Wed Jun 18, 2008 1:43 am    Post subject: Reply with quote

is char startmin long enough to handle the time integer?
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Wed Jun 18, 2008 1:48 am    Post subject: Reply with quote

char EndMin[262] = "";
char StartMin[262] = "";
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Wed Jun 18, 2008 2:10 am    Post subject: Reply with quote

Are you sure it freezes when doing sprintf?
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Wed Jun 18, 2008 2:36 am    Post subject: Reply with quote

I dont know exactly where, but it's in the second time get part
Back to top
View user's profile Send private message
Pirata Nervo



Joined: 09 Oct 2007
Posts: 409

PostPosted: Wed Jun 18, 2008 2:41 am    Post subject: Reply with quote

try doing some debug.
printf("0");
add a delay of 1 sec here
first function
printf("1");
add a delay of 1 sec here
second function
printf("2");
add a delay of 1 sec here
third function
_________________

Upgrade your PSP
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Wed Jun 18, 2008 3:38 am    Post subject: Reply with quote

i know its in the latest time part, because without the latest it works
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Jun 18, 2008 3:44 am    Post subject: Reply with quote

Then why don't you post that section of code? Can't help with code we can't see. :)
Back to top
View user's profile Send private message AIM Address
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Wed Jun 18, 2008 4:03 am    Post subject: Reply with quote

I wrote it in 1th post, but here again (this is only the second time part, so at the end of the function)

sceRtcGetCurrentClockLocalTime(&time);
sprintf(EndMin, "%d", time.minutes);

So this comes after '. . .function'
Maybe the problem is that i call sceRtc. . 2 times ?

Tnx for the help.
Back to top
View user's profile Send private message
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Wed Jun 18, 2008 4:28 am    Post subject: Reply with quote

we really need more code to help you
it looks like there is an overwritten somewhere or it can come from the stack etc etc ...
The problem may be elsewhere and you see it only there ...
_________________
--pspZorba--
NO to K1.5 !
Back to top
View user's profile Send private message
Question_dev



Joined: 24 Aug 2007
Posts: 88

PostPosted: Thu Jun 19, 2008 5:40 am    Post subject: Reply with quote

Solved :)
Found a strange bugat end of function.

Tnx anyway !
Cu
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