Skip to content

Commit

Permalink
fixed some error handling for LabRAD integration
Browse files Browse the repository at this point in the history
  • Loading branch information
markzakharyan committed Sep 30, 2024
1 parent 72b8e67 commit ca53a14
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions m4/src/Peripherals/God.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class God {
registerMemberFunctionVector(dacLedBufferRampWrapper,
"DAC_LED_BUFFER_RAMP");
registerMemberFunction(dacChannelCalibration, "DAC_CH_CAL");
registerMemberFunctionVector(boxcarAverageRamp, "BOXCAR_AVERAGE_RAMP");
registerMemberFunctionVector(boxcarAverageRamp, "BOXCAR_BUFFER_RAMP");
registerMemberFunctionVector(boxcarAverageRampDebug,
"BOXCAR_AVERAGE_RAMP_DEBUG");
"BOXCAR_BUFFER_RAMP_DEBUG");
}

// args:
Expand Down Expand Up @@ -408,7 +408,7 @@ class God {
}

uint32_t dacPeriod_us = (numAdcMeasuresPerDacStep + numAdcConversionSkips) *
actualConversionTime_us;
actualConversionTime_us + 10*numAdcChannels;

setStopFlag(false);

Expand Down Expand Up @@ -436,10 +436,10 @@ class God {
int adcGetsSinceLastDacSet = 0;

// for debugging:
float dacPeriodFloat = static_cast<float>(dacPeriod_us);
m4SendFloat(&dacPeriodFloat, 1);
float adcPeriodFloat = static_cast<float>(actualConversionTime_us);
m4SendFloat(&adcPeriodFloat, 1);
// float dacPeriodFloat = static_cast<float>(dacPeriod_us);
// m4SendFloat(&dacPeriodFloat, 1);
// float adcPeriodFloat = static_cast<float>(actualConversionTime_us);
// m4SendFloat(&adcPeriodFloat, 1);

for (int i = 0; i < numAdcChannels; ++i) {
ADCController::startContinuousConversion(adcChannels[i]);
Expand All @@ -462,7 +462,7 @@ class God {
ADCController::getVoltageDataNoTransaction(adcChannels[i]);
packets[i] = v;
}
// m4SendVoltage(packets, numAdcChannels);
m4SendVoltage(packets, numAdcChannels);
delete[] packets;
x++;
}
Expand Down Expand Up @@ -601,10 +601,10 @@ class God {
bool isHighSet = false;

// For debugging:
float dacPeriodFloat = static_cast<float>(dacPeriod_us);
m4SendFloat(&dacPeriodFloat, 1);
float adcPeriodFloat = static_cast<float>(actualConversionTime_us);
m4SendFloat(&adcPeriodFloat, 1);
// float dacPeriodFloat = static_cast<float>(dacPeriod_us);
// m4SendFloat(&dacPeriodFloat, 1);
// float adcPeriodFloat = static_cast<float>(actualConversionTime_us);
// m4SendFloat(&adcPeriodFloat, 1);

for (int i = 0; i < numAdcChannels; ++i) {
ADCController::startContinuousConversion(adcChannels[i]);
Expand Down
4 changes: 2 additions & 2 deletions m4/src/UserIOHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ struct UserIOHandler {
}
break;
case FunctionRegistry::ExecuteResult::ArgumentError:
m4SendChar("Error: Argument error", 22);
m4SendChar("FAILURE: Argument error", 24);
break;
case FunctionRegistry::ExecuteResult::FunctionNotFound:
m4SendChar("Error: Function not found", 26);
m4SendChar("FAILURE: Function not found", 28);
break;
}
}
Expand Down

0 comments on commit ca53a14

Please sign in to comment.