This commit is contained in:
rusefi 2020-05-21 22:33:48 -04:00
parent 780a613ba5
commit 09ff35918b
2 changed files with 8 additions and 2 deletions

View File

@ -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);

View File

@ -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*/
#endif /*EFI_AUX_SERIAL*/