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:
Tyler Veness
2016-11-20 07:25:03 -08:00
committed by Peter Johnson
parent 7bcd243ec3
commit 69422dc063
129 changed files with 643 additions and 639 deletions

View File

@@ -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.