mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Adds PWM to LoopTiming and CycleStart HAL calls (#693)
This commit is contained in:
committed by
Peter Johnson
parent
f34332643a
commit
90f99dc571
@@ -80,7 +80,7 @@ void HAL_SetPWMConfig(HAL_DigitalHandle pwmPortHandle, double max,
|
||||
|
||||
// calculate the loop time in milliseconds
|
||||
double loopTime =
|
||||
HAL_GetLoopTiming(status) / (kSystemClockTicksPerMicrosecond * 1e3);
|
||||
HAL_GetPWMLoopTiming(status) / (kSystemClockTicksPerMicrosecond * 1e3);
|
||||
if (*status != 0) return;
|
||||
|
||||
int32_t maxPwm = static_cast<int32_t>((max - kDefaultPwmCenter) / loopTime +
|
||||
@@ -340,12 +340,12 @@ void HAL_SetPWMPeriodScale(HAL_DigitalHandle pwmPortHandle, int32_t squelchMask,
|
||||
*
|
||||
* @return The loop time
|
||||
*/
|
||||
int32_t HAL_GetLoopTiming(int32_t* status) { return kExpectedLoopTiming; }
|
||||
int32_t HAL_GetPWMLoopTiming(int32_t* status) { return kExpectedLoopTiming; }
|
||||
|
||||
/**
|
||||
* Get the pwm starting cycle time
|
||||
*
|
||||
* @return The pwm cycle start time.
|
||||
*/
|
||||
uint64_t HAL_GetCycleStartTime(int32_t* status) { return 0; }
|
||||
uint64_t HAL_GetPWMCycleStartTime(int32_t* status) { return 0; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user