Aux analog inputs via CAN #3378

This commit is contained in:
rusefillc 2021-10-19 19:48:18 -04:00
parent 913187825d
commit 3a7013a72c
4 changed files with 36 additions and 15 deletions

View File

@ -69,6 +69,10 @@ typedef enum __attribute__ ((__packed__)) {
Aux2,
Aux3,
Aux4,
Aux5,
Aux6,
Aux7,
Aux8,
VehicleSpeed,

View File

@ -12,6 +12,10 @@ static FunctionalSensor auxSensors[] = {
{ SensorType::Aux2, MS2NT(50) },
{ SensorType::Aux3, MS2NT(50) },
{ SensorType::Aux4, MS2NT(50) },
{ SensorType::Aux5, MS2NT(50) },
{ SensorType::Aux6, MS2NT(50) },
{ SensorType::Aux7, MS2NT(50) },
{ SensorType::Aux8, MS2NT(50) },
};
static_assert(efi::size(auxSensors) == AUX_ANALOG_INPUT_COUNT);

View File

@ -75,7 +75,7 @@ struct_no_prefix engine_configuration_s
! see 'blockingFactor' in rusefi.ini
#define BLOCKING_FACTOR 256
#define AUX_ANALOG_INPUT_COUNT 4
#define AUX_ANALOG_INPUT_COUNT 8
#define FSIO_ANALOG_INPUT_COUNT 4
#define LUA_PWM_COUNT 8
@ -1380,7 +1380,7 @@ int16_t tps2Max;Full throttle#2. tpsMax value as 10 bit ADC value. Not Voltage!\
float[MAP_ACCEL_TAPER] mapAccelTaperBins;;"counter", 1, 0, 0, 300, 0
float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0, 300, 2
adc_channel_e[AUX_ANALOG_INPUT_COUNT iterate] fsioAdc;todo: rename to fsioAnalogInputs
float unusedAnotherOneOfThose;EGO value correction;"value", 1, 0, -10, 10, 2
float fixedTiming;Fixed timing, useful for TDC testing;"deg", 1, 0, -720, 720, 2
float mapLowValueVoltage;MAP voltage for low point;"v", 1, 0, 0, 10, 2
float mapHighValueVoltage;MAP voltage for low point;"v", 1, 0, 0, 10, 2
@ -1409,7 +1409,8 @@ float[MAP_ACCEL_TAPER] mapAccelTaperMult;;"mult", 1, 0, 0, 300, 2
vvt_mode_e[CAMS_PER_BANK iterate] vvtMode;set vvt_mode X
uint8_t[CAMS_PER_BANK_padding] vvtModePadding;;
uint8_t fan2ExtraIdle;+Additional idle % when fan #2 is active;"%", 1, 0, 0, 100, 0
uint8_t[9] unusedOldBiquad;;"units", 1, 0, -20, 100, 0
uint8_t[1] unusedOldBiquad;;"units", 1, 0, -20, 100, 0
adc_channel_e[AUX_ANALOG_INPUT_COUNT iterate] auxAnalogInputs;todo: rename to fsioAnalogInputs
output_pin_e[MAX_CYLINDER_COUNT iterate] trailingCoilPins;
float[CLT_TIMING_CURVE_SIZE] cltTimingBins;CLT-based timing correction;"C", 1, 0, -100, 250, 1

View File

@ -531,10 +531,14 @@ enable2ndByteCanID = false
requiresPowerCycle = fsioFrequency5
requiresPowerCycle = fsioFrequency6
requiresPowerCycle = fsioAdc1
requiresPowerCycle = fsioAdc2
requiresPowerCycle = fsioAdc3
requiresPowerCycle = fsioAdc4
requiresPowerCycle = auxAnalogInputs1
requiresPowerCycle = auxAnalogInputs2
requiresPowerCycle = auxAnalogInputs3
requiresPowerCycle = auxAnalogInputs4
requiresPowerCycle = auxAnalogInputs5
requiresPowerCycle = auxAnalogInputs6
requiresPowerCycle = auxAnalogInputs7
requiresPowerCycle = auxAnalogInputs8
readOnly = warning_message
@ -2412,10 +2416,14 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
panel = allPinsMC33
dialog = allPins1_3
field = "FSIO ADC #1", fsioAdc1
field = "FSIO ADC #2", fsioAdc2
field = "FSIO ADC #3", fsioAdc3
field = "FSIO ADC #4", fsioAdc4
field = "FSIO ADC #1", auxAnalogInputs1
field = "FSIO ADC #2", auxAnalogInputs2
field = "FSIO ADC #3", auxAnalogInputs3
field = "FSIO ADC #4", auxAnalogInputs4
field = "FSIO ADC #5", auxAnalogInputs5
field = "FSIO ADC #6", auxAnalogInputs6
field = "FSIO ADC #7", auxAnalogInputs7
field = "FSIO ADC #8", auxAnalogInputs8
field = "GPS RX", gps_rx_pin @@if_ts_show_gps
field = "GPS TX", gps_tx_pin @@if_ts_show_gps
field = "CAN RX pin", canRxPin @@if_ts_show_can_pins
@ -3315,10 +3323,14 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@\x00\x31\x00\x00"
field = "#6", fsioFormulas6
dialog = auxInputsDialog, "Aux inputs"
field = "ADC #1", fsioAdc1
field = "ADC #2", fsioAdc2
field = "ADC #3", fsioAdc3
field = "ADC #4", fsioAdc4
field = "ADC #1", auxAnalogInputs1
field = "ADC #2", auxAnalogInputs2
field = "ADC #3", auxAnalogInputs3
field = "ADC #4", auxAnalogInputs4
field = "ADC #5", auxAnalogInputs5
field = "ADC #6", auxAnalogInputs6
field = "ADC #7", auxAnalogInputs7
field = "ADC #8", auxAnalogInputs8
dialog = luaOutputs, "Lua Outputs"
field = "#Call startPwm to initialize, then call"