diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-23 12:07:58 +0200 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-12-23 12:07:58 +0200 |
| commit | 71ea5fcc1e5bb9f671b6cd5d7507e6689cdd535c (patch) | |
| tree | 0326a5701a49877db5c831fe371c03766c4fde72 /Software/Embedded_SW/Embedded/Drivers | |
| parent | 071a25b7bb2c03a6ae29fec70bd415ea89092dc4 (diff) | |
| download | Tango-71ea5fcc1e5bb9f671b6cd5d7507e6689cdd535c.tar.gz Tango-71ea5fcc1e5bb9f671b6cd5d7507e6689cdd535c.zip | |
fix FF reports, add time support for error log (and world time in the system), report regarding dispensers 50% and 25% LS
Diffstat (limited to 'Software/Embedded_SW/Embedded/Drivers')
3 files changed, 21 insertions, 19 deletions
diff --git a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c index c37bbc437..741f0bab3 100644 --- a/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c +++ b/Software/Embedded_SW/Embedded/Drivers/FPGA/FPGA_GPIO/FPGA_GPIO.c @@ -18,6 +18,7 @@ #include "Drivers/I2C_Communication/Head_Card/IO_Ports/Head_IO.h" #include <Drivers/I2C_Communication/I2C_Task.h> +#include <Utilities/utils.h> #include <Utilities/delay.h> FPGA_GPI FPGA_Gpi; @@ -487,9 +488,9 @@ uint32_t DeActivateCleanerPump() return OK; } //---------------------------------- - void Power_Off()//Power Down { + utilsStoreLocalTime(); #ifdef WATCHDOG ROM_WatchdogResetDisable(WATCHDOG0_BASE); #endif @@ -499,6 +500,7 @@ void Power_Off()//Power Down void Power_Reset()// Resets the MCU { + utilsStoreLocalTime(); F3_SW_RESET_reg &= ~BIT0; SysCtlDelay(1000); F3_SW_RESET_reg |= BIT0; 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 */ diff --git a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h index 2102d1716..aee812973 100644 --- a/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h +++ b/Software/Embedded_SW/Embedded/Drivers/flash_ram/MCU_E2Prom.h @@ -38,7 +38,7 @@ typedef enum { EEPROM_ALARM_SUPPORT, EEPROM_ORIFICE1_ZERO_VALUE, EEPROM_ORIFICE3_ZERO_VALUE, - EEPROM_WASTE_TANK_ZERO_VALUE, + EEPROM_LOCAL_TIME, EEPROM_PULLER_TENSION_POSITION, EEPROM_WINDER_TENSION_POSITION, EEPROM_INIT_FAILURE_COUNTER, |
