[sim] Allow creating a PWMSim object from a PWMMotorController (#4039)

This commit is contained in:
Dustin Spicuzza
2022-05-06 11:44:59 -04:00
committed by GitHub
parent dc6f641fd2
commit 99424ad562
3 changed files with 22 additions and 0 deletions

View File

@@ -10,12 +10,16 @@
#include <hal/simulation/PWMData.h>
#include "frc/PWM.h"
#include "frc/motorcontrol/PWMMotorController.h"
using namespace frc;
using namespace frc::sim;
PWMSim::PWMSim(const PWM& pwm) : m_index{pwm.GetChannel()} {}
PWMSim::PWMSim(const PWMMotorController& motorctrl)
: m_index{motorctrl.GetChannel()} {}
PWMSim::PWMSim(int channel) : m_index{channel} {}
std::unique_ptr<CallbackStore> PWMSim::RegisterInitializedCallback(