Peripherals: make the encoder's full rev count atomic.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
551b71f298
commit
1d05aac914
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user