Merge "Change uint to int for channels on constructors which can take a single channel or single pointer to avoid ambiguous calls."

This commit is contained in:
Brad Miller (WPI)
2014-11-19 10:28:34 -08:00
committed by Gerrit Code Review
8 changed files with 12 additions and 12 deletions

View File

@@ -18,7 +18,7 @@
*/
class AnalogAccelerometer : public SensorBase, public PIDSource, public LiveWindowSendable {
public:
explicit AnalogAccelerometer(uint32_t channel);
explicit AnalogAccelerometer(int32_t channel);
explicit AnalogAccelerometer(AnalogInput *channel);
virtual ~AnalogAccelerometer();

View File

@@ -15,7 +15,7 @@ class AnalogTrigger : public SensorBase
{
friend class AnalogTriggerOutput;
public:
explicit AnalogTrigger(uint32_t channel);
explicit AnalogTrigger(int32_t channel);
explicit AnalogTrigger(AnalogInput *channel);
virtual ~AnalogTrigger();

View File

@@ -25,7 +25,7 @@ class Counter : public SensorBase, public CounterBase, public LiveWindowSendable
public:
Counter();
explicit Counter(uint32_t channel);
explicit Counter(int32_t channel);
explicit Counter(DigitalSource *source);
explicit Counter(DigitalSource &source);
explicit Counter(AnalogTrigger *trigger);
@@ -34,7 +34,7 @@ public:
bool inverted);
virtual ~Counter();
void SetUpSource(uint32_t channel);
void SetUpSource(int32_t channel);
void SetUpSource(AnalogTrigger *analogTrigger, AnalogTriggerType triggerType);
void SetUpSource(AnalogTrigger &analogTrigger, AnalogTriggerType triggerType);
void SetUpSource(DigitalSource *source);
@@ -42,7 +42,7 @@ public:
void SetUpSourceEdge(bool risingEdge, bool fallingEdge);
void ClearUpSource();
void SetDownSource(uint32_t channel);
void SetDownSource(int32_t channel);
void SetDownSource(AnalogTrigger *analogTrigger, AnalogTriggerType triggerType);
void SetDownSource(AnalogTrigger &analogTrigger, AnalogTriggerType triggerType);
void SetDownSource(DigitalSource *source);

View File

@@ -30,7 +30,7 @@ public:
static constexpr float kCalibrationSampleTime = 5.0;
static constexpr float kDefaultVoltsPerDegreePerSecond = 0.007;
explicit Gyro(uint32_t channel);
explicit Gyro(int32_t channel);
explicit Gyro(AnalogInput *channel);
explicit Gyro(AnalogInput &channel);
virtual ~Gyro();

View File

@@ -26,7 +26,7 @@ void AnalogAccelerometer::InitAccelerometer()
*
* The constructor allocates desired analog input.
*/
AnalogAccelerometer::AnalogAccelerometer(uint32_t channel)
AnalogAccelerometer::AnalogAccelerometer(int32_t channel)
{
m_AnalogInput = new AnalogInput(channel);
m_allocatedChannel = true;

View File

@@ -31,7 +31,7 @@ void AnalogTrigger::InitTrigger(uint32_t channel)
*
* @param channel The analog channel (0..7).
*/
AnalogTrigger::AnalogTrigger(uint32_t channel)
AnalogTrigger::AnalogTrigger(int32_t channel)
{
InitTrigger(channel);
}

View File

@@ -82,7 +82,7 @@ Counter::Counter(DigitalSource &source) :
*
* The counter will start counting immediately.
*/
Counter::Counter(uint32_t channel) :
Counter::Counter(int32_t channel) :
m_upSource(NULL),
m_downSource(NULL),
m_counter(NULL)
@@ -177,7 +177,7 @@ Counter::~Counter()
/**
* Set the upsource for the counter as a digital input channel.
*/
void Counter::SetUpSource(uint32_t channel)
void Counter::SetUpSource(int32_t channel)
{
if (StatusIsFatal()) return;
SetUpSource(new DigitalInput(channel));
@@ -278,7 +278,7 @@ void Counter::ClearUpSource()
/**
* Set the down counting source to be a digital input channel.
*/
void Counter::SetDownSource(uint32_t channel)
void Counter::SetDownSource(int32_t channel)
{
if (StatusIsFatal()) return;
SetDownSource(new DigitalInput(channel));

View File

@@ -75,7 +75,7 @@ void Gyro::InitGyro()
*
* @param channel The analog channel the gyro is connected to.
*/
Gyro::Gyro(uint32_t channel)
Gyro::Gyro(int32_t channel)
{
m_analog = new AnalogInput(channel);
m_channelAllocated = true;