mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-27 02:01:42 +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:
@@ -19,17 +19,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.
|
||||
* 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];
|
||||
|
||||
if (!CheckPWMChannel(channel)) {
|
||||
@@ -52,13 +50,6 @@ void PWM::InitPWM(uint32_t channel) {
|
||||
HALReport(HALUsageReporting::kResourceType_PWM, channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Allocate a PWM given a channel number.
|
||||
*
|
||||
* @param channel The PWM channel.
|
||||
*/
|
||||
PWM::PWM(uint32_t channel) { InitPWM(channel); }
|
||||
|
||||
/**
|
||||
* Free the PWM channel.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user