This commit is contained in:
Andrey 2022-09-07 15:46:08 -04:00
commit 14e1b9fb81
37 changed files with 65 additions and 51 deletions

View File

@ -196,7 +196,12 @@ static void SetNextCompositeEntry(efitick_t timestamp) {
return; return;
} }
composite_logger_s* entry = &buffer->buffer[buffer->nextIdx]; size_t idx = buffer->nextIdx;
auto nextIdx = idx + 1;
buffer->nextIdx = nextIdx;
if (idx < efi::size(buffer->buffer)) {
composite_logger_s* entry = &buffer->buffer[idx];
uint32_t nowUs = NT2US(timestamp); uint32_t nowUs = NT2US(timestamp);
@ -208,11 +213,10 @@ static void SetNextCompositeEntry(efitick_t timestamp) {
entry->sync = engine->triggerCentral.triggerState.getShaftSynchronized(); entry->sync = engine->triggerCentral.triggerState.getShaftSynchronized();
entry->coil = currentCoilState; entry->coil = currentCoilState;
entry->injector = currentInjectorState; entry->injector = currentInjectorState;
}
buffer->nextIdx++;
// if the buffer is full... // if the buffer is full...
bool bufferFull = buffer->nextIdx >= efi::size(buffer->buffer); bool bufferFull = nextIdx >= efi::size(buffer->buffer);
// ... or it's been too long since the last flush // ... or it's been too long since the last flush
bool bufferTimedOut = buffer->startTime.hasElapsedSec(5); bool bufferTimedOut = buffer->startTime.hasElapsedSec(5);

View File

@ -1,2 +1,2 @@
#pragma once #pragma once
#define VCS_DATE 20220905 #define VCS_DATE 20220907

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3963821 #define SIGNATURE_HASH 3963821
#define TS_SIGNATURE "rusEFI 2022.09.06.48way.3963821" #define TS_SIGNATURE "rusEFI 2022.09.07.48way.3963821"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 387675106 #define SIGNATURE_HASH 387675106
#define TS_SIGNATURE "rusEFI 2022.09.06.all.387675106" #define TS_SIGNATURE "rusEFI 2022.09.07.all.387675106"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 621407886 #define SIGNATURE_HASH 621407886
#define TS_SIGNATURE "rusEFI 2022.09.06.alphax-2chan.621407886" #define TS_SIGNATURE "rusEFI 2022.09.07.alphax-2chan.621407886"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 2617749613 #define SIGNATURE_HASH 2617749613
#define TS_SIGNATURE "rusEFI 2022.09.06.alphax-4chan.2617749613" #define TS_SIGNATURE "rusEFI 2022.09.07.alphax-4chan.2617749613"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 198280901 #define SIGNATURE_HASH 198280901
#define TS_SIGNATURE "rusEFI 2022.09.06.atlas.198280901" #define TS_SIGNATURE "rusEFI 2022.09.07.atlas.198280901"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3791069723 #define SIGNATURE_HASH 3791069723
#define TS_SIGNATURE "rusEFI 2022.09.06.core8.3791069723" #define TS_SIGNATURE "rusEFI 2022.09.07.core8.3791069723"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 387675106 #define SIGNATURE_HASH 387675106
#define TS_SIGNATURE "rusEFI 2022.09.06.cypress.387675106" #define TS_SIGNATURE "rusEFI 2022.09.07.cypress.387675106"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 387675106 #define SIGNATURE_HASH 387675106
#define TS_SIGNATURE "rusEFI 2022.09.06.f407-discovery.387675106" #define TS_SIGNATURE "rusEFI 2022.09.07.f407-discovery.387675106"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 387675106 #define SIGNATURE_HASH 387675106
#define TS_SIGNATURE "rusEFI 2022.09.06.f429-discovery.387675106" #define TS_SIGNATURE "rusEFI 2022.09.07.f429-discovery.387675106"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 1433898790 #define SIGNATURE_HASH 1433898790
#define TS_SIGNATURE "rusEFI 2022.09.06.frankenso_na6.1433898790" #define TS_SIGNATURE "rusEFI 2022.09.07.frankenso_na6.1433898790"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3890640589 #define SIGNATURE_HASH 3890640589
#define TS_SIGNATURE "rusEFI 2022.09.06.harley81.3890640589" #define TS_SIGNATURE "rusEFI 2022.09.07.harley81.3890640589"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 2742875732 #define SIGNATURE_HASH 2742875732
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen-gm-e67.2742875732" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen-gm-e67.2742875732"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3465560622 #define SIGNATURE_HASH 3465560622
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen-nb1.3465560622" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen-nb1.3465560622"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 2680539912 #define SIGNATURE_HASH 2680539912
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen121nissan.2680539912" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen121nissan.2680539912"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 1731899544 #define SIGNATURE_HASH 1731899544
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen121vag.1731899544" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen121vag.1731899544"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3924119260 #define SIGNATURE_HASH 3924119260
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen128.3924119260" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen128.3924119260"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 2404647270 #define SIGNATURE_HASH 2404647270
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen154hyundai.2404647270" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen154hyundai.2404647270"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3844365030 #define SIGNATURE_HASH 3844365030
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen72.3844365030" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen72.3844365030"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 900639720 #define SIGNATURE_HASH 900639720
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen81.900639720" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen81.900639720"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 49176622 #define SIGNATURE_HASH 49176622
#define TS_SIGNATURE "rusEFI 2022.09.06.hellen88bmw.49176622" #define TS_SIGNATURE "rusEFI 2022.09.07.hellen88bmw.49176622"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3538496864 #define SIGNATURE_HASH 3538496864
#define TS_SIGNATURE "rusEFI 2022.09.06.hellenNA6.3538496864" #define TS_SIGNATURE "rusEFI 2022.09.07.hellenNA6.3538496864"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3071459850 #define SIGNATURE_HASH 3071459850
#define TS_SIGNATURE "rusEFI 2022.09.06.hellenNA8_96.3071459850" #define TS_SIGNATURE "rusEFI 2022.09.07.hellenNA8_96.3071459850"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 2144129326 #define SIGNATURE_HASH 2144129326
#define TS_SIGNATURE "rusEFI 2022.09.06.kin.2144129326" #define TS_SIGNATURE "rusEFI 2022.09.07.kin.2144129326"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3637378836 #define SIGNATURE_HASH 3637378836
#define TS_SIGNATURE "rusEFI 2022.09.06.mre_f4.3637378836" #define TS_SIGNATURE "rusEFI 2022.09.07.mre_f4.3637378836"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3637378836 #define SIGNATURE_HASH 3637378836
#define TS_SIGNATURE "rusEFI 2022.09.06.mre_f7.3637378836" #define TS_SIGNATURE "rusEFI 2022.09.07.mre_f7.3637378836"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 1207020036 #define SIGNATURE_HASH 1207020036
#define TS_SIGNATURE "rusEFI 2022.09.06.prometheus_405.1207020036" #define TS_SIGNATURE "rusEFI 2022.09.07.prometheus_405.1207020036"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 1207020036 #define SIGNATURE_HASH 1207020036
#define TS_SIGNATURE "rusEFI 2022.09.06.prometheus_469.1207020036" #define TS_SIGNATURE "rusEFI 2022.09.07.prometheus_469.1207020036"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3000415380 #define SIGNATURE_HASH 3000415380
#define TS_SIGNATURE "rusEFI 2022.09.06.proteus_f4.3000415380" #define TS_SIGNATURE "rusEFI 2022.09.07.proteus_f4.3000415380"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3000415380 #define SIGNATURE_HASH 3000415380
#define TS_SIGNATURE "rusEFI 2022.09.06.proteus_f7.3000415380" #define TS_SIGNATURE "rusEFI 2022.09.07.proteus_f7.3000415380"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3000415380 #define SIGNATURE_HASH 3000415380
#define TS_SIGNATURE "rusEFI 2022.09.06.proteus_h7.3000415380" #define TS_SIGNATURE "rusEFI 2022.09.07.proteus_h7.3000415380"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 1845865016 #define SIGNATURE_HASH 1845865016
#define TS_SIGNATURE "rusEFI 2022.09.06.subaru_eg33_f7.1845865016" #define TS_SIGNATURE "rusEFI 2022.09.07.subaru_eg33_f7.1845865016"

View File

@ -3,4 +3,4 @@
// //
#define SIGNATURE_HASH 3172187574 #define SIGNATURE_HASH 3172187574
#define TS_SIGNATURE "rusEFI 2022.09.06.tdg-pdm8.3172187574" #define TS_SIGNATURE "rusEFI 2022.09.07.tdg-pdm8.3172187574"

View File

@ -212,13 +212,17 @@ int TriggerDecoderBase::getTotalRevolutionCounter() const {
void PrimaryTriggerDecoder::resetTriggerState() { void PrimaryTriggerDecoder::resetTriggerState() {
TriggerDecoderBase::resetTriggerState(); TriggerDecoderBase::resetTriggerState();
memset(timeOfLastEvent, 0, sizeof(timeOfLastEvent));
memset(spinningEvents, 0, sizeof(spinningEvents));
spinningEventIndex = 0;
prevInstantRpmValue = 0; prevInstantRpmValue = 0;
m_instantRpm = 0; m_instantRpm = 0;
resetHasFullSync(); resetHasFullSync();
resetInstantRpm();
}
void PrimaryTriggerDecoder::resetInstantRpm() {
memset(timeOfLastEvent, 0, sizeof(timeOfLastEvent));
memset(spinningEvents, 0, sizeof(spinningEvents));
spinningEventIndex = 0;
} }
void PrimaryTriggerDecoder::movePreSynchTimestamps() { void PrimaryTriggerDecoder::movePreSynchTimestamps() {
@ -393,6 +397,10 @@ angle_t PrimaryTriggerDecoder::syncEnginePhase(int divider, int remainder, angle
if (totalShift > 0) { if (totalShift > 0) {
camResyncCounter++; camResyncCounter++;
// Reset instant RPM, since the engine phase has now changed, invalidating the tooth history buffer
// maybe TODO: could/should we rotate the buffer around to re-align it instead? Is that worth it?
resetInstantRpm();
} }
return totalShift; return totalShift;

View File

@ -235,6 +235,8 @@ private:
TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails, TriggerWaveform const & triggerShape, TriggerFormDetails *triggerFormDetails,
uint32_t index, efitick_t nowNt); uint32_t index, efitick_t nowNt);
void resetInstantRpm();
float m_instantRpm = 0; float m_instantRpm = 0;
float m_instantRpmRatio = 0; float m_instantRpmRatio = 0;

View File

@ -1,12 +1,12 @@
// This file was generated by Version2Header // This file was generated by Version2Header
// Mon Sep 05 00:27:02 UTC 2022 // Wed Sep 07 00:28:41 UTC 2022
#ifndef GIT_HASH #ifndef GIT_HASH
#define GIT_HASH "5d4f45bff6bfee2136fcda7b199d0b31edea6ef1" #define GIT_HASH "d2e6ff3da3f0644d5d3301bc87467e2c7ce47db8"
#endif #endif
#ifndef VCS_VERSION #ifndef VCS_VERSION
#define VCS_VERSION "46217" #define VCS_VERSION "46285"
#endif #endif