mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
[wpilib] Deprecate getInstance() in favor of static functions (#3440)
Co-authored-by: Noam Zaks <imnoamzaks@gmail.com>
This commit is contained in:
@@ -13,9 +13,8 @@ using namespace frc;
|
||||
|
||||
NidecBrushless::NidecBrushless(int pwmChannel, int dioChannel)
|
||||
: m_dio(dioChannel), m_pwm(pwmChannel) {
|
||||
auto& registry = wpi::SendableRegistry::GetInstance();
|
||||
registry.AddChild(this, &m_dio);
|
||||
registry.AddChild(this, &m_pwm);
|
||||
wpi::SendableRegistry::AddChild(this, &m_dio);
|
||||
wpi::SendableRegistry::AddChild(this, &m_pwm);
|
||||
SetExpiration(0_s);
|
||||
SetSafetyEnabled(false);
|
||||
|
||||
@@ -24,7 +23,7 @@ NidecBrushless::NidecBrushless(int pwmChannel, int dioChannel)
|
||||
m_dio.EnablePWM(0.5);
|
||||
|
||||
HAL_Report(HALUsageReporting::kResourceType_NidecBrushless, pwmChannel + 1);
|
||||
registry.AddLW(this, "Nidec Brushless", pwmChannel);
|
||||
wpi::SendableRegistry::AddLW(this, "Nidec Brushless", pwmChannel);
|
||||
}
|
||||
|
||||
void NidecBrushless::Set(double speed) {
|
||||
|
||||
Reference in New Issue
Block a user