Add FSUSER_GetSdmcArchiveResource().
This commit is contained in:
parent
a2911e4883
commit
43661f8263
@ -139,6 +139,7 @@ Result FSUSER_CloseArchive(Handle* handle, FS_archive* archive);
|
||||
Result FSUSER_CreateDirectory(Handle* handle, FS_archive archive, FS_path dirLowPath);
|
||||
Result FSUSER_DeleteFile(Handle *handle, FS_archive archive, FS_path fileLowPath);
|
||||
Result FSUSER_DeleteDirectory(Handle *handle, FS_archive archive, FS_path dirLowPath);
|
||||
Result FSUSER_GetSdmcArchiveResource(Handle *handle, u32 *sectorSize, u32 *clusterSize, u32 *numClusters, u32 *freeClusters);
|
||||
Result FSUSER_IsSdmcDetected(Handle *handle, u32 *detected);
|
||||
Result FSUSER_IsSdmcWritable(Handle *handle, u32 *writable);
|
||||
|
||||
|
@ -606,6 +606,68 @@ FSUSER_CloseArchive(Handle *handle,
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
/*! Get SD FAT information
|
||||
*
|
||||
* @param[in] handle fs:USER handle
|
||||
* @param[out] sectorSize Sector size (bytes)
|
||||
* @param[out] clusterSize Cluster size (bytes)
|
||||
* @param[out] numClusters Total number of clusters
|
||||
* @param[out] freeClusters Number of free clusters
|
||||
*
|
||||
* @returns error
|
||||
*
|
||||
* @internal
|
||||
*
|
||||
* #### Request
|
||||
*
|
||||
* Index Word | Description
|
||||
* -----------|-------------------------
|
||||
* 0 | Header code [0x08140000]
|
||||
*
|
||||
* #### Response
|
||||
*
|
||||
* Index Word | Description
|
||||
* -----------|-------------------------
|
||||
* 0 | Header code
|
||||
* 1 | Result code
|
||||
* 2 | Sector (bytes)
|
||||
* 3 | Cluster (bytes)
|
||||
* 4 | Partition capacity (clusters)
|
||||
* 5 | Free space (clusters)
|
||||
*/
|
||||
Result
|
||||
FSUSER_GetSdmcArchiveResource(Handle *handle,
|
||||
u32 *sectorSize,
|
||||
u32 *clusterSize,
|
||||
u32 *numClusters,
|
||||
u32 *freeClusters)
|
||||
{
|
||||
if(!handle)
|
||||
handle = &fsuHandle;
|
||||
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = 0x08140000;
|
||||
|
||||
Result ret = 0;
|
||||
if((ret = svcSendSyncRequest(*handle)))
|
||||
return ret;
|
||||
|
||||
if(sectorSize)
|
||||
*sectorSize = cmdbuf[2];
|
||||
|
||||
if(clusterSize)
|
||||
*clusterSize = cmdbuf[3];
|
||||
|
||||
if(numClusters)
|
||||
*numClusters = cmdbuf[4];
|
||||
|
||||
if(freeClusters)
|
||||
*freeClusters = cmdbuf[5];
|
||||
|
||||
return cmdbuf[1];
|
||||
}
|
||||
|
||||
/*! Check if SD card is detected
|
||||
*
|
||||
* @param[in] handle fs:USER handle
|
||||
|
Loading…
Reference in New Issue
Block a user