 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
dankydoo
Joined: 29 Mar 2005 Posts: 11
|
Posted: Sat Oct 08, 2005 8:12 am Post subject: usb exiting |
|
|
Hello all,
I've been porting some of my openGL code with the PSPSDK, and it came to me that compile time/execution turnaround will be much quicker if I enable USB in my programs, then upload the new executable with a script after it is compiled and then maybe hook the booting of the executable to say the 'select' button.
I've integrated the USB example into my proggie, the only problem is that I cannot exit the program cleanly. After I hit the home button and say 'Yes' to exit, it freezes and shuts down the PSP. I've investigated, and the USB demo app has the same problem. I have a feeling it has to do with either kernel thread/ user thread things, or stopping/unloading the USB modules.
Any suggestions, or any direction would be great!
thanks,
dankydoo |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
Posted: Sat Oct 08, 2005 11:33 am Post subject: |
|
|
in pspinside we do it like this:
| Code: |
void initUSBdrivers(void)
{
int exec_pu;
exec_pu=sceKernelLoadModule("flash0:/kd/semawm.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstor.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstormgr.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstorms.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
exec_pu=sceKernelLoadModule("flash0:/kd/usbstorboot.prx",0,NULL);
sceKernelStartModule(exec_pu, 0, NULL, 0, NULL);
int ret = 0;
// FIXME: last arg should be NULL (wrong prototype in pspsdk?)
sceUsbStart("USBBusDriver",0,0);
ret = sceUsbStart("USBStor_Driver",0,0);
if(ret)
{
// prototype in pspsdk has only one arg, is that correct?
// sceUsbstorBootSetCapacity(0x00800000,ret);
sceUsbstorBootSetCapacity(0x00800000);
}
}
void exitUSBdrivers(void)
{
sceUsbDeactivate();
// FIXME: last arg should be NULL (wrong prototype in pspsdk?)
sceUsbStop("USBStor_Driver",0,0);
sceUsbStop("USBBusDriver",0,0);
}
|
that seems to work fine. (atleast pspinside doesnt crash and exits to the vsh cleanly :)) _________________ http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/ |
|
| Back to top |
|
 |
holger
Joined: 18 Aug 2005 Posts: 204
|
|
| Back to top |
|
 |
dankydoo
Joined: 29 Mar 2005 Posts: 11
|
Posted: Mon Oct 10, 2005 3:42 am Post subject: |
|
|
Thanks guys!
I will look into this...
dankydoo |
|
| Back to top |
|
 |
|
|
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
|