diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index f568f65..64c5c5a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,5 +22,5 @@ repos: - id: cppcheck name: cppcheck require_serial: true - entry: cppcheck --enable=all --suppress=missingInclude --suppress=missingIncludeSystem --inline-suppr -i mbed-os --std=c++14 --error-exitcode=1 + entry: cppcheck --enable=all --suppress=missingInclude --suppress=missingIncludeSystem --suppress=unusedStructMember --inline-suppr -i mbed-os --std=c++14 --error-exitcode=1 language: system diff --git a/common/constants.hpp b/common/constants.hpp index 850af8e..8ba92e1 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 - kMinGear; +static constexpr uint8_t kMinGearSize = kMaxGearSize - kMaxGear; // pedal related constants // When compiling and linking with gcc, we get a link error when using static diff --git a/common/speedometer.hpp b/common/speedometer.hpp index 559eafc..6326d77 100644 --- a/common/speedometer.hpp +++ b/common/speedometer.hpp @@ -80,7 +80,7 @@ class Speedometer { float _currentSpeed = 0.0f; Mutex _totalDistanceMutex; float _totalDistance = 0.0f; - uint8_t _gearSize = bike_computer::kMinGearSize; + uint8_t _gearSize = bike_computer::kMaxGearSize; #if defined(MBED_TEST_MODE) mbed::Callback _cb; diff --git a/multi_tasking/bike_system.hpp b/multi_tasking/bike_system.hpp index 377a084..41a1935 100644 --- a/multi_tasking/bike_system.hpp +++ b/multi_tasking/bike_system.hpp @@ -138,7 +138,7 @@ class BikeSystem { ////////////////////////////////////////////////////////////// // shared resources between the main thread and the isr thread uint8_t _currentGear = bike_computer::kMinGear; - uint8_t _currentGearSize = bike_computer::kMinGearSize; + uint8_t _currentGearSize = bike_computer::kMaxGearSize; ////////////////////////////////////////////////////////////// // data member that represents the device for manipulating the pedal rotation diff --git a/static_scheduling/bike_system.hpp b/static_scheduling/bike_system.hpp index 67fefd5..5e8ccf2 100644 --- a/static_scheduling/bike_system.hpp +++ b/static_scheduling/bike_system.hpp @@ -80,7 +80,7 @@ class BikeSystem { // data member that represents the device for manipulating the gear GearDevice _gearDevice; uint8_t _currentGear = bike_computer::kMinGear; - uint8_t _currentGearSize = bike_computer::kMinGearSize; + uint8_t _currentGearSize = bike_computer::kMaxGearSize; // data member that represents the device for manipulating the pedal rotation // speed/time PedalDevice _pedalDevice;