Skip to content

Commit

Permalink
Restrict getSequenceResyncValue to DAC channel
Browse files Browse the repository at this point in the history
  • Loading branch information
rp_local committed Sep 26, 2024
1 parent cdb0ae9 commit 823c37e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/server/control.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ 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 numChan = numSlowDACChan > 2 ? 2 : numSlowDACChan;
if (seqData->resyncLUT != NULL && channel < numChan) {
int localStep = seqStep % seqData->numStepsPerRepetition;
result = seqData->resyncLUT[localStep * numChan + channel];
}
Expand Down Expand Up @@ -215,6 +215,7 @@ static void setLUTValuesFor(int futureStep, int channel, int currPDMIndex) {
if (activeSequence == NULL) {
setPDMValueVolt(0.0, channel, currPDMIndex);
setEnableDAC(false, channel, currPDMIndex);
setResyncDAC(false, channel, currPDMIndex);
setRampDownDAC(false, channel, currPDMIndex);
return;
}
Expand Down

0 comments on commit 823c37e

Please sign in to comment.