Merge remote-tracking branch 'origin/master' into perf-tracing

This commit is contained in:
Matthew Kennedy 2019-11-19 16:28:58 -08:00
commit 93d24dfc0b
240 changed files with 26430 additions and 1583 deletions

View File

@ -35,12 +35,12 @@ endif
# Compiler options here.
ifeq ($(USE_OPT),)
USE_OPT = $(EXTRA_PARAMS) $(DEBUG_LEVEL_OPT) $(RFLAGS) -Wno-error=implicit-fallthrough -Wno-error=bool-operation -fomit-frame-pointer -falign-functions=16 -Werror-implicit-function-declaration -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Werror=missing-field-initializers -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes
USE_OPT = $(EXTRA_PARAMS) $(DEBUG_LEVEL_OPT) $(RFLAGS) -Wno-error=implicit-fallthrough -Wno-error=bool-operation -fomit-frame-pointer -falign-functions=16 -Werror -Wno-error=pointer-sign -Wno-error=unused-function -Wno-error=unused-variable -Wno-error=sign-compare -Wno-error=unused-parameter -Werror=missing-field-initializers -Werror=type-limits -Wno-error=strict-aliasing -Wno-error=attributes
endif
# C specific options here (added to USE_OPT).
ifeq ($(USE_COPT),)
USE_COPT = -fgnu89-inline -std=gnu99
USE_COPT = -fgnu89-inline -std=gnu99 -Werror-implicit-function-declaration
endif
# C++ specific options here (added to USE_OPT).

46
firmware/build-notes.txt Normal file
View File

@ -0,0 +1,46 @@
This directory contains the source code for the RusEFI firmware.
The ideal is that typical end users should be able to use pre-built
firmware. They should not need to modify or even rebuild from the
source code for basic use, but building from the source code provides
the opportunity for optimization, supporting unexpected engine
configurations, and specialized enhancements.
TL;DR
make PROJECT_BOARD=microrusefi PROJECT_CPU=ARCH_STM32F4
Environment
Rebuilding from source code requires this firmware, a modern C/C++
compiler for embedded ARM systems, and a platform that supports 'make'
based builds.
While many compilers have the potential to work, we suggest using the
official ARM version of GCC available at launchpad.net.
Linux and MacOS systems should have the software development tools,
primarily 'make', pre-installed or readily installed. MS-Windows
requires selecting and installing a Unix-compatible system environment.
Note that the developers are volunteers, with varied motivations.
These motivations often include using leading-edge language and build
system concepts, requiring recent versions of tools. Should you
encounter build problems, review the latest version of this document.
Expected Future Changes
The firmware build is moving toward a system that separates board
features from processor features. This will require specifying both
the board type and specific processor.
The existing system evolved based on the original RusEFI boards which
used 'STM32 Discovery' development boards plugged into base boards
that held the ECU specific chips. That resulted in hard-coded
assumption about pin assignments, and associations of hardware with a
specific processor variant. That legacy is slowly being cleaned up,
but is still evident in some settings and limitations.

View File

@ -44,7 +44,6 @@ MEMORY
ram5 : org = 0x00000000, len = 0
ram6 : org = 0x00000000, len = 0
ram7 : org = 0x00000000, len = 0
config : org = 0x00075000, len = 0xB000
}
/* Flash region for the configuration bytes.*/
@ -58,14 +57,6 @@ SECTIONS
{
KEEP(*(.cfmconfig))
} > flash1b
.config : ALIGN(4)
{
. = ALIGN(4);
*(.config)
*(.config.*)
. = ALIGN(4);
} > config AT > config
}
/* For each data/text section two region are defined, a virtual region

View File

@ -280,7 +280,7 @@ void gpt_lld_start(GPTDriver *gptp) {
/* Clock activation.*/
SIM->SCGC6 |= SIM_SCGC6_PIT;
#endif
gptp->clock = KINETIS_SYSCLK_FREQUENCY;
gptp->clock = KINETIS_SPLL_DIV2_FREQENCY/*KINETIS_SYSCLK_FREQUENCY*/;
#if !KINETIS_HAS_PIT_COMMON_IRQ

View File

