Timer and Interrupts

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

Moderators: cheriff, TyRaNiD

Post Reply
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Timer and Interrupts

Post by kasikeeper »

Hi,

I wat to setup a simple timer interrupt which displays a text message e.g. everyday at 9am. I am really at the beginning of my code but I am not sure what route to choose now. I guess what is needed is some kind of an interrupt to not loop until time=9am. Is there any tutorial out there which explains how to set up timer interrupts?

Also, would a separate prx filebe required here? Can prx programs be considered as separate threads at all or should that be done inside my main internally?

I would really like to understand prx and threads on PSP better but the SDK doxygen doc is too hard for me to understand. Does anyone know of good tutorials?

Best regards,
Kai
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Hello,

noone here to give some advice on timer interrupts on the PSP??

Kai
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Did you at least look at the sample in the sdk? I know that one of the tutorial sites a user here maintains has a section on timers as well. Do a little research yourself and maybe others will be more inclined to help. You ARE supposed to be a developer, after all.
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

You might be better off using the RTC alarm handlers here to wake up the PSP at a given time.
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Adrahil, this is exactly what I am looking for. I am using the VTimers successfully but when the PSP goes to sleep, the timers go to sleep as well and there is no chance to wake the PSP up from a VTimer callback.

I checked the psprtc.h header file but could not find any rtc timer handler functionality. Ca you give me a clue where in the sdk these functions sit?
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

Have a look at Art's code. There is a modified psprtc.h and a little alarm library.
http://forums.qj.net/f-psp-development- ... 36338.html
kasikeeper
Posts: 36
Joined: Thu Nov 29, 2007 7:08 pm

Post by kasikeeper »

Ok. I had a look the the timebaby source code and I copied the modified psprtc.h header into my sdk directory (by the way,when is this new header file going to be part of the standard sdk distribution?)

When compiling my code I get

[Linker error] undefined reference to `sceRtcRegisterCallback'
[Linker error] undefined reference to `sceRtcSetAlarmTick'

which are two of the functions that are new in the psprtc.h so I assumed they sit in the precompiled .s files provided with the sources. I included them in my makefile and now I get the follwoing compile errors:

unrecognized opcode `dummy'
junk at end of line, first unrecognized character is `/'
[sceRtc_driver.o] Error 1

How can these functions`sceRtcRegisterCallback' and `sceRtcSetAlarmTick' be made accessable more easily? Or how doI get rid of the assembler errors in a precompiled .s file?
Post Reply