Removed HallEffect.

Change-Id: I677387d5c03a0e274b9ce5332bc56af367b19113
diff --git a/frc971/wpilib/BUILD b/frc971/wpilib/BUILD
index f9a7e9e..9417159 100644
--- a/frc971/wpilib/BUILD
+++ b/frc971/wpilib/BUILD
@@ -37,7 +37,6 @@
   deps = [
     '//aos/externals:wpilib',
     '//aos/common/logging',
-    ':hall_effect',
   ],
 )
 
@@ -141,13 +140,3 @@
     '//aos/common/logging:queue_logging',
   ],
 )
-
-cc_library(
-  name = 'hall_effect',
-  hdrs = [
-    'hall_effect.h',
-  ],
-  deps = [
-    '//aos/externals:wpilib',
-  ],
-)
diff --git a/frc971/wpilib/dma_edge_counting.h b/frc971/wpilib/dma_edge_counting.h
index 99ae80e..c145268 100644
--- a/frc971/wpilib/dma_edge_counting.h
+++ b/frc971/wpilib/dma_edge_counting.h
@@ -6,13 +6,12 @@
 
 #include "aos/common/macros.h"
 
-#include "frc971/wpilib/hall_effect.h"
-
 #include "DigitalInput.h"
 #include "Encoder.h"
 #include "AnalogInput.h"
 #include "Utility.h"
 #include "dma.h"