@ -55,8 +55,9 @@ SPIDriver SPID2;
/* Driver local functions. */
/*===========================================================================*/
static int32_t spi_detectPCS(bool isMaster, ioportid_t ssport, uint16_t sspad) {
static int32_t spi_detectPCS(bool isMaster, ioportid_t ssport, uint16_t sspad, int *alt) {
// todo: check if PCS corresponds to SPI number
*alt = 3;
if (ssport == GPIOA) {
switch (sspad) {
case 6:
@ -78,9 +79,11 @@ static int32_t spi_detectPCS(bool isMaster, ioportid_t ssport, uint16_t sspad) {
} else if (ssport == GPIOD && sspad == 3) {
return isMaster ? kLPSPI_MasterPcs0 : kLPSPI_SlavePcs0;
} else if (ssport == GPIOE && sspad == 6) {
*alt = 2;
return isMaster ? kLPSPI_MasterPcs2 : kLPSPI_SlavePcs2;
}
// wrong/unrecognized PCS!
*alt = 0;
return -1;
}
@ -165,9 +168,17 @@ void spi_lld_start(SPIDriver *spip) {
#endif
spip->isMaster = (spip->config->cr1 & SPI_CR1_MSTR) != 0;
int pcsIdx = spi_detectPCS(spip->isMaster, spip->config->ssport, spip->config->sspad);
osalDbgAssert(pcsIdx >= 0, "invalid SPI PCS pin");
spip->flags = pcsIdx; // kLPSPI_MasterByteSwap;
spip->flags = 0; // kLPSPI_MasterByteSwap;
int pcsAlt;
int pcsIdx = spi_detectPCS(spip->isMaster, spip->config->ssport, spip->config->sspad, &pcsAlt);
if (pcsIdx >= 0) {
spip->flags |= pcsIdx;
// enable corresponding alt.mode for hardware PCS control
palSetPadMode(spip->config->ssport, spip->config->sspad, PAL_MODE_ALTERNATE(pcsAlt));
} else {
// software PCS control for non-standard pins
palSetPadMode(spip->config->ssport, spip->config->sspad, PAL_MODE_OUTPUT_OPENDRAIN);
}
//CLOCK_SetIpSrc(clockName, kCLOCK_IpSrcSysPllAsync);
@ -245,8 +256,9 @@ void spi_lld_stop(SPIDriver *spip) {
* @notapi
*/
void spi_lld_select(SPIDriver *spip) {
//palClearPad(spip->config->ssport, spip->config->sspad);
// software PCS control for non-standard pins
if (!(spip->flags & LPSPI_MASTER_PCS_MASK))
palClearPad(spip->config->ssport, spip->config->sspad);
}
/**
@ -258,8 +270,9 @@ void spi_lld_select(SPIDriver *spip) {
* @notapi
*/
void spi_lld_unselect(SPIDriver *spip) {
//palSetPad(spip->config->ssport, spip->config->sspad);
// software PCS control for non-standard pins
if (!(spip->flags & LPSPI_MASTER_PCS_MASK))
palSetPad(spip->config->ssport, spip->config->sspad);
}
/**

View File

@ -203,7 +203,14 @@ void uart_lld_start(UARTDriver *uartp) {
}
#endif
// Enable UART
LPUART_Init(uartp->lpuart, &lpuartConfig, KINETIS_UART_FREQUENCY);
status_t status = LPUART_Init(uartp->lpuart, &lpuartConfig, KINETIS_UART_FREQUENCY);
if (status == kStatus_LPUART_BaudrateNotSupport) {
// the only reason we could fail is wrong 'baudRate_Bps'. So let's give it a second chance...
static const int defaultBaudRate = 115200;
lpuartConfig.baudRate_Bps = defaultBaudRate;
status = LPUART_Init(uartp->lpuart, &lpuartConfig, KINETIS_UART_FREQUENCY);
assert (status == kStatus_Success);
}
//LPUART_EnableInterrupts(uartp->lpuart, kLPUART_IdleLineInterruptEnable);

View File

@ -797,6 +797,9 @@ extern "C"
#ifndef __ASSEMBLER__
#ifdef __cplusplus
extern "C"
#endif
void chDbgPanic3(const char *msg, const char * file, int line);
#endif

View File

@ -5,7 +5,11 @@ rem the storage section of rusefi.ini is updated as well
cd ../../../..
java -cp ../java_tools/ConfigDefinition.jar;../java_tools/configuration_definition/lib/snakeyaml.jar ^
pwd
java ^
-DSystemOut.name=gen_config ^
-cp ../java_tools/ConfigDefinition.jar;../java_tools/configuration_definition/lib/snakeyaml.jar ^
com.rusefi.board_generator.BoardReader ^
-board kinetis ^
-firmware_path . ^
@ -13,7 +17,11 @@ java -cp ../java_tools/ConfigDefinition.jar;../java_tools/configuration_definiti
-enumInputFile controllers/algo/rusefi_enums.h ^
-enumInputFile config/boards/kinetis/rusefi_hw_enums.h
java -jar ../java_tools/ConfigDefinition.jar ^
mkdir build_kinetis
java ^
-DSystemOut.name=gen_config ^
-jar ../java_tools/ConfigDefinition.jar ^
-definition integration/rusefi_config.txt ^
-ts_destination tunerstudio ^
-ts_output_name rusefi_kinetis.ini ^

View File

@ -569,8 +569,8 @@ case FRANKENSO_QA_ENGINE:
return "FRANKENSO_QA_ENGINE";
case Force_4_bytes_size_engine_type:
return "Force_4_bytes_size_engine_type";
case GEO_STORM:
return "GEO_STORM";
case BMW_M73_F:
return "BMW_M73_F";
case MRE_BOARD_TEST:
return "MRE_BOARD_TEST";
case GY6_139QMB:
@ -605,8 +605,8 @@ case MIATA_1990:
return "MIATA_1990";
case MIATA_1994_DEVIATOR:
return "MIATA_1994_DEVIATOR";
case MIATA_1994_SPAGS:
return "MIATA_1994_SPAGS";
case BMW_M73_M:
return "BMW_M73_M";
case MIATA_1996:
return "MIATA_1996";
case MIATA_NA6_MAP:

View File

@ -2,6 +2,8 @@
// was generated automatically by rusEfi tool ConfigDefinition.jar based on integration/rusefi_config.txt
//
#define absoluteFuelPressure_offset 76
#define absoluteFuelPressure_offset_hex 4c
#define accelerometerSpiDevice_offset 2712
#define accelerometerSpiDevice_offset_hex a98
#define acCutoffHighRpm_offset 1494
@ -55,6 +57,10 @@
#define alFIn_offset_hex fb8
#define alignEngineSnifferAtTDC_offset 744
#define alignEngineSnifferAtTDC_offset_hex 2e8
#define alternator_antiwindupFreq_offset 1764
#define alternator_antiwindupFreq_offset_hex 6e4
#define alternator_derivativeFilterLoss_offset 1760
#define alternator_derivativeFilterLoss_offset_hex 6e0
#define alternatorControl_dFactor_offset 1724
#define alternatorControl_dFactor_offset_hex 6bc
#define alternatorControl_iFactor_offset 1720
@ -79,6 +85,8 @@
#define alternatorOffAboveTps_offset_hex 7ec
#define alternatorPwmFrequency_offset 2256
#define alternatorPwmFrequency_offset_hex 8d0
#define ambiguousOperationMode_offset 488
#define ambiguousOperationMode_offset_hex 1e8
#define analogInputDividerCoefficient_offset 460
#define analogInputDividerCoefficient_offset_hex 1cc
#define autoTuneCltThreshold_offset 2420
@ -255,8 +263,6 @@
#define biQuad_offset 2332
#define biQuad_offset_hex 91c
#define BLOCKING_FACTOR 400
#define boardTestModeJumperPin_offset 676
#define boardTestModeJumperPin_offset_hex 2a4
#define boostCutPressure_offset 2132
#define boostCutPressure_offset_hex 854
#define brain_input_pin_e_enum "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "N/A", "N/A", "PA10", "PA11", "PA12", "PA13", "N/A", "N/A", "N/A", "N/A", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "N/A", "N/A", "N/A", "N/A", "PB12", "PB13", "N/A", "N/A", "N/A", "N/A", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "N/A", "N/A", "N/A", "N/A", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "PD15", "PD16", "N/A", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A"
@ -301,6 +307,8 @@
#define cj125isLsu49_offset_hex 4c
#define cj125isUaDivided_offset 76
#define cj125isUaDivided_offset_hex 4c
#define cj125isUrDivided_offset 76
#define cj125isUrDivided_offset_hex 4c
#define cj125SpiDevice_offset 2224
#define cj125SpiDevice_offset_hex 8b0
#define cj125ua_offset 2609
@ -364,8 +372,14 @@
#define clutchUpPinInverted_offset_hex 3d0
#define clutchUpPinMode_offset 971
#define clutchUpPinMode_offset_hex 3cb
#define CMD_CALIBRATE_PEDAL_DOWN "calibrate_pedal_down"
#define CMD_CALIBRATE_PEDAL_UP "calibrate_pedal_up"
#define CMD_DATE "date"
#define CMD_DISABLE "disable"
#define CMD_ENABLE "enable"
#define CMD_ETB_DUTY "set_etb_duty"
#define CMD_REBOOT "reboot"
#define CMD_REBOOT_DFU "reboot_dfu"
#define CMD_TRIGGER_HW_INPUT "trigger_hw_input"
#define CMD_TRIGGERINFO "triggerinfo"
#define CMD_WRITECONFIG "writeconfig"
@ -438,6 +452,12 @@
#define debug_mode_e_enum "Alternator PID", "TPS acceleration enrichment", "INVALID", "Idle Control", "Engine Load accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT input", "Cranking", "Timing", "Closed-loop fuel corr PID", "VSS", "SD card", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test / TS commands", "Aux Valves", "Analog inputs #1", "INSTANT_RPM", "FSIO_EXPRESSION", "Status", "CJ125", "CAN", "MAP", "Metrics", "ETB#2", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "Aux Temperature", "ETB Logic"
#define debugMode_offset 2092
#define debugMode_offset_hex 82c
#define debugSetTimer_offset 806
#define debugSetTimer_offset_hex 326
#define debugTimerCallback_offset 711
#define debugTimerCallback_offset_hex 2c7
#define debugTriggerSync_offset 676
#define debugTriggerSync_offset_hex 2a4
#define DIGIPOT_COUNT 4
#define digitalPotentiometerChipSelect1_offset 668
#define digitalPotentiometerChipSelect1_offset_hex 29c
@ -490,8 +510,8 @@
#define engineType_offset_hex 0
#define etb1_controlPin1_offset 682
#define etb1_controlPin1_offset_hex 2aa
#define etb1_controlPin2_offset 683
#define etb1_controlPin2_offset_hex 2ab
#define etb1_controlPinMode_offset 683
#define etb1_controlPinMode_offset_hex 2ab
#define etb1_directionPin1_offset 680
#define etb1_directionPin1_offset_hex 2a8
#define etb1_directionPin2_offset 681
@ -502,8 +522,8 @@
#define etb1_use_two_wires_offset_hex 4c
#define etb2_controlPin1_offset 3966
#define etb2_controlPin1_offset_hex f7e
#define etb2_controlPin2_offset 3967
#define etb2_controlPin2_offset_hex f7f
#define etb2_controlPinMode_offset 3967
#define etb2_controlPinMode_offset_hex f7f
#define etb2_directionPin1_offset 3964
#define etb2_directionPin1_offset_hex f7c
#define etb2_directionPin2_offset 3965
@ -537,6 +557,8 @@
#define etbBiasBins_offset_hex f30
#define etbBiasValues_offset 3920
#define etbBiasValues_offset_hex f50
#define etbCalibrationOnStart_offset 1476
#define etbCalibrationOnStart_offset_hex 5c4
#define etbDeadband_offset 3960
#define etbDeadband_offset_hex f78
#define etbFreq_offset 2514
@ -545,6 +567,8 @@
#define etbIdleRange_offset_hex 3cc
#define etbIdleThrottleRange_offset 4012
#define etbIdleThrottleRange_offset_hex fac
#define etbNeutralPosition_offset 1471
#define etbNeutralPosition_offset_hex 5bf
#define externalKnockSenseAdc_offset 3103
#define externalKnockSenseAdc_offset_hex c1f
#define extraInjectionOffset_offset 432
@ -557,16 +581,12 @@
#define fanPin_offset_hex 297
#define fanPinMode_offset 662
#define fanPinMode_offset_hex 296
#define fatalErrorPin_offset 2040
#define fatalErrorPin_offset_hex 7f8
#define firingOrder_offset 404
#define firingOrder_offset_hex 194
#define fixedModeTiming_offset 452
#define fixedModeTiming_offset_hex 1c4
#define fixedTiming_offset 2204
#define fixedTiming_offset_hex 89c
#define flexFuelSensor_offset 3100
#define flexFuelSensor_offset_hex c1c
#define frequencyReportingMapInputPin_offset 970
#define frequencyReportingMapInputPin_offset_hex 3ca
#define FSIO_ANALOG_INPUT_COUNT 4
@ -858,6 +878,8 @@
#define fuelPumpPin_offset_hex 292
#define fuelPumpPinMode_offset 659
#define fuelPumpPinMode_offset_hex 293
#define fuelRailPressure_offset 1756
#define fuelRailPressure_offset_hex 6dc
#define fuelRpmBins_offset 16224
#define fuelRpmBins_offset_hex 3f60
#define fuelTable_offset 15136
@ -867,6 +889,8 @@
#define GAUGE_NAME_ACCEL_Y "Acceleration: Y"
#define GAUGE_NAME_ACCEL_Z "Acceleration: Z"
#define GAUGE_NAME_AFR "Air/Fuel Ratio"
#define GAUGE_NAME_AIR_FLOW "air flow"
#define GAUGE_NAME_AIR_MASS "air mass"
#define GAUGE_NAME_CPU_TEMP "CPU Temperature"
#define GAUGE_NAME_DEBUG_F1 "debug f1"
#define GAUGE_NAME_DEBUG_F2 "debug f2: iTerm"
@ -883,6 +907,10 @@
#define GAUGE_NAME_DWELL_DUTY "dwell: coil duty cycle"
#define GAUGE_NAME_ECU_TEMPERATURE "ECU temperature"
#define GAUGE_NAME_ENGINE_LOAD "Engine Load"
#define GAUGE_NAME_ETB_DUTY "ETB duty cycle"
#define GAUGE_NAME_ETB_ERROR "ETB position error"
#define GAUGE_NAME_ETB_TARGET "ETB position target"
#define GAUGE_NAME_FUEL_BARO_CORR "fuel: Barometric pressure correction"
#define GAUGE_NAME_FUEL_BASE "fuel: base"
#define GAUGE_NAME_FUEL_CHARGE_TEMP "fuel: Estimated charge temperature"
#define GAUGE_NAME_FUEL_CLT_CORR "fuel: CLT correction"
@ -904,6 +932,7 @@
#define GAUGE_NAME_KNOCK_LEVEL "knock: current level"
#define GAUGE_NAME_TARGET_AFR "fuel: target AFR"
#define GAUGE_NAME_TCHARGE "fuel: SD tCharge"
#define GAUGE_NAME_THROTTLE_PEDAL "Throttle pedal position"
#define GAUGE_NAME_TIMING_ADVANCE "timing"
#define GAUGE_NAME_VBAT "VBatt"
#define GAUGE_NAME_VERSION "firmware"
@ -992,12 +1021,19 @@
#define hipOutputChannel_offset 1468
#define hipOutputChannel_offset_hex 5bc
#define HW_MAX_ADC_INDEX 17
#define IAC_PID_MULT_SIZE 8
#define iacByTpsTaper_offset 2038
#define iacByTpsTaper_offset_hex 7f6
#define iacCoasting_offset 3224
#define iacCoasting_offset_hex c98
#define iacCoastingBins_offset 3160
#define iacCoastingBins_offset_hex c58
#define iacPidMultLoadBins_offset 4124
#define iacPidMultLoadBins_offset_hex 101c
#define iacPidMultRpmBins_offset 4132
#define iacPidMultRpmBins_offset_hex 1024
#define iacPidMultTable_offset 4060
#define iacPidMultTable_offset_hex fdc
#define iat_adcChannel_offset 312
#define iat_adcChannel_offset_hex 138
#define iat_alignmentFill_offset 313
@ -1057,10 +1093,30 @@
#define idlePidRpmDeadZone_offset_hex 766
#define idlePidRpmUpperLimit_offset 1484
#define idlePidRpmUpperLimit_offset_hex 5cc
#define idleRpmPid2_dFactor_offset 4048
#define idleRpmPid2_dFactor_offset_hex fd0
#define idleRpmPid2_iFactor_offset 4044
#define idleRpmPid2_iFactor_offset_hex fcc
#define idleRpmPid2_maxValue_offset 4058
#define idleRpmPid2_maxValue_offset_hex fda
#define idleRpmPid2_minValue_offset 4056
#define idleRpmPid2_minValue_offset_hex fd8
#define idleRpmPid2_offset 4040
#define idleRpmPid2_offset_hex fc8
#define idleRpmPid2_offset_offset 4052
#define idleRpmPid2_offset_offset_hex fd4
#define idleRpmPid2_periodMs_offset 4054
#define idleRpmPid2_periodMs_offset_hex fd6
#define idleRpmPid2_pFactor_offset 4040
#define idleRpmPid2_pFactor_offset_hex fc8
#define idleRpmPid_dFactor_offset 1796
#define idleRpmPid_dFactor_offset_hex 704
#define idleRpmPid_iFactor_offset 1792
#define idleRpmPid_iFactor_offset_hex 700
#define idlerpmpid_iTermMax_offset 4006
#define idlerpmpid_iTermMax_offset_hex fa6
#define idlerpmpid_iTermMin_offset 4002
#define idlerpmpid_iTermMin_offset_hex fa2
#define idleRpmPid_maxValue_offset 1806
#define idleRpmPid_maxValue_offset_hex 70e
#define idleRpmPid_minValue_offset 1804
@ -1168,6 +1224,7 @@
#define ignitionTpsTable_offset_hex cd8
#define ignMathCalculateAtIndex_offset 1488
#define ignMathCalculateAtIndex_offset_hex 5d0
#define INDICATOR_NAME_AC_SWITCH "AC switch"
#define INDICATOR_NAME_BRAKE_DOWN "brake: down"
#define INDICATOR_NAME_CLUTCH_DOWN "clutch: down"
#define INDICATOR_NAME_CLUTCH_UP "clutch: up"
@ -1252,16 +1309,6 @@
#define isMapAveragingEnabled_offset_hex 5c4
#define isSdCardEnabled_offset 744
#define isSdCardEnabled_offset_hex 2e8
#define issue_294_15_offset 76
#define issue_294_15_offset_hex 4c
#define issue_294_16_offset 76
#define issue_294_16_offset_hex 4c
#define issue_294_17_offset 76
#define issue_294_17_offset_hex 4c
#define issue_294_18_offset 76
#define issue_294_18_offset_hex 4c
#define issue_294_19_offset 76
#define issue_294_19_offset_hex 4c
#define issue_294_21_offset 76
#define issue_294_21_offset_hex 4c
#define issue_294_22_offset 76
@ -1326,13 +1373,18 @@
#define knockVThreshold_offset_hex 5e8
#define lcdThreadPeriodMs_offset 720
#define lcdThreadPeriodMs_offset_hex 2d0
#define LDS_CLT_INDEX 0
#define LDS_ALTERNATOR_PID_STATE_INDEX 9
#define LDS_CJ125_PID_STATE_INDEX 10
#define LDS_CLT_STATE_INDEX 0
#define LDS_ENGINE_STATE_INDEX 3
#define LDS_FUEL_TRIM_INDEX 4
#define LDS_IAT_INDEX 1
#define LDS_SPEED_DENSITY_INDEX 2
#define LDS_TPS_TPS_ENEICHMENT_INDEX 5
#define LDS_TRIGGER_INDEX 6
#define LDS_ETB_PID_STATE_INDEX 7
#define LDS_FUEL_TRIM_STATE_INDEX 4
#define LDS_IAT_STATE_INDEX 1
#define LDS_IDLE_PID_STATE_INDEX 8
#define LDS_SPEED_DENSITY_STATE_INDEX 2
#define LDS_TPS_TPS_ENEICHMENT_STATE_INDEX 5
#define LDS_TRIGGER_CENTRAL_STATE_INDEX 6
#define LDS_TRIGGER_STATE_STATE_INDEX 11
#define LE_COMMAND_LENGTH 200
#define LIS302DLCsPin_offset 2043
#define LIS302DLCsPin_offset_hex 7fb
@ -1363,8 +1415,8 @@
#define mainRelayPin_offset_hex 2c2
#define mainRelayPinMode_offset 752
#define mainRelayPinMode_offset_hex 2f0
#define mainUnusedEnd_offset 4040
#define mainUnusedEnd_offset_hex fc8
#define mainUnusedEnd_offset 4140
#define mainUnusedEnd_offset_hex 102c
#define malfunctionIndicatorPin_offset 660
#define malfunctionIndicatorPin_offset_hex 294
#define malfunctionIndicatorPinMode_offset 661
@ -1457,7 +1509,14 @@
#define miataNb2VVTRatioFrom_offset_hex 334
#define miataNb2VVTRatioTo_offset 824
#define miataNb2VVTRatioTo_offset_hex 338
#define MOCK_AFR_COMMAND "mock_afr_voltage"
#define MOCK_CLT_COMMAND "mock_clt_voltage"
#define MOCK_IAT_COMMAND "mock_iat_voltage"
#define MOCK_MAF_COMMAND "mock_maf_voltage"
#define MOCK_MAP_COMMAND "mock_map_voltage"
#define MOCK_PPS_POSITION_COMMAND "mock_pps_position"
#define MOCK_PPS_VOLTAGE_COMMAND "mock_pps_voltage"
#define MOCK_TPS_COMMAND "mock_tps_voltage"
#define NARROW_BAND_WIDE_BAND_CONVERSION_SIZE 8
#define narrowToWideOxygen_offset 2296
#define narrowToWideOxygen_offset_hex 8f8
@ -1489,8 +1548,6 @@
#define oilPressure_value2_offset_hex a94
#define onOffAlternatorLogic_offset 744
#define onOffAlternatorLogic_offset_hex 2e8
#define operationMode_offset 488
#define operationMode_offset_hex 1e8
#define output_pin_e_enum "NONE", "INVALID", "PA0", "PA1", "PA2", "PA3", "PA4", "PA5", "PA6", "PA7", "N/A", "N/A", "PA10", "PA11", "PA12", "PA13", "N/A", "N/A", "N/A", "N/A", "PB0", "PB1", "PB2", "PB3", "PB4", "PB5", "PB6", "PB7", "N/A", "N/A", "N/A", "N/A", "PB12", "PB13", "N/A", "N/A", "N/A", "N/A", "PC0", "PC1", "PC2", "PC3", "PC4", "PC5", "PC6", "PC7", "PC8", "PC9", "N/A", "N/A", "N/A", "N/A", "PC14", "PC15", "PC16", "PC17", "PD0", "PD1", "PD2", "PD3", "PD4", "PD5", "PD6", "PD7", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "PD15", "PD16", "N/A", "PE0", "PE1", "PE2", "PE3", "PE4", "PE5", "PE6", "PE7", "PE8", "PE9", "PE10", "PE11", "N/A", "N/A", "N/A", "N/A", "N/A", "N/A", "TLE6240_1", "TLE6240_2", "TLE6240_3", "TLE6240_4", "TLE6240_5", "TLE6240_6", "TLE6240_7", "TLE6240_8", "TLE6240_9", "TLE6240_10", "TLE6240_11", "TLE6240_12", "TLE6240_13", "TLE6240_14", "TLE6240_15", "TLE6240_16"
#define overrideCrankingIacSetting_offset 1476
#define overrideCrankingIacSetting_offset_hex 5c4
@ -1520,7 +1577,25 @@
#define primingSquirtDurationMs_offset 96
#define primingSquirtDurationMs_offset_hex 60
#define PROTOCOL_ANALOG_CHART "analog_chart"
#define PROTOCOL_COIL1_SHORT_NAME "c1"
#define PROTOCOL_CRANK1 "t1"
#define PROTOCOL_CRANK2 "t2"
#define PROTOCOL_CRANK3 "t3"
#define PROTOCOL_DIZZY_NAME "dizzy"
#define PROTOCOL_ENGINE_SNIFFER "wave_chart"
#define PROTOCOL_ES_DOWN "d"
#define PROTOCOL_ES_UP "u"
#define PROTOCOL_HIP_NAME "HIP"
#define PROTOCOL_INJ1_SHORT_NAME "i1"
#define PROTOCOL_OUTPIN "outpin"
#define PROTOCOL_TACH_NAME "tach"
#define PROTOCOL_TEST_RESPONSE_TAG "ts_p_alive"
#define PROTOCOL_VERSION_TAG "rusEfiVersion"
#define PROTOCOL_VVT_NAME "VVT"
#define PROTOCOL_WA_CHANNEL_1 "input1"
#define PROTOCOL_WA_CHANNEL_2 "input2"
#define PROTOCOL_WA_CHANNEL_3 "input3"
#define PROTOCOL_WA_CHANNEL_4 "input4"
#define RPM_1_BYTE_PACKING_MULT 50
#define rpmHardLimit_offset 416
#define rpmHardLimit_offset_hex 1a0
@ -1528,6 +1603,8 @@
#define runningLedPin_offset_hex 715
#define sdCardCsPin_offset 707
#define sdCardCsPin_offset_hex 2c3
#define sdCardPeriodMs_offset 804
#define sdCardPeriodMs_offset_hex 324
#define sdCardSpiDevice_offset 2592
#define sdCardSpiDevice_offset_hex a20
#define secondTriggerChannelEnabled_offset 1476
@ -1718,6 +1795,7 @@
#define tle8888_csPinMode_offset_hex c22
#define tle8888spiDevice_offset 4000
#define tle8888spiDevice_offset_hex fa0
#define TOP_DEAD_CENTER_MESSAGE "r"
#define TOTAL_CONFIG_SIZE 20000
#define TOTAL_CONFIG_SIZE_hex 4e20
#define tps1_1AdcChannel_offset 512
@ -1816,14 +1894,28 @@
#define unrealisticRpmThreashold_offset_hex 2f8
#define unused1234234_offset 2042
#define unused1234234_offset_hex 7fa
#define unused_1484_bit_20_offset 1476
#define unused_1484_bit_20_offset_hex 5c4
#define unused_1484_bit_21_offset 1476
#define unused_1484_bit_21_offset_hex 5c4
#define unused_bit_1472_29_offset 1464
#define unused_bit_1472_29_offset_hex 5b8
#define unused_bit_1472_30_offset 1464
#define unused_bit_1472_30_offset_hex 5b8
#define unused_1484_bit_22_offset 1476
#define unused_1484_bit_22_offset_hex 5c4
#define unused_1484_bit_23_offset 1476
#define unused_1484_bit_23_offset_hex 5c4
#define unused_1484_bit_24_offset 1476
#define unused_1484_bit_24_offset_hex 5c4
#define unused_1484_bit_25_offset 1476
#define unused_1484_bit_25_offset_hex 5c4
#define unused_1484_bit_26_offset 1476
#define unused_1484_bit_26_offset_hex 5c4
#define unused_1484_bit_27_offset 1476
#define unused_1484_bit_27_offset_hex 5c4
#define unused_1484_bit_28_offset 1476
#define unused_1484_bit_28_offset_hex 5c4
#define unused_1484_bit_29_offset 1476
#define unused_1484_bit_29_offset_hex 5c4
#define unused_1484_bit_30_offset 1476
#define unused_1484_bit_30_offset_hex 5c4
#define unused_1484_bit_31_offset 1476
#define unused_1484_bit_31_offset_hex 5c4
#define unused_board_984_31_offset 744
#define unused_board_984_31_offset_hex 2e8
#define unused_former_warmup_target_afr_offset 2096
@ -1832,24 +1924,22 @@
#define unusedAnotherOne_offset_hex 2e8
#define unusedAtBoardConfigurationEnd_offset 980
#define unusedAtBoardConfigurationEnd_offset_hex 3d4
#define unusedFormerWarmupAfrPid_offset 1756
#define unusedFormerWarmupAfrPid_offset_hex 6dc
#define unusedh_offset 1471
#define unusedh_offset_hex 5bf
#define unusedMa2_offset 711
#define unusedMa2_offset_hex 2c7
#define unusedErrorPin_offset 2040
#define unusedErrorPin_offset_hex 7f8
#define unusedFlexFuelSensor_offset 3100
#define unusedFlexFuelSensor_offset_hex c1c
#define unusedFormerWarmupAfrPid_offset 1768
#define unusedFormerWarmupAfrPid_offset_hex 6e8
#define unusedOldWarmupAfr_offset 744
#define unusedOldWarmupAfr_offset_hex 2e8
#define unusedSpiPadding2_offset 804
#define unusedSpiPadding2_offset_hex 324
#define unusedSpiPadding2_offset 807
#define unusedSpiPadding2_offset_hex 327
#define unusedSpiPadding3_offset 4036
#define unusedSpiPadding3_offset_hex fc4
#define unusedSpiPadding4_offset 2593
#define unusedSpiPadding4_offset_hex a21
#define unusedSpiPadding5_offset 2713
#define unusedSpiPadding5_offset_hex a99
#define unusedSpiPadding6_offset 4002
#define unusedSpiPadding6_offset_hex fa2
#define unusedSpiPadding7_offset 4005
#define unusedSpiPadding7_offset_hex fa5
#define unusedSpiPadding8_offset 4009
@ -1874,8 +1964,12 @@
#define useFSIO10ForServo3_offset_hex 5b8
#define useFSIO11ForServo4_offset 1464
#define useFSIO11ForServo4_offset_hex 5b8
#define useFSIO12ForIdleOffset_offset 1464
#define useFSIO12ForIdleOffset_offset_hex 5b8
#define useFSIO12ForServo5_offset 1464
#define useFSIO12ForServo5_offset_hex 5b8
#define useFSIO13ForIdleMinValue_offset 1464
#define useFSIO13ForIdleMinValue_offset_hex 5b8
#define useFSIO15ForIdleRpmAdjustment_offset 1464
#define useFSIO15ForIdleRpmAdjustment_offset_hex 5b8
#define useFSIO16ForTimingAdjustment_offset 1464
@ -1884,6 +1978,8 @@
#define useFSIO4ForSeriousEngineWarning_offset_hex 5b8
#define useFSIO5ForCriticalIssueEngineStop_offset 1464
#define useFSIO5ForCriticalIssueEngineStop_offset_hex 5b8
#define useFSIO6ForRevLimiter_offset 1464
#define useFSIO6ForRevLimiter_offset_hex 5b8
#define useFSIO8ForServo1_offset 1464
#define useFSIO8ForServo1_offset_hex 5b8
#define useFSIO9ForServo2_offset 1464
@ -1892,6 +1988,8 @@
#define useIacTableForCoasting_offset_hex 2e8
#define useIdleTimingPidControl_offset 744
#define useIdleTimingPidControl_offset_hex 2e8
#define useInstantRpmForIdle_offset 76
#define useInstantRpmForIdle_offset_hex 4c
#define useLcdScreen_offset 744
#define useLcdScreen_offset_hex 2e8
#define useLinearCltSensor_offset 1464
@ -1912,6 +2010,10 @@
#define useSerialPort_offset_hex 2e8
#define useStepperIdle_offset 744
#define useStepperIdle_offset_hex 2e8
#define useTLE8888_cranking_hack_offset 76
#define useTLE8888_cranking_hack_offset_hex 4c
#define useTLE8888_hall_mode_offset 76
#define useTLE8888_hall_mode_offset_hex 4c
#define useTpicAdvancedMode_offset 744
#define useTpicAdvancedMode_offset_hex 2e8
#define useTPSAdvanceTable_offset 1476

View File

@ -111,7 +111,7 @@
* It also has smaller pages so it takes less time to erase
*
* There is no remote access to FlexNVM meaning that we cannot erase settings externally
* /
*/
#define FLASH_ADDR 0x10000000 // FlexNVM
#define FLASH_ADDR_SECOND_COPY 0x10008000
@ -407,7 +407,7 @@
#define EFI_PRINT_ERRORS_AS_WARNINGS TRUE
#define EFI_PRINT_MESSAGES_TO_TERMINAL TRUE
#define EFI_ACTIVE_CONFIGURATION_IN_FLASH __attribute__((section (".config")))
#define EFI_ACTIVE_CONFIGURATION_IN_FLASH FLASH_ADDR
//#define PWM_PHASE_MAX_COUNT 122

View File

@ -0,0 +1,10 @@
cd ../../..
set PROJECT_BOARD=microrusefi
set PROJECT_CPU=ARCH_STM32F4
set DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=MRE_BOARD_TEST
call config/boards/common_make.bat
call config/boards/clean_env_variables.bat

View File

@ -0,0 +1,9 @@
cd ../../..
set PROJECT_BOARD=microrusefi
set PROJECT_CPU=ARCH_STM32F4
call config/boards/common_make.bat
call config/boards/clean_env_variables.bat

View File

@ -0,0 +1,17 @@
cd ../../..
set LDSCRIPT = config/boards/NUCLEO_F767/STM32F76xxI.ld
set PROJECT_BOARD=microrusefi
set PROJECT_CPU=ARCH_STM32F7
set EXTRA_PARAMS=-DDUMMY ^
-DEFI_COMMUNICATION_PIN=GPIOB_7 ^
-DEFI_FATAL_ERROR_PIN=GPIOB_14 ^
-DDEFAULT_ENGINE_TYPE=BMW_M73_F
rem -DDEFAULT_ENGINE_TYPE=MRE_BOARD_TEST
call config/boards/common_make.bat
call config/boards/clean_env_variables.bat

View File

@ -1,16 +1,30 @@
# List of all the board related files.
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.c
BOARDSRC_CPP = $(PROJECT_DIR)/config/boards/microrusefi/board_configuration.cpp
# Combine the related files for a specific platform and MCU.
# Required include directories
BOARDINC = $(PROJECT_DIR)/config/boards/nucleo_f767 $(PROJECT_DIR)/config/stm32f7ems
BOARDS_DIR = $(PROJECT_DIR)/config/boards
LDSCRIPT= $(PROJECT_DIR)/config/boards/nucleo_f767/STM32F76xxI.ld
# Target ECU board design
BOARDSRC_CPP = $(BOARDS_DIR)/microrusefi/board_configuration.cpp
# Target processor details
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
MCU_DEFS = -DSTM32F407xx
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.c
BOARDINC = $(BOARDS_DIR)/microrusefi
BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h
BOARDINC += $(BOARDS_DIR)/st_stm32f4
LDSCRIPT= $(BOARDS_DIR)/prometheus/STM32F405xG.ld
else
MCU_DEFS = -DSTM32F767xx
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.c
BOARDINC = $(BOARDS_DIR)/nucleo_f767 # For board.h
BOARDINC += $(PROJECT_DIR)/config/stm32f7ems # efifeatures/halconf/chconf.h
LDSCRIPT= $(BOARDS_DIR)/nucleo_f767/STM32F76xxI.ld
endif
# Set this if you want a default engine type other than normal MRE
ifeq ($(DEFAULT_ENGINE_TYPE),)
DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=MICRO_RUS_EFI
endif
# Override DEFAULT_ENGINE_TYPE
DDEFS += -DSTM32F767xx -DEFI_USE_OSC=TRUE -DEFI_FATAL_ERROR_PIN=GPIOE_3 -DFIRMWARE_ID=\"microRusEfi\" $(DEFAULT_ENGINE_TYPE)
# Add them all together
DDEFS += $(MCU_DEFS) -DEFI_USE_OSC=TRUE -DEFI_FATAL_ERROR_PIN=GPIOE_3 -DFIRMWARE_ID=\"microRusEfi\" $(DEFAULT_ENGINE_TYPE)

View File

@ -215,3 +215,10 @@ void setBoardConfigurationOverrides(void) {
void setAdcChannelOverrides(void) {
}
/**
* @brief Board-specific SD card configuration code overrides. Needed by bootloader code.
* @todo Add your board-specific code, if any.
*/
void setSdCardConfigurationOverrides(void) {
}

View File

@ -0,0 +1,30 @@
# Combine the related files for a specific platform and MCU.
BOARDS_DIR = $(PROJECT_DIR)/config/boards
# Target ECU board design
BOARDSRC_CPP = $(BOARDS_DIR)/skeleton/board_configuration.cpp
# Target processor details
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
MCU_DEFS = -DSTM32F407xx
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.c
BOARDINC = $(BOARDS_DIR)/skeleton
BOARDINC += $(PROJECT_DIR)/config/stm32f4ems # For board.h
BOARDINC += $(BOARDS_DIR)/st_stm32f4
LDSCRIPT= $(BOARDS_DIR)/prometheus/STM32F405xG.ld
else
MCU_DEFS = -DSTM32F767xx
BOARDSRC = $(CHIBIOS)/os/hal/boards/ST_NUCLEO144_F767ZI/board.c
BOARDINC = $(BOARDS_DIR)/nucleo_f767 # For board.h
BOARDINC += $(PROJECT_DIR)/config/stm32f7ems # efifeatures/halconf/chconf.h
LDSCRIPT= $(BOARDS_DIR)/nucleo_f767/STM32F76xxI.ld
endif
# Set this if you want a default engine type
ifeq ($(DEFAULT_ENGINE_TYPE),)
DEFAULT_ENGINE_TYPE = -DDEFAULT_ENGINE_TYPE=MICRO_RUS_EFI
endif
# Add them all together
DDEFS += $(MCU_DEFS) -DEFI_USE_OSC=TRUE -DEFI_FATAL_ERROR_PIN=GPIOE_3 -DFIRMWARE_ID=\"skeleton\" $(DEFAULT_ENGINE_TYPE)

View File

@ -0,0 +1,240 @@
/**
* @file boards/skeleton/board_configuration.cpp
*
*
* @brief Example configuration defaults for a RusEFI board
*
* @author Donald Becker November 2019
* @author Hugo Becker November 2019
*
* This file is an example of board-specific firmware for RusEFI.
* It contains the unique code need for the setup of a specific board.
*
* This file must contain the configuration for the hard-wired aspects
* of the board, for instance the pins used for a specific MCU functional
* unit such as SPI.
*
* It may also contain preferences for the assignment of external connector
* such as which analog input is used to measure coolant temperature, or
* of if an analog input is connected to a throttle pedal.
*
* These initialization functions are called from
* firmware/controllers/algo/engine_configuration.cpp
* void setBoardConfigurationOverrides(void);
* void setPinConfigurationOverrides(void);
* void setSerialConfigurationOverrides(void);
*
* Future: Clean up the distinction between these functions.
*/
#include "global.h"
#include "engine.h"
#include "engine_math.h"
#include "allsensors.h"
#include "fsio_impl.h"
#include "engine_configuration.h"
EXTERN_ENGINE;
// An example of how to configure complex features on the board.
// Generally these should be local (static) functions, one function per chip.
// This shows a SPI connected TLE8888.
static void setupTle8888() {
// Enable the SPI channel and set up the SPI pins
boardConfiguration->is_enabled_spi_3 = true;
boardConfiguration->spi3mosiPin = GPIOB_5;
boardConfiguration->spi3misoPin = GPIOB_4;
boardConfiguration->spi3sckPin = GPIOB_3;
// SPI chip select is often independent of the SPI pin limitations
engineConfiguration->tle8888_cs = GPIOD_5;
// Set SPI device
engineConfiguration->tle8888spiDevice = SPI_DEVICE_3;
}
// A configuration for a Electronic Throttle Body (ETB) driver.
// This example uses the TLE9201 H-Bridge.
// The TLE9201 has three control pins:
// DIR - sets direction of the motor
// PWM - control (enable high, coast low), PWM capable
// DIS - disables motor (enable low)
// Future: An example showing how to probe for an optionally connected
// diagnostic interface on SPI
static void setupTle9201Etb() {
// This chip has PWM/DIR, not dira/dirb
engineConfiguration->etb1_use_two_wires = false;
// PWM and DIR pins
boardConfiguration->etb1.controlPin1 = GPIOC_7;
boardConfiguration->etb1.directionPin1 = GPIOA_8;
boardConfiguration->etb1.directionPin2 = GPIO_UNASSIGNED;
// PWM frequency needs to be configured to match the physical part
engineConfiguration->etbFreq = 800;
}
// Configure key sensors inputs.
//
// ToDo: Review count assumption with initialization of unused triggers/cams
// ToDo: Resolve angst over default input assignments.
static void setupDefaultSensorInputs() {
// Engine rotation position sensors
// Trigger is our primary timing signal, and usually comes from the crank.
// trigger inputs up TRIGGER_SUPPORTED_CHANNELS (2)
boardConfiguration->triggerInputPins[0] = GPIOC_6;
boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;
// A secondary Cam signal up to CAM_INPUTS_COUNT (4)
engineConfiguration->camInputs[0] = GPIOA_5;
// Throttle Body Position Sensors, second channel is a check/fail-safe
// tps = "20 - AN volt 5"
engineConfiguration->tps1_1AdcChannel = EFI_ADC_13;
engineConfiguration->tps2_1AdcChannel = EFI_ADC_NONE;
// Throttle pedal inputs
// Idle/Up/Closed (no pressure on pedal) pin
engineConfiguration->throttlePedalUpPin = GPIO_UNASSIGNED;
// If the ETB has analog feedback we can use it for closed loop control.
engineConfiguration->throttlePedalPositionAdcChannel = EFI_ADC_2;
// Manifold Air Pressure sensor input
// EFI_ADC_10: "27 - AN volt 1"
engineConfiguration->map.sensor.hwChannel = EFI_ADC_10;
// Air Fuel Ratio (exhaust gas oxygen) sensor input
// EFI_ADC_14: "32 - AN volt 6"
engineConfiguration->afr.hwChannel = EFI_ADC_14;
// Coolant Temp
// clt = "18 - AN temp 1"
engineConfiguration->clt.adcChannel = EFI_ADC_0;
engineConfiguration->clt.config.bias_resistor = 2700;
// Intake Air Temperature, IAT
// iat = "23 - AN temp 2"
engineConfiguration->iat.adcChannel = EFI_ADC_1;
engineConfiguration->iat.config.bias_resistor = 2700;
}
void setPinConfigurationOverrides(void) {
}
// Future: configure USART3 for LIN bus and UART4 for console
void setSerialConfigurationOverrides(void) {
boardConfiguration->useSerialPort = false;
engineConfiguration->binarySerialTxPin = GPIO_UNASSIGNED;
engineConfiguration->binarySerialRxPin = GPIO_UNASSIGNED;
engineConfiguration->consoleSerialTxPin = GPIO_UNASSIGNED;
engineConfiguration->consoleSerialRxPin = GPIO_UNASSIGNED;
}
/**
* @brief Board-specific configuration overrides.
*
* See also setDefaultEngineConfiguration
*
* @todo Add any board-specific code
*/
void setBoardConfigurationOverrides(void) {
// Set indicator LED pins.
// This is often redundant with efifeatures.h or the run-time config
boardConfiguration->triggerErrorPin = GPIOE_1;
engineConfiguration->communicationLedPin = GPIOE_2;
engineConfiguration->FatalErrorPin = GPIOE_3;
engineConfiguration->runningLedPin = GPIOE_4;
engineConfiguration->warningLedPin = GPIOE_5;
engineConfiguration->checkEngineLedPin = GPIOE_6;
engineConfiguration->errorLedPin = GPIOE_7;
// Set injector pins and the pin output mode
boardConfiguration->injectionPinMode = OM_DEFAULT;
boardConfiguration->injectionPins[0] = GPIOE_14;
boardConfiguration->injectionPins[1] = GPIOE_13;
boardConfiguration->injectionPins[2] = GPIOE_12;
boardConfiguration->injectionPins[3] = GPIOE_11;
// Disable the remainder only when they may never be assigned
for (int i = 4; i < INJECTION_PIN_COUNT;i++) {
boardConfiguration->injectionPins[i] = GPIO_UNASSIGNED;
}
// Do the same for ignition outputs
boardConfiguration->ignitionPinMode = OM_DEFAULT;
boardConfiguration->ignitionPins[0] = GPIOD_4;
boardConfiguration->ignitionPins[1] = GPIOD_3;
boardConfiguration->ignitionPins[2] = GPIOD_2;
boardConfiguration->ignitionPins[3] = GPIOD_1;
// Disable remainder
for (int i = 4; i < IGNITION_PIN_COUNT; i++) {
boardConfiguration->ignitionPins[i] = GPIO_UNASSIGNED;
}
// Board-specific scaling values to convert ADC fraction to Volts.
// It is good practice to make the math explicit, but still simple.
// The results should be compile time constants
// The ADC reference voltage
engineConfiguration->adcVcc = 3.30f;
// This is a board with 6.8 Kohm and 10 Kohm resistor dividers
engineConfiguration->analogInputDividerCoefficient = (10.0+6.8) / 10.0f;
// Vbatt is the voltage of the 12V battery.
// Here the hardware has a 39 Kohm high side/10 Kohm low side divider,
// with the second divider also applied.
engineConfiguration->vbattDividerCoeff =
(49.0f / 10.0f) * engineConfiguration->analogInputDividerCoefficient;
engineConfiguration->vbattAdcChannel = EFI_ADC_11;
// Configure any special on-board chips
setupTle8888();
setupEtb();
// The MRE uses the TLE8888 fixed-function main relay control pin.
// This firmware is not involved with main relay control, although
// the pin inputs can be over-ridden through the TLE8888 Cmd0 register.
// ToDo: consider EFI_MAIN_RELAY_CONTROL to FALSE for MRE configuration
// Configure the TLE8888 half bridges (pushpull, lowside, or high-low)
// TLE8888_IN11 -> TLE8888_OUT21
// GPIOE_8: "35 - GP Out 1"
boardConfiguration->fuelPumpPin = GPIOE_8;
// TLE8888 high current low side: VVT2 IN9 / OUT5
// GPIOE_10: "3 - Lowside 2"
boardConfiguration->idle.solenoidPin = GPIOE_10;
// TLE8888_PIN_22: "34 - GP Out 2"
boardConfiguration->fanPin = TLE8888_PIN_22;
// The "required" hardware is done - set some reasonable input defaults
setupDefaultSensorInputs();
// Some sensible defaults for other options
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_60_2;
engineConfiguration->useOnlyRisingEdgeForTrigger = true;
setAlgorithm(LM_SPEED_DENSITY PASS_CONFIG_PARAMETER_SUFFIX);
engineConfiguration->specs.cylindersCount = 4;
engineConfiguration->specs.firingOrder = FO_1_3_4_2;
// Ign is IM_ONE_COIL, IM_TWO_COILS, IM_INDIVIDUAL_COILS, IM_WASTED_SPARK
engineConfiguration->ignitionMode = IM_INDIVIDUAL_COILS;
// Inj mode: IM_SIMULTANEOUS, IM_SEQUENTIAL, IM_BATCH, IM_SINGLE_POINT
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
engineConfiguration->injectionMode = IM_SIMULTANEOUS;
}
void setAdcChannelOverrides(void) {
}
/*
* Local variables:
* c-basic-indent: 4
* tab-width: 4
* End:
*/

View File

@ -0,0 +1,401 @@
/**
* @file efifeatures.h
*
* @brief Configure which firmware modules are used.
* @author Donald Becker October 2019
* @author Hugo Becker November 2019
*
* This configuration is a "skeleton" example for RusEFI boards.
*
*/
#pragma once
// General software features
// Use the GPIO port setup code -- almost always set.
#define EFI_GPIO_HARDWARE TRUE
// Internal ADC -- almost always set.
#define EFI_INTERNAL_ADC TRUE
#define EFI_ANALOG_SENSORS TRUE
// Console I/O features to monitor formulas and pin state
#define EFI_FSIO TRUE
// Log crank/cam sensor events, a frequently needed diag for new installations
#define EFI_TOOTH_LOGGER TRUE
// Log other events, see also EFI_PRINT_MESSAGES_TO_TERMINAL
#define EFI_TEXT_LOGGING TRUE
// Monitor changes to Default settings that create failures -- note spelling
#define EFI_DEFAILED_LOGGING FALSE
// Build the logic analyzer support.
// A logic analyzer viewer is included in the java console.
#define EFI_WAVE_ANALYZER TRUE
// A development feature to test output jitter and consistency
#define EFI_PWM_TESTER FALSE
#define EFI_ENABLE_CRITICAL_ENGINE_STOP TRUE
#define EFI_ENABLE_ENGINE_WARNING TRUE
#define EFI_CAN_SUPPORT TRUE
// Internal MCU features
// Use STM32 Core Coupled Memory as general purpose RAM.
#define EFI_USE_CCM TRUE
// Support USB Mass Storage Devices
// Typically off as it requires USB OTG and power output.
#define HAL_USE_USB_MSD FALSE
// Hardware feature and chip support
// Some require a non-zero count to include support, others are TRUE/FALSE
// Other inconsistencies, such as naming, abound.
// Capacitive Discharge Module ion sense for detontation/knock detection
#define EFI_CDM_INTEGRATION FALSE
// MCP42010 digital potentiometer
#define EFI_POTENTIOMETER FALSE
// MC33816 Programmable Gate Driver over SPI
#define EFI_MC33816 FALSE
// MAX31855 Thermocouple interface over SPI
#define EFI_MAX_31855 FALSE
// MCP3208 ADC over SPI
#define EFI_MCP_3208 FALSE
// HIP9011 Knock / Detonation Detector SPI config
#define EFI_HIP_9011 FALSE
// Bosch CJ125 Wideband Exhaust Gas Oxygen Sensor interface
#define EFI_CJ125 FALSE
// LIS302DL MEMS Accelerometer over SPI, as on F4 Discovery board.
#define EFI_MEMS FALSE
// HD44780 Character LCD, the only client of EFI_LCD
#define EFI_HD44780_LCD FALSE
#define EFI_LCD FALSE
// and the closely related joystick input for the LCD menu system.
#define EFI_JOYSTICK FALSE
#define BOARD_TLE6240_COUNT 0
#define BOARD_MC33972_COUNT 0
#define BOARD_TLE8888_COUNT 0
// Future: move these outside of efifeatures.h
#define BOARD_EXT_GPIOCHIPS (BOARD_TLE6240_COUNT + BOARD_MC33972_COUNT + BOARD_TLE8888_COUNT)
#define BOARD_EXT_PINREPOPINS 24
/**
* if you have a 60-2 trigger, or if you just want better performance, you
* probably want EFI_ENABLE_ASSERTS to be FALSE. Also you would probably want to FALSE
* CH_DBG_ENABLE_CHECKS
* CH_DBG_ENABLE_ASSERTS
* CH_DBG_ENABLE_TRACE
* in chconf.h
*
*/
#if !defined(EFI_ENABLE_ASSERTS)
#define EFI_ENABLE_ASSERTS TRUE
#endif /* EFI_ENABLE_ASSERTS */
#if !defined(EFI_ENABLE_MOCK_ADC)
#define EFI_ENABLE_MOCK_ADC TRUE
#endif /* EFI_ENABLE_MOCK_ADC */
//#define EFI_UART_ECHO_TEST_MODE TRUE
#define EFI_ICU_INPUTS TRUE
#ifndef HAL_TRIGGER_USE_PAL
#define HAL_TRIGGER_USE_PAL FALSE
#endif /* HAL_TRIGGER_USE_PAL */
// TunerStudio support.
#define EFI_TUNER_STUDIO TRUE
#define EFI_TUNER_STUDIO_VERBOSE TRUE // Debugging output
// HC-06 Bluetooth module UART setup (output an initial configuration string)
#define EFI_BLUETOOTH_SETUP FALSE
// Serial port NMEA GPS reporting
#define EFI_UART_GPS FALSE
/**
* Dev console support.
*/
#define EFI_CLI_SUPPORT TRUE
#define EFI_RTC TRUE
#define EFI_ALTERNATOR_CONTROL TRUE
#define EFI_AUX_PID TRUE
#define EFI_SIGNAL_EXECUTOR_SLEEP FALSE
#define EFI_SIGNAL_EXECUTOR_ONE_TIMER TRUE
#define EFI_SIGNAL_EXECUTOR_HW_TIMER FALSE
#define FUEL_MATH_EXTREME_LOGGING FALSE
#define SPARK_EXTREME_LOGGING FALSE
#define TRIGGER_EXTREME_LOGGING FALSE
#ifndef EFI_INTERNAL_FLASH
#define EFI_INTERNAL_FLASH TRUE
#endif
/**
* Usually you need shaft position input, but maybe you do not need it?
*/
#ifndef EFI_SHAFT_POSITION_INPUT
#define EFI_SHAFT_POSITION_INPUT TRUE
#endif
#define EFI_ENGINE_CONTROL TRUE
#define EFI_SPEED_DENSITY TRUE
#define EFI_ANALOG_SENSORS TRUE
#define EFI_NARROW_EGO_AVERAGING TRUE
#define EFI_DENSO_ADC FALSE
#ifndef EFI_IDLE_CONTROL
#define EFI_IDLE_CONTROL TRUE
#endif
#define EFI_IDLE_INCREMENTAL_PID_CIC FALSE
/**
* Control the main power relay based on measured ignition voltage (Vbatt)
*/
#ifndef EFI_MAIN_RELAY_CONTROL
#define EFI_MAIN_RELAY_CONTROL FALSE
#endif
#ifndef EFI_PWM
#define EFI_PWM TRUE
#endif
#ifndef EFI_VEHICLE_SPEED
#define EFI_VEHICLE_SPEED TRUE
#endif
#define EFI_FUEL_PUMP TRUE
#ifndef EFI_ENGINE_EMULATOR
#define EFI_ENGINE_EMULATOR TRUE
#endif
#ifndef EFI_EMULATE_POSITION_SENSORS
#define EFI_EMULATE_POSITION_SENSORS TRUE
#endif
/**
* This macros is used to hide hardware-specific pieces of the code from unit tests and simulator, so it only makes
* sense in folders exposed to the tests projects (simulator and unit tests).
* This macros is NOT about taking out logging in general.
* See also EFI_UNIT_TEST
* See also EFI_SIMULATOR
* todo: do we want to rename any of these three options?
*/
#define EFI_PROD_CODE TRUE
/**
* Do we need file logging (like SD card) logic?
*/
#ifndef EFI_FILE_LOGGING
#define EFI_FILE_LOGGING TRUE
#endif
#define EFI_USB_SERIAL TRUE
// For now we can still embed all car configurations into the firmware binary.
// These give us control over which configurations go in.
#define EFI_SUPPORT_DODGE_NEON TRUE
#define EFI_SUPPORT_FORD_ASPIRE TRUE
#define EFI_SUPPORT_FORD_FIESTA TRUE
#define EFI_SUPPORT_NISSAN_PRIMERA TRUE
#define EFI_SUPPORT_1995_FORD_INLINE_6 TRUE
#ifndef EFI_ENGINE_SNIFFER
#define EFI_ENGINE_SNIFFER TRUE
#endif
#define EFI_HISTOGRAMS FALSE
#define EFI_SENSOR_CHART TRUE
#if defined __GNUC__
#define EFI_PERF_METRICS FALSE
#define DL_OUTPUT_BUFFER 6500
#else
#define EFI_PERF_METRICS FALSE
#define DL_OUTPUT_BUFFER 8000
#endif
/**
* Do we need GPS logic?
*/
//#define EFI_UART_GPS FALSE
#define EFI_SERVO TRUE
#define EFI_ELECTRONIC_THROTTLE_BODY TRUE
// MIL Malfunction Indicator Lamp logic
#define EFI_MALFUNCTION_INDICATOR TRUE
#define CONSOLE_MAX_ACTIONS 180
#define EFI_MAP_AVERAGING TRUE
// todo: most of this should become configurable
// todo: switch to continuous ADC conversion for slow ADC?
// https://github.com/rusefi/rusefi/issues/630
#define EFI_INTERNAL_SLOW_ADC_PWM &PWMD8
// todo: switch to continues ADC conversion for fast ADC?
#define EFI_INTERNAL_FAST_ADC_PWM &PWMD4
#define EFI_SPI1_AF 5
#define EFI_SPI2_AF 5
/**
* This section is for right-side center SPI
*/
#define EFI_SPI3_AF 6
#define EFI_I2C_SCL_BRAIN_PIN GPIOB_6
#define EFI_I2C_SDA_BRAIN_PIN GPIOB_7
#define EFI_I2C_AF 4
/**
* Patched version of ChibiOS/RT support extra details in the system error messages
*/
#define EFI_CUSTOM_PANIC_METHOD TRUE
#define ADC_CHANNEL_VREF ADC_CHANNEL_IN14
/**
* currently ChibiOS uses only first and second channels of each timer for input capture
*
* So, our options are:
*
* TIM2_CH1
* PA5
*
* TIM4_CH1
* PB6
* PD12
*
* TIM9_CH1
* PE5
*/
// Future: Consistently use consoleUartDevice
#ifndef EFI_CONSOLE_SERIAL_DEVICE
#define EFI_CONSOLE_SERIAL_DEVICE (&SD3)
#endif
/**
* Use 'HAL_USE_UART' DMA-mode driver instead of 'HAL_USE_SERIAL'
*
* See also
* STM32_SERIAL_USE_USARTx
* STM32_UART_USE_USARTx
* in mcuconf.h
*/
#define TS_UART_DMA_MODE FALSE
#define TS_UART_DEVICE (&UARTD3)
#define TS_SERIAL_DEVICE (&SD3)
// todo: add DMA-mode for Console?
#if (TS_UART_DMA_MODE || TS_UART_MODE)
#undef EFI_CONSOLE_SERIAL_DEVICE
#endif
#ifndef LED_ERROR_BRAIN_PIN
#define LED_ERROR_BRAIN_PIN GPIOD_14
#endif
// USART1 -> check defined STM32_SERIAL_USE_USART1
// For GPS we have USART1. We can start with PB7 USART1_RX and PB6 USART1_TX
#define GPS_SERIAL_DEVICE &SD1
#define GPS_SERIAL_SPEED 38400
#ifndef CONFIG_RESET_SWITCH_PORT
// looks like this feature is not extremely popular, we can try living without it now :)
//#define CONFIG_RESET_SWITCH_PORT GPIOD
#endif
#ifndef CONFIG_RESET_SWITCH_PIN
#define CONFIG_RESET_SWITCH_PIN 6
#endif
/**
* This is the size of the MemoryStream used by chvprintf
*/
#define INTERMEDIATE_LOGGING_BUFFER_SIZE 2000
// Enable file logging (like SD card) logic
#define EFI_FILE_LOGGING FALSE
#define EFI_PRINT_ERRORS_AS_WARNINGS TRUE
#define EFI_USB_SERIAL TRUE
// GPS reporting NMEA protocol on a serial port
#undef EFI_UART_GPS
#define EFI_UART_GPS FALSE
// consoleUartDevice is unused but provided on UART4 Tx:PC10 Rx:PC11
// USART3 would work on the same pins but is reserved for future LIN bus use.
// ToDo: Fix so that UART4 will work here.
#define HAL_USE_SERIAL_USB TRUE
#undef EFI_CONSOLE_SERIAL_DEVICE
#undef TS_UART_DEVICE
#undef TS_SERIAL_DEVICE
#undef TS_UART_MODE
#define EFI_CONSOLE_SERIAL_DEVICE (&SD1)
//#define EFI_CONSOLE_SERIAL_DEVICE (&SDU1)
#define EFI_UART_ECHO_TEST_MODE TRUE
#define TS_UART_DEVICE (&UARTD3)
#define TS_SERIAL_DEVICE (&SD3)
// USART3 is Alternate Function 7, UART4 is AF8
// todo: start using consoleSerial{Tx,Rx}Pin
#define EFI_CONSOLE_AF 7
#define TS_SERIAL_AF 7
#define EFI_CONSOLE_TX_PORT GPIOC
#define EFI_CONSOLE_TX_PIN 10
#define EFI_CONSOLE_RX_PORT GPIOC
#define EFI_CONSOLE_RX_PIN 11
// todo: document the limitations of DMA mode for the UART.
#undef TS_UART_DMA_MODE
#define TS_UART_DMA_MODE FALSE
// todo: add DMA-mode for Console?
#if (TS_UART_DMA_MODE || TS_UART_MODE)
#undef EFI_CONSOLE_SERIAL_DEVICE
#endif

View File

@ -0,0 +1,54 @@
outputs:
# TLE8888 injector channels
GPIOE_14: "37 - Injector 1"
GPIOE_13: "38 - Injector 2"
GPIOE_12: "41 - Injector 3"
GPIOE_11: "42 - Injector 4"
# TC4427 ignition outputs (5v)
GPIOD_4: "9 - Ignition 1"
GPIOD_3: "10 - Ignition 2"
GPIOD_2: "11 - Ignition 3"
GPIOD_1: "12 - Ignition 4"
# TC4427 general purpose output (selectable 5v/12v)
GPIOD_7: "14 - GP Out 5"
GPIOD_6: "13 - GP Out 6"
# TLE8888 high current low side: VVT1 TLE8888_IN10 / TLE8888_OUT6
GPIOE_9: "7 - Lowside 1"
# TLE8888 high current low side: VVT2 TLE8888_IN9 / TLE8888_OUT5
GPIOE_10: "3 - Lowside 2"
# TLE8888 half bridges (pushpull, lowside, or high-low) TLE8888_IN11 / TLE8888_OUT21
GPIOE_8: "35 - GP Out 1"
# TLE8888 half bridges (pushpull, lowside, or high-low) IN? / TLE8888_OUT22
# this should work but it does not GPIOE_7: "34 - GP Out 2"
TLE8888_PIN_22: "34 - GP Out 2"
TLE8888_PIN_23: "33 - GP Out 3"
TLE8888_PIN_24: "43 - GP Out 4"
event_inputs:
# RC filter input for hall
GPIOA_5: "25 - Hall Cam"
# TLE8888 VR/hall conditioner
GPIOC_6: "45 - VR/Hall Crank"
switch_inputs:
GPIOE_10: "Brake Switch"
GPIOG_1: "Clutch Switch"
analog_inputs:
EFI_ADC_0: "18 - AN temp 1"
EFI_ADC_1: "23 - AN temp 2"
EFI_ADC_2: "24 - AN temp 3"
EFI_ADC_3: "22 - AN temp 4"
EFI_ADC_4: "28 - AN volt 10"
EFI_ADC_6: "26 - AN volt 2"
EFI_ADC_7: "31 - AN volt 3"
EFI_ADC_8: "36 - AN volt 8"
EFI_ADC_9: "40 - AN volt 9"
EFI_ADC_10: "27 - AN volt 1"
EFI_ADC_11: "Battery Sense"
EFI_ADC_12: "19 - AN volt 4"
EFI_ADC_13: "20 - AN volt 5"
EFI_ADC_14: "32 - AN volt 6"
EFI_ADC_15: "30 - AN volt 7"

View File

@ -0,0 +1,8 @@
#define ts_show_hip9011 false
#define ts_show_cj125 false
#define ts_show_full_pinout false
#define ts_show_lcd false
#define ts_show_joystick false
#define ts_show_egt false
#define ts_show_gps false
#define ts_show_etb_pins false

View File

@ -0,0 +1,11 @@
This directory contains an example of the files needed to configure the
firmware for a specific RusEFI board.
The files here
- select specific features to be included into the firmware
- firmware to configure and support unique features of the board
- set communication channels (USB, serial, CAN) and parameters e.g. speed
- set the default GPIO pin configuration for use at startup
Note that many settings may be immediately reconfigured by the engine
configuration.

View File

@ -1,3 +1,8 @@
/**
* @file board_extra.c
*/
#include "chconf_common.h"
/**
* @brief Board-specific configuration code overrides.

View File

@ -20,6 +20,7 @@ EXTERN_CONFIG
;
void setBmwE34(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
// chartsize 450
engineConfiguration->engineChartSize = 450;

View File

@ -5,11 +5,9 @@
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef BMW_E34_H_
#define BMW_E34_H_
#pragma once
#include "engine_configuration.h"
void setBmwE34(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* BMW_E34_H_ */

View File

@ -0,0 +1,129 @@
/*
* @file bmw_m73.cpp
*
*
* https://github.com/rusefi/rusefi_documentation/wiki/BMW_e38_750
*
* https://rusefi.com/wiki/index.php?title=Hardware:OEM_connectors#134_pin
*
* 1/2 plugs black
* 2/2 plugs grey
*
*
* ********* | | OEM | rusEfi | function
*
* Plug #1 9 pin
* ECU pin 4: GND BRN/ORG
* ECU pin 6: GND BRN
* ECU pin 7: IN RED +12v hot at all times
* ECU pin 8: IN RED/BLU +12v from ECU relay
*
* Plug #2 24 pin
* ECU pin 3: CAN xxx/xxx CAN low
* ECU pin 4: CAN xxx/xxx CAN high
* ECU pin 23: OUT BRN/BLK BLK ECU relay control, low-side
*
* Plug #3 52 pin
* ECU pin 2: OUT injector #4
* ECU pin 6: GND ECU
* ECU pin 15: OUT injector #2
* ECU pin 20: IN WHT hall effect camshaft sensor signal
* ECU pin 21: GND BRN BLK CLT sensor
* ECU pin 22: IN RED/BRN GRN CLT sensor
* ECU pin 27: OUT injector #6
* ECU pin 28: OUT injector #5
* ECU pin 32: IN ORG VR positive crankshaft sensor - only 2x 5k per channel, R111 not installed, W1002 not installed
* ECU pin 40: OUT BRN/BLK injector #3
* ECU pin 41: OUT BRN/WHT injector #1
* ECU pin 45: GND crankshaft shield
* ECU pin 46: IN BLK BLU VR negative crankshaft sensor
*
*
* Plug #4 40 pin
* ECU pin 6: IN start signal from ignition key
* ECU pin 17: OUT BLK engine speed output for gauge cluster
* ECU pin 26: IN GRN/BLK RED +12 hot in start & run
* ECU pin 40: OUT YEL/BRN BRN starter enable
*
*
* Plug #5 9 pin
* ECU pic 3: OUT BLK coil signal, low-side
* ECU pic 5: GND BRN ground
* ECU pic 6: OUT BLK coil signal, low-side
* ECU pic 9: OUT BLK coil signal, low-side
*
* Frankenso
* set engine_type 40
* Manhattan
* set engine_type 24
*
* @date Nov 1, 2019
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#include "engine_template.h"
#include "custom_engine.h"
EXTERN_CONFIG;
static void m73engine(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// 13641435991 injector
engineConfiguration->injector.flow = 180; // cc/min, who knows if this number is real - no good source of info
engineConfiguration->specs.cylindersCount = 12;
engineConfiguration->specs.displacement = 5.4;
engineConfiguration->specs.firingOrder = FO_1_7_5_11_3_9_6_12_2_8_4_10;
engineConfiguration->vvtMode = VVT_FIRST_HALF;
engineConfiguration->globalTriggerAngleOffset = 90;
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
engineConfiguration->trigger.type = TT_60_2_VW;
engineConfiguration->ignitionMode = IM_TWO_COILS;
}
// BMW_M73_F
void setEngineBMW_M73_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
m73engine(PASS_CONFIG_PARAMETER_SIGNATURE);
boardConfiguration->triggerInputPins[0] = GPIOA_5;
boardConfiguration->triggerInputPins[1] = GPIO_UNASSIGNED;
engineConfiguration->camInputs[0] = GPIOC_6;
CONFIGB(idle).solenoidPin = GPIO_UNASSIGNED;
CONFIGB(mainRelayPin) = GPIO_UNASSIGNED;
CONFIGB(fanPin) = GPIO_UNASSIGNED;
CONFIGB(fuelPumpPin) = GPIO_UNASSIGNED;
boardConfiguration->ignitionPins[ID2INDEX(1)] = GPIOE_14; // Frankenso high side - pin 1G
boardConfiguration->ignitionPins[ID2INDEX(2)] = GPIO_UNASSIGNED;
boardConfiguration->ignitionPins[ID2INDEX(3)] = GPIO_UNASSIGNED;
boardConfiguration->ignitionPins[ID2INDEX(4)] = GPIO_UNASSIGNED;
boardConfiguration->ignitionPins[ID2INDEX(7)] = GPIOC_7; // Frankenso high side - pin 1H
boardConfiguration->injectionPins[0] = GPIOB_8;
boardConfiguration->injectionPins[1] = GPIOB_7;
boardConfiguration->injectionPins[2] = GPIOB_9;
boardConfiguration->injectionPins[3] = GPIOD_5;
boardConfiguration->injectionPins[4] = GPIOD_3;
boardConfiguration->injectionPins[5] = GPIOE_2;
boardConfiguration->injectionPins[6] = GPIOE_3;
boardConfiguration->injectionPins[7] = GPIOE_4;
boardConfiguration->injectionPins[8] = GPIOE_5;
boardConfiguration->injectionPins[9] = GPIOE_6;
boardConfiguration->injectionPins[10] = GPIOC_13;
boardConfiguration->injectionPins[11] = GPIOD_7;
}
// BMW_M73_M
void setEngineBMW_M73_Manhattan(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
m73engine(PASS_CONFIG_PARAMETER_SIGNATURE);
}

View File

@ -0,0 +1,13 @@
/*
* @file engine_template.h
*
* @date Nov 1, 2019
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#pragma once
#include "engine_configuration.h"
void setEngineBMW_M73_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setEngineBMW_M73_Manhattan(DECLARE_CONFIG_PARAMETER_SIGNATURE);

View File

@ -71,6 +71,8 @@ static const ignition_table_t default_tps_advance_table = {
EXTERN_CONFIG;
void setCitroenBerlingoTU3JPConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->engineType = CITROEN_TU3JP;
/**

View File

@ -85,6 +85,7 @@ void disableLCD(board_configuration_s *boardConfiguration) {
// todo: should this be part of more default configurations?
void setFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->trigger.type = TT_ONE_PLUS_ONE;
setFrankenso_01_LCD(boardConfiguration);
@ -244,6 +245,7 @@ void setFrankensoBoardTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// ETB_BENCH_ENGINE
// set engine_type 58
void setEtbTestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
// VAG test ETB
// set tps_min 54
engineConfiguration->tpsMin = 54;
@ -389,6 +391,7 @@ void setTle8888TestConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
* set engine_type 30
*/
void mreBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
#if (BOARD_TLE8888_COUNT > 0)
engineConfiguration->directSelfStimulation = true; // this engine type is used for board validation
boardConfiguration->triggerSimulatorFrequency = 60;
@ -496,6 +499,7 @@ void mreBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// TLE8888 high current low side: VVT2 IN9 / OUT5
// GPIOE_10: "3 - Lowside 2"
boardConfiguration->injectionPins[2 - 1] = GPIOE_10;
#endif /* BOARD_TLE8888_COUNT */
}
#endif /* CONFIG_ENGINES_CUSTOM_ENGINE_CPP_ */

View File

@ -145,6 +145,8 @@ static const fuel_table_t veDodgeNeon2003Table = {
EXTERN_CONFIG;
void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->trigger.type = TT_DODGE_NEON_1995;
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;
@ -249,6 +251,7 @@ void setDodgeNeon1995EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
}
void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->trigger.type = TT_DODGE_NEON_2003_CAM;
setFrankenso_01_LCD(boardConfiguration);
setFrankenso0_1_joystick(engineConfiguration);
@ -500,9 +503,5 @@ void setDodgeNeonNGCEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// end of setDodgeNeonNGCEngineConfiguration
}
void setDodgeNeonNGCEngineConfigurationCrankBased(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDodgeNeonNGCEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
}
#endif /* EFI_SUPPORT_DODGE_NEON */

View File

@ -2,7 +2,7 @@
* @file engine_template.cpp
*
* @date
* @author Andrey Belomutskiy, (c) 2012-2018
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#include "engine_template.h"

View File

@ -2,14 +2,11 @@
* @file engine_template.h
*
* @date
* @author Andrey Belomutskiy, (c) 2012-2017
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#ifndef CONFIG_ENGINES_ENGINE_TEMPLATE_H_
#define CONFIG_ENGINES_ENGINE_TEMPLATE_H_
#pragma once
#include "engine_configuration.h"
void setEngineTemplateConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* CONFIG_ENGINES_ENGINE_TEMPLATE_H_ */

View File

@ -4,6 +4,7 @@ ENGINES_SRC =
ENGINES_SRC_CPP = $(PROJECT_DIR)/config/engines/ford_aspire.cpp \
$(PROJECT_DIR)/config/engines/custom_engine.cpp \
$(PROJECT_DIR)/config/engines/bmw_e34.cpp \
$(PROJECT_DIR)/config/engines/bmw_m73.cpp \
$(PROJECT_DIR)/config/engines/mazda_miata.cpp \
$(PROJECT_DIR)/config/engines/mazda_miata_base_maps.cpp \
$(PROJECT_DIR)/config/engines/mazda_miata_1_6.cpp \
@ -22,7 +23,6 @@ ENGINES_SRC_CPP = $(PROJECT_DIR)/config/engines/ford_aspire.cpp \
$(PROJECT_DIR)/config/engines/rover_v8.cpp \
$(PROJECT_DIR)/config/engines/mazda_323.cpp \
$(PROJECT_DIR)/config/engines/mazda_626.cpp \
$(PROJECT_DIR)/config/engines/prometheus.cpp \
$(PROJECT_DIR)/config/engines/sachs.cpp \
$(PROJECT_DIR)/config/engines/test_engine.cpp \
$(PROJECT_DIR)/config/engines/mitsubishi.cpp \
@ -35,7 +35,6 @@ ENGINES_SRC_CPP = $(PROJECT_DIR)/config/engines/ford_aspire.cpp \
$(PROJECT_DIR)/config/engines/chevrolet_c20_1973.cpp \
$(PROJECT_DIR)/config/engines/toyota_jzs147.cpp \
$(PROJECT_DIR)/config/engines/lada_kalina.cpp \
$(PROJECT_DIR)/config/engines/geo_storm.cpp \
$(PROJECT_DIR)/config/engines/zil130.cpp \
$(PROJECT_DIR)/config/engines/honda_600.cpp \
$(PROJECT_DIR)/config/engines/me7pnp.cpp \

View File

@ -24,6 +24,8 @@ EXTERN_CONFIG;
* @brief Default values for persistent properties
*/
void setFordInline6(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->specs.cylindersCount = 6;
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);

View File

@ -88,6 +88,8 @@ static void setDefaultAspireMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
}
void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->tpsMin = 100;
engineConfiguration->tpsMax = 750;
@ -121,7 +123,7 @@ void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// set cranking_timing_angle 37
engineConfiguration->crankingTimingAngle = -37;
setSingleCoilDwell(engineConfiguration);
setSingleCoilDwell(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->ignitionMode = IM_ONE_COIL;
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
engineConfiguration->useOnlyRisingEdgeForTrigger = true;

View File

@ -9,11 +9,8 @@
*
*/
#ifndef FORD_ASPIRE_H_
#define FORD_ASPIRE_H_
#pragma once
#include "engine_configuration.h"
void setFordAspireEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* FORD_ASPIRE_H_ */

View File

@ -69,9 +69,9 @@ EXTERN_CONFIG;
* set engine_type 14
*/
void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;
common079721_2351(PASS_CONFIG_PARAMETER_SIGNATURE);
common079721_2351(engineConfiguration, boardConfiguration);
engineConfiguration->trigger.type = TT_MAZDA_DOHC_1_4;
setFrankenso_01_LCD(boardConfiguration);
setFrankenso0_1_joystick(engineConfiguration);
@ -155,7 +155,7 @@ void setFordEscortGt(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setWholeFuelMap(5 PASS_CONFIG_PARAMETER_SUFFIX);
setAfrMap(config->afrTable, 13.5);
setSingleCoilDwell(engineConfiguration);
setSingleCoilDwell(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->ignitionMode = IM_ONE_COIL;
boardConfiguration->triggerSimulatorPinModes[0] = OM_OPENDRAIN;

View File

@ -1,16 +0,0 @@
/*
* @file geo_storm.h
*
* @date Mar 26, 2016
* @author Andrey Belomutskiy, (c) 2012-2018
*/
#include "geo_storm.h"
#include "custom_engine.h"
EXTERN_CONFIG;
void setGeoStormConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
}

View File

@ -1,15 +0,0 @@
/*
* @file geo_storm.h
*
* @date Mar 26, 2016
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef CONFIG_ENGINES_GEO_STORM_H_
#define CONFIG_ENGINES_GEO_STORM_H_
#include "engine_configuration.h"
void setGeoStormConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* CONFIG_ENGINES_GEO_STORM_H_ */

View File

@ -64,6 +64,7 @@ static void setDefaultCustomMaps(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
}
void setHonda600(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->trigger.type = TT_HONDA_CBR_600_CUSTOM;
engineConfiguration->fuelAlgorithm = LM_ALPHA_N;

View File

@ -8,8 +8,7 @@
* MIATA_1990 = 19 (Frankenstein board)
* MIATA_1994_DEVIATOR = 20
* MIATA_1996 = 21
* MIATA_1994_SPAGS = 24
* set engine_type 24
* set engine_type 21
*
* @date Apr 11, 2014
* @author Andrey Belomutskiy, (c) 2012-2018
@ -167,7 +166,8 @@ static void commonMiataNa(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setCommonNTCSensor(&engineConfiguration->iat, 2700);
}
void common079721_2351(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration) {
void common079721_2351(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->engineChartSize = 300;
@ -204,7 +204,7 @@ void common079721_2351(engine_configuration_s *engineConfiguration, board_config
* Frankenstein board
*/
void setMiata1990(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
common079721_2351(engineConfiguration, boardConfiguration);
common079721_2351(PASS_CONFIG_PARAMETER_SIGNATURE);
commonMiataNa(PASS_CONFIG_PARAMETER_SIGNATURE);
@ -313,6 +313,7 @@ static void setMiata1994_common(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
*/
void setMiata1994_d(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setMiata1994_common(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->vbattDividerCoeff = ((float) (8.2 + 33)) / 8.2 * 2;
/**
* This board was avoiding PE0 & PE1 mosfets altogether
@ -326,47 +327,6 @@ void setMiata1994_d(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
boardConfiguration->idle.solenoidPin = GPIO_UNASSIGNED;
}
void setMiata1994_s(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setMiata1994_common(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->vbattDividerCoeff = ((float) (10.0 + 33)) / 10 * 2;
boardConfiguration->triggerSimulatorPins[2] = GPIO_UNASSIGNED;
engineConfiguration->acSwitchAdc = EFI_ADC_1; // PA1, W50 on Frankenso
engineConfiguration->afr.hwChannel = EFI_ADC_3;
setEgoSensor(ES_Innovate_MTX_L PASS_CONFIG_PARAMETER_SUFFIX);
/**
* This board has PE0<>PD5 & PE1<>PD3 rewired in order to avoid Discovery issue
*/
boardConfiguration->injectionPins[0] = GPIOD_3; // avoiding PE1
boardConfiguration->injectionPins[1] = GPIOE_2; // injector #2
boardConfiguration->injectionPins[2] = GPIOB_8; // injector #3
boardConfiguration->injectionPins[3] = GPIOB_7; // injector #4
// setFsio(engineConfiguration, 0, GPIOD_11, "coolant 80 >");
boardConfiguration->idle.solenoidFrequency = 500;
engineConfiguration->acCutoffLowRpm = 400;
engineConfiguration->acCutoffHighRpm = 4500;
engineConfiguration->acIdleRpmBump = 200;
//engineConfiguration->idleMode != IM_AUTO;
setTargetRpmCurve(800 PASS_CONFIG_PARAMETER_SUFFIX);
engineConfiguration->tpsMax = 86;
engineConfiguration->tpsMin = 596;
boardConfiguration->malfunctionIndicatorPin = GPIOE_5;
boardConfiguration->malfunctionIndicatorPinMode = OM_DEFAULT;
engineConfiguration->fuelAlgorithm = LM_REAL_MAF;
setMazdaMiataNAMaf(config);
engineConfiguration->injector.flow = 230;
}
/**
* Tom tomiata, Frankenstein board
*/

View File

@ -9,15 +9,11 @@
* Injectors: Denso 195500-2180, 230-265cc (?), tan, 13.9 ohms
*/
#ifndef MAZDA_MIATA_H_
#define MAZDA_MIATA_H_
#pragma once
#include "engine_configuration.h"
void common079721_2351(engine_configuration_s *engineConfiguration, board_configuration_s *boardConfiguration);
void common079721_2351(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setMiata1990(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setMiata1994_d(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setMiata1994_s(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setMiata1996(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* MAZDA_MIATA_H_ */

View File

@ -198,6 +198,8 @@ static void setMiataNA6_settings(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
* MIATA_NA6_MAP
*/
void setMiataNA6_MAP_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
boardConfiguration->isHip9011Enabled = false;
@ -301,6 +303,7 @@ void setMiataNA6_VAF_Frankenso(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
* set engine_type 12
*/
void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
#if (BOARD_TLE8888_COUNT > 0)
// idle.solenoidPin output is inherited from boards/microrusefi/board_configuration.cpp
// CLT: "18 - AN temp 1"
// IAT: "23 - AN temp 2"
@ -345,5 +348,5 @@ void setMiataNA6_VAF_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setMiataNA6_settings(PASS_CONFIG_PARAMETER_SIGNATURE);
miataNAcommonEngineSettings(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->fuelAlgorithm = LM_PLAIN_MAF;
#endif /* BOARD_TLE8888_COUNT */
}

View File

@ -5,11 +5,8 @@
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef CONFIG_ENGINES_MAZDA_MIATA_NA8_H_
#define CONFIG_ENGINES_MAZDA_MIATA_NA8_H_
#pragma once
#include "engine_configuration.h"
void setMazdaMiataNA8Configuration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* CONFIG_ENGINES_MAZDA_MIATA_NA8_H_ */

View File

@ -18,6 +18,8 @@
EXTERN_CONFIG;
void setMazdaMiataNb1EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
// set_rpm_hard_limit 3000
engineConfiguration->rpmHardLimit = 3000; // yes, 3k. let's play it safe for now

View File

@ -5,11 +5,9 @@
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef MAZDA_MIATA_NB1_H_
#define MAZDA_MIATA_NB1_H_
#pragma once
#include "engine_configuration.h"
void setMazdaMiataNb1EngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* MAZDA_MIATA_NB1_H_ */

View File

@ -486,6 +486,7 @@ void setMazdaMiata2003EngineConfigurationBoardTest(DECLARE_CONFIG_PARAMETER_SIGN
* set engine_type 13
*/
void setMiataNB2_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
#if (BOARD_TLE8888_COUNT > 0)
setMazdaMiataEngineNB2Defaults(PASS_CONFIG_PARAMETER_SIGNATURE);
// MRE has a special main relay control low side pin - rusEfi firmware is totally not involved with main relay control
@ -564,5 +565,5 @@ void setMiataNB2_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
// 0.3#4 has wrong R139 as well?
// 56k high side/10k low side multiplied by above analogInputDividerCoefficient = 11
engineConfiguration->vbattDividerCoeff = (66.0f / 10.0f) * engineConfiguration->analogInputDividerCoefficient;
#endif /* BOARD_TLE8888_COUNT */
}

View File

@ -7,8 +7,7 @@
* http://rusefi.com/forum/viewtopic.php?f=3&t=1095
*/
#ifndef CONFIG_ENGINES_MAZDA_MIATA_VVT_H_
#define CONFIG_ENGINES_MAZDA_MIATA_VVT_H_
#pragma once
#include "engine_configuration.h"
@ -20,5 +19,3 @@ void setMazdaMiata2003EngineConfigurationNaFuelRail(DECLARE_CONFIG_PARAMETER_SIG
void setMazdaMiata2003EngineConfigurationBoardTest(DECLARE_CONFIG_PARAMETER_SIGNATURE);
void setMiataNB2_MRE(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* CONFIG_ENGINES_MAZDA_MIATA_VVT_H_ */

View File

@ -17,6 +17,8 @@
EXTERN_CONFIG;
void setMitsubishiConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->engineType = MITSU_4G93;
engineConfiguration->trigger.type = TT_MITSUBISHI; // same trigger as 4G63?

View File

@ -1,17 +0,0 @@
/*
* prometheus.cpp
*
* set engine_type 100
*
* @date May 6, 2017
* @author Andrey Belomutskiy, (c) 2012-2018
*/
#include "prometheus.h"
void setPrometheusDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
}

View File

@ -1,14 +0,0 @@
/*
* prometheus.h
*
* @date May 6, 2017
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef CONFIG_ENGINES_PROMETHEUS_H_
#define CONFIG_ENGINES_PROMETHEUS_H_
#include "engine_configuration.h"
void setPrometheusDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE);
#endif /* CONFIG_ENGINES_PROMETHEUS_H_ */

View File

@ -1,9 +1,15 @@
In TunerStudio or rusEfi console please use "Popular Vehicles" dialog to apply some of these presets.
This directory contains pre-defined configurations for popular engines.
These configurations are a convenience, not a limit. Most engine types
can be manually configured.
Please do not be afraid of the content of this folder. You would NOT need your own file to start your own engine.
In TunerStudio or rusEfi console use the "Popular Vehicles" dialog to
apply one of these presets.
See http://rusefi.com/wiki/index.php?title=Manual:Engine_Type
This folder is also used by continutes integration testing suite.
This folder is also used by the continuous integration testing suite.
New configurations should follow the pattern of <make>_<model>.cpp for
consistency. A future change may rename these to <make>_<engine>.cpp

View File

@ -28,6 +28,8 @@ void setFrankenstein_01_LCD(board_configuration_s *boardConfiguration) {
EXTERN_CONFIG;
void setRoverv8(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
// set trigger_type 9
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL_36_1;

View File

@ -15,6 +15,8 @@
EXTERN_CONFIG;
void setSachs(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->specs.displacement = 0.1; // 100cc
engineConfiguration->specs.cylindersCount = 1;

View File

@ -18,6 +18,7 @@
EXTERN_CONFIG;
void setTestEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
setOperationMode(engineConfiguration, FOUR_STROKE_CAM_SENSOR);
engineConfiguration->trigger.type = TT_ONE_PLUS_ONE;
@ -54,6 +55,7 @@ void setTestEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
}
void setTestVVTEngineConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setDefaultFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
setOperationMode(engineConfiguration, FOUR_STROKE_CRANK_SENSOR);
engineConfiguration->trigger.type = TT_TOOTHED_WHEEL;

View File

@ -752,6 +752,9 @@
#ifndef __ASSEMBLER__
#ifdef __cplusplus
extern "C"
#endif
void chDbgPanic3(const char *msg, const char * file, int line);
#endif

View File

@ -7,8 +7,7 @@
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#ifndef EFIFEATURES_STM32F4_H_
#define EFIFEATURES_STM32F4_H_
#pragma once
#define EFI_GPIO_HARDWARE TRUE
@ -404,5 +403,3 @@
#define INTERMEDIATE_LOGGING_BUFFER_SIZE 2000
#define EFI_JOYSTICK TRUE
#endif /* EFIFEATURES_STM32F4_H_ */

View File

@ -710,6 +710,9 @@
#ifndef __ASSEMBLER__
#ifdef __cplusplus
extern "C"
#endif
void chDbgPanic3(const char *msg, const char * file, int line);
#endif

View File

@ -12,8 +12,7 @@
#include "../stm32f4ems/efifeatures.h"
#ifndef EFIFEATURES_STM32F7_H_
#define EFIFEATURES_STM32F7_H_
#pragma once
// Warning! This is a test config!
@ -109,5 +108,3 @@
// todo: temporary ignore errors, this is a test config
#define EFI_PRINT_ERRORS_AS_WARNINGS TRUE
#endif /* EFIFEATURES_STM32F7_H_ */

View File

@ -267,7 +267,7 @@ static const void * getStructAddr(int structId) {
case LDS_ENGINE_STATE_INDEX:
return static_cast<engine_state2_s*>(&engine->engineState);
case LDS_FUEL_TRIM_STATE_INDEX:
return static_cast<wall_fuel_state*>(&engine->wallFuel);
return static_cast<wall_fuel_state*>(&engine->wallFuel[0]);
case LDS_TRIGGER_CENTRAL_STATE_INDEX:
return static_cast<trigger_central_s*>(&engine->triggerCentral);
case LDS_TRIGGER_STATE_STATE_INDEX:
@ -308,9 +308,11 @@ static void handleGetStructContent(ts_channel_s *tsChannel, int structId, int si
* read log file content for rusEfi console
*/
static void handleReadFileContent(ts_channel_s *tsChannel, short fileId, short offset, short length) {
#if EFI_FILE_LOGGING
readLogFileContent(tsChannel->crcReadBuffer, fileId, offset, length);
#endif /* EFI_FILE_LOGGING */
//#if EFI_FILE_LOGGING
// readLogFileContent(tsChannel->crcReadBuffer, fileId, offset, length);
//#else
UNUSED(tsChannel); UNUSED(fileId); UNUSED(offset); UNUSED(length);
//#endif /* EFI_FILE_LOGGING */
}
/**
@ -720,7 +722,7 @@ static void handleExecuteCommand(ts_channel_s *tsChannel, char *data, int incomi
*/
bool handlePlainCommand(ts_channel_s *tsChannel, uint8_t command) {
// Bail fast if guaranteed not to be a plain command
if(command == 0)
if (command == 0)
{
return false;
}

View File

@ -111,6 +111,7 @@ static void sayHello(void) {
chThdSleepMilliseconds(5);
}
#if CH_DBG_THREADS_PROFILING && CH_DBG_FILL_THREADS
static uintptr_t CountFreeStackSpace(const void* wabase)
{
const uint8_t* stackBase = reinterpret_cast<const uint8_t*>(wabase);
@ -124,6 +125,7 @@ static uintptr_t CountFreeStackSpace(const void* wabase)
return stackUsage - stackBase;
}
#endif
/**
* This methods prints all threads, their stack usage, and their total times
@ -164,6 +166,8 @@ void print(const char *format, ...) {
va_start(ap, format);
chvprintf((BaseSequentialStream*) getConsoleChannel(), format, ap);
va_end(ap);
#else
UNUSED(format);
#endif /* EFI_UART_ECHO_TEST_MODE */
}

View File

@ -91,6 +91,10 @@ extern int icuWidthPeriodCounter;
#include "fsio_impl.h"
#endif /* EFI_FSIO */
#if (BOARD_TLE8888_COUNT > 0)
#include "tle8888.h"
#endif /* BOARD_TLE8888_COUNT */
#if EFI_ENGINE_SNIFFER
#include "engine_sniffer.h"
extern WaveChart waveChart;
@ -121,9 +125,10 @@ static void setWarningEnabled(int value) {
// this one needs to be in main ram so that SD card SPI DMA works fine
static char FILE_LOGGER[1000] MAIN_RAM;
static Logging fileLogger("file logger", FILE_LOGGER, sizeof(FILE_LOGGER));
static int logFileLineIndex = 0;
#endif /* EFI_FILE_LOGGING */
static int logFileLineIndex = 0;
#define TAB "\t"
static void reportSensorF(Logging *log, const char *caption, const char *units, float value,
@ -147,6 +152,9 @@ static void reportSensorF(Logging *log, const char *caption, const char *units,
appendFloat(log, value, precision);
append(log, TAB);
}
#else
UNUSED(log);UNUSED(caption);UNUSED(units);UNUSED(value);
UNUSED(precision);
#endif /* EFI_FILE_LOGGING */
}
}
@ -162,6 +170,8 @@ static void reportSensorI(Logging *log, const char *caption, const char *units,
} else {
appendPrintf(log, "%d%s", value, TAB);
}
#else
UNUSED(log);UNUSED(caption);UNUSED(units);UNUSED(value);
#endif /* EFI_FILE_LOGGING */
}
@ -184,6 +194,7 @@ static float getAirFlowGauge(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
return hasMafSensor() ? getRealMaf(PASS_ENGINE_PARAMETER_SIGNATURE) : engine->engineState.airFlow;
}
#if EFI_FILE_LOGGING
static void printSensors(Logging *log) {
bool fileFormat = true; // todo:remove this unused variable
// current time, in milliseconds
@ -324,8 +335,8 @@ static void printSensors(Logging *log) {
// 268
reportSensorF(log, GAUGE_NAME_FUEL_PID_CORR, "ms", ENGINE(engineState.running.pidCorrection), 2);
reportSensorF(log, GAUGE_NAME_FUEL_WALL_AMOUNT, "v", ENGINE(wallFuel).getWallFuel(0), 2);
reportSensorF(log, GAUGE_NAME_FUEL_WALL_CORRECTION, "v", ENGINE(wallFuel).wallFuelCorrection, 2);
reportSensorF(log, GAUGE_NAME_FUEL_WALL_AMOUNT, "v", ENGINE(wallFuel[0]).getWallFuel(), 2);
reportSensorF(log, GAUGE_NAME_FUEL_WALL_CORRECTION, "v", ENGINE(wallFuel[0]).wallFuelCorrection, 2);
reportSensorI(log, GAUGE_NAME_VERSION, "#", getRusEfiVersion());
@ -377,6 +388,8 @@ static void printSensors(Logging *log) {
reportSensorI(log, INDICATOR_NAME_AC_SWITCH, "bool", engine->acSwitchState);
}
#endif /* EFI_FILE_LOGGING */
void writeLogLine(void) {
#if EFI_FILE_LOGGING
@ -567,7 +580,7 @@ static void showFuelInfo(void) {
}
#endif
static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin, &enginePins.checkEnginePin,
static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPin,
&enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin };
static void initStatusLeds(void) {
@ -577,6 +590,10 @@ static void initStatusLeds(void) {
enginePins.warningLedPin.initPin("led: warning status", engineConfiguration->warningLedPin);
enginePins.runningLedPin.initPin("led: running status", engineConfiguration->runningLedPin);
enginePins.debugTriggerSync.initPin("debug: sync", CONFIGB(debugTriggerSync));
enginePins.debugTimerCallback.initPin("debug: timer callback", CONFIGB(debugTimerCallback));
enginePins.debugSetTimer.initPin("debug: set timer", CONFIGB(debugSetTimer));
}
#define BLINKING_PERIOD_MS 33
@ -754,11 +771,11 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
// 148
tsOutputChannels->fuelTankLevel = engine->sensors.fuelTankLevel;
// 160
tsOutputChannels->wallFuelAmount = ENGINE(wallFuel).getWallFuel(0);
tsOutputChannels->wallFuelAmount = ENGINE(wallFuel[0]).getWallFuel();
// 164
tsOutputChannels->iatCorrection = ENGINE(engineState.running.intakeTemperatureCoefficient);
// 168
tsOutputChannels->wallFuelCorrection = ENGINE(wallFuel).wallFuelCorrection;
tsOutputChannels->wallFuelCorrection = ENGINE(wallFuel[0]).wallFuelCorrection;
// 184
tsOutputChannels->cltCorrection = ENGINE(engineState.running.coolantTemperatureCoefficient);
// 188
@ -855,10 +872,11 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->speedToRpmRatio = vehicleSpeed / rpm;
#endif /* EFI_VEHICLE_SPEED */
tsOutputChannels->isCltError = !isValidCoolantTemperature(getCoolantTemperature());
tsOutputChannels->isIatError = !isValidIntakeAirTemperature(getIntakeAirTemperature());
#endif /* EFI_PROD_CODE */
tsOutputChannels->isCltError = !hasCltSensor();
tsOutputChannels->isIatError = !hasIatSensor();
tsOutputChannels->fuelConsumptionPerHour = engine->engineState.fuelConsumption.perSecondConsumption;
tsOutputChannels->warningCounter = engine->engineState.warnings.warningCounter;
@ -919,7 +937,7 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->debugIntField1 = engine->triggerCentral.getHwEventCounter((int)SHAFT_PRIMARY_FALLING);
tsOutputChannels->debugIntField2 = engine->triggerCentral.getHwEventCounter((int)SHAFT_SECONDARY_FALLING);
tsOutputChannels->debugIntField3 = engine->triggerCentral.getHwEventCounter((int)SHAFT_3RD_FALLING);
#if EFI_PROD_CODE
#if EFI_PROD_CODE && HAL_USE_ICU == TRUE
tsOutputChannels->debugIntField4 = engine->triggerCentral.vvtEventRiseCounter;
tsOutputChannels->debugIntField5 = engine->triggerCentral.vvtEventFallCounter;
tsOutputChannels->debugFloatField5 = icuWidthCallbackCounter + icuWidthPeriodCounter;
@ -999,6 +1017,11 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
ionPostState(tsOutputChannels);
#endif /* EFI_CDM_INTEGRATION */
break;
case DBG_TLE8888:
#if (BOARD_TLE8888_COUNT > 0)
tle8888PostState(tsOutputChannels);
#endif /* BOARD_TLE8888_COUNT */
break;
default:
;
}

View File

@ -32,7 +32,7 @@ static Logging *logger;
static SimplePwm alternatorControl("alt");
static pid_s *altPidS = &persistentState.persistentConfiguration.engineConfiguration.alternatorControl;
Pid alternatorPid(altPidS);
static PidIndustrial alternatorPid(altPidS);
static percent_t currentAltDuty;
@ -56,6 +56,10 @@ class AlternatorController : public PeriodicTimerController {
}
#endif
// todo: move this to pid_s one day
alternatorPid.antiwindupFreq = engineConfiguration->alternator_antiwindupFreq;
alternatorPid.derivativeFilterLoss = engineConfiguration->alternator_derivativeFilterLoss;
if (engineConfiguration->debugMode == DBG_ALTERNATOR_PID) {
// this block could be executed even in on/off alternator control mode
// but at least we would reflect latest state
@ -148,7 +152,7 @@ void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousCon
shouldResetPid = !alternatorPid.isSame(&previousConfiguration->alternatorControl);
}
void initAlternatorCtrl(Logging *sharedLogger) {
void initAlternatorCtrl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
logger = sharedLogger;
addConsoleAction("altinfo", showAltInfo);
if (CONFIGB(alternatorControlPin) == GPIO_UNASSIGNED)

View File

@ -15,15 +15,13 @@
* it is believed that more than just PID would be needed, as is this is probably
* not usable on a real vehicle. Needs to be tested :)
*
*
* https://raw.githubusercontent.com/wiki/rusefi/rusefi_documentation/oem_docs/VAG/Bosch_0280750009_pinout.jpg
*
* ETB is controlled according to pedal position input (pedal position sensor is a potentiometer)
* pedal 0% means pedal not pressed / idle
* pedal 100% means pedal all the way down
* (not TPS - not the one you can calibrate in TunerStudio)
*
* At the moment we only control opening motor - while relying on ETB spring to move throttle butterfly
* back. Throttle position sensor inside ETB is used for closed-loop PID control of ETB.
*
* See also pid.cpp
*
@ -481,7 +479,7 @@ void setDefaultEtbParameters(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->etb.maxValue = 200;
}
static bool isSamePins(etb_io *current, etb_io *active) {
static bool isEtbPinsChanged(etb_io *current, etb_io *active) {
return current->controlPin1 != active->controlPin1 ||
current->controlPinMode != active->controlPinMode ||
current->directionPin1 != active->directionPin1 ||
@ -493,7 +491,7 @@ bool isETBRestartNeeded(void) {
/**
* We do not want any interruption in HW pin while adjusting other properties
*/
return isSamePins(&engineConfiguration->bc.etb1, &activeConfiguration.bc.etb1);
return isEtbPinsChanged(&engineConfiguration->bc.etb1, &activeConfiguration.bc.etb1);
}
void stopETBPins(void) {
@ -519,6 +517,7 @@ void startETBPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
);
}
#if EFI_PROD_CODE && 0
static void setTempOutput(float value) {
autoTune.output = value;
}
@ -540,6 +539,7 @@ static void setAutoOffset(int offset) {
tuneWorkingPidSettings.offset = offset;
autoTune.reset();
}
#endif
void setDefaultEtbBiasCurve(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
engineConfiguration->etbBiasBins[0] = 0;

View File

@ -2,11 +2,10 @@
* @file electronic_throttle.h
*
* @date Dec 7, 2013
* @author Andrey Belomutskiy, (c) 2012-2017
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#ifndef ELECTRONIC_THROTTLE_H_
#define ELECTRONIC_THROTTLE_H_
#pragma once
// https://en.wikipedia.org/wiki/Nyquist%E2%80%93Shannon_sampling_theorem
#define DEFAULT_ETB_LOOP_FREQUENCY 200
@ -37,5 +36,3 @@ void stopETBPins(void);
void startETBPins(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void onConfigurationChangeElectronicThrottleCallback(engine_configuration_s *previousConfiguration);
void unregisterEtbPins();
#endif /* ELECTRONIC_THROTTLE_H_ */

View File

@ -293,7 +293,7 @@ static percent_t automaticIdleController(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
int idlePidLowerRpm = targetRpm + CONFIG(idlePidRpmDeadZone);
if (CONFIG(idlePidRpmUpperLimit) > 0) {
engine->engineState.idle.idleState = PID_UPPER;
if (CONFIGB(useIacTableForCoasting) && !cisnan(engine->sensors.clt)) {
if (CONFIGB(useIacTableForCoasting) && hasCltSensor()) {
percent_t iacPosForCoasting = interpolate2d("iacCoasting", getCoolantTemperature(), CONFIG(iacCoastingBins), CONFIG(iacCoasting));
newValue = interpolateClamped(idlePidLowerRpm, newValue, idlePidLowerRpm + CONFIG(idlePidRpmUpperLimit), iacPosForCoasting, rpm);
} else {
@ -371,7 +371,7 @@ static percent_t automaticIdleController(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
#endif /* EFI_SHAFT_POSITION_INPUT */
// cltCorrection is used only for cranking or running in manual mode
float cltCorrection;
if (cisnan(clt))
if (!hasCltSensor())
cltCorrection = 1.0f;
// Use separate CLT correction table for cranking
else if (engineConfiguration->overrideCrankingIacSetting && !isRunning) {
@ -526,7 +526,30 @@ static void applyIdleSolenoidPinState(int stateIndex, PwmConfig *state) /* pwm_g
}
}
static void initIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
bool isIdleHardwareRestartNeeded() {
return isConfigurationChanged(stepperEnablePin) ||
isConfigurationChanged(stepperEnablePinMode) ||
isConfigurationChanged(bc.idle.stepperStepPin) ||
isConfigurationChanged(bc.idle.solenoidFrequency) ||
isConfigurationChanged(bc.useStepperIdle) ||
// isConfigurationChanged() ||
isConfigurationChanged(bc.useETBforIdleControl) ||
isConfigurationChanged(bc.idle.solenoidPin);
}
void stopIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
brain_pin_markUnused(activeConfiguration.stepperEnablePin);
brain_pin_markUnused(activeConfiguration.bc.idle.stepperStepPin);
brain_pin_markUnused(activeConfiguration.bc.idle.solenoidPin);
// brain_pin_markUnused(activeConfiguration.bc.idle.);
// brain_pin_markUnused(activeConfiguration.bc.idle.);
// brain_pin_markUnused(activeConfiguration.bc.idle.);
// brain_pin_markUnused(activeConfiguration.bc.idle.);
}
void initIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (CONFIGB(useStepperIdle)) {
iacMotor.initialize(CONFIGB(idle).stepperStepPin,
CONFIGB(idle).stepperDirectionPin,
@ -537,7 +560,7 @@ static void initIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
logger);
// This greatly improves PID accuracy for steppers with a small number of steps
idlePositionSensitivityThreshold = 1.0f / engineConfiguration->idleStepperTotalSteps;
} else {
} else if (!engineConfiguration->bc.useETBforIdleControl) {
/**
* Start PWM for idleValvePin
*/
@ -559,7 +582,8 @@ void startIdleThread(Logging*sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
idlePid.initPidClass(&engineConfiguration->idleRpmPid);
#if ! EFI_UNIT_TEST
// todo: re-initialize idle pins on the fly
// todo: we still have to explicitly init all hardware on start in addition to handling configuration change via
// 'applyNewHardwareSettings' todo: maybe unify these two use-cases?
initIdleHardware(PASS_ENGINE_PARAMETER_SIGNATURE);
#endif /* EFI_UNIT_TEST */

View File

@ -3,11 +3,10 @@
* @brief Idle Valve Control thread
*
* @date May 23, 2013
* @author Andrey Belomutskiy, (c) 2012-2017
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#ifndef IDLE_THREAD_H_
#define IDLE_THREAD_H_
#pragma once
#include "engine.h"
#include "periodic_task.h"
@ -33,6 +32,8 @@ void setIdleDFactor(float value);
void setIdleMode(idle_mode_e value);
void setTargetIdleRpm(int value);
void setIdleDT(int value);
void stopIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void initIdleHardware(DECLARE_ENGINE_PARAMETER_SIGNATURE);
bool isIdleHardwareRestartNeeded();
void onConfigurationChangeIdleCallback(engine_configuration_s *previousConfiguration);
#endif /* IDLE_THREAD_H_ */

View File

@ -161,6 +161,7 @@ static const char* idleModeStr[] = { "I:A", "I:M" };
// }
//}
#if 0
static char * prepareInfoLine(engine_configuration_s *engineConfiguration, char *buffer) {
char *ptr = buffer;
@ -176,6 +177,7 @@ static char * prepareInfoLine(engine_configuration_s *engineConfiguration, char
ptr = appendStr(ptr, " ");
return ptr;
}
#endif
//static char * prepareStatusLine(char *buffer) {
// char *ptr = buffer;

View File

@ -25,7 +25,8 @@ static void turnTachPinLow(void) {
static void tachSignalCallback(trigger_event_e ckpSignalType,
uint32_t index DECLARE_ENGINE_PARAMETER_SUFFIX) {
if (index != engineConfiguration->tachPulseTriggerIndex) {
UNUSED(ckpSignalType);
if (index != (uint32_t)engineConfiguration->tachPulseTriggerIndex) {
return;
}
enginePins.tachOut.setHigh();

View File

@ -39,16 +39,13 @@ tps_tps_Map3D_t tpsTpsMap("tpsTps");
static Logging *logger = nullptr;
WallFuel::WallFuel() {
resetWF();
}
void WallFuel::resetWF() {
wallFuel = 0;
}
//
floatms_t WallFuel::adjust(int injectorIndex, floatms_t desiredFuel DECLARE_ENGINE_PARAMETER_SUFFIX) {
floatms_t WallFuel::adjust(floatms_t desiredFuel DECLARE_ENGINE_PARAMETER_SUFFIX) {
invocationCounter++;
if (cisnan(desiredFuel)) {
return desiredFuel;
}
@ -118,7 +115,7 @@ floatms_t WallFuel::adjust(int injectorIndex, floatms_t desiredFuel DECLARE_ENGI
beta = alpha;
}
float fuelFilmMass = wallFuel/*[injectorIndex]*/;
float fuelFilmMass = wallFuel;
float M_cmd = (desiredFuel - (1 - alpha) * fuelFilmMass) / (1 - beta);
// We can't inject a negative amount of fuel
@ -132,15 +129,15 @@ floatms_t WallFuel::adjust(int injectorIndex, floatms_t desiredFuel DECLARE_ENGI
float fuelFilmMassNext = alpha * fuelFilmMass + beta * M_cmd;
DISPLAY_TEXT(Current_Wall_Fuel_Film);
DISPLAY_FIELD(wallFuel)/*[injectorIndex]*/ = fuelFilmMassNext;
DISPLAY_FIELD(wallFuel) = fuelFilmMassNext;
DISPLAY_TEXT(Fuel correction);
DISPLAY_FIELD(wallFuelCorrection) = M_cmd - desiredFuel;
DISPLAY_TEXT(ms);
return M_cmd;
}
floatms_t WallFuel::getWallFuel(int injectorIndex) const {
return wallFuel/*[injectorIndex]*/;
floatms_t WallFuel::getWallFuel() const {
return wallFuel;
}
int AccelEnrichment::getMaxDeltaIndex(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
@ -242,7 +239,7 @@ float LoadAccelEnrichment::getEngineLoadEnrichment(DECLARE_ENGINE_PARAMETER_SIGN
float taper = 0;
if (d > engineConfiguration->engineLoadAccelEnrichmentThreshold) {
int distance = cb.currentIndex - index;
distance = cb.currentIndex - index;
if (distance <= 0) // checking if indexes are out of order due to circular buffer nature
distance += minI(cb.getCount(), cb.getSize());
@ -292,6 +289,8 @@ void TpsAccelEnrichment::onEngineCycleTps(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// we update values in handleFuel() directly
//onNewValue(getTPS(PASS_ENGINE_PARAMETER_SIGNATURE) PASS_ENGINE_PARAMETER_SUFFIX);
onUpdateInvocationCounter++;
// we used some extra fuel during the current cycle, so we "charge" our "acceleration pump" with it
accumulatedValue -= maxExtraPerPeriod;
maxExtraPerPeriod = maxF(maxExtraPerCycle, maxExtraPerPeriod);

View File

@ -7,8 +7,7 @@
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef ACC_ENRICHMENT_H_
#define ACC_ENRICHMENT_H_
#pragma once
#include "global.h"
#include "cyclic_buffer.h"
@ -30,6 +29,7 @@ public:
void setLength(int length);
cyclic_buffer<float> cb;
void onNewValue(float currentValue DECLARE_ENGINE_PARAMETER_SUFFIX);
int onUpdateInvocationCounter = 0;
};
class LoadAccelEnrichment : public AccelEnrichment {
@ -67,15 +67,14 @@ private:
*/
class WallFuel : public wall_fuel_state {
public:
WallFuel();
/**
* @param target desired squirt duration
* @return total adjusted fuel squirt duration once wall wetting is taken into effect
*/
floatms_t adjust(int injectorIndex, floatms_t target DECLARE_ENGINE_PARAMETER_SUFFIX);
floatms_t getWallFuel(int injectorIndex) const;
floatms_t adjust(floatms_t target DECLARE_ENGINE_PARAMETER_SUFFIX);
floatms_t getWallFuel() const;
void resetWF();
private:
int invocationCounter = 0;
};
void initAccelEnrichment(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX);
@ -93,6 +92,3 @@ void setDecelThr(float value);
void setDecelMult(float value);
void updateAccelParameters();
#endif /* ACC_ENRICHMENT_H_ */

View File

@ -113,7 +113,7 @@ static angle_t getRunningAdvance(int rpm, float engineLoad DECLARE_ENGINE_PARAME
angle_t getAdvanceCorrections(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
float iatCorrection;
if (cisnan(engine->sensors.iat)) {
if (!hasIatSensor()) {
iatCorrection = 0;
} else {
iatCorrection = iatAdvanceCorrectionMap.getValue((float) rpm, getIntakeAirTemperature());

View File

@ -5,8 +5,7 @@
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef ADVANCE_H_
#define ADVANCE_H_
#pragma once
#include "engine.h"
@ -17,5 +16,3 @@ float getTopAdvanceForBore(chamber_style_e style, int octane, double compression
float getInitialAdvance(int rpm, float map, float advanceMax);
void buildTimingMap(float advanceMax DECLARE_CONFIG_PARAMETER_SUFFIX);
angle_t getAdvanceCorrections(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX);
#endif /* ADVANCE_H_ */

View File

@ -5,12 +5,9 @@
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef ALGO_H_
#define ALGO_H_
#pragma once
#include "global.h"
#include "engine_configuration.h"
void initDataStructures(DECLARE_ENGINE_PARAMETER_SIGNATURE);
void initAlgo(Logging *sharedLogger);
#endif /* ALGO_H_ */

View File

@ -707,8 +707,10 @@ case FRANKENSO_QA_ENGINE:
return "FRANKENSO_QA_ENGINE";
case Force_4_bytes_size_engine_type:
return "Force_4_bytes_size_engine_type";
case GEO_STORM:
return "GEO_STORM";
case BMW_M73_F:
return "BMW_M73_F";
case BMW_M73_M:
return "BMW_M73_M";
case MRE_BOARD_TEST:
return "MRE_BOARD_TEST";
case GY6_139QMB:
@ -743,8 +745,6 @@ case MIATA_1990:
return "MIATA_1990";
case MIATA_1994_DEVIATOR:
return "MIATA_1994_DEVIATOR";
case MIATA_1994_SPAGS:
return "MIATA_1994_SPAGS";
case MIATA_1996:
return "MIATA_1996";
case MIATA_NA6_MAP:

View File

@ -372,13 +372,9 @@ void Engine::periodicFastCallback(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
engine->m.beforeFuelCalc = getTimeNowLowerNt();
int rpm = GET_RPM();
/**
* we have same assignment of 'getInjectionDuration' to 'injectionDuration' in handleFuel()
* Open question why do we refresh that in two places?
*/
ENGINE(injectionDuration) = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
engine->m.fuelCalcTime = getTimeNowLowerNt() - engine->m.beforeFuelCalc;
}
void doScheduleStopEngine(DECLARE_ENGINE_PARAMETER_SIGNATURE) {

View File

@ -29,7 +29,7 @@
#include "global_execution_queue.h"
#endif /* EFI_UNIT_TEST */
#define FAST_CALLBACK_PERIOD_MS 20
#define FAST_CALLBACK_PERIOD_MS 5
class RpmCalculator;
@ -62,6 +62,11 @@ public:
*/
int globalSparkIdCounter = 0;
// this is useful at least for real hardware integration testing - maybe a proper solution would be to simply
// GND input pins instead of leaving them floating
bool hwTriggerInputEnabled = true;
#if !EFI_PROD_CODE
float mockMapValue = 0;
// for historical reasons we have options to mock TPS on different layers :(
@ -94,7 +99,7 @@ public:
IgnitionEventList ignitionEvents;
#endif /* EFI_ENGINE_CONTROL */
WallFuel wallFuel;
WallFuel wallFuel[INJECTION_PIN_COUNT];
bool needToStopEngine(efitick_t nowNt) const;
bool etbAutoTune = false;
/**

View File

@ -38,6 +38,7 @@
#include "custom_engine.h"
#include "engine_template.h"
#include "bmw_e34.h"
#include "bmw_m73.h"
#include "dodge_neon.h"
#include "dodge_ram.h"
@ -62,7 +63,6 @@
#include "citroenBerlingoTU3JP.h"
#include "rover_v8.h"
#include "mitsubishi.h"
#include "prometheus.h"
#include "subaru.h"
#include "test_engine.h"
#include "sachs.h"
@ -74,7 +74,6 @@
#include "toyota_jzs147.h"
#include "ford_festiva.h"
#include "lada_kalina.h"
#include "geo_storm.h"
#include "zil130.h"
#include "honda_600.h"
@ -114,6 +113,7 @@ EXTERN_ENGINE;
#define xxxxx 0
#if 0
static fuel_table_t alphaNfuel = {
{/*0 engineLoad=0.00*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx},
{/*1 engineLoad=6.66*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx},
@ -132,6 +132,7 @@ static fuel_table_t alphaNfuel = {
{/*14 engineLoad=93.33*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx},
{/*15 engineLoad=100.00*/ /*0 800.0*/xxxxx, /*1 1213.0*/xxxxx, /*2 1626.0*/xxxxx, /*3 2040.0*/xxxxx, /*4 2453.0*/xxxxx, /*5 2866.0*/xxxxx, /*6 3280.0*/xxxxx, /*7 3693.0*/xxxxx, /*8 4106.0*/xxxxx, /*9 4520.0*/xxxxx, /*10 4933.0*/xxxxx, /*11 5346.0*/xxxxx, /*12 5760.0*/xxxxx, /*13 6173.0*/xxxxx, /*14 6586.0*/xxxxx, /*15 7000.0*/xxxxx}
};
#endif
/**
* Current engine configuration. On firmware start we assign empty configuration, then
@ -141,9 +142,10 @@ static fuel_table_t alphaNfuel = {
* todo: place this field next to 'engineConfiguration'?
*/
#ifdef EFI_ACTIVE_CONFIGURATION_IN_FLASH
engine_configuration_s EFI_ACTIVE_CONFIGURATION_IN_FLASH activeConfiguration;
engine_configuration_s & activeConfiguration = *(engine_configuration_s *)EFI_ACTIVE_CONFIGURATION_IN_FLASH;
#else
engine_configuration_s activeConfiguration;
static engine_configuration_s activeConfigurationLocalStorage;
engine_configuration_s & activeConfiguration = activeConfigurationLocalStorage;
#endif /* EFI_ACTIVE_CONFIGURATION_IN_FLASH */
extern engine_configuration_s *engineConfiguration;
@ -159,6 +161,8 @@ extern LoggingWithStorage sharedLogger;
/**
* this is the top-level method which should be called in case of any changes to engine configuration
* online tuning of most values in the maps does not count as configuration change, but 'Burn' command does
*
* this method is NOT currently invoked on ECU start - actual user input has to happen!
*/
void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
ENGINE(globalConfigurationVersion++);
@ -184,7 +188,7 @@ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
#endif /* EFI_IDLE_CONTROL */
#if EFI_SHAFT_POSITION_INPUT
onConfigurationChangeTriggerCallback(&activeConfiguration PASS_ENGINE_PARAMETER_SUFFIX);
onConfigurationChangeTriggerCallback(PASS_ENGINE_PARAMETER_SIGNATURE);
#endif /* EFI_SHAFT_POSITION_INPUT */
#if EFI_EMULATE_POSITION_SENSORS
onConfigurationChangeRpmEmulatorCallback(&activeConfiguration);
@ -198,6 +202,7 @@ void incrementGlobalConfigurationVersion(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
/**
* @brief Sets the same dwell time across the whole getRpm() range
* set dwell X
*/
void setConstantDwell(floatms_t dwellMs DECLARE_CONFIG_PARAMETER_SUFFIX) {
for (int i = 0; i < DWELL_CURVE_SIZE; i++) {
@ -223,9 +228,11 @@ void setMap(fuel_table_t table, float value) {
}
}
#if 0
static void setWholeVEMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
setMap(config->veTable, value);
}
#endif
void setWholeFuelMap(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
setMap(config->fuelTable, value);
@ -235,6 +242,8 @@ void setWholeIgnitionIatCorr(float value DECLARE_CONFIG_PARAMETER_SUFFIX) {
#if (IGN_LOAD_COUNT == FUEL_LOAD_COUNT) && (IGN_RPM_COUNT == FUEL_RPM_COUNT)
// todo: make setMap a template
setMap(config->ignitionIatCorrTable, value);
#else
UNUSED(value);
#endif
}
@ -529,7 +538,7 @@ static void setDefaultStepperIdleParameters(DECLARE_ENGINE_PARAMETER_SIGNATURE)
engineConfiguration->idleStepperTotalSteps = 150;
}
static void setCanFrankensoDefaults(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
static void setCanFrankensoDefaults(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
boardConfiguration->canDeviceMode = CD_USE_CAN2;
boardConfiguration->canTxPin = GPIOB_6;
boardConfiguration->canRxPin = GPIOB_12;
@ -546,7 +555,7 @@ void setTargetRpmCurve(int rpm DECLARE_CONFIG_PARAMETER_SUFFIX) {
int getTargetRpmForIdleCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
float clt = getCoolantTemperature();
int targetRpm;
if (cisnan(clt)) {
if (!hasCltSensor()) {
// error is already reported, let's take first value from the table should be good enough error handing solution
targetRpm = CONFIG(cltIdleRpm)[0];
} else {
@ -954,9 +963,9 @@ static void setDefaultEngineConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
/**
* @brief Hardware board-specific default configuration (GPIO pins, ADC channels, SPI configs etc.)
*/
static void setDefaultFrankensoConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
void setDefaultFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE) {
setCanFrankensoDefaults(PASS_ENGINE_PARAMETER_SIGNATURE);
setCanFrankensoDefaults(PASS_CONFIG_PARAMETER_SIGNATURE);
engineConfiguration->map.sensor.hwChannel = EFI_ADC_4;
engineConfiguration->clt.adcChannel = EFI_ADC_6;
@ -1001,7 +1010,7 @@ static void setDefaultFrankensoConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE)
// set optional subsystem configs
#if EFI_MEMS
// this would override some values from above
configureAccelerometerPins(PASS_ENGINE_PARAMETER_SIGNATURE);
configureAccelerometerPins(PASS_CONFIG_PARAMETER_SIGNATURE);
#endif /* EFI_MEMS */
#if EFI_HIP_9011
@ -1009,7 +1018,7 @@ static void setDefaultFrankensoConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE)
#endif /* EFI_HIP_9011 */
#if EFI_FILE_LOGGING
setDefaultSdCardParameters(PASS_ENGINE_PARAMETER_SIGNATURE);
setDefaultSdCardParameters(PASS_CONFIG_PARAMETER_SIGNATURE);
#endif /* EFI_FILE_LOGGING */
boardConfiguration->is_enabled_spi_1 = false;
@ -1044,9 +1053,15 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
*/
switch (engineType) {
case DEFAULT_FRANKENSO:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
case FRANKENSO_QA_ENGINE:
setFrankensoConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case BMW_M73_F:
setEngineBMW_M73_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case BMW_M73_M:
setEngineBMW_M73_Manhattan(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MRE_MIATA_NA6:
setMiataNA6_VAF_MRE(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
@ -1056,6 +1071,7 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
case MRE_MIATA_NB2:
setMiataNB2_MRE(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case PROMETHEUS_DEFAULTS:
case MINIMAL_PINS:
// all basic settings are already set in prepareVoidConfiguration(), no need to set anything here
break;
@ -1064,16 +1080,11 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
break;
#if EFI_SUPPORT_DODGE_NEON
case DODGE_NEON_1995:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setDodgeNeon1995EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case DODGE_NEON_2003_CAM:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setDodgeNeonNGCEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case DODGE_NEON_2003_CRANK:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setDodgeNeonNGCEngineConfigurationCrankBased(PASS_CONFIG_PARAMETER_SIGNATURE);
setDodgeNeonNGCEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case LADA_KALINA:
setLadaKalina(PASS_CONFIG_PARAMETER_SIGNATURE);
@ -1082,7 +1093,6 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
#endif /* EFI_SUPPORT_DODGE_NEON */
#if EFI_SUPPORT_FORD_ASPIRE
case FORD_ASPIRE_1996:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setFordAspireEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
#endif /* EFI_SUPPORT_FORD_ASPIRE */
@ -1103,15 +1113,12 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
setZil130(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MIATA_NA6_MAP:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMiataNA6_MAP_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MIATA_NA6_VAF:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMiataNA6_VAF_Frankenso(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case ETB_BENCH_ENGINE:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setEtbTestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MICRO_RUS_EFI:
@ -1121,7 +1128,6 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
setTle8888TestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MAZDA_MIATA_NA8:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMazdaMiataNA8Configuration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case TEST_CIVIC_4_0_BOTH:
@ -1136,20 +1142,14 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
case HONDA_ACCORD_1_24_SHIFTED:
setHondaAccordConfiguration1_24_shifted(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case FRANKENSO_QA_ENGINE:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setFrankensoBoardTestConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case HONDA_ACCORD_CD_DIP:
setHondaAccordConfigurationDip(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MITSU_4G93:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMitsubishiConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
#if EFI_SUPPORT_1995_FORD_INLINE_6
case FORD_INLINE_6_1995:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setFordInline6(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
#endif /* EFI_SUPPORT_1995_FORD_INLINE_6 */
@ -1157,11 +1157,9 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
setGy6139qmbDefaultEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case HONDA_600:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setHonda600(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MAZDA_MIATA_NB1:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMazdaMiataNb1EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MAZDA_323:
@ -1174,38 +1172,27 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
setSuzukiVitara(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case FORD_ESCORT_GT:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setFordEscortGt(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MIATA_1990:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMiata1990(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MIATA_1994_DEVIATOR:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMiata1994_d(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MIATA_1994_SPAGS:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMiata1994_s(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MIATA_1996:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMiata1996(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case CITROEN_TU3JP:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setCitroenBerlingoTU3JPConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case ROVER_V8:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setRoverv8(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case SUBARU_2003_WRX:
setSubaru2003Wrx(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case BMW_E34:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setBmwE34(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case DODGE_RAM:
@ -1215,7 +1202,6 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
setDodgeStratus(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case VW_ABA:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setVwAba(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
#if EFI_UNIT_TEST
@ -1231,40 +1217,30 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
#endif
case TEST_ENGINE:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setTestEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MAZDA_MIATA_2003:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMazdaMiata2003EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MAZDA_MIATA_2003_NA_RAIL:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMazdaMiata2003EngineConfigurationNaFuelRail(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case MAZDA_MIATA_2003_BOARD_TEST:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setMazdaMiata2003EngineConfigurationBoardTest(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case PROMETHEUS_DEFAULTS:
setPrometheusDefaults(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case SUBARUEJ20G_DEFAULTS:
setSubaruEJ20GDefaults(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case TEST_ENGINE_VVT:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setTestVVTEngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case SACHS:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setSachs(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case DAIHATSU:
setDaihatsu(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case CAMARO_4:
setDefaultFrankensoConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
setCamaro4(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case CHEVY_C20_1973:
@ -1276,9 +1252,6 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
case TOYOTA_JZS147:
setToyota_jzs147EngineConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
case GEO_STORM:
setGeoStormConfiguration(PASS_CONFIG_PARAMETER_SIGNATURE);
break;
default:
warning(CUSTOM_UNEXPECTED_ENGINE_TYPE, "Unexpected engine type: %d", engineType);
@ -1291,6 +1264,7 @@ void resetConfigurationExt(Logging * logger, configuration_callback_t boardCallb
}
void emptyCallbackWithConfiguration(engine_configuration_s * engineConfiguration) {
UNUSED(engineConfiguration);
}
void resetConfigurationExt(Logging * logger, engine_type_e engineType DECLARE_ENGINE_PARAMETER_SUFFIX) {

View File

@ -81,6 +81,7 @@ void copyFuelTable(fuel_table_t const source, fuel_table_t destination);
void copyTimingTable(ignition_table_t const source, ignition_table_t destination);
void emptyCallbackWithConfiguration(engine_configuration_s * engine);
void setDefaultFrankensoConfiguration(DECLARE_CONFIG_PARAMETER_SIGNATURE);
typedef void (*configuration_callback_t)(engine_configuration_s*);

View File

@ -34,7 +34,7 @@ public:
float s_h_c = 0;
bool isLinear;
private:
thermistor_conf_s currentConfig = {};
thermistor_conf_s currentConfig = {0,0,0,0,0,0,0};
};
class Accelerometer {

View File

@ -56,21 +56,6 @@ public:
angle_t mapAveragingDuration = 0;
angle_t timingAdvance = 0;
// spark-related
/**
* ignition dwell duration in ms
* See also dwellAngle
*/
floatms_t sparkDwell = 0;
/**
* ignition dwell duration as crankshaft angle
* NAN if engine is stopped
* See also sparkDwell
*/
angle_t dwellAngle = NAN;
angle_t cltTimingCorrection = 0;
// fuel-related;
float fuelCutoffCorrection = 0;
efitick_t coastingFuelCutStartTime = 0;

View File

@ -45,7 +45,7 @@ typedef enum {
FO_1_10_9_4_3_6_5_8_7_2 = 14, // dodge and viper ram v10
// 12 cylinder
FO_1_7_5_11_3_9_6_12_2_8_4_10 = 15, // bmw M70 etc
FO_1_7_5_11_3_9_6_12_2_8_4_10 = 15, // bmw M70 & M73 etc
FO_1_7_4_10_2_8_6_12_3_9_5_11 = 16, // lamborghini, typical rusEfi use-case
FO_1_12_5_8_3_10_6_7_2_11_4_9 = 18, // VAG W12

View File

@ -44,6 +44,11 @@ extern baroCorr_Map3D_t baroCorrMap;
DISPLAY_STATE(Engine)
DISPLAY(DISPLAY_FIELD(sparkDwell))
DISPLAY(DISPLAY_FIELD(dwellAngle))
DISPLAY(DISPLAY_FIELD(cltTimingCorrection))
DISPLAY_TEXT(eol);
DISPLAY(DISPLAY_IF(isCrankingState)) floatms_t getCrankingFuel3(float coolantTemperature,
uint32_t revolutionCounterSinceStart DECLARE_ENGINE_PARAMETER_SUFFIX) {
// these magic constants are in Celsius
@ -225,7 +230,7 @@ int getNumberOfInjections(injection_mode_e mode DECLARE_ENGINE_PARAMETER_SUFFIX)
* @see getCoilDutyCycle
*/
percent_t getInjectorDutyCycle(int rpm DECLARE_ENGINE_PARAMETER_SUFFIX) {
floatms_t totalInjectiorAmountPerCycle = getInjectionDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
floatms_t totalInjectiorAmountPerCycle = ENGINE(injectionDuration) * getNumberOfInjections(engineConfiguration->injectionMode PASS_ENGINE_PARAMETER_SUFFIX);
floatms_t engineCycleDuration = getEngineCycleDuration(rpm PASS_ENGINE_PARAMETER_SUFFIX);
return 100 * totalInjectiorAmountPerCycle / engineCycleDuration;
}
@ -312,13 +317,13 @@ void initFuelMap(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
* @brief Engine warm-up fuel correction.
*/
float getCltFuelCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (cisnan(engine->sensors.clt))
if (!hasCltSensor())
return 1; // this error should be already reported somewhere else, let's just handle it
return interpolate2d("cltf", getCoolantTemperature(), config->cltFuelCorrBins, config->cltFuelCorr);
}
angle_t getCltTimingCorrection(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
if (cisnan(engine->sensors.clt))
if (!hasCltSensor())
return 0; // this error should be already reported somewhere else, let's just handle it
return interpolate2d("timc", getCoolantTemperature(), engineConfiguration->cltTimingBins, engineConfiguration->cltTimingExtra);
}
@ -346,7 +351,8 @@ float getFuelCutOffCorrection(efitick_t nowNt, int rpm DECLARE_ENGINE_PARAMETER_
// gather events
bool mapDeactivate = (map >= CONFIG(coastingFuelCutMap));
bool tpsDeactivate = (tpsPos >= CONFIG(coastingFuelCutTps));
bool cltDeactivate = cisnan(engine->sensors.clt) ? false : (engine->sensors.clt < (float)CONFIG(coastingFuelCutClt));
// If no CLT sensor (or broken), don't allow DFCO
bool cltDeactivate = hasCltSensor() ? (getCoolantTemperature() < (float)CONFIG(coastingFuelCutClt)) : true;
bool rpmDeactivate = (rpm < CONFIG(coastingFuelCutRpmLow));
bool rpmActivate = (rpm > CONFIG(coastingFuelCutRpmHigh));

View File

@ -4,8 +4,8 @@
* @date Jan 6, 2015
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef CONTROLLERS_ALGO_LCD_MENU_TREE_H_
#define CONTROLLERS_ALGO_LCD_MENU_TREE_H_
#pragma once
typedef enum {
LL_STRING,
@ -73,7 +73,3 @@ public:
MenuItem *current = nullptr;
MenuItem *topVisible = nullptr;
};
#endif /* CONTROLLERS_ALGO_LCD_MENU_TREE_H_ */

View File

@ -108,7 +108,9 @@ void nmea_parse_gpgga(char *nmea, loc_t *loc) {
p = strchr(p, ',') + 1; // in p string started with searching address
str_till_comma(p, dStr); // str to float till comma saved modified string
if(strlen(p) == 0) return; // if no data in field - empty data - we return
if (strlen(p) == 0) {
return; // if no data in field - empty data - we return
}
loc->latitude = atoff(dStr); // fulfil data
@ -182,7 +184,7 @@ void nmea_parse_gprmc(char *nmea, loc_t *loc) {
p = strchr(p, ',') + 1; //read time
str_till_comma(p, dStr);
if(strlen(dStr) > 5){
if (strlen(dStr) > 5) {
timp.tm_hour = str2int(dStr,2);
timp.tm_min = str2int(dStr+2,2);
timp.tm_sec = str2int(dStr+4,2);
@ -191,7 +193,7 @@ void nmea_parse_gprmc(char *nmea, loc_t *loc) {
p = strchr(p, ',') + 1; //read field Valid status
str_till_comma(p, dStr);
if(dStr[0] == 'V') { // if field is invalid
if (dStr[0] == 'V') { // if field is invalid
loc->quality = 0;
return;
}
@ -242,13 +244,13 @@ void nmea_parse_gprmc(char *nmea, loc_t *loc) {
p = strchr(p, ',') + 1; //read date
str_till_comma(p, dStr);
if(strlen(dStr) > 5){
if (strlen(dStr) > 5) {
timp.tm_mday = str2int(dStr,2);
timp.tm_mon = str2int(dStr+2,2);
timp.tm_year = str2int(dStr+4,2)+100; // we receive -200, but standard wait -1900 = add correction
}
if( timp.tm_year > 0 ) { // check if date field is valid
if (timp.tm_year > 0 ) { // check if date field is valid
memcpy(&loc->GPStm, &timp, sizeof(timp));
}
}

View File

@ -1908,7 +1908,7 @@ typedef enum {
CUSTOM_ERR_6558 = 6558,
CUSTOM_ERR_6559 = 6559,
CUSTOM_ERR_6560 = 6560,
CUSTOM_ERR_TRIGGER_ANGLE_RANGE = 6560,
CUSTOM_ERR_6561 = 6561,
CUSTOM_ERR_6562 = 6562,
CUSTOM_ERR_6563 = 6563,
@ -2051,10 +2051,10 @@ typedef enum {
CUSTOM_ERR_6688 = 6688,
CUSTOM_ERR_6689 = 6689,
CUSTOM_ERR_6690 = 6690,
CUSTOM_ERR_MAP_START_ASSERT = 6690,
CUSTOM_ERR_MAP_AVG_OFFSET = 6691,
CUSTOM_ERR_6692 = 6692,
CUSTOM_ERR_6693 = 6693,
CUSTOM_ERR_MAP_CYL_OFFSET = 6692,
CUSTOM_ERR_PWM_DUTY_ASSERT = 6693,
CUSTOM_ERR_ZERO_CRANKING_FUEL = 6694,
CUSTOM_ERR_6695 = 6695,
CUSTOM_ERR_6696 = 6696,
@ -2070,11 +2070,14 @@ typedef enum {
CUSTOM_ERR_BOTH_FRONTS_REQUIRED = 6704,
CUSTOM_TLE8888 = 6705,
CUSTOM_ERR_6706 = 6706,
CUSTOM_ERR_6707 = 6707,
CUSTOM_ERR_6708 = 6708,
CUSTOM_ERR_PIN_COUNT_TOO_LARGE = 6709,
CUSTOM_ERR_TIMER_TEST_CALLBACK_NOT_HAPPENED = 6707,
CUSTOM_ERR_TIMER_TEST_CALLBACK_WRONG_TIME = 6708,
CUSTOM_ERR_6709 = 6709,
CUSTOM_DUTY_INVALID = 6710,
CUSTOM_DUTY_TOO_HIGH = 6711,
CUSTOM_ERR_PWM_STATE_ASSERT = 6712,
CUSTOM_ERR_PWM_CALLBACK_ASSERT = 6713,
CUSTOM_ERR_PWM_SWITCH_ASSERT = 6714,
CUSTOM_ERR_TRIGGER_SYNC = 9000,

View File

@ -8,8 +8,7 @@
* @author Andrey Belomutskiy, (c) 2012-2019
*/
#ifndef RUSEFI_ENUMS_H_
#define RUSEFI_ENUMS_H_
#pragma once
#include "efifeatures.h"
#include "obd_error_codes.h"
@ -96,7 +95,7 @@ typedef enum {
SUBARU_2003_WRX = 22,
DODGE_NEON_2003_CAM = 23,
MIATA_1994_SPAGS = 24,
BMW_M73_M = 24,
BMW_E34 = 25,
@ -131,7 +130,7 @@ typedef enum {
LADA_KALINA = 39,
GEO_STORM = 40,
BMW_M73_F = 40,
// Frankenso board
MIATA_NA6_MAP = 41,
@ -839,5 +838,3 @@ typedef enum {
*/
Force_4bytes_size_idle_state_e = ENUM_32_BITS,
} idle_state_e;
#endif /* RUSEFI_ENUMS_H_ */

View File

@ -85,6 +85,7 @@ typedef float fuel_table_t[FUEL_LOAD_COUNT][FUEL_RPM_COUNT];
typedef float ignition_table_t[IGN_LOAD_COUNT][IGN_RPM_COUNT];
typedef int16_t ignition_tps_table_t[IGN_LOAD_COUNT][IGN_RPM_COUNT];
typedef uint8_t pedal_to_tps_t[PEDAL_TO_TPS_SIZE][PEDAL_TO_TPS_SIZE];
typedef uint8_t iac_pid_mult_t[IAC_PID_MULT_SIZE][IAC_PID_MULT_SIZE];
typedef float baro_corr_table_t[BARO_CORR_SIZE][BARO_CORR_SIZE];

View File

@ -78,4 +78,6 @@
x.config = config; \
x.boardConfiguration = boardConfiguration;
#define isConfigurationChanged(x) (engineConfiguration->x != activeConfiguration.x)
#endif /* CONTROLLERS_CORE_COMMON_HEADERS_H_ */

View File

@ -36,7 +36,7 @@ MultiWave::MultiWave() {
reset();
}
MultiWave::MultiWave(float *switchTimes, SingleWave *waves) : MultiWave(){
MultiWave::MultiWave(float *switchTimes, SingleWave *waves) : MultiWave() {
init(switchTimes, waves);
}
@ -93,6 +93,6 @@ int MultiWave::findAngleMatch(const float angle, const int size) const {
}
void MultiWave::setSwitchTime(const int index, const float value) {
efiAssertVoid(CUSTOM_ERR_6690, switchTimes != NULL, "switchTimes");
efiAssertVoid(CUSTOM_ERR_PWM_SWITCH_ASSERT, switchTimes != NULL, "switchTimes");
switchTimes[index] = value;
}

View File

@ -18,7 +18,7 @@ static MemoryStream firmwareErrorMessageStream;
#define WARNING_BUFFER_SIZE 80
static char warningBuffer[WARNING_BUFFER_SIZE];
static bool isWarningStreamInitialized = false;
static volatile bool isWarningStreamInitialized = false;
#if EFI_HD44780_LCD
#include "lcd_HD44780.h"

View File

@ -8,15 +8,14 @@
#ifndef ERROR_HANDLING_H_
#define ERROR_HANDLING_H_
#include "global.h"
#include "obd_error_codes.h"
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
#include "global.h"
#include "obd_error_codes.h"
/**
* Something is wrong, but we can live with it: some minor sensor is disconnected
* or something like that
@ -31,7 +30,7 @@ typedef uint8_t fatal_msg_t[200];
*
* see also warning()
*/
EXTERNC void firmwareError(obd_code_e code, const char *fmt, ...);
void firmwareError(obd_code_e code, const char *fmt, ...);
#define hasFirmwareError() hasFirmwareErrorFlag

View File

@ -287,7 +287,7 @@ bool LECalculator::processElement(LEElement *element DECLARE_ENGINE_PARAMETER_SU
push(element->action, getVoltage("fsio", engineConfiguration->fsioAdc[0] PASS_ENGINE_PARAMETER_SUFFIX));
break;
case LE_METHOD_KNOCK:
push(element->action, engine->knockCount);
push(element->action, ENGINE(knockCount));
break;
case LE_UNDEFINED:
warning(CUSTOM_UNKNOWN_FSIO, "FSIO undefined action");

View File

@ -269,6 +269,7 @@ void applyFsioConfiguration(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
}
void onConfigurationChangeFsioCallback(engine_configuration_s *previousConfiguration DECLARE_ENGINE_PARAMETER_SUFFIX) {
(void)previousConfiguration;
#if EFI_FSIO
applyFsioConfiguration(PASS_ENGINE_PARAMETER_SIGNATURE);
#endif

View File

@ -266,12 +266,15 @@ efitick_t getTimeNowNt(void) {
}
#endif /* EFI_PROD_CODE */
#if ! EFI_UNIT_TEST
/**
* number of SysClock ticks in one ms
*/
#define TICKS_IN_MS (CH_CFG_ST_FREQUENCY / 1000)
// todo: this overflows pretty fast!
efitimems_t currentTimeMillis(void) {
// todo: migrate to getTimeNowUs? or not?
@ -282,13 +285,16 @@ efitimems_t currentTimeMillis(void) {
efitimesec_t getTimeNowSeconds(void) {
return currentTimeMillis() / 1000;
}
#endif /* EFI_PROD_CODE */
#endif /* EFI_UNIT_TEST */
static void resetAccel(void) {
engine->engineLoadAccelEnrichment.resetAE();
engine->tpsAccelEnrichment.resetAE();
engine->wallFuel.resetWF();
for (unsigned int i = 0; i < sizeof(engine->wallFuel) / sizeof(engine->wallFuel[0]); i++)
{
engine->wallFuel[i].resetWF();
}
}
static int previousSecond;
@ -748,7 +754,7 @@ void initEngineContoller(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX)
initMalfunctionCentral();
#if EFI_ALTERNATOR_CONTROL
initAlternatorCtrl(sharedLogger);
initAlternatorCtrl(sharedLogger PASS_ENGINE_PARAMETER_SUFFIX);
#endif
#if EFI_AUX_PID
@ -812,6 +818,6 @@ int getRusEfiVersion(void) {
if (initBootloader() != 0)
return 123;
#endif /* EFI_BOOTLOADER_INCLUDE_CODE */
return 20191013;
return 20191117;
}
#endif /* EFI_UNIT_TEST */

View File

@ -6,8 +6,7 @@
* @author Andrey Belomutskiy, (c) 2012-2017
*/
#ifndef FLASH_MAIN_H_
#define FLASH_MAIN_H_
#pragma once
#include "engine.h"
@ -38,5 +37,3 @@ void setNeedToWriteConfiguration(void);
*/
bool getNeedToWriteConfiguration(void);
void writeToFlashIfPending(void);
#endif /* FLASH_MAIN_H_ */

View File

@ -1,4 +1,4 @@
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sun Sep 29 11:56:14 EDT 2019
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Nov 19 09:22:58 EST 2019
// by class com.rusefi.output.CHeaderConsumer
// begin
#ifndef CONTROLLERS_GENERATED_ENGINE_CONFIGURATION_GENERATED_STRUCTURES_H
@ -461,8 +461,8 @@ struct board_configuration_s {
*/
float mapFrequency100Kpa;
/**
* See also triggerSimulatorPins
* See also directSelfStimulation
* Same RPM is used for two ways of producing simulated RPM. See also triggerSimulatorPins (with wires)
* See also directSelfStimulation (no wires, bypassing input hardware)
* rpm X
* offset 20
*/
@ -580,7 +580,7 @@ struct board_configuration_s {
/**
* offset 76
*/
brain_pin_e unused1133;
brain_pin_e debugTriggerSync;
/**
* Digital Potentiometer is used by stock ECU stimulation code
* offset 77
@ -655,7 +655,7 @@ struct board_configuration_s {
/**
* offset 111
*/
uint8_t unusedMa2;
brain_pin_e debugTimerCallback;
/**
* offset 112
*/
@ -681,7 +681,8 @@ struct board_configuration_s {
*/
can_device_mode_e canDeviceMode;
/**
* See also directSelfStimulation
* Each rusEfi piece can provide synthetic trigger signal for external ECU. Sometimes these wires are routed back into trigger inputs of the same rusEfi board.
* See also directSelfStimulation which is different.
* offset 136
*/
brain_pin_e triggerSimulatorPins[TRIGGER_SIMULATOR_PIN_COUNT];
@ -853,7 +854,11 @@ struct board_configuration_s {
/**
* offset 206
*/
uint8_t unusedSpiPadding2[2];
brain_pin_e debugSetTimer;
/**
* offset 207
*/
uint8_t unusedSpiPadding2;
/**
* offset 208
*/
@ -1256,12 +1261,12 @@ struct engine_configuration_s {
*/
engine_load_mode_e fuelAlgorithm;
/**
* This is the type of injection strategy (See Fuel/Injection settings for more detail) it is suggested to use "Simultaneous" for easiest starting.
* This is the injection strategy during engine start. See Fuel/Injection settings for more detail. It is suggested to use "Simultaneous".
* offset 424
*/
injection_mode_e crankingInjectionMode;
/**
* This is where the fuel injection type is defined: "Simultaneous" means all injectors will fire together at once. "Sequential" fires the injectors on a per cylinder basis, only use this if you have individually wired injectors. "batched" will fire the injectors in groups, if your injectors are individually wired you will also need to enable "Two wire batch emulation".
* This is where the fuel injection type is defined: "Simultaneous" means all injectors will fire together at once. "Sequential" fires the injectors on a per cylinder basis, which requires individually wired injectors. "Batched" will fire the injectors in groups. If your injectors are individually wired you will also need to enable "Two wire batch emulation".
* set injection_mode X
* See also twoWireBatchInjection
* offset 428
@ -1581,7 +1586,7 @@ struct engine_configuration_s {
bool useFSIO13ForIdleMinValue : 1;
/**
offset 1464 bit 31 */
bool unusedBit31 : 1;
bool useFSIO6ForRevLimiter : 1;
/**
* offset 1468
*/
@ -1839,7 +1844,15 @@ struct engine_configuration_s {
/**
* offset 1760
*/
uint8_t unusedFormerWarmupAfrPid[16];
float alternator_derivativeFilterLoss;
/**
* offset 1764
*/
float alternator_antiwindupFreq;
/**
* offset 1768
*/
uint8_t unusedFormerWarmupAfrPid[8];
/**
* kPa value which is too low to be true
* offset 1776
@ -2604,7 +2617,19 @@ struct engine_configuration_s {
/**
* offset 4060
*/
int mainUnusedEnd[585];
iac_pid_mult_t iacPidMultTable;
/**
* offset 4124
*/
uint8_t iacPidMultLoadBins[IAC_PID_MULT_SIZE];
/**
* offset 4132
*/
uint8_t iacPidMultRpmBins[IAC_PID_MULT_SIZE];
/**
* offset 4140
*/
int mainUnusedEnd[565];
/** total size 6400*/
};
@ -2867,4 +2892,4 @@ typedef struct persistent_config_s persistent_config_s;
#endif
// end
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Sun Sep 29 11:56:14 EDT 2019
// this section was generated automatically by rusEfi tool ConfigDefinition.jar based on integration\rusefi_config.txt Tue Nov 19 09:22:58 EST 2019

Some files were not shown because too many files have changed in this diff Show More