Switches AnalogInputs and AnalogTriggers to Handles (#117)

Results in a breaking change to AnalogTrigger int constructor. If a user wants
multiple AnalogTriggers, they must use the AnalogInput constructor.
This commit is contained in:
Thad House
2016-06-27 21:32:30 -07:00
committed by Peter Johnson
parent 77a1af44c4
commit e8e052712e
18 changed files with 516 additions and 341 deletions

View File

@@ -9,6 +9,7 @@
#include <memory>
#include "HAL/Handles.h"
#include "LiveWindow/LiveWindowSendable.h"
#include "PIDSource.h"
#include "SensorBase.h"
@@ -28,6 +29,8 @@
class AnalogInput : public SensorBase,
public PIDSource,
public LiveWindowSendable {
friend class AnalogTrigger;
public:
static const uint8_t kAccumulatorModuleNumber = 1;
static const uint32_t kAccumulatorNumChannels = 2;
@@ -77,7 +80,7 @@ class AnalogInput : public SensorBase,
private:
uint32_t m_channel;
// TODO: Adjust HAL to avoid use of raw pointers.
void* m_port;
HalAnalogInputHandle m_port;
int64_t m_accumulatorOffset;
std::shared_ptr<ITable> m_table;