WPILibC++ 2027.0.0-alpha-4
Loading...
Searching...
No Matches
DriverStationModeThread.hpp
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <atomic>
8#include <thread>
9
12
13namespace wpi::internal {
14/**
15 * For internal use only.
16 */
18 public:
19 /**
20 * For internal use only.
21 *
22 * @param word initial control word
23 */
25
27
31 delete;
33
34 /**
35 * Only to be used to tell the Driver Station what code you claim to be
36 * executing for diagnostic purposes only.
37 *
38 * @param word control word
39 */
41 m_userControlWord = word.GetValue().value;
42 }
43
44 private:
45 std::atomic_bool m_keepAlive{false};
46 wpi::util::Event m_event{false, false};
47 std::thread m_thread;
48 void Run();
49 std::atomic<int64_t> m_userControlWord;
50};
51} // namespace wpi::internal
A wrapper around Driver Station control word.
Definition DriverStationTypes.hpp:29
HAL_ControlWord GetValue() const
Get the HAL raw value.
Definition DriverStationTypes.hpp:198
DriverStationModeThread(const DriverStationModeThread &other)=delete
DriverStationModeThread(DriverStationModeThread &&other)=delete
DriverStationModeThread(wpi::hal::ControlWord word)
For internal use only.
DriverStationModeThread & operator=(const DriverStationModeThread &other)=delete
void InControl(wpi::hal::ControlWord word)
Only to be used to tell the Driver Station what code you claim to be executing for diagnostic purpose...
Definition DriverStationModeThread.hpp:40
DriverStationModeThread & operator=(DriverStationModeThread &&other)=delete
An atomic signaling event for synchronization.
Definition Synchronization.hpp:231
Definition DriverStationModeThread.hpp:13
int64_t value
Definition DriverStationTypes.h:27