learning C++

This commit is contained in:
rusefillc 2022-11-06 00:17:24 -04:00
parent 6c8325c0c2
commit 8bcbb2b9b1
2 changed files with 6 additions and 8 deletions

View File

@ -837,9 +837,7 @@ uint32_t TriggerDecoderBase::findTriggerZeroEventIndex(
return 0; return 0;
} }
TriggerStimulatorHelper helper; expected<uint32_t> syncIndex = TriggerStimulatorHelper::findTriggerSyncPoint(shape,
expected<uint32_t> syncIndex = helper.findTriggerSyncPoint(shape,
triggerConfiguration, triggerConfiguration,
*this); *this);
if (!syncIndex) { if (!syncIndex) {
@ -855,7 +853,7 @@ uint32_t TriggerDecoderBase::findTriggerZeroEventIndex(
} }
#endif /* EFI_UNIT_TEST */ #endif /* EFI_UNIT_TEST */
helper.assertSyncPosition(triggerConfiguration, TriggerStimulatorHelper::assertSyncPosition(triggerConfiguration,
syncIndex.Value, *this, shape); syncIndex.Value, *this, shape);
return syncIndex.Value % shape.getSize(); return syncIndex.Value % shape.getSize();

View File

@ -17,20 +17,20 @@ int getSimulatedEventTime(const TriggerWaveform& shape, int i);
class TriggerStimulatorHelper { class TriggerStimulatorHelper {
public: public:
expected<uint32_t> findTriggerSyncPoint( static expected<uint32_t> findTriggerSyncPoint(
TriggerWaveform& shape, TriggerWaveform& shape,
const TriggerConfiguration& triggerConfiguration, const TriggerConfiguration& triggerConfiguration,
TriggerDecoderBase& state); TriggerDecoderBase& state);
void assertSyncPosition( static void assertSyncPosition(
const TriggerConfiguration& triggerConfiguration, const TriggerConfiguration& triggerConfiguration,
const uint32_t index, const uint32_t index,
TriggerDecoderBase& state, TriggerDecoderBase& state,
TriggerWaveform& shape TriggerWaveform& shape
); );
private:
// send next event so that we can see how state reacts // send next event so that we can see how state reacts
void feedSimulatedEvent( static void feedSimulatedEvent(
const TriggerConfiguration& triggerConfiguration, const TriggerConfiguration& triggerConfiguration,
TriggerDecoderBase& state, TriggerDecoderBase& state,
const TriggerWaveform& shape, const TriggerWaveform& shape,