Skip to content

Commit

Permalink
Merge branch 'master' into fix_CP_in_OBD_error_assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
mi-hol committed Jul 17, 2023
2 parents 219fb46 + a8cbf0e commit 6d79d42
Show file tree
Hide file tree
Showing 175 changed files with 12,669 additions and 10,325 deletions.
2 changes: 2 additions & 0 deletions firmware/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ Release template (copy/paste this for new release):
### Fixed
- Improved bench test resolution (more usable for testing injectors, dwell, etc)
- Maximum knock retard table displays correct Y axis values in TunerStudio
- Make errors about fuel pressure sensors less aggressive #111 #117
- Always operate in "two wire" mode for batch fuel, fixing batch firing order #23

## May 2023 Release

Expand Down
2 changes: 1 addition & 1 deletion firmware/config/boards/proteus/proteus-base.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ ifneq ($(PROJECT_CPU),ARCH_STM32H7)
DDEFS += -DEFI_SOFTWARE_KNOCK=TRUE
endif

# disable hardware serial ports on H7
# serial ports only on F4
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
# Hardware serial port on UART 2 -> PD5/PD6
DDEFS += -DSTM32_UART_USE_USART2=TRUE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ struct engine_configuration_s {
bool useFordRedundantTps : 1 {};

// offset 88 bit 2
bool unused88b2 : 1 {};
bool lambdaProtectionEnable : 1 {};

// offset 88 bit 3
bool overrideTriggerGaps : 1 {};
Expand Down Expand Up @@ -1131,8 +1131,13 @@ struct engine_configuration_s {
// offset 640
scaled_channel<uint16_t, 1000, 1> fordInjectorSmallPulseSlope;

// RPM
// offset 642
uint8_t unused638[2];
scaled_channel<uint8_t, 1, 100> lambdaProtectionMinRpm;

// %
// offset 643
scaled_channel<uint8_t, 1, 10> lambdaProtectionMinLoad;

// offset 644 bit 0
bool is_enabled_spi_1 : 1 {};
Expand Down Expand Up @@ -1217,31 +1222,31 @@ struct engine_configuration_s {
bool enableAemXSeries : 1 {};

// offset 644 bit 23
bool unusedBit_195_23 : 1 {};
bool unusedBit_196_23 : 1 {};

// offset 644 bit 24
bool unusedBit_195_24 : 1 {};
bool unusedBit_196_24 : 1 {};

// offset 644 bit 25
bool unusedBit_195_25 : 1 {};
bool unusedBit_196_25 : 1 {};

// offset 644 bit 26
bool unusedBit_195_26 : 1 {};
bool unusedBit_196_26 : 1 {};

// offset 644 bit 27
bool unusedBit_195_27 : 1 {};
bool unusedBit_196_27 : 1 {};

// offset 644 bit 28
bool unusedBit_195_28 : 1 {};
bool unusedBit_196_28 : 1 {};

// offset 644 bit 29
bool unusedBit_195_29 : 1 {};
bool unusedBit_196_29 : 1 {};

// offset 644 bit 30
bool unusedBit_195_30 : 1 {};
bool unusedBit_196_30 : 1 {};

// offset 644 bit 31
bool unusedBit_195_31 : 1 {};
bool unusedBit_196_31 : 1 {};

// offset 648
brain_input_pin_e logicAnalyzerPins[LOGIC_ANALYZER_CHANNEL_COUNT];
Expand Down Expand Up @@ -1389,8 +1394,18 @@ struct engine_configuration_s {
// offset 746
uint16_t startCrankingDuration;

// %
// offset 748
uint8_t unused748[3];
scaled_channel<uint8_t, 1, 1> lambdaProtectionMinTps;

// Only respond once lambda is out of range for this period of time. Use to avoid transients triggering lambda protection when not needed
// s
// offset 749
scaled_channel<uint8_t, 10, 1> lambdaProtectionTimeout;

// RPM
// offset 750
scaled_channel<uint8_t, 1, 100> lambdaProtectionRestoreRpm;

// offset 751
pin_output_mode_e acRelayPinMode;
Expand Down Expand Up @@ -1537,13 +1552,13 @@ struct engine_configuration_s {
bool verboseCan2 : 1 {};

// offset 808 bit 29
bool unusedBit_288_29 : 1 {};
bool unusedBit_291_29 : 1 {};

// offset 808 bit 30
bool unusedBit_288_30 : 1 {};
bool unusedBit_291_30 : 1 {};

// offset 808 bit 31
bool unusedBit_288_31 : 1 {};
bool unusedBit_291_31 : 1 {};

// offset 812
dc_io etbIo[ETB_COUNT];
Expand Down Expand Up @@ -1851,10 +1866,8 @@ struct engine_configuration_s {
// offset 1200 bit 11
bool isManualSpinningMode : 1 {};

// This is needed if your coils are individually wired and you wish to use batch injection.
// enable two_wire_batch_injection
// offset 1200 bit 12
bool twoWireBatchInjection : 1 {};
bool unused1200b12 : 1 {};

// offset 1200 bit 13
bool neverInstantRpm : 1 {};
Expand Down Expand Up @@ -1921,10 +1934,10 @@ struct engine_configuration_s {
bool ALSActivateInverted : 1 {};

// offset 1200 bit 30
bool unusedBit_393_30 : 1 {};
bool unusedBit_396_30 : 1 {};

// offset 1200 bit 31
bool unusedBit_393_31 : 1 {};
bool unusedBit_396_31 : 1 {};

// count
// offset 1204
Expand Down Expand Up @@ -2231,96 +2244,101 @@ struct engine_configuration_s {
bool injectorFlowAsMassFlow : 1 {};

// offset 1436 bit 4
bool unusedBit_467_4 : 1 {};
bool unusedBit_470_4 : 1 {};

// offset 1436 bit 5
bool unusedBit_467_5 : 1 {};
bool unusedBit_470_5 : 1 {};

// offset 1436 bit 6
bool unusedBit_467_6 : 1 {};
bool unusedBit_470_6 : 1 {};

// offset 1436 bit 7
bool unusedBit_467_7 : 1 {};
bool unusedBit_470_7 : 1 {};

// offset 1436 bit 8
bool unusedBit_467_8 : 1 {};
bool unusedBit_470_8 : 1 {};

// offset 1436 bit 9
bool unusedBit_467_9 : 1 {};
bool unusedBit_470_9 : 1 {};

// offset 1436 bit 10
bool unusedBit_467_10 : 1 {};
bool unusedBit_470_10 : 1 {};

// offset 1436 bit 11
bool unusedBit_467_11 : 1 {};
bool unusedBit_470_11 : 1 {};

// offset 1436 bit 12
bool unusedBit_467_12 : 1 {};
bool unusedBit_470_12 : 1 {};

// offset 1436 bit 13
bool unusedBit_467_13 : 1 {};
bool unusedBit_470_13 : 1 {};

// offset 1436 bit 14
bool unusedBit_467_14 : 1 {};
bool unusedBit_470_14 : 1 {};

// offset 1436 bit 15
bool unusedBit_467_15 : 1 {};
bool unusedBit_470_15 : 1 {};

// offset 1436 bit 16
bool unusedBit_467_16 : 1 {};
bool unusedBit_470_16 : 1 {};

// offset 1436 bit 17
bool unusedBit_467_17 : 1 {};
bool unusedBit_470_17 : 1 {};

// offset 1436 bit 18
bool unusedBit_467_18 : 1 {};
bool unusedBit_470_18 : 1 {};

// offset 1436 bit 19
bool unusedBit_467_19 : 1 {};
bool unusedBit_470_19 : 1 {};

// offset 1436 bit 20
bool unusedBit_467_20 : 1 {};
bool unusedBit_470_20 : 1 {};

// offset 1436 bit 21
bool unusedBit_467_21 : 1 {};
bool unusedBit_470_21 : 1 {};

// offset 1436 bit 22
bool unusedBit_467_22 : 1 {};
bool unusedBit_470_22 : 1 {};

// offset 1436 bit 23
bool unusedBit_467_23 : 1 {};
bool unusedBit_470_23 : 1 {};

// offset 1436 bit 24
bool unusedBit_467_24 : 1 {};
bool unusedBit_470_24 : 1 {};

// offset 1436 bit 25
bool unusedBit_467_25 : 1 {};
bool unusedBit_470_25 : 1 {};

// offset 1436 bit 26
bool unusedBit_467_26 : 1 {};
bool unusedBit_470_26 : 1 {};

// offset 1436 bit 27
bool unusedBit_467_27 : 1 {};
bool unusedBit_470_27 : 1 {};

// offset 1436 bit 28
bool unusedBit_467_28 : 1 {};
bool unusedBit_470_28 : 1 {};

// offset 1436 bit 29
bool unusedBit_467_29 : 1 {};
bool unusedBit_470_29 : 1 {};

// offset 1436 bit 30
bool unusedBit_467_30 : 1 {};
bool unusedBit_470_30 : 1 {};

// offset 1436 bit 31
bool unusedBit_467_31 : 1 {};
bool unusedBit_470_31 : 1 {};

// Time between bench test pulses
// ms
// offset 1440
scaled_channel<uint8_t, 1, 5> benchTestOffTime;

// %
// offset 1441
uint8_t unused1445[2];
scaled_channel<uint8_t, 1, 1> lambdaProtectionRestoreTps;

// %
// offset 1442
scaled_channel<uint8_t, 1, 10> lambdaProtectionRestoreLoad;

// offset 1443
pin_input_mode_e launchActivatePinMode;
Expand Down Expand Up @@ -3800,6 +3818,17 @@ struct persistent_config_s {
// offset 22476
blend_table_s boostClosedLoopBlends[BOOST_BLEND_COUNT];

// lambda
// offset 22852
scaled_channel<uint8_t, 100, 1> lambdaMaxDeviationTable[4][4];

// offset 22868
uint16_t lambdaMaxDeviationLoadBins[4];

// RPM
// offset 22876
uint16_t lambdaMaxDeviationRpmBins[4];

};
static_assert(sizeof(persistent_config_s) == 22852);
static_assert(sizeof(persistent_config_s) == 22884);

Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@
#define PACK_PERCENT_BYTE_MULT 100.0
#define PEDAL_TO_TPS_SIZE 8
#define PERCENT_TRIM_BYTE_PACKING_DIV 0.02
#define persistent_config_s_size 22852
#define persistent_config_s_size 22884
#define pid_s_size 20
#define PidAutoTune_AutoTunerState_AUTOTUNER_OFF 0
#define PidAutoTune_AutoTunerState_CONVERGED 16
Expand Down Expand Up @@ -981,7 +981,7 @@
#define show_Frankenso_presets false
#define show_Proteus_presets false
#define show_test_presets false
#define SIGNATURE_HASH 1684310330
#define SIGNATURE_HASH 583617090
#define spi_device_e_auto_enum 0="SPI_NONE",1="SPI_DEVICE_1",2="SPI_DEVICE_2",3="SPI_DEVICE_3",4="SPI_DEVICE_4"
#define spi_device_e_SPI_DEVICE_1 1
#define spi_device_e_SPI_DEVICE_2 2
Expand Down Expand Up @@ -1027,7 +1027,7 @@
#define TOOTH_PACKET_SIZE 2
#define TOP_DEAD_CENTER_MESSAGE "r"
#define TORQUE_CURVE_SIZE 6
#define TOTAL_CONFIG_SIZE 22852
#define TOTAL_CONFIG_SIZE 22884
#define TPS_2_BYTE_PACKING_MULT 100
#define TPS_TPS_ACCEL_CLT_CORR_TABLE 4
#define TPS_TPS_ACCEL_TABLE 8
Expand Down Expand Up @@ -1248,12 +1248,12 @@
#define ts_show_vbatt true
#define ts_show_vr_threshold_2 true
#define ts_show_vr_threshold_all true
#define TS_SIGNATURE "rusEFI (FOME) master.2023.06.11.subaru_eg33_f7.1684310330"
#define TS_SIGNATURE "rusEFI (FOME) master.2023.07.09.subaru_eg33_f7.583617090"
#define TS_SINGLE_WRITE_COMMAND 'W'
#define TS_SINGLE_WRITE_COMMAND_char W
#define TS_TEST_COMMAND 't'
#define TS_TEST_COMMAND_char t
#define TS_TOTAL_OUTPUT_SIZE 1372
#define TS_TOTAL_OUTPUT_SIZE 1376
#define TS_TRIGGER_SCOPE_CHANNEL_1_NAME "Channel 1"
#define TS_TRIGGER_SCOPE_CHANNEL_2_NAME "Channel 2"
#define TS_TRIGGER_SCOPE_DISABLE 5
Expand Down
2 changes: 1 addition & 1 deletion firmware/config/engines/chevrolet_camaro_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void setCamaro4() {
engineConfiguration->triggerInputPins[1] = Gpio::C6;

engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->twoWireBatchInjection = true;

// set ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;

Expand Down
4 changes: 0 additions & 4 deletions firmware/config/engines/dodge_neon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ void setDodgeNeon1995EngineConfiguration() {
// set injection_mode 1
engineConfiguration->injectionMode = IM_SEQUENTIAL;

// this is needed for injector lag auto-tune research if switching to batch
// enable two_wire_batch_injection
engineConfiguration->twoWireBatchInjection = true;

// set ignition_mode 2
engineConfiguration->ignitionMode = IM_WASTED_SPARK;
// set_firing_order 2
Expand Down
2 changes: 0 additions & 2 deletions firmware/config/engines/ford_1995_inline_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ void setFordInline6() {
engineConfiguration->firingOrder = FO_1_5_3_6_2_4;
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
engineConfiguration->injectionMode = IM_BATCH;
engineConfiguration->twoWireBatchInjection = true;


/**
* 0.5ms dwell time just to be sure it would fit within camshaft revolution, dwell is not controlled by us anyway
Expand Down
4 changes: 0 additions & 4 deletions firmware/config/engines/gm_ls_4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
void setGmLs4() {
engineConfiguration->globalTriggerAngleOffset = 86;

// would not hurt just in case no cam
engineConfiguration->twoWireBatchInjection = true;


engineConfiguration->fuelReferencePressure = 400; // 400 kPa, 58 psi
engineConfiguration->injectorCompensationMode = ICM_FixedRailPressure;
engineConfiguration->injector.flow = 440;
Expand Down
3 changes: 0 additions & 3 deletions firmware/config/engines/mazda_miata_1_6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,6 @@ void setMiataNA6_MAP_MRE() {

engineConfiguration->fuelPumpPin = Gpio::Unassigned;


engineConfiguration->twoWireBatchInjection = true;

engineConfiguration->useIacTableForCoasting = true;
engineConfiguration->idlePidDeactivationTpsThreshold = 90;

Expand Down
2 changes: 0 additions & 2 deletions firmware/config/engines/mazda_miata_vvt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,6 @@ void setMazdaMiata2003EngineConfiguration() {

// engineConfiguration->is_enabled_spi_1 = true;

engineConfiguration->twoWireBatchInjection = true; // this is needed for #492 testing

engineConfiguration->alternatorControlPin = Gpio::E10;
engineConfiguration->alternatorControlPinMode = OM_OPENDRAIN;

Expand Down
Loading

0 comments on commit 6d79d42

Please sign in to comment.