[mw_shl_code=c,true]/*-----------------------------------------------------------------------*/
/* Low level disk I/O module skeleton for FatFs (C)ChaN, 2007 */
/*-----------------------------------------------------------------------*/
/* This is a stub disk I/O module that acts as front end of the existing */
/* disk I/O modules and attach it to FatFs module with common interface. */
/*-----------------------------------------------------------------------*/
#if _READONLY == 0
DRESULT disk_write (
BYTE drv, /* Physical drive nmuber (0..) */
const BYTE *buff, /* Data to be written */
DWORD sector, /* Sector address (LBA) */
BYTE count /* Number of sectors to write (1..255) */
)
{
if (count > 1)
{
SD_WriteMultiBlocks((uint8_t *)buff, sector*BLOCK_SIZE, BLOCK_SIZE, count);
/* Check if the Transfer is finished */
SD_WaitWriteOperation(); //μè′ydma′«êä½áêø
while(SD_GetStatus() != SD_TRANSFER_OK); //μè′ysdioμ½sd¿¨′«êä½áêø
}
else
{
SD_WriteBlock((uint8_t *)buff,sector*BLOCK_SIZE, BLOCK_SIZE);
/* Check if the Transfer is finished */
SD_WaitWriteOperation(); //μè′ydma′«êä½áêø
while(SD_GetStatus() != SD_TRANSFER_OK); //μè′ysdioμ½sd¿¨′«êä½áêø
}
return RES_OK;
}
#endif /* _READONLY */
DRESULT disk_ioctl (
BYTE drv, /* Physical drive nmuber (0..) */
BYTE ctrl, /* Control code */
void *buff /* Buffer to send/receive control data */
)
{
return RES_OK;
}
/*-----------------------------------------------------------------------*/
/* Get current time */
/*-----------------------------------------------------------------------*/
DWORD get_fattime(void)
{