diff options
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index f4c52f000..48e29e54c 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -600,7 +600,9 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) Data[i].name = fno[i]->fname; Data[i].has_length = true; Data[i].length = fno[i]->fsize; + Data[i].has_lastmodifieddate = true; Data[i].lastmodifieddate = fno[i]->fdate; + Data[i].has_lastmodifiedtime = true; Data[i].lastmodifiedtime = fno[i]->ftime; if (i==0) usnprintf(&FullPath[i], 50, "%s", request->path); @@ -644,7 +646,7 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer) } return Fresult; } -FRESULT FileWrite(void * buffer, uint16_t size,char *path) +FRESULT FileWrite(void * buffer, uint16_t size,char *path, uint32_t timeout) { FRESULT Fresult = FR_OK; FIL *FileHandle = 0; //the system supports a single active file @@ -657,7 +659,11 @@ FRESULT FileWrite(void * buffer, uint16_t size,char *path) Fresult = FR_DENIED; else { - Semaphore_pend(FFS_Sem, BIOS_WAIT_FOREVER); + if (Semaphore_pend(FFS_Sem, timeout) == false) + { + LOG_ERROR (false,"file system busy error"); + return FR_TIMEOUT; + } Fresult = f_open(FileHandle,path,FA_WRITE | FA_OPEN_ALWAYS); if (Fresult == FR_OK) |
