Make DMA pulse width work

The sensors return 1 when there is no ball...

Also fix a move before get to a get before move to fix a segfault

Change-Id: If7ebcda52c18f011eb7583a494eb52a8d038cb1b
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/wpilib/dma.cc b/frc971/wpilib/dma.cc
index 432b77b..6cc8bf0 100644
--- a/frc971/wpilib/dma.cc
+++ b/frc971/wpilib/dma.cc
@@ -7,6 +7,7 @@
 #include "frc971/wpilib/ahal/AnalogInput.h"
 #include "frc971/wpilib/ahal/DigitalSource.h"
 #include "frc971/wpilib/ahal/Encoder.h"
+#include "glog/logging.h"
 #include "hal/HAL.h"
 
 // Interface to the roboRIO FPGA's DMA features.
@@ -142,6 +143,7 @@
 
 void DMA::SetExternalTrigger(frc::DigitalSource *input, bool rising,
                              bool falling) {
+  CHECK(input);
   tRioStatusCode status = 0;
 
   if (manager_) {