From c77caecc310da7729832594625b79b8738bb3a01 Mon Sep 17 00:00:00 2001 From: Martin Mueller Date: Wed, 2 Dec 2026 10:55:15 +0100 Subject: [PATCH] split reg for dsamples and asamples --- slsDetectorServers/ctbDetectorServer/RegisterDefs.h | 8 ++------ .../ctbDetectorServer/slsDetectorFunctionList.c | 9 +++------ 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h index 737318093..af4301c1d 100644 --- a/slsDetectorServers/ctbDetectorServer/RegisterDefs.h +++ b/slsDetectorServers/ctbDetectorServer/RegisterDefs.h @@ -426,12 +426,8 @@ #define PATTERN_LOOP_ADDR_STP_MSK (0x00001FFF << PATTERN_LOOP_ADDR_STP_OFST) /* Samples RW register */ -#define SAMPLES_REG (0x32 << MEM_MAP_SHIFT) - -#define SAMPLES_DIGITAL_OFST (0) -#define SAMPLES_DIGITAL_MSK (0x0000FFFF << SAMPLES_DIGITAL_OFST) -#define SAMPLES_ANALOG_OFST (16) -#define SAMPLES_ANALOG_MSK (0x0000FFFF << SAMPLES_ANALOG_OFST) +#define DBIT_NSAMPLES_REG (0x32 << MEM_MAP_SHIFT) +#define ADC_NSAMPLES_REG (0x35 << MEM_MAP_SHIFT) /** Power RW register */ #define POWER_REG (0x33 << MEM_MAP_SHIFT) diff --git a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c index 7079a8873..44c5a21d1 100644 --- a/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/ctbDetectorServer/slsDetectorFunctionList.c @@ -1029,9 +1029,7 @@ int setNumAnalogSamples(int val) { } LOG(logINFO, ("Setting number of analog samples %d\n", val)); naSamples = val; - bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) & ~SAMPLES_ANALOG_MSK); - bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) | - ((val << SAMPLES_ANALOG_OFST) & SAMPLES_ANALOG_MSK)); + bus_w(ADC_NSAMPLES_REG,val); // 1Gb if (!enableTenGigabitEthernet(-1)) { @@ -1051,9 +1049,8 @@ int setNumDigitalSamples(int val) { } LOG(logINFO, ("Setting number of digital samples %d\n", val)); ndSamples = val; - bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) & ~SAMPLES_DIGITAL_MSK); - bus_w(SAMPLES_REG, bus_r(SAMPLES_REG) | ((val << SAMPLES_DIGITAL_OFST) & - SAMPLES_DIGITAL_MSK)); + bus_w(DBIT_NSAMPLES_REG,val); + // 1Gb if (!enableTenGigabitEthernet(-1)) { if (updateDatabytesandAllocateRAM() == FAIL) {