[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:
Thad House
2025-03-20 19:23:22 -07:00
committed by GitHub
parent 2e21a41f87
commit e2cc9e0059
96 changed files with 1037 additions and 2453 deletions

View File

@@ -28,11 +28,8 @@ HALSimWSProviderPWM::~HALSimWSProviderPWM() {
void HALSimWSProviderPWM::RegisterCallbacks() {
m_initCbKey = REGISTER(Initialized, "<init", bool, boolean);
m_speedCbKey = REGISTER(Speed, "<speed", double, double);
m_positionCbKey = REGISTER(Position, "<position", double, double);
m_rawCbKey = REGISTER(PulseMicrosecond, "<raw", int32_t, int);
m_periodScaleCbKey = REGISTER(PeriodScale, "<period_scale", int32_t, int);
m_zeroLatchCbKey = REGISTER(ZeroLatch, "<zero_latch", bool, boolean);
m_outputPeriodCbKey = REGISTER(OutputPeriod, "<output_period", int32_t, int);
}
void HALSimWSProviderPWM::CancelCallbacks() {
@@ -41,18 +38,12 @@ void HALSimWSProviderPWM::CancelCallbacks() {
void HALSimWSProviderPWM::DoCancelCallbacks() {
HALSIM_CancelPWMInitializedCallback(m_channel, m_initCbKey);
HALSIM_CancelPWMSpeedCallback(m_channel, m_speedCbKey);
HALSIM_CancelPWMPositionCallback(m_channel, m_positionCbKey);
HALSIM_CancelPWMPulseMicrosecondCallback(m_channel, m_rawCbKey);
HALSIM_CancelPWMPeriodScaleCallback(m_channel, m_periodScaleCbKey);
HALSIM_CancelPWMZeroLatchCallback(m_channel, m_zeroLatchCbKey);
HALSIM_CancelPWMOutputPeriodCallback(m_channel, m_outputPeriodCbKey);
m_initCbKey = 0;
m_speedCbKey = 0;
m_positionCbKey = 0;
m_rawCbKey = 0;
m_periodScaleCbKey = 0;
m_zeroLatchCbKey = 0;
m_outputPeriodCbKey = 0;
}
} // namespace wpilibws

View File

@@ -24,11 +24,8 @@ class HALSimWSProviderPWM : public HALSimWSHalChanProvider {
private:
int32_t m_initCbKey = 0;
int32_t m_speedCbKey = 0;
int32_t m_positionCbKey = 0;
int32_t m_rawCbKey = 0;
int32_t m_periodScaleCbKey = 0;
int32_t m_zeroLatchCbKey = 0;
int32_t m_outputPeriodCbKey = 0;
};
} // namespace wpilibws