mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
[hal] Use std::log2() for base-2 logarithm (#5278)
This commit is contained in:
@@ -127,9 +127,7 @@ void HAL_SetDigitalPWMRate(double rate, int32_t* status) {
|
||||
// higher freq.
|
||||
// TODO: Round in the linear rate domain.
|
||||
// uint8_t pwmPeriodPower = static_cast<uint8_t>(
|
||||
// std::log(1.0 / (kExpectedLoopTiming * 0.25E-6 * rate)) /
|
||||
// std::log(2.0) +
|
||||
// 0.5);
|
||||
// std::log2(1.0 / (kExpectedLoopTiming * 0.25E-6 * rate)) + 0.5);
|
||||
// TODO(THAD) : Add a case to set this in the simulator
|
||||
// digitalSystem->writePWMPeriodPower(pwmPeriodPower, status);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user