bail from trigger_central (#4210)
This commit is contained in:
parent
14d4d0b868
commit
e8be471b46
|
@ -226,6 +226,11 @@ static void logFront(bool isImportantFront, efitick_t nowNt, int index) {
|
|||
}
|
||||
|
||||
void hwHandleVvtCamSignal(trigger_value_e front, efitick_t nowNt, int index) {
|
||||
if (engine->directSelfStimulation || !engine->hwTriggerInputEnabled) {
|
||||
// sensor noise + self-stim = loss of trigger sync
|
||||
return;
|
||||
}
|
||||
|
||||
int bankIndex = index / CAMS_PER_BANK;
|
||||
int camIndex = index % CAMS_PER_BANK;
|
||||
TriggerCentral *tc = &engine->triggerCentral;
|
||||
|
@ -412,6 +417,11 @@ void hwHandleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) {
|
|||
palWritePad(criticalErrorLedPort, criticalErrorLedPin, 0);
|
||||
#endif // VR_HW_CHECK_MODE
|
||||
|
||||
if (engine->directSelfStimulation || !engine->hwTriggerInputEnabled) {
|
||||
// sensor noise + self-stim = loss of trigger sync
|
||||
return;
|
||||
}
|
||||
|
||||
handleShaftSignal(signalIndex, isRising, timestamp);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,18 +11,6 @@
|
|||
#include "trigger_structure.h"
|
||||
#include "trigger_central.h"
|
||||
|
||||
#define TRIGGER_BAIL_IF_DISABLED \
|
||||
if (!engine->hwTriggerInputEnabled) { \
|
||||
return; \
|
||||
}
|
||||
|
||||
#define TRIGGER_BAIL_IF_SELF_STIM \
|
||||
if (engine->directSelfStimulation) { \
|
||||
/* sensor noise + self-stim = loss of trigger sync */ \
|
||||
return; \
|
||||
}
|
||||
|
||||
|
||||
#define TRIGGER_SUPPORTED_CHANNELS 2
|
||||
|
||||
void turnOnTriggerInputPins();
|
||||
|
|
|
@ -26,9 +26,6 @@ static ioline_t camLines[CAM_INPUTS_COUNT];
|
|||
|
||||
static void shaft_callback(void *arg, efitick_t stamp) {
|
||||
// do the time sensitive things as early as possible!
|
||||
TRIGGER_BAIL_IF_DISABLED
|
||||
TRIGGER_BAIL_IF_SELF_STIM
|
||||
|
||||
int index = (int)arg;
|
||||
ioline_t pal_line = shaftLines[index];
|
||||
bool rise = (palReadLine(pal_line) == PAL_HIGH);
|
||||
|
@ -40,9 +37,6 @@ static void shaft_callback(void *arg, efitick_t stamp) {
|
|||
}
|
||||
|
||||
static void cam_callback(void *arg, efitick_t stamp) {
|
||||
TRIGGER_BAIL_IF_DISABLED
|
||||
TRIGGER_BAIL_IF_SELF_STIM
|
||||
|
||||
int index = (int)arg;
|
||||
ioline_t pal_line = camLines[index];
|
||||
|
||||
|
|
|
@ -25,8 +25,6 @@ int icuFallingCallbackCounter = 0;
|
|||
|
||||
static void vvtRisingCallback(void *arg) {
|
||||
efitick_t now = getTimeNowNt();
|
||||
TRIGGER_BAIL_IF_DISABLED
|
||||
TRIGGER_BAIL_IF_SELF_STIM
|
||||
|
||||
int index = (int)arg;
|
||||
|
||||
|
@ -41,8 +39,6 @@ static void vvtRisingCallback(void *arg) {
|
|||
|
||||
static void vvtFallingCallback(void * arg) {
|
||||
efitick_t now = getTimeNowNt();
|
||||
TRIGGER_BAIL_IF_DISABLED
|
||||
TRIGGER_BAIL_IF_SELF_STIM
|
||||
|
||||
int index = (int)arg;
|
||||
#if EFI_TOOTH_LOGGER
|
||||
|
@ -59,9 +55,6 @@ static void vvtFallingCallback(void * arg) {
|
|||
static void shaftRisingCallback(bool isPrimary) {
|
||||
efitick_t stamp = getTimeNowNt();
|
||||
|
||||
TRIGGER_BAIL_IF_DISABLED
|
||||
TRIGGER_BAIL_IF_SELF_STIM
|
||||
|
||||
icuRisingCallbackCounter++;
|
||||
|
||||
// icucnt_t last_width = icuGetWidth(icup); so far we are fine with system time
|
||||
|
@ -72,9 +65,6 @@ static void shaftRisingCallback(bool isPrimary) {
|
|||
static void shaftFallingCallback(bool isPrimary) {
|
||||
efitick_t stamp = getTimeNowNt();
|
||||
|
||||
TRIGGER_BAIL_IF_DISABLED
|
||||
TRIGGER_BAIL_IF_SELF_STIM
|
||||
|
||||
icuFallingCallbackCounter++;
|
||||
|
||||
hwHandleShaftSignal(isPrimary ? 0 : 1, false, stamp);
|
||||
|
|
Loading…
Reference in New Issue