more fancy
This commit is contained in:
parent
cd77afe464
commit
d4bb6a3a5e
|
@ -839,11 +839,11 @@ uint32_t TriggerDecoderBase::findTriggerZeroEventIndex(
|
||||||
|
|
||||||
TriggerStimulatorHelper helper;
|
TriggerStimulatorHelper helper;
|
||||||
|
|
||||||
uint32_t syncIndex = helper.findTriggerSyncPoint(shape,
|
expected<uint32_t> syncIndex = helper.findTriggerSyncPoint(shape,
|
||||||
triggerConfiguration,
|
triggerConfiguration,
|
||||||
*this);
|
*this);
|
||||||
if (syncIndex == EFI_ERROR_CODE) {
|
if (!syncIndex) {
|
||||||
return syncIndex;
|
return EFI_ERROR_CODE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Assert that we found the sync point on the very first revolution
|
// Assert that we found the sync point on the very first revolution
|
||||||
|
@ -856,9 +856,9 @@ uint32_t TriggerDecoderBase::findTriggerZeroEventIndex(
|
||||||
#endif /* EFI_UNIT_TEST */
|
#endif /* EFI_UNIT_TEST */
|
||||||
|
|
||||||
helper.assertSyncPosition(triggerConfiguration,
|
helper.assertSyncPosition(triggerConfiguration,
|
||||||
syncIndex, *this, shape);
|
syncIndex.Value, *this, shape);
|
||||||
|
|
||||||
return syncIndex % shape.getSize();
|
return syncIndex.Value % shape.getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||||
|
|
|
@ -127,7 +127,7 @@ void TriggerStimulatorHelper::assertSyncPosition(
|
||||||
/**
|
/**
|
||||||
* @return trigger synchronization point index, or error code if not found
|
* @return trigger synchronization point index, or error code if not found
|
||||||
*/
|
*/
|
||||||
uint32_t TriggerStimulatorHelper::findTriggerSyncPoint(
|
expected<uint32_t> TriggerStimulatorHelper::findTriggerSyncPoint(
|
||||||
TriggerWaveform& shape,
|
TriggerWaveform& shape,
|
||||||
const TriggerConfiguration& triggerConfiguration,
|
const TriggerConfiguration& triggerConfiguration,
|
||||||
TriggerDecoderBase& state) {
|
TriggerDecoderBase& state) {
|
||||||
|
@ -140,5 +140,5 @@ uint32_t TriggerStimulatorHelper::findTriggerSyncPoint(
|
||||||
}
|
}
|
||||||
shape.setShapeDefinitionError(true);
|
shape.setShapeDefinitionError(true);
|
||||||
warning(CUSTOM_ERR_TRIGGER_SYNC, "findTriggerZeroEventIndex() failed");
|
warning(CUSTOM_ERR_TRIGGER_SYNC, "findTriggerZeroEventIndex() failed");
|
||||||
return EFI_ERROR_CODE;
|
return unexpected;
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ int getSimulatedEventTime(const TriggerWaveform& shape, int i);
|
||||||
class TriggerStimulatorHelper {
|
class TriggerStimulatorHelper {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
uint32_t findTriggerSyncPoint(
|
expected<uint32_t> findTriggerSyncPoint(
|
||||||
TriggerWaveform& shape,
|
TriggerWaveform& shape,
|
||||||
const TriggerConfiguration& triggerConfiguration,
|
const TriggerConfiguration& triggerConfiguration,
|
||||||
TriggerDecoderBase& state);
|
TriggerDecoderBase& state);
|
||||||
|
|
Loading…
Reference in New Issue