+#undef ERROR
 
 namespace frc971 {
 namespace wpilib {
diff --git a/frc971/wpilib/hall_effect.h b/frc971/wpilib/hall_effect.h
deleted file mode 100644
index d95b717..0000000
--- a/frc971/wpilib/hall_effect.h
+++ /dev/null
@@ -1,20 +0,0 @@
-#ifndef FRC971_WPILIB_HALL_EFFECT_H_
-#define FRC971_WPILIB_HALL_EFFECT_H_
-
-#include "DigitalInput.h"
-#undef ERROR
-
-namespace frc971 {
-namespace wpilib {
-
-// Inverts the output from a digital input.
-class HallEffect : public DigitalInput {
- public:
-  HallEffect(int index) : DigitalInput(index) {}
-  virtual bool Get() override { return !DigitalInput::Get(); }
-};
-
-}  // namespace wpilib
-}  // namespace frc971
-
-#endif  // FRC971_WPILIB_HALL_EFFECT_H_
diff --git a/y2014/wpilib/BUILD b/y2014/wpilib/BUILD
index 8b0713c..3436376 100644
--- a/y2014/wpilib/BUILD
+++ b/y2014/wpilib/BUILD
@@ -22,7 +22,6 @@
     '//aos/common/messages:robot_state',
     '//aos/common/util:phased_loop',
     '//aos/common/util:wrapping_counter',
-    '//frc971/wpilib:hall_effect',
     '//frc971/wpilib:joystick_sender',
     '//frc971/wpilib:loop_output_handler',
     '//frc971/wpilib:buffered_pcm',
diff --git a/y2014/wpilib/wpilib_interface.cc b/y2014/wpilib/wpilib_interface.cc
index 3977300..c8792d0 100644
--- a/y2014/wpilib/wpilib_interface.cc
+++ b/y2014/wpilib/wpilib_interface.cc
@@ -38,7 +38,6 @@
 #include "y2014/constants.h"
 #include "y2014/queues/auto_mode.q.h"
 
-#include "frc971/wpilib/hall_effect.h"
 #include "frc971/wpilib/joystick_sender.h"
 #include "frc971/wpilib/loop_output_handler.h"
 #include "frc971/wpilib/buffered_solenoid.h"
@@ -309,8 +308,8 @@
     {
       auto shooter_message = shooter_queue.position.MakeMessage();
       shooter_message->position = shooter_translate(shooter_encoder_->GetRaw());
-      shooter_message->plunger = shooter_plunger_reader_->value();
-      shooter_message->latch = shooter_latch_reader_->value();
+      shooter_message->plunger = !shooter_plunger_reader_->value();
+      shooter_message->latch = !shooter_latch_reader_->value();
       CopyShooterPosedgeCounts(shooter_proximal_counter_.get(),
                                &shooter_message->pusher_proximal);
       CopyShooterPosedgeCounts(shooter_distal_counter_.get(),
@@ -388,12 +387,12 @@
     void CopyPosition(const EdgeCounter *counter, HallEffectStruct *out) {
       const double multiplier = reversed_ ? -1.0 : 1.0;
 
-      out->current = counter->polled_value();
-      out->posedge_count = counter->positive_interrupt_count();
-      out->negedge_count = counter->negative_interrupt_count();
-      out->posedge_value =
-          multiplier * claw_translate(counter->last_positive_encoder_value());
+      out->current = !counter->polled_value();
+      out->posedge_count = counter->negative_interrupt_count();
+      out->negedge_count = counter->positive_interrupt_count();
       out->negedge_value =
+          multiplier * claw_translate(counter->last_positive_encoder_value());
+      out->posedge_value =
           multiplier * claw_translate(counter->last_negative_encoder_value());
     }
 
@@ -417,9 +416,7 @@
 
   void CopyShooterPosedgeCounts(const DMAEdgeCounter *counter,
                                 PosedgeOnlyCountedHallEffectStruct *output) {
-    // TODO(Brian): Remove HallEffect so current will get inverted too like
-    // everything else.
-    output->current = counter->polled_value();
+    output->current = !counter->polled_value();
     // These are inverted because the hall effects give logical false when
     // there's a magnet in front of them.
     output->posedge_count = counter->negative_count();
@@ -698,20 +695,20 @@
     reader.set_low_right_drive_hall(make_unique<AnalogInput>(3));
 
     reader.set_top_claw_encoder(make_encoder(3));
-    reader.set_top_claw_front_hall(make_unique<HallEffect>(4));  // R2
-    reader.set_top_claw_calibration_hall(make_unique<HallEffect>(3));  // R3
-    reader.set_top_claw_back_hall(make_unique<HallEffect>(5));  // R1
+    reader.set_top_claw_front_hall(make_unique<DigitalInput>(4));  // R2
+    reader.set_top_claw_calibration_hall(make_unique<DigitalInput>(3));  // R3
+    reader.set_top_claw_back_hall(make_unique<DigitalInput>(5));  // R1
 
     reader.set_bottom_claw_encoder(make_encoder(4));
-    reader.set_bottom_claw_front_hall(make_unique<HallEffect>(1));  // L2
-    reader.set_bottom_claw_calibration_hall(make_unique<HallEffect>(0));  // L3
-    reader.set_bottom_claw_back_hall(make_unique<HallEffect>(2));  // L1
+    reader.set_bottom_claw_front_hall(make_unique<DigitalInput>(1));  // L2
+    reader.set_bottom_claw_calibration_hall(make_unique<DigitalInput>(0));  // L3
+    reader.set_bottom_claw_back_hall(make_unique<DigitalInput>(2));  // L1
 
     reader.set_shooter_encoder(::std::move(shooter_encoder_temp));
-    reader.set_shooter_proximal(make_unique<HallEffect>(6));  // S1
-    reader.set_shooter_distal(make_unique<HallEffect>(7));  // S2
-    reader.set_shooter_plunger(make_unique<HallEffect>(8));  // S3
-    reader.set_shooter_latch(make_unique<HallEffect>(9));  // S4
+    reader.set_shooter_proximal(make_unique<DigitalInput>(6));  // S1
+    reader.set_shooter_distal(make_unique<DigitalInput>(7));  // S2
+    reader.set_shooter_plunger(make_unique<DigitalInput>(8));  // S3
+    reader.set_shooter_latch(make_unique<DigitalInput>(9));  // S4
 
     reader.set_dma(make_unique<DMA>());
     ::std::thread reader_thread(::std::ref(reader));
diff --git a/y2015/wpilib/BUILD b/y2015/wpilib/BUILD
index 54fb3d3..85f9139 100644
--- a/y2015/wpilib/BUILD
+++ b/y2015/wpilib/BUILD
@@ -23,7 +23,6 @@
     '//aos/common/messages:robot_state',
     '//aos/common/util:phased_loop',
     '//aos/common/util:wrapping_counter',
-    '//frc971/wpilib:hall_effect',
     '//frc971/wpilib:joystick_sender',
     '//frc971/wpilib:loop_output_handler',
     '//frc971/wpilib:buffered_pcm',
diff --git a/y2015/wpilib/wpilib_interface.cc b/y2015/wpilib/wpilib_interface.cc
index 76d5976..c56d211 100644
--- a/y2015/wpilib/wpilib_interface.cc
+++ b/y2015/wpilib/wpilib_interface.cc
@@ -38,7 +38,6 @@
 #include "y2015/control_loops/claw/claw.q.h"
 #include "y2015/autonomous/auto.q.h"
 
-#include "frc971/wpilib/hall_effect.h"
 #include "frc971/wpilib/joystick_sender.h"
 #include "frc971/wpilib/loop_output_handler.h"
 #include "frc971/wpilib/buffered_solenoid.h"