Skip to content

Commit

Permalink
dead feature: sensor chart fast ADC
Browse files Browse the repository at this point in the history
  • Loading branch information
mck1117 committed Nov 8, 2024
1 parent 258852f commit 6b26a4e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 52 deletions.
1 change: 0 additions & 1 deletion firmware/controllers/algo/rusefi_enums.h
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ typedef enum __attribute__ ((__packed__)) {
// unused 2
SC_RPM_ACCEL = 3,
SC_DETAILED_RPM = 4,
SC_AUX_FAST1 = 5,

} sensor_chart_e;

Expand Down
7 changes: 0 additions & 7 deletions firmware/hw_layer/hardware.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,6 @@ void onFastAdcComplete(adcsample_t*) {
adcToVoltsDivided(getFastAdc(fastMapSampleIndex), engineConfiguration->map.sensor.hwChannel)
);
#endif // MODULE_MAP_AVERAGING

#if EFI_SENSOR_CHART && EFI_SHAFT_POSITION_INPUT
if (getEngineState()->sensorChartMode == SC_AUX_FAST1) {
float voltage = getAdcValue("fAux1", engineConfiguration->auxFastSensor1_adcChannel);
scAddData(engine->triggerCentral.getCurrentEnginePhase(getTimeNowNt()).value_or(0), voltage);
}
#endif /* EFI_SENSOR_CHART */
}
#endif /* HAL_USE_ADC */

Expand Down
41 changes: 0 additions & 41 deletions firmware/init/sensor/init_sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,6 @@

static void initSensorCli();

void initIfValid(const char* msg, adc_channel_e channel) {
if (!isAdcChannelValid(channel)) {
return;
}

#if EFI_PROD_CODE
/**
TODO: this code is similar to AdcSubscription::SubscribeSensor, what is the plan? shall we extract helper method or else?
*/

brain_pin_e pin = getAdcChannelBrainPin(msg, channel);
if (pin == Gpio::Invalid) {
// todo: external muxes for internal ADC #3350
return;
}
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("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel);
}

static void deInitOldAnalogInputs() {
deInitIfValid("AUXF#1", activeConfiguration.auxFastSensor1_adcChannel);
}

static void initAuxDigital() {
#if EFI_PROD_CODE
for (size_t i = 0; i < efi::size(engineConfiguration->luaDigitalInputPins); i++) {
Expand Down Expand Up @@ -93,7 +55,6 @@ void initNewSensors() {

void stopSensors() {
deInitAuxDigital();
deInitOldAnalogInputs();

deinitTps();
deinitFluidPressure();
Expand Down Expand Up @@ -121,8 +82,6 @@ void reconfigureSensors() {
initVehicleSpeedSensor();
initTurbochargerSpeedSensor();
initInputShaftSpeedSensor();

initOldAnalogInputs();
}

// Mocking/testing helpers
Expand Down
4 changes: 2 additions & 2 deletions firmware/integration/rusefi_config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ switch_input_pin_e clutchDownPin;Some cars have a switch to indicate that clutch
Gpio mc33972_cs;
pin_output_mode_e mc33972_csPinMode;

adc_channel_e auxFastSensor1_adcChannel;Useful in Research&Development phase
uint8_t unused581
adc_channel_e tps1_2AdcChannel;First throttle body, second sensor.
adc_channel_e tps2_2AdcChannel;Second throttle body, second sensor.

Expand Down Expand Up @@ -807,7 +807,7 @@ custom script_setting_t 4 scalar, F32, @OFFSET@, "", 1, 0, 0, 18000, 2
uart_device_e consoleUartDevice;


#define sensor_chart_e_enum "none", "trigger", "INVALID", "RPM ACCEL", "DETAILED RPM", "Fast Aux1"
#define sensor_chart_e_enum "none", "trigger", "INVALID", "RPM ACCEL", "DETAILED RPM", "INVALID"
custom sensor_chart_e 1 bits, S08, @OFFSET@, [0:2], @@sensor_chart_e_enum@@
sensor_chart_e sensorChartMode;FOME console sensor sniffer mode;

Expand Down
1 change: 0 additions & 1 deletion firmware/tunerstudio/tunerstudio.template.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2910,7 +2910,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "A/C Switch", acSwitch
field = "Aux Temperature #1", auxTempSensor1_adcChannel
field = "Aux Temperature #2", auxTempSensor2_adcChannel
field = "Aux Fast Analog", auxFastSensor1_adcChannel

dialog = allPinsMC33, "MC33816"
field = "Chip Select", mc33816_cs
Expand Down

0 comments on commit 6b26a4e

Please sign in to comment.