mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-28 02:11:43 +00:00
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:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user