client gives now 3d positions of detector to be configured in udp header, only in jungfrau firmware till now

This commit is contained in:
Dhanya Maliakal
2017-09-22 15:28:57 +02:00
parent 5a8f30fee8
commit 663fd557ff
8 changed files with 76 additions and 22 deletions

View File

@@ -1043,7 +1043,25 @@ int configureMAC(uint32_t destip, uint64_t destmac, uint64_t sourcemac, uint32_t
}
int setDetectorPosition(int pos[]) {
int ret = OK;
bus_w(COORD_0, bus_r(COORD_0) | ((pos[0] << COORD_0_X_OFST) & COORD_0_X_MSK));
if ((bus_r(COORD_0) & COORD_0_X_MSK) != ((pos[0] << COORD_0_X_OFST) & COORD_0_X_MSK))
ret = FAIL;
bus_w(COORD_0, bus_r(COORD_0) | ((pos[1] << COORD_0_Y_OFST) & COORD_0_Y_MSK));
if ((bus_r(COORD_0) & COORD_0_Y_MSK) != ((pos[1] << COORD_0_Y_OFST) & COORD_0_Y_MSK))
ret = FAIL;
bus_w(COORD_1, bus_r(COORD_1) | ((pos[2] << COORD_0_Z_OFST) & COORD_0_Z_MSK));
if ((bus_r(COORD_1) & COORD_0_Z_MSK) != ((pos[2] << COORD_0_Z_OFST) & COORD_0_Z_MSK))
ret = FAIL;
if (ret == OK)
printf("Position set to [%d, %d, %d]\n", pos[0], pos[1], pos[2]);
return ret;
}