diff --git a/firmware/controllers/settings.cpp b/firmware/controllers/settings.cpp index 415d8f6b34..30ac467cd9 100644 --- a/firmware/controllers/settings.cpp +++ b/firmware/controllers/settings.cpp @@ -762,7 +762,8 @@ static void setTriggerSimulatorPin(const char *indexStr, const char *pinName) { } #if HAL_USE_ADC -// set_analog_input_pin pps +// set_analog_input_pin pps pa4 +// set_analog_input_pin afr none static void setAnalogInputPin(const char *sensorStr, const char *pinName) { brain_pin_e pin = parseBrainPin(pinName); if (pin == GPIO_INVALID) { @@ -780,6 +781,9 @@ static void setAnalogInputPin(const char *sensorStr, const char *pinName) { } else if (strEqual("pps", sensorStr)) { engineConfiguration->throttlePedalPositionAdcChannel = channel; scheduleMsg(&logger, "setting PPS to %s/%d", pinName, channel); + } else if (strEqual("afr", sensorStr)) { + engineConfiguration->afr.hwChannel = channel; + scheduleMsg(&logger, "setting AFR to %s/%d", pinName, channel); } else if (strEqual("clt", sensorStr)) { engineConfiguration->clt.adcChannel = channel; scheduleMsg(&logger, "setting CLT to %s/%d", pinName, channel); diff --git a/firmware/hw_layer/ports/stm32/stm32_common.cpp b/firmware/hw_layer/ports/stm32/stm32_common.cpp index 8ddadae2bc..ec10313095 100644 --- a/firmware/hw_layer/ports/stm32/stm32_common.cpp +++ b/firmware/hw_layer/ports/stm32/stm32_common.cpp @@ -117,6 +117,8 @@ adc_channel_e getAdcChannel(brain_pin_e pin) { return EFI_ADC_14; case GPIOC_5: return EFI_ADC_15; + case GPIO_UNASSIGNED: + return EFI_ADC_NONE; default: return EFI_ADC_ERROR; } @@ -164,4 +166,4 @@ bool isValidSerialRxPin(brain_pin_e pin) { return isValidUART6RxPin(pin); } -#endif /*EFI_AUX_SERIAL*/ \ No newline at end of file +#endif /*EFI_AUX_SERIAL*/