only:ADC mode argument is always the same FAST, renaming method

This commit is contained in:
rusefi 2024-07-22 19:28:17 -04:00
parent 86fef52d02
commit 8a98d21c00
4 changed files with 11 additions and 13 deletions

View File

@ -105,10 +105,10 @@ void setAdcChannelOverrides() {
// on Kinetis, ADC_FAST & SLOW are not really "fast" or "slow",
// they are just different ADC numbers with different sets of channels
removeChannel("VBatt", engineConfiguration->vbattAdcChannel);
addChannel("VBatt", engineConfiguration->vbattAdcChannel, ADC_FAST);
addFastAdcChannel("VBatt", engineConfiguration->vbattAdcChannel);
removeChannel("TPS", engineConfiguration->tps1_1AdcChannel);
addChannel("TPS", engineConfiguration->tps1_1AdcChannel, ADC_SLOW);
addFastAdcChannel("TPS", engineConfiguration->tps1_1AdcChannel);
}
#include <setjmp.h>

View File

@ -142,18 +142,16 @@ public:
}
};
void addChannel(const char*, adc_channel_e hwChannel, adc_channel_mode_e mode) {
void addFastAdcChannel(const char*, adc_channel_e hwChannel) {
if (!isAdcChannelValid(hwChannel)) {
return;
}
#if EFI_USE_FAST_ADC
if (mode == ADC_FAST) {
fastAdc.enableChannel(hwChannel);
}
fastAdc.enableChannel(hwChannel);
#endif
adcHwChannelMode[hwChannel] = mode;
adcHwChannelMode[hwChannel] = ADC_FAST;
// Nothing to do for slow channels, input is mapped to analog in init_sensors.cpp
}
@ -183,13 +181,13 @@ static void configureInputs() {
* which does not mean anything.
*/
addChannel("MAP", engineConfiguration->map.sensor.hwChannel, ADC_FAST);
addFastAdcChannel("MAP", engineConfiguration->map.sensor.hwChannel);
addChannel("HIP9011", engineConfiguration->hipOutputChannel, ADC_FAST);
addFastAdcChannel("HIP9011", engineConfiguration->hipOutputChannel);
// not currently used addChannel("Vref", engineConfiguration->vRefAdcChannel, ADC_SLOW);
// not currently used addFastAdcChannel("Vref", engineConfiguration->vRefAdcChannel, ADC_SLOW);
addChannel("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel, ADC_FAST);
addFastAdcChannel("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel);
setAdcChannelOverrides();
}

View File

@ -86,7 +86,7 @@ void printFullAdcReportIfNeeded(void);
int getInternalAdcValue(const char *msg, adc_channel_e index);
float getMCUInternalTemperature(void);
void addChannel(const char *name, adc_channel_e hwChannel, adc_channel_mode_e mode);
void addFastAdcChannel(const char *name, adc_channel_e hwChannel);
void removeChannel(const char *name, adc_channel_e hwChannel);
#define getAdcValue(msg, hwChannel) getInternalAdcValue(msg, hwChannel)

View File

@ -158,7 +158,7 @@ adc_channel_e getAdcChannelForTrigger(void) {
void addAdcChannelForTrigger(void) {
adc_channel_e channel = getAdcChannelForTrigger();
if (isAdcChannelValid(channel)) {
addChannel("TRIG", channel, ADC_FAST);
addFastAdcChannel("TRIG", channel);
}
}