Access to uninitialized table: tct fix #7300
fix to initialization sequence - noise or starter might get lucky and happen too soon? only:uaefi
This commit is contained in:
parent
8a47382b9a
commit
9dac54ad17
|
@ -131,12 +131,9 @@ static void writeSdBlock(Writer& outBuffer) {
|
||||||
outBuffer.write(buffer, 1);
|
outBuffer.write(buffer, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
|
||||||
extern bool main_loop_started;
|
|
||||||
#endif //EFI_PROD_CODE
|
|
||||||
|
|
||||||
void writeSdLogLine(Writer& bufferedWriter) {
|
void writeSdLogLine(Writer& bufferedWriter) {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
|
extern bool main_loop_started;
|
||||||
if (!main_loop_started)
|
if (!main_loop_started)
|
||||||
return;
|
return;
|
||||||
#endif //EFI_PROD_CODE
|
#endif //EFI_PROD_CODE
|
||||||
|
|
|
@ -1843,7 +1843,7 @@ enum class ObdCode : uint16_t {
|
||||||
CUSTOM_ERR_DWELL_DURATION = 6118,
|
CUSTOM_ERR_DWELL_DURATION = 6118,
|
||||||
CUSTOM_ERR_NO_SHAPE = 6119,
|
CUSTOM_ERR_NO_SHAPE = 6119,
|
||||||
|
|
||||||
CUSTOM_ERR_6121 = 6121,
|
CUSTOM_ERR_INPUT_DURING_INITIALISATION = 6121,
|
||||||
CUSTOM_ERR_6122 = 6122,
|
CUSTOM_ERR_6122 = 6122,
|
||||||
CUSTOM_ERR_6123 = 6123,
|
CUSTOM_ERR_6123 = 6123,
|
||||||
CUSTOM_ERR_6124 = 6124,
|
CUSTOM_ERR_6124 = 6124,
|
||||||
|
|
|
@ -258,12 +258,26 @@ static void logVvtFront(bool useOnlyRise, bool isImportantFront, TriggerValue fr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool tooSoonToHandleSignal() {
|
||||||
|
#if EFI_PROD_CODE
|
||||||
|
extern bool main_loop_started;
|
||||||
|
if (!main_loop_started) {
|
||||||
|
warning(ObdCode::CUSTOM_ERR_INPUT_DURING_INITIALISATION, "event too early");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
#endif //EFI_PROD_CODE
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void hwHandleVvtCamSignal(bool isRising, efitick_t timestamp, int index) {
|
void hwHandleVvtCamSignal(bool isRising, efitick_t timestamp, int index) {
|
||||||
hwHandleVvtCamSignal(isRising ? TriggerValue::RISE : TriggerValue::FALL, timestamp, index);
|
hwHandleVvtCamSignal(isRising ? TriggerValue::RISE : TriggerValue::FALL, timestamp, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 'invertCamVVTSignal' is already accounted by the time this method is invoked
|
// 'invertCamVVTSignal' is already accounted by the time this method is invoked
|
||||||
void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
|
void hwHandleVvtCamSignal(TriggerValue front, efitick_t nowNt, int index) {
|
||||||
|
if (tooSoonToHandleSignal()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
TriggerCentral *tc = getTriggerCentral();
|
TriggerCentral *tc = getTriggerCentral();
|
||||||
if (tc->directSelfStimulation || !tc->hwTriggerInputEnabled) {
|
if (tc->directSelfStimulation || !tc->hwTriggerInputEnabled) {
|
||||||
// sensor noise + self-stim = loss of trigger sync
|
// sensor noise + self-stim = loss of trigger sync
|
||||||
|
@ -432,6 +446,9 @@ uint32_t triggerMaxDuration = 0;
|
||||||
* - Trigger replay from CSV (unit tests)
|
* - Trigger replay from CSV (unit tests)
|
||||||
*/
|
*/
|
||||||
void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) {
|
void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) {
|
||||||
|
if (tooSoonToHandleSignal()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
TriggerCentral *tc = getTriggerCentral();
|
TriggerCentral *tc = getTriggerCentral();
|
||||||
ScopePerf perf(PE::HandleShaftSignal);
|
ScopePerf perf(PE::HandleShaftSignal);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue