usbloadergx/source/fatmounter.c
ardi@ist-einmalig.de 904fda37d4 NOTE: this commit requires "make clean" and the new libfat (see Downloads libfat-01-06-2009)
* clean up the wild mounts and unmounts (this and the new libfat fix the download-bug)
* reorganize shutdowns and reboots use now the functions Sys_Reboot(), Sys_Shutdown(), Sys_ShutdownToIdel(), Sys_ShutdownToStandby() and Sys_BackToLoader()
  this functions stops the GUI-Thread, Shutdowns the Audio, Video, WPad and unmounts the SD and USB
2009-06-01 15:50:18 +00:00

51 lines
1.0 KiB
C

#include <fat.h>
#include <sys/dir.h>
#include <sys/iosupport.h>
#include <ogc/lwp_watchdog.h>
#include <ogc/mutex.h>
#include <ogc/system.h>
#include <ogc/usbstorage.h>
#include <sdcard/wiisd_io.h>
#define CACHE 4
#define SECTORS 64
int USBDevice_Init()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("USB:/");
//right now only mounts first partition
if (fatMount("USB", &__io_usbstorage, 0, CACHE, SECTORS)) {
return 1;
}
return -1;
}
void USBDevice_deInit()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("USB:/");
}
int isSdInserted()
{
return __io_wiisd.isInserted();
}
int SDCard_Init()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("SD:/");
//right now only mounts first partition
if (fatMount("SD", &__io_wiisd, 0, CACHE, SECTORS))
return 1;
return -1;
}
void SDCard_deInit()
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("SD:/");
}