2022-09-01 16:18:26 -07:00
|
|
|
#pragma once
|
|
|
|
#include "rusefi_types.h"
|
2023-01-14 13:08:25 -08:00
|
|
|
struct running_fuel_s {
|
2023-05-05 02:14:07 -07:00
|
|
|
// Fuel: Post cranking mult
|
2023-03-27 01:38:48 -07:00
|
|
|
// offset 0
|
2023-01-14 13:08:25 -08:00
|
|
|
float postCrankingFuelCorrection = (float)0;
|
2023-03-27 01:38:48 -07:00
|
|
|
// @@GAUGE_NAME_FUEL_IAT_CORR@@
|
|
|
|
// offset 4
|
2023-01-14 13:08:25 -08:00
|
|
|
float intakeTemperatureCoefficient = (float)0;
|
2023-03-27 01:38:48 -07:00
|
|
|
// @@GAUGE_NAME_FUEL_CLT_CORR@@
|
|
|
|
// offset 8
|
2023-01-14 13:08:25 -08:00
|
|
|
float coolantTemperatureCoefficient = (float)0;
|
2023-03-27 01:38:48 -07:00
|
|
|
// secs
|
|
|
|
// offset 12
|
2023-01-14 13:08:25 -08:00
|
|
|
float timeSinceCrankingInSecs = (float)0;
|
2023-05-05 02:14:07 -07:00
|
|
|
// @@GAUGE_NAME_FUEL_BASE@@
|
|
|
|
// This is the raw value we take from the fuel map or base fuel algorithm, before the corrections
|
|
|
|
// mg
|
2023-03-27 01:38:48 -07:00
|
|
|
// offset 16
|
2023-05-05 02:14:07 -07:00
|
|
|
scaled_channel<uint16_t, 100, 1> baseFuel = (uint16_t)0;
|
|
|
|
// @@GAUGE_NAME_FUEL_RUNNING@@
|
|
|
|
// Total fuel with CLT IAT and TPS acceleration without injector lag corrections per cycle, as pulse per cycle
|
|
|
|
// mg
|
|
|
|
// offset 18
|
|
|
|
scaled_channel<uint16_t, 100, 1> fuel = (uint16_t)0;
|
2023-01-14 13:08:25 -08:00
|
|
|
};
|
2023-05-05 02:14:07 -07:00
|
|
|
static_assert(sizeof(running_fuel_s) == 20);
|
2023-01-14 13:08:25 -08:00
|
|
|
|
2022-09-01 16:18:26 -07:00
|
|
|
struct fuel_computer_s {
|
2023-05-05 02:14:07 -07:00
|
|
|
// Fuel: Total correction
|
2023-03-27 01:38:48 -07:00
|
|
|
// mult
|
|
|
|
// offset 0
|
2023-01-14 02:42:09 -08:00
|
|
|
float totalFuelCorrection = (float)0;
|
2023-03-27 01:38:48 -07:00
|
|
|
// offset 4
|
2023-01-14 13:08:25 -08:00
|
|
|
running_fuel_s running;
|
2023-03-27 01:38:48 -07:00
|
|
|
// %
|
2023-05-05 02:14:07 -07:00
|
|
|
// offset 24
|
2022-11-05 17:28:03 -07:00
|
|
|
scaled_channel<uint16_t, 100, 1> afrTableYAxis = (uint16_t)0;
|
2023-03-27 01:38:48 -07:00
|
|
|
// @@GAUGE_NAME_TARGET_LAMBDA@@
|
2023-05-05 02:14:07 -07:00
|
|
|
// offset 26
|
2022-11-05 17:28:03 -07:00
|
|
|
scaled_channel<uint16_t, 10000, 1> targetLambda = (uint16_t)0;
|
2023-03-27 01:38:48 -07:00
|
|
|
// @@GAUGE_NAME_TARGET_AFR@@
|
|
|
|
// ratio
|
2023-05-05 02:14:07 -07:00
|
|
|
// offset 28
|
2022-11-05 17:28:03 -07:00
|
|
|
scaled_channel<uint16_t, 1000, 1> targetAFR = (uint16_t)0;
|
2023-05-05 02:14:07 -07:00
|
|
|
// Fuel: Stoich ratio
|
2023-03-27 01:38:48 -07:00
|
|
|
// ratio
|
2023-05-05 02:14:07 -07:00
|
|
|
// offset 30
|
2022-11-05 17:28:03 -07:00
|
|
|
scaled_channel<uint16_t, 1000, 1> stoichiometricRatio = (uint16_t)0;
|
2023-05-05 02:14:07 -07:00
|
|
|
// offset 32
|
2022-09-03 04:44:24 -07:00
|
|
|
float sdTcharge_coff = (float)0;
|
2023-05-05 02:14:07 -07:00
|
|
|
// @@GAUGE_NAME_AIR_MASS@@
|
|
|
|
// g
|
|
|
|
// offset 36
|
2022-09-03 04:44:24 -07:00
|
|
|
float sdAirMassInOneCylinder = (float)0;
|
2023-09-16 23:09:52 -07:00
|
|
|
// Air: Normalized cyl filling
|
|
|
|
// %
|
|
|
|
// offset 40
|
|
|
|
float normalizedCylinderFilling = (float)0;
|
2022-09-01 16:18:26 -07:00
|
|
|
};
|
2023-09-16 23:09:52 -07:00
|
|
|
static_assert(sizeof(fuel_computer_s) == 44);
|
2022-09-01 16:18:26 -07:00
|
|
|
|