From e4eaedb7bcca2276a17bda687d7773dc1540346d Mon Sep 17 00:00:00 2001 From: Shlomo Hecht Date: Tue, 9 Jul 2019 16:52:02 +0300 Subject: improve flash handling --- Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c | 2 +- Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'Software/Embedded_SW/Embedded/Common/SWUpdate') diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c index c424320ff..8682f706a 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FileSystem.c @@ -284,7 +284,7 @@ uint32_t FileChunkDownloadRequestFunc(MessageContainer* requestContainer) FIL *SentFileHandle; //the system supports a single active file SentFileHandle = DownloadFileHandle; - char *Buffer = 0; + uint8_t *Buffer = 0; Buffer = my_malloc (MAX_CHUNK_LENGTH); if (Buffer != NULL) { diff --git a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c index 3bae023db..273dfb49d 100644 --- a/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c +++ b/Software/Embedded_SW/Embedded/Common/SWUpdate/FirmwareUpgrade.c @@ -143,21 +143,26 @@ uint32_t ActivateVersionRequestFunc(MessageContainer* requestContainer) usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); Fresult = f_unlink("//SYSINFO//EMBPARAM.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//EMBPARAM.CFG"); + LoadConfigurationParamsFromFile(); + CurrentRunningFile++; break; case VERSION_FILE_DESTINATION__ProcessParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); Fresult = f_unlink("//SYSINFO//PROCESSP.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//PROCESSP.CFG"); + CurrentRunningFile++; break; case VERSION_FILE_DESTINATION__AlarmParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); Fresult = f_unlink("//SYSINFO//ALARMPRM.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//ALARMPRM.CFG"); + CurrentRunningFile++; break; case VERSION_FILE_DESTINATION__GeneralHWConfigParams: usnprintf(FullPath, 50, "%s%s%s", request->path,"/", VersionPackage->filedescriptors[File_i]->filename); Fresult = f_unlink("//SYSINFO//GENHWCFG.CFG"); Fresult |= f_rename (FullPath, "//SYSINFO//GENHWCFG.CFG"); + CurrentRunningFile++; break; default: LOG_ERROR (VersionPackage->filedescriptors[File_i]->destination,"wrong file update Destination"); -- cgit v1.3.1