| View previous topic :: View next topic |
| Author |
Message |
Slash
Joined: 07 Jan 2007 Posts: 26
|
Posted: Sat Aug 11, 2007 11:46 pm Post subject: (plugin) sceRtcGetCurrentClockLocalTime problem |
|
|
I have a code in my program...
| Code: | pspTime cTime;
int errCode = sceRtcGetCurrentClockLocalTime(&cTime); |
which works perfectly as an EBOOT.PBP. But when I've tried it as a plugin, it does not work. If I remove that code, the plugin works fine. Could it be that the rtc module is not yet loaded when the plugins run? What can I do to run it as soon as the PSP starts (vsh plugin)?
Update: It seems that other rtc.prx functions does not work too. If the said rtc function is removed, the plugin works perfect, but if added, succeeding plugin process is not working as if the plugin was terminated prematurely. I've tried to load and start rtc.prx module manually and still rtc functions does not work properly. :( |
|
| Back to top |
|
 |
kururin
Joined: 05 Jul 2006 Posts: 36
|
Posted: Sun Aug 12, 2007 9:55 am Post subject: |
|
|
Your problem is very simple.
You are using the rtc library, which is an user mode library, and in 3.XX kernel modules cannot use user functions.
The solution is to change this in the makefile:
from:
-lpsprtc
to:
-lpsprtc_driver |
|
| Back to top |
|
 |
Slash
Joined: 07 Jan 2007 Posts: 26
|
Posted: Sun Aug 12, 2007 12:59 pm Post subject: |
|
|
| kururin wrote: | Your problem is very simple.
You are using the rtc library, which is an user mode library, and in 3.XX kernel modules cannot use user functions.
The solution is to change this in the makefile:
from:
-lpsprtc
to:
-lpsprtc_driver |
Thanks a lot! I love you! Lol. :D
EDIT: One problem though, the timezone does not work. The date/time given is the time with the timezone of 0. |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
|
| Back to top |
|
 |
Slash
Joined: 07 Jan 2007 Posts: 26
|
Posted: Tue Aug 14, 2007 11:32 am Post subject: |
|
|
| Art wrote: | http://forums.ps2dev.org/viewtopic.php?t=3587&highlight=timezone
Shine shows you haow to get timezone from sysparams,
and adjust it yourself. |
Thanks alot but I'm having a trouble compiling it. The program compiles fine but if I add the tzset(), it gives me an error...
| Code: | /usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib/libc.a(_sbrk.o): In function `_sbrk':../../../../../../newlib/libc/sys/psp/libcglue.c:524: undefined reference to `sceKernelMaxFreeMemSize'
collect2: ld returned 1 exit status
make: *** [timezone_sampler.elf] Error 1 |
Makefile:
| Code: | TARGET = timezone_sampler
OBJS = main.o exports.o
BUILD_PRX = 1
USE_KERNEL_LIBS = 1
PRX_EXPORTS = exports.exp
CFLAGS = -O2 -G0 -Wall
ASFLAGS = $(CFLAGS)
LIBS = -lpspkernel -lpsprtc_driver -lpsplibc -lpsputility
LDFLAGS = -nostartfiles
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak |
Include files:
| Code: | #include <pspkernel.h>
#include <psprtc.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h> |
|
|
| Back to top |
|
 |
|