use limp mgr for trigger disable (#2145)

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2020-12-26 15:12:36 -08:00 committed by GitHub
parent ff4ce2fb1f
commit 19bf208cde
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 6 additions and 13 deletions

View File

@ -276,6 +276,11 @@ uint32_t triggerMaxDuration = 0;
void hwHandleShaftSignal(trigger_event_e signal, efitick_t timestamp) { void hwHandleShaftSignal(trigger_event_e signal, efitick_t timestamp) {
ScopePerf perf(PE::HandleShaftSignal); ScopePerf perf(PE::HandleShaftSignal);
// Don't accept trigger input in case of some problems
if (!engine->limpManager.allowTriggerInput()) {
return;
}
#if VR_HW_CHECK_MODE #if VR_HW_CHECK_MODE
// some boards do not have hardware VR input LEDs which makes such boards harder to validate // some boards do not have hardware VR input LEDs which makes such boards harder to validate
// from experience we know that assembly mistakes happen and quality control is required // from experience we know that assembly mistakes happen and quality control is required

View File

@ -37,8 +37,6 @@ static void shaft_callback(void *arg) {
// todo: support for 3rd trigger input channel // todo: support for 3rd trigger input channel
// todo: start using real event time from HW event, not just software timer? // todo: start using real event time from HW event, not just software timer?
if (hasFirmwareErrorFlag)
return;
bool isPrimary = pal_line == primary_line; bool isPrimary = pal_line == primary_line;
if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) { if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) {

View File

@ -65,8 +65,7 @@ static void shaftRisingCallback(bool isPrimary) {
} }
icuRisingCallbackCounter++; icuRisingCallbackCounter++;
// todo: support for 3rd trigger input channel // todo: support for 3rd trigger input channel
if (hasFirmwareErrorFlag)
return;
if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) { if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) {
return; return;
} }
@ -86,8 +85,6 @@ static void shaftFallingCallback(bool isPrimary) {
icuFallingCallbackCounter++; icuFallingCallbackCounter++;
if (hasFirmwareErrorFlag)
return;
if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) { if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) {
return; return;
} }

View File

@ -71,8 +71,6 @@
EXTERN_ENGINE; EXTERN_ENGINE;
extern bool hasFirmwareErrorFlag;
#if HAL_USE_SPI #if HAL_USE_SPI
extern bool isSpiInitialized[5]; extern bool isSpiInitialized[5];

View File

@ -20,9 +20,6 @@ extern "C" void toggleLed(int led, int mode);
#define BOARD_MOD1_PORT GPIOD #define BOARD_MOD1_PORT GPIOD
#define BOARD_MOD1_PIN 5 #define BOARD_MOD1_PIN 5
extern bool hasFirmwareErrorFlag;
EXTERN_ENGINE EXTERN_ENGINE
; ;
static Logging *logger; static Logging *logger;
@ -116,8 +113,6 @@ static void onTriggerChanged(efitick_t stamp, bool isPrimary, bool isRising) {
#if 1 #if 1
// todo: support for 3rd trigger input channel // todo: support for 3rd trigger input channel
// todo: start using real event time from HW event, not just software timer? // todo: start using real event time from HW event, not just software timer?
if (hasFirmwareErrorFlag)
return;
if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) { if (!isPrimary && !TRIGGER_WAVEFORM(needSecondTriggerInput)) {
return; return;