MPSoC Fixes #894
@@ -179,9 +179,12 @@ ReturnValue_t PlocMpsocSpecialComHelper::performFlashWrite() {
|
|||||||
|
|
||||||
ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
|
ReturnValue_t PlocMpsocSpecialComHelper::performFlashRead() {
|
||||||
std::error_code e;
|
std::error_code e;
|
||||||
std::ofstream ofile(flashReadAndWrite.obcFile,
|
if (std::filesystem::exists(flashReadAndWrite.obcFile)) {
|
||||||
std::ios::trunc | std::ios::binary | std::ios::app);
|
// Truncate the file first.
|
||||||
if (ofile.bad()) {
|
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;
|
return returnvalue::FAILED;
|
||||||
}
|
}
|
||||||
ReturnValue_t result = flashfopen(mpsoc::FileAccessModes::READ);
|
ReturnValue_t result = flashfopen(mpsoc::FileAccessModes::READ);
|
||||||
|
2
tmtc
2
tmtc
Submodule tmtc updated: dccbf89da1...067a016040
Reference in New Issue
Block a user