From 4be0b5d4366440449ad86fc78fa04e618d56df5f Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 8 Apr 2019 18:05:05 +0200 Subject: [PATCH] jungfrau server bug fix: setting detector position gave error when switching between different sized detector configurations --- RELEASE.txt | 7 +++++++ .../jungfrauDetectorServer/slsDetectorFunctionList.c | 3 +++ 2 files changed, 10 insertions(+) diff --git a/RELEASE.txt b/RELEASE.txt index a64084483..d6518d2c4 100644 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -18,6 +18,7 @@ This document describes the differences between 4.0.2 and 4.0.1 releases. ==================== - Jungfrau receiver as root user + - Jungfrau server detector position error when switching between different detector sizes @@ -33,6 +34,12 @@ This document describes the differences between 4.0.2 and 4.0.1 releases. sls_detector_put rx_udpsocksize 1048576000 This has been fixed now to allow a greater size (including the default size). + + Detector Server (Jungfrau) + -------------------------- + 1. Switching between different detector size configurations, the detector gave an + error "Could not set detector position". This is fixed now. + 3. Known Issues =============== diff --git a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c index 38d841538..68d821184 100644 --- a/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorSoftware/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -1313,14 +1313,17 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t int setDetectorPosition(int pos[]) { int ret = OK; + bus_w(COORD_0_REG, bus_r(COORD_0_REG) & (~COORD_0_X_MSK)); bus_w(COORD_0_REG, bus_r(COORD_0_REG) | ((pos[0] << COORD_0_X_OFST) & COORD_0_X_MSK)); if ((bus_r(COORD_0_REG) & COORD_0_X_MSK) != ((pos[0] << COORD_0_X_OFST) & COORD_0_X_MSK)) ret = FAIL; + bus_w(COORD_0_REG, bus_r(COORD_0_REG) & (~COORD_0_Y_MSK)); bus_w(COORD_0_REG, bus_r(COORD_0_REG) | ((pos[1] << COORD_0_Y_OFST) & COORD_0_Y_MSK)); if ((bus_r(COORD_0_REG) & COORD_0_Y_MSK) != ((pos[1] << COORD_0_Y_OFST) & COORD_0_Y_MSK)) ret = FAIL; + bus_w(COORD_1_REG, bus_r(COORD_1_REG) & (~COORD_0_Z_MSK)); bus_w(COORD_1_REG, bus_r(COORD_1_REG) | ((pos[2] << COORD_0_Z_OFST) & COORD_0_Z_MSK)); if ((bus_r(COORD_1_REG) & COORD_0_Z_MSK) != ((pos[2] << COORD_0_Z_OFST) & COORD_0_Z_MSK)) ret = FAIL;