Remove 1 cycle delay in FPGA writes
The FPGA is only taking updates to lengthen the cycle before the next
cycle starts. This is adding 1 cycle of delay when decelerating our
catapult.
The FPGA supports changing the period. So, we can set the period to
1/2, and then skip every other period. This produces the same waveform,
but effectively updates the active FPGA value more frequently.
Change-Id: Ib239f09ff4da652a9fbdf0aa0e552eb71b1d2054
Signed-off-by: Austin Schuh <austin.linux@gmail.com>
diff --git a/frc971/wpilib/ahal/Spark.cc b/frc971/wpilib/ahal/Spark.cc
index deb891b..502ff31 100644
--- a/frc971/wpilib/ahal/Spark.cc
+++ b/frc971/wpilib/ahal/Spark.cc
@@ -26,7 +26,7 @@
* 0.999ms = full "reverse"
*/
SetBounds(2.003, 1.55, 1.50, 1.46, .999);
- SetPeriodMultiplier(kPeriodMultiplier_1X);
+ SetPeriodMultiplier(kPeriodMultiplier_2X);
SetSpeed(0.0);
SetZeroLatch();