diff --git a/pi.c b/pi.c index 33766b1..6917899 100644 --- a/pi.c +++ b/pi.c @@ -29,8 +29,8 @@ #define SWTS_KI 0.001 /* These two take their values from the configuration file. (see ptp4l.c) */ -extern double configured_pi_kp; -extern double configured_pi_ki; +double configured_pi_kp; +double configured_pi_ki; struct pi_servo { struct servo servo; diff --git a/pi.h b/pi.h index aa2bd85..e1babd3 100644 --- a/pi.h +++ b/pi.h @@ -21,6 +21,18 @@ #include "servo.h" +/** + * When set to a non-zero value, this variable determines the + * proportional constant for the PI controller. + */ +extern double configured_pi_kp; + +/** + * When set to a non-zero value, this variable determines the + * integral constant for the PI controller. + */ +extern double configured_pi_ki; + struct servo *pi_servo_create(int max_ppb, int sw_ts); #endif diff --git a/ptp4l.c b/ptp4l.c index a695164..6986aef 100644 --- a/ptp4l.c +++ b/ptp4l.c @@ -24,13 +24,13 @@ #include "clock.h" #include "config.h" +#include "pi.h" #include "print.h" #include "sk.h" #include "transport.h" #include "util.h" int assume_two_step; -double configured_pi_kp, configured_pi_ki; /*see pi.c*/ extern unsigned char ptp_dst_mac[]; /*see raw.c*/ extern unsigned char p2p_dst_mac[]; /*see raw.c*/