/** * @file init_sensorss.cpp */ #include "pch.h" #include "init.h" #include "cli_registry.h" #include "io_pins.h" static void initSensorCli(); void initIfValid(const char* msg, adc_channel_e channel) { if (!isAdcChannelValid(channel)) { return; } #if EFI_PROD_CODE brain_pin_e pin = getAdcChannelBrainPin(msg, channel); efiSetPadMode(msg, pin, PAL_MODE_INPUT_ANALOG); #endif } void deInitIfValid(const char* msg, adc_channel_e channel) { if (!isAdcChannelValid(channel)) { return; } #if EFI_PROD_CODE brain_pin_e pin = getAdcChannelBrainPin(msg, channel); efiSetPadUnused(pin); #endif } static void initOldAnalogInputs() { initIfValid("AFR", engineConfiguration->afr.hwChannel); initIfValid("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel); initIfValid("CJ125 UR", engineConfiguration->cj125ur); initIfValid("CJ125 UA", engineConfiguration->cj125ua); } static void deInitOldAnalogInputs() { deInitIfValid("AFR", activeConfiguration.afr.hwChannel); deInitIfValid("AUXF#1", activeConfiguration.auxFastSensor1_adcChannel); deInitIfValid("CJ125 UR", activeConfiguration.cj125ur); deInitIfValid("CJ125 UA", activeConfiguration.cj125ua); } static void initAuxDigital() { for (size_t i = 0;iluaDigitalInputPins);i++) { efiSetPadMode("Lua Digital", engineConfiguration->luaDigitalInputPins[i], getInputMode(PI_DEFAULT)); } } static void deInitAuxDigital() { for (size_t i = 0;i(idx)); }); }