parser rewrite prep: normalize config (#2741)

* cleanup 1

* cleanup 2

* impl

* fix
This commit is contained in:
Matthew Kennedy 2021-05-27 06:23:28 -06:00 committed by GitHub
parent 157732d5aa
commit 8ce2057a89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 55 additions and 65 deletions

View File

@ -40,8 +40,6 @@ typedef time_t efitimesec_t;
*/
typedef uint32_t efitimems_t;
typedef int pid_dt;
/**
* We use a signed type here so that subtraction result is a proper negative value.
* A typical use-case negative result is when we do 'timeNow() - timeOfEvent' where timeOfEvent
@ -123,12 +121,9 @@ typedef ignition_table_t angle_table_t;
typedef uint32_t cylinders_count_t;
typedef int32_t bool32_t;
typedef int16_t fsio_pwm_freq_t;
typedef float fsio_setting_t;
typedef float cfg_float_t_1f;
typedef brain_pin_e brain_input_pin_e;
typedef brain_pin_e switch_input_pin_e;

View File

@ -87,7 +87,7 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
angle_t ignitionPositionWithinEngineCycle = ENGINE(ignitionPositionWithinEngineCycle[event->cylinderIndex]);
assertAngleRange(ignitionPositionWithinEngineCycle, "aPWEC", CUSTOM_ERR_6566);
// this correction is usually zero (not used)
cfg_float_t_1f perCylinderCorrection = CONFIG(timing_offset_cylinder[event->cylinderIndex]);
float perCylinderCorrection = CONFIG(timing_offset_cylinder[event->cylinderIndex]);
const angle_t sparkAngle = -ENGINE(engineState.timingAdvance) + ignitionPositionWithinEngineCycle + perCylinderCorrection;
efiAssertVoid(CUSTOM_SPARK_ANGLE_9, !cisnan(sparkAngle), "findAngle#9");

View File

@ -524,21 +524,21 @@ end_struct
injector_s injector
bit isForcedInduction;
bit isForcedInduction
bit useFordRedundantTps;+On Ford vehicles one of the sensors is not linear on the full range, i.e. in the specific range of the positions we effectively have only one sensor.
bit isVerboseAuxPid1;
bit overrideTriggerGaps;
bit unused_294_4;
bit unused_294_5;
bit unused_294_6;
bit unused_294_7;
bit unused_294_8;
bit isVerboseAuxPid1
bit overrideTriggerGaps
bit unused_294_4
bit unused_294_5
bit unused_294_6
bit unused_294_7
bit unused_294_8
bit isCJ125Verbose;enable cj125verbose/disable cj125verbose
bit cj125isUaDivided;+Is your UA CJ125 output wired to MCU via resistor divider? Ua can go over 3.3v but only at lambda >3, i.e very lean AFR above 44.1\nWhen exposed to free air and 17x gain, Ua will be 4.17 volt
bit cj125isLsu49;
bit cj125isLsu49
bit etb_use_two_wires;+TLE7209 uses two-wire mode. TLE9201 and VNH2SP30 do NOT use two wire mode.
bit isDoubleSolenoidIdle;+Subaru/BMW style where default valve position is somewhere in the middle. First solenoid opens it more while second can close it more than default position.
bit showSdCardWarning;
bit showSdCardWarning
bit cj125isUrDivided;+Is your UR CJ125 output wired to MCU via resistor divider?\nLooks like 3v range should be enough, divider generally not needed.
bit useCicPidForIdle;+Switch between Industrial and Cic PID implementation
bit useTLE8888_cranking_hack;
@ -549,12 +549,12 @@ bit rollingLaunchEnabled;
bit antiLagEnabled;
bit useRunningMathForCranking,"Fuel Map","Fixed";+For cranking either use the specified fixed base fuel mass, or use the normal running math (VE table).
bit displayLogicLevelsInEngineSniffer;+Shall we display real life signal or just the part consumed by trigger decoder.\nenable logic_level_trigger
bit useTLE8888_stepper;
bit useTLE8888_stepper
bit enableMapEstimationTableFallback;+If enabled, the MAP estimate table will be used if the MAP sensor fails to estimate manifold pressure based on RPM and TPS.
bit useFSIOTableForCanSniffingFiltering;
bit issue_294_29;
bit issue_294_30;
bit issue_294_31,"si_example","nada_example";
bit useFSIOTableForCanSniffingFiltering
bit issue_294_29
bit issue_294_30
bit issue_294_31,"si_example","nada_example"
!todo: extract these two fields into a structure
@ -610,7 +610,7 @@ int sensorSnifferRpmThreshold;+Disable sensor sniffer above this rpm;"RPM",
custom engine_load_mode_e 4 bits, U32, @OFFSET@, [0:2], @@engine_load_mode_e_enum@@
engine_load_mode_e fuelAlgorithm;+This setting controls which fuel quantity control algorithm is used.
engine_load_mode_e fuelAlgorithm;+This setting controls which fuel quantity control algorithm is used.;
custom injection_mode_e 4 bits, U32, @OFFSET@, [0:1], "Simultaneous", "Sequential", "Batch", "Single Point"
@ -672,16 +672,13 @@ adc_channel_e fuelLevelSensor;+This is the processor pin that your fuel level se
struct trigger_config_s @brief Trigger wheel(s) configuration
custom bool32_t 4 bits, U32, @OFFSET@, [0:0], "false", "true"
#define trigger_type_e_enum "custom toothed wheel", "Ford Aspire", "Dodge Neon 1995", "Miata NA", "Miata NB", "GM_7X", "Cooper R50", "Mazda SOHC 4", "60/2", "36/1", "Honda 4+24+1", "Mitsubishi", "Honda 4+24", "Honda 1+4+24", "Dodge Neon 2003", "Mazda DOHC 1+4", "1+1", "INVALID", "Single Tooth", "Dodge Ram 1+16", "60/2 VW", "Honda 1+24", "Dodge Stratus", "36_2_2_2", "Nissan Primera", "dev 2JZ 3/34 simulator", "Rover K", "GM LS 24", "Honda CBR 600", "2JZ_1_12", "Honda CBR 600 custom", "3/1 skipped" , "Dodge Neon 2003 crank", "Miata VVT", "trg34", "trg35", "Subaru 7+6", "Jeep 18-2-2-2", "WIP", "Dodge Neon 1995 crank only", "Jeep XJ 4 cyl", "FiatIAQ_P8", "Mazda Z5", "trg43", "Renix 44-2-2", "Renix 66-2-2-2", "Honda K 12+1", "trg47", "36/2", "Subaru SVX", "1+16", "Subaru 7 without 6", "trg52", "TriTach", "GM 60/2/2/2", "Skoda Favorit", "Barra 3+1 Cam", "Kawa KX450F", "trg58", "trg59", "trg60", "INVALID"
custom trigger_type_e 4 bits, U32, @OFFSET@, [0:5], @@trigger_type_e_enum@@
trigger_type_e type;+https://github.com/rusefi/rusefi/wiki/All-Supported-Triggers\nset trigger_type X
bit todoRemoveMeOneDay0;
bit todoRemoveMeOneDay1;
bit todoRemoveMeOneDay0
bit todoRemoveMeOneDay1
bit useOnlyFirstChannel;+This option could be used if your second trigger channel is broken
int customTotalToothCount;;"number", 1, 0.0, 0, 500.0, 0
@ -726,10 +723,10 @@ air_pressure_sensor_config_s baroSensor;@see hasBaroSensor
struct idle_hardware_s
int solenoidFrequency;;"Hz", 1, 0, 0, 3000, 0
output_pin_e solenoidPin;
output_pin_e stepperDirectionPin;
output_pin_e stepperStepPin;
pin_output_mode_e solenoidPinMode;
output_pin_e solenoidPin
output_pin_e stepperDirectionPin
output_pin_e stepperStepPin
pin_output_mode_e solenoidPinMode
end_struct
struct dc_io
@ -844,10 +841,10 @@ bit is_enabled_spi_2
bit useSerialPort
bit useStepperIdle;+This setting should only be used if you have a stepper motor idle valve and a stepper motor driver installed.
bit enabledStep1Limiter;
bit useTpicAdvancedMode;
bit useLcdScreen;
bit verboseTLE8888;
bit enabledStep1Limiter
bit useTpicAdvancedMode
bit useLcdScreen
bit verboseTLE8888
bit enableVerboseCanTx;+CAN broadcast using custom rusEFI protocol\nenable can_broadcast/disable can_broadcast
bit onOffAlternatorLogic;+This will cause the alternator to be operated in a basic on or off mode, this is the simplest alternator control.
bit isCJ125Enabled;enable cj125/disable cj125
@ -912,7 +909,6 @@ custom uart_device_e 1 bits,U08, @OFFSET@, [0:1], "Off", "UART1", "UART2", "UA
output_pin_e acRelayPin;
pin_output_mode_e acRelayPinMode;
custom pid_dt 4 scalar, U32, @OFFSET@, "ms", 1, 0, 0, 3000, 0
custom fsio_pwm_freq_t 2 scalar, U16, @OFFSET@, "Hz", 1, 0, 0, 3000, 0
fsio_pwm_freq_t[FSIO_COMMAND_COUNT iterate] fsioFrequency;
@ -932,7 +928,7 @@ custom fsio_setting_t 4 scalar, F32, @OFFSET@, "Val", 1, 0, 0,
brain_pin_e spi3misoPin;
brain_pin_e spi3sckPin;
brain_pin_e cdmInputPin;+Saab Combustion Detection Module knock signal input pin\nalso known as Saab Ion Sensing Module
brain_pin_e cdmInputPin;+Saab Combustion Detection Module knock signal input pin\nalso known as Saab Ion Sensing Module;
brain_pin_e joystickCenterPin;
brain_pin_e joystickAPin;
@ -944,7 +940,7 @@ custom fsio_setting_t 4 scalar, F32, @OFFSET@, "Val", 1, 0, 0,
#define sensor_chart_e_enum "none", "trigger", "MAP", "RPM ACCEL", "DETAILED RPM", "Fast Aux1", "INVALID", "INVALID"
custom sensor_chart_e 4 bits, S32, @OFFSET@, [0:2], @@sensor_chart_e_enum@@
sensor_chart_e sensorChartMode;+rusEfi console Sensor Sniffer mode
sensor_chart_e sensorChartMode;+rusEfi console Sensor Sniffer mode;
#define maf_sensor_type_e_enum "v0", "v1", "v2", "v3"
@ -983,30 +979,30 @@ custom maf_sensor_type_e 4 bits, S32, @OFFSET@, [0:1], @@maf_sensor_type_e_enum@
bit enableInnovateLC2
bit showHumanReadableWarning
bit stftIgnoreErrorMagnitude;+If enabled, adjust at a constant rate instead of a rate proportional to the current lambda error. This mode may be easier to tune, and more tolerant of sensor noise. Use of this mode is required if you have a narrowband O2 sensor.
bit unused976b11;
bit unused976b11
bit enableSoftwareKnock
bit verboseVVTDecoding;enable vvt_details
bit invertCamVVTSignal;get invertCamVVTSignal
bit consumeObdSensors;+This property is useful if using rusEFI as TCM or BCM only\nenable consumeObdSensors
bit knockBankCyl1,"Channel 2","Channel 1";
bit knockBankCyl2,"Channel 2","Channel 1";
bit knockBankCyl3,"Channel 2","Channel 1";
bit knockBankCyl4,"Channel 2","Channel 1";
bit knockBankCyl5,"Channel 2","Channel 1";
bit knockBankCyl6,"Channel 2","Channel 1";
bit knockBankCyl7,"Channel 2","Channel 1";
bit knockBankCyl8,"Channel 2","Channel 1";
bit knockBankCyl9,"Channel 2","Channel 1";
bit knockBankCyl10,"Channel 2","Channel 1";
bit knockBankCyl11,"Channel 2","Channel 1";
bit knockBankCyl12,"Channel 2","Channel 1";
bit knockBankCyl1,"Channel 2","Channel 1"
bit knockBankCyl2,"Channel 2","Channel 1"
bit knockBankCyl3,"Channel 2","Channel 1"
bit knockBankCyl4,"Channel 2","Channel 1"
bit knockBankCyl5,"Channel 2","Channel 1"
bit knockBankCyl6,"Channel 2","Channel 1"
bit knockBankCyl7,"Channel 2","Channel 1"
bit knockBankCyl8,"Channel 2","Channel 1"
bit knockBankCyl9,"Channel 2","Channel 1"
bit knockBankCyl10,"Channel 2","Channel 1"
bit knockBankCyl11,"Channel 2","Channel 1"
bit knockBankCyl12,"Channel 2","Channel 1"
bit tcuEnabled
bit unusedBit_251_29
dc_io[ETB_COUNT iterate] etbIo
output_pin_e boostControlPin;+Wastegate control Solenoid
output_pin_e boostControlPin;+Wastegate control Solenoid;
pin_output_mode_e boostControlPinMode;
switch_input_pin_e antiLagActivatePin;
switch_input_pin_e launchActivatePin;
@ -1085,21 +1081,21 @@ bit cutFuelOnHardLimit,"yes","no"
bit cutSparkOnHardLimit,"yes","no"
bit launchFuelCutEnable
bit launchSparkCutEnable;+This is the Cut Mode normally used
bit hasFrequencyReportingMapSensor;
bit hasFrequencyReportingMapSensor
bit useFSIO8ForServo1
bit useFSIO9ForServo2
bit useFSIO10ForServo3
bit useFSIO11ForServo4
bit useFSIO12ForServo5
bit useFSIO15ForIdleRpmAdjustment;
bit useFSIO15ForIdleRpmAdjustment
bit useFSIO5ForCriticalIssueEngineStop;Sometimes we just have to shut the engine down. Use carefully!
bit useFSIO4ForSeriousEngineWarning;Sometimes we have to miss injection on purpose to attract driver's attention
bit useFSIO12ForIdleOffset;
bit useFSIO13ForIdleMinValue;
bit useFSIO6ForRevLimiter;
bit useFSIO12ForIdleOffset
bit useFSIO13ForIdleMinValue
bit useFSIO6ForRevLimiter
adc_channel_e hipOutputChannel;
switch_input_pin_e acSwitch; A/C button input
switch_input_pin_e acSwitch;A/C button input;
adc_channel_e vRefAdcChannel;
uint8_t etbNeutralPosition;+Expected neutral position;"%", 1, 0, 0, 100, 0
@ -1125,10 +1121,10 @@ custom idle_mode_e 4 bits, U32, @OFFSET@, [0:0], "Automatic", "Manual"
bit useFixedBaroCorrFromMap
bit useSeparateAdvanceForCranking,"Table (untapered)","Tapered Constant";+This activates a separate advance table for cranking conditions, this allows cranking advance to be RPM dependant.
bit useAdvanceCorrectionsForCranking;+This enables the various ignition corrections during cranking (IAT, CLT, FSIO and PID idle).
bit unused1476b19;
bit unused1476b20;
bit unused1476b19
bit unused1476b20
bit useIacPidMultTable;+This flag allows to use a special 'PID Multiplier' table (0.0-1.0) to compensate for nonlinear nature of IAC-RPM controller
bit isBoostControlEnabled;
bit isBoostControlEnabled
bit launchSmoothRetard;+Interpolates the Ignition Retard from 0 to 100% within the RPM Range
bit unused_1484_bit_24
bit unused_1484_bit_25
@ -1359,8 +1355,7 @@ tle8888_mode_e tle8888mode;
pid_s etbWastegatePid;
uint8_t[4] unused2536;;"units", 1, 0, -20, 100, 0
custom cfg_float_t_1f 4 scalar, F32, @OFFSET@, "Val", 1, 0, -20000000, 20000000, 1
cfg_float_t_1f[IGNITION_PIN_COUNT iterate] timing_offset_cylinder;per-cylinder timing correction
angle_t[IGNITION_PIN_COUNT iterate] timing_offset_cylinder;per-cylinder timing correction;"deg", 1, 0, -720, 720, 1
float idlePidActivationTime;;"seconds", 1, 0, 0, 60, 1
@ -1369,7 +1364,7 @@ tle8888_mode_e tle8888mode;
uint8_t[3] unusedSpiPadding4;;"units", 1, 0, -20, 100, 0
pin_mode_e spi1SckMode;
pin_mode_e spi1MosiMode;+Modes count be used for 3v<>5v integration using pull-ups/pull-downs etc.
pin_mode_e spi1MosiMode;+Modes count be used for 3v<>5v integration using pull-ups/pull-downs etc.;
pin_mode_e spi1MisoMode;
pin_mode_e spi2SckMode;
@ -1408,7 +1403,7 @@ tle8888_mode_e tle8888mode;
float[FSIO_CURVE_8] fsioCurve4Bins;;"x", 1, 0, -999, 1000.0, 3
float[FSIO_CURVE_8] fsioCurve4;;"y", 1, 0, -999, 1000.0, 3
brain_input_pin_e flexSensorPin;+Continental/GM flex fuel sensor, 50-150hz type
brain_input_pin_e flexSensorPin;+Continental/GM flex fuel sensor, 50-150hz type;
brain_pin_e test557pin
pin_output_mode_e stepperDirectionPinMode;
adc_channel_e externalKnockSenseAdc;