Commit 9a1ef51f authored by Adam Wujek's avatar Adam Wujek Committed by Tristan Gingold

lib/task-stats: add extra servo stats to stat command if CONFIG_MONITOR_SERVO_ERR

Signed-off-by: 's avatarAdam Wujek <dev_public@wujek.eu>
parent 56a7d702
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2021 CERN
* Copyright (C) 2021-2023 CERN
* Author: Wesley W. Terpstra <w.terpstra@gsi.de>
*
* Released according to the GNU GPL, version 2 or any later version.
......@@ -21,6 +21,13 @@
#include "wrc_global.h"
#include "shell.h"
#ifdef CONFIG_CMD_MONITOR_SERVO_ERR
#define HAS_MONITOR_SERVO_ERR 1
#else
#define HAS_MONITOR_SERVO_ERR 0
#endif
/* internal "last", exported to shell command */
uint32_t wrc_stats_last;
......@@ -119,6 +126,11 @@ int wrc_log_stats(void)
pp_printf("setp:%d ", (int) wrh_servo->cur_setpoint_ps);
pp_printf("ucnt:%d ", (int) s->update_count);
pp_printf("bslide:%d ", ep_get_bitslide(&wrc_endpoint_dev));
if (HAS_MONITOR_SERVO_ERR) {
pp_printf("ses:%u ", wrh_servo->n_err_state);
pp_printf("seo:%u ", wrh_servo->n_err_offset);
pp_printf("sedr:%u ", wrh_servo->n_err_delta_rtt);
}
}
pp_printf("hd:%d md:%d ad:%d ", spll_get_dac(-1), spll_get_dac(0),
......
/*
* This work is part of the White Rabbit project
*
* Copyright (C) 2021 CERN
* Copyright (C) 2021-2023 CERN
* Author: Adam Wujek
*
* Released according to the GNU GPL, version 2 or any later version.
......@@ -33,6 +33,11 @@
#error ("WRPC monitor requires full version of pp_printf implementation")
#endif
#ifdef CONFIG_CMD_MONITOR_SERVO_ERR
#define HAS_MONITOR_SERVO_ERR 1
#else
#define HAS_MONITOR_SERVO_ERR 0
#endif
#define WRC_MONITOR_REFRESH_PERIOD (1 * TICS_PER_SECOND)
......@@ -467,11 +472,12 @@ static void print_aux_data(void)
static void print_servo_description(void)
{
#if CONFIG_MONITOR_SERVO_ERR
pcprintf(19, 45, C_BLUE, "err state:");
pprintf(20, 45, "err offset:");
pprintf(21, 45, "err delta:");
#endif
if (HAS_MONITOR_SERVO_ERR) {
pcprintf(19, 45, C_BLUE, "err state:");
pprintf(20, 45, "err offset:");
pprintf(21, 45, "err delta:");
}
pcprintf(16, 1, C_BLUE, "Servo state:\n");
......@@ -552,13 +558,11 @@ static void print_servo_data(struct pp_instance *ppi)
if (wrh_servo && !wrh_servo->tracking_enabled)
cprintf(C_RED, "Tracking forcibly disabled\n");
#if CONFIG_MONITOR_SERVO_ERR
if (wrh_servo) {
if (HAS_MONITOR_SERVO_ERR && wrh_servo) {
pcprintf(19, 60, C_WHITE, " %u ", wrh_servo->n_err_state);
pprintf(20, 60, " %u ", wrh_servo->n_err_offset);
pprintf(21, 60, " %u ", wrh_servo->n_err_delta_rtt);
}
#endif
/* +- Timing parameters --------------------------------------------------------- */
......
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