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