mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 09:08:00 +02:00
jungfrau server bug fix: setting detector position gave error when switching between different sized detector configurations
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user