From ea95bb85aaf2323c4affa61826bf77f814b46156 Mon Sep 17 00:00:00 2001 From: Thad House Date: Sun, 3 Jul 2016 21:52:49 -0700 Subject: [PATCH] Adds Constants from new constants class to encoders (#133) --- hal/lib/athena/Encoder.cpp | 7 ++++--- hal/lib/athena/FPGAEncoder.cpp | 8 +++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/hal/lib/athena/Encoder.cpp b/hal/lib/athena/Encoder.cpp index 253509fc70..f5ee63a7cb 100644 --- a/hal/lib/athena/Encoder.cpp +++ b/hal/lib/athena/Encoder.cpp @@ -12,6 +12,7 @@ #include "FPGAEncoder.h" #include "HAL/Counter.h" #include "HAL/Errors.h" +#include "PortsInternal.h" #include "handles/LimitedClassedHandleResource.h" using namespace hal; @@ -213,9 +214,9 @@ double Encoder::DecodingScaleFactor() const { } } -static LimitedClassedHandleResource< - HalEncoderHandle, Encoder, tEncoder::kNumSystems + tCounter::kNumSystems, - HalHandleEnum::Encoder> +static LimitedClassedHandleResource encoderHandles; extern "C" { diff --git a/hal/lib/athena/FPGAEncoder.cpp b/hal/lib/athena/FPGAEncoder.cpp index 7b568fc952..9482a7796d 100644 --- a/hal/lib/athena/FPGAEncoder.cpp +++ b/hal/lib/athena/FPGAEncoder.cpp @@ -8,11 +8,9 @@ #include "FPGAEncoder.h" #include "DigitalInternal.h" +#include "PortsInternal.h" #include "handles/LimitedHandleResource.h" -static_assert(sizeof(uint32_t) <= sizeof(void*), - "This file shoves uint32_ts into pointers."); - using namespace hal; namespace { @@ -24,8 +22,8 @@ struct Encoder { static const double DECODING_SCALING_FACTOR = 0.25; -static LimitedHandleResource +static LimitedHandleResource fpgaEncoderHandles; extern "C" {