mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
Merge pull request #323 from slsdetectorgroup/jungfraucalibfix
Jungfraucalibfix
This commit is contained in:
commit
3726ae3fd1
Binary file not shown.
@ -2260,8 +2260,19 @@ void enableCurrentSource(int fix, uint64_t select, int normal) {
|
||||
|
||||
} else {
|
||||
// select
|
||||
LOG(logINFO, ("\tSetting selection to 0x%lx\n", (long unsigned int)select));
|
||||
set64BitReg(select, CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG);
|
||||
// invert select first
|
||||
uint64_t tmp = select;
|
||||
uint64_t inverted = 0;
|
||||
for (int i = 0; i != 64; ++i) {
|
||||
// get each bit from LSB side
|
||||
uint64_t bit = (tmp >> i) & 0x1;
|
||||
// push the bit into MSB side
|
||||
inverted |= (bit << (63 - i));
|
||||
}
|
||||
LOG(logINFO, ("\tSetting selection to 0x%lx (inverted from 0x%lx)\n",
|
||||
(long unsigned int) inverted, (long unsigned int)select));
|
||||
set64BitReg(inverted, CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG);
|
||||
|
||||
// normal
|
||||
if (normal) {
|
||||
LOG(logINFO, ("\tEnabling normal\n"))
|
||||
@ -2314,7 +2325,18 @@ uint64_t getSelectCurrentSource() {
|
||||
return ((bus_r(DAQ_REG) & DAQ_CRRNT_SRC_CLMN_SLCT_MSK) >>
|
||||
DAQ_CRRNT_SRC_CLMN_SLCT_OFST);
|
||||
} else {
|
||||
return get64BitReg(CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG);
|
||||
// invert the select
|
||||
uint64_t retval = get64BitReg(CRRNT_SRC_COL_LSB_REG, CRRNT_SRC_COL_MSB_REG);
|
||||
|
||||
uint64_t tmp = retval;
|
||||
uint64_t inverted = 0;
|
||||
for (int i = 0; i != 64; ++i) {
|
||||
// get each bit from LSB side
|
||||
uint64_t bit = (tmp >> i) & 0x1;
|
||||
// push the bit into MSB side
|
||||
inverted |= (bit << (63 - i));
|
||||
}
|
||||
return inverted;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#define APICTB 0x211019
|
||||
#define APIGOTTHARD 0x211019
|
||||
#define APIGOTTHARD2 0x211019
|
||||
#define APIJUNGFRAU 0x211019
|
||||
#define APIMYTHEN3 0x211019
|
||||
#define APIMOENCH 0x211019
|
||||
#define APIEIGER 0x211019
|
||||
#define APIJUNGFRAU 0x211019
|
||||
|
Loading…
x
Reference in New Issue
Block a user