mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +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
@@ -43,14 +43,14 @@ Talon::Talon(int channel) : SafePWM(channel) {
|
||||
*
|
||||
* @param speed The speed value between -1.0 and 1.0 to set.
|
||||
*/
|
||||
void Talon::Set(float speed) { SetSpeed(speed); }
|
||||
void Talon::Set(double speed) { SetSpeed(speed); }
|
||||
|
||||
/**
|
||||
* Get the recently set value of the PWM.
|
||||
*
|
||||
* @return The most recently set value for the PWM between -1.0 and 1.0.
|
||||
*/
|
||||
float Talon::Get() const { return GetSpeed(); }
|
||||
double Talon::Get() const { return GetSpeed(); }
|
||||
|
||||
/**
|
||||
* Common interface for disabling a motor.
|
||||
@@ -62,4 +62,4 @@ void Talon::Disable() { SetRaw(kPwmDisabled); }
|
||||
*
|
||||
* @param output Write out the PWM value as was found in the PIDController
|
||||
*/
|
||||
void Talon::PIDWrite(float output) { Set(output); }
|
||||
void Talon::PIDWrite(double output) { Set(output); }
|
||||
|
||||
Reference in New Issue
Block a user