aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2020-06-01 20:06:06 +0300
committerShlomo Hecht <shlomo@twine-s.com>2020-06-01 20:06:06 +0300
commit63a7b55a394c99048e6662823b8c4ead962e3eab (patch)
tree6cb0ec6c16bfb3cc88dd8b5e64de2c9cff32027a /Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
parentda153304bc308e9f6a101384bd55d2e85d172618 (diff)
downloadTango-63a7b55a394c99048e6662823b8c4ead962e3eab.tar.gz
Tango-63a7b55a394c99048e6662823b8c4ead962e3eab.zip
head eeprom failure causes bit failure and red activity led
whs eeprom failure causes bit failure and orange activity led secondary heater deactivated when not active file system control failures
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c')
-rw-r--r--Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
index 794ef6d37..1b53a826b 100644
--- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
+++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c
@@ -35,6 +35,7 @@
#include "drivers/Flash_Memory/fatfs/ff.h"
#include "drivers/FPGA/FPGA_GPIO/FPGA_GPIO.h"
+#include "Modules/Control/Control.h"
#include "StateMachines/Printing/PrintingSTM.h"
@@ -152,6 +153,20 @@ uint32_t FileUploadRequestFunc(MessageContainer* requestContainer)
return OK;
}
FRESULT lFresult = FR_OK;
+uint32_t Chunk_ControlId = 0xFF;
+uint32_t FileChunkUploadCallBackFunction(uint32_t IfIndex, uint32_t BusyFlag)
+{
+ Report("chunk timeout error",__FILE__,IfIndex,FileReceivedLength,RpWarning,BusyFlag,0);
+ f_close(UploadFileHandle);
+ my_free (UploadFileHandle);
+ UploadFileHandle = 0;
+ FileReceivedLength = 0;
+ FileDone = true;
+ if (SafeRemoveControlCallback(Chunk_ControlId, FileChunkUploadCallBackFunction )==OK)
+ Chunk_ControlId = 0xFF;
+
+}
+
uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
{
//uint32_t status = OK;
@@ -184,6 +199,8 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
{
KeepAliveOneSecondCounter = 0;
save_milisec = msec_millisecondCounter;
+ Chunk_ControlId = AddControlCallback("chunk", FileChunkUploadCallBackFunction, eOneSecond, TemplateDataReadCBFunction,0,request->buffer.len, WrittenBytes );
+
Fresult = f_write(ReceivedFileHandle,request->buffer.data,request->buffer.len,&WrittenBytes );
lFresult = Fresult;
if(Fresult != FR_OK)
@@ -195,6 +212,8 @@ uint32_t FileChunkUploadRequestFunc(MessageContainer* requestContainer)
{
FileReceivedLength += WrittenBytes;
ReportWithPackageFilter(CommFilter,"Chunk received", __FILE__,FileLength,FileReceivedLength, RpMessage,msec_millisecondCounter-save_milisec, 0);
+ RemoveControlCallback(Chunk_ControlId, FileChunkUploadCallBackFunction );
+ Chunk_ControlId = 0xFF;
//REPORT_MSG (FileReceivedLength,"file upload chunk");
if (FileReceivedLength == FileLength)