diff --git a/common/constants.hpp b/common/constants.hpp index 859a210..850af8e 100644 --- a/common/constants.hpp +++ b/common/constants.hpp @@ -36,7 +36,7 @@ static constexpr uint8_t kMaxGear = 9; // smallest gear (= 1) corresponds to a gear size of 20 // when the gear increases, the gear size descreases static constexpr uint8_t kMaxGearSize = 20; -static constexpr uint8_t kMinGearSize = kMaxGearSize - kMaxGear; +static constexpr uint8_t kMinGearSize = kMaxGearSize - kMinGear; // pedal related constants // When compiling and linking with gcc, we get a link error when using static @@ -52,9 +52,8 @@ static constexpr std::chrono::milliseconds kMaxPedalRotationTime = 1500ms; static constexpr std::chrono::milliseconds kDeltaPedalRotationTime = 25ms; static constexpr uint32_t kNbrOfSteps = static_cast( - ( - bike_computer::kMaxPedalRotationTime - bike_computer::kMinPedalRotationTime - ).count() / bike_computer::kDeltaPedalRotationTime.count() -); + (bike_computer::kMaxPedalRotationTime - bike_computer::kMinPedalRotationTime) + .count() / + bike_computer::kDeltaPedalRotationTime.count()); -} // namespace bike_computer \ No newline at end of file +} // namespace bike_computer diff --git a/common/speedometer.hpp b/common/speedometer.hpp index bbc1e6b..d821093 100644 --- a/common/speedometer.hpp +++ b/common/speedometer.hpp @@ -79,13 +79,11 @@ class Speedometer { float _currentSpeed = 0.0f; Mutex _totalDistanceMutex; float _totalDistance = 0.0f; - uint8_t _gearSize = 1; - - Thread _thread; + uint8_t _gearSize = bike_computer::kMinGearSize; #if defined(MBED_TEST_MODE) mbed::Callback _cb; #endif }; -} // namespace bike_computer \ No newline at end of file +} // namespace bike_computer