fix compilers warnings
This commit is contained in:
parent
483c89c337
commit
8299d3d581
@ -218,20 +218,20 @@ FRESULT move_window (
|
|||||||
if (wsect != sector) { /* Changed current window */
|
if (wsect != sector) { /* Changed current window */
|
||||||
#if !_FS_READONLY
|
#if !_FS_READONLY
|
||||||
if (fs->wflag) { /* Write back dirty window if needed */
|
if (fs->wflag) { /* Write back dirty window if needed */
|
||||||
if (disk_write(fs->drive, fs->win, wsect, 1) != RES_OK)
|
if (disk_write(fs->drive, fs->win, wsect, (BYTE)1) != RES_OK)
|
||||||
return FR_DISK_ERR;
|
return FR_DISK_ERR;
|
||||||
fs->wflag = 0;
|
fs->wflag = 0;
|
||||||
if (wsect < (fs->fatbase + fs->sects_fat)) { /* In FAT area */
|
if (wsect < (fs->fatbase + fs->sects_fat)) { /* In FAT area */
|
||||||
BYTE nf;
|
BYTE nf;
|
||||||
for (nf = fs->n_fats; nf >= 2; nf--) { /* Refrect the change to FAT copy */
|
for (nf = fs->n_fats; nf >= 2; nf--) { /* Refrect the change to FAT copy */
|
||||||
wsect += fs->sects_fat;
|
wsect += fs->sects_fat;
|
||||||
disk_write(fs->drive, fs->win, wsect, 1);
|
disk_write(fs->drive, fs->win, wsect, (BYTE)1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (sector) {
|
if (sector) {
|
||||||
if (disk_read(fs->drive, fs->win, sector, 1) != RES_OK)
|
if (disk_read(fs->drive, fs->win, sector,(BYTE) 1) != RES_OK)
|
||||||
return FR_DISK_ERR;
|
return FR_DISK_ERR;
|
||||||
fs->winsect = sector;
|
fs->winsect = sector;
|
||||||
}
|
}
|
||||||
@ -255,7 +255,7 @@ FRESULT sync ( /* FR_OK: successful, FR_DISK_ERR: failed */
|
|||||||
FRESULT res;
|
FRESULT res;
|
||||||
|
|
||||||
|
|
||||||
res = move_window(fs, 0);
|
res = move_window(fs,(DWORD) 0);
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
/* Update FSInfo sector if needed */
|
/* Update FSInfo sector if needed */
|
||||||
if (fs->fs_type == FS_FAT32 && fs->fsi_flag) {
|
if (fs->fs_type == FS_FAT32 && fs->fsi_flag) {
|
||||||
@ -266,7 +266,7 @@ FRESULT sync ( /* FR_OK: successful, FR_DISK_ERR: failed */
|
|||||||
ST_DWORD(fs->win+FSI_StrucSig, 0x61417272);
|
ST_DWORD(fs->win+FSI_StrucSig, 0x61417272);
|
||||||
ST_DWORD(fs->win+FSI_Free_Count, fs->free_clust);
|
ST_DWORD(fs->win+FSI_Free_Count, fs->free_clust);
|
||||||
ST_DWORD(fs->win+FSI_Nxt_Free, fs->last_clust);
|
ST_DWORD(fs->win+FSI_Nxt_Free, fs->last_clust);
|
||||||
disk_write(fs->drive, fs->win, fs->fsi_sector, 1);
|
disk_write(fs->drive, fs->win, fs->fsi_sector, (BYTE)1);
|
||||||
fs->fsi_flag = 0;
|
fs->fsi_flag = 0;
|
||||||
}
|
}
|
||||||
/* Make sure that no pending write process in the physical drive */
|
/* Make sure that no pending write process in the physical drive */
|
||||||
@ -409,7 +409,7 @@ FRESULT remove_chain (
|
|||||||
if (nxt == 0) break; /* Empty cluster? */
|
if (nxt == 0) break; /* Empty cluster? */
|
||||||
if (nxt == 1) { res = FR_INT_ERR; break; } /* Internal error? */
|
if (nxt == 1) { res = FR_INT_ERR; break; } /* Internal error? */
|
||||||
if (nxt == 0xFFFFFFFF) { res = FR_DISK_ERR; break; } /* Disk error? */
|
if (nxt == 0xFFFFFFFF) { res = FR_DISK_ERR; break; } /* Disk error? */
|
||||||
res = put_cluster(fs, clst, 0); /* Mark the cluster "empty" */
|
res = put_cluster(fs, clst,(DWORD) 0); /* Mark the cluster "empty" */
|
||||||
if (res != FR_OK) break;
|
if (res != FR_OK) break;
|
||||||
if (fs->free_clust != 0xFFFFFFFF) { /* Update FSInfo */
|
if (fs->free_clust != 0xFFFFFFFF) { /* Update FSInfo */
|
||||||
fs->free_clust++;
|
fs->free_clust++;
|
||||||
@ -586,12 +586,12 @@ FRESULT dir_next ( /* FR_OK:Succeeded, FR_NO_FILE:End of table, FR_DENIED:EOT an
|
|||||||
if (clst == 1) return FR_INT_ERR;
|
if (clst == 1) return FR_INT_ERR;
|
||||||
if (clst == 0xFFFFFFFF) return FR_DISK_ERR;
|
if (clst == 0xFFFFFFFF) return FR_DISK_ERR;
|
||||||
/* Clean-up streached table */
|
/* Clean-up streached table */
|
||||||
if (move_window(dj->fs, 0)) return FR_DISK_ERR; /* Flush active window */
|
if (move_window(dj->fs,(DWORD) 0)) return FR_DISK_ERR; /* Flush active window */
|
||||||
mem_set(dj->fs->win, 0, SS(dj->fs)); /* Clear window buffer */
|
mem_set(dj->fs->win, 0, SS(dj->fs)); /* Clear window buffer */
|
||||||
dj->fs->winsect = clust2sect(dj->fs, clst); /* Cluster start sector */
|
dj->fs->winsect = clust2sect(dj->fs, clst); /* Cluster start sector */
|
||||||
for (c = 0; c < dj->fs->csize; c++) { /* Fill the new cluster with 0 */
|
for (c = 0; c < dj->fs->csize; c++) { /* Fill the new cluster with 0 */
|
||||||
dj->fs->wflag = 1;
|
dj->fs->wflag = 1;
|
||||||
if (move_window(dj->fs, 0)) return FR_DISK_ERR;
|
if (move_window(dj->fs,(DWORD) 0)) return FR_DISK_ERR;
|
||||||
dj->fs->winsect++;
|
dj->fs->winsect++;
|
||||||
}
|
}
|
||||||
dj->fs->winsect -= c; /* Rewind window address */
|
dj->fs->winsect -= c; /* Rewind window address */
|
||||||
@ -1325,7 +1325,7 @@ BYTE check_fs ( /* 0:The FAT boot record, 1:Valid boot record but not an FAT, 2:
|
|||||||
DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */
|
DWORD sect /* Sector# (lba) to check if it is an FAT boot record or not */
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (disk_read(fs->drive, fs->win, sect, 1) != RES_OK) /* Load boot record */
|
if (disk_read(fs->drive, fs->win, sect, (BYTE)1) != RES_OK) /* Load boot record */
|
||||||
return 3;
|
return 3;
|
||||||
if (LD_WORD(&fs->win[BS_55AA]) != 0xAA55) /* Check record signature (always placed at offset 510 even if the sector size is >512) */
|
if (LD_WORD(&fs->win[BS_55AA]) != 0xAA55) /* Check record signature (always placed at offset 510 even if the sector size is >512) */
|
||||||
return 2;
|
return 2;
|
||||||
@ -1448,7 +1448,7 @@ FRESULT auto_mount ( /* FR_OK(0): successful, !=0: any error occured */
|
|||||||
if (fmt == FS_FAT32) {
|
if (fmt == FS_FAT32) {
|
||||||
fs->fsi_sector = bsect + LD_WORD(fs->win+BPB_FSInfo);
|
fs->fsi_sector = bsect + LD_WORD(fs->win+BPB_FSInfo);
|
||||||
fs->fsi_flag = 0;
|
fs->fsi_flag = 0;
|
||||||
if (disk_read(fs->drive, fs->win, fs->fsi_sector, 1) == RES_OK &&
|
if (disk_read(fs->drive, fs->win, fs->fsi_sector,(BYTE) 1) == RES_OK &&
|
||||||
LD_WORD(fs->win+BS_55AA) == 0xAA55 &&
|
LD_WORD(fs->win+BS_55AA) == 0xAA55 &&
|
||||||
LD_DWORD(fs->win+FSI_LeadSig) == 0x41615252 &&
|
LD_DWORD(fs->win+FSI_LeadSig) == 0x41615252 &&
|
||||||
LD_DWORD(fs->win+FSI_StrucSig) == 0x61417272) {
|
LD_DWORD(fs->win+FSI_StrucSig) == 0x61417272) {
|
||||||
@ -1559,7 +1559,7 @@ FRESULT f_open (
|
|||||||
res = auto_mount(&path, &dj.fs, (BYTE)(mode & (FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)));
|
res = auto_mount(&path, &dj.fs, (BYTE)(mode & (FA_WRITE | FA_CREATE_ALWAYS | FA_OPEN_ALWAYS | FA_CREATE_NEW)));
|
||||||
#else
|
#else
|
||||||
mode &= FA_READ;
|
mode &= FA_READ;
|
||||||
res = auto_mount(&path, &dj.fs, 0);
|
res = auto_mount(&path, &dj.fs, (BYTE)0);
|
||||||
#endif
|
#endif
|
||||||
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
||||||
INITBUF(dj, sfn, lfn);
|
INITBUF(dj, sfn, lfn);
|
||||||
@ -1690,13 +1690,13 @@ FRESULT f_read (
|
|||||||
#if !_FS_TINY
|
#if !_FS_TINY
|
||||||
#if !_FS_READONLY
|
#if !_FS_READONLY
|
||||||
if (fp->flag & FA__DIRTY) { /* Write sector I/O buffer if needed */
|
if (fp->flag & FA__DIRTY) { /* Write sector I/O buffer if needed */
|
||||||
if (disk_write(fp->fs->drive, fp->buf, fp->dsect, 1) != RES_OK)
|
if (disk_write(fp->fs->drive, fp->buf, fp->dsect, (BYTE)1) != RES_OK)
|
||||||
ABORT(fp->fs, FR_DISK_ERR);
|
ABORT(fp->fs, FR_DISK_ERR);
|
||||||
fp->flag &= (BYTE)~FA__DIRTY;
|
fp->flag &= (BYTE)~FA__DIRTY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (fp->dsect != sect) { /* Fill sector buffer with file data */
|
if (fp->dsect != sect) { /* Fill sector buffer with file data */
|
||||||
if (disk_read(fp->fs->drive, fp->buf, sect, 1) != RES_OK)
|
if (disk_read(fp->fs->drive, fp->buf, sect,(BYTE) 1) != RES_OK)
|
||||||
ABORT(fp->fs, FR_DISK_ERR);
|
ABORT(fp->fs, FR_DISK_ERR);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1756,7 +1756,7 @@ FRESULT f_write (
|
|||||||
if (fp->fptr == 0) { /* On the top of the file? */
|
if (fp->fptr == 0) { /* On the top of the file? */
|
||||||
clst = fp->org_clust; /* Follow from the origin */
|
clst = fp->org_clust; /* Follow from the origin */
|
||||||
if (clst == 0) /* When there is no cluster chain, */
|
if (clst == 0) /* When there is no cluster chain, */
|
||||||
fp->org_clust = clst = create_chain(fp->fs, 0); /* Create a new cluster chain */
|
fp->org_clust = clst = create_chain(fp->fs, (DWORD)0); /* Create a new cluster chain */
|
||||||
} else { /* Middle or end of the file */
|
} else { /* Middle or end of the file */
|
||||||
clst = create_chain(fp->fs, fp->curr_clust); /* Follow or streach cluster chain */
|
clst = create_chain(fp->fs, fp->curr_clust); /* Follow or streach cluster chain */
|
||||||
}
|
}
|
||||||
@ -1767,11 +1767,11 @@ FRESULT f_write (
|
|||||||
fp->csect = 0; /* Reset sector address in the cluster */
|
fp->csect = 0; /* Reset sector address in the cluster */
|
||||||
}
|
}
|
||||||
#if _FS_TINY
|
#if _FS_TINY
|
||||||
if (fp->fs->winsect == fp->dsect && move_window(fp->fs, 0)) /* Write back data buffer prior to following direct transfer */
|
if (fp->fs->winsect == fp->dsect && move_window(fp->fs, (DWORD)0)) /* Write back data buffer prior to following direct transfer */
|
||||||
ABORT(fp->fs, FR_DISK_ERR);
|
ABORT(fp->fs, FR_DISK_ERR);
|
||||||
#else
|
#else
|
||||||
if (fp->flag & FA__DIRTY) { /* Write back data buffer prior to following direct transfer */
|
if (fp->flag & FA__DIRTY) { /* Write back data buffer prior to following direct transfer */
|
||||||
if (disk_write(fp->fs->drive, fp->buf, fp->dsect, 1) != RES_OK)
|
if (disk_write(fp->fs->drive, fp->buf, fp->dsect,(BYTE) 1) != RES_OK)
|
||||||
ABORT(fp->fs, FR_DISK_ERR);
|
ABORT(fp->fs, FR_DISK_ERR);
|
||||||
fp->flag &= (BYTE)~FA__DIRTY;
|
fp->flag &= (BYTE)~FA__DIRTY;
|
||||||
}
|
}
|
||||||
@ -1791,13 +1791,13 @@ FRESULT f_write (
|
|||||||
}
|
}
|
||||||
#if _FS_TINY
|
#if _FS_TINY
|
||||||
if (fp->fptr >= fp->fsize) { /* Avoid silly buffer filling at growing edge */
|
if (fp->fptr >= fp->fsize) { /* Avoid silly buffer filling at growing edge */
|
||||||
if (move_window(fp->fs, 0)) ABORT(fp->fs, FR_DISK_ERR);
|
if (move_window(fp->fs,(DWORD) 0)) ABORT(fp->fs, FR_DISK_ERR);
|
||||||
fp->fs->winsect = sect;
|
fp->fs->winsect = sect;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (fp->dsect != sect) { /* Fill sector buffer with file data */
|
if (fp->dsect != sect) { /* Fill sector buffer with file data */
|
||||||
if (fp->fptr < fp->fsize &&
|
if (fp->fptr < fp->fsize &&
|
||||||
disk_read(fp->fs->drive, fp->buf, sect, 1) != RES_OK)
|
disk_read(fp->fs->drive, fp->buf, sect, (BYTE)1) != RES_OK)
|
||||||
ABORT(fp->fs, FR_DISK_ERR);
|
ABORT(fp->fs, FR_DISK_ERR);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1844,7 +1844,7 @@ FRESULT f_sync (
|
|||||||
if (fp->flag & FA__WRITTEN) { /* Has the file been written? */
|
if (fp->flag & FA__WRITTEN) { /* Has the file been written? */
|
||||||
#if !_FS_TINY /* Write-back dirty buffer */
|
#if !_FS_TINY /* Write-back dirty buffer */
|
||||||
if (fp->flag & FA__DIRTY) {
|
if (fp->flag & FA__DIRTY) {
|
||||||
if (disk_write(fp->fs->drive, fp->buf, fp->dsect, 1) != RES_OK)
|
if (disk_write(fp->fs->drive, fp->buf, fp->dsect,(BYTE) 1) != RES_OK)
|
||||||
LEAVE_FF(fp->fs, FR_DISK_ERR);
|
LEAVE_FF(fp->fs, FR_DISK_ERR);
|
||||||
fp->flag &= (BYTE)~FA__DIRTY;
|
fp->flag &= (BYTE)~FA__DIRTY;
|
||||||
}
|
}
|
||||||
@ -1937,7 +1937,7 @@ FRESULT f_lseek (
|
|||||||
clst = fp->org_clust; /* start from the first cluster */
|
clst = fp->org_clust; /* start from the first cluster */
|
||||||
#if !_FS_READONLY
|
#if !_FS_READONLY
|
||||||
if (clst == 0) { /* If no cluster chain, create a new chain */
|
if (clst == 0) { /* If no cluster chain, create a new chain */
|
||||||
clst = create_chain(fp->fs, 0);
|
clst = create_chain(fp->fs, (DWORD)0);
|
||||||
if (clst == 1) ABORT(fp->fs, FR_INT_ERR);
|
if (clst == 1) ABORT(fp->fs, FR_INT_ERR);
|
||||||
if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
|
if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
|
||||||
fp->org_clust = clst;
|
fp->org_clust = clst;
|
||||||
@ -1976,12 +1976,12 @@ FRESULT f_lseek (
|
|||||||
#if !_FS_TINY
|
#if !_FS_TINY
|
||||||
#if !_FS_READONLY
|
#if !_FS_READONLY
|
||||||
if (fp->flag & FA__DIRTY) { /* Write-back dirty buffer if needed */
|
if (fp->flag & FA__DIRTY) { /* Write-back dirty buffer if needed */
|
||||||
if (disk_write(fp->fs->drive, fp->buf, fp->dsect, 1) != RES_OK)
|
if (disk_write(fp->fs->drive, fp->buf, fp->dsect,(BYTE) 1) != RES_OK)
|
||||||
ABORT(fp->fs, FR_DISK_ERR);
|
ABORT(fp->fs, FR_DISK_ERR);
|
||||||
fp->flag &= (BYTE)~FA__DIRTY;
|
fp->flag &= (BYTE)~FA__DIRTY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (disk_read(fp->fs->drive, fp->buf, nsect, 1) != RES_OK)
|
if (disk_read(fp->fs->drive, fp->buf, nsect,(BYTE) 1) != RES_OK)
|
||||||
ABORT(fp->fs, FR_DISK_ERR);
|
ABORT(fp->fs, FR_DISK_ERR);
|
||||||
#endif
|
#endif
|
||||||
fp->dsect = nsect;
|
fp->dsect = nsect;
|
||||||
@ -2014,7 +2014,7 @@ FRESULT f_opendir (
|
|||||||
BYTE *dir;
|
BYTE *dir;
|
||||||
|
|
||||||
|
|
||||||
res = auto_mount(&path, &dj->fs, 0);
|
res = auto_mount(&path, &dj->fs, (BYTE)0);
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
INITBUF((*dj), sfn, lfn);
|
INITBUF((*dj), sfn, lfn);
|
||||||
res = follow_path(dj, path); /* Follow the path to the directory */
|
res = follow_path(dj, path); /* Follow the path to the directory */
|
||||||
@ -2097,7 +2097,7 @@ FRESULT f_stat (
|
|||||||
NAMEBUF(sfn, lfn);
|
NAMEBUF(sfn, lfn);
|
||||||
|
|
||||||
|
|
||||||
res = auto_mount(&path, &dj.fs, 0);
|
res = auto_mount(&path, &dj.fs, (BYTE)0);
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
INITBUF(dj, sfn, lfn);
|
INITBUF(dj, sfn, lfn);
|
||||||
res = follow_path(&dj, path); /* Follow the file path */
|
res = follow_path(&dj, path); /* Follow the file path */
|
||||||
@ -2175,7 +2175,7 @@ FRESULT f_getfree (
|
|||||||
|
|
||||||
|
|
||||||
/* Get drive number */
|
/* Get drive number */
|
||||||
res = auto_mount(&path, fatfs, 0);
|
res = auto_mount(&path, fatfs, (BYTE)0);
|
||||||
if (res != FR_OK) LEAVE_FF(*fatfs, res);
|
if (res != FR_OK) LEAVE_FF(*fatfs, res);
|
||||||
|
|
||||||
/* If number of free cluster is valid, return it without cluster scan. */
|
/* If number of free cluster is valid, return it without cluster scan. */
|
||||||
@ -2237,7 +2237,7 @@ FRESULT f_unlink (
|
|||||||
DWORD dclst;
|
DWORD dclst;
|
||||||
|
|
||||||
|
|
||||||
res = auto_mount(&path, &dj.fs, 1);
|
res = auto_mount(&path, &dj.fs, (BYTE)1);
|
||||||
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
||||||
|
|
||||||
INITBUF(dj, sfn, lfn);
|
INITBUF(dj, sfn, lfn);
|
||||||
@ -2290,7 +2290,7 @@ FRESULT f_mkdir (
|
|||||||
DWORD dsect, dclst, pclst, tim;
|
DWORD dsect, dclst, pclst, tim;
|
||||||
|
|
||||||
|
|
||||||
res = auto_mount(&path, &dj.fs, 1);
|
res = auto_mount(&path, &dj.fs, (BYTE)1);
|
||||||
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
||||||
|
|
||||||
INITBUF(dj, sfn, lfn);
|
INITBUF(dj, sfn, lfn);
|
||||||
@ -2299,13 +2299,13 @@ FRESULT f_mkdir (
|
|||||||
if (res != FR_NO_FILE) /* Any error occured */
|
if (res != FR_NO_FILE) /* Any error occured */
|
||||||
LEAVE_FF(dj.fs, res);
|
LEAVE_FF(dj.fs, res);
|
||||||
|
|
||||||
dclst = create_chain(dj.fs, 0); /* Allocate a new cluster for new directory table */
|
dclst = create_chain(dj.fs, (DWORD)0); /* Allocate a new cluster for new directory table */
|
||||||
res = FR_OK;
|
res = FR_OK;
|
||||||
if (dclst == 0) res = FR_DENIED;
|
if (dclst == 0) res = FR_DENIED;
|
||||||
if (dclst == 1) res = FR_INT_ERR;
|
if (dclst == 1) res = FR_INT_ERR;
|
||||||
if (dclst == 0xFFFFFFFF) res = FR_DISK_ERR;
|
if (dclst == 0xFFFFFFFF) res = FR_DISK_ERR;
|
||||||
if (res == FR_OK)
|
if (res == FR_OK)
|
||||||
res = move_window(dj.fs, 0);
|
res = move_window(dj.fs,(DWORD) 0);
|
||||||
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
if (res != FR_OK) LEAVE_FF(dj.fs, res);
|
||||||
dsect = clust2sect(dj.fs, dclst);
|
dsect = clust2sect(dj.fs, dclst);
|
||||||
|
|
||||||
@ -2328,7 +2328,7 @@ FRESULT f_mkdir (
|
|||||||
for (n = 0; n < dj.fs->csize; n++) { /* Write dot entries and clear left sectors */
|
for (n = 0; n < dj.fs->csize; n++) { /* Write dot entries and clear left sectors */
|
||||||
dj.fs->winsect = dsect++;
|
dj.fs->winsect = dsect++;
|
||||||
dj.fs->wflag = 1;
|
dj.fs->wflag = 1;
|
||||||
res = move_window(dj.fs, 0);
|
res = move_window(dj.fs,(DWORD) 0);
|
||||||
if (res) LEAVE_FF(dj.fs, res);
|
if (res) LEAVE_FF(dj.fs, res);
|
||||||
mem_set(dir, 0, SS(dj.fs));
|
mem_set(dir, 0, SS(dj.fs));
|
||||||
}
|
}
|
||||||
@ -2368,7 +2368,7 @@ FRESULT f_chmod (
|
|||||||
BYTE *dir;
|
BYTE *dir;
|
||||||
|
|
||||||
|
|
||||||
res = auto_mount(&path, &dj.fs, 1);
|
res = auto_mount(&path, &dj.fs,(BYTE) 1);
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
INITBUF(dj, sfn, lfn);
|
INITBUF(dj, sfn, lfn);
|
||||||
res = follow_path(&dj, path); /* Follow the file path */
|
res = follow_path(&dj, path); /* Follow the file path */
|
||||||
@ -2406,7 +2406,7 @@ FRESULT f_utime (
|
|||||||
BYTE *dir;
|
BYTE *dir;
|
||||||
|
|
||||||
|
|
||||||
res = auto_mount(&path, &dj.fs, 1);
|
res = auto_mount(&path, &dj.fs,(BYTE) 1);
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
INITBUF(dj, sfn, lfn);
|
INITBUF(dj, sfn, lfn);
|
||||||
res = follow_path(&dj, path); /* Follow the file path */
|
res = follow_path(&dj, path); /* Follow the file path */
|
||||||
@ -2446,7 +2446,7 @@ FRESULT f_rename (
|
|||||||
|
|
||||||
|
|
||||||
INITBUF(dj_old, sfn, lfn);
|
INITBUF(dj_old, sfn, lfn);
|
||||||
res = auto_mount(&path_old, &dj_old.fs, 1);
|
res = auto_mount(&path_old, &dj_old.fs,(BYTE) 1);
|
||||||
if (res == FR_OK) {
|
if (res == FR_OK) {
|
||||||
dj_new.fs = dj_old.fs;
|
dj_new.fs = dj_old.fs;
|
||||||
res = follow_path(&dj_old, path_old); /* Check old object */
|
res = follow_path(&dj_old, path_old); /* Check old object */
|
||||||
@ -2681,7 +2681,7 @@ FRESULT f_mkfs (
|
|||||||
ST_DWORD(tbl+8, 63); /* Partition start in LBA */
|
ST_DWORD(tbl+8, 63); /* Partition start in LBA */
|
||||||
ST_DWORD(tbl+12, n_part); /* Partition size in LBA */
|
ST_DWORD(tbl+12, n_part); /* Partition size in LBA */
|
||||||
ST_WORD(tbl+64, 0xAA55); /* Signature */
|
ST_WORD(tbl+64, 0xAA55); /* Signature */
|
||||||
if (disk_write(drv, fs->win, 0, 1) != RES_OK)
|
if (disk_write(drv, fs->win, 0, (BYTE)1) != RES_OK)
|
||||||
return FR_DISK_ERR;
|
return FR_DISK_ERR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2721,10 +2721,10 @@ FRESULT f_mkfs (
|
|||||||
mem_cpy(tbl+BS_VolLab32, "NO NAME FAT32 ", 19); /* Volume lavel, FAT signature */
|
mem_cpy(tbl+BS_VolLab32, "NO NAME FAT32 ", 19); /* Volume lavel, FAT signature */
|
||||||
}
|
}
|
||||||
ST_WORD(tbl+BS_55AA, 0xAA55); /* Signature */
|
ST_WORD(tbl+BS_55AA, 0xAA55); /* Signature */
|
||||||
if (disk_write(drv, tbl, b_part+0, 1) != RES_OK)
|
if (disk_write(drv, tbl, b_part+0,(BYTE) 1) != RES_OK)
|
||||||
return FR_DISK_ERR;
|
return FR_DISK_ERR;
|
||||||
if (fmt == FS_FAT32)
|
if (fmt == FS_FAT32)
|
||||||
disk_write(drv, tbl, b_part+6, 1);
|
disk_write(drv, tbl, b_part+6, (BYTE)1);
|
||||||
|
|
||||||
/* Initialize FAT area */
|
/* Initialize FAT area */
|
||||||
for (m = 0; m < N_FATS; m++) {
|
for (m = 0; m < N_FATS; m++) {
|
||||||
@ -2737,11 +2737,11 @@ FRESULT f_mkfs (
|
|||||||
ST_DWORD(tbl+4, 0xFFFFFFFF);
|
ST_DWORD(tbl+4, 0xFFFFFFFF);
|
||||||
ST_DWORD(tbl+8, 0x0FFFFFFF); /* Reserve cluster #2 for root dir */
|
ST_DWORD(tbl+8, 0x0FFFFFFF); /* Reserve cluster #2 for root dir */
|
||||||
}
|
}
|
||||||
if (disk_write(drv, tbl, b_fat++, 1) != RES_OK)
|
if (disk_write(drv, tbl, b_fat++,(BYTE) 1) != RES_OK)
|
||||||
return FR_DISK_ERR;
|
return FR_DISK_ERR;
|
||||||
mem_set(tbl, 0, SS(fs)); /* Following FAT entries are filled by zero */
|
mem_set(tbl, 0, SS(fs)); /* Following FAT entries are filled by zero */
|
||||||
for (n = 1; n < n_fat; n++) {
|
for (n = 1; n < n_fat; n++) {
|
||||||
if (disk_write(drv, tbl, b_fat++, 1) != RES_OK)
|
if (disk_write(drv, tbl, b_fat++,(BYTE) 1) != RES_OK)
|
||||||
return FR_DISK_ERR;
|
return FR_DISK_ERR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2749,7 +2749,7 @@ FRESULT f_mkfs (
|
|||||||
/* Initialize Root directory */
|
/* Initialize Root directory */
|
||||||
m = (BYTE)((fmt == FS_FAT32) ? allocsize : n_dir);
|
m = (BYTE)((fmt == FS_FAT32) ? allocsize : n_dir);
|
||||||
do {
|
do {
|
||||||
if (disk_write(drv, tbl, b_fat++, 1) != RES_OK)
|
if (disk_write(drv, tbl, b_fat++, (BYTE)1) != RES_OK)
|
||||||
return FR_DISK_ERR;
|
return FR_DISK_ERR;
|
||||||
} while (--m);
|
} while (--m);
|
||||||
|
|
||||||
@ -2760,8 +2760,8 @@ FRESULT f_mkfs (
|
|||||||
ST_DWORD(tbl+FSI_StrucSig, 0x61417272);
|
ST_DWORD(tbl+FSI_StrucSig, 0x61417272);
|
||||||
ST_DWORD(tbl+FSI_Free_Count, n_clst - 1);
|
ST_DWORD(tbl+FSI_Free_Count, n_clst - 1);
|
||||||
ST_DWORD(tbl+FSI_Nxt_Free, 0xFFFFFFFF);
|
ST_DWORD(tbl+FSI_Nxt_Free, 0xFFFFFFFF);
|
||||||
disk_write(drv, tbl, b_part+1, 1);
|
disk_write(drv, tbl, b_part+1, (BYTE)1);
|
||||||
disk_write(drv, tbl, b_part+7, 1);
|
disk_write(drv, tbl, b_part+7, (BYTE)1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (disk_ioctl(drv, CTRL_SYNC, (void*)NULL) == RES_OK) ? FR_OK : FR_DISK_ERR;
|
return (disk_ioctl(drv, CTRL_SYNC, (void*)NULL) == RES_OK) ? FR_OK : FR_DISK_ERR;
|
||||||
|
|||||||
@ -149,7 +149,7 @@ void boot(void)
|
|||||||
printfs(0, "FATFS OPTIXX.ORG ");
|
printfs(0, "FATFS OPTIXX.ORG ");
|
||||||
|
|
||||||
printfc("SNES::main: Try to init disk\n");
|
printfc("SNES::main: Try to init disk\n");
|
||||||
put_rc(f_mount(0, &fatfs[0]));
|
put_rc(f_mount((BYTE)0, &fatfs[0]));
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
printfc("SNES::main: Try to get free\n");
|
printfc("SNES::main: Try to get free\n");
|
||||||
@ -222,7 +222,7 @@ void boot(void)
|
|||||||
#endif /* */
|
#endif /* */
|
||||||
printfc("SNES::main: open %s \n", ROM_NAME);
|
printfc("SNES::main: open %s \n", ROM_NAME);
|
||||||
printfs(0, "OPEN %s", ROM_NAME);
|
printfs(0, "OPEN %s", ROM_NAME);
|
||||||
put_rc(f_open(&file1, ROM_NAME, FA_READ));
|
put_rc(f_open(&file1, ROM_NAME, (BYTE)FA_READ));
|
||||||
p1 = 32768L * 8;
|
p1 = 32768L * 8;
|
||||||
p2 = 0;
|
p2 = 0;
|
||||||
p3 = 0;
|
p3 = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user