Commit 63899c73 authored by Alessandro Rubini's avatar Alessandro Rubini

wr: trivial: remove duplicate variable

Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 4dae1e34
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include <hal_exports.h> #include <hal_exports.h>
#include <wr-api.h> #include <wr-api.h>
extern int servo_state_valid;
extern ptpdexp_sync_state_t cur_servo_state; extern ptpdexp_sync_state_t cur_servo_state;
/* minipc Encoding of the supported commands */ /* minipc Encoding of the supported commands */
...@@ -39,12 +38,9 @@ static struct minipc_pd __rpcdef_cmd = { ...@@ -39,12 +38,9 @@ static struct minipc_pd __rpcdef_cmd = {
/* Fill struct ptpdexp_sync_state_t with current servo state */ /* Fill struct ptpdexp_sync_state_t with current servo state */
static int wrsipc_get_sync_state(ptpdexp_sync_state_t *state) static int wrsipc_get_sync_state(ptpdexp_sync_state_t *state)
{ {
if (BUILT_WITH_WHITERABBIT && servo_state_valid) { if (!BUILT_WITH_WHITERABBIT)
memcpy(state, &cur_servo_state, sizeof(ptpdexp_sync_state_t)); cur_servo_state.valid = 0; /* unneeded, likely */
state->valid = 1; memcpy(state, &cur_servo_state, sizeof(*state));
} else
state->valid = 0;
return 0; return 0;
} }
......
...@@ -21,8 +21,7 @@ const char *servo_state_str[] = { ...@@ -21,8 +21,7 @@ const char *servo_state_str[] = {
[WR_WAIT_OFFSET_STABLE] = "OFFSET_STABLE", [WR_WAIT_OFFSET_STABLE] = "OFFSET_STABLE",
}; };
int servo_state_valid = 0; /* FIXME: why? */ ptpdexp_sync_state_t cur_servo_state; /* Exported with mini-rpc */
ptpdexp_sync_state_t cur_servo_state; /* FIXME: why? */
static int tracking_enabled = 1; /* FIXME: why? */ static int tracking_enabled = 1; /* FIXME: why? */
...@@ -141,7 +140,6 @@ static int got_sync = 0; ...@@ -141,7 +140,6 @@ static int got_sync = 0;
void wr_servo_reset() void wr_servo_reset()
{ {
cur_servo_state.valid = 0; cur_servo_state.valid = 0;
servo_state_valid = 0;
} }
int wr_servo_init(struct pp_instance *ppi) int wr_servo_init(struct pp_instance *ppi)
...@@ -183,7 +181,6 @@ int wr_servo_init(struct pp_instance *ppi) ...@@ -183,7 +181,6 @@ int wr_servo_init(struct pp_instance *ppi)
strcpy(cur_servo_state.slave_servo_state, "Uninitialized"); strcpy(cur_servo_state.slave_servo_state, "Uninitialized");
servo_state_valid = 1;
cur_servo_state.valid = 1; cur_servo_state.valid = 1;
cur_servo_state.update_count = 0; cur_servo_state.update_count = 0;
......
Markdown is supported
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