Add ign & fuel load fields (#1568)

* add to code

* output channels size

* rusefi.input

* java offsets

Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
Matthew Kennedy 2020-07-04 13:40:31 -07:00 committed by GitHub
parent 4c7f5be4ef
commit 00e01abc4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 85 additions and 77 deletions

View File

@ -181,17 +181,22 @@ typedef struct {
TsCalMode calibrationMode; // 132
uint8_t padding[1]; // 133
// Values used for load axes for fuel/ign tables
// These may or may not be the same value, depending on mode
scaled_channel<uint16_t, 100> fuelingLoad; // 134
scaled_channel<uint16_t, 100> ignitionLoad; // 136
// we want a hash of engineMake+engineCode+vehicleName in the log file in order to match TS logs to rusEFI Online tune
int16_t engineMakeCodeNameCrc16; // 134
int16_t engineMakeCodeNameCrc16; // 138
// Errors
int totalTriggerErrorCounter; // 136
int orderingErrorCounter; // 140
int16_t warningCounter; // 144
int16_t lastErrorCode; // 146
int16_t recentErrorCodes[8]; // 148-162
int totalTriggerErrorCounter; // 140
int orderingErrorCounter; // 144
int16_t warningCounter; // 148
int16_t lastErrorCode; // 150
int16_t recentErrorCodes[8]; // 152-166
// Debug
float debugFloatField1; // 164
float debugFloatField1; // 168
float debugFloatField2;
float debugFloatField3;
float debugFloatField4;
@ -202,24 +207,24 @@ typedef struct {
int debugIntField2;
int debugIntField3;
int16_t debugIntField4;
int16_t debugIntField5; // 206
int16_t debugIntField5; // 210
// accelerometer
int16_t accelerationX; // 208
int16_t accelerationY; // 210
int16_t accelerationX; // 212
int16_t accelerationY; // 214
// EGT
egt_values_s egtValues; // 212
egt_values_s egtValues; // 216
scaled_percent throttle2Position; // 228
scaled_percent throttle2Position; // 232
scaled_voltage rawTps1Primary; // 230
scaled_voltage rawPpsPrimary; // 232
scaled_voltage rawClt; // 234
scaled_voltage rawIat; // 236
scaled_voltage rawOilPressure; // 238
scaled_voltage rawTps1Primary; // 234
scaled_voltage rawPpsPrimary; // 236
scaled_voltage rawClt; // 238
scaled_voltage rawIat; // 240
scaled_voltage rawOilPressure; // 242
int16_t tuneCrc16; // 240
int16_t tuneCrc16; // 244
uint8_t unusedAtTheEnd[2]; // we have some unused bytes to allow compatible TS changes
// Temporary - will remove soon

View File

@ -26,7 +26,7 @@
! this is here so that rusEfi console can access it, too
! [IMPORTANT] every time TS_OUTPUT_SIZE is changed make sure to increment TS_SIGNATURE above
!
#define TS_OUTPUT_SIZE 244
#define TS_OUTPUT_SIZE 248
!
! this is used to confirm that firmware and TunerStudio are using the same rusefi.ini version

View File

@ -307,60 +307,63 @@ enable2ndByteCanID = false
calibrationMode = scalar, U08, 132, "", 1, 0
; 1 bytes padding1
engineMakeCodeNameCrc16= scalar, U16, 134, "crc16", 1, 0
fuelingLoad = scalar, U16, 134, "%", 0.01, 0
ignitionLoad = scalar, U16, 136, "%", 0.01, 0
engineMakeCodeNameCrc16= scalar, U16, 138, "crc16", 1, 0
; Errors
totalTriggerErrorCounter=scalar,U32, 136,"counter", 1, 0
; orderingErrorCounter 140
warningCounter = scalar, U16, 144, "count", 1, 0
lastErrorCode = scalar, U16, 146, "error", 1, 0
recentErrorCode0= scalar, U16, 148, "error", 1, 0
recentErrorCode1= scalar, U16, 150, "error", 1, 0
recentErrorCode2= scalar, U16, 152, "error", 1, 0
recentErrorCode3= scalar, U16, 154, "error", 1, 0
recentErrorCode4= scalar, U16, 156, "error", 1, 0
recentErrorCode5= scalar, U16, 158, "error", 1, 0
recentErrorCode6= scalar, U16, 160, "error", 1, 0
recentErrorCode7= scalar, U16, 162, "error", 1, 0
totalTriggerErrorCounter=scalar,U32, 140,"counter", 1, 0
; orderingErrorCounter 144
warningCounter = scalar, U16, 148, "count", 1, 0
lastErrorCode = scalar, U16, 150, "error", 1, 0
recentErrorCode0= scalar, U16, 152, "error", 1, 0
recentErrorCode1= scalar, U16, 154, "error", 1, 0
recentErrorCode2= scalar, U16, 156, "error", 1, 0
recentErrorCode3= scalar, U16, 158, "error", 1, 0
recentErrorCode4= scalar, U16, 160, "error", 1, 0
recentErrorCode5= scalar, U16, 162, "error", 1, 0
recentErrorCode6= scalar, U16, 164, "error", 1, 0
recentErrorCode7= scalar, U16, 166, "error", 1, 0
; Debug
debugFloatField1= scalar, F32, 164, "val", 1, 0.0
debugFloatField2= scalar, F32, 168, "val", 1, 0.0
debugFloatField3= scalar, F32, 172, "val", 1, 0.0
debugFloatField4= scalar, F32, 176, "val", 1, 0.0
debugFloatField5= scalar, F32, 180, "val", 1, 0.0
debugFloatField6= scalar, F32, 184, "val", 1, 0.0
debugFloatField7= scalar, F32, 188, "val", 1, 0.0
debugIntField1 = scalar, S32, 192, "val", 1, 0.0
debugIntField2 = scalar, S32, 196, "val", 1, 0.0
debugIntField3 = scalar, S32, 200, "val", 1, 0.0
debugIntField4 = scalar, S16, 204, "val", 1, 0.0
debugIntField5 = scalar, S16, 206, "val", 1, 0.0
debugFloatField1= scalar, F32, 168, "val", 1, 0.0
debugFloatField2= scalar, F32, 172, "val", 1, 0.0
debugFloatField3= scalar, F32, 176, "val", 1, 0.0
debugFloatField4= scalar, F32, 180, "val", 1, 0.0
debugFloatField5= scalar, F32, 184, "val", 1, 0.0
debugFloatField6= scalar, F32, 188, "val", 1, 0.0
debugFloatField7= scalar, F32, 192, "val", 1, 0.0
debugIntField1 = scalar, S32, 196, "val", 1, 0.0
debugIntField2 = scalar, S32, 200, "val", 1, 0.0
debugIntField3 = scalar, S32, 204, "val", 1, 0.0
debugIntField4 = scalar, S16, 208, "val", 1, 0.0
debugIntField5 = scalar, S16, 210, "val", 1, 0.0
; Accel
accelerationX = scalar, S16, 208, "G", 0.01, 0
accelerationY = scalar, S16, 210, "G", 0.01, 0
accelerationX = scalar, S16, 212, "G", 0.01, 0
accelerationY = scalar, S16, 214, "G", 0.01, 0
; egt
egt1 = scalar, S16, 212, "deg C", 1, 0
egt2 = scalar, S16, 214, "deg C", 1, 0
egt3 = scalar, S16, 216, "deg C", 1, 0
egt4 = scalar, S16, 218, "deg C", 1, 0
egt5 = scalar, S16, 220, "deg C", 1, 0
egt6 = scalar, S16, 222, "deg C", 1, 0
egt7 = scalar, S16, 224, "deg C", 1, 0
egt8 = scalar, S16, 226, "deg C", 1, 0
egt1 = scalar, S16, 216, "deg C", 1, 0
egt2 = scalar, S16, 218, "deg C", 1, 0
egt3 = scalar, S16, 220, "deg C", 1, 0
egt4 = scalar, S16, 222, "deg C", 1, 0
egt5 = scalar, S16, 224, "deg C", 1, 0
egt6 = scalar, S16, 226, "deg C", 1, 0
egt7 = scalar, S16, 228, "deg C", 1, 0
egt8 = scalar, S16, 230, "deg C", 1, 0
TPS2Value = scalar, S16, 228, "%",{1/@@PACK_MULT_PERCENT@@}, 0
TPS2Value = scalar, S16, 232, "%",{1/@@PACK_MULT_PERCENT@@}, 0
rawTps1Primary = scalar, U16, 230, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawPpsPrimary = scalar, U16, 232, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawClt = scalar, U16, 234, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawIat = scalar, U16, 236, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawOilPressure = scalar, U16, 238, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawTps1Primary = scalar, U16, 234, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawPpsPrimary = scalar, U16, 236, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawClt = scalar, U16, 238, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawIat = scalar, U16, 240, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
rawOilPressure = scalar, U16, 242, "V",{1/@@PACK_MULT_VOLTAGE@@}, 0.0
; we use this to match logs to tunes
tuneCrc16= scalar, U16, 240, "crc16", 1, 0
tuneCrc16= scalar, U16, 244, "crc16", 1, 0
;
; see TunerStudioOutputChannels struct

View File

@ -93,26 +93,26 @@ public enum Sensor {
FIRMWARE_VERSION(GAUGE_NAME_VERSION, SensorCategory.OPERATIONS, FieldType.INT, 120, 1, 0, 100, "version_f"),
TS_CONFIG_VERSION(".ini version", SensorCategory.OPERATIONS, FieldType.INT, 124),
engineMakeCodeNameCrc16("engine crc16", SensorCategory.STATUS, FieldType.UINT16, 134, 0, 5),
engineMakeCodeNameCrc16("engine crc16", SensorCategory.STATUS, FieldType.UINT16, 138, 0, 5),
// Errors
totalTriggerErrorCounter(GAUGE_NAME_TRG_ERR, SensorCategory.STATUS, FieldType.INT, 136, 0, 5),
lastErrorCode("last error", SensorCategory.STATUS, FieldType.INT, 138, 0, 5),
totalTriggerErrorCounter(GAUGE_NAME_TRG_ERR, SensorCategory.STATUS, FieldType.INT, 140, 0, 5),
lastErrorCode("last error", SensorCategory.STATUS, FieldType.INT, 150, 0, 5),
// Debug
debugFloatField1(GAUGE_NAME_DEBUG_F1, SensorCategory.DEBUG, FieldType.FLOAT, 156, 0, 5),
debugFloatField2(GAUGE_NAME_DEBUG_F2, SensorCategory.DEBUG, FieldType.FLOAT, 160, 0, 5),
debugFloatField3(GAUGE_NAME_DEBUG_F3, SensorCategory.DEBUG, FieldType.FLOAT, 164, 0, 5),
debugFloatField4(GAUGE_NAME_DEBUG_F4, SensorCategory.DEBUG, FieldType.FLOAT, 168, 0, 5),
debugFloatField5(GAUGE_NAME_DEBUG_F5, SensorCategory.DEBUG, FieldType.FLOAT, 172, 0, 5),
debugFloatField6(GAUGE_NAME_DEBUG_F6, SensorCategory.DEBUG, FieldType.FLOAT, 176, 0, 5),
debugFloatField7(GAUGE_NAME_DEBUG_F7, SensorCategory.DEBUG, FieldType.FLOAT, 180, 0, 5),
debugIntField1(GAUGE_NAME_DEBUG_I1, SensorCategory.DEBUG, FieldType.INT, 184, 0, 5),
debugIntField2(GAUGE_NAME_DEBUG_I2, SensorCategory.DEBUG, FieldType.INT, 188, 0, 5),
debugIntField3(GAUGE_NAME_DEBUG_I3, SensorCategory.DEBUG, FieldType.INT, 192, 0, 5),
debugIntField4("debug i4", SensorCategory.DEBUG, FieldType.INT16, 196, 0, 5),
debugIntField5("debug i5", SensorCategory.DEBUG, FieldType.INT16, 198, 0, 5),
debugFloatField1(GAUGE_NAME_DEBUG_F1, SensorCategory.DEBUG, FieldType.FLOAT, 168, 0, 5),
debugFloatField2(GAUGE_NAME_DEBUG_F2, SensorCategory.DEBUG, FieldType.FLOAT, 172, 0, 5),
debugFloatField3(GAUGE_NAME_DEBUG_F3, SensorCategory.DEBUG, FieldType.FLOAT, 176, 0, 5),
debugFloatField4(GAUGE_NAME_DEBUG_F4, SensorCategory.DEBUG, FieldType.FLOAT, 180, 0, 5),
debugFloatField5(GAUGE_NAME_DEBUG_F5, SensorCategory.DEBUG, FieldType.FLOAT, 184, 0, 5),
debugFloatField6(GAUGE_NAME_DEBUG_F6, SensorCategory.DEBUG, FieldType.FLOAT, 188, 0, 5),
debugFloatField7(GAUGE_NAME_DEBUG_F7, SensorCategory.DEBUG, FieldType.FLOAT, 192, 0, 5),
debugIntField1(GAUGE_NAME_DEBUG_I1, SensorCategory.DEBUG, FieldType.INT, 196, 0, 5),
debugIntField2(GAUGE_NAME_DEBUG_I2, SensorCategory.DEBUG, FieldType.INT, 200, 0, 5),
debugIntField3(GAUGE_NAME_DEBUG_I3, SensorCategory.DEBUG, FieldType.INT, 204, 0, 5),
debugIntField4("debug i4", SensorCategory.DEBUG, FieldType.INT16, 208, 0, 5),
debugIntField5("debug i5", SensorCategory.DEBUG, FieldType.INT16, 210, 0, 5),
tuneCrc16("tune crc16", SensorCategory.STATUS, FieldType.UINT16, 240, 0, 5),
tuneCrc16("tune crc16", SensorCategory.STATUS, FieldType.UINT16, 244, 0, 5),
// Synthetic (console only) channels
ETB_CONTROL_QUALITY("ETB metric", SensorCategory.SNIFFING, "", 100),