Edited git ignore. Target can now build without any errors'!'

This commit is contained in:
2015-04-30 11:59:37 +02:00
parent af5141fade
commit 4d68a607bc
27 changed files with 1049 additions and 13 deletions

View File

@@ -9,7 +9,7 @@
//Only ONE device with ONE partition!!!
#include "diskio.h" /* FatFs lower layer API */
//TODO: include meow!
#include <shimatta_sdio-driver.h>
/* Definitions of physical drive number for each drive */
#define SDIO 0 /* Example: Map ATA harddisk to physical drive 0 */

View File

@@ -19,6 +19,8 @@
#include "ff.h" /* Declarations of FatFs API */
#include "diskio.h" /* Declarations of disk I/O functions */
//For get_fattime:
//#include <shimatta_sdio-driver.h>
/*--------------------------------------------------------------------------
@@ -62,9 +64,9 @@
#if _NORTC_YEAR < 1980 || _NORTC_YEAR > 2107 || _NORTC_MON < 1 || _NORTC_MON > 12 || _NORTC_MDAY < 1 || _NORTC_MDAY > 31
#error Invalid _FS_NORTC settings
#endif
#define GET_FATTIME() ((DWORD)(_NORTC_YEAR - 1980) << 25 | (DWORD)_NORTC_MON << 21 | (DWORD)_NORTC_MDAY << 16)
#define get_fattime() ((DWORD)(_NORTC_YEAR - 1980) << 25 | (DWORD)_NORTC_MON << 21 | (DWORD)_NORTC_MDAY << 16)
#else
#define GET_FATTIME() get_fattime()
#define get_fattime() get_fattime()
#endif
@@ -2462,7 +2464,7 @@ FRESULT f_open (
}
}
if (res == FR_OK && (mode & FA_CREATE_ALWAYS)) { /* Truncate it if overwrite mode */
dw = GET_FATTIME(); /* Created time */
dw = get_fattime(); /* Created time */
ST_DWORD(dir + DIR_CrtTime, dw);
dir[DIR_Attr] = 0; /* Reset attribute */
ST_DWORD(dir + DIR_FileSize, 0);/* size = 0 */
@@ -2788,7 +2790,7 @@ FRESULT f_sync (
dir[DIR_Attr] |= AM_ARC; /* Set archive bit */
ST_DWORD(dir + DIR_FileSize, fp->fsize); /* Update file size */
st_clust(dir, fp->sclust); /* Update start cluster */
tm = GET_FATTIME(); /* Update updated time */
tm = get_fattime(); /* Update updated timer*/
ST_DWORD(dir + DIR_WrtTime, tm);
ST_WORD(dir + DIR_LstAccDate, 0);
fp->flag &= ~FA__WRITTEN;
@@ -3556,7 +3558,7 @@ FRESULT f_mkdir (
FRESULT res;
DIR dj;
BYTE *dir, n;
DWORD dsc, dcl, pcl, tm = GET_FATTIME();
DWORD dsc, dcl, pcl, tm = get_fattime();
DEFINE_NAMEBUF;
@@ -3916,7 +3918,7 @@ FRESULT f_setlabel (
if (res == FR_OK) { /* A volume label is found */
if (vn[0]) {
mem_cpy(dj.dir, vn, 11); /* Change the volume label name */
tm = GET_FATTIME();
tm = get_fattime();
ST_DWORD(dj.dir + DIR_WrtTime, tm);
} else {
dj.dir[0] = DDEM; /* Remove the volume label */
@@ -3932,7 +3934,7 @@ FRESULT f_setlabel (
mem_set(dj.dir, 0, SZ_DIRE); /* Set volume label */
mem_cpy(dj.dir, vn, 11);
dj.dir[DIR_Attr] = AM_VOL;
tm = GET_FATTIME();
tm = get_fattime();
ST_DWORD(dj.dir + DIR_WrtTime, tm);
dj.fs->wflag = 1;
res = sync_fs(dj.fs);
@@ -4183,7 +4185,7 @@ FRESULT f_mkfs (
ST_WORD(tbl + BPB_SecPerTrk, 63); /* Number of sectors per track */
ST_WORD(tbl + BPB_NumHeads, 255); /* Number of heads */
ST_DWORD(tbl + BPB_HiddSec, b_vol); /* Hidden sectors */
n = GET_FATTIME(); /* Use current time as VSN */
n = get_fattime(); /* Use current time as VSN */
if (fmt == FS_FAT32) {
ST_DWORD(tbl + BS_VolID32, n); /* VSN */
ST_DWORD(tbl + BPB_FATSz32, n_fat); /* Number of sectors per FAT */

View File

@@ -0,0 +1,27 @@
/*
* shimatta_sdio-driver.c
*
* Created on: Apr 30, 2015
* Author: mari
*/
#include <shimatta_sdio-driver.h>
DSTATUS SDIO_status(){
return 0;
}
DSTATUS SDIO_initialize(){
return 0;
}
DRESULT SDIO_disk_read(BYTE *buff, DWORD sector, UINT count){
return RES_OK;
}
DRESULT SDIO_disk_write(BYTE *buff, DWORD sector, UINT count){
return RES_OK;
}
DRESULT SDIO_disk_ioctl(BYTE cmd, void* buff){
return RES_OK;
}
DWORD get_fattime(){
return 0;
}

View File

@@ -8,6 +8,13 @@
#ifndef FATFS_SHIMATTA_SDIO_DRIVER_SHIMATTA_SDIO_DRIVER_H_
#define FATFS_SHIMATTA_SDIO_DRIVER_SHIMATTA_SDIO_DRIVER_H_
#include <diskio.h>
DSTATUS SDIO_status();
DSTATUS SDIO_initialize();
DRESULT SDIO_disk_read(BYTE *buff, DWORD sector, UINT count);
DRESULT SDIO_disk_write(BYTE *buff, DWORD sector, UINT count);
DRESULT SDIO_disk_ioctl(BYTE cmd, void* buff);
DWORD get_fattime();
#endif /* FATFS_SHIMATTA_SDIO_DRIVER_SHIMATTA_SDIO_DRIVER_H_ */