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:
Tyler Veness
2015-06-29 02:43:44 -07:00
parent e4a8aacc51
commit 1ab3ea670d
62 changed files with 258 additions and 525 deletions

View File

@@ -16,13 +16,15 @@ const int32_t PWM::kDefaultPwmStepsDown;
const int32_t PWM::kPwmDisabled;
/**
* Initialize PWMs given a channel.
* Allocate a PWM given a channel number.
*
* This method is private and is the common path for all the constructors for creating PWM
* instances. Checks channel value range and allocates the appropriate channel.
* The allocation is only done to help users ensure that they don't double assign channels.
* Checks channel value range and allocates the appropriate channel.
* The allocation is only done to help users ensure that they don't double
* assign channels.
* @param channel The PWM channel number. 0-9 are on-board, 10-19 are on the MXP
* port
*/
void PWM::InitPWM(uint32_t channel)
PWM::PWM(uint32_t channel)
{
char buf[64];
@@ -41,16 +43,6 @@ void PWM::InitPWM(uint32_t channel)
m_centerPwm = kPwmDisabled; // In simulation, the same thing.
}
/**
* Allocate a PWM given a channel number.
*
* @param channel The PWM channel.
*/
PWM::PWM(uint32_t channel)
{
InitPWM(channel);
}
/**
* Optionally eliminate the deadband from a speed controller.
* @param eliminateDeadband If true, set the motor curve on the Jaguar to eliminate