aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
diff options
context:
space:
mode:
authorVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-18 13:27:02 +0200
committerVictoria Plitt <Victoria.Plitt@twine-s.com>2019-12-18 13:27:02 +0200
commit41129873d38034c5679eeaf46f48e4f67fd38ba2 (patch)
tree94109a9602e91bcf7f114e3491bc8018e60bef4c /Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
parent70e3f2699a500666d1ca4e4d5db2dbaafb339e80 (diff)
parenta61a911d1ebde107ba7bf210af7e753e692d93e2 (diff)
downloadTango-41129873d38034c5679eeaf46f48e4f67fd38ba2.tar.gz
Tango-41129873d38034c5679eeaf46f48e4f67fd38ba2.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
index 5650cbd1b..d7592ccba 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
@@ -49,7 +49,7 @@ FIL *UploadFileHandle = 0; //the system supports a single active file
FIL *DownloadFileHandle = 0; //the system supports a single active file
char FileHandleChar[5];
char ErrorMsg[100];
-#define MAX_CHUNK_LENGTH 3500
+#define MAX_CHUNK_LENGTH 5500
int32_t FileLength = 0;
int32_t FileReceivedLength = 0;
int32_t FileSentLength = 0;
@@ -158,14 +158,16 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
FIL *ReceivedFileHandle; //the system supports a single active file
+ uint32_t save_milisec = 0;
// if (request->uploadid == 1)
ReceivedFileHandle = UploadFileHandle;
// memcpy (&ReceivedFileHandle,request->uploadid,sizeof(ReceivedFileHandle));
//if (ReceivedFileHandle == FileHandle)
//{
- Control_WD(ENABLE,55); //activate heaters/dispenser watchdog, 0.5 seconds
- GeneralHwReady = false;
+ //Control_WD(ENABLE,55); //activate heaters/dispenser watchdog, 0.5 seconds
+ //GeneralHwReady = false;
KeepAliveOneSecondCounter = 0;
+ save_milisec = msec_millisecondCounter;
Fresult = f_write(ReceivedFileHandle,request->buffer.data,request->buffer.len,&WrittenBytes );
lFresult = Fresult;
if(Fresult != FR_OK)
@@ -176,6 +178,8 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
else
{
FileReceivedLength += WrittenBytes;
+ ReportWithPackageFilter(CommFilter,"Chunk received", __FILE__,WrittenBytes,FileReceivedLength, RpMessage,msec_millisecondCounter-save_milisec, 0);
+
//REPORT_MSG (FileReceivedLength,"file upload chunk");
if (FileReceivedLength == FileLength)
{
@@ -224,12 +228,25 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
if (FileDone == true)
{
Task_setPri(CommRxTaskHandle, 9);
- GeneralHwReady = true;
Semaphore_post(FFS_Sem);
//Report("Task_setPri", __FILE__, __LINE__, 9, RpWarning, (int)CommRxTaskHandle, 0);
}
return OK;
}
+void FileChunkUploadError(void)
+{
+ if (FileDone == false)
+ {
+ REPORT_MSG (FileReceivedLength,"file upload too much data!");
+ f_close(UploadFileHandle);
+ my_free (UploadFileHandle);
+ UploadFileHandle = 0;
+ FileReceivedLength = 0;
+ FileDone = true;
+ Task_setPri(CommRxTaskHandle, 9);
+ Semaphore_post(FFS_Sem);
+ }
+}
uint32_t FileDownloadRequestFunc(MessageContainer* requestContainer)
{
//uint32_t status = OK;