name our threads for ease of debugging
Change-Id: If35518ed5f33aa38cc054d075cbe2850960ea3f5
diff --git a/frc971/wpilib/wpilib_interface.cc b/frc971/wpilib/wpilib_interface.cc
index 1738ea8..42bf1aa 100644
--- a/frc971/wpilib/wpilib_interface.cc
+++ b/frc971/wpilib/wpilib_interface.cc
@@ -109,7 +109,8 @@
// Updates the any_interrupt_count count when the interrupt comes in without
// the lock.
void operator()() {
- ::aos::SetCurrentThreadRealtimePriority(priority_);
+ ::aos::SetCurrentThreadName("EdgeCounter_" +
+ ::std::to_string(input_->GetChannel()));
input_->RequestInterrupts();
input_->SetUpSourceEdge(true, true);
@@ -119,6 +120,7 @@
current_value_ = input_->GetHall();
}
+ ::aos::SetCurrentThreadRealtimePriority(priority_);
InterruptableSensorBase::WaitResult result = InterruptableSensorBase::kBoth;
while (run_) {
result = input_->WaitForInterrupt(
@@ -289,6 +291,7 @@
}
void operator()() {
+ ::aos::SetCurrentThreadName("HallSync" + ::std::to_string(num_sensors));
::aos::SetCurrentThreadRealtimePriority(priority_);
while (run_) {
::aos::time::PhasedLoopXMS(10, 9000);
@@ -615,9 +618,10 @@
}
void operator()() {
+ ::aos::SetCurrentThreadName("SensorReader");
+
const int kPriority = 30;
const int kInterruptPriority = 55;
- ::aos::SetCurrentThreadRealtimePriority(kPriority);
::std::array<::std::unique_ptr<HallEffect>, 2> shooter_sensors;
shooter_sensors[0] = ::std::move(shooter_proximal_);
@@ -644,6 +648,7 @@
"bottom_claw", kPriority, kInterruptPriority,
::std::move(claw_bottom_encoder_), &claw_bottom_sensors, true);
+ ::aos::SetCurrentThreadRealtimePriority(kPriority);
while (run_) {
::aos::time::PhasedLoopXMS(10, 9000);
RunIteration();
@@ -937,6 +942,7 @@
public:
virtual void StartCompetition() {
::aos::Init();
+ ::aos::SetCurrentThreadName("StartCompetition");
::frc971::wpilib::MotorWriter writer;
::frc971::wpilib::SensorReader reader;
::std::thread reader_thread(::std::ref(reader));