From e40dd74f396b41590563a83af4ab9af1e58f9e5c Mon Sep 17 00:00:00 2001 From: meggert Date: Thu, 14 Sep 2023 13:54:05 +0200 Subject: [PATCH] lets see if this robin guy knows what he is talking about --- mission/controller/AcsController.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/mission/controller/AcsController.cpp b/mission/controller/AcsController.cpp index f0c1f3e0..c78ed47a 100644 --- a/mission/controller/AcsController.cpp +++ b/mission/controller/AcsController.cpp @@ -1040,18 +1040,14 @@ ReturnValue_t AcsController::updateTle(const uint8_t *line1, const uint8_t *line } ReturnValue_t AcsController::writeTleToFs(const uint8_t *tle) { - // split TLE to two lines - // not sure why these need to be 70 long - uint8_t tleLine1[70] = {}; - uint8_t tleLine2[70] = {}; - std::memcpy(tleLine1, tle, 69); - std::memcpy(tleLine2, tle + 69, 69); // ToDo: check which SD card is active via sdcMan std::string path = SD_0 + TLE_FILE; // Clear existing TLE from file std::ofstream tleFile(path.c_str(), std::ofstream::out | std::ofstream::trunc); if (tleFile.is_open()) { - tleFile << tleLine1 << "\n" << tleLine2 << "\n"; + tleFile.write(static_cast(tle), 69); + tleFile << "\n"; + tleFile.write(static_cast(tle + 69), 69); } else { // return error }