mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[hal, wpilib] PWM Rewrite (#7845)
The HAL will only contain the output period and the raw microseconds. Higher level things such as SimDevice can handle everything else.
This commit is contained in:
@@ -11,10 +11,9 @@
|
||||
using namespace frc;
|
||||
|
||||
{{ name }}::{{ name }}(int channel) : PWMMotorController("{{ name }}", channel) {
|
||||
m_pwm.SetBounds({{ pulse_width_ms.max }}_ms, {{ pulse_width_ms.deadbandMax }}_ms, {{ pulse_width_ms.center }}_ms, {{ pulse_width_ms.deadbandMin }}_ms, {{ pulse_width_ms.min }}_ms);
|
||||
m_pwm.SetPeriodMultiplier(PWM::kPeriodMultiplier_{{ PeriodMultiplier | default("1", true)}}X);
|
||||
m_pwm.SetSpeed(0.0);
|
||||
m_pwm.SetZeroLatch();
|
||||
SetBounds({{ pulse_width_ms.max }}_ms, {{ pulse_width_ms.deadbandMax }}_ms, {{ pulse_width_ms.center }}_ms, {{ pulse_width_ms.deadbandMin }}_ms, {{ pulse_width_ms.min }}_ms);
|
||||
m_pwm.SetOutputPeriod(PWM::kOutputPeriod_{{ OutputPeriod | default("5", true)}}Ms);
|
||||
SetSpeed(0.0);
|
||||
|
||||
HAL_ReportUsage("IO", GetChannel(), "{{ ResourceName }}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user