Compare commits

...

71 Commits

Author SHA1 Message Date
alrijleh e4723f47c8 added default settings 2024-09-07 20:51:47 -04:00
alrijleh c6263b592c dfco fuel cut map unit test added and passes 2024-09-07 19:41:02 -04:00
alrijleh c85b2e0d34 fixed typo and improved description 2024-09-07 00:31:33 -04:00
alrijleh 7361132597 Merge branch 'master' into dfco-map-with-rpm 2024-09-07 00:19:37 -04:00
GitHub set-date Action a76268cd8e Update date 2024-09-06 00:10:20 +00:00
DenisMitchell 28c7b9efc1
Update tachometer.cpp - fix tach sweep (#483)
fix tachsweep - x2 and y2 transposed in interpolateClamped
2024-09-05 11:44:32 -07:00
GitHub gen-configs Action 20333f9ddb Auto-generated configs and docs 2024-09-05 18:15:46 +00:00
Matthew Kennedy 8c65ce3575 Merge branch 'master' of https://github.com/fome-tech/fome-fw 2024-09-05 11:14:16 -07:00
Matthew Kennedy d5911316df tach sweep typo 2024-09-05 11:14:11 -07:00
Matthew Kennedy 9a634c95a0 tweak release instructions 2024-09-04 23:24:32 -07:00
GitHub gen-configs Action 60a1249cc0 Auto-generated configs and docs 2024-09-05 05:43:05 +00:00
Matthew Kennedy 0d3742afb5 tach sweep ui 2024-09-04 22:41:39 -07:00
GitHub gen-configs Action dea81536ea Auto-generated configs and docs 2024-09-05 05:39:34 +00:00
Matthew Kennedy 2ff394e3e9 tach sweep experiment 2024-09-04 22:38:12 -07:00
GitHub set-date Action 4d02171f6d Update date 2024-09-04 00:10:27 +00:00
GitHub gen-configs Action a2d7fd7c87 Auto-generated configs and docs 2024-09-03 23:33:46 +00:00
Matthew Kennedy e00bc56666 tachometer onFastCallback 2024-09-03 16:32:22 -07:00
Matthew Kennedy c3e1435f39 move tachometer to modules dir 2024-09-03 16:28:54 -07:00
GitHub gen-configs Action 3b2a136a75 Auto-generated configs and docs 2024-09-03 22:59:55 +00:00
Matthew Kennedy 344223cbfa add VSS as GPPWM parameter 2024-09-03 15:58:33 -07:00
Matthew Kennedy d0e4a0c644 cleanup 2024-09-03 13:34:36 -07:00
Matthew Kennedy e20908704d print friendly pin names for "pins" command 2024-09-03 13:31:49 -07:00
GitHub gen-configs Action 7c54e36d22 Auto-generated configs and docs 2024-09-03 17:08:20 +00:00
DenisMitchell 5ac24ae295
Update README.md - link to developer.md instead of RusEFI forum (#481)
* Update README.md - link to developer.md instead of RusEFI forum

Link to developer.md instead of RusEFI forums; instructions on the RusEFI forums do not appear to apply to FOME at this point.
2024-09-03 12:06:50 -05:00
GitHub set-date Action 762bd50dcf Update date 2024-09-02 00:13:23 +00:00
GitHub gen-configs Action 11fa537f5b Auto-generated configs and docs 2024-09-01 23:55:00 +00:00
Matthew Kennedy 8d843f3cac people ask constantly about why this doesn't do what they want 2024-09-01 16:53:40 -07:00
GitHub gen-configs Action 17ca8b204f Auto-generated configs and docs 2024-09-01 23:50:02 +00:00
Matthew Kennedy 40dfd1e205 give dwell metric its own channel 2024-09-01 16:48:40 -07:00
GitHub set-date Action 5105258377 Update date 2024-09-01 00:12:28 +00:00
Matthew Kennedy 51a23364e2
Odd cylinder engine wasted spark (#479)
* allow wasted spark spin-up

* allow firing without phase sync on odd cyl engines

* support odd cyl wasted spark

* changelog

* unit test it

* wow, it's easy to support odd-fire too
2024-08-31 02:22:31 -07:00
Matthew Kennedy 397e3dcd04 hoist dwellMs/angle/sparkangle 2024-08-31 00:44:21 -07:00
Matthew Kennedy 3fc42222cc hoist dwell check out of loop 2024-08-31 00:37:27 -07:00
GitHub gen-configs Action 7593cd61d4 Auto-generated configs and docs 2024-08-31 05:50:02 +00:00
Matthew Kennedy 5c614ca945
all ECUs can use big blocking factor! (#474)
* all ECUs can use big blocking factor!

* reclaim 100 bytes of blocking factor

* fits on ethernet f4

* ch-ch-ch-ch-changelog

* bump it a little
2024-08-30 22:48:37 -07:00
GitHub set-date Action 97f26196fe Update date 2024-08-31 00:10:11 +00:00
GitHub gen-configs Action 9f4c10450d Auto-generated configs and docs 2024-08-30 17:50:07 +00:00
Nathan Schulte 316915ec4c
more Toyota gear ratios (#477)
* add Aisin AR5 transmission gear ratios

GM Pontiac Solstice/Saturn Sky MA-5

* add Toyota transmission gear ratios

* round gear ratios to fit TS field
2024-08-30 10:48:50 -07:00
Matthew Kennedy ebe5f6ab54 changelog 2024-08-30 10:46:21 -07:00
Matthew Kennedy 8591dd1336 Merge branch 'master' of https://github.com/fome-tech/fome-fw 2024-08-30 10:45:09 -07:00
GitHub gen-configs Action dca081a907 Auto-generated configs and docs 2024-08-30 07:20:25 +00:00
Matthew Kennedy a269b9af38 additional aux linear sensors #476 2024-08-30 00:18:54 -07:00
Matthew Kennedy 227723484c useless comment 2024-08-29 22:40:53 -07:00
GitHub gen-configs Action 03ac7f15f4 Auto-generated configs and docs 2024-08-30 05:39:45 +00:00
Matthew Kennedy 761efd862c
MAP avg uses engine module callbacks (#475)
* use engine module callbacks

* happy tests

* happy small-can-board

* interact with map avg via module

* simplify map avg init

* tweaks

* omit module to disable it instead!

* unnecessary guard

* minor cleanups

* unnecessary branch - lookups for these tables are fine at 0 rpm

* oop
2024-08-29 22:38:30 -07:00
GitHub set-date Action e41f3bb968 Update date 2024-08-30 00:10:18 +00:00
Matthew Kennedy 12321d4325 map averaging includes 2024-08-29 13:29:53 -07:00
Matthew Kennedy 6fc52a1430 move map averaging to module 2024-08-29 13:26:57 -07:00
GitHub gen-configs Action 3bbd89aa0d Auto-generated configs and docs 2024-08-29 18:25:18 +00:00
Matthew Kennedy 77c5a150ee fix small can board 2024-08-29 11:23:58 -07:00
GitHub set-date Action 3843218389 Update date 2024-08-29 00:10:22 +00:00
GitHub gen-configs Action 2bf0fa43d1 Auto-generated configs and docs 2024-08-28 10:05:11 +00:00
Matthew Kennedy 9123bae316 there's not really a reason for mainUnusedEnd 2024-08-28 03:02:09 -07:00
Matthew Kennedy 6af46b59a9 MAP averaging can use common math for cyl offset calc 2024-08-28 02:58:21 -07:00
Matthew Kennedy 75a50695c6 extend engineModules.apply_all to onEnginePhase 2024-08-28 02:26:16 -07:00
GitHub gen-configs Action 1bc6adf597 Auto-generated configs and docs 2024-08-28 09:07:31 +00:00
Matthew Kennedy bd7f8f2bb6 remove trigger input debug pins 2024-08-28 02:06:02 -07:00
GitHub gen-configs Action a7bb5f98fa Auto-generated configs and docs 2024-08-28 08:55:19 +00:00
Matthew Kennedy d2255fc696 no need to compare ==1 for booleans in TS INI 2024-08-28 01:53:54 -07:00
GitHub gen-configs Action 9f08ba90c6 Auto-generated configs and docs 2024-08-28 08:50:30 +00:00
alrijleh 557ad66662
disable injection/ignition trim tables for cylinders > cyl_count (#473)
* disable injection/ignition trim tables for cylinders > cyl_count

* missing comma

* added the missing ", 0,"
2024-08-28 01:49:09 -07:00
Matthew Kennedy f80ffd4ddf clamp map sampling duration to fit between cylinders 2024-08-28 01:48:41 -07:00
GitHub gen-configs Action d1abcab6bb Auto-generated configs and docs 2024-08-28 08:47:00 +00:00
Matthew Kennedy 32c57fd7af dead instant rpm debug mode 2024-08-28 01:45:29 -07:00
GitHub gen-configs Action 2ac6c6346c Auto-generated configs and docs 2024-08-28 08:45:02 +00:00
Matthew Kennedy 4ae3056257 dead MAP debug mode 2024-08-28 01:43:34 -07:00
Matthew Kennedy 23cfa4e2c6 Schedule MAP by angle instead of tooth #38
Do MAP sampling like we do ignition/fuel, rather than scheduling everything at once at the same trigger tooth.
2024-08-28 01:39:49 -07:00
Matthew Kennedy 6884fb83d3 useless comment 2024-08-28 01:33:08 -07:00
GitHub gen-configs Action b3784587fe Auto-generated configs and docs 2024-08-28 08:21:38 +00:00
Matthew Kennedy 7ffbaf4e5e decouple MAP sampling from trigger central 2024-08-28 01:19:53 -07:00
GitHub set-date Action 436a7fc805 Update date 2024-08-27 00:12:44 +00:00
110 changed files with 48822 additions and 53000 deletions

View File

@ -61,7 +61,7 @@ Initialize the checkout:
See [firmware/gcc_version_check.c](firmware/gcc_version_check.c) for the recommended version of GCC.
Check out https://rusefi.com/forum/viewtopic.php?f=5&t=9
Refer to [firmware/DEVELOPER.md](firmware/DEVELOPER.md) for details on building FOME firmware.
# Release Notes

View File

@ -41,7 +41,9 @@ or
- Add 1-5-4-8-3-7-2-6 and 1-6-5-10-2-7-3-8-4-9 firing orders
- Console command `set_sensor_mock` now accepts a sensor by name, instead of index. Example: `set_sensor_mock CLT 85.5`
- TunerStudio UI improvements (#436, etc)
- Dropdown selector for popular gearbox ratios (#358, thank you @alrijleh!)
- Dropdown selector for popular gearbox ratios (#358, thank you @alrijleh and @nmschulte!)
- Add two more aux linear sensors #476
- Support wasted spark on odd cylinder count 4-stroke engines. Improves startup and allows running without a cam sensor!
### Fixed
- Improve performance with Lua CAN reception of a high volume of frames
@ -52,6 +54,7 @@ or
- Fix decel fuel cutoff (DFCO) on engines without a MAP sensor #457
- Automatic calculation of knock sense frequency based on cylinder bore #379
- Removed MAP sampling option that can result in inaccurate MAP sensor readings
- Improve TunerStudio performance on STM32F4-based ECUs #474
## December 2023 Release

View File

@ -3,5 +3,3 @@
! Atlas is guaranteed dual bank flash, so there's no delay when sending the burn command.
! All commands should complete effectively instantly.
#define TS_BLOCK_READ_TIMEOUT 250
#define BLOCKING_FACTOR 1500

View File

@ -17,11 +17,12 @@ DDEFS += -DEFI_SHAFT_POSITION_INPUT=FALSE
DDEFS += -DEFI_ALTERNATOR_CONTROL=FALSE
DDEFS += -DEFI_VVT_PID=FALSE
DDEFS += -DEFI_EMULATE_POSITION_SENSORS=FALSE
DDEFS += -DEFI_MAP_AVERAGING=FALSE
DDEFS += -DEFI_HPFP=FALSE
DDEFS += -DEFI_TOOTH_LOGGER=FALSE
DDEFS += -DRAM_UNUSED_SIZE=100
NO_MAP_AVERAGING = yes
DDEFS += -DHW_SMALL_CAN_BOARD=1
#Mass Storage

View File

@ -1 +0,0 @@
#define BLOCKING_FACTOR 1500

View File

@ -23,4 +23,3 @@
#define show_Proteus_presets true
#define LUA_SCRIPT_SIZE 12000
#define BLOCKING_FACTOR 1500

View File

@ -75,8 +75,6 @@ void setFordAspireEngineConfiguration() {
engineConfiguration->ignitionMode = IM_ONE_COIL;
engineConfiguration->trigger.type = trigger_type_e::TT_FORD_ASPIRE;
engineConfiguration->triggerInputDebugPins[0] = Gpio::C15;
engineConfiguration->injectionPins[4] = Gpio::Unassigned;
engineConfiguration->injectionPins[5] = Gpio::Unassigned;

View File

@ -262,7 +262,7 @@
#if MODULE_ETHERNET_CONSOLE
// F4 ethernet needs some extra space
#define LUA_USER_HEAP 40000
#define LUA_USER_HEAP 25000
#else // MODULE_ETHERNET_CONSOLE
#define LUA_USER_HEAP 50000
#endif
@ -302,10 +302,6 @@
//#define EFI_MALFUNCTION_INDICATOR FALSE
#endif
#ifndef EFI_MAP_AVERAGING
#define EFI_MAP_AVERAGING TRUE
#endif
// todo: most of this should become configurable
// todo: switch to continuous ADC conversion for fast ADC?

View File

@ -249,6 +249,8 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2
float auxLinear1;@@GAUGE_NAME_AUX_LINEAR_1@@;"", 1, 0, 0, 0, 2
float auxLinear2;@@GAUGE_NAME_AUX_LINEAR_2@@;"", 1, 0, 0, 0, 2
float auxLinear3;@@GAUGE_NAME_AUX_LINEAR_3@@;"", 1, 0, 0, 0, 2
float auxLinear4;@@GAUGE_NAME_AUX_LINEAR_4@@;"", 1, 0, 0, 0, 2
uint16_t autoscale fallbackMap;;"kPa", 0.1, 0, 0, 1000, 1
@ -310,31 +312,6 @@ int16_t rpmAcceleration;dRPM;"RPM acceleration",1, 0, 0, 5, 2
uint8_t[BOOST_BLEND_COUNT iterate] autoscale boostClosedLoopBlendBias;;"%", 0.5, 0, 0, 100, 1
int16_t[BOOST_BLEND_COUNT iterate] autoscale boostClosedLoopBlendOutput;;"%", 0.1, 0, -1000, 1000, 1
bit coilState1
bit coilState2
bit coilState3
bit coilState4
bit coilState5
bit coilState6
bit coilState7
bit coilState8
bit coilState9
bit coilState10
bit coilState11
bit coilState12
bit injectorState1
bit injectorState2
bit injectorState3
bit injectorState4
bit injectorState5
bit injectorState6
bit injectorState7
bit injectorState8
bit injectorState9
bit injectorState10
bit injectorState11
bit injectorState12
uint32_t outputRequestPeriod
float mapFast
float[LUA_GAUGE_COUNT iterate] luaGauges;Lua: Gauge;"value",1, 0, 0, 50000, 3
@ -372,5 +349,5 @@ float mapFast
uint8_t[12 iterate] mapPerCylinder;;"kPa", 1, 0, 0, 0, 0
uint8_t[102 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
uint16_t autoscale dwellAccuracyRatio;;"ratio", 0.001, 0, 0, 0, 3
end_struct

View File

@ -532,258 +532,201 @@ struct output_channels_s {
// Aux linear #2
// offset 336
float auxLinear2 = (float)0;
// kPa
// Aux linear #3
// offset 340
float auxLinear3 = (float)0;
// Aux linear #4
// offset 344
float auxLinear4 = (float)0;
// kPa
// offset 348
scaled_channel<uint16_t, 10, 1> fallbackMap = (uint16_t)0;
// Instant MAP
// kPa
// offset 342
// offset 350
scaled_channel<uint16_t, 30, 1> instantMAPValue = (uint16_t)0;
// us
// offset 344
// offset 352
uint16_t maxLockedDuration = (uint16_t)0;
// CAN: Tx OK
// offset 346
// offset 354
uint16_t canWriteOk = (uint16_t)0;
// CAN: Tx err
// offset 348
uint16_t canWriteNotOk = (uint16_t)0;
// offset 350
uint8_t alignmentFill_at_350[2];
// offset 352
uint32_t triggerPrimaryFall = (uint32_t)0;
// offset 356
uint32_t triggerPrimaryRise = (uint32_t)0;
uint16_t canWriteNotOk = (uint16_t)0;
// offset 358
uint8_t alignmentFill_at_358[2];
// offset 360
uint32_t triggerSecondaryFall = (uint32_t)0;
uint32_t triggerPrimaryFall = (uint32_t)0;
// offset 364
uint32_t triggerSecondaryRise = (uint32_t)0;
uint32_t triggerPrimaryRise = (uint32_t)0;
// offset 368
uint32_t triggerVvtFall = (uint32_t)0;
uint32_t triggerSecondaryFall = (uint32_t)0;
// offset 372
uint32_t triggerVvtRise = (uint32_t)0;
uint32_t triggerSecondaryRise = (uint32_t)0;
// offset 376
uint32_t triggerVvtFall = (uint32_t)0;
// offset 380
uint32_t triggerVvtRise = (uint32_t)0;
// offset 384
uint8_t starterState = (uint8_t)0;
// offset 377
// offset 385
uint8_t starterRelayDisable = (uint8_t)0;
// Ign: Multispark count
// offset 378
// offset 386
uint8_t multiSparkCounter = (uint8_t)0;
// offset 379
// offset 387
uint8_t extiOverflowCount = (uint8_t)0;
// offset 380
// offset 388
pid_status_s alternatorStatus;
// offset 396
// offset 404
pid_status_s idleStatus;
// offset 412
// offset 420
pid_status_s etbStatus;
// offset 428
// offset 436
pid_status_s boostStatus;
// offset 444
// offset 452
pid_status_s wastegateDcStatus;
// offset 460
// offset 468
pid_status_s vvtStatus[4];
// Aux speed 1
// s
// offset 524
// offset 532
uint16_t auxSpeed1 = (uint16_t)0;
// Aux speed 2
// s
// offset 526
// offset 534
uint16_t auxSpeed2 = (uint16_t)0;
// TCU: Input Shaft Speed
// RPM
// offset 528
// offset 536
uint16_t ISSValue = (uint16_t)0;
// V
// offset 530
// offset 538
scaled_channel<int16_t, 1000, 1> rawAnalogInput[8];
// GPPWM Output
// %
// offset 546
// offset 554
scaled_channel<uint8_t, 2, 1> gppwmOutput[4];
// offset 550
int16_t gppwmXAxis[4];
// offset 558
int16_t gppwmXAxis[4];
// offset 566
scaled_channel<int16_t, 10, 1> gppwmYAxis[4];
// V
// offset 566
// offset 574
scaled_channel<int16_t, 1000, 1> rawBattery = (int16_t)0;
// offset 568
// offset 576
scaled_channel<int16_t, 10, 1> ignBlendParameter[4];
// %
// offset 576
// offset 584
scaled_channel<uint8_t, 2, 1> ignBlendBias[4];
// deg
// offset 580
scaled_channel<int16_t, 100, 1> ignBlendOutput[4];
// offset 588
scaled_channel<int16_t, 100, 1> ignBlendOutput[4];
// offset 596
scaled_channel<int16_t, 10, 1> veBlendParameter[4];
// %
// offset 596
// offset 604
scaled_channel<uint8_t, 2, 1> veBlendBias[4];
// %
// offset 600
scaled_channel<int16_t, 100, 1> veBlendOutput[4];
// offset 608
scaled_channel<int16_t, 100, 1> veBlendOutput[4];
// offset 616
scaled_channel<int16_t, 10, 1> boostOpenLoopBlendParameter[2];
// %
// offset 612
// offset 620
scaled_channel<uint8_t, 2, 1> boostOpenLoopBlendBias[2];
// %
// offset 614
// offset 622
int8_t boostOpenLoopBlendOutput[2];
// offset 616
// offset 624
scaled_channel<int16_t, 10, 1> boostClosedLoopBlendParameter[2];
// %
// offset 620
// offset 628
scaled_channel<uint8_t, 2, 1> boostClosedLoopBlendBias[2];
// %
// offset 622
// offset 630
scaled_channel<int16_t, 10, 1> boostClosedLoopBlendOutput[2];
// offset 626
uint8_t alignmentFill_at_626[2];
// offset 628 bit 0
bool coilState1 : 1 {};
// offset 628 bit 1
bool coilState2 : 1 {};
// offset 628 bit 2
bool coilState3 : 1 {};
// offset 628 bit 3
bool coilState4 : 1 {};
// offset 628 bit 4
bool coilState5 : 1 {};
// offset 628 bit 5
bool coilState6 : 1 {};
// offset 628 bit 6
bool coilState7 : 1 {};
// offset 628 bit 7
bool coilState8 : 1 {};
// offset 628 bit 8
bool coilState9 : 1 {};
// offset 628 bit 9
bool coilState10 : 1 {};
// offset 628 bit 10
bool coilState11 : 1 {};
// offset 628 bit 11
bool coilState12 : 1 {};
// offset 628 bit 12
bool injectorState1 : 1 {};
// offset 628 bit 13
bool injectorState2 : 1 {};
// offset 628 bit 14
bool injectorState3 : 1 {};
// offset 628 bit 15
bool injectorState4 : 1 {};
// offset 628 bit 16
bool injectorState5 : 1 {};
// offset 628 bit 17
bool injectorState6 : 1 {};
// offset 628 bit 18
bool injectorState7 : 1 {};
// offset 628 bit 19
bool injectorState8 : 1 {};
// offset 628 bit 20
bool injectorState9 : 1 {};
// offset 628 bit 21
bool injectorState10 : 1 {};
// offset 628 bit 22
bool injectorState11 : 1 {};
// offset 628 bit 23
bool injectorState12 : 1 {};
// offset 628 bit 24
bool unusedBit_628_24 : 1 {};
// offset 628 bit 25
bool unusedBit_628_25 : 1 {};
// offset 628 bit 26
bool unusedBit_628_26 : 1 {};
// offset 628 bit 27
bool unusedBit_628_27 : 1 {};
// offset 628 bit 28
bool unusedBit_628_28 : 1 {};
// offset 628 bit 29
bool unusedBit_628_29 : 1 {};
// offset 628 bit 30
bool unusedBit_628_30 : 1 {};
// offset 628 bit 31
bool unusedBit_628_31 : 1 {};
// offset 632
uint32_t outputRequestPeriod = (uint32_t)0;
// offset 634
uint8_t alignmentFill_at_634[2];
// offset 636
uint32_t outputRequestPeriod = (uint32_t)0;
// offset 640
float mapFast = (float)0;
// Lua: Gauge
// value
// offset 640
// offset 644
float luaGauges[2];
// V
// offset 648
// offset 652
scaled_channel<uint16_t, 1000, 1> rawMaf2 = (uint16_t)0;
// MAF #2
// kg/h
// offset 650
// offset 654
scaled_channel<uint16_t, 10, 1> mafMeasured2 = (uint16_t)0;
// offset 652
// offset 656
uint16_t schedulingUsedCount = (uint16_t)0;
// %
// offset 654
// offset 658
scaled_channel<uint16_t, 100, 1> Gego = (uint16_t)0;
// count
// offset 656
// offset 660
uint16_t testBenchIter = (uint16_t)0;
// deg C
// offset 658
// offset 662
scaled_channel<int16_t, 100, 1> oilTemp = (int16_t)0;
// deg C
// offset 660
// offset 664
scaled_channel<int16_t, 100, 1> fuelTemp = (int16_t)0;
// deg C
// offset 662
// offset 666
scaled_channel<int16_t, 100, 1> ambientTemp = (int16_t)0;
// deg C
// offset 664
// offset 668
scaled_channel<int16_t, 100, 1> compressorDischargeTemp = (int16_t)0;
// kPa
// offset 666
// offset 670
scaled_channel<uint16_t, 30, 1> compressorDischargePressure = (uint16_t)0;
// kPa
// offset 668
// offset 672
scaled_channel<uint16_t, 30, 1> throttleInletPressure = (uint16_t)0;
// sec
// offset 670
// offset 674
uint16_t ignitionOnTime = (uint16_t)0;
// sec
// offset 672
// offset 676
uint16_t engineRunTime = (uint16_t)0;
// km
// offset 674
// offset 678
scaled_channel<uint16_t, 10, 1> distanceTraveled = (uint16_t)0;
// Air/Fuel Ratio (Gas Scale)
// AFR
// offset 676
// offset 680
scaled_channel<uint16_t, 1000, 1> afrGasolineScale = (uint16_t)0;
// Air/Fuel Ratio 2 (Gas Scale)
// AFR
// offset 678
// offset 682
scaled_channel<uint16_t, 1000, 1> afr2GasolineScale = (uint16_t)0;
// Fuel: Last inj pulse width stg 2
// ms
// offset 680
// offset 684
scaled_channel<uint16_t, 300, 1> actualLastInjectionStage2 = (uint16_t)0;
// Fuel: injector duty cycle stage 2
// %
// offset 682
// offset 686
scaled_channel<uint8_t, 2, 1> injectorDutyCycleStage2 = (uint8_t)0;
// offset 683
// offset 687
uint8_t pad = (uint8_t)0;
// offset 684
// offset 688
uint16_t mapAveragingSamples = (uint16_t)0;
// kPa
// offset 686
// offset 690
uint8_t mapPerCylinder[12];
// offset 698
uint8_t unusedAtTheEnd[102];
// ratio
// offset 702
scaled_channel<uint16_t, 1000, 1> dwellAccuracyRatio = (uint16_t)0;
};
static_assert(sizeof(output_channels_s) == 800);
static_assert(sizeof(output_channels_s) == 704);
static_assert(offsetof(output_channels_s, RPMValue) == 4);
static_assert(offsetof(output_channels_s, rpmAcceleration) == 6);
static_assert(offsetof(output_channels_s, speedToRpmRatio) == 8);
@ -906,64 +849,66 @@ static_assert(offsetof(output_channels_s, vssEdgeCounter) == 324);
static_assert(offsetof(output_channels_s, issEdgeCounter) == 328);
static_assert(offsetof(output_channels_s, auxLinear1) == 332);
static_assert(offsetof(output_channels_s, auxLinear2) == 336);
static_assert(offsetof(output_channels_s, fallbackMap) == 340);
static_assert(offsetof(output_channels_s, instantMAPValue) == 342);
static_assert(offsetof(output_channels_s, maxLockedDuration) == 344);
static_assert(offsetof(output_channels_s, canWriteOk) == 346);
static_assert(offsetof(output_channels_s, canWriteNotOk) == 348);
static_assert(offsetof(output_channels_s, triggerPrimaryFall) == 352);
static_assert(offsetof(output_channels_s, triggerPrimaryRise) == 356);
static_assert(offsetof(output_channels_s, triggerSecondaryFall) == 360);
static_assert(offsetof(output_channels_s, triggerSecondaryRise) == 364);
static_assert(offsetof(output_channels_s, triggerVvtFall) == 368);
static_assert(offsetof(output_channels_s, triggerVvtRise) == 372);
static_assert(offsetof(output_channels_s, starterState) == 376);
static_assert(offsetof(output_channels_s, starterRelayDisable) == 377);
static_assert(offsetof(output_channels_s, multiSparkCounter) == 378);
static_assert(offsetof(output_channels_s, extiOverflowCount) == 379);
static_assert(offsetof(output_channels_s, auxSpeed1) == 524);
static_assert(offsetof(output_channels_s, auxSpeed2) == 526);
static_assert(offsetof(output_channels_s, ISSValue) == 528);
static_assert(offsetof(output_channels_s, rawAnalogInput) == 530);
static_assert(offsetof(output_channels_s, gppwmOutput) == 546);
static_assert(offsetof(output_channels_s, gppwmXAxis) == 550);
static_assert(offsetof(output_channels_s, gppwmYAxis) == 558);
static_assert(offsetof(output_channels_s, rawBattery) == 566);
static_assert(offsetof(output_channels_s, ignBlendParameter) == 568);
static_assert(offsetof(output_channels_s, ignBlendBias) == 576);
static_assert(offsetof(output_channels_s, ignBlendOutput) == 580);
static_assert(offsetof(output_channels_s, veBlendParameter) == 588);
static_assert(offsetof(output_channels_s, veBlendBias) == 596);
static_assert(offsetof(output_channels_s, veBlendOutput) == 600);
static_assert(offsetof(output_channels_s, boostOpenLoopBlendParameter) == 608);
static_assert(offsetof(output_channels_s, boostOpenLoopBlendBias) == 612);
static_assert(offsetof(output_channels_s, boostOpenLoopBlendOutput) == 614);
static_assert(offsetof(output_channels_s, boostClosedLoopBlendParameter) == 616);
static_assert(offsetof(output_channels_s, boostClosedLoopBlendBias) == 620);
static_assert(offsetof(output_channels_s, boostClosedLoopBlendOutput) == 622);
static_assert(offsetof(output_channels_s, outputRequestPeriod) == 632);
static_assert(offsetof(output_channels_s, mapFast) == 636);
static_assert(offsetof(output_channels_s, luaGauges) == 640);
static_assert(offsetof(output_channels_s, rawMaf2) == 648);
static_assert(offsetof(output_channels_s, mafMeasured2) == 650);
static_assert(offsetof(output_channels_s, schedulingUsedCount) == 652);
static_assert(offsetof(output_channels_s, Gego) == 654);
static_assert(offsetof(output_channels_s, testBenchIter) == 656);
static_assert(offsetof(output_channels_s, oilTemp) == 658);
static_assert(offsetof(output_channels_s, fuelTemp) == 660);
static_assert(offsetof(output_channels_s, ambientTemp) == 662);
static_assert(offsetof(output_channels_s, compressorDischargeTemp) == 664);
static_assert(offsetof(output_channels_s, compressorDischargePressure) == 666);
static_assert(offsetof(output_channels_s, throttleInletPressure) == 668);
static_assert(offsetof(output_channels_s, ignitionOnTime) == 670);
static_assert(offsetof(output_channels_s, engineRunTime) == 672);
static_assert(offsetof(output_channels_s, distanceTraveled) == 674);
static_assert(offsetof(output_channels_s, afrGasolineScale) == 676);
static_assert(offsetof(output_channels_s, afr2GasolineScale) == 678);
static_assert(offsetof(output_channels_s, actualLastInjectionStage2) == 680);
static_assert(offsetof(output_channels_s, injectorDutyCycleStage2) == 682);
static_assert(offsetof(output_channels_s, pad) == 683);
static_assert(offsetof(output_channels_s, mapAveragingSamples) == 684);
static_assert(offsetof(output_channels_s, mapPerCylinder) == 686);
static_assert(offsetof(output_channels_s, unusedAtTheEnd) == 698);
static_assert(offsetof(output_channels_s, auxLinear3) == 340);
static_assert(offsetof(output_channels_s, auxLinear4) == 344);
static_assert(offsetof(output_channels_s, fallbackMap) == 348);
static_assert(offsetof(output_channels_s, instantMAPValue) == 350);
static_assert(offsetof(output_channels_s, maxLockedDuration) == 352);
static_assert(offsetof(output_channels_s, canWriteOk) == 354);
static_assert(offsetof(output_channels_s, canWriteNotOk) == 356);
static_assert(offsetof(output_channels_s, triggerPrimaryFall) == 360);
static_assert(offsetof(output_channels_s, triggerPrimaryRise) == 364);
static_assert(offsetof(output_channels_s, triggerSecondaryFall) == 368);
static_assert(offsetof(output_channels_s, triggerSecondaryRise) == 372);
static_assert(offsetof(output_channels_s, triggerVvtFall) == 376);
static_assert(offsetof(output_channels_s, triggerVvtRise) == 380);
static_assert(offsetof(output_channels_s, starterState) == 384);
static_assert(offsetof(output_channels_s, starterRelayDisable) == 385);
static_assert(offsetof(output_channels_s, multiSparkCounter) == 386);
static_assert(offsetof(output_channels_s, extiOverflowCount) == 387);
static_assert(offsetof(output_channels_s, auxSpeed1) == 532);
static_assert(offsetof(output_channels_s, auxSpeed2) == 534);
static_assert(offsetof(output_channels_s, ISSValue) == 536);
static_assert(offsetof(output_channels_s, rawAnalogInput) == 538);
static_assert(offsetof(output_channels_s, gppwmOutput) == 554);
static_assert(offsetof(output_channels_s, gppwmXAxis) == 558);
static_assert(offsetof(output_channels_s, gppwmYAxis) == 566);
static_assert(offsetof(output_channels_s, rawBattery) == 574);
static_assert(offsetof(output_channels_s, ignBlendParameter) == 576);
static_assert(offsetof(output_channels_s, ignBlendBias) == 584);
static_assert(offsetof(output_channels_s, ignBlendOutput) == 588);
static_assert(offsetof(output_channels_s, veBlendParameter) == 596);
static_assert(offsetof(output_channels_s, veBlendBias) == 604);
static_assert(offsetof(output_channels_s, veBlendOutput) == 608);
static_assert(offsetof(output_channels_s, boostOpenLoopBlendParameter) == 616);
static_assert(offsetof(output_channels_s, boostOpenLoopBlendBias) == 620);
static_assert(offsetof(output_channels_s, boostOpenLoopBlendOutput) == 622);
static_assert(offsetof(output_channels_s, boostClosedLoopBlendParameter) == 624);
static_assert(offsetof(output_channels_s, boostClosedLoopBlendBias) == 628);
static_assert(offsetof(output_channels_s, boostClosedLoopBlendOutput) == 630);
static_assert(offsetof(output_channels_s, outputRequestPeriod) == 636);
static_assert(offsetof(output_channels_s, mapFast) == 640);
static_assert(offsetof(output_channels_s, luaGauges) == 644);
static_assert(offsetof(output_channels_s, rawMaf2) == 652);
static_assert(offsetof(output_channels_s, mafMeasured2) == 654);
static_assert(offsetof(output_channels_s, schedulingUsedCount) == 656);
static_assert(offsetof(output_channels_s, Gego) == 658);
static_assert(offsetof(output_channels_s, testBenchIter) == 660);
static_assert(offsetof(output_channels_s, oilTemp) == 662);
static_assert(offsetof(output_channels_s, fuelTemp) == 664);
static_assert(offsetof(output_channels_s, ambientTemp) == 666);
static_assert(offsetof(output_channels_s, compressorDischargeTemp) == 668);
static_assert(offsetof(output_channels_s, compressorDischargePressure) == 670);
static_assert(offsetof(output_channels_s, throttleInletPressure) == 672);
static_assert(offsetof(output_channels_s, ignitionOnTime) == 674);
static_assert(offsetof(output_channels_s, engineRunTime) == 676);
static_assert(offsetof(output_channels_s, distanceTraveled) == 678);
static_assert(offsetof(output_channels_s, afrGasolineScale) == 680);
static_assert(offsetof(output_channels_s, afr2GasolineScale) == 682);
static_assert(offsetof(output_channels_s, actualLastInjectionStage2) == 684);
static_assert(offsetof(output_channels_s, injectorDutyCycleStage2) == 686);
static_assert(offsetof(output_channels_s, pad) == 687);
static_assert(offsetof(output_channels_s, mapAveragingSamples) == 688);
static_assert(offsetof(output_channels_s, mapPerCylinder) == 690);
static_assert(offsetof(output_channels_s, dwellAccuracyRatio) == 702);

View File

@ -42,6 +42,9 @@ static Timer requestPeriodTimer;
* Gauges refresh
*/
void TunerStudio::cmdOutputChannels(TsChannelBase* tsChannel, uint16_t offset, uint16_t count) {
// Assert that the entire output channels block will fit in a single TS transaction
static_assert(BLOCKING_FACTOR >= TS_TOTAL_OUTPUT_SIZE + 10);
if (offset + count > TS_TOTAL_OUTPUT_SIZE) {
efiPrintf("TS: Version Mismatch? Too much outputs requested %d/%d/%d", offset, count,
sizeof(TunerStudioOutputChannels));
@ -49,10 +52,8 @@ void TunerStudio::cmdOutputChannels(TsChannelBase* tsChannel, uint16_t offset, u
return;
}
if (offset < BLOCKING_FACTOR) {
engine->outputChannels.outputRequestPeriod
= 1e6 * requestPeriodTimer.getElapsedSecondsAndReset(getTimeNowNt());
}
engine->outputChannels.outputRequestPeriod
= 1e6 * requestPeriodTimer.getElapsedSecondsAndReset(getTimeNowNt());
tsState.outputChannelsCommandCounter++;
updateTunerStudioState();

View File

@ -69,10 +69,6 @@ extern bool main_loop_started;
#include "flash_main.h"
#endif
#if EFI_MAP_AVERAGING
#include "map_averaging.h"
#endif
#if (BOARD_TLE8888_COUNT > 0)
#include "tle8888.h"
#endif /* BOARD_TLE8888_COUNT */
@ -391,6 +387,8 @@ static void updatePressures() {
engine->outputChannels.auxLinear1 = Sensor::getOrZero(SensorType::AuxLinear1);
engine->outputChannels.auxLinear2 = Sensor::getOrZero(SensorType::AuxLinear2);
engine->outputChannels.auxLinear3 = Sensor::getOrZero(SensorType::AuxLinear3);
engine->outputChannels.auxLinear4 = Sensor::getOrZero(SensorType::AuxLinear4);
}
static void updateMiscSensors() {
@ -621,19 +619,6 @@ void updateTunerStudioState() {
tsOutputChannels->debugIntField5 = engine->triggerCentral.triggerState.currentCycle.eventCount[1];
#endif // EFI_SHAFT_POSITION_INPUT
break;
#if EFI_MAP_AVERAGING
case DBG_MAP:
postMapState(tsOutputChannels);
break;
#endif /* EFI_MAP_AVERAGING */
case DBG_INSTANT_RPM:
{
#if EFI_SHAFT_POSITION_INPUT
tsOutputChannels->debugFloatField2 = instantRpm / Sensor::getOrZero(SensorType::Rpm);
#endif // EFI_SHAFT_POSITION_INPUT
}
break;
case DBG_TLE8888:
#if (BOARD_TLE8888_COUNT > 0)

View File

@ -6,7 +6,6 @@
#include "thread_controller.h"
#include "tunerstudio.h"
// Assert that the USB tx/rx buffers are large enough to fit one full packet
static_assert(SERIAL_USB_BUFFERS_SIZE >= BLOCKING_FACTOR + 10);

View File

@ -58,6 +58,10 @@ expected<float> readGppwmChannel(gppwm_channel_e channel) {
return Sensor::get(SensorType::AuxLinear1);
case GPPWM_AuxLinear2:
return Sensor::get(SensorType::AuxLinear2);
case GPPWM_AuxLinear3:
return Sensor::get(SensorType::AuxLinear3);
case GPPWM_AuxLinear4:
return Sensor::get(SensorType::AuxLinear4);
case GPPWM_GppwmOutput1:
return (float)engine->outputChannels.gppwmOutput[0];
case GPPWM_GppwmOutput2:
@ -74,6 +78,8 @@ expected<float> readGppwmChannel(gppwm_channel_e channel) {
return Sensor::get(SensorType::EGT1);
case GPPWM_Egt2:
return Sensor::get(SensorType::EGT2);
case GPPWM_VehicleSpeed:
return Sensor::get(SensorType::VehicleSpeed);
}
return unexpected;

View File

@ -333,6 +333,10 @@ case GPPWM_AuxLinear1:
return "GPPWM_AuxLinear1";
case GPPWM_AuxLinear2:
return "GPPWM_AuxLinear2";
case GPPWM_AuxLinear3:
return "GPPWM_AuxLinear3";
case GPPWM_AuxLinear4:
return "GPPWM_AuxLinear4";
case GPPWM_AuxTemp1:
return "GPPWM_AuxTemp1";
case GPPWM_AuxTemp2:
@ -383,6 +387,8 @@ case GPPWM_VVT_2I:
return "GPPWM_VVT_2I";
case GPPWM_Vbatt:
return "GPPWM_Vbatt";
case GPPWM_VehicleSpeed:
return "GPPWM_VehicleSpeed";
case GPPWM_Zero:
return "GPPWM_Zero";
}

View File

@ -122,16 +122,22 @@ case DBG_20:
return "DBG_20";
case DBG_21:
return "DBG_21";
case DBG_22:
return "DBG_22";
case DBG_24:
return "DBG_24";
case DBG_25:
return "DBG_25";
case DBG_26:
return "DBG_26";
case DBG_27:
return "DBG_27";
case DBG_29:
return "DBG_29";
case DBG_32:
return "DBG_32";
case DBG_33:
return "DBG_33";
case DBG_34:
return "DBG_34";
case DBG_35:
@ -156,8 +162,6 @@ case DBG_9:
return "DBG_9";
case DBG_COMPOSITE_LOG:
return "DBG_COMPOSITE_LOG";
case DBG_DWELL_METRIC:
return "DBG_DWELL_METRIC";
case DBG_DYNO_VIEW:
return "DBG_DYNO_VIEW";
case DBG_ELECTRONIC_THROTTLE_PID:
@ -168,16 +172,12 @@ case DBG_ETB_AUTOTUNE:
return "DBG_ETB_AUTOTUNE";
case DBG_EXECUTOR:
return "DBG_EXECUTOR";
case DBG_INSTANT_RPM:
return "DBG_INSTANT_RPM";
case DBG_ION:
return "DBG_ION";
case DBG_LOGIC_ANALYZER:
return "DBG_LOGIC_ANALYZER";
case DBG_LUA:
return "DBG_LUA";
case DBG_MAP:
return "DBG_MAP";
case DBG_METRICS:
return "DBG_METRICS";
case DBG_SR5_PROTOCOL:

View File

@ -32,8 +32,6 @@ void setDefaultBaseEngine() {
engineConfiguration->turbochargerFilter = 0.01f;
engineConfiguration->fuelAlgorithm = LM_SPEED_DENSITY;
// let's have valid default while we still have the field
engineConfiguration->debugMode = DBG_INSTANT_RPM;
// Limits and Fallbacks
engineConfiguration->rpmHardLimit = 7000;

View File

@ -109,6 +109,9 @@ static void setDefaultFuelCutParameters() {
engineConfiguration->coastingFuelCutTps = 2;
engineConfiguration->coastingFuelCutMap = 30;
engineConfiguration->coastingFuelCutClt = 60;
engineConfiguration->useTableForDfcoMap = 0;
copyArray(engineConfiguration->dfcoMapRpmValuesBins, { 1500, 2000, 3500, 5000 });
copyArray(engineConfiguration->dfcoMapRpmValues, { 30, 25, 20, 18 });
}
static void setDefaultStftSettings() {

View File

@ -17,13 +17,11 @@
#include "speed_density.h"
#include "advance_map.h"
#include "map_averaging.h"
#include "perf_trace.h"
#include "backup_ram.h"
#include "idle_thread.h"
#include "idle_hardware.h"
#include "gppwm.h"
#include "tachometer.h"
#include "speedometer.h"
#include "dynoview.h"
#include "boost_control.h"
@ -467,13 +465,8 @@ injection_mode_e getCurrentInjectionMode() {
void Engine::periodicFastCallback() {
ScopePerf pc(PE::EnginePeriodicFastCallback);
#if EFI_MAP_AVERAGING
refreshMapAveragingPreCalc();
#endif
engineState.periodicFastCallback();
tachUpdate();
speedoUpdate();
engineModules.apply_all([](auto & m) { m.onFastCallback(); });

View File

@ -24,6 +24,8 @@ public:
*/
angle_t engineCycle;
bool useOddFireWastedSpark = false;
/**
* this is based on sensorChartMode and sensorSnifferRpmThreshold settings
*/

View File

@ -253,18 +253,18 @@ typedef enum __attribute__ ((__packed__)) {
DBG_20 = 20,
DBG_21 = 21,
DBG_INSTANT_RPM = 22,
DBG_22 = 22,
UNUSED23 = 23,
DBG_24 = 24,
DBG_25 = 25,
DBG_26 = 26,
DBG_MAP = 27,
DBG_27 = 27,
DBG_METRICS = 28,
DBG_29 = 29,
DBG_ION = 30,
DBG_TLE8888 = 31,
DBG_32 = 32,
DBG_DWELL_METRIC = 33,
DBG_33 = 33,
DBG_34 = 34,
DBG_35 = 35,
DBG_36 = 36,

View File

@ -2069,7 +2069,7 @@ enum class ObdCode : uint16_t {
CUSTOM_ERR_MAP_START_ASSERT = 6690,
CUSTOM_ERR_MAP_AVG_OFFSET = 6691,
CUSTOM_ERR_MAP_CYL_OFFSET = 6692,
CUSTOM_ERR_6692 = 6692,
CUSTOM_ERR_PWM_DUTY_ASSERT = 6693,
CUSTOM_ERR_ZERO_CRANKING_FUEL = 6694,
CUSTOM_NULL_EXECUTOR = 6695,

View File

@ -527,6 +527,9 @@ typedef enum __attribute__ ((__packed__)) {
GPPWM_BaroPressure = 26,
GPPWM_Egt1 = 27,
GPPWM_Egt2 = 28,
GPPWM_AuxLinear3 = 29,
GPPWM_AuxLinear4 = 30,
GPPWM_VehicleSpeed = 31,
} gppwm_channel_e;
typedef enum __attribute__ ((__packed__)) {

View File

@ -22,7 +22,6 @@ CONTROLLERS_SRC_CPP = \
$(CONTROLLERS_DIR)/actuators/vvt.cpp \
$(CONTROLLERS_DIR)/actuators/gppwm/gppwm_channel.cpp \
$(CONTROLLERS_DIR)/actuators/gppwm/gppwm.cpp \
$(CONTROLLERS_DIR)/gauges/tachometer.cpp \
$(CONTROLLERS_DIR)/gauges/speedometer.cpp \
$(CONTROLLERS_DIR)/gauges/malfunction_indicator.cpp \
$(CONTROLLERS_DIR)/system/timer/single_timer_executor.cpp \
@ -30,7 +29,6 @@ CONTROLLERS_SRC_CPP = \
$(CONTROLLERS_DIR)/system/timer/event_queue.cpp \
$(CONTROLLERS_DIR)/settings.cpp \
$(CONTROLLERS_DIR)/core/error_handling.cpp \
$(CONTROLLERS_DIR)/engine_cycle/map_averaging.cpp \
$(CONTROLLERS_DIR)/engine_cycle/high_pressure_fuel_pump.cpp \
$(CONTROLLERS_DIR)/engine_cycle/rpm_calculator.cpp \
$(CONTROLLERS_DIR)/engine_cycle/spark_logic.cpp \

View File

@ -25,4 +25,11 @@ public:
// Queried to determine whether this module needs a delayed shutoff, defaults to false
virtual bool needsDelayedShutoff() { return false; }
// Called on every successfully decoded tooth of the primary trigger
virtual void onEnginePhase(float /*rpm*/,
efitick_t /*edgeTimestamp*/,
angle_t /*currentPhase*/,
angle_t /*nextPhase*/)
{ }
};

View File

@ -1,2 +1,2 @@
#pragma once
#define VCS_DATE 20240825
#define VCS_DATE 20240906

View File

@ -32,7 +32,6 @@
#include "flash_main.h"
#include "bench_test.h"
#include "electronic_throttle.h"
#include "map_averaging.h"
#include "high_pressure_fuel_pump.h"
#include "malfunction_central.h"
#include "malfunction_indicator.h"
@ -45,7 +44,6 @@
#include "vvt.h"
#include "boost_control.h"
#include "launch_control.h"
#include "tachometer.h"
#include "speedometer.h"
#include "gppwm.h"
#include "date_stamp.h"
@ -514,11 +512,9 @@ void commonInitEngineController() {
initElectronicThrottle();
#endif /* EFI_ELECTRONIC_THROTTLE_BODY */
#if EFI_MAP_AVERAGING
if (engineConfiguration->isMapAveragingEnabled) {
initMapAveraging();
}
#endif /* EFI_MAP_AVERAGING */
#ifdef MODULE_MAP_AVERAGING
initMapAveraging();
#endif /* MODULE_MAP_AVERAGING */
#if EFI_BOOST_CONTROL
initBoostCtrl();

View File

@ -82,13 +82,12 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_
// todo: check for 'trigger->is_synchnonized?'
return;
}
if (rpm == NOISY_RPM) {
if (rpm == NOISY_RPM || rpm > UNREALISTIC_RPM) {
warning(ObdCode::OBD_Crankshaft_Position_Sensor_A_Circuit_Malfunction, "noisy trigger");
return;
}
if (trgEventIndex == 0) {
if (getTriggerCentral()->checkIfTriggerConfigChanged()) {
getIgnitionEvents()->isReady = false; // we need to rebuild complete ignition schedule
getFuelSchedule()->isReady = false;
@ -100,15 +99,16 @@ void mainTriggerCallback(uint32_t trgEventIndex, efitick_t edgeTimestamp, angle_
}
}
engine->engineModules.apply_all([=](auto & m) {
m.onEnginePhase(rpm, edgeTimestamp, currentPhase, nextPhase);
});
/**
* For fuel we schedule start of injection based on trigger angle, and then inject for
* specified duration of time
*/
handleFuel(edgeTimestamp, currentPhase, nextPhase);
engine->module<TriggerScheduler>()->scheduleEventsUntilNextTriggerTooth(
rpm, edgeTimestamp, currentPhase, nextPhase);
/**
* For spark we schedule both start of coil charge and actual spark based on trigger angle
*/

View File

@ -104,6 +104,14 @@ static void prepareCylinderIgnitionSchedule(angle_t dwellAngleDuration, floatms_
event->sparkAngle = sparkAngle;
auto ignitionMode = getCurrentIgnitionMode();
// On an odd cylinder (or odd fire) wasted spark engine, map outputs as if in sequential.
// During actual scheduling, the events just get scheduled every 360 deg instead
// of every 720 deg.
if (ignitionMode == IM_WASTED_SPARK && engine->engineState.useOddFireWastedSpark) {
ignitionMode = IM_INDIVIDUAL_COILS;
}
engine->outputChannels.currentIgnitionMode = static_cast<uint8_t>(ignitionMode);
const int index = getIgnitionPinForIndex(event->cylinderIndex, ignitionMode);
@ -175,35 +183,14 @@ void fireSparkAndPrepareNextSchedule(IgnitionEvent *event) {
LogTriggerCoilState(nowNt, false);
#endif // EFI_TOOTH_LOGGER
#if !EFI_UNIT_TEST
if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
#if EFI_TUNER_STUDIO
float actualDwellMs = event->actualDwellTimer.getElapsedSeconds(nowNt) * 1e3;
/**
* ratio of desired dwell duration to actual dwell duration gives us some idea of how good is input trigger jitter
*/
float ratio = actualDwellMs / event->sparkDwell;
// todo: smarted solution for index to field mapping
switch (event->cylinderIndex) {
case 0:
engine->outputChannels.debugFloatField1 = ratio;
break;
case 1:
engine->outputChannels.debugFloatField2 = ratio;
break;
case 2:
engine->outputChannels.debugFloatField3 = ratio;
break;
case 3:
engine->outputChannels.debugFloatField4 = ratio;
break;
{
// ratio of desired dwell duration to actual dwell duration gives us some idea of how good is input trigger jitter
float actualDwellMs = event->actualDwellTimer.getElapsedSeconds(nowNt) * 1e3;
engine->outputChannels.dwellAccuracyRatio = actualDwellMs / event->sparkDwell;
}
#endif
}
#endif /* EFI_UNIT_TEST */
// now that we've just fired a coil let's prepare the new schedule for the next engine revolution
angle_t dwellAngleDuration = engine->ignitionState.dwellAngle;
@ -219,19 +206,12 @@ if (engineConfiguration->debugMode == DBG_DWELL_METRIC) {
efitick_t nextDwellStart = nowNt + engine->engineState.multispark.delay;
efitick_t nextFiring = nextDwellStart + engine->engineState.multispark.dwell;
#if SPARK_EXTREME_LOGGING
efiPrintf("schedule multispark");
#endif /* SPARK_EXTREME_LOGGING */
// We can schedule both of these right away, since we're going for "asap" not "particular angle"
engine->scheduler.schedule("dwell", &event->dwellStartTimer, nextDwellStart, { &turnSparkPinHigh, event });
engine->scheduler.schedule("firing", &event->sparkEvent.scheduling, nextFiring, { fireSparkAndPrepareNextSchedule, event });
} else {
if (engineConfiguration->enableTrailingSparks) {
#if SPARK_EXTREME_LOGGING
efiPrintf("scheduleByAngle TrailingSparks");
#endif /* SPARK_EXTREME_LOGGING */
// Trailing sparks are enabled - schedule an event for the corresponding trailing coil
scheduleByAngle(
&event->trailingSparkFire, nowNt, engine->engineState.trailingSparkAngle,
@ -309,20 +289,9 @@ void turnSparkPinHigh(IgnitionEvent *event) {
}
static void scheduleSparkEvent(bool limitedSpark, IgnitionEvent *event,
int rpm, efitick_t edgeTimestamp, float currentPhase, float nextPhase) {
int rpm, float dwellMs, float dwellAngle, float sparkAngle, efitick_t edgeTimestamp, float currentPhase, float nextPhase) {
angle_t sparkAngle = event->sparkAngle;
const floatms_t dwellMs = engine->ignitionState.sparkDwell;
if (std::isnan(dwellMs) || dwellMs <= 0) {
warning(ObdCode::CUSTOM_DWELL, "invalid dwell to handle: %.2f at %d", dwellMs, rpm);
return;
}
if (std::isnan(sparkAngle)) {
warning(ObdCode::CUSTOM_ADVANCE_SPARK, "NaN advance");
return;
}
float angleOffset = event->dwellAngle - currentPhase;
float angleOffset = dwellAngle - currentPhase;
if (angleOffset < 0) {
angleOffset += engine->engineState.engineCycle;
}
@ -457,6 +426,12 @@ void onTriggerEventSparkLogic(int rpm, efitick_t edgeTimestamp, float currentPha
engine->outputChannels.sparkCutReason = (int8_t)limitedSparkState.reason;
bool limitedSpark = !limitedSparkState.value;
const floatms_t dwellMs = engine->ignitionState.sparkDwell;
if (std::isnan(dwellMs) || dwellMs <= 0) {
warning(ObdCode::CUSTOM_DWELL, "invalid dwell to handle: %.2f at %d", dwellMs, rpm);
return;
}
if (!engine->ignitionEvents.isReady) {
prepareIgnitionSchedule();
}
@ -467,13 +442,48 @@ void onTriggerEventSparkLogic(int rpm, efitick_t edgeTimestamp, float currentPha
* See initializeIgnitionActions()
*/
// Only apply odd cylinder count wasted logic if:
// - odd cyl count
// - current mode is wasted spark
// - four stroke
bool enableOddCylinderWastedSpark =
engine->engineState.useOddFireWastedSpark
&& getCurrentIgnitionMode() == IM_WASTED_SPARK;
// scheduleSimpleMsg(&logger, "eventId spark ", eventIndex);
if (engine->ignitionEvents.isReady) {
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
IgnitionEvent *event = &engine->ignitionEvents.elements[i];
if (!isPhaseInRange(event->dwellAngle, currentPhase, nextPhase)) {
angle_t dwellAngle = event->dwellAngle;
angle_t sparkAngle = event->sparkAngle;
if (std::isnan(sparkAngle)) {
warning(ObdCode::CUSTOM_ADVANCE_SPARK, "NaN advance");
continue;
}
bool isOddCylWastedEvent = false;
if (enableOddCylinderWastedSpark) {
auto dwellAngleWastedEvent = dwellAngle + 360;
if (dwellAngleWastedEvent > 720) {
dwellAngleWastedEvent -= 720;
}
// Check whether this event hits 360 degrees out from now (ie, wasted spark),
// and if so, twiddle the dwell and spark angles so it happens now instead
isOddCylWastedEvent = isPhaseInRange(dwellAngleWastedEvent, currentPhase, nextPhase);
if (isOddCylWastedEvent) {
dwellAngle = dwellAngleWastedEvent;
sparkAngle += 360;
if (sparkAngle > 720) {
sparkAngle -= 720;
}
}
}
if (!isOddCylWastedEvent && !isPhaseInRange(dwellAngle, currentPhase, nextPhase)) {
continue;
}
@ -498,7 +508,7 @@ void onTriggerEventSparkLogic(int rpm, efitick_t edgeTimestamp, float currentPha
engine->ALSsoftSparkLimiter.setTargetSkipRatio(ALSSkipRatio);
#endif // EFI_ANTILAG_SYSTEM
scheduleSparkEvent(limitedSpark, event, rpm, edgeTimestamp, currentPhase, nextPhase);
scheduleSparkEvent(limitedSpark, event, rpm, dwellMs, dwellAngle, sparkAngle, edgeTimestamp, currentPhase, nextPhase);
}
}
}

View File

@ -1,11 +0,0 @@
/*
* @file tachometer.h
*
* @date Aug 18, 2015
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
void initTachometer();
void tachUpdate();

View File

@ -19,12 +19,6 @@ static bool noFiringUntilVvtSync(vvt_mode_e vvtMode) {
return true;
}
// Odd cylinder count engines don't work properly with wasted spark, so wait for full sync (so that sequential works)
// See https://github.com/rusefi/rusefi/issues/4195 for the issue to properly support this case
if (engineConfiguration->cylindersCount > 1 && engineConfiguration->cylindersCount % 2 == 1) {
return true;
}
// Symmetrical crank modes require cam sync before firing
// non-symmetrical cranks can use faster spin-up mode (firing in wasted/batch before VVT sync)
// Examples include Nissan MR/VQ, Miata NB, etc

View File

@ -386,8 +386,7 @@ ignition_mode_e getCurrentIgnitionMode() {
ignition_mode_e ignitionMode = engineConfiguration->ignitionMode;
#if EFI_SHAFT_POSITION_INPUT
// In spin-up cranking mode we don't have full phase sync info yet, so wasted spark mode is better
// However, only do this on even cylinder count engines: odd cyl count doesn't fire at all
if (ignitionMode == IM_INDIVIDUAL_COILS && (engineConfiguration->cylindersCount % 2 == 0)) {
if (ignitionMode == IM_INDIVIDUAL_COILS) {
bool missingPhaseInfoForSequential =
!engine->triggerCentral.triggerState.hasSynchronizedPhase();
@ -405,7 +404,20 @@ ignition_mode_e getCurrentIgnitionMode() {
* This heavy method is only invoked in case of a configuration change or initialization.
*/
void prepareOutputSignals() {
getEngineState()->engineCycle = getEngineCycle(getEngineRotationState()->getOperationMode());
auto operationMode = getEngineRotationState()->getOperationMode();
getEngineState()->engineCycle = getEngineCycle(operationMode);
bool isOddFire = false;
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
if (engineConfiguration->timing_offset_cylinder[i] != 0) {
isOddFire = true;
break;
}
}
// Use odd fire wasted spark logic if not two stroke, and an odd fire or odd cylinder # engine
getEngineState()->useOddFireWastedSpark = operationMode != TWO_STROKE
&& (isOddFire | (engineConfiguration->cylindersCount % 2 == 1));
#if EFI_UNIT_TEST
if (verboseMode) {

View File

@ -23,11 +23,6 @@
#include "pch.h"
#if EFI_MAP_AVERAGING
#include "map_averaging.h"
#include "trigger_central.h"
#if EFI_SENSOR_CHART
@ -52,12 +47,11 @@ static int averagedMapBufIdx = 0;
* here we have averaging start and averaging end points for each cylinder
*/
struct sampler {
scheduling_s startTimer;
scheduling_s endTimer;
scheduling_s timer;
uint8_t cylinderIndex;
};
static CCM_OPTIONAL sampler samplers[MAX_CYLINDER_COUNT][2];
static CCM_OPTIONAL sampler samplers[MAX_CYLINDER_COUNT];
static void endAveraging(MapAverager* arg);
@ -78,10 +72,15 @@ static void startAveraging(sampler* s) {
mapAveragingPin.setHigh();
scheduleByAngle(&s->endTimer, getTimeNowNt(), duration,
scheduleByAngle(&s->timer, getTimeNowNt(), duration,
{ endAveraging, &averager });
}
void MapAverager::showInfo(const char* sensorName) const {
const auto value = get();
efiPrintf("Sensor \"%s\" is MAP averager: valid: %s value: %.2f averaged sample count: %d", sensorName, boolToString(value.Valid), value.Value, m_lastCounter);
}
void MapAverager::start(uint8_t cylinderIndex) {
chibios_rt::CriticalSectionLocker csl;
@ -137,24 +136,21 @@ void MapAverager::stop() {
}
}
#if HAL_USE_ADC
/**
* This method is invoked from ADC callback.
* @note This method is invoked OFTEN, this method is a potential bottleneck - the implementation should be
* as fast as possible
*/
void mapAveragingAdcCallback(float instantVoltage) {
void MapAveragingModule::submitSample(float volts) {
efiAssertVoid(ObdCode::CUSTOM_ERR_6650, getCurrentRemainingStack() > 128, "lowstck#9a");
SensorResult mapResult = getMapAvg(currentMapAverager).submit(instantVoltage);
SensorResult mapResult = getMapAvg(currentMapAverager).submit(volts);
float instantMap = mapResult.value_or(0);
#if EFI_TUNER_STUDIO
engine->outputChannels.instantMAPValue = instantMap;
#endif // EFI_TUNER_STUDIO
}
#endif
static void endAveraging(MapAverager* arg) {
arg->stop();
@ -173,106 +169,68 @@ static void applyMapMinBufferLength() {
}
}
#if EFI_TUNER_STUDIO
void postMapState(TunerStudioOutputChannels *tsOutputChannels) {
tsOutputChannels->debugFloatField2 = engine->engineState.mapAveragingDuration;
}
#endif /* EFI_TUNER_STUDIO */
void MapAveragingModule::onFastCallback() {
float rpm = Sensor::getOrZero(SensorType::Rpm);
void refreshMapAveragingPreCalc() {
int rpm = Sensor::getOrZero(SensorType::Rpm);
if (isValidRpm(rpm)) {
MAP_sensor_config_s * c = &engineConfiguration->map;
angle_t start = interpolate2d(rpm, c->samplingAngleBins, c->samplingAngle);
angle_t duration = interpolate2d(rpm, c->samplingWindowBins, c->samplingWindow);
efiAssertVoid(ObdCode::CUSTOM_ERR_MAP_START_ASSERT, !std::isnan(start), "start");
assertAngleRange(duration, "samplingDuration", ObdCode::CUSTOM_ERR_6563);
MAP_sensor_config_s * c = &engineConfiguration->map;
angle_t offsetAngle = engine->triggerCentral.triggerFormDetails.eventAngles[0];
efiAssertVoid(ObdCode::CUSTOM_ERR_MAP_AVG_OFFSET, !std::isnan(offsetAngle), "offsetAngle");
angle_t start = interpolate2d(rpm, c->samplingAngleBins, c->samplingAngle);
efiAssertVoid(ObdCode::CUSTOM_ERR_MAP_START_ASSERT, !std::isnan(start), "start");
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
angle_t cylinderOffset = getEngineCycle(getEngineRotationState()->getOperationMode()) * i / engineConfiguration->cylindersCount;
efiAssertVoid(ObdCode::CUSTOM_ERR_MAP_CYL_OFFSET, !std::isnan(cylinderOffset), "cylinderOffset");
// part of this formula related to specific cylinder offset is never changing - we can
// move the loop into start-up calculation and not have this loop as part of periodic calculation
// todo: change the logic as described above in order to reduce periodic CPU usage?
float cylinderStart = start + cylinderOffset - offsetAngle + tdcPosition();
wrapAngle(cylinderStart, "cylinderStart", ObdCode::CUSTOM_ERR_6562);
engine->engineState.mapAveragingStart[i] = cylinderStart;
}
engine->engineState.mapAveragingDuration = duration;
} else {
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
engine->engineState.mapAveragingStart[i] = 0;
}
engine->engineState.mapAveragingDuration = 0;
for (size_t i = 0; i < engineConfiguration->cylindersCount; i++) {
float cylinderStart = start + getCylinderAngle(i, ID2INDEX(getCylinderId(i)));;
wrapAngle(cylinderStart, "cylinderStart", ObdCode::CUSTOM_ERR_6562);
engine->engineState.mapAveragingStart[i] = cylinderStart;
}
angle_t duration = interpolate2d(rpm, c->samplingWindowBins, c->samplingWindow);
assertAngleRange(duration, "samplingDuration", ObdCode::CUSTOM_ERR_6563);
// Clamp the duration to slightly less than one cylinder period
float cylinderPeriod = engine->engineState.engineCycle / engineConfiguration->cylindersCount;
engine->engineState.mapAveragingDuration = clampF(10, duration, cylinderPeriod - 10);
}
/**
* Shaft Position callback used to schedule start and end of MAP averaging
*/
void mapAveragingTriggerCallback(
uint32_t index, efitick_t edgeTimestamp) {
#if EFI_ENGINE_CONTROL
// update only once per engine cycle
if (index != 0) {
return;
}
int rpm = Sensor::getOrZero(SensorType::Rpm);
if (!isValidRpm(rpm)) {
// Callback to schedule the start of map averaging for each cylinder
void MapAveragingModule::onEnginePhase(float rpm,
efitick_t edgeTimestamp,
float currentPhase,
float nextPhase) {
if (!engineConfiguration->isMapAveragingEnabled) {
return;
}
ScopePerf perf(PE::MapAveragingTriggerCallback);
if (engineConfiguration->mapMinBufferLength != mapMinBufferLength) {
applyMapMinBufferLength();
}
int samplingCount = engineConfiguration->measureMapOnlyInOneCylinder ? 1 : engineConfiguration->cylindersCount;
for (int i = 0; i < samplingCount; i++) {
angle_t samplingStart = engine->engineState.mapAveragingStart[i];
angle_t samplingDuration = engine->engineState.mapAveragingDuration;
if (samplingDuration <= 0) {
warning(ObdCode::CUSTOM_MAP_ANGLE_PARAM, "map sampling angle should be positive");
return;
if (!isPhaseInRange(samplingStart, currentPhase, nextPhase)) {
continue;
}
angle_t samplingEnd = samplingStart + samplingDuration;
if (std::isnan(samplingEnd)) {
// todo: when would this happen?
warning(ObdCode::CUSTOM_ERR_6549, "no map angles");
return;
float angleOffset = samplingStart - currentPhase;
if (angleOffset < 0) {
angleOffset += engine->engineState.engineCycle;
}
// todo: pre-calculate samplingEnd for each cylinder
wrapAngle(samplingEnd, "samplingEnd", ObdCode::CUSTOM_ERR_6563);
// only if value is already prepared
int structIndex = getRevolutionCounter() % 2;
sampler* s = &samplers[i][structIndex];
s->cylinderIndex = i;
// at the moment we schedule based on time prediction based on current RPM and angle
// we are loosing precision in case of changing RPM - the further away is the event the worse is precision
// todo: schedule this based on closest trigger event, same as ignition works
scheduleByAngle(&s->startTimer, edgeTimestamp, samplingStart,
{ startAveraging, s });
auto& s = samplers[i];
scheduleByAngle(&s.timer, edgeTimestamp, angleOffset, { startAveraging, &s });
}
}
void MapAveragingModule::onConfigurationChange(engine_configuration_s const * previousConfig) {
if (!previousConfig || engineConfiguration->mapMinBufferLength != previousConfig->mapMinBufferLength) {
applyMapMinBufferLength();
}
#endif
}
void initMapAveraging() {
for (size_t i = 0; i < efi::size(samplers); i++) {
samplers[i].cylinderIndex = i;
}
applyMapMinBufferLength();
}
#endif /* EFI_MAP_AVERAGING */

View File

@ -9,27 +9,11 @@
#include "sensor_converter_func.h"
#if EFI_MAP_AVERAGING
#if HAL_USE_ADC
void mapAveragingAdcCallback(float instantVoltage);
#endif
void initMapAveraging();
void refreshMapAveragingPreCalc();
void mapAveragingTriggerCallback(
uint32_t index, efitick_t edgeTimestamp);
#if EFI_TUNER_STUDIO
void postMapState(TunerStudioOutputChannels *tsOutputChannels);
#endif
// allow smoothing up to number of cylinders
#define MAX_MAP_BUFFER_LENGTH (MAX_CYLINDER_COUNT)
#endif /* EFI_MAP_AVERAGING */
class MapAverager : public StoredValueSensor {
public:
MapAverager(SensorType type, efidur_t timeout)
@ -59,3 +43,16 @@ private:
};
MapAverager& getMapAvg(size_t idx);
class MapAveragingModule : public EngineModule {
public:
void onConfigurationChange(engine_configuration_s const * previousConfig);
void onFastCallback() override;
void onEnginePhase(float rpm,
efitick_t edgeTimestamp,
float currentPhase,
float nextPhase) override;
void submitSample(float volts);
};

View File

@ -0,0 +1,6 @@
MODULES_INC += $(PROJECT_DIR)/controllers/modules/map_averaging
MODULES_CPPSRC += $(PROJECT_DIR)/controllers/modules/map_averaging/map_averaging.cpp
MODULES_INCLUDE += \#include "map_averaging.h"\n
MODULES_LIST += MapAveragingModule,
DDEFS += -DMODULE_MAP_AVERAGING

View File

@ -1,4 +1,9 @@
include $(PROJECT_DIR)/controllers/modules/fan/fan.mk
include $(PROJECT_DIR)/controllers/modules/fuel_pump/fuel_pump.mk
include $(PROJECT_DIR)/controllers/modules/gear_detector/gear_detector.mk
include $(PROJECT_DIR)/controllers/modules/tachometer/tachometer.mk
include $(PROJECT_DIR)/controllers/modules/trip_odometer/trip_odometer.mk
ifeq ($(NO_MAP_AVERAGING),)
include $(PROJECT_DIR)/controllers/modules/map_averaging/map_averaging.mk
endif

View File

@ -10,11 +10,9 @@
#include "pch.h"
#include "tachometer.h"
static SimplePwm tachControl("tach");
static float tachFreq;
static float duty;
static float tachFreq;
static float duty;
#if EFI_UNIT_TEST
float getTachFreq() {
@ -28,7 +26,7 @@ float getTachDuty() {
static bool tachHasInit = false;
void tachUpdate() {
void TachometerModule::onFastCallback() {
// Only do anything if tach enabled
if (!tachHasInit) {
return;
@ -43,7 +41,7 @@ void tachUpdate() {
}
// What is the angle per tach output period?
float cycleTimeMs = 60000.0f / Sensor::getOrZero(SensorType::Rpm);
float cycleTimeMs = 60000.0f / getRpm();
float periodTimeMs = cycleTimeMs / periods;
tachFreq = 1000.0f / periodTimeMs;
@ -64,6 +62,37 @@ void tachUpdate() {
tachControl.setFrequency(tachFreq);
}
float TachometerModule::getRpm() {
float trueRpm = Sensor::getOrZero(SensorType::Rpm);
if (!m_doTachSweep) {
return trueRpm;
}
float elapsed = m_stateChangeTimer.getElapsedSeconds();
float sweepPosition = elapsed / engineConfiguration->tachSweepTime;
if (sweepPosition > 1) {
// We've done a full sweep time, we're done!
m_doTachSweep = false;
return trueRpm;
} else if (sweepPosition < 0.5f) {
// First half of the ramp, ramp up from 0 -> max
return interpolateClamped(0, 0, 0.5f, engineConfiguration->tachSweepMax, sweepPosition);
} else {
// Use y2 = trueRpm instead of 0 so that it ramps back down smoothly
// to the current RPM if the engine started during ther ramp
return interpolateClamped(0.5f, engineConfiguration->tachSweepMax, 1, trueRpm, sweepPosition);
}
}
void TachometerModule::onIgnitionStateChanged(bool ignitionOn) {
if (ignitionOn && engineConfiguration->tachSweepTime != 0) {
m_stateChangeTimer.reset();
m_doTachSweep = true;
}
}
void initTachometer() {
tachHasInit = false;

View File

@ -0,0 +1,31 @@
/*
* @file tachometer.h
*
* @date Aug 18, 2015
* @author Andrey Belomutskiy, (c) 2012-2020
*/
#pragma once
void initTachometer();
class TachometerModule : public EngineModule {
public:
// TODO: can/should this be slow callback instead?
void onFastCallback() override;
void onIgnitionStateChanged(bool ignitionOn) override;
private:
float getRpm();
bool m_doTachSweep = false;
enum class TachState {
Normal,
RampUp,
RampDown,
};
TachState m_state = TachState::Normal;
Timer m_stateChangeTimer;
};

View File

@ -0,0 +1,6 @@
MODULES_INC += $(PROJECT_DIR)/controllers/modules/tachometer
MODULES_CPPSRC += $(PROJECT_DIR)/controllers/modules/tachometer/tachometer.cpp
MODULES_INCLUDE += \#include "tachometer.h"\n
MODULES_LIST += TachometerModule,
DDEFS += -DMODULE_TACHOMETER

View File

@ -30,6 +30,10 @@ case SensorType::AuxLinear1:
return "AuxLinear1";
case SensorType::AuxLinear2:
return "AuxLinear2";
case SensorType::AuxLinear3:
return "AuxLinear3";
case SensorType::AuxLinear4:
return "AuxLinear4";
case SensorType::AuxSpeed1:
return "AuxSpeed1";
case SensorType::AuxSpeed2:

View File

@ -31,12 +31,12 @@ static void printMAPInfo() {
#if EFI_ANALOG_SENSORS
efiPrintf("instant value=%.2fkPa", Sensor::getOrZero(SensorType::Map));
#if EFI_MAP_AVERAGING
#ifdef MODULE_MAP_AVERAGING
efiPrintf("map type=%d/%s MAP=%.2fkPa mapMinBufferLength=%d", engineConfiguration->map.sensor.type,
getAir_pressure_sensor_type_e(engineConfiguration->map.sensor.type),
Sensor::getOrZero(SensorType::Map),
mapMinBufferLength);
#endif // EFI_MAP_AVERAGING
#endif // MODULE_MAP_AVERAGING
adc_channel_e mapAdc = engineConfiguration->map.sensor.hwChannel;
char pinNameBuffer[16];

View File

@ -9,7 +9,6 @@
#include "resistance_func.h"
#include "thermistor_func.h"
#include "identity_func.h"
#include "map_averaging.h"
void ProxySensor::showInfo(const char* sensorName) const {
efiPrintf("Sensor \"%s\" proxied from sensor \"%s\"", sensorName, getSensorName(m_proxiedSensor));
@ -69,11 +68,6 @@ void Lps25Sensor::showInfo(const char* sensorName) const {
efiPrintf("%s: LPS25 baro %.2f kPa", sensorName, get().Value);
}
void MapAverager::showInfo(const char* sensorName) const {
const auto value = get();
efiPrintf("Sensor \"%s\" is MAP averager: valid: %s value: %.2f averaged sample count: %d", sensorName, boolToString(value.Valid), value.Value, m_lastCounter);
}
void LinearFunc::showInfo(float testRawValue) const {
efiPrintf(" Linear function slope: %.2f offset: %.2f min: %.1f max: %.1f", m_a, m_b, m_minOutput, m_maxOutput);
const auto value = convert(testRawValue);

View File

@ -118,6 +118,8 @@ enum class SensorType : unsigned char {
AuxLinear1,
AuxLinear2,
AuxLinear3,
AuxLinear4,
// frequency sensors
AuxSpeed1,

View File

@ -419,44 +419,6 @@ IgnitionOutputPin::IgnitionOutputPin() {
reset();
}
void IgnitionOutputPin::setHigh() {
NamedOutputPin::setHigh();
// this is NASTY but what's the better option? bytes? At cost of 22 extra bytes in output status packet?
switch (coilIndex) {
case 0:
engine->outputChannels.coilState1 = true;
break;
case 1:
engine->outputChannels.coilState2 = true;
break;
case 2:
engine->outputChannels.coilState3 = true;
break;
case 3:
engine->outputChannels.coilState4 = true;
break;
}
}
void IgnitionOutputPin::setLow() {
NamedOutputPin::setLow();
// this is NASTY but what's the better option? bytes? At cost of 22 extra bytes in output status packet?
switch (coilIndex) {
case 0:
engine->outputChannels.coilState1 = false;
break;
case 1:
engine->outputChannels.coilState2 = false;
break;
case 2:
engine->outputChannels.coilState3 = false;
break;
case 3:
engine->outputChannels.coilState4 = false;
break;
}
}
void IgnitionOutputPin::reset() {
outOfOrder = false;
signalFallSparkId = 0;

View File

@ -30,8 +30,7 @@ void turnAllPinsOff(void);
class IgnitionOutputPin : public NamedOutputPin {
public:
IgnitionOutputPin();
void setHigh() override;
void setLow() override;
void reset();
int signalFallSparkId;
bool outOfOrder; // https://sourceforge.net/p/rusefi/tickets/319/

View File

@ -82,44 +82,3 @@ void InjectorOutputPin::close(efitick_t nowNt) {
m_overlappingCounter = 0;
}
}
void InjectorOutputPin::setHigh() {
NamedOutputPin::setHigh();
TunerStudioOutputChannels *state = getTunerStudioOutputChannels();
// this is NASTY but what's the better option? bytes? At cost of 22 extra bytes in output status packet?
switch (injectorIndex) {
case 0:
state->injectorState1 = true;
break;
case 1:
state->injectorState2 = true;
break;
case 2:
state->injectorState3 = true;
break;
case 3:
state->injectorState4 = true;
break;
}
}
void InjectorOutputPin::setLow() {
NamedOutputPin::setLow();
TunerStudioOutputChannels *state = getTunerStudioOutputChannels();
// this is NASTY but what's the better option? bytes? At cost of 22 extra bytes in output status packet?
switch (injectorIndex) {
case 0:
state->injectorState1 = false;
break;
case 1:
state->injectorState2 = false;
break;
case 2:
state->injectorState3 = false;
break;
case 3:
state->injectorState4 = false;
break;
}
}

View File

@ -16,8 +16,6 @@ public:
void open(efitick_t nowNt);
void close(efitick_t nowNt);
void setHigh() override;
void setLow() override;
int8_t getOverlappingCounter() const { return m_overlappingCounter; }

View File

@ -79,8 +79,6 @@ bool EventQueue::insertTask(scheduling_s *scheduling, efitick_t timeX, action_s
assertListIsSorted();
efiAssert(ObdCode::CUSTOM_ERR_ASSERT, action.getCallback() != NULL, "NULL callback", false);
// please note that simulator does not use this code at all - simulator uses signal_executor_sleep
if (scheduling->action) {
#if EFI_UNIT_TEST
if (verboseMode) {

View File

@ -80,10 +80,10 @@ void TriggerScheduler::schedule(AngleBasedEvent* event, action_s action) {
}
}
void TriggerScheduler::scheduleEventsUntilNextTriggerTooth(int rpm,
void TriggerScheduler::onEnginePhase(float rpm,
efitick_t edgeTimestamp, float currentPhase, float nextPhase) {
if (!isValidRpm(rpm)) {
if (!isValidRpm(rpm) || !EFI_SHAFT_POSITION_INPUT) {
// this might happen for instance in case of a single trigger event after a pause
return;
}

View File

@ -10,9 +10,11 @@ public:
action_s action,
float currentPhase, float nextPhase);
void scheduleEventsUntilNextTriggerTooth(int rpm,
efitick_t edgeTimestamp,
float currentPhase, float nextPhase);
void onEnginePhase(float /*rpm*/,
efitick_t /*edgeTimestamp*/,
angle_t /*currentPhase*/,
angle_t /*nextPhase*/)
override;
// For unit tests
AngleBasedEvent * getElementAtIndexForUnitTest(int index);

View File

@ -18,7 +18,6 @@
#include "trigger_simulator.h"
#include "trigger_emulator_algo.h"
#include "map_averaging.h"
#include "main_trigger_callback.h"
#include "status_loop.h"
#include "engine_sniffer.h"
@ -32,9 +31,6 @@
WaveChart waveChart;
#endif /* EFI_ENGINE_SNIFFER */
static scheduling_s debugToggleScheduling;
#define DEBUG_PIN_DELAY US2NT(60)
#define TRIGGER_WAVEFORM(x) getTriggerCentral()->triggerShape.x
#if EFI_SHAFT_POSITION_INPUT
@ -131,22 +127,6 @@ angle_t TriggerCentral::syncAndReport(int divider, int remainder) {
return totalShift;
}
static void turnOffAllDebugFields(void *arg) {
(void)arg;
#if EFI_PROD_CODE
for (int index = 0; index < TRIGGER_INPUT_PIN_COUNT; index++) {
if (isBrainPinValid(engineConfiguration->triggerInputDebugPins[index])) {
writePad("trigger debug", engineConfiguration->triggerInputDebugPins[index], 0);
}
}
for (int index = 0; index < CAM_INPUTS_COUNT; index++) {
if (isBrainPinValid(engineConfiguration->camInputsDebug[index])) {
writePad("cam debug", engineConfiguration->camInputsDebug[index], 0);
}
}
#endif /* EFI_PROD_CODE */
}
static angle_t adjustCrankPhase(int camIndex) {
float maxSyncThreshold = engineConfiguration->maxCamPhaseResolveRpm;
if (maxSyncThreshold != 0 && Sensor::getOrZero(SensorType::Rpm) > maxSyncThreshold) {
@ -210,13 +190,6 @@ static angle_t wrapVvt(angle_t vvtPosition, int period) {
}
static void logVvtFront(bool isImportantFront, bool isRising, efitick_t nowNt, int index) {
if (isImportantFront && isBrainPinValid(engineConfiguration->camInputsDebug[index])) {
#if EFI_PROD_CODE
writePad("cam debug", engineConfiguration->camInputsDebug[index], 1);
#endif /* EFI_PROD_CODE */
getScheduler()->schedule("dbg_on", &debugToggleScheduling, nowNt + DEBUG_PIN_DELAY, &turnOffAllDebugFields);
}
// If we care about both edges OR displayLogicLevel is set, log every front exactly as it is
addEngineSnifferVvtEvent(index, isRising);
@ -430,13 +403,6 @@ void handleShaftSignal(int signalIndex, bool isRising, efitick_t timestamp) {
return;
}
if (engineConfiguration->triggerInputDebugPins[signalIndex] != Gpio::Unassigned) {
#if EFI_PROD_CODE
writePad("trigger debug", engineConfiguration->triggerInputDebugPins[signalIndex], 1);
#endif /* EFI_PROD_CODE */
getScheduler()->schedule("dbg_off", &debugToggleScheduling, timestamp + DEBUG_PIN_DELAY, &turnOffAllDebugFields);
}
uint32_t triggerHandlerEntryTime = getTimeNowLowerNt();
if (triggerReentrant > maxTriggerReentrant)
maxTriggerReentrant = triggerReentrant;
@ -645,12 +611,6 @@ void TriggerCentral::handleShaftSignal(trigger_event_e signal, efitick_t timesta
// Schedule the TDC mark
tdcMarkCallback(triggerIndexForListeners, timestamp);
#if !EFI_UNIT_TEST
#if EFI_MAP_AVERAGING
mapAveragingTriggerCallback(triggerIndexForListeners, timestamp);
#endif /* EFI_MAP_AVERAGING */
#endif /* EFI_UNIT_TEST */
#if EFI_LOGIC_ANALYZER
waTriggerEventListener(signal, triggerIndexForListeners, timestamp);
#endif

View File

@ -115,25 +115,6 @@ void turnOnTriggerInputPins() {
#endif /* (HAL_TRIGGER_USE_PAL == TRUE) */
void stopTriggerDebugPins() {
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
efiSetPadUnusedIfConfigurationChanged(triggerInputDebugPins[i]);
}
for (int i = 0; i < CAM_INPUTS_COUNT; i++) {
efiSetPadUnusedIfConfigurationChanged(camInputsDebug[i]);
}
}
void startTriggerDebugPins() {
for (int i = 0; i < TRIGGER_INPUT_PIN_COUNT; i++) {
efiSetPadModeIfConfigurationChanged("trigger debug", triggerInputDebugPins[i], PAL_MODE_OUTPUT_PUSHPULL);
}
for (int i = 0; i < CAM_INPUTS_COUNT; i++) {
efiSetPadModeIfConfigurationChanged("cam debug", camInputsDebug[i], PAL_MODE_OUTPUT_PUSHPULL);
}
}
void applyNewTriggerInputPins() {
if (hasFirmwareError()) {
return;

View File

@ -16,7 +16,4 @@ void applyNewTriggerInputPins();
void startTriggerInputPins();
void stopTriggerInputPins();
void stopTriggerDebugPins();
void startTriggerDebugPins();
void onTriggerChanged(efitick_t stamp, bool isPrimary, bool isRising);

View File

@ -47,10 +47,6 @@
#include "mc33816.h"
#endif /* EFI_MC33816 */
#if EFI_MAP_AVERAGING
#include "map_averaging.h"
#endif
#if EFI_INTERNAL_FLASH
#include "flash_main.h"
#endif
@ -152,9 +148,11 @@ void onFastAdcComplete(adcsample_t*) {
// this callback is executed 10 000 times a second, it needs to be as fast as possible!
ScopePerf perf(PE::AdcCallbackFast);
#if EFI_MAP_AVERAGING
mapAveragingAdcCallback(adcToVoltsDivided(getFastAdc(fastMapSampleIndex), engineConfiguration->map.sensor.hwChannel));
#endif /* EFI_MAP_AVERAGING */
#ifdef MODULE_MAP_AVERAGING
engine->module<MapAveragingModule>()->submitSample(
adcToVoltsDivided(getFastAdc(fastMapSampleIndex), engineConfiguration->map.sensor.hwChannel)
);
#endif // MODULE_MAP_AVERAGING
#if EFI_SENSOR_CHART && EFI_SHAFT_POSITION_INPUT
if (getEngineState()->sensorChartMode == SC_AUX_FAST1) {
@ -250,10 +248,6 @@ void applyNewHardwareSettings() {
efiSetPadUnused(activeConfiguration.clutchUpPin);
}
#if EFI_SHAFT_POSITION_INPUT
stopTriggerDebugPins();
#endif // EFI_SHAFT_POSITION_INPUT
enginePins.unregisterPins();
#if EFI_PROD_CODE
@ -391,9 +385,6 @@ void stopHardware() {
void startHardware() {
#if EFI_SHAFT_POSITION_INPUT
validateTriggerInputs();
startTriggerDebugPins();
#endif // EFI_SHAFT_POSITION_INPUT
startPedalPins();

View File

@ -112,10 +112,6 @@ iomode_t getInputMode(pin_input_mode_e mode) {
}
}
void writePad(const char *msg, brain_pin_e pin, int bit) {
palWritePad(getHwPort(msg, pin), getHwPin(msg, pin), bit);
}
#else /* EFI_PROD_CODE */
// This has been made global so we don't need to worry about efiReadPin having access the object

View File

@ -39,8 +39,6 @@ EXTERNC iomode_t getInputMode(pin_input_mode_e mode);
#endif /* EFI_GPIO_HARDWARE */
void writePad(const char *msg, brain_pin_e pin, int bit);
#if ! EFI_PROD_CODE
#define BRAIN_PIN_COUNT (1 << 8 * sizeof(brain_pin_e))
extern bool mockPinStates[BRAIN_PIN_COUNT];

View File

@ -127,15 +127,20 @@ static void reportPins() {
int totalPinsUsed = 0;
for (unsigned int i = 0; i < getBrainPinOnchipNum(); i++) {
const char *pin_user = getBrainUsedPin(i);
const char* pinUser = getBrainUsedPin(i);
/* show used pins */
if (pin_user != NULL) {
if (pinUser) {
brain_pin_e brainPin = index_to_brainPin(i);
int pin = getBrainPinIndex(brainPin);
ioportid_t port = getBrainPinPort(brainPin);
efiPrintf("pin %s%d: %s", portname(port), pin, pin_user);
if (const char* friendlyName = getBoardSpecificPinName(brainPin)) {
efiPrintf("pin %s: %s", friendlyName, pinUser);
} else {
int pin = getBrainPinIndex(brainPin);
ioportid_t port = getBrainPinPort(brainPin);
efiPrintf("pin %s%d: %s", portname(port), pin, pinUser);
}
totalPinsUsed++;
}
}
@ -226,11 +231,7 @@ const char *hwPortname(brain_pin_e brainPin) {
return portNameBuffer;
}
void initPinRepository(void) {
/**
* this method cannot use console because this method is invoked before console is initialized
*/
void initPinRepository() {
addConsoleAction(CMD_PINS, reportPins);
#if (BOARD_TLE8888_COUNT > 0)

View File

@ -22,7 +22,7 @@ public:
bool isBrainPinValid(brain_pin_e brainPin);
void initPinRepository(void);
void initPinRepository();
bool brain_pin_is_onchip(brain_pin_e brainPin);
bool brain_pin_is_ext(brain_pin_e brainPin);
void pinDiag2string(char *buffer, size_t size, brain_pin_diag_e pin_diag);

View File

@ -11,7 +11,6 @@
#if HAL_USE_ADC
#include "mpu_util.h"
#include "map_averaging.h"
#ifdef ADC_MUX_PIN
#error "ADC mux not yet supported on STM32H7"

View File

@ -23,6 +23,12 @@ static FunctionalSensor auxLinear1Sensor(SensorType::AuxLinear1, /* timeout = */
static LinearFunc auxLinear2Func;
static FunctionalSensor auxLinear2Sensor(SensorType::AuxLinear2, /* timeout = */ MS2NT(50));
static LinearFunc auxLinear3Func;
static FunctionalSensor auxLinear3Sensor(SensorType::AuxLinear3, /* timeout = */ MS2NT(50));
static LinearFunc auxLinear4Func;
static FunctionalSensor auxLinear4Sensor(SensorType::AuxLinear4, /* timeout = */ MS2NT(50));
/**
* @param bandwidth Hertz, used by low pass filter in to analog subscribers
*/
@ -57,6 +63,8 @@ void initFluidPressure() {
initFluidPressure(fuelPressureFuncHigh, fuelPressureSensorHigh, engineConfiguration->highPressureFuel, 100);
initFluidPressure(auxLinear1Func, auxLinear1Sensor, engineConfiguration->auxLinear1, 10);
initFluidPressure(auxLinear2Func, auxLinear2Sensor, engineConfiguration->auxLinear2, 10);
initFluidPressure(auxLinear3Func, auxLinear3Sensor, engineConfiguration->auxLinear3, 10);
initFluidPressure(auxLinear4Func, auxLinear4Sensor, engineConfiguration->auxLinear4, 10);
injectorPressure.setProxiedSensor(
engineConfiguration->injectorPressureType == IPT_High
@ -73,4 +81,6 @@ void deinitFluidPressure() {
AdcSubscription::UnsubscribeSensor(fuelPressureSensorHigh, engineConfiguration->highPressureFuel.hwChannel);
AdcSubscription::UnsubscribeSensor(auxLinear1Sensor, engineConfiguration->auxLinear1.hwChannel);
AdcSubscription::UnsubscribeSensor(auxLinear2Sensor, engineConfiguration->auxLinear2.hwChannel);
AdcSubscription::UnsubscribeSensor(auxLinear3Sensor, engineConfiguration->auxLinear3.hwChannel);
AdcSubscription::UnsubscribeSensor(auxLinear4Sensor, engineConfiguration->auxLinear4.hwChannel);
}

View File

@ -4,7 +4,6 @@
#include "linear_func.h"
#include "fallback_sensor.h"
#include "functional_sensor.h"
#include "map_averaging.h"
static LinearFunc baroConverter;
static FunctionalSensor baroSensor(SensorType::BarometricPressure, MS2NT(50));
@ -17,6 +16,7 @@ static FunctionalSensor slowMapSensor2(SensorType::MapSlow2, MS2NT(50));
static FunctionalSensor compressorDischargePress(SensorType::CompressorDischargePressure, MS2NT(50));
static FunctionalSensor throttleInletPress(SensorType::ThrottleInletPressure, MS2NT(50));
#ifdef MODULE_MAP_AVERAGING
// lowest reasonable idle is maybe 600 rpm
// one sample per cycle (1 cylinder, or "sample one cyl" mode) gives a period of 100ms
// add some margin -> 200ms timeout for fast MAP sampling
@ -26,6 +26,7 @@ MapAverager fastMapSensor2(SensorType::MapFast2, MS2NT(200));
MapAverager& getMapAvg(size_t idx) {
return idx == 0 ? fastMapSensor : fastMapSensor2;
}
#endif // MODULE_MAP_AVERAGING
// Combine MAP sensors: prefer fast sensor, but use slow if fast is unavailable.
static FallbackSensor mapCombiner(SensorType::Map, SensorType::MapFast, SensorType::MapSlow);
@ -103,8 +104,10 @@ void initMap() {
slowMapSensor.setFunction(mapConverter);
slowMapSensor2.setFunction(mapConverter);
#ifdef MODULE_MAP_AVERAGING
fastMapSensor.setFunction(mapConverter);
fastMapSensor2.setFunction(mapConverter);
#endif // MODULE_MAP_AVERAGING
compressorDischargePress.setFunction(mapConverter);
throttleInletPress.setFunction(mapConverter);
@ -112,8 +115,10 @@ void initMap() {
if (isAdcChannelValid(mapChannel)) {
slowMapSensor.Register();
slowMapSensor2.Register();
#ifdef MODULE_MAP_AVERAGING
fastMapSensor.Register();
fastMapSensor2.Register();
#endif // MODULE_MAP_AVERAGING
mapCombiner.Register();
mapCombiner2.Register();

View File

@ -106,7 +106,7 @@ struct_no_prefix persistent_config_s
struct_no_prefix engine_configuration_s
#define BLOCKING_FACTOR 750
#define BLOCKING_FACTOR 1320
#define SENT_INPUT_COUNT 1
@ -266,7 +266,7 @@ float baseFuel;Base mass of the per-cylinder fuel injected during cranking. This
int16_t rpm;This sets the RPM limit below which the ECU will use cranking fuel and ignition logic, typically this is around 350-450rpm.;"RPM", 1, 0, 0, 3000, 0
end_struct
#define debug_mode_e_enum "INVALID", "TPS acceleration enrichment", "INVALID", "Stepper Idle Control", "Engine Load accl enrich", "Trigger Counters", "Soft Spark Cut", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "SD card", "sr5", "Knock", "INVALID", "Electronic Throttle", "Executor", "Bench Test / TS commands", "INVALID", "Analog inputs #1", "INSTANT_RPM", "INVALID", "Status", "INVALID", "INVALID", "MAP", "Metrics", "INVALID", "Ion Sense", "TLE8888", "Analog inputs #2", "Dwell Metric", "INVALID", "INVALID", "Boost Control", "INVALID", "INVALID", "ETB Autotune", "Composite Log", "INVALID", "INVALID", "INVALID", "Dyno_View", "Logic_Analyzer", "INVALID", "TCU", "Lua"
#define debug_mode_e_enum "INVALID", "TPS acceleration enrichment", "INVALID", "Stepper Idle Control", "Engine Load accl enrich", "Trigger Counters", "Soft Spark Cut", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "SD card", "sr5", "Knock", "INVALID", "Electronic Throttle", "Executor", "Bench Test / TS commands", "INVALID", "Analog inputs #1", "INVALID", "INVALID", "Status", "INVALID", "INVALID", "INVALID", "Metrics", "INVALID", "Ion Sense", "TLE8888", "Analog inputs #2", "INVALID", "INVALID", "INVALID", "Boost Control", "INVALID", "INVALID", "ETB Autotune", "Composite Log", "INVALID", "INVALID", "INVALID", "Dyno_View", "Logic_Analyzer", "INVALID", "TCU", "Lua"
custom debug_mode_e 1 bits, U08, @OFFSET@, [0:5], @@debug_mode_e_enum@@
#define vvt_mode_e_enum "Inactive", "Single Tooth", "Toyota 3 Tooth", "Miata NB2", "INVALID", "Bosch Quick Start", "4/1", "ST 170", "Ford Barra 3+1", "Nissan VQ", "Honda K Intake", "Nissan MR18", "Mitsu 3A92", "VTwin by MAP", "Mitsu 6G75", "Mazda Skyactiv", "Honda K Exhaust", "Mitsubishi 4G92/93/94", "Mitsubishi 4G63", "Mazda L"
@ -304,7 +304,7 @@ custom pin_output_mode_e 1 bits, U08, @OFFSET@, [0:1], @@pin_output_mode_e_enum@
#define pin_input_mode_e_enum "DEFAULT", "PULLUP", "PULLDOWN"
custom pin_input_mode_e 1 bits, U08, @OFFSET@, [0:1], @@pin_input_mode_e_enum@@
#define gppwm_channel_e_enum "Zero", "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2", "Accel Pedal", "Battery Voltage", "VVT 1 I", "VVT 1 E", "VVT 2 I", "VVT 2 E", "Ethanol (Flex) %", "Aux Linear 1", "Aux Linear 2", "GPPWM Output 1", "GPPWM Output 2", "GPPWM Output 3", "GPPWM Output 4", "Lua Gauge 1", "Lua Gauge 2", "RPM", "Gear (detected)", "Baro pressure", "EGT 1", "EGT 2"
#define gppwm_channel_e_enum "Zero", "TPS", "MAP", "CLT", "IAT", "Fuel Load", "Ignition Load", "Aux Temp 1", "Aux Temp 2", "Accel Pedal", "Battery Voltage", "VVT 1 I", "VVT 1 E", "VVT 2 I", "VVT 2 E", "Ethanol (Flex) %", "Aux Linear 1", "Aux Linear 2", "GPPWM Output 1", "GPPWM Output 2", "GPPWM Output 3", "GPPWM Output 4", "Lua Gauge 1", "Lua Gauge 2", "RPM", "Gear (detected)", "Baro pressure", "EGT 1", "EGT 2", "Aux Linear 3", "Aux Linear 4", "Vehicle speed"
custom gppwm_channel_e 1 bits, U08, @OFFSET@, [0:4], @@gppwm_channel_e_enum@@
struct gppwm_channel
@ -746,7 +746,8 @@ output_pin_e acFanPin;Optional Radiator Fan used with A/C
Gpio[EGT_CHANNEL_COUNT iterate] max31855_cs;
brain_input_pin_e flexSensorPin;Continental/GM flex fuel sensor, 50-150hz type;
uint16_t unused720
uint8_t autoscale tachSweepTime;Total time for the tach to sweep up then back down at startup. Set to 0 to disable sweep.;"s", 0.1, 0, 0, 10, 1
uint8_t autoscale tachSweepMax;Maximum RPM for the startup tach sweep.;"rpm", 50, 0, 0, 12500, 0
pin_output_mode_e stepperDirectionPinMode;
spi_device_e mc33972spiDevice;
@ -1003,7 +1004,6 @@ bit ALSActivateInverted
float turboSpeedSensorMultiplier;;"mult", 1, 0, 0, 7000, 3
Gpio[CAM_INPUTS_COUNT iterate] camInputsDebug;
int16_t acIdleRpmBump;Extra idle target speed when A/C is enabled. Some cars need the extra speed to keep the AC efficient while idling.;"RPM", 1, 0, 0, 1000, 0
int16_t warningPeriod;;"seconds", 1, 0, 0, 60, 0
@ -1028,7 +1028,6 @@ custom pin_mode_e 1 bits, U08, @OFFSET@, [0:6], @@pin_mode_e_enum@@
float wwaeTau;Length of time the deposited wall fuel takes to dissipate after the start of acceleration. ;"Seconds", 1, 0, 0, 3, 2
pid_s alternatorControl;
pid_s etb;
Gpio[TRIGGER_INPUT_PIN_COUNT iterate] triggerInputDebugPins;
int16_t airTaperRpmRange;RPM range above upper limit for extra air taper;"RPM", 1, 0, 0, 1500, 0
brain_input_pin_e turboSpeedSensorInputPin;
int16_t tps2Min;;"ADC", 1, 0, 0, 1023, 0
@ -1249,7 +1248,7 @@ tChargeMode_e tChargeMode;
int16_t coastingFuelCutClt;Fuel cutoff is disabled when the engine is cold.;"C", 1, 0, -100, 100, 0
int16_t pidExtraForLowRpm;Increases PID reaction for RPM<target by adding extra percent to PID-error;"%", 1, 0, 0, 100, 0
bit useTableForDfcoMap,"Table","Fixed";Use a fixed MAP value as DFCO threshold, or vary the threshold with RPM. This allows a softer cut at high RPMs where greater vaccuum is generated.
bit useTableForDfcoMap,"Table","Fixed";Fixed: MAP threshold cut fuel when conditions are met\nTable: Use a curve to vary the MAP threshold based on engine RPM
uint8_t[DFCO_RPM_MAP_TABLE] autoscale dfcoMapRpmValuesBins;;"RPM", 100, 0, 0, 17500, 0
uint8_t[DFCO_RPM_MAP_TABLE] autoscale dfcoMapRpmValues;DFCO will activate when operating below this curve. Used to allow a higher threshold at low RPM where less vaccuum is generated;"MAP", 1, 0, 0, 50, 0
int16_t coastingFuelCutMap;MAP value above which fuel injection is re-enabled.;"kPa", 1, 0, 0, 250, 0
@ -1371,6 +1370,8 @@ uint16_t vvtActivationDelayMs;We need to give engine time to build oil pressure
linear_sensor_s auxLinear1
linear_sensor_s auxLinear2
linear_sensor_s auxLinear3
linear_sensor_s auxLinear4
output_pin_e tcu_tcc_onoff_solenoid
pin_output_mode_e tcu_tcc_onoff_solenoid_mode
@ -1450,8 +1451,6 @@ pin_input_mode_e[LUA_DIGITAL_INPUT_COUNT iterate] luaDigitalInputPinModes;
Gpio spi6misoPin;
Gpio spi6sckPin;
uint8_t[237] mainUnusedEnd;;"units", 1, 0, 0, 1, 0
! end of engine_configuration_s
end_struct

View File

@ -106,6 +106,8 @@
#define GAUGE_NAME_AUX_LINEAR_1 "Aux linear #1"
#define GAUGE_NAME_AUX_LINEAR_2 "Aux linear #2"
#define GAUGE_NAME_AUX_LINEAR_3 "Aux linear #3"
#define GAUGE_NAME_AUX_LINEAR_4 "Aux linear #4"
#define GAUGE_NAME_BOOST_OUTPUT "Boost: Output"
#define GAUGE_NAME_BOOST_CLOSED_LOOP "Boost: Closed loop"

View File

@ -1,5 +1,6 @@
# How to Release
1. In changelog.md, rename the "unreleased" section to "Month 20YY Release", and copy the unreleased section in the comment to replace the renamed one.
1. Create a release branch off master in the format `release_YYMMDD`, for example `release_230410` for a release in 10 April 2023. Run `git checkout -b release_YYMMDD`
1. Create a tag on that branch in the format `release_YYMMDD_nn` where `nn` is a sequence number (so we can release a patch off the same branch later and they sort correctly). Run `git tag release_YYMMDD_nn`
1. Push the branch and tags

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1400,6 +1400,8 @@ gaugeCategory = Sensors - Extra 1
fuelTankLevelGauge = fuelTankLevel,"Fuel level", "%", 0, 100, 10, 20, 100, 100, 1, 1
AuxL1Gauge = auxLinear1, @@GAUGE_NAME_AUX_LINEAR_1@@, "", -100, 100, -100, -100, 100, 100, 2, 2
AuxL2Gauge = auxLinear2, @@GAUGE_NAME_AUX_LINEAR_2@@, "", -100, 100, -100, -100, 100, 100, 2, 2
AuxL3Gauge = auxLinear3, @@GAUGE_NAME_AUX_LINEAR_3@@, "", -100, 100, -100, -100, 100, 100, 2, 2
AuxL4Gauge = auxLinear4, @@GAUGE_NAME_AUX_LINEAR_4@@, "", -100, 100, -100, -100, 100, 100, 2, 2
gaugeCategory = Sensors - Extra 2
accelerationLatGauge = accelerationLat, @@GAUGE_NAME_ACCEL_LAT@@, "acc", -2, 2, -2, -1, 1, 2, 3, 1
@ -1700,33 +1702,33 @@ menuDialog = main
menu = "Fuel"
# basic
subMenu = injectorConfig, "Injection configuration"
subMenu = injectorPins, "Injection hardware", 0, {isInjectionEnabled == 1} @@if_ts_show_injector_pins
subMenu = injectorPins, "Injection hardware", 0, {isInjectionEnabled} @@if_ts_show_injector_pins
subMenu = injTest, "Injector test", 0, {isInjectionEnabled}
subMenu = cylinderBankSelect, "Cylinder bank selection", 0, {isInjectionEnabled == 1}
subMenu = injectorNonlinear, "Injector small-pulse correction", 0, {isInjectionEnabled == 1}
subMenu = cylinderBankSelect, "Cylinder bank selection", 0, {isInjectionEnabled}
subMenu = injectorNonlinear, "Injector small-pulse correction", 0, {isInjectionEnabled}
subMenu = stagedInjection, "Staged injection", 0, {isInjectionEnabled}
subMenu = stagedInjectionOutputs, "Staged injection outputs", 0, {isInjectionEnabled && enableStagedInjection}
subMenu = stagedInjectionTbl, "Staged injection % table", 0, {isInjectionEnabled && enableStagedInjection}
groupMenu = "Cylinder fuel trims"
groupChildMenu = fuelTrimTbl1, "Fuel trim cyl 1"
groupChildMenu = fuelTrimTbl2, "Fuel trim cyl 2"
groupChildMenu = fuelTrimTbl3, "Fuel trim cyl 3"
groupChildMenu = fuelTrimTbl4, "Fuel trim cyl 4"
groupChildMenu = fuelTrimTbl5, "Fuel trim cyl 5"
groupChildMenu = fuelTrimTbl6, "Fuel trim cyl 6"
groupChildMenu = fuelTrimTbl7, "Fuel trim cyl 7"
groupChildMenu = fuelTrimTbl8, "Fuel trim cyl 8"
groupChildMenu = fuelTrimTbl9, "Fuel trim cyl 9"
groupChildMenu = fuelTrimTbl10, "Fuel trim cyl 10"
groupChildMenu = fuelTrimTbl11, "Fuel trim cyl 11"
groupChildMenu = fuelTrimTbl12, "Fuel trim cyl 12"
groupChildMenu = fuelTrimTbl1, "Fuel trim cyl 1" , 0, { isInjectionEnabled && cylindersCount >= 1 }
groupChildMenu = fuelTrimTbl2, "Fuel trim cyl 2" , 0, { isInjectionEnabled && cylindersCount >= 2 }
groupChildMenu = fuelTrimTbl3, "Fuel trim cyl 3" , 0, { isInjectionEnabled && cylindersCount >= 3 }
groupChildMenu = fuelTrimTbl4, "Fuel trim cyl 4" , 0, { isInjectionEnabled && cylindersCount >= 4 }
groupChildMenu = fuelTrimTbl5, "Fuel trim cyl 5" , 0, { isInjectionEnabled && cylindersCount >= 5 }
groupChildMenu = fuelTrimTbl6, "Fuel trim cyl 6" , 0, { isInjectionEnabled && cylindersCount >= 6 }
groupChildMenu = fuelTrimTbl7, "Fuel trim cyl 7" , 0, { isInjectionEnabled && cylindersCount >= 7 }
groupChildMenu = fuelTrimTbl8, "Fuel trim cyl 8" , 0, { isInjectionEnabled && cylindersCount >= 8 }
groupChildMenu = fuelTrimTbl9, "Fuel trim cyl 9" , 0, { isInjectionEnabled && cylindersCount >= 9 }
groupChildMenu = fuelTrimTbl10, "Fuel trim cyl 10", 0, { isInjectionEnabled && cylindersCount >= 10 }
groupChildMenu = fuelTrimTbl11, "Fuel trim cyl 11", 0, { isInjectionEnabled && cylindersCount >= 11 }
groupChildMenu = fuelTrimTbl12, "Fuel trim cyl 12", 0, { isInjectionEnabled && cylindersCount >= 12 }
subMenu = std_separator
# Air mass model
subMenu = veTableDialog, "VE", 0, {isInjectionEnabled == 1}
subMenu = veTableDialog, "VE", 0, {isInjectionEnabled}
groupMenu = "VE blend tables"
groupChildMenu = veBlend1Cfg, "VE blend 1 bias", 0, {isInjectionEnabled}
@ -1738,32 +1740,32 @@ menuDialog = main
groupChildMenu = veBlend4Cfg, "VE blend 4 bias", 0, {isInjectionEnabled}
groupChildMenu = veBlend4Table, "VE blend table 4", 0, { isInjectionEnabled && veBlends4_blendParameter != 0 }
subMenu = tChargeSettings, "Charge temperature estimation", 0, {isInjectionEnabled == 1}
subMenu = baroCorrTbl, "Barometric pressure correction", 0, {isInjectionEnabled == 1 && fuelAlgorithm == @@engine_load_mode_e_LM_SPEED_DENSITY@@}
subMenu = tChargeSettings, "Charge temperature estimation", 0, {isInjectionEnabled}
subMenu = baroCorrTbl, "Barometric pressure correction", 0, {isInjectionEnabled && fuelAlgorithm == @@engine_load_mode_e_LM_SPEED_DENSITY@@}
subMenu = mapEstimateTableTbl, "MAP estimate table"
subMenu = std_separator
# Fuel model
#if LAMBDA
subMenu = lambdaTableTbl, "Target lambda", 0, {isInjectionEnabled == 1}
subMenu = lambdaTableTbl, "Target lambda", 0, {isInjectionEnabled}
#else
subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled == 1}
subMenu = afrTableTbl, "Target AFR", 0, {isInjectionEnabled}
#endif
subMenu = cltFuelCorrCurve, "CLT multiplier", 0, {isInjectionEnabled == 1}
subMenu = iatFuelCorrCurve, "IAT multiplier", 0, {isInjectionEnabled == 1}
subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled == 1}
subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled == 1}
subMenu = cltFuelCorrCurve, "CLT multiplier", 0, {isInjectionEnabled}
subMenu = iatFuelCorrCurve, "IAT multiplier", 0, {isInjectionEnabled}
subMenu = fuelClosedLoopDialog, "Closed loop fuel correction", 0, {isInjectionEnabled}
subMenu = coastingFuelCutControl, "Deceleration fuel cutoff (DFCO)", 0, {isInjectionEnabled}
subMenu = dfcoMapRpmCorrection, "DFCO MAP to RPM threshold", 0, {isInjectionEnabled && useTableForDfcoMap }
subMenu = std_separator
# Injector model
subMenu = injPhaseTableTbl, "Injection phase", 0, {isInjectionEnabled == 1}
subMenu = injPhaseTableTbl, "Injection phase", 0, {isInjectionEnabled}
subMenu = std_separator
# Accel enrichment
subMenu = AccelEnrich, "Acceleration enrichment", 0, {isInjectionEnabled == 1}
subMenu = tpsTpsAccelTbl, "TPS/TPS acceleration extra fuel", 0, {isInjectionEnabled == 1}
subMenu = tpsTspRpmCorrection, "TPS/TPS AE RPM correction", 0, {isInjectionEnabled == 1}
subMenu = AccelEnrich, "Acceleration enrichment", 0, {isInjectionEnabled}
subMenu = tpsTpsAccelTbl, "TPS/TPS acceleration extra fuel", 0, {isInjectionEnabled}
subMenu = tpsTspRpmCorrection, "TPS/TPS AE RPM correction", 0, {isInjectionEnabled}
groupMenu = "Wall wetting AE"
groupChildMenu = wwTauCurves, "Evap time", 0, { complexWallModel != 0 }
@ -1791,18 +1793,18 @@ menuDialog = main
groupChildMenu = ignAdder4Cfg, "Ignition blend 4 bias", 0, {isIgnitionEnabled}
groupChildMenu = ignAdder4Table, "Ignition blend table 4", 0, { isIgnitionEnabled && ignBlends4_blendParameter != 0 }
groupMenu = "Cylinder ign trims"
groupChildMenu = ignTrimTbl1, "Ignition trim cyl 1"
groupChildMenu = ignTrimTbl2, "Ignition trim cyl 2"
groupChildMenu = ignTrimTbl3, "Ignition trim cyl 3"
groupChildMenu = ignTrimTbl4, "Ignition trim cyl 4"
groupChildMenu = ignTrimTbl5, "Ignition trim cyl 5"
groupChildMenu = ignTrimTbl6, "Ignition trim cyl 6"
groupChildMenu = ignTrimTbl7, "Ignition trim cyl 7"
groupChildMenu = ignTrimTbl8, "Ignition trim cyl 8"
groupChildMenu = ignTrimTbl9, "Ignition trim cyl 9"
groupChildMenu = ignTrimTbl10, "Ignition trim cyl 10"
groupChildMenu = ignTrimTbl11, "Ignition trim cyl 11"
groupChildMenu = ignTrimTbl12, "Ignition trim cyl 12"
groupChildMenu = ignTrimTbl1, "Ignition trim cyl 1" , 0, { isIgnitionEnabled && cylindersCount >= 1 }
groupChildMenu = ignTrimTbl2, "Ignition trim cyl 2" , 0, { isIgnitionEnabled && cylindersCount >= 2 }
groupChildMenu = ignTrimTbl3, "Ignition trim cyl 3" , 0, { isIgnitionEnabled && cylindersCount >= 3 }
groupChildMenu = ignTrimTbl4, "Ignition trim cyl 4" , 0, { isIgnitionEnabled && cylindersCount >= 4 }
groupChildMenu = ignTrimTbl5, "Ignition trim cyl 5" , 0, { isIgnitionEnabled && cylindersCount >= 5 }
groupChildMenu = ignTrimTbl6, "Ignition trim cyl 6" , 0, { isIgnitionEnabled && cylindersCount >= 6 }
groupChildMenu = ignTrimTbl7, "Ignition trim cyl 7" , 0, { isIgnitionEnabled && cylindersCount >= 7 }
groupChildMenu = ignTrimTbl8, "Ignition trim cyl 8" , 0, { isIgnitionEnabled && cylindersCount >= 8 }
groupChildMenu = ignTrimTbl9, "Ignition trim cyl 9" , 0, { isIgnitionEnabled && cylindersCount >= 9 }
groupChildMenu = ignTrimTbl10, "Ignition trim cyl 10", 0, { isIgnitionEnabled && cylindersCount >= 10 }
groupChildMenu = ignTrimTbl11, "Ignition trim cyl 11", 0, { isIgnitionEnabled && cylindersCount >= 11 }
groupChildMenu = ignTrimTbl12, "Ignition trim cyl 12", 0, { isIgnitionEnabled && cylindersCount >= 12 }
subMenu = std_separator
subMenu = softwareKnock, "Knock sensing", 0, {isIgnitionEnabled} @@if_ts_show_software_knock
@ -1820,11 +1822,11 @@ menuDialog = main
subMenu = crankingTpsCurve, "Fuel TPS multiplier"
subMenu = std_separator
subMenu = crankingAdvanceCurve, "Cranking ignition advance", 0, {useSeparateAdvanceForCranking == 1}
subMenu = crankingAdvanceCurve, "Cranking ignition advance", 0, {useSeparateAdvanceForCranking}
subMenu = std_separator
subMenu = cltCrankingCurve, "Cranking IAC CLT multiplier", 0, {overrideCrankingIacSetting == 1}
subMenu = cltCrankingTaperDurationCurve, "Cranking taper duration multiplier", 0, {useCrankingIdleTaperTableSetting == 1}
subMenu = cltCrankingCurve, "Cranking IAC CLT multiplier", 0, {overrideCrankingIacSetting}
subMenu = cltCrankingTaperDurationCurve, "Cranking taper duration multiplier", 0, {useCrankingIdleTaperTableSetting}
menu = "&Idle" @@if_ts_show_idle
subMenu = idleSettings, "Idle settings" @@if_ts_show_idle
@ -1834,11 +1836,11 @@ menuDialog = main
subMenu = cltIdleCurve, "CLT multiplier" @@if_ts_show_idle
subMenu = std_separator @@if_ts_show_idle
subMenu = idleTimingPidCorrDialog, "Closed-loop idle timing" @@if_ts_show_idle
subMenu = iacPidMultTbl, "IAC PID multiplier", 0, {idleMode == 0 && useIacPidMultTable == 1} @@if_ts_show_idle
subMenu = iacCoastingCurve, "Coasting IAC position", 0, {useIacTableForCoasting == 1} @@if_ts_show_idle
subMenu = iacPidMultTbl, "IAC PID multiplier", 0, {idleMode == 0 && useIacPidMultTable} @@if_ts_show_idle
subMenu = iacCoastingCurve, "Coasting IAC position", 0, {useIacTableForCoasting} @@if_ts_show_idle
subMenu = std_separator @@if_ts_show_idle
subMenu = idleVeTableTbl, "Idle VE", 0, {useSeparateVeForIdle == 1} @@if_ts_show_idle
subMenu = idleAdvanceCurve, "Ignition advance", 0, {useSeparateAdvanceForIdle == 1} @@if_ts_show_idle
subMenu = idleVeTableTbl, "Idle VE", 0, {useSeparateVeForIdle} @@if_ts_show_idle
subMenu = idleAdvanceCurve, "Ignition advance", 0, {useSeparateAdvanceForIdle} @@if_ts_show_idle
menu = "&Advanced"
subMenu = smLaunchControl, "Launch Control"
@ -2237,7 +2239,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = baseInjection, "Injection"
field = "Enabled", isInjectionEnabled
field = "Mode", injectionMode, {isInjectionEnabled == 1} @@if_ts_show_injection_mode
field = "Mode", injectionMode, {isInjectionEnabled} @@if_ts_show_injection_mode
field = "#Batch injection with individual wiring"
field = "Alpha-N uses IAT density correction", alphaNUseIat, { fuelAlgorithm == @@engine_load_mode_e_LM_ALPHA_N@@ }
field = "Override VE table load axis", veOverrideMode, { isInjectionEnabled }
@ -2245,19 +2247,19 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Injection phase control mode", injectionTimingMode, { isInjectionEnabled }
dialog = ignitionOutputs, "Ignition Outputs"
field = "Ignition Output Mode", ignitionPinMode, {isIgnitionEnabled == 1}@@if_ts_show_ignitionPinMode
field = "Ignition Pin 1", ignitionPins1, { isIgnitionEnabled == 1 }
field = "Ignition Pin 2", ignitionPins2, { isIgnitionEnabled == 1 && cylindersCount >= 2 }
field = "Ignition Pin 3", ignitionPins3, { isIgnitionEnabled == 1 && cylindersCount >= 3 }
field = "Ignition Pin 4", ignitionPins4, { isIgnitionEnabled == 1 && cylindersCount >= 4 }
field = "Ignition Pin 5", ignitionPins5, { isIgnitionEnabled == 1 && cylindersCount >= 5 }
field = "Ignition Pin 6", ignitionPins6, { isIgnitionEnabled == 1 && cylindersCount >= 6 }
field = "Ignition Pin 7", ignitionPins7, { isIgnitionEnabled == 1 && cylindersCount >= 7 }
field = "Ignition Pin 8", ignitionPins8, { isIgnitionEnabled == 1 && cylindersCount >= 8 }
field = "Ignition Pin 9", ignitionPins9, { isIgnitionEnabled == 1 && cylindersCount >= 9 }
field = "Ignition Pin 10", ignitionPins10, { isIgnitionEnabled == 1 && cylindersCount >= 10 }
field = "Ignition Pin 11", ignitionPins11, { isIgnitionEnabled == 1 && cylindersCount >= 11 }
field = "Ignition Pin 12", ignitionPins12, { isIgnitionEnabled == 1 && cylindersCount >= 12 }
field = "Ignition Output Mode", ignitionPinMode, {isIgnitionEnabled}@@if_ts_show_ignitionPinMode
field = "Ignition Pin 1", ignitionPins1, { isIgnitionEnabled }
field = "Ignition Pin 2", ignitionPins2, { isIgnitionEnabled && cylindersCount >= 2 }
field = "Ignition Pin 3", ignitionPins3, { isIgnitionEnabled && cylindersCount >= 3 }
field = "Ignition Pin 4", ignitionPins4, { isIgnitionEnabled && cylindersCount >= 4 }
field = "Ignition Pin 5", ignitionPins5, { isIgnitionEnabled && cylindersCount >= 5 }
field = "Ignition Pin 6", ignitionPins6, { isIgnitionEnabled && cylindersCount >= 6 }
field = "Ignition Pin 7", ignitionPins7, { isIgnitionEnabled && cylindersCount >= 7 }
field = "Ignition Pin 8", ignitionPins8, { isIgnitionEnabled && cylindersCount >= 8 }
field = "Ignition Pin 9", ignitionPins9, { isIgnitionEnabled && cylindersCount >= 9 }
field = "Ignition Pin 10", ignitionPins10, { isIgnitionEnabled && cylindersCount >= 10 }
field = "Ignition Pin 11", ignitionPins11, { isIgnitionEnabled && cylindersCount >= 11 }
field = "Ignition Pin 12", ignitionPins12, { isIgnitionEnabled && cylindersCount >= 12 }
dialog = ignitionBasic, ""
field = "Enabled", isIgnitionEnabled
@ -2267,7 +2269,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Override ignition table load axis", ignOverrideMode, {isIgnitionEnabled}
field = "#Use fixed timing while validating with a timing gun"
field = "Timing Mode", timingMode, {isIgnitionEnabled}
field = "Fixed Timing", fixedTiming, {isIgnitionEnabled == 1 && timingMode == 1}
field = "Fixed Timing", fixedTiming, {isIgnitionEnabled && timingMode == 1}
dialog = ignitionSettings, "", xAxis
panel = ignitionBasic
@ -2341,17 +2343,17 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = triggerConfiguration_gap, "Trigger Gap Override"
field = "!This is an advanced feature for debugging trigger synchronization"
field = "Override trigger gaps", overrideTriggerGaps
field = "Count", gapTrackingLengthOverride, { overrideTriggerGaps == 1 }
field = "Gap #1 from", triggerGapOverrideFrom1, { overrideTriggerGaps == 1 }
field = "Gap #1 to", triggerGapOverrideTo1, { overrideTriggerGaps == 1 }
field = "Gap #2 from", triggerGapOverrideFrom2, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 2 }
field = "Gap #2 to", triggerGapOverrideTo2, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 2 }
field = "Gap #3 from", triggerGapOverrideFrom3, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 3 }
field = "Gap #3 to", triggerGapOverrideTo3, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 3 }
field = "Gap #4 from", triggerGapOverrideFrom4, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 4 }
field = "Gap #4 to", triggerGapOverrideTo4, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 4 }
field = "Gap #5 from", triggerGapOverrideFrom5, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 5 }
field = "Gap #5 to", triggerGapOverrideTo5, { overrideTriggerGaps == 1 && gapTrackingLengthOverride >= 5 }
field = "Count", gapTrackingLengthOverride, { overrideTriggerGaps }
field = "Gap #1 from", triggerGapOverrideFrom1, { overrideTriggerGaps }
field = "Gap #1 to", triggerGapOverrideTo1, { overrideTriggerGaps }
field = "Gap #2 from", triggerGapOverrideFrom2, { overrideTriggerGaps && gapTrackingLengthOverride >= 2 }
field = "Gap #2 to", triggerGapOverrideTo2, { overrideTriggerGaps && gapTrackingLengthOverride >= 2 }
field = "Gap #3 from", triggerGapOverrideFrom3, { overrideTriggerGaps && gapTrackingLengthOverride >= 3 }
field = "Gap #3 to", triggerGapOverrideTo3, { overrideTriggerGaps && gapTrackingLengthOverride >= 3 }
field = "Gap #4 from", triggerGapOverrideFrom4, { overrideTriggerGaps && gapTrackingLengthOverride >= 4 }
field = "Gap #4 to", triggerGapOverrideTo4, { overrideTriggerGaps && gapTrackingLengthOverride >= 4 }
field = "Gap #5 from", triggerGapOverrideFrom5, { overrideTriggerGaps && gapTrackingLengthOverride >= 5 }
field = "Gap #5 to", triggerGapOverrideTo5, { overrideTriggerGaps && gapTrackingLengthOverride >= 5 }
dialog = triggerInputComparator, "Built-in Comparator Settings (Kinetis-only)"
field = "Comparator Center Point Voltage", triggerCompCenterVolt
@ -2390,34 +2392,34 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = injectorPins, "Injector Outputs", yAxis
field = "Use only first half of outputs for batch mode"
field = "Injection Output 1", injectionPins1, {isInjectionEnabled == 1}
field = "Injection Output 2", injectionPins2, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 1}
field = "Injection Output 3", injectionPins3, {isInjectionEnabled == 1 && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 2}
field = "Injection Output 4", injectionPins4, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 3}
field = "Injection Output 5 ", injectionPins5, {isInjectionEnabled == 1 && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 4}
field = "Injection Output 6 ", injectionPins6, {isInjectionEnabled == 1 && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 5}
field = "Injection Output 7 ", injectionPins7, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 6}
field = "Injection Output 8 ", injectionPins8, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 7}
field = "Injection Output 9 ", injectionPins9, {isInjectionEnabled == 1 && cylindersCount > 8}
field = "Injection Output 10 ", injectionPins10, {isInjectionEnabled == 1 && cylindersCount > 9}
field = "Injection Output 11 ", injectionPins11, {isInjectionEnabled == 1 && cylindersCount > 10}
field = "Injection Output 12 ", injectionPins12, {isInjectionEnabled == 1 && cylindersCount > 11}
field = "Injection Output 1", injectionPins1, {isInjectionEnabled}
field = "Injection Output 2", injectionPins2, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 1}
field = "Injection Output 3", injectionPins3, {isInjectionEnabled && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 2}
field = "Injection Output 4", injectionPins4, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 3}
field = "Injection Output 5 ", injectionPins5, {isInjectionEnabled && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 4}
field = "Injection Output 6 ", injectionPins6, {isInjectionEnabled && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 5}
field = "Injection Output 7 ", injectionPins7, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 6}
field = "Injection Output 8 ", injectionPins8, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 7}
field = "Injection Output 9 ", injectionPins9, {isInjectionEnabled && cylindersCount > 8}
field = "Injection Output 10 ", injectionPins10, {isInjectionEnabled && cylindersCount > 9}
field = "Injection Output 11 ", injectionPins11, {isInjectionEnabled && cylindersCount > 10}
field = "Injection Output 12 ", injectionPins12, {isInjectionEnabled && cylindersCount > 11}
field = ""@@if_ts_show_injectionPinMode
field = "injection Output(s) Mode", injectionPinMode, {isInjectionEnabled == 1}@@if_ts_show_injectionPinMode
field = "injection Output(s) Mode", injectionPinMode, {isInjectionEnabled}@@if_ts_show_injectionPinMode
dialog = cylinderBankSelect, "Cylinder Banks", yAxis
field = "Cylinder 1", cylinderBankSelect1, {isInjectionEnabled == 1}
field = "Cylinder 2", cylinderBankSelect2, {isInjectionEnabled == 1 && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 1}
field = "Cylinder 3", cylinderBankSelect3, {isInjectionEnabled == 1 && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 2}
field = "Cylinder 4", cylinderBankSelect4, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 3}
field = "Cylinder 5 ", cylinderBankSelect5, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 4}
field = "Cylinder 6 ", cylinderBankSelect6, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 5}
field = "Cylinder 7 ", cylinderBankSelect7, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 6}
field = "Cylinder 8 ", cylinderBankSelect8, {isInjectionEnabled == 1 && injectionMode != 3 && cylindersCount > 7}
field = "Cylinder 9 ", cylinderBankSelect9, {isInjectionEnabled == 1 && cylindersCount > 8}
field = "Cylinder 10 ", cylinderBankSelect10, {isInjectionEnabled == 1 && cylindersCount > 9}
field = "Cylinder 11 ", cylinderBankSelect11, {isInjectionEnabled == 1 && cylindersCount > 10}
field = "Cylinder 12 ", cylinderBankSelect12, {isInjectionEnabled == 1 && cylindersCount > 11}
field = "Cylinder 1", cylinderBankSelect1, {isInjectionEnabled}
field = "Cylinder 2", cylinderBankSelect2, {isInjectionEnabled && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 1}
field = "Cylinder 3", cylinderBankSelect3, {isInjectionEnabled && injectionMode != @@injection_mode_e_IM_SINGLE_POINT@@ && cylindersCount > 2}
field = "Cylinder 4", cylinderBankSelect4, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 3}
field = "Cylinder 5 ", cylinderBankSelect5, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 4}
field = "Cylinder 6 ", cylinderBankSelect6, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 5}
field = "Cylinder 7 ", cylinderBankSelect7, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 6}
field = "Cylinder 8 ", cylinderBankSelect8, {isInjectionEnabled && injectionMode != 3 && cylindersCount > 7}
field = "Cylinder 9 ", cylinderBankSelect9, {isInjectionEnabled && cylindersCount > 8}
field = "Cylinder 10 ", cylinderBankSelect10, {isInjectionEnabled && cylindersCount > 9}
field = "Cylinder 11 ", cylinderBankSelect11, {isInjectionEnabled && cylindersCount > 10}
field = "Cylinder 12 ", cylinderBankSelect12, {isInjectionEnabled && cylindersCount > 11}
dialog = injectorNonlinearPolynomial, "Polynomial Adder", yAxis
field = "Add nonlinearity below pulse", applyNonlinearBelowPulse
@ -2438,7 +2440,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = injectorNonlinear
field = "Small pulse correction mode", injectorNonlinearMode
panel = injectorNonlinearPolynomial, {1}, { injectorNonlinearMode == 1 }
panel = injectorNonlinearPolynomial, {1}, { injectorNonlinearMode }
panel = injectorNonlinearFord, {1}, { injectorNonlinearMode == 2 }
dialog = testLuaOut, "Lua Out Test"
@ -2898,14 +2900,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Aux Temperature #2", auxTempSensor2_adcChannel
field = "Aux Fast Analog", auxFastSensor1_adcChannel
dialog = allTriggerDebug, "Trigger Debug"
field = "trigger 1 debug", triggerInputDebugPins1
field = "trigger 2 debug", triggerInputDebugPins2
field = "cam 1 debug", camInputsDebug1
field = "cam 2 debug", camInputsDebug2
field = "cam 3 debug", camInputsDebug3
field = "cam 4 debug", camInputsDebug4
dialog = allPinsMC33, "MC33816"
field = "Chip Select", mc33816_cs
field = rstb, mc33816_rstb
@ -2977,7 +2971,6 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = allPins2_3
field = "Debug Trigger Sync", debugTriggerSync
panel = allTriggerDebug
panel = allPinsMC33
dialog = allPins1_3
@ -2991,15 +2984,15 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Aux ADC #8", auxAnalogInputs8
field = "CAN RX pin", canRxPin @@if_ts_show_can_pins
field = "CAN TX pin", canTxPin @@if_ts_show_can_pins
field = "SPI1 MOSI", spi1mosiPin, { spi1mosiPin != 0 || is_enabled_spi_1 == 1} @@if_ts_show_spi
field = "SPI1 MISO", spi1misoPin, { spi1misoPin != 0 || is_enabled_spi_1 == 1} @@if_ts_show_spi
field = "SPI1 SCK", spi1sckPin, {is_enabled_spi_1 == 1} @@if_ts_show_spi
field = "SPI2 MOSI", spi2mosiPin, {is_enabled_spi_2 == 1} @@if_ts_show_spi
field = "SPI2 MISO", spi2misoPin, {is_enabled_spi_2 == 1} @@if_ts_show_spi
field = "SPI2 SCK", spi2sckPin, {is_enabled_spi_2 == 1} @@if_ts_show_spi
field = "SPI3 MOSI", spi3mosiPin, {is_enabled_spi_3 == 1} @@if_ts_show_spi
field = "SPI3 MISO", spi3misoPin, {is_enabled_spi_3 == 1} @@if_ts_show_spi
field = "SPI3 SCK", spi3sckPin, {is_enabled_spi_3 == 1} @@if_ts_show_spi
field = "SPI1 MOSI", spi1mosiPin, { spi1mosiPin != 0 || is_enabled_spi_1} @@if_ts_show_spi
field = "SPI1 MISO", spi1misoPin, { spi1misoPin != 0 || is_enabled_spi_1} @@if_ts_show_spi
field = "SPI1 SCK", spi1sckPin, {is_enabled_spi_1} @@if_ts_show_spi
field = "SPI2 MOSI", spi2mosiPin, {is_enabled_spi_2} @@if_ts_show_spi
field = "SPI2 MISO", spi2misoPin, {is_enabled_spi_2} @@if_ts_show_spi
field = "SPI2 SCK", spi2sckPin, {is_enabled_spi_2} @@if_ts_show_spi
field = "SPI3 MOSI", spi3mosiPin, {is_enabled_spi_3} @@if_ts_show_spi
field = "SPI3 MISO", spi3misoPin, {is_enabled_spi_3} @@if_ts_show_spi
field = "SPI3 SCK", spi3sckPin, {is_enabled_spi_3} @@if_ts_show_spi
field = "LIS302DLCsPin", LIS302DLCsPin
field = "DRV8860 CS", drv8860_cs
field = "DRV8860 CS Mode", drv8860_csPinMode
@ -3158,9 +3151,25 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "High voltage", auxLinear2_v2, {auxLinear2_hwChannel != @@ADC_CHANNEL_NONE@@}
field = "High value", auxLinear2_value2, {auxLinear2_hwChannel != @@ADC_CHANNEL_NONE@@}
dialog = auxLinearSensor3, "Aux Linear Sensor #3"
field = "ADC input", auxLinear3_hwChannel
field = "Low voltage", auxLinear3_v1, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@}
field = "Low value", auxLinear3_value1, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@}
field = "High voltage", auxLinear3_v2, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@}
field = "High value", auxLinear3_value2, {auxLinear3_hwChannel != @@ADC_CHANNEL_NONE@@}
dialog = auxLinearSensor4, "Aux Linear Sensor #4"
field = "ADC input", auxLinear4_hwChannel
field = "Low voltage", auxLinear4_v1, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@}
field = "Low value", auxLinear4_value1, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@}
field = "High voltage", auxLinear4_v2, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@}
field = "High value", auxLinear4_value2, {auxLinear4_hwChannel != @@ADC_CHANNEL_NONE@@}
dialog = auxLinearSensors
panel = auxLinearSensor1
panel = auxLinearSensor2
panel = auxLinearSensor3
panel = auxLinearSensor4
field = auxSpeedSensorInputPin1, auxSpeedSensorInputPin1
field = auxSpeedSensorInputPin2, auxSpeedSensorInputPin2
@ -3360,7 +3369,7 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = idleExtra, "Extra Idle Features"
field = "Use idle ignition table", useSeparateAdvanceForIdle
field = "Use idle VE table", useSeparateVeForIdle
field = "Override Idle VE table load axis", idleVeOverrideMode, { useSeparateVeForIdle == 1 }
field = "Override Idle VE table load axis", idleVeOverrideMode, { useSeparateVeForIdle }
field = "Use idle tables for cranking taper", useSeparateIdleTablesForCrankingTaper
field = "Use coasting idle table", useIacTableForCoasting
@ -3382,11 +3391,11 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = ""
field = "#Gain is in degrees advance per rpm away from target"
field = "#A good starting point is 0.1 = 10 deg per 100 rpm"
field = "Proportional gain", idleTimingPid_pFactor, {useIdleTimingPidControl == 1}
field = "Derivative gain", idleTimingPid_dFactor, {useIdleTimingPidControl == 1}
field = "Proportional gain", idleTimingPid_pFactor, {useIdleTimingPidControl}
field = "Derivative gain", idleTimingPid_dFactor, {useIdleTimingPidControl}
field = ""
field = "Min adjustment (retard)", idleTimingPid_minValue, {useIdleTimingPidControl == 1}
field = "Max adjustment (advance)", idleTimingPid_maxValue, {useIdleTimingPidControl == 1}
field = "Min adjustment (retard)", idleTimingPid_minValue, {useIdleTimingPidControl}
field = "Max adjustment (advance)", idleTimingPid_maxValue, {useIdleTimingPidControl}
field = ""
field = "#Use debug mode 'Timing' to view idle timing adjustment"
@ -3472,6 +3481,9 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Pulse Mode", tachPulseDurationAsDutyCycle
field = "Pulse duration", tachPulseDuractionMs
field = "Pulse per Rev", tachPulsePerRev
field = ""
field = "Startup sweep time", tachSweepTime
field = "Startup sweep RPM", tachSweepMax
dialog = speedoSettings, "Speedometer output"
field = "Output", speedometerOutputPin
@ -3527,34 +3539,34 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = spiFunction, "SPI settings"
field = "!ECU reboot needed to apply these settings"
field = "SPI1 Enable", is_enabled_spi_1
field = "SPI1 MOSI", spi1mosiPin, {is_enabled_spi_1 == 1}
field = "SPI1 MISO", spi1misoPin, {is_enabled_spi_1 == 1}
field = "SPI1 SCK", spi1sckPin, {is_enabled_spi_1 == 1}
field = "SPI1 MOSI", spi1mosiPin, {is_enabled_spi_1}
field = "SPI1 MISO", spi1misoPin, {is_enabled_spi_1}
field = "SPI1 SCK", spi1sckPin, {is_enabled_spi_1}
field = "SPI2 Enable", is_enabled_spi_2
field = "SPI2 MOSI", spi2mosiPin, {is_enabled_spi_2 == 1}
field = "SPI2 MISO", spi2misoPin, {is_enabled_spi_2 == 1}
field = "SPI2 SCK", spi2sckPin, {is_enabled_spi_2 == 1}
field = "SPI2 MOSI", spi2mosiPin, {is_enabled_spi_2}
field = "SPI2 MISO", spi2misoPin, {is_enabled_spi_2}
field = "SPI2 SCK", spi2sckPin, {is_enabled_spi_2}
field = "SPI3 Enable", is_enabled_spi_3
field = "SPI3 MOSI", spi3mosiPin, {is_enabled_spi_3 == 1}
field = "SPI3 MISO", spi3misoPin, {is_enabled_spi_3 == 1}
field = "SPI3 SCK", spi3sckPin, {is_enabled_spi_3 == 1}
field = "SPI3 MOSI", spi3mosiPin, {is_enabled_spi_3}
field = "SPI3 MISO", spi3misoPin, {is_enabled_spi_3}
field = "SPI3 SCK", spi3sckPin, {is_enabled_spi_3}
field = "SPI4 Enable", is_enabled_spi_4
field = "SPI4 MOSI", spi4mosiPin, {is_enabled_spi_4 == 1}
field = "SPI4 MISO", spi4misoPin, {is_enabled_spi_4 == 1}
field = "SPI4 SCK", spi4sckPin, {is_enabled_spi_4 == 1}
field = "SPI4 MOSI", spi4mosiPin, {is_enabled_spi_4}
field = "SPI4 MISO", spi4misoPin, {is_enabled_spi_4}
field = "SPI4 SCK", spi4sckPin, {is_enabled_spi_4}
field = "SPI5 Enable", is_enabled_spi_5
field = "SPI5 MOSI", spi5mosiPin, {is_enabled_spi_5 == 1}
field = "SPI5 MISO", spi5misoPin, {is_enabled_spi_5 == 1}
field = "SPI5 SCK", spi5sckPin, {is_enabled_spi_5 == 1}
field = "SPI5 MOSI", spi5mosiPin, {is_enabled_spi_5}
field = "SPI5 MISO", spi5misoPin, {is_enabled_spi_5}
field = "SPI5 SCK", spi5sckPin, {is_enabled_spi_5}
field = "SPI6 Enable", is_enabled_spi_6
field = "SPI6 MOSI", spi6mosiPin, {is_enabled_spi_6 == 1}
field = "SPI6 MISO", spi6misoPin, {is_enabled_spi_6 == 1}
field = "SPI6 SCK", spi6sckPin, {is_enabled_spi_6 == 1}
field = "SPI6 MOSI", spi6mosiPin, {is_enabled_spi_6}
field = "SPI6 MISO", spi6misoPin, {is_enabled_spi_6}
field = "SPI6 SCK", spi6sckPin, {is_enabled_spi_6}
field = "LIS302DLCsPin", LIS302DLCsPin
dialog = stftPartitioning, "Region Configuration"
@ -3585,18 +3597,18 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
dialog = fuelClosedLoopDialog, "Closed loop fuel correction"
field = "Enabled", fuelClosedLoopCorrectionEnabled
field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled == 1}
field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled == 1}
field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled == 1}
field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled == 1}
field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled == 1}
field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled == 1}
field = "Startup delay" stft_startupDelay, {fuelClosedLoopCorrectionEnabled}
field = "Minimum CLT for correction", stft_minClt, {fuelClosedLoopCorrectionEnabled}
field = "Minimum AFR for correction", stft_minAfr, {fuelClosedLoopCorrectionEnabled}
field = "Maximum AFR for correction", stft_maxAfr, {fuelClosedLoopCorrectionEnabled}
field = "Adjustment deadband", stft_deadband, {fuelClosedLoopCorrectionEnabled}
field = "Ignore error magnitude", stftIgnoreErrorMagnitude, {fuelClosedLoopCorrectionEnabled}
panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled == 1}
panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled == 1}
panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled == 1}
panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled == 1}
panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled == 1}
panel = stftPartitioning, {fuelClosedLoopCorrectionEnabled}
panel = stftPartitionSettingsMain, {fuelClosedLoopCorrectionEnabled}
panel = stftPartitionSettingsIdle, {fuelClosedLoopCorrectionEnabled}
panel = stftPartitionSettingsPower, {fuelClosedLoopCorrectionEnabled}
panel = stftPartitionSettingsOverrun, {fuelClosedLoopCorrectionEnabled}
dialog = lambdaProtectionLeft, ""
field = "Enable lambda protection", lambdaProtectionEnable
@ -3665,18 +3677,18 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
field = "Battery Input Divider Coefficient", vbattDividerCoeff
dialog = alternator, "Alternator Settings", yAxis
field = "Enabled", isAlternatorControlEnabled
field = "Target", targetVBatt, {isAlternatorControlEnabled == 1}
field = "Control output", alternatorControlPin, {isAlternatorControlEnabled == 1}
field = "Control outpur mode", alternatorControlPinMode, {isAlternatorControlEnabled == 1}
field = "PWM frequency", alternatorPwmFrequency, {isAlternatorControlEnabled == 1}
field = "A/C duty adder", acRelayAlternatorDutyAdder, {isAlternatorControlEnabled == 1}
field = "Target", targetVBatt, {isAlternatorControlEnabled}
field = "Control output", alternatorControlPin, {isAlternatorControlEnabled}
field = "Control outpur mode", alternatorControlPinMode, {isAlternatorControlEnabled}
field = "PWM frequency", alternatorPwmFrequency, {isAlternatorControlEnabled}
field = "A/C duty adder", acRelayAlternatorDutyAdder, {isAlternatorControlEnabled}
field = "#PID control"
field = "offset", alternatorControl_offset, {isAlternatorControlEnabled == 1}
field = "P factor", alternatorControl_pFactor, {isAlternatorControlEnabled == 1}
field = "I factor", alternatorControl_iFactor, {isAlternatorControlEnabled == 1}
field = "D factor", alternatorControl_dFactor, {isAlternatorControlEnabled == 1}
field = "Min", alternatorControl_minValue, {isAlternatorControlEnabled == 1}
field = "Max", alternatorControl_maxValue, {isAlternatorControlEnabled == 1}
field = "offset", alternatorControl_offset, {isAlternatorControlEnabled}
field = "P factor", alternatorControl_pFactor, {isAlternatorControlEnabled}
field = "I factor", alternatorControl_iFactor, {isAlternatorControlEnabled}
field = "D factor", alternatorControl_dFactor, {isAlternatorControlEnabled}
field = "Min", alternatorControl_minValue, {isAlternatorControlEnabled}
field = "Max", alternatorControl_maxValue, {isAlternatorControlEnabled}
field = "#% duty = Pterm + Iterm + Dterm + offset%"
dialog = energySystems, "Battery and Alternator Settings", yAxis
@ -3722,6 +3734,11 @@ cmd_set_engine_type_default = "@@TS_IO_TEST_COMMAND_char@@@@ts_command_e_TS_
settingOption = "Toyota C60" , totalGearsCount=5,gearRatio1=3.17,gearRatio2=2.05,gearRatio3=1.48,gearRatio4=1.17,gearRatio5=0.92,gearRatio6=0.73 ,finalGearRatio=4.53
settingOption = "Toyota EB60" , totalGearsCount=6,gearRatio1=3.54,gearRatio2=2.05,gearRatio3=1.38,gearRatio4=1.03,gearRatio5=0.88,gearRatio6=0.73 ,finalGearRatio=4.06
settingOption = "Toyota EB62" , totalGearsCount=6,gearRatio1=3.54,gearRatio2=2.05,gearRatio3=1.38,gearRatio4=0.98,gearRatio5=0.74,gearRatio6=0.66 ,finalGearRatio=4.06
settingOption = "Aisin AR5 5 speed" , totalGearsCount=5,gearRatio1=3.75,gearRatio2=2.26,gearRatio3=1.51,gearRatio4=1.00,gearRatio5=0.73
settingOption = "Toyota R154 5 speed" , totalGearsCount=5,gearRatio1=3.25,gearRatio2=1.96,gearRatio3=1.31,gearRatio4=1.00,gearRatio5=0.75
settingOption = "Toyota W55 5 speed" , totalGearsCount=5,gearRatio1=3.57,gearRatio2=2.06,gearRatio3=1.38,gearRatio4=1.00,gearRatio5=0.85
settingOption = "Toyota W58 5 speed" , totalGearsCount=5,gearRatio1=3.29,gearRatio2=1.89,gearRatio3=1.28,gearRatio4=1.00,gearRatio5=0.78
settingOption = "Toyota V160 6 speed" , totalGearsCount=6,gearRatio1=3.83,gearRatio2=2.36,gearRatio3=1.69,gearRatio4=1.31,gearRatio5=1.00,gearRatio6=0.79
settingOption = "BRZ/FRS/86 6 speed" , totalGearsCount=6,gearRatio1=3.63,gearRatio2=2.19,gearRatio3=1.54,gearRatio4=1.21,gearRatio5=1.00,gearRatio6=0.77
field = ""
field = "Forward gear count", totalGearsCount
@ -4405,31 +4422,31 @@ dialog = tcuControls, "Transmission Settings"
field = "Enable Launch Control", launchControlEnabled
field = "Activation Mode", launchActivationMode
field = "Launch Button", launchActivatePin, { launchActivatePin != 0 || (launchActivationMode == @@launchActivationMode_e_SWITCH_INPUT_LAUNCH@@ && launchControlEnabled == 1)}
field = "Launch Button", launchActivatePin, { launchActivatePin != 0 || (launchActivationMode == @@launchActivationMode_e_SWITCH_INPUT_LAUNCH@@ && launchControlEnabled)}
field = "Launch Button inverted", launchActivateInverted
field = "Launch Button mode", launchActivatePinMode, {launchActivationMode == @@launchActivationMode_e_SWITCH_INPUT_LAUNCH@@ && launchControlEnabled == 1}
field = "Launch Button mode", launchActivatePinMode, {launchActivationMode == @@launchActivationMode_e_SWITCH_INPUT_LAUNCH@@ && launchControlEnabled}
field = "Clutch Down", clutchDownPin, {launchActivationMode == @@launchActivationMode_e_CLUTCH_INPUT_LAUNCH@@ && launchControlEnabled == 1}
field = "Clutch Down", clutchDownPin, {launchActivationMode == @@launchActivationMode_e_CLUTCH_INPUT_LAUNCH@@ && launchControlEnabled}
field = "Clutch Down inverted", clutchDownPinInverted
field = "Clutch Down mode", clutchDownPinMode, {launchActivationMode == @@launchActivationMode_e_CLUTCH_INPUT_LAUNCH@@ && launchControlEnabled == 1}
field = "Clutch Down mode", clutchDownPinMode, {launchActivationMode == @@launchActivationMode_e_CLUTCH_INPUT_LAUNCH@@ && launchControlEnabled}
field = ""
; dead code field = "Rpm Threshold", launchRpmThreshold, {launchControlEnabled == 1}
field = "Speed Threshold", launchSpeedThreshold, {launchControlEnabled == 1}
; dead code field = "Rpm Threshold", launchRpmThreshold, {launchControlEnabled}
field = "Speed Threshold", launchSpeedThreshold, {launchControlEnabled}
field = ""
field = "Launch RPM", launchRpm, {launchControlEnabled == 1}
field = "Ignition Retard Adder", launchTimingRpmRange, {launchControlEnabled == 1 && enableLaunchRetard == 1}
field = "Hard Cut RPM Adder", hardCutRpmRange, {launchControlEnabled == 1}
;field = "Extra Fuel", launchFuelAdded, {launchControlEnabled == 1}
;field = "Boost Solenoid Duty", launchBoostDuty, {launchControlEnabled == 1}
field = "TPS Threshold", launchTpsThreshold, {launchControlEnabled == 1}
field = "Ignition Retard enable", enableLaunchRetard, {launchControlEnabled == 1}
field = "Ignition Retard", launchTimingRetard, {launchControlEnabled == 1 && enableLaunchRetard == 1}
field = "Fuel Added %", launchFuelAdderPercent, {launchControlEnabled == 1}
field = "Smooth Retard Mode", launchSmoothRetard, {launchControlEnabled == 1 && enableLaunchRetard == 1}
field = "Launch RPM", launchRpm, {launchControlEnabled}
field = "Ignition Retard Adder", launchTimingRpmRange, {launchControlEnabled && enableLaunchRetard}
field = "Hard Cut RPM Adder", hardCutRpmRange, {launchControlEnabled}
;field = "Extra Fuel", launchFuelAdded, {launchControlEnabled}
;field = "Boost Solenoid Duty", launchBoostDuty, {launchControlEnabled}
field = "TPS Threshold", launchTpsThreshold, {launchControlEnabled}
field = "Ignition Retard enable", enableLaunchRetard, {launchControlEnabled}
field = "Ignition Retard", launchTimingRetard, {launchControlEnabled && enableLaunchRetard}
field = "Fuel Added %", launchFuelAdderPercent, {launchControlEnabled}
field = "Smooth Retard Mode", launchSmoothRetard, {launchControlEnabled && enableLaunchRetard}
field = "Hard Cut Mode"
field = "Ignition Cut", launchSparkCutEnable, {launchControlEnabled == 1}
field = "Fuel Cut", launchFuelCutEnable, {launchControlEnabled == 1}
field = "Ignition Cut", launchSparkCutEnable, {launchControlEnabled}
field = "Fuel Cut", launchFuelCutEnable, {launchControlEnabled}
dialog = smLaunchControl, "", border
@ -4439,34 +4456,34 @@ dialog = tcuControls, "Transmission Settings"
dialog = antiLagDialog, "AntiLag Settings"
field = "Enable AntiLag", antiLagEnabled
field = "Activation Mode", antiLagActivationMode
field = "Switch Input", ALSActivatePin, {antiLagActivationMode == @@antiLagActivationMode_e_SWITCH_INPUT_ANTILAG@@ && antiLagEnabled == 1}
field = "ALS Button inverted", ALSActivateInverted, {antiLagActivationMode == @@antiLagActivationMode_e_SWITCH_INPUT_ANTILAG@@ && antiLagEnabled == 1}
field = "ALS Button mode", ALSActivatePinMode, {antiLagActivationMode == @@antiLagActivationMode_e_SWITCH_INPUT_ANTILAG@@ && antiLagEnabled == 1}
field = "ALS timeout", ALSMaxDuration, {antiLagEnabled == 1}
field = "Max TPS", ALSMaxTPS, {antiLagEnabled == 1}
field = "Min RPM", ALSMinRPM, {antiLagEnabled == 1}
field = "Max RPM", ALSMaxRPM, {antiLagEnabled == 1}
field = "Min CLT", ALSMinCLT, {antiLagEnabled == 1}
field = "Max CLT", ALSMaxCLT, {antiLagEnabled == 1}
field = "Idle Air Add", ALSIdleAdd, {antiLagEnabled == 1}
field = "ETB Air Add", ALSEtbAdd, {antiLagEnabled == 1}
field = "Spark Skip Ratio", ALSSkipRatio, {antiLagEnabled == 1}
field = "Switch Input", ALSActivatePin, {antiLagActivationMode == @@antiLagActivationMode_e_SWITCH_INPUT_ANTILAG@@ && antiLagEnabled}
field = "ALS Button inverted", ALSActivateInverted, {antiLagActivationMode == @@antiLagActivationMode_e_SWITCH_INPUT_ANTILAG@@ && antiLagEnabled}
field = "ALS Button mode", ALSActivatePinMode, {antiLagActivationMode == @@antiLagActivationMode_e_SWITCH_INPUT_ANTILAG@@ && antiLagEnabled}
field = "ALS timeout", ALSMaxDuration, {antiLagEnabled}
field = "Max TPS", ALSMaxTPS, {antiLagEnabled}
field = "Min RPM", ALSMinRPM, {antiLagEnabled}
field = "Max RPM", ALSMaxRPM, {antiLagEnabled}
field = "Min CLT", ALSMinCLT, {antiLagEnabled}
field = "Max CLT", ALSMaxCLT, {antiLagEnabled}
field = "Idle Air Add", ALSIdleAdd, {antiLagEnabled}
field = "ETB Air Add", ALSEtbAdd, {antiLagEnabled}
field = "Spark Skip Ratio", ALSSkipRatio, {antiLagEnabled}
panel = FuelAdderTableALS
panel = IgnRetardTableALS
dialog = coastingFuelCutControl, "Coasting Fuel Cutoff Settings"
field = "Enable Coasting Fuel Cutoff", coastingFuelCutEnabled
field = "No cut below CLT", coastingFuelCutClt, {coastingFuelCutEnabled == 1}
field = "RPM cut fuel above", coastingFuelCutRpmHigh, {coastingFuelCutEnabled == 1}
field = "RPM restore fuel below", coastingFuelCutRpmLow, {coastingFuelCutEnabled == 1}
field = "Vehicle speed cut above", coastingFuelCutVssHigh, {coastingFuelCutEnabled == 1}
field = "Vehicle speed restore below", coastingFuelCutVssLow, {coastingFuelCutEnabled == 1}
field = "Cut fuel below TPS", coastingFuelCutTps, {coastingFuelCutEnabled == 1}
field = "Cut fuel below MAP mode", useTableForDfcoMap, {coastingFuelCutEnabled == 1}
field = "MAP threshold", coastingFuelCutMap, {coastingFuelCutEnabled && !useTableForDfcoMap}
field = "Fuel cut delay", dfcoDelay, {coastingFuelCutEnabled == 1}
field = "Inhibit closed loop fuel after cut", noFuelTrimAfterDfcoTime, {coastingFuelCutEnabled == 1}
field = "No cut below CLT", coastingFuelCutClt, {coastingFuelCutEnabled}
field = "RPM cut fuel above", coastingFuelCutRpmHigh, {coastingFuelCutEnabled}
field = "RPM restore fuel below", coastingFuelCutRpmLow, {coastingFuelCutEnabled}
field = "Vehicle speed cut above", coastingFuelCutVssHigh, {coastingFuelCutEnabled}
field = "Vehicle speed restore below", coastingFuelCutVssLow, {coastingFuelCutEnabled}
field = "Cut fuel below TPS", coastingFuelCutTps, {coastingFuelCutEnabled}
field = "Cut fuel below MAP mode", useTableForDfcoMap, {coastingFuelCutEnabled}
field = "Cut fuel below MAP", coastingFuelCutMap, {coastingFuelCutEnabled && !useTableForDfcoMap}
field = "Fuel cut delay", dfcoDelay, {coastingFuelCutEnabled}
field = "Inhibit closed loop fuel after cut", noFuelTrimAfterDfcoTime, {coastingFuelCutEnabled}
dialog = rotaryDialog, "Rotary"
field = "Enable Trailing Sparks", enableTrailingSparks
@ -4505,7 +4522,7 @@ dialog = tcuControls, "Transmission Settings"
dialog = parkingLot, "Experimental/Broken"
field = "I understand ECU Locking", yesUnderstandLocking
field = "Tune read/write password", tuneHidingKey, { yesUnderstandLocking == 1 }
field = "Tune read/write password", tuneHidingKey, { yesUnderstandLocking }
field = "#System hacks"
field = "Global fuel correction", globalFuelCorrection
field = "ADC vRef voltage", adcVcc
@ -4522,7 +4539,6 @@ dialog = tcuControls, "Transmission Settings"
field = auxFrequencyFilter, auxFrequencyFilter
field = useBiQuadOnAuxSpeedSensors, useBiQuadOnAuxSpeedSensors
field = "TODO KS mode 4569", kickStartCranking
panel = allTriggerDebug
panel = harleyAcr
help = helpGeneral, "FOME General Help"

View File

@ -80,7 +80,6 @@ char* itoa10(char *p, int num);
bool strEqualCaseInsensitive(const char *str1, const char *str2);
bool strEqual(const char *str1, const char *str2);
// Currently used by air-interp. tCharge mode (see EngineState::updateTChargeK()).
float limitRateOfChange(float newValue, float oldValue, float incrLimitPerSec, float decrLimitPerSec, float secsPassed);
bool isPhaseInRange(float test, float current, float next);

View File

@ -64,6 +64,8 @@ public enum SensorType {
LuaGauge2,
AuxLinear1,
AuxLinear2,
AuxLinear3,
AuxLinear4,
AuxSpeed1,
AuxSpeed2,
PlaceholderLast,

View File

@ -27,18 +27,18 @@ public enum debug_mode_e {
DBG_19,
DBG_20,
DBG_21,
DBG_INSTANT_RPM,
DBG_22,
UNUSED23,
DBG_24,
DBG_25,
DBG_26,
DBG_MAP,
DBG_27,
DBG_METRICS,
DBG_29,
DBG_ION,
DBG_TLE8888,
DBG_32,
DBG_DWELL_METRIC,
DBG_33,
DBG_34,
DBG_35,
DBG_36,

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