refactoring - explicit read method

This commit is contained in:
Andrey 2021-06-26 22:11:42 -04:00
parent a5eeb19c4d
commit 1822426d0c
2 changed files with 4 additions and 3 deletions

View File

@ -451,8 +451,9 @@ void Engine::OnTriggerSyncronization(bool wasSynchronized) {
if (isTriggerDecoderError(PASS_ENGINE_PARAMETER_SIGNATURE)) {
warning(CUSTOM_OBD_TRG_DECODING, "trigger decoding issue. expected %d/%d/%d got %d/%d/%d",
TRIGGER_WAVEFORM(expectedEventCount[0]), TRIGGER_WAVEFORM(expectedEventCount[1]),
TRIGGER_WAVEFORM(expectedEventCount[2]),
TRIGGER_WAVEFORM(getExpectedEventCount(0)),
TRIGGER_WAVEFORM(getExpectedEventCount(1)),
TRIGGER_WAVEFORM(getExpectedEventCount(2)),
triggerCentral.triggerState.currentCycle.eventCount[0],
triggerCentral.triggerState.currentCycle.eventCount[1],
triggerCentral.triggerState.currentCycle.eventCount[2]);

View File

@ -190,7 +190,7 @@ int TriggerWaveform::getExpectedEventCount(int channelIndex) {
void TriggerWaveform::calculateExpectedEventCounts(bool useOnlyRisingEdgeForTrigger) {
if (!useOnlyRisingEdgeForTrigger) {
for (size_t i = 0; i < efi::size(expectedEventCount); i++) {
if (expectedEventCount[i] % 2 != 0) {
if (getExpectedEventCount(i) % 2 != 0) {
firmwareError(ERROR_TRIGGER_DRAMA, "Trigger: should be even %d %d", i, expectedEventCount[i]);
}
}