Switched from DigitalSource to DigitalInput.
The new WPILib (2016) doesn't define Get on DigitalSource.
Change-Id: Iebff24e6a92ef9879e8908fcd56ec0350a05025e
diff --git a/frc971/wpilib/dma_edge_counting.h b/frc971/wpilib/dma_edge_counting.h
index e8bef6f..99ae80e 100644
--- a/frc971/wpilib/dma_edge_counting.h
+++ b/frc971/wpilib/dma_edge_counting.h
@@ -8,7 +8,7 @@
#include "frc971/wpilib/hall_effect.h"
-#include "DigitalSource.h"
+#include "DigitalInput.h"
#include "Encoder.h"
#include "AnalogInput.h"
#include "Utility.h"
@@ -41,7 +41,7 @@
// corresponding to those edges.
class DMAEdgeCounter : public DMASampleHandlerInterface {
public:
- DMAEdgeCounter(Encoder *encoder, DigitalSource *input)
+ DMAEdgeCounter(Encoder *encoder, DigitalInput *input)
: encoder_(encoder), input_(input) {}
int positive_count() const { return pos_edge_count_; }
@@ -75,7 +75,7 @@
bool ExtractValue(const DMASample &sample) const;
Encoder *const encoder_;
- DigitalSource *const input_;
+ DigitalInput *const input_;
// The last DMA reading we got.
DMASample prev_sample_;
@@ -101,7 +101,7 @@
// Reads a hall effect in sync with DMA samples.
class DMADigitalReader : public DMASampleHandlerInterface {
public:
- DMADigitalReader(DigitalSource *input) : input_(input) {}
+ DMADigitalReader(DigitalInput *input) : input_(input) {}
bool value() const { return value_; }
@@ -115,7 +115,7 @@
dma->Add(input_);
}
- DigitalSource *const input_;
+ DigitalInput *const input_;
bool value_;
diff --git a/frc971/wpilib/interrupt_edge_counting.h b/frc971/wpilib/interrupt_edge_counting.h
index f0b5e32..987e01d 100644
--- a/frc971/wpilib/interrupt_edge_counting.h
+++ b/frc971/wpilib/interrupt_edge_counting.h
@@ -9,7 +9,7 @@
#include "aos/common/stl_mutex.h"
#include "aos/common/macros.h"
-#include "DigitalSource.h"
+#include "DigitalInput.h"
#include "Encoder.h"
#include "AnalogInput.h"
#include "Utility.h"
@@ -109,7 +109,7 @@
// input.
class EdgeCounter : public InterruptHandler {
public:
- EdgeCounter(Encoder *encoder, DigitalSource *input)
+ EdgeCounter(Encoder *encoder, DigitalInput *input)
: encoder_(encoder), input_(input) {}
// Returns the current interrupt edge counts and encoder values.
@@ -140,7 +140,7 @@
void operator()() override;
Encoder *encoder_;
- DigitalSource *input_;
+ DigitalInput *input_;
// The following variables represent the current "shadow" state.
bool current_value_ = false;
diff --git a/y2014/wpilib/wpilib_interface.cc b/y2014/wpilib/wpilib_interface.cc
index 107a18c..ffb10e2 100644
--- a/y2014/wpilib/wpilib_interface.cc
+++ b/y2014/wpilib/wpilib_interface.cc
@@ -152,17 +152,17 @@
top_reader_.set_encoder(::std::move(encoder));
}
- void set_top_claw_front_hall(::std::unique_ptr<DigitalSource> hall) {
+ void set_top_claw_front_hall(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
top_reader_.set_front_hall(::std::move(hall));
}
- void set_top_claw_calibration_hall(::std::unique_ptr<DigitalSource> hall) {
+ void set_top_claw_calibration_hall(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
top_reader_.set_calibration_hall(::std::move(hall));
}
- void set_top_claw_back_hall(::std::unique_ptr<DigitalSource> hall) {
+ void set_top_claw_back_hall(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
top_reader_.set_back_hall(::std::move(hall));
}
@@ -172,17 +172,17 @@
bottom_reader_.set_encoder(::std::move(encoder));
}
- void set_bottom_claw_front_hall(::std::unique_ptr<DigitalSource> hall) {
+ void set_bottom_claw_front_hall(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
bottom_reader_.set_front_hall(::std::move(hall));
}
- void set_bottom_claw_calibration_hall(::std::unique_ptr<DigitalSource> hall) {
+ void set_bottom_claw_calibration_hall(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
bottom_reader_.set_calibration_hall(::std::move(hall));
}
- void set_bottom_claw_back_hall(::std::unique_ptr<DigitalSource> hall) {
+ void set_bottom_claw_back_hall(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
bottom_reader_.set_back_hall(::std::move(hall));
}
@@ -192,24 +192,24 @@
shooter_encoder_ = ::std::move(encoder);
}
- void set_shooter_proximal(::std::unique_ptr<DigitalSource> hall) {
+ void set_shooter_proximal(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
shooter_proximal_ = ::std::move(hall);
}
- void set_shooter_distal(::std::unique_ptr<DigitalSource> hall) {
+ void set_shooter_distal(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
shooter_distal_ = ::std::move(hall);
}
- void set_shooter_plunger(::std::unique_ptr<DigitalSource> hall) {
+ void set_shooter_plunger(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
shooter_plunger_ = ::std::move(hall);
shooter_plunger_reader_ =
make_unique<DMADigitalReader>(shooter_plunger_.get());
}
- void set_shooter_latch(::std::unique_ptr<DigitalSource> hall) {
+ void set_shooter_latch(::std::unique_ptr<DigitalInput> hall) {
hall_filter_.Add(hall.get());
shooter_latch_ = ::std::move(hall);
shooter_latch_reader_ = make_unique<DMADigitalReader>(shooter_latch_.get());
@@ -330,16 +330,16 @@
encoder_ = ::std::move(encoder);
}
- void set_front_hall(::std::unique_ptr<DigitalSource> front_hall) {
+ void set_front_hall(::std::unique_ptr<DigitalInput> front_hall) {
front_hall_ = ::std::move(front_hall);
}
void set_calibration_hall(
- ::std::unique_ptr<DigitalSource> calibration_hall) {
+ ::std::unique_ptr<DigitalInput> calibration_hall) {
calibration_hall_ = ::std::move(calibration_hall);
}
- void set_back_hall(::std::unique_ptr<DigitalSource> back_hall) {
+ void set_back_hall(::std::unique_ptr<DigitalInput> back_hall) {
back_hall_ = ::std::move(back_hall);
}
@@ -396,9 +396,9 @@
::std::unique_ptr<InterruptSynchronizedEncoder> synchronized_encoder_;
::std::unique_ptr<Encoder> encoder_;
- ::std::unique_ptr<DigitalSource> front_hall_;
- ::std::unique_ptr<DigitalSource> calibration_hall_;
- ::std::unique_ptr<DigitalSource> back_hall_;
+ ::std::unique_ptr<DigitalInput> front_hall_;
+ ::std::unique_ptr<DigitalInput> calibration_hall_;
+ ::std::unique_ptr<DigitalInput> back_hall_;
const bool reversed_;
};
@@ -436,8 +436,8 @@
HalfClawReader top_reader_{false}, bottom_reader_{true};
::std::unique_ptr<Encoder> shooter_encoder_;
- ::std::unique_ptr<DigitalSource> shooter_proximal_, shooter_distal_;
- ::std::unique_ptr<DigitalSource> shooter_plunger_, shooter_latch_;
+ ::std::unique_ptr<DigitalInput> shooter_proximal_, shooter_distal_;
+ ::std::unique_ptr<DigitalInput> shooter_plunger_, shooter_latch_;
::std::unique_ptr<DMAEdgeCounter> shooter_proximal_counter_,
shooter_distal_counter_;
::std::unique_ptr<DMADigitalReader> shooter_plunger_reader_,
@@ -454,7 +454,7 @@
shooter_(".frc971.control_loops.shooter_queue.output"),
drivetrain_(".frc971.control_loops.drivetrain_queue.output") {}
- void set_pressure_switch(::std::unique_ptr<DigitalSource> pressure_switch) {
+ void set_pressure_switch(::std::unique_ptr<DigitalInput> pressure_switch) {
pressure_switch_ = ::std::move(pressure_switch);
}
@@ -532,7 +532,7 @@
::std::unique_ptr<BufferedSolenoid> shooter_latch_;
::std::unique_ptr<BufferedSolenoid> shooter_brake_;
- ::std::unique_ptr<DigitalSource> pressure_switch_;
+ ::std::unique_ptr<DigitalInput> pressure_switch_;
::std::unique_ptr<Relay> compressor_relay_;
::aos::Queue<::frc971::control_loops::ShooterQueue::Output> shooter_;