Commit 894e1f48 authored by John Gill's avatar John Gill

Merge branch 'ak-lemocfg-bug-fix' into 'master'

Bug fixes for configuring and reading debug signals

See merge request !5
parents 8b124566 658e7551
......@@ -1327,7 +1327,7 @@ libwr2rf_configure_lemo_debug(struct libwr2rf_dev *dev, unsigned lemo, unsigned
unsigned baddr = WR2RF_VME_REGS_INIT;
unsigned addr = 0;
if (dbg > LIBWR2RF_LEMO_DBG_WRS_SOFTSTART)
if (dbg > LIBWR2RF_LEMO_DBG_NONE)
return LIBWR2RF_ERROR_BAD_PARAM;
switch (lemo) {
......@@ -1352,8 +1352,9 @@ libwr2rf_configure_lemo_debug(struct libwr2rf_dev *dev, unsigned lemo, unsigned
default:
return LIBWR2RF_ERROR_BAD_ID;
}
libwr2rf_write16(dev, baddr + addr, (1 << dbg));
uint16_t val = (dbg == LIBWR2RF_LEMO_DBG_NONE) ? 0x0 : (1 << dbg);
libwr2rf_write16(dev, baddr + addr, val);
return 0;
}
......
......@@ -162,6 +162,8 @@ int libwr2rf_read_diag(struct libwr2rf_dev *dev, unsigned id,
#define LIBWR2RF_LEMO_DBG_WRS_RF_RST 11
#define LIBWR2RF_LEMO_DBG_WRS_SOFTSTOP 12
#define LIBWR2RF_LEMO_DBG_WRS_SOFTSTART 13
#define LIBWR2RF_LEMO_DBG_NONE 14
/* LEMO front panel debug selection */
int libwr2rf_configure_lemo_debug(struct libwr2rf_dev *dev,
......
......@@ -2658,12 +2658,12 @@ lemo_disp_dbg(struct libwr2rf_dev *dev, struct strb *strb, unsigned lemo)
val = libwr2rf_read16
(dev, WR2RF_VME_REGS_INIT + WR2RF_INIT_REGS_TMGIO1 + lemo*2);
strb_printf(strb, "out: ");
if (val == (1 << (LIBWR2RF_LEMO_DBG_WRS_SOFTSTOP - 1))) {
if (val == (1 << LIBWR2RF_LEMO_DBG_WRS_SOFTSTOP)) {
unsigned vtu;
strb_printf(strb, "softstop");
vtu = libwr2rf_read16(dev, WR2RF_VME_REGS_INIT + WR2RF_INIT_REGS_SOFTSTART);
vtu = libwr2rf_read16(dev, WR2RF_VME_REGS_INIT + WR2RF_INIT_REGS_SOFTSTOP);
switch (vtu) {
case LIBWR2RF_RF1T1_SOFTSTOP_SEL:
......@@ -2683,7 +2683,7 @@ lemo_disp_dbg(struct libwr2rf_dev *dev, struct strb *strb, unsigned lemo)
break;
}
}
else if (val == (1 << (LIBWR2RF_LEMO_DBG_WRS_SOFTSTART - 1))) {
else if (val == (1 << LIBWR2RF_LEMO_DBG_WRS_SOFTSTART)) {
unsigned vtu;
strb_printf(strb, "softstart");
......
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