From 64535c21436714bbd829dc270853da1da373d5ec Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 15:02:06 +0200 Subject: [PATCH] set for vetoalg, although currently no difference --- .../slsDetectorFunctionList.c | 23 ++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 7aa42ade5..605a45c10 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -2634,7 +2634,28 @@ enum vetoAlgorithm getVetoAlgorithm(enum ethernetInterface interface) { } void setVetoAlgorithm(enum ethernetInterface interface, - enum vetoAlgorithm alg) {} + enum vetoAlgorithm alg) { + uint32_t addr = CONFIG_REG; + uint32_t value = bus_r(addr); + switch (alg) { + // more to follow + case DEFAULT_ALGORITHM: + if (interface == I3GBE) { + LOG(logINFO, ("Setting default veto algorithm for 3Gbe\n")); + value &= (~CONFIG_VETO_CH_3GB_ALG_MSK); + value |= CONFIG_VETO_CH_3GB_ALG_DEFAULT_VAL; + } else { + LOG(logINFO, ("Setting default veto algorithm for 10Gbe\n")); + value &= (~CONFIG_VETO_CH_10GB_ALG_MSK); + value |= CONFIG_VETO_CH_10GB_ALG_DEFAULT_VAL; + } + break; + default: + LOG(logERROR, ("unknown algorithm %d for 3gbe\n", alg)); + return; + } + bus_w(addr, value); +} void setBadChannels(int nch, int *channels) { LOG(logINFO, ("Setting %d bad channels\n", nch));