From 1d05aac9143635c1abbf4b0ea124f350624beb5b Mon Sep 17 00:00:00 2001 From: Erki Date: Mon, 5 Jul 2021 11:44:32 +0300 Subject: [PATCH] Peripherals: make the encoder's full rev count atomic. --- Peripherals/Inc/peripherals_encoder.hpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Peripherals/Inc/peripherals_encoder.hpp b/Peripherals/Inc/peripherals_encoder.hpp index 21c200c..b4d52dc 100644 --- a/Peripherals/Inc/peripherals_encoder.hpp +++ b/Peripherals/Inc/peripherals_encoder.hpp @@ -8,6 +8,7 @@ #ifndef SKULLC_PERIPHERALS_ENCODER_HPP_ #define SKULLC_PERIPHERALS_ENCODER_HPP_ +#include #include #include @@ -87,7 +88,7 @@ private: TIM_HandleTypeDef* htim_; std::uint32_t channels_; - std::int32_t full_revolutions_ = 0; + std::atomic full_revolutions_ = 0; }; }// namespace Peripherals