mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Replaced floats with doubles (#355)
This makes our APIs more consistent. With optimizations enabled, doubles are just as efficient as floats on ARMv7, so we should take advantage of the extra precision.
This commit is contained in:
committed by
Peter Johnson
parent
7bcd243ec3
commit
69422dc063
@@ -25,7 +25,7 @@ PWMSpeedController::PWMSpeedController(int channel) : SafePWM(channel) {}
|
||||
*
|
||||
* @param speed The speed value between -1.0 and 1.0 to set.
|
||||
*/
|
||||
void PWMSpeedController::Set(float speed) {
|
||||
void PWMSpeedController::Set(double speed) {
|
||||
SetSpeed(m_isInverted ? -speed : speed);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ void PWMSpeedController::Set(float speed) {
|
||||
*
|
||||
* @return The most recently set value for the PWM between -1.0 and 1.0.
|
||||
*/
|
||||
float PWMSpeedController::Get() const { return GetSpeed(); }
|
||||
double PWMSpeedController::Get() const { return GetSpeed(); }
|
||||
|
||||
/**
|
||||
* Common interface for disabling a motor.
|
||||
@@ -63,7 +63,7 @@ bool PWMSpeedController::GetInverted() const { return m_isInverted; }
|
||||
*
|
||||
* @param output Write out the PWM value as was found in the PIDController
|
||||
*/
|
||||
void PWMSpeedController::PIDWrite(float output) { Set(output); }
|
||||
void PWMSpeedController::PIDWrite(double output) { Set(output); }
|
||||
|
||||
/**
|
||||
* Common interface to stop the motor until Set is called again.
|
||||
|
||||
Reference in New Issue
Block a user