trigger signal debug pins - logic level output #2959
This commit is contained in:
parent
a926357a01
commit
e721c1768f
|
@ -133,7 +133,7 @@ static void turnOffTriggerInputPin(int index, bool isTriggerShaft) {
|
|||
/* Exported functions. */
|
||||
/*==========================================================================*/
|
||||
|
||||
void stopTriggerInputPins(void) {
|
||||
void stopTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) {
|
||||
if (isConfigurationChanged(triggerInputPins[i])) {
|
||||
turnOffTriggerInputPin(i, true);
|
||||
|
@ -152,7 +152,7 @@ void stopTriggerInputPins(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void startTriggerInputPins(void) {
|
||||
void startTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) {
|
||||
if (isConfigurationChanged(triggerInputPins[i])) {
|
||||
const char * msg = (i == 0 ? "Trigger #1" : (i == 1 ? "Trigger #2" : "Trigger #3"));
|
||||
|
@ -173,7 +173,7 @@ void startTriggerInputPins(void) {
|
|||
}
|
||||
}
|
||||
|
||||
void turnOnTriggerInputPins() {
|
||||
void turnOnTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
/* init all trigger HW available */
|
||||
icuTriggerTurnOnInputPins();
|
||||
extiTriggerTurnOnInputPins();
|
||||
|
@ -183,11 +183,11 @@ void turnOnTriggerInputPins() {
|
|||
|
||||
#endif /* (HAL_USE_ICU == TRUE) || (HAL_TRIGGER_USE_PAL == TRUE) */
|
||||
|
||||
void applyNewTriggerInputPins(void) {
|
||||
void applyNewTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
// first we will turn off all the changed pins
|
||||
stopTriggerInputPins();
|
||||
stopTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
// then we will enable all the changed pins
|
||||
startTriggerInputPins();
|
||||
startTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
}
|
||||
|
||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||
|
|
|
@ -28,10 +28,10 @@
|
|||
|
||||
#define TRIGGER_SUPPORTED_CHANNELS 2
|
||||
|
||||
void turnOnTriggerInputPins();
|
||||
void applyNewTriggerInputPins(void);
|
||||
void startTriggerInputPins(void);
|
||||
void stopTriggerInputPins(void);
|
||||
void turnOnTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void applyNewTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void startTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
void stopTriggerInputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if HAL_TRIGGER_USE_ADC && HAL_USE_ADC
|
||||
// This detector has 2 modes for low-RPM (ADC) and fast-RPM (EXTI)
|
||||
|
|
|
@ -269,7 +269,7 @@ static void adcConfigListener(Engine *engine) {
|
|||
calcFastAdcIndexes();
|
||||
}
|
||||
|
||||
static void turnOnHardware() {
|
||||
static void turnOnHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
||||
#if EFI_FASTER_UNIFORM_ADC
|
||||
for (int i = 0; i < ADC_MAX_CHANNELS_COUNT; i++) {
|
||||
averagedSamples[i] = 0;
|
||||
|
@ -278,7 +278,7 @@ static void turnOnHardware() {
|
|||
#endif /* EFI_FASTER_UNIFORM_ADC */
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
turnOnTriggerInputPins();
|
||||
turnOnTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||
}
|
||||
|
||||
|
@ -311,7 +311,7 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
ButtonDebounce::stopConfigurationList();
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
stopTriggerInputPins();
|
||||
stopTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||
|
||||
|
||||
|
@ -384,7 +384,7 @@ void applyNewHardwareSettings(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
******************************************/
|
||||
|
||||
#if EFI_SHAFT_POSITION_INPUT
|
||||
startTriggerInputPins();
|
||||
startTriggerInputPins(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
#endif /* EFI_SHAFT_POSITION_INPUT */
|
||||
|
||||
#if (HAL_USE_PAL && EFI_JOYSTICK)
|
||||
|
@ -562,7 +562,7 @@ void initHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
|
|||
// init_adc_mcp3208(&adcState, &SPID2);
|
||||
// requestAdcValue(&adcState, 0);
|
||||
|
||||
turnOnHardware();
|
||||
turnOnHardware(PASS_ENGINE_PARAMETER_SIGNATURE);
|
||||
|
||||
#if EFI_HIP_9011
|
||||
initHip9011();
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
/*
|
||||
* @file test_change_engine_type.cpp
|
||||
*
|
||||
* @date Jul 14, 2021
|
||||
* @author Andrey Belomutskiy, (c) 2012-2021
|
||||
*/
|
||||
|
||||
#include "engine_test_helper.h"
|
||||
|
||||
TEST(misc, changeEngineType) {
|
||||
WITH_ENGINE_TEST_HELPER (FORD_ASPIRE_1996);
|
||||
|
||||
}
|
||||
|
|
@ -25,6 +25,7 @@ TESTS_SRC_CPP = \
|
|||
tests/lua/test_lua_basic.cpp \
|
||||
tests/lua/test_lua_hooks.cpp \
|
||||
tests/sensor/test_cj125.cpp \
|
||||
tests/test_change_engine_type.cpp \
|
||||
tests/util/test_timer.cpp \
|
||||
tests/system/test_periodic_thread_controller.cpp \
|
||||
tests/test_util.cpp \
|
||||
|
|
Loading…
Reference in New Issue