Peripherals: make the encoder's full rev count atomic.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Erki 2021-07-05 11:44:32 +03:00
parent 551b71f298
commit 1d05aac914

View File

@ -8,6 +8,7 @@
#ifndef SKULLC_PERIPHERALS_ENCODER_HPP_
#define SKULLC_PERIPHERALS_ENCODER_HPP_
#include <atomic>
#include <cstdint>
#include <tim.h>
@ -87,7 +88,7 @@ private:
TIM_HandleTypeDef* htim_;
std::uint32_t channels_;
std::int32_t full_revolutions_ = 0;
std::atomic<std::int32_t> full_revolutions_ = 0;
};
}// namespace Peripherals