aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-10-18 15:02:09 +0300
committerShlomo Hecht <shlomo@twine-s.com>2020-10-18 15:02:09 +0300
commit9c78f978589d5a1b8c4ff701a80e3e3b2bf3bee0 (patch)
treed61c9a4ad452bb152d946bff75c8ffbb9dbd3e9a /Software/Embedded_SW/Embedded/Common
parentb8ff21ed2013c5c2bea14d735786480d63fb0d67 (diff)
downloadTango-9c78f978589d5a1b8c4ff701a80e3e3b2bf3bee0.tar.gz
Tango-9c78f978589d5a1b8c4ff701a80e3e3b2bf3bee0.zip
task priorities
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c17
-rw-r--r--Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c2
2 files changed, 11 insertions, 8 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
index 72693f391..b9c87cd66 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
@@ -77,6 +77,8 @@ bool FileUploadGetState(void)
{
return FileDone;
}
+int CommRxpri;
+
uint32_t FileUploadRequestFunc(MessageContainer* requestContainer)
{
//uint32_t status = OK;
@@ -115,8 +117,9 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer)
if (sem_ok == true)
{
CommRxTaskHandle = Task_self();
- Task_setPri(CommRxTaskHandle, 4);
- // Report("Task_setPri", __FILE__, __LINE__, 4, RpWarning, (int)CommRxTaskHandle, 0);
+ CommRxpri = Task_getPri(CommRxTaskHandle);
+ Task_setPri(CommRxTaskHandle, 11);
+ Report("Task_setPri", __FILE__, __LINE__, 4, RpWarning, (int)CommRxTaskHandle, 0);
//Report("FileUploadRequestFunc 2", __FILE__, __LINE__, msec_millisecondCounter, RpWarning, (int)0, 0);
Fresult = f_open(UploadFileHandle,request->path,FA_READ | FA_WRITE | FA_OPEN_ALWAYS | FA_CREATE_ALWAYS);
if (Fresult == FR_OK)
@@ -173,9 +176,9 @@ uint32_t FileChunkUploadCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
UploadFileHandle = 0;
FileReceivedLength = 0;
FileDone = true;
- Task_setPri(CommRxTaskHandle, 9);
+ Task_setPri(CommRxTaskHandle, CommRxpri);
Semaphore_post(FileUpload_sem_param);
- //Report("Task_setPri", __FILE__, __LINE__, 9, RpWarning, (int)CommRxTaskHandle, 0);
+ Report("Task_setPri", __FILE__, __LINE__, CommRxpri, RpWarning, (int)CommRxTaskHandle, 0);
if (SafeRemoveControlCallback(Chunk_ControlId, FileChunkUploadCallBackFunction )==OK)
Chunk_ControlId = 0xFF;
@@ -272,9 +275,9 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
SendCharsWithType(container_buffer, container_size,MESSAGE_TYPE__FileChunkUploadResponse);
if (FileDone == true)
{
- Task_setPri(CommRxTaskHandle, 9);
+ Task_setPri(CommRxTaskHandle, CommRxpri);
Semaphore_post(FileUpload_sem_param);
- Report("Task_setPri", __FILE__, __LINE__, 9, RpWarning, (int)CommRxTaskHandle, 0);
+ Report("Task_setPri", __FILE__, __LINE__, CommRxpri, RpWarning, (int)CommRxTaskHandle, 0);
}
return OK;
}
@@ -288,7 +291,7 @@ void FileChunkUploadError(void)
UploadFileHandle = 0;
FileReceivedLength = 0;
FileDone = true;
- Task_setPri(CommRxTaskHandle, 9);
+ Task_setPri(CommRxTaskHandle, CommRxpri);
Semaphore_post(FileUpload_sem_param);
}
}
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c b/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c
index 54e186b28..0f4ce4244 100644
--- a/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c
+++ b/Software/Embedded_SW/Embedded/Common/Utilities/idle_task.c
@@ -27,7 +27,7 @@
#include "Modules/Control/Control.h"
#include "Modules/Control/MillisecTask.h"
#define MAX_PRIORITY 15
-#define SECOND_MAX_PRIORITY 14
+#define SECOND_MAX_PRIORITY 24
#define MIN_PRIORITY 0
#define SECOND_MIN_PRIORITY 1
#define TICKS_IN_SECOND 1000