mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
artf4107: Removed most "Init" functions from classes
They were either replaced with delegating constructors or merged into the only constructor in the class. Change-Id: I3d35139f6ab23c719433a9f76942b02a3b07ddac
This commit is contained in:
@@ -13,9 +13,12 @@
|
||||
#include "WPIErrors.h"
|
||||
|
||||
/**
|
||||
* Initialize an analog trigger from a channel.
|
||||
* Constructor for an analog trigger given a channel number.
|
||||
*
|
||||
* @param channel The channel number on the roboRIO to represent. 0-3 are
|
||||
* on-board 4-7 are on the MXP port.
|
||||
*/
|
||||
void AnalogTrigger::InitTrigger(uint32_t channel) {
|
||||
AnalogTrigger::AnalogTrigger(int32_t channel) {
|
||||
void *port = getPort(channel);
|
||||
int32_t status = 0;
|
||||
uint32_t index = 0;
|
||||
@@ -26,22 +29,14 @@ void AnalogTrigger::InitTrigger(uint32_t channel) {
|
||||
HALReport(HALUsageReporting::kResourceType_AnalogTrigger, channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for an analog trigger given a channel number.
|
||||
*
|
||||
* @param channel The channel number on the roboRIO to represent. 0-3 are
|
||||
* on-board 4-7 are on the MXP port.
|
||||
*/
|
||||
AnalogTrigger::AnalogTrigger(int32_t channel) { InitTrigger(channel); }
|
||||
|
||||
/**
|
||||
* Construct an analog trigger given an analog input.
|
||||
* This should be used in the case of sharing an analog channel between the
|
||||
* trigger and an analog input object.
|
||||
* @param channel The pointer to the existing AnalogInput object
|
||||
*/
|
||||
AnalogTrigger::AnalogTrigger(AnalogInput *input) {
|
||||
InitTrigger(input->GetChannel());
|
||||
AnalogTrigger::AnalogTrigger(AnalogInput *input) :
|
||||
AnalogTrigger(input->GetChannel()) {
|
||||
}
|
||||
|
||||
AnalogTrigger::~AnalogTrigger() {
|
||||
|
||||
Reference in New Issue
Block a user