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:
@@ -18,13 +18,15 @@
|
||||
static Resource *relayChannels = nullptr;
|
||||
|
||||
/**
|
||||
* Common relay initialization method.
|
||||
* This code is common to all Relay constructors and initializes the relay and
|
||||
* reserves
|
||||
* all resources that need to be locked. Initially the relay is set to both
|
||||
* lines at 0v.
|
||||
* Relay constructor given a channel.
|
||||
*
|
||||
* This code initializes the relay and reserves all resources that need to be
|
||||
* locked. Initially the relay is set to both lines at 0v.
|
||||
* @param channel The channel number (0-3).
|
||||
* @param direction The direction that the Relay object will control.
|
||||
*/
|
||||
void Relay::InitRelay() {
|
||||
Relay::Relay(uint32_t channel, Relay::Direction direction)
|
||||
: m_channel(channel), m_direction(direction) {
|
||||
char buf[64];
|
||||
Resource::CreateResourceObject(&relayChannels,
|
||||
dio_kNumSystems * kRelayChannels * 2);
|
||||
@@ -61,16 +63,6 @@ void Relay::InitRelay() {
|
||||
LiveWindow::GetInstance()->AddActuator("Relay", 1, m_channel, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Relay constructor given a channel.
|
||||
* @param channel The channel number (0-3).
|
||||
* @param direction The direction that the Relay object will control.
|
||||
*/
|
||||
Relay::Relay(uint32_t channel, Relay::Direction direction)
|
||||
: m_channel(channel), m_direction(direction) {
|
||||
InitRelay();
|
||||
}
|
||||
|
||||
/**
|
||||
* Free the resource associated with a relay.
|
||||
* The relay channels are set to free and the relay output is turned off.
|
||||
|
||||
Reference in New Issue
Block a user