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 

[SOLVED] thread problem

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



Joined: 15 Jun 2008
Posts: 121

PostPosted: Sun Jun 15, 2008 8:53 pm    Post subject: [SOLVED] thread problem Reply with quote

Hi,
I've a problem with the threads
Code:

    int thid;
   
    thid = sceKernelCreateThread("Show_systray_info_thread", Show_systray_info, 0x18, 0x10000, PSP_THREAD_ATTR_USER, NULL);
    if(thid < 0)
    {
            printf("Error, could not create thread\n");
            sceKernelSleepThread();
    }

    sceKernelStartThread(thid, 0, NULL);

And here is the code of Show_systray_info funct:
Code:

int Show_systray_info(SceSize args, void *argp)
{
    while(running())
    {
        int number=(scePowerGetBatteryLifePercent()*20)/100;
        int a;
        for(a=0; a<number;a++){
        fillScreenRect(scePowerIsBatteryCharging()? 0xFF5252FF : 0xFF8CFF8C, 476-a, 7, 1, 2);
        fillScreenRect(scePowerIsBatteryCharging()? 0xFF0000FF : 0xFF00FF00, 476-a, 9, 1, 3);
        fillScreenRect(scePowerIsBatteryCharging()? 0xFF0000CA : 0xFF00AE00, 476-a, 12, 1, 3);
        fillScreenRect(scePowerIsBatteryCharging()? 0xFF000091 : 0xFF008A00, 476-a, 15, 1, 2);
        }

        pspTime time;
        sceRtcGetCurrentClockLocalTime(&time);

        intraFontSetStyle(ltn8, 1.00f,WHITE,0,INTRAFONT_ALIGN_RIGHT);
        intraFontPrintf(ltn8, 445, 16, "%s     %i:%i", Stat_Usb()? "Usb-->" : "", (int)time.hour, (int)time.minutes);
    }
    intraFontSetStyle(ltn8, 0.80f,BLACK,WHITE,0);
   
    return 0;
}

It's all great ( I think ) but when I try to compile it I've that error:
Code:

main.c:35: undefined reference to `_flush_cache'

collect2: ld returned 1 exit status

C:\pspsdk\bin\make.exe: *** [explorer.elf] Error 1


Build failed. Exit value 2.

Why? I've to include a specific library?
Excuse me, but I'm new in the psp development...
Sorry for my bad english, I'm Spanish!

EDIT:
I think Makefile is useful:
Code:

TARGET = explorer
OBJS = intraFont.o main.o osk.o framebuffer.o graphics.o general.o img_mouse.o img_base.o \
       img_menu.o img_menu2.o img_proprieta.o img_cartella.o img_file.o img_avviso.o \
       img_iso.o img_cso.o img_img.o img_mov.o img_mp3.o img_txt.o img_bin.o \
       img_doc.o img_bmp.o img_jpg.o img_png.o img_gif.o img_menu_principale.o \
       img_pbp.o img_elf.o img_prx.o img_zip.o img_barra.o img_barra2.o \
       img_selezione.o img_mem_device.o img_selezione_2.o



CFLAGS = -O2 -G0 -Wall -g
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBS =  -lpspgum -lpspgu -lpng -lz -lm -lpspumd -lpspusb -lpspusbstor -lpsppower -lpsprtc
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = New FRT

PSP_EBOOT_ICON = ICON0.PNG
# In my toolchian is not requided to set up the path
include $(PSPSDK)/lib/build.mak
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