Skip to content

Commit

Permalink
fix multi-channel resync issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tknopp committed Sep 26, 2024
1 parent 0457f85 commit 45d19c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/server/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,10 @@ bool getSequenceEnableValue(sequenceData_t *seqData, int seqStep, int channel) {

bool getSequenceResyncValue(sequenceData_t *seqData, int seqStep, int channel) {
bool result = false;
int numChan = numSlowDACChan > 2 ? 2 : numSlowDACChan;
if (seqData->resyncLUT != NULL) {
int localStep = seqStep % seqData->numStepsPerRepetition;
result = seqData->resyncLUT[localStep + channel];
result = seqData->resyncLUT[localStep * numChan + channel];
}
return result;
}
Expand Down
2 changes: 1 addition & 1 deletion src/server/scpi_commands.c
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ static scpi_result_t RP_DAC_SetResyncLUT(scpi_t * context) {
printf("Allocating ressyncLUT\n");
configSeq->resyncLUT = (bool *)calloc(numChan, configSeq->numStepsPerRepetition * sizeof(bool));

int n = readAll(newdatasockfd, configSeq->resyncLUT, numSlowDACChan * configSeq->numStepsPerRepetition * sizeof(bool));
int n = readAll(newdatasockfd, configSeq->resyncLUT, numChan * configSeq->numStepsPerRepetition * sizeof(bool));
seqState = CONFIG;
if (n < 0) perror("ERROR reading from socket");
return returnSCPIBool(context, true);
Expand Down

0 comments on commit 45d19c1

Please sign in to comment.