Directly construct PWM port from HAL, avoid wpilib PWM object (#2106)

This commit is contained in:
Thad House
2019-11-20 14:48:14 -08:00
committed by Peter Johnson
parent c0e36df9d8
commit 5443fdabc1
3 changed files with 30 additions and 79 deletions

View File

@@ -17,7 +17,6 @@
#include "frc/ErrorBase.h"
namespace frc {
class PWM;
/**
* A class for driving addressable LEDs, such as WS2812s and NeoPixels.
@@ -44,27 +43,6 @@ class AddressableLED : public ErrorBase {
}
};
/**
* Constructs a new driver from a PWM output.
*
* @param output the pwm output to use
*/
explicit AddressableLED(PWM& output);
/**
* Constructs a new driver from a PWM output.
*
* @param output the pwm output to use
*/
explicit AddressableLED(PWM* output);
/**
* Constructs a new driver from a PWM output.
*
* @param output the pwm output to use
*/
explicit AddressableLED(std::shared_ptr<PWM> output);
/**
* Constructs a new driver for a specific port.
*
@@ -142,9 +120,7 @@ class AddressableLED : public ErrorBase {
void Stop();
private:
void Init();
std::shared_ptr<PWM> m_pwmOutput;
hal::Handle<HAL_DigitalHandle> m_pwmHandle;
hal::Handle<HAL_AddressableLEDHandle> m_handle;
};
} // namespace frc