MPSoC Fixes #894

Merged
muellerr merged 4 commits from mpsoc-fixes into main 2024-05-13 14:03:12 +02:00
4 changed files with 29 additions and 7 deletions
Showing only changes of commit 0b3c928886 - Show all commits

View File

@@ -179,9 +179,12 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() {
ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
std::error_code e;
std::ofstream ofile(flashReadAndWrite.obcFile,
std::ios::trunc | std::ios::binary | std::ios::app);
if (ofile.bad()) {
if (std::filesystem::exists(flashReadAndWrite.obcFile)) {
// Truncate the file first.
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::binary | std::ios::trunc);
}
std::ofstream ofile(flashReadAndWrite.obcFile, std::ios::binary | std::ios::app);
if (ofile.bad() or not ofile.is_open()) {
return returnvalue::FAILED;
}
ReturnValue_t result = flashfopen(mpsoc::FileAccessModes::READ);

2
tmtc

Submodule tmtc updated: dccbf89da1...067a016040