From 1da7242e062f23cd76fff72cfc0ca9869bcc6ddd Mon Sep 17 00:00:00 2001 From: Nathan Schulte Date: Fri, 18 Nov 2022 21:01:03 -0600 Subject: [PATCH] firmware: digital_input logic depends on e.g. HAL_USE_ADC --- firmware/hw_layer/digital_input/trigger/trigger_input_adc.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/firmware/hw_layer/digital_input/trigger/trigger_input_adc.cpp b/firmware/hw_layer/digital_input/trigger/trigger_input_adc.cpp index 75dc7eab5d..dddd7bfaf8 100644 --- a/firmware/hw_layer/digital_input/trigger/trigger_input_adc.cpp +++ b/firmware/hw_layer/digital_input/trigger/trigger_input_adc.cpp @@ -239,7 +239,9 @@ void TriggerAdcDetector::digitalCallback(efitick_t stamp, bool isPrimary, bool r return; } +#if EFI_SHAFT_POSITION_INPUT && HAL_TRIGGER_USE_ADC && HAL_USE_ADC onTriggerChanged(stamp, isPrimary, rise); +#endif // EFI_SHAFT_POSITION_INPUT && HAL_TRIGGER_USE_ADC && HAL_USE_ADC if ((stamp - prevStamp) > minDeltaTimeForStableAdcDetectionNt) { switchingCnt++; @@ -360,7 +362,9 @@ void TriggerAdcDetector::analogCallback(efitick_t stamp, triggerAdcSample_t valu } if (transitionCooldownCnt <= 0) { +#if EFI_SHAFT_POSITION_INPUT && HAL_TRIGGER_USE_ADC && HAL_USE_ADC onTriggerChanged(stamp - stampCorrectionForAdc, true, transition == 1); +#endif // EFI_SHAFT_POSITION_INPUT && HAL_TRIGGER_USE_ADC && HAL_USE_ADC // let's skip some nearest possible measurements: // the transition cannot be SO fast, but the jitter can! transitionCooldownCnt = transitionCooldown;