diff --git a/pi.c b/pi.c index 9b3b09e..5fbce38 100644 --- a/pi.c +++ b/pi.c @@ -38,8 +38,8 @@ double configured_pi_offset = 0.0; struct pi_servo { struct servo servo; - double offset[2]; - double local[2]; + int64_t offset[2]; + uint64_t local[2]; double drift; double maxppb; double kp; @@ -55,8 +55,8 @@ static void pi_destroy(struct servo *servo) } static double pi_sample(struct servo *servo, - double offset, - double local_ts, + int64_t offset, + uint64_t local_ts, enum servo_state *state) { double ki_term, ppb = 0.0; diff --git a/servo.c b/servo.c index 97c2e60..a312ad1 100644 --- a/servo.c +++ b/servo.c @@ -35,8 +35,8 @@ void servo_destroy(struct servo *servo) } double servo_sample(struct servo *servo, - double offset, - double local_ts, + int64_t offset, + uint64_t local_ts, enum servo_state *state) { return servo->sample(servo, offset, local_ts, state); diff --git a/servo.h b/servo.h index 0d2ab71..4d4a8e7 100644 --- a/servo.h +++ b/servo.h @@ -20,6 +20,8 @@ #ifndef HAVE_SERVO_H #define HAVE_SERVO_H +#include + /** Opaque type */ struct servo; @@ -80,8 +82,8 @@ void servo_destroy(struct servo *servo); * @return The clock adjustment in parts per billion. */ double servo_sample(struct servo *servo, - double offset, - double local_ts, + int64_t offset, + uint64_t local_ts, enum servo_state *state); #endif diff --git a/servo_private.h b/servo_private.h index 2c710e5..f9c151f 100644 --- a/servo_private.h +++ b/servo_private.h @@ -26,7 +26,7 @@ struct servo { void (*destroy)(struct servo *servo); double (*sample)(struct servo *servo, - double offset, double local_ts, + int64_t offset, uint64_t local_ts, enum servo_state *state); };