aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Drivers/Flash_Memory
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
committerMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
commit00a491d93733d4625ad329b2ba8237f445364b3f (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Embedded_SW/Embedded/Drivers/Flash_Memory
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
downloadTango-00a491d9.tar.gz
Tango-00a491d9.zip
merge
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers/Flash_Memory')
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/fatfs_port_mx66l51235f.c5
-rw-r--r--Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c34
2 files changed, 21 insertions, 18 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/fatfs_port_mx66l51235f.c b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/fatfs_port_mx66l51235f.c
index 0eccc7601..23490aca3 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/fatfs_port_mx66l51235f.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/fatfs_port_mx66l51235f.c
@@ -24,6 +24,8 @@
#include "driverlib/gpio.h"
#include "inc/hw_memmap.h"
#include <time.h>
+#include <utils/ustdlib.h>
+#include <DataDef.h>
//#include <ti/mw/fatfs/ff.h>
//#include <ti/mw/fatfs/ffcio.h>
@@ -200,7 +202,8 @@ void disk_timerproc (void)
DWORD get_fattime (void)
{
//return miliseconds / 1000;
- DWORD t = (DWORD)time(NULL);
+ time_t tt = umktime(&LocalTime);
+ DWORD t = (DWORD)tt;
return t;
}
diff --git a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c
index 632dfb0d5..5140b8202 100644
--- a/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c
+++ b/Software/Embedded_SW/Embedded/Drivers/Flash_Memory/FATFS/ff.c
@@ -898,7 +898,7 @@ FRESULT put_fat (
if (clst < 2 || clst >= fs->n_fatent) { /* Check range */
{
res = FR_INT_ERR;
- Report("put_fat FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fs->n_fatent,0);
+ safeReport("put_fat FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fs->n_fatent,0);
}
} else {
@@ -934,7 +934,7 @@ FRESULT put_fat (
default :
res = FR_INT_ERR;
- Report("put_fat FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fs->fs_type,0);
+ safeReport("put_fat FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fs->fs_type,0);
}
fs->wflag = 1;
@@ -965,7 +965,7 @@ FRESULT remove_chain (
if (clst < 2 || clst >= fs->n_fatent) { /* Check range */
res = FR_INT_ERR;
- Report("remove_chain FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fs->n_fatent,0);
+ safeReport("remove_chain FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fs->n_fatent,0);
} else {
res = FR_OK;
while (clst < fs->n_fatent) { /* Not a last link? */
@@ -973,7 +973,7 @@ FRESULT remove_chain (
if (nxt == 0) break; /* Empty cluster? */
if (nxt == 1) {
res = FR_INT_ERR;
- Report("remove_chain FR_INT_ERR",__FILE__,__LINE__,(int)res,RpWarning,(int)fs->n_fatent,0);
+ safeReport("remove_chain FR_INT_ERR",__FILE__,__LINE__,(int)res,RpWarning,(int)fs->n_fatent,0);
break; } /* Internal error? */
if (nxt == 0xFFFFFFFF) { res = FR_DISK_ERR; break; } /* Disk error? */
res = put_fat(fs, clst, 0); /* Mark the cluster "empty" */
@@ -1108,7 +1108,7 @@ FRESULT dir_sdi (
clst = dj->sclust;
if (clst == 1 || clst >= dj->fs->n_fatent) /* Check start cluster range */
{
- Report("dir_sdi FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)dj->fs->n_fatent,0);
+ safeReport("dir_sdi FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)dj->fs->n_fatent,0);
return FR_INT_ERR;
}
if (!clst && dj->fs->fs_type == FS_FAT32) /* Replace cluster# 0 with root cluster# if in FAT32 */
@@ -1118,7 +1118,7 @@ FRESULT dir_sdi (
dj->clust = clst;
if (idx >= dj->fs->n_rootdir) /* Index is out of range */
{
- Report("dir_sdi FR_INT_ERR",__FILE__,__LINE__,(int)idx,RpWarning,(int)dj->fs->n_rootdir,0);
+ safeReport("dir_sdi FR_INT_ERR",__FILE__,__LINE__,(int)idx,RpWarning,(int)dj->fs->n_rootdir,0);
return FR_INT_ERR;
}
dj->sect = dj->fs->dirbase + idx / (SS(dj->fs) / SZ_DIR); /* Sector# */
@@ -1130,7 +1130,7 @@ FRESULT dir_sdi (
if (clst == 0xFFFFFFFF) return FR_DISK_ERR; /* Disk error */
if (clst < 2 || clst >= dj->fs->n_fatent) /* Reached to end of table or int error */
{
- Report("dir_sdi FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)dj->fs->n_fatent,0);
+ safeReport("dir_sdi FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)dj->fs->n_fatent,0);
return FR_INT_ERR;
}
idx -= ic;
@@ -2578,7 +2578,7 @@ FRESULT f_write (
if (res != FR_OK) LEAVE_FF(fp->fs, res);
if (fp->flag & FA__ERROR) /* Aborted file? */
{
- Report("f_write FR_INT_ERR",__FILE__,__LINE__,(int)fp->flag,RpWarning,(int)btw,0);
+ safeReport("f_write FR_INT_ERR",__FILE__,__LINE__,(int)fp->flag,RpWarning,(int)btw,0);
LEAVE_FF(fp->fs, FR_INT_ERR);
}
if (!(fp->flag & FA_WRITE)) /* Check access mode */
@@ -2620,7 +2620,7 @@ FRESULT f_write (
sect = clust2sect(fp->fs, fp->clust); /* Get current sector */
if (!sect)
{
- Report("f_write FR_INT_ERR",__FILE__,__LINE__,(int)sect,RpWarning,(int)btw,0);
+ safeReport("f_write FR_INT_ERR",__FILE__,__LINE__,(int)sect,RpWarning,(int)btw,0);
ABORT(fp->fs, FR_INT_ERR);
}
sect += csect;
@@ -2913,7 +2913,7 @@ FRESULT f_lseek (
if (res != FR_OK) LEAVE_FF(fp->fs, res);
if (fp->flag & FA__ERROR) /* Check abort flag */
{
- Report("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)fp->flag,RpWarning,(int)FA__ERROR,0);
+ safeReport("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)fp->flag,RpWarning,(int)FA__ERROR,0);
LEAVE_FF(fp->fs, FR_INT_ERR);
}
@@ -3000,7 +3000,7 @@ FRESULT f_lseek (
clst = create_chain(fp->fs, 0);
if (clst == 1)
{
- Report("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)FA__ERROR,0);
+ safeReport("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)FA__ERROR,0);
ABORT(fp->fs, FR_INT_ERR);
}
if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
@@ -3023,7 +3023,7 @@ FRESULT f_lseek (
if (clst == 0xFFFFFFFF) ABORT(fp->fs, FR_DISK_ERR);
if (clst <= 1 || clst >= fp->fs->n_fatent)
{
- Report("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fp->fs->n_fatent,0);
+ safeReport("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)clst,RpWarning,(int)fp->fs->n_fatent,0);
ABORT(fp->fs, FR_INT_ERR);
}
fp->clust = clst;
@@ -3035,7 +3035,7 @@ FRESULT f_lseek (
nsect = clust2sect(fp->fs, clst); /* Current sector */
if (!nsect)
{
- Report("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)nsect,RpWarning,(int)0,0);
+ safeReport("f_lseek FR_INT_ERR",__FILE__,__LINE__,(int)nsect,RpWarning,(int)0,0);
ABORT(fp->fs, FR_INT_ERR);
}
nsect += ofs / SS(fp->fs);
@@ -3227,7 +3227,7 @@ FRESULT f_getfree (
if (stat == 0xFFFFFFFF) { res = FR_DISK_ERR; break; }
if (stat == 1)
{
- Report("f_getfree FR_INT_ERR",__FILE__,__LINE__,(int)stat,RpWarning,(int)0,0);
+ safeReport("f_getfree FR_INT_ERR",__FILE__,__LINE__,(int)stat,RpWarning,(int)0,0);
res = FR_INT_ERR; break; }
if (stat == 0) n++;
} while (++clst < fs->n_fatent);
@@ -3277,7 +3277,7 @@ FRESULT f_truncate (
res = validate(fp); /* Check validity of the object */
if (res == FR_OK) {
if (fp->flag & FA__ERROR) { /* Check abort flag */
- Report("f_truncate FR_INT_ERR",__FILE__,__LINE__,(int)fp->flag,RpWarning,(int)0,0);
+ safeReport("f_truncate FR_INT_ERR",__FILE__,__LINE__,(int)fp->flag,RpWarning,(int)0,0);
res = FR_INT_ERR;
} else {
if (!(fp->flag & FA_WRITE)) /* Check access mode */
@@ -3297,7 +3297,7 @@ FRESULT f_truncate (
if (ncl == 0xFFFFFFFF) res = FR_DISK_ERR;
if (ncl == 1)
{
- Report("f_truncate FR_INT_ERR",__FILE__,__LINE__,(int)ncl,RpWarning,(int)0,0);
+ safeReport("f_truncate FR_INT_ERR",__FILE__,__LINE__,(int)ncl,RpWarning,(int)0,0);
res = FR_INT_ERR;
}
if (res == FR_OK && ncl < fp->fs->n_fatent) {
@@ -3350,7 +3350,7 @@ FRESULT f_unlink (
dclst = ld_clust(dj.fs, dir);
if (res == FR_OK && (dir[DIR_Attr] & AM_DIR)) { /* Is it a sub-dir? */
if (dclst < 2) {
- Report("f_unlink FR_INT_ERR",__FILE__,__LINE__,(int)dclst,RpWarning,(int)0,0);
+ safeReport("f_unlink FR_INT_ERR",__FILE__,__LINE__,(int)dclst,RpWarning,(int)0,0);
res = FR_INT_ERR;
} else {
mem_cpy(&sdj, &dj, sizeof (DIR)); /* Check if the sub-dir is empty or not */