2009-05-15 22:03:19 +02:00
|
|
|
#include <fat.h>
|
2009-05-19 02:46:14 +02:00
|
|
|
#include <sys/dir.h>
|
2009-05-15 22:03:19 +02:00
|
|
|
#include <ogc/lwp_watchdog.h>
|
|
|
|
#include <ogc/mutex.h>
|
2009-05-19 02:46:14 +02:00
|
|
|
#include <ogc/system.h>
|
2009-05-15 22:03:19 +02:00
|
|
|
#include <ogc/usbstorage.h>
|
|
|
|
#include <sdcard/wiisd_io.h>
|
|
|
|
|
2009-05-21 16:05:30 +02:00
|
|
|
#define CACHE 1
|
2009-05-19 09:52:17 +02:00
|
|
|
#define SECTORS 64
|
2009-05-15 22:03:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
int USBDevice_Init()
|
|
|
|
{
|
|
|
|
//right now only mounts first partition and only under IOS36
|
|
|
|
__io_usbstorage.startup();
|
|
|
|
|
2009-05-19 09:52:17 +02:00
|
|
|
if (fatMount("USB", &__io_usbstorage, 0, CACHE, SECTORS)) {
|
2009-05-15 22:03:19 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void USBDevice_deInit()
|
|
|
|
{
|
|
|
|
//First unmount all the devs...
|
|
|
|
fatUnmount("USB");
|
|
|
|
//...and then shutdown em!
|
|
|
|
__io_usbstorage.shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
int isSdInserted()
|
|
|
|
{
|
|
|
|
return __io_wiisd.isInserted();
|
|
|
|
}
|
|
|
|
|
|
|
|
int SDCard_Init()
|
|
|
|
{
|
|
|
|
//mount SD if inserted
|
|
|
|
__io_wiisd.startup();
|
|
|
|
if (!isSdInserted()){
|
|
|
|
return -1;
|
|
|
|
}
|
2009-05-20 15:14:52 +02:00
|
|
|
if (fatMount("SD", &__io_wiisd, 0, CACHE, SECTORS)) {
|
2009-05-15 22:03:19 +02:00
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
void SDCard_deInit()
|
|
|
|
{
|
|
|
|
//First unmount all the devs...
|
|
|
|
fatUnmount("SD");
|
|
|
|
//...and then shutdown em!
|
|
|
|
__io_wiisd.shutdown();
|
|
|
|
}
|