Move shared PI global variable into the proper module.
Signed-off-by: Richard Cochran <richardcochran@gmail.com>master
parent
8f6d2549b1
commit
e1f77422ec
4
pi.c
4
pi.c
|
@ -29,8 +29,8 @@
|
||||||
#define SWTS_KI 0.001
|
#define SWTS_KI 0.001
|
||||||
|
|
||||||
/* These two take their values from the configuration file. (see ptp4l.c) */
|
/* These two take their values from the configuration file. (see ptp4l.c) */
|
||||||
extern double configured_pi_kp;
|
double configured_pi_kp;
|
||||||
extern double configured_pi_ki;
|
double configured_pi_ki;
|
||||||
|
|
||||||
struct pi_servo {
|
struct pi_servo {
|
||||||
struct servo servo;
|
struct servo servo;
|
||||||
|
|
12
pi.h
12
pi.h
|
@ -21,6 +21,18 @@
|
||||||
|
|
||||||
#include "servo.h"
|
#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);
|
struct servo *pi_servo_create(int max_ppb, int sw_ts);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
2
ptp4l.c
2
ptp4l.c
|
@ -24,13 +24,13 @@
|
||||||
|
|
||||||
#include "clock.h"
|
#include "clock.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
#include "pi.h"
|
||||||
#include "print.h"
|
#include "print.h"
|
||||||
#include "sk.h"
|
#include "sk.h"
|
||||||
#include "transport.h"
|
#include "transport.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
int assume_two_step;
|
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 ptp_dst_mac[]; /*see raw.c*/
|
||||||
extern unsigned char p2p_dst_mac[]; /*see raw.c*/
|
extern unsigned char p2p_dst_mac[]; /*see raw.c*/
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue