libstp
Robotics library for Botball
Loading...
Searching...
No Matches
speed_mode_context.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <atomic>
4
5namespace libstp::foundation
6{
30 {
31 public:
34
36 [[nodiscard]] bool isSpeedModeEnabled() const noexcept;
37
40 void setSpeedModeEnabled(bool enabled) noexcept;
41
46 void assertBemfAvailable(const char* context) const;
47
49 SpeedModeContext& operator=(const SpeedModeContext&) = delete;
51 SpeedModeContext& operator=(SpeedModeContext&&) = delete;
52
53 private:
54 SpeedModeContext() = default;
55
56 std::atomic<bool> speed_mode_enabled_{false};
57 };
58}
bool isSpeedModeEnabled() const noexcept
True when SpeedMode is active (BEMF disabled, no cm precision).
SpeedModeContext(const SpeedModeContext &)=delete
static SpeedModeContext & instance()
Access the process-wide instance.
void assertBemfAvailable(const char *context) const
void setSpeedModeEnabled(bool enabled) noexcept