Skip to content
Snippets Groups Projects
Commit fcf7fd55 authored by Adam Wujek's avatar Adam Wujek
Browse files

proto-ext-common/wrh-servo: add toggling tracking_enabled


Signed-off-by: default avatarAdam Wujek <dev_public@wujek.eu>
parent d2ace2cf
Branches
Tags
No related merge requests found
......@@ -4,8 +4,7 @@
#include <stdio.h>
#include <stdlib.h>
#define PPSIEXP_COMMAND_WR_TRACKING 1
#define PPSIEXP_COMMAND_L1SYNC_TRACKING 2
#define PPSIEXP_COMMAND_TRACKING 1
/* Return values */
#define PPSIEXP_RET_OK 0
......@@ -43,6 +42,11 @@
#define PPSIEXP_PARAM_PROFILE_HA_WR PPSI_PROFILE_HA_WR
#define PPSIEXP_PARAM_PROFILE_CUSTOM PPSI_PROFILE_CUSTOM
#define PPSIEXP_COMMAND_TRACKING_DISABLE WRH_TRACKING_DISABLE
#define PPSIEXP_COMMAND_TRACKING_ENABLE WRH_TRACKING_ENABLE
#define PPSIEXP_COMMAND_TRACKING_TOGGLE WRH_TRACKING_TOGGLE
#define PPSI_INSTANCE_USE_PORT 0x80000000
/* Export structures, shared by server and client for argument matching */
......
......@@ -19,14 +19,12 @@ static struct pp_globals *ppg_local;
/* Execute command coming ipc */
static int wrsipc_cmd(int cmd, int value)
{
if(cmd == PPSIEXP_COMMAND_WR_TRACKING) {
if ( CONFIG_HAS_EXT_WR ) {
wrh_servo_enable_tracking(value);
return 0;
}
}
if(cmd == PPSIEXP_COMMAND_L1SYNC_TRACKING) {
if ( CONFIG_HAS_EXT_L1SYNC ) {
if (cmd == PPSIEXP_COMMAND_TRACKING){
if (CONFIG_HAS_EXT_WR || CONFIG_HAS_EXT_L1SYNC) {
pp_diag(NULL, config, 2,
"%s: cmd %d (PPSIEXP_COMMAND_TRACKING) value "
"%d\n",
__func__, cmd, value);
wrh_servo_enable_tracking(value);
return 0;
}
......
......@@ -30,6 +30,11 @@
#define FIX_ALPHA_FRACBITS 40
#define FIX_ALPHA_FRACBITS_AS_FLOAT 40.0
#define WRH_TRACKING_DISABLE 0
#define WRH_TRACKING_ENABLE 1
#define WRH_TRACKING_TOGGLE 2
typedef enum {
WRH_TM_LOCKING_STATE_NONE=0,
WRH_TM_LOCKING_STATE_LOCKING,
......
......@@ -23,7 +23,7 @@
#define SNMP_MAX_DELTA_RTT_PS 1000
/* Enable tracking by default. Disabling the tracking is used for demos. */
static int wrh_tracking_enabled = 1;
static int wrh_tracking_enabled = WRH_TRACKING_ENABLE;
/* prototypes */
static int __wrh_servo_update(struct pp_instance *ppi);
......@@ -34,6 +34,11 @@ extern struct wrs_shm_head *ppsi_head;
void wrh_servo_enable_tracking(int enable)
{
if (enable == WRH_TRACKING_TOGGLE) {
wrh_tracking_enabled = !wrh_tracking_enabled;
return;
}
wrh_tracking_enabled = enable;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment