aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-06-19 16:09:05 +0300
committerShlomo Hecht <shlomo@twine-s.com>2020-06-19 16:09:05 +0300
commit9ddb8965c11f48b83a523d5aa9eae8ba431b082e (patch)
tree1d4179fa5732b677e693a65d7d4815896cec6ba7 /Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
parent2f3691aea6e9dad37634134c6e1381fa4e40938e (diff)
downloadTango-9ddb8965c11f48b83a523d5aa9eae8ba431b082e.tar.gz
Tango-9ddb8965c11f48b83a523d5aa9eae8ba431b082e.zip
Version1.4.6.32; semaphores removed from file system for now
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c30
1 files changed, 20 insertions, 10 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
index 65328efb3..6bb40b215 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
@@ -82,7 +82,7 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer)
//uint32_t status = OK;
FRESULT Fresult = FR_OK;
-
+ bool sem_ok = false;
MessageContainer responseContainer;
FileUploadRequest* request = file_upload_request__unpack(NULL, requestContainer->data.len, requestContainer->data.data);
@@ -102,7 +102,17 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer)
Fresult = FR_DENIED;
else
{
- if (Semaphore_pend(FileUpload_sem_param, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FileUpload_sem_param, BIOS_NO_WAIT))
+ {
+ sem_ok = true;
+ }
+ else
+ {
+ Semaphore_post(FileUpload_sem_param);
+ Report("semaphore was not free", __FILE__, __LINE__, request->length, RpWarning, (int)MAX_CHUNK_LENGTH, 0);
+ sem_ok = true;
+ }
+ if (sem_ok == true)
{
CommRxTaskHandle = Task_self();
Task_setPri(CommRxTaskHandle, 2);
@@ -264,7 +274,7 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
{
Task_setPri(CommRxTaskHandle, 9);
Semaphore_post(FileUpload_sem_param);
- //Report("Task_setPri", __FILE__, __LINE__, 9, RpWarning, (int)CommRxTaskHandle, 0);
+ Report("Task_setPri", __FILE__, __LINE__, 9, RpWarning, (int)CommRxTaskHandle, 0);
}
return OK;
}
@@ -311,7 +321,7 @@ uint32_t FileDownloadRequestFunc(MessageContainer* requestContainer)
Fresult = FR_DENIED;
else
{
- if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
Fresult = f_open(DownloadFileHandle,request->filename,FA_READ );
if (Fresult == FR_OK)
@@ -495,7 +505,7 @@ uint32_t CreateRequestFunc(MessageContainer* requestContainer)
Fresult = FR_DENIED;
else
{
- if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
Fresult = f_open(UploadFileHandle,request->path,FA_READ | FA_WRITE | FA_OPEN_ALWAYS | FA_CREATE_ALWAYS);
if (Fresult == FR_OK)
@@ -553,7 +563,7 @@ uint32_t DeleteRequestFunc(MessageContainer* requestContainer)
//int NumOfFiles = 0;
FRESULT Fresult = FR_OK;
- if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
Fresult = f_unlink(request->path);
Semaphore_post(FFS_Sem);
@@ -659,7 +669,7 @@ uint32_t GetFilesRequestFunc(MessageContainer* requestContainer)
Report(curTime, __FILE__, ltm->tm_hour,ltm->tm_min , RpWarning, ltm->tm_sec, 0);
*/
- if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
Fresult |= f_opendir(&dir, g_cCwdBuf);
if(Fresult != FR_OK)
@@ -781,7 +791,7 @@ FRESULT FileWrite(void * buffer, uint16_t size,char *path, uint32_t timeout)
Fresult = FR_DENIED;
else
{
- if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
Fresult = f_open(FileHandle,path,FA_WRITE | FA_OPEN_ALWAYS|FA_CREATE_ALWAYS);
if (Fresult == FR_OK)
@@ -836,7 +846,7 @@ FRESULT FileRead(char *path, uint32_t *Size, void **Buffer)
Fresult = FR_DENIED;
else
{
- if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
Fresult = f_open(FileHandle,path,FA_READ);
if (Fresult == FR_OK)
@@ -899,7 +909,7 @@ FRESULT FileOpen(char *path, uint32_t *Size, FIL *FileHandle)
if (FileHandle == 0)
Fresult = FR_DENIED;
else
- if (Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
+ if (1)//(Semaphore_pend(FFS_Sem, BIOS_NO_WAIT))
{
Fresult = f_open(FileHandle,path,FA_READ);
Semaphore_post(FFS_Sem); //will be closed with the f_close, in the job