This commit is contained in:
maliakal_d 2022-02-18 11:38:37 +01:00
parent 0fb6c8b823
commit 0d521b64b6
2 changed files with 22 additions and 24 deletions

View File

@ -754,6 +754,7 @@ int setDynamicRange(int dr) {
bus_w(CONFIG_REG, bus_r(CONFIG_REG) & ~CONFIG_DYNAMIC_RANGE_MSK);
bus_w(CONFIG_REG, bus_r(CONFIG_REG) | regval);
updatePacketizing();
return OK;
}
int getDynamicRange(int *retval) {

View File

@ -4657,18 +4657,17 @@ int set_read_n_rows(int file_des) {
#ifdef EIGERD
int dr = 0;
ret = getDynamicRange(&dr);
int isTenGiga = enableTenGigabitEthernet(GET_FLAG);
unsigned int maxnl = MAX_ROWS_PER_READOUT;
unsigned int maxnp = (isTenGiga ? 4 : 16) * dr;
// get dr fail
if (ret == FAIL) {
strcpy(mess,
"Could not read n rows (failed to get dynamic range)\n");
LOG(logERROR, (mess));
} else {
int isTenGiga = enableTenGigabitEthernet(GET_FLAG);
unsigned int maxnl = MAX_ROWS_PER_READOUT;
unsigned int maxnp = (isTenGiga ? 4 : 16) * dr;
if ((arg * maxnp) % maxnl) {
} else if ((arg * maxnp) % maxnl) {
ret = FAIL;
sprintf(
mess,
sprintf(mess,
"Could not set number of rows to %d. For %d bit "
"mode and 10 giga %s, (%d (num "
"rows) x %d (max num packets for this mode)) must be "
@ -4698,8 +4697,7 @@ int set_read_n_rows(int file_des) {
{
if (setReadNRows(arg) == FAIL) {
ret = FAIL;
sprintf(mess, "Could not set number of rows to %d.\n",
arg);
sprintf(mess, "Could not set number of rows to %d.\n", arg);
LOG(logERROR, (mess));
} else {
int retval = getReadNRows();
@ -4715,7 +4713,6 @@ int set_read_n_rows(int file_des) {
}
}
}
}
#endif
return Server_SendResult(file_des, INT32, NULL, 0);
}