From 8cf2490a30fd21959cea4baa0afc9cdced434593 Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Thu, 10 Dec 2020 00:06:49 +0200 Subject: file handling --- Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index f3d42b01a..a59a14dcf 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -794,8 +794,11 @@ FRESULT FileWrite(void * buffer, uint16_t size,char *path, uint32_t timeout) { LOG_ERROR (Fresult,"fwrite error"); } - //LOG_ERROR (Bytes,"f_write ok no of bytes"); - Report("f_write ok no of bytes", __FILE__, __LINE__, Bytes, RpWarning, (int)size, 0); + else + { + //LOG_ERROR (Bytes,"f_write ok no of bytes"); + Report("f_write ok no of bytes", __FILE__, __LINE__, Bytes, RpWarning, (int)size, 0); + } f_close(FileHandle); } else @@ -875,12 +878,14 @@ FRESULT FileRead(char *path, uint32_t *Size, void **Buffer) } else { - LOG_ERROR (Fresult,"malloc error"); + Report("malloc error", __FILE__, __LINE__, Fresult, RpWarning, (int)fno->fsize, 0); + Fresult = FR_DENIED; } } else { - LOG_ERROR (Fresult,"f_stat error"); + Report("f_stat error", __FILE__, __LINE__, Fresult, RpWarning, (int)0, 0); + Fresult = FR_DENIED; } my_free(fno); return Fresult; -- cgit v1.3.1