diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-07-28 13:14:18 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2019-07-28 13:14:18 +0300 |
| commit | 30759321e22e22363eda9387e178b4d48b7d9088 (patch) | |
| tree | 6192b4cb0c06d43150ecaca1de7c7e48b765f7b7 /Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | |
| parent | 5973459316a1b230bbbb88aaa4517a2524cbecac (diff) | |
| parent | a3f1ec8389cde87fff45dced9380f85d1b2424c6 (diff) | |
| download | Tango-30759321e22e22363eda9387e178b4d48b7d9088.tar.gz Tango-30759321e22e22363eda9387e178b4d48b7d9088.zip | |
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
| -rw-r--r-- | Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 8 |
1 files changed, 6 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..5cbc92285 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -644,7 +644,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 +657,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) |
