diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 287fea6a..7eb20a9f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,4 +1,4 @@ { "name": "STS1 COBC Full", - "image": "tuwienspaceteam/sts1-cobc:1.6.0" + "image": "tuwienspaceteam/sts1-cobc:1.6.1" } diff --git a/Sts1CobcSw/Periphery/FramMock.cpp b/Sts1CobcSw/Periphery/FramMock.cpp index 532201b6..2ac7f549 100644 --- a/Sts1CobcSw/Periphery/FramMock.cpp +++ b/Sts1CobcSw/Periphery/FramMock.cpp @@ -1,16 +1,16 @@ #include +#include #include -#include -#include +#include // IWYU pragma: keep #include -#include namespace sts1cobcsw::fram { -auto ramSimulation = std::array{}; +constexpr auto framSize = (1U << 20U); +auto ramSimulation = std::array{}; MockMode mockDevice = MockMode::ram; constexpr auto mockFilename = "FramMock.bin"; @@ -91,7 +91,7 @@ auto WriteTo(Address address, void const * data, std::size_t nBytes) -> void } else { - // FIXME: Fix pointer arithmetic + // FIXME: Fix pointer arithmetic and out of bounds access std::memcpy(ramSimulation.data() + address, data, nBytes); } } diff --git a/Sts1CobcSw/Periphery/FramMock.hpp b/Sts1CobcSw/Periphery/FramMock.hpp index 0af1c733..349ac7e0 100644 --- a/Sts1CobcSw/Periphery/FramMock.hpp +++ b/Sts1CobcSw/Periphery/FramMock.hpp @@ -3,6 +3,8 @@ #include +#include + namespace sts1cobcsw::fram { diff --git a/Tests/UnitTests/Fram.test.cpp b/Tests/UnitTests/Fram.test.cpp index 6d6bf84c..653e8616 100644 --- a/Tests/UnitTests/Fram.test.cpp +++ b/Tests/UnitTests/Fram.test.cpp @@ -43,8 +43,6 @@ TEST_CASE("Fram mock using ram") std::generate( testData.begin(), testData.end(), [&]() { return static_cast(randomEngine()); }); WriteAndReadTestData(address); -<<<<<<< HEAD -======= auto deviceId = fram::ReadDeviceId(); constexpr auto correctDeviceId = @@ -53,7 +51,6 @@ TEST_CASE("Fram mock using ram") fram::SetDoReadDeviceId(ReadCorrectDeviceId); deviceId = fram::ReadDeviceId(); REQUIRE(deviceId == correctDeviceId); ->>>>>>> 465f578 (Fix more stuff) } TEST_CASE("Fram mock using file") @@ -78,14 +75,10 @@ auto WriteAndReadTestData(fram::Address const & address) -> void static_cast(testDataSize), static_cast(address)); fram::WriteTo(address, Span(testData)); -<<<<<<< HEAD - std::printf("Reading n bytes from address ...\n"); -======= std::printf("Reading %d bytes from address 0x%08x ...\n", static_cast(testDataSize), static_cast(address)); ->>>>>>> 465f578 (Fix more stuff) fram::ReadFrom(address, Span(&readData)); std::printf("Comparing first %d written and read bytes:\n", nBytesToPrint);