Commit a0943281 authored by Aurelio Colosimo's avatar Aurelio Colosimo Committed by Alessandro Rubini

ppsi_monitor.c: restored "mode: WR Slave / Master" indication

Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent ac229317
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <pps_gen.h> #include <pps_gen.h>
#include <onewire.h> #include <onewire.h>
#include <util.h> #include <util.h>
#include "wrc_ptp.h"
#define UI_REFRESH_PERIOD TICS_PER_SECOND /* 1 sec */ #define UI_REFRESH_PERIOD TICS_PER_SECOND /* 1 sec */
...@@ -63,16 +64,17 @@ void wrc_mon_gui(void) ...@@ -63,16 +64,17 @@ void wrc_mon_gui(void)
minic_get_stats(&tx, &rx); minic_get_stats(&tx, &rx);
cprintf(C_GREY, "(RX: %d, TX: %d), mode: ", rx, tx); cprintf(C_GREY, "(RX: %d, TX: %d), mode: ", rx, tx);
/* FIXME: define HEXP_PORT_MODE_WR_MASTER/SLAVE somewhere switch (ptp_mode) {
switch (ps.mode) { case WRC_MODE_GM:
case HEXP_PORT_MODE_WR_MASTER: case WRC_MODE_MASTER:
cprintf(C_WHITE, "WR Master "); cprintf(C_WHITE, "WR Master ");
break; break;
case HEXP_PORT_MODE_WR_SLAVE: case WRC_MODE_SLAVE:
cprintf(C_WHITE, "WR Slave "); cprintf(C_WHITE, "WR Slave ");
break; break;
default:
cprintf(C_RED, "WR Unknown ");
} }
*/
if (ps.is_locked) if (ps.is_locked)
cprintf(C_GREEN, "Locked "); cprintf(C_GREEN, "Locked ");
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#define WRC_MODE_GM 1 #define WRC_MODE_GM 1
#define WRC_MODE_MASTER 2 #define WRC_MODE_MASTER 2
#define WRC_MODE_SLAVE 3 #define WRC_MODE_SLAVE 3
extern int ptp_mode;
int wrc_ptp_init(); int wrc_ptp_init();
int wrc_ptp_set_mode(int mode); int wrc_ptp_set_mode(int mode);
......
...@@ -58,7 +58,8 @@ static RunTimeOpts rtOpts = { ...@@ -58,7 +58,8 @@ static RunTimeOpts rtOpts = {
static PtpPortDS *ptpPortDS; static PtpPortDS *ptpPortDS;
static PtpClockDS ptpClockDS; static PtpClockDS ptpClockDS;
static int ptp_enabled = 0, ptp_mode = WRC_MODE_UNKNOWN; int ptp_mode = WRC_MODE_UNKNOWN;
static int ptp_enabled = 0;
int wrc_ptp_init() int wrc_ptp_init()
{ {
......
...@@ -16,13 +16,14 @@ ...@@ -16,13 +16,14 @@
#include <ppsi/ppsi.h> #include <ppsi/ppsi.h>
#include <wr-constants.h> #include <wr-constants.h>
#include "syscon.h" #include "syscon.h"
#include "endpoint.h"
#include "softpll_ng.h" #include "softpll_ng.h"
#include "wrc_ptp.h" #include "wrc_ptp.h"
#include "pps_gen.h" #include "pps_gen.h"
#include "uart.h" #include "uart.h"
static int ptp_enabled = 0, ptp_mode = WRC_MODE_UNKNOWN, int ptp_mode = WRC_MODE_UNKNOWN;
ptp_forced_stop = 0; static int ptp_enabled = 0, ptp_forced_stop = 0;
struct pp_instance ppi_static; /* FIXME: no more static, because used in struct pp_instance ppi_static; /* FIXME: no more static, because used in
tests/measure_t24p.c */ tests/measure_t24p.c */
CONST_VERBOSITY int pp_diag_verbosity = CONFIG_PPSI_VERBOSITY; CONST_VERBOSITY int pp_diag_verbosity = CONFIG_PPSI_VERBOSITY;
......
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