From 628ceeeb96fb1c97b22e7c9db63ce300add65583 Mon Sep 17 00:00:00 2001 From: oganigl Date: Wed, 22 Apr 2026 13:43:15 +0200 Subject: [PATCH 1/6] move direction outside template --- Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp b/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp index 7bcf98eb7..093b3913f 100644 --- a/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp +++ b/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp @@ -9,9 +9,9 @@ #include "C++Utilities/CppUtils.hpp" namespace ST_LIB { - + enum Direction : uint8_t { FORWARD = 0, BACKWARDS = 1 }; template struct EncoderSensor { - enum Direction : uint8_t { FORWARD = 0, BACKWARDS = 1 }; + private: constexpr static size_t WINDOW_SIZE{(SAMPLES / 2) * 2}; From 18a30f1546550f1bc697daeeb95ae5d408fd61bf Mon Sep 17 00:00:00 2001 From: oganigl Date: Wed, 22 Apr 2026 13:44:03 +0200 Subject: [PATCH 2/6] run indentation --- Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp b/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp index 093b3913f..52bc7259a 100644 --- a/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp +++ b/Inc/ST-LIB_LOW/Sensors/EncoderSensor/NewEncoderSensor.hpp @@ -9,9 +9,8 @@ #include "C++Utilities/CppUtils.hpp" namespace ST_LIB { - enum Direction : uint8_t { FORWARD = 0, BACKWARDS = 1 }; +enum Direction : uint8_t { FORWARD = 0, BACKWARDS = 1 }; template struct EncoderSensor { - private: constexpr static size_t WINDOW_SIZE{(SAMPLES / 2) * 2}; From d711b413a7a07a376e9413ef07d312cfdcbfa8c5 Mon Sep 17 00:00:00 2001 From: oganigl Date: Wed, 22 Apr 2026 13:45:47 +0200 Subject: [PATCH 3/6] add .md --- .changesets/archive/v5.1.0/move-struct-direction.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .changesets/archive/v5.1.0/move-struct-direction.md diff --git a/.changesets/archive/v5.1.0/move-struct-direction.md b/.changesets/archive/v5.1.0/move-struct-direction.md new file mode 100644 index 000000000..f9254fd1c --- /dev/null +++ b/.changesets/archive/v5.1.0/move-struct-direction.md @@ -0,0 +1,2 @@ +release: minor +summary: move a struct outside template class From 22912108fe1e84ccfd524237127940205582e121 Mon Sep 17 00:00:00 2001 From: oganigl Date: Wed, 22 Apr 2026 13:52:36 +0200 Subject: [PATCH 4/6] it was in archive, my bad --- .changesets/{archive/v5.1.0 => }/move-struct-direction.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .changesets/{archive/v5.1.0 => }/move-struct-direction.md (100%) diff --git a/.changesets/archive/v5.1.0/move-struct-direction.md b/.changesets/move-struct-direction.md similarity index 100% rename from .changesets/archive/v5.1.0/move-struct-direction.md rename to .changesets/move-struct-direction.md From c50653e65995847eb47c1d23e77449a4db0a10d9 Mon Sep 17 00:00:00 2001 From: oganigl Date: Wed, 22 Apr 2026 15:44:26 +0200 Subject: [PATCH 5/6] fucked tests --- Tests/Time/encoder_test.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Tests/Time/encoder_test.cpp b/Tests/Time/encoder_test.cpp index eaf3b8b13..ad963b495 100644 --- a/Tests/Time/encoder_test.cpp +++ b/Tests/Time/encoder_test.cpp @@ -103,7 +103,7 @@ TEST(EncoderSensorTest, ReadTreatsEncoderInitialCounterAsZeroPosition) { double position = -1.0; double speed = -1.0; double acceleration = -1.0; - MockSensor::Direction direction = MockSensor::BACKWARDS; + ST_LIB::Direction direction = ST_LIB::Direction::BACKWARDS; MockSensor sensor(encoder, 0.5, 0.1, &direction, &position, &speed, &acceleration); @@ -112,7 +112,7 @@ TEST(EncoderSensorTest, ReadTreatsEncoderInitialCounterAsZeroPosition) { EXPECT_DOUBLE_EQ(position, 0.0); EXPECT_DOUBLE_EQ(speed, 0.0); EXPECT_DOUBLE_EQ(acceleration, 0.0); - EXPECT_EQ(direction, MockSensor::FORWARD); + EXPECT_EQ(direction, ST_LIB::Direction::FORWARD); } TEST(EncoderSensorTest, ResetForwardsToEncoderAndClearsHistory) { @@ -122,7 +122,7 @@ TEST(EncoderSensorTest, ResetForwardsToEncoderAndClearsHistory) { double position = 0.0; double speed = 0.0; double acceleration = 0.0; - MockSensor::Direction direction = MockSensor::BACKWARDS; + ST_LIB::Direction direction = ST_LIB::Direction::BACKWARDS; MockSensor sensor(encoder, 1.0, 1.0, &direction, &position, &speed, &acceleration); From f949f4136780dd9251c336359449d2324b79798c Mon Sep 17 00:00:00 2001 From: oganigl Date: Wed, 22 Apr 2026 15:48:26 +0200 Subject: [PATCH 6/6] fucking fucking indentation --- Tests/Time/encoder_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/Time/encoder_test.cpp b/Tests/Time/encoder_test.cpp index ad963b495..057e05e4e 100644 --- a/Tests/Time/encoder_test.cpp +++ b/Tests/Time/encoder_test.cpp @@ -103,7 +103,7 @@ TEST(EncoderSensorTest, ReadTreatsEncoderInitialCounterAsZeroPosition) { double position = -1.0; double speed = -1.0; double acceleration = -1.0; - ST_LIB::Direction direction = ST_LIB::Direction::BACKWARDS; + ST_LIB::Direction direction = ST_LIB::Direction::BACKWARDS; MockSensor sensor(encoder, 0.5, 0.1, &direction, &position, &speed, &acceleration); @@ -122,7 +122,7 @@ TEST(EncoderSensorTest, ResetForwardsToEncoderAndClearsHistory) { double position = 0.0; double speed = 0.0; double acceleration = 0.0; - ST_LIB::Direction direction = ST_LIB::Direction::BACKWARDS; + ST_LIB::Direction direction = ST_LIB::Direction::BACKWARDS; MockSensor sensor(encoder, 1.0, 1.0, &direction, &position, &speed, &acceleration);