Skip to content

Commit 1873889

Browse files
committed
feat: DFCO switch input, rotational idle switch + RPM window, menu reorganization
- DFCO enable switch pin (coastingFuelCutSwitchPin): switch ON allows fuel cut per parameters, switch OFF disables DFCO entirely; leave unassigned for parameter-only control - Rotational Idle manual enable switch pin: switch ON forces rotational idle active, overriding automatic CLT/TPS engage conditions - Rotational Idle RPM window (minRpm/maxRpm): gate engagement within a configurable RPM range; 0 = no limit; live data flags rotIdleEngineTooSlow and rotIdleEngineTooFast now wired up - TunerStudio: Fuel Consumption moved from Advanced to Fuel menu - TunerStudio: Rotational Idle moved from Advanced to Idle menu - TunerStudio: removed duplicate VSS and Injector Flow fields from Fuel Consumption dialog - Regenerated all board headers and INI files
1 parent 1198fc7 commit 1873889

12 files changed

Lines changed: 54211 additions & 10215 deletions

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ All notable changes to Mazduino firmware are documented here.
55
## [Unreleased]
66

77
### Added
8+
- DFCO enable switch input (`coastingFuelCutSwitchPin`): assign a pin to control DFCO via a physical switch; switch ON allows fuel cut per RPM/TPS/CLT parameters, switch OFF disables fuel cut entirely; leave unassigned for parameter-only control
9+
- Rotational Idle manual enable switch input (`rotationalIdleController.switchPin`): when switch is ON, rotational idle is forced active regardless of automatic CLT/TPS conditions
10+
- Rotational Idle RPM window (`minRpm`, `maxRpm`): configurable RPM range for rotational idle engagement; 0 = no limit; displayed in live data as `rotIdleEngineTooSlow` / `rotIdleEngineTooFast`
811
- Fuel consumption output channels: trip-average L/100km and instantaneous L/hr, user-configurable via TunerStudio (Engine > Fuel Consumption); requires VSS, injection enabled, and injector flow set
912
- `fuelConsumptionEnabled` bit and `fuelDensity` (g/L, default 750 petrol) added to engine configuration; calculation runs in `TripOdometer::onSlowCallback()`
1013
- `OUTCH_FuelConsumptionL100km` and `OUTCH_FuelConsumptionLitersPerHour` added to `output_channel_e` enum for Lua access
@@ -16,6 +19,9 @@ All notable changes to Mazduino firmware are documented here.
1619
- mazduino-mega100-512: STM32F407VET6 (512KB) board with reduced feature set; firmware constrained to 384KB to keep tune storage sector (sector 7, 0x08060000) free
1720

1821
### Changed
22+
- TunerStudio menu: Fuel Consumption moved from Advanced to Fuel menu (after DFCO entry)
23+
- TunerStudio menu: Rotational Idle moved from Advanced to Idle menu
24+
- TunerStudio dialog: Fuel Consumption dialog removes duplicate VSS input pin and Injector Flow fields (already configurable in their own dedicated menus)
1925
- `_compile_unit_tests.sh` updated to use `boards/mazduino-lite/meta-info.env` as the reference board (replacing deleted root `meta-info.env`)
2026
- `generated/controllers/generated/` pre-generated headers regenerated to include CAN input/output feature structs and new enum values from the mazduino rusefi fork
2127
- mazduino-mega100 and mega100-512: status LED at PB7 enabled (`getCommsLedPin()` and `LED_CRITICAL_ERROR_BRAIN_PIN` both assigned to PB7)

ext/rusefi

generated/controllers/generated/engine_configuration_generated_structures_mazduino.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7036,8 +7036,12 @@ struct engine_configuration_s {
70367036
* offset 5700
70377037
*/
70387038
TriggeredCanOutput triggeredCanOutput[8] = {};
7039+
bool fuelConsumptionEnabled : 1 {};
7040+
bool fuelConsumptionEnabledPad : 7 {};
7041+
scaled_channel<uint8_t, 1, 4> fuelDensity;
7042+
uint8_t fuelConsumptionPad[2] = {};
70397043
};
7040-
static_assert(sizeof(engine_configuration_s) == 6660);
7044+
static_assert(sizeof(engine_configuration_s) == 6664);
70417045

70427046
// start of ign_cyl_trim_s
70437047
struct ign_cyl_trim_s {

generated/controllers/lua/generated/value_lookup_generated.cpp

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,6 +2074,12 @@ float getConfigValueByHash(const int hash) {
20742074
// rotationalIdleController.auto_engage_clt
20752075
case 602046867:
20762076
return engineConfiguration->rotationalIdleController.auto_engage_clt;
2077+
// rotationalIdleController.minRpm
2078+
case 644592037:
2079+
return engineConfiguration->rotationalIdleController.minRpm;
2080+
// rotationalIdleController.maxRpm
2081+
case 635464039:
2082+
return engineConfiguration->rotationalIdleController.maxRpm;
20772083
// misfireDetectionEnabled
20782084
case -2092512610:
20792085
return engineConfiguration->misfireDetectionEnabled;
@@ -2110,6 +2116,12 @@ float getConfigValueByHash(const int hash) {
21102116
// misfireSettleCycles
21112117
case -631434424:
21122118
return engineConfiguration->misfireSettleCycles;
2119+
// fuelConsumptionEnabled
2120+
case 1450706523:
2121+
return engineConfiguration->fuelConsumptionEnabled;
2122+
// fuelDensity
2123+
case -1922244559:
2124+
return engineConfiguration->fuelDensity;
21132125
// tcu_shiftTime
21142126
case -1658957891:
21152127
return config->tcu_shiftTime;
@@ -2227,12 +2239,6 @@ float getConfigValueByHash(const int hash) {
22272239
// analogMultiSwitchLatch8
22282240
case 440931128:
22292241
return config->analogMultiSwitchLatch8;
2230-
// fuelConsumptionEnabled
2231-
case 1450706523:
2232-
return config->fuelConsumptionEnabled;
2233-
// fuelDensity
2234-
case -1922244559:
2235-
return config->fuelDensity;
22362242
}
22372243
return EFI_ERROR_CODE;
22382244
}
@@ -5692,6 +5698,16 @@ bool setConfigValueByName(const char *name, float value) {
56925698
{
56935699
engineConfiguration->rotationalIdleController.auto_engage_clt = (int)value;
56945700
return 1;
5701+
}
5702+
case 644592037:
5703+
{
5704+
engineConfiguration->rotationalIdleController.minRpm = (int)value;
5705+
return 1;
5706+
}
5707+
case 635464039:
5708+
{
5709+
engineConfiguration->rotationalIdleController.maxRpm = (int)value;
5710+
return 1;
56955711
}
56965712
case -2092512610:
56975713
{
@@ -5752,6 +5768,16 @@ bool setConfigValueByName(const char *name, float value) {
57525768
{
57535769
engineConfiguration->misfireSettleCycles = (int)value;
57545770
return 1;
5771+
}
5772+
case 1450706523:
5773+
{
5774+
engineConfiguration->fuelConsumptionEnabled = (int)value;
5775+
return 1;
5776+
}
5777+
case -1922244559:
5778+
{
5779+
engineConfiguration->fuelDensity = (int)value;
5780+
return 1;
57555781
}
57565782
case -1658957891:
57575783
{
@@ -5947,16 +5973,6 @@ bool setConfigValueByName(const char *name, float value) {
59475973
{
59485974
config->analogMultiSwitchLatch8 = (int)value;
59495975
return 1;
5950-
}
5951-
case 1450706523:
5952-
{
5953-
config->fuelConsumptionEnabled = (int)value;
5954-
return 1;
5955-
}
5956-
case -1922244559:
5957-
{
5958-
config->fuelDensity = (int)value;
5959-
return 1;
59605976
}
59615977
}
59625978
return 0;

generated/controllers/lua/generated/value_lookup_generated.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,6 +2068,12 @@ Rotational Idle Auto engage CLT
20682068
### rotationalIdleController.auto_engage_clt
20692069
Rotational Idle Auto engage CLT.
20702070

2071+
### rotationalIdleController.minRpm
2072+
Minimum RPM for rotational idle to engage
2073+
2074+
### rotationalIdleController.maxRpm
2075+
Maximum RPM for rotational idle to disengage
2076+
20712077
### misfireDetectionEnabled
20722078
Misfire Detection: master enable. Active at idle only. Latches check-engine light (P0300) once the count threshold is reached.
20732079

@@ -2104,6 +2110,12 @@ Misfire Detection: wobble EMA alpha when spread is decreasing.
21042110
### misfireSettleCycles
21052111
Misfire Detection: firings to wait after entering idle before flagging starts. 0 = immediate.
21062112

2113+
### fuelConsumptionEnabled
2114+
Enable fuel consumption calculation (L/100km and L/hr)
2115+
2116+
### fuelDensity
2117+
Fuel density (petrol ~750, E85 ~787, diesel ~840)
2118+
21072119
### tcu_shiftTime
21082120

21092121

@@ -2221,9 +2233,3 @@ Latch: toggles on position change. Momentary: reflects current position.
22212233
### analogMultiSwitchLatch8
22222234
Latch: toggles on position change. Momentary: reflects current position.
22232235

2224-
### fuelConsumptionEnabled
2225-
Enable fuel consumption calculation (L/100km and L/hr)
2226-
2227-
### fuelDensity
2228-
Fuel density (petrol ~750, E85 ~787, diesel ~840)
2229-

0 commit comments

Comments
 (0)