knock sensor debug status
This commit is contained in:
parent
c803cf6f77
commit
c356d916e3
|
@ -661,6 +661,11 @@ static void lcdThread(void *arg) {
|
|||
}
|
||||
}
|
||||
|
||||
#if EFI_HIP_9011 || defined(__DOXYGEN__)
|
||||
extern int correctResponsesCount;
|
||||
extern int invalidResponsesCount;
|
||||
#endif /* EFI_HIP_9011 */
|
||||
|
||||
#if EFI_TUNER_STUDIO || defined(__DOXYGEN__)
|
||||
|
||||
void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ENGINE_PARAMETER_S) {
|
||||
|
@ -761,6 +766,13 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
|
|||
tsOutputChannels->debugIntField1 = engine->rpmCalculator.getRevolutionCounterSinceStart();
|
||||
}
|
||||
|
||||
#if EFI_HIP_9011 || defined(__DOXYGEN__)
|
||||
if (engineConfiguration->debugMode == DBG_KNOCK) {
|
||||
tsOutputChannels->debugIntField1 = correctResponsesCount;
|
||||
tsOutputChannels->debugIntField2 = invalidResponsesCount;
|
||||
}
|
||||
#endif /* EFI_HIP_9011 */
|
||||
|
||||
|
||||
tsOutputChannels->wallFuelAmount = ENGINE(wallFuel).getWallFuel(0);
|
||||
tsOutputChannels->wallFuelCorrection = ENGINE(wallFuelCorrection);
|
||||
|
|
|
@ -676,6 +676,9 @@ typedef enum {
|
|||
DBG_TRIGGER_INPUT = 5,
|
||||
FSIO_ADC = 6,
|
||||
AUX_PID_1 = 7,
|
||||
/**
|
||||
* VVT position debugging - not VVT valve control
|
||||
*/
|
||||
DBG_VVT = 8,
|
||||
DBG_CRANKING_DETAILS = 9,
|
||||
DBG_IGNITION_TIMING = 10,
|
||||
|
@ -683,7 +686,7 @@ typedef enum {
|
|||
DBG_VEHICLE_SPEED_SENSOR = 12,
|
||||
DBG_SD_CARD = 13,
|
||||
DBG_SR5_PROTOCOL = 14,
|
||||
DM_15 = 15,
|
||||
DBG_KNOCK = 15,
|
||||
DM_16 = 16,
|
||||
DM_17 = 17,
|
||||
DM_18 = 18,
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
#define MAP_ACCEL_TAPER 8
|
||||
#define BARO_CORR_SIZE 4
|
||||
#define MAF_DECODING_COUNT 256
|
||||
#define debug_mode_e_enum "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "mode14", "mode15"
|
||||
#define debug_mode_e_enum "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "sr5", "Knock", "mode16", "mode17", "mode18", "mode19"
|
||||
#define vvt_mode_e_enum "First half", "Second half", "2GZ", "Miata NB2", "mode4", "mode5", "mode6", "mode7"
|
||||
#define mass_storage_e_enum "Auto", "Always", "Never"
|
||||
#define brain_input_pin_e_enum "INVALID", "PA1", "PA2", "PA3", "INVALID", "PA5", "PA6", "PA7", "PA8", "PA9", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PA15", "INVALID", "INVALID", "INVALID", "PB3", "PB4", "PB5", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PC6", "PC7", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "PE5", "PE6", "INVALID", "INVALID", "PE9", "INVALID", "PE11", "INVALID", "INVALID", "INVALID", "INVALID", "NONE", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID", "INVALID"
|
||||
|
|
|
@ -67,8 +67,8 @@ static float hipValueMax = 0;
|
|||
|
||||
static unsigned char tx_buff[1];
|
||||
static unsigned char rx_buff[1];
|
||||
static int correctResponse = 0;
|
||||
static int invalidResponse = 0;
|
||||
int correctResponsesCount = 0;
|
||||
int invalidResponsesCount = 0;
|
||||
static char pinNameBuffer[16];
|
||||
static float currentAngleWindowWidth;
|
||||
|
||||
|
@ -102,9 +102,9 @@ SPI_CR1_MSTR |
|
|||
|
||||
static void checkResponse(void) {
|
||||
if (tx_buff[0] == rx_buff[0]) {
|
||||
correctResponse++;
|
||||
correctResponsesCount++;
|
||||
} else {
|
||||
invalidResponse++;
|
||||
invalidResponsesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -152,12 +152,12 @@ static void showHipInfo(void) {
|
|||
currentIntergratorIndex, engineConfiguration->knockVThreshold,
|
||||
engine->knockCount, engineConfiguration->maxKnockSubDeg);
|
||||
|
||||
const char * msg = invalidResponse > 0 ? "NOT GOOD" : "ok";
|
||||
const char * msg = invalidResponsesCount > 0 ? "NOT GOOD" : "ok";
|
||||
scheduleMsg(logger, "spi=%s IntHold@%s/%d response count=%d incorrect response=%d %s",
|
||||
getSpi_device_e(hipSpiDevice),
|
||||
hwPortname(boardConfiguration->hip9011IntHoldPin),
|
||||
boardConfiguration->hip9011IntHoldPinMode,
|
||||
correctResponse, invalidResponse,
|
||||
correctResponsesCount, invalidResponsesCount,
|
||||
msg);
|
||||
scheduleMsg(logger, "CS@%s updateCount=%d", hwPortname(boardConfiguration->hip9011CsPin), settingUpdateCount);
|
||||
|
||||
|
@ -376,7 +376,7 @@ static void hipStartupCode(void) {
|
|||
|
||||
chThdSleepMilliseconds(10);
|
||||
|
||||
if (correctResponse == 0) {
|
||||
if (correctResponsesCount == 0) {
|
||||
warning(CUSTOM_OBD_KNOCK_PROCESSOR, "TPIC/HIP does not respond");
|
||||
}
|
||||
|
||||
|
@ -465,4 +465,4 @@ void initHip9011(Logging *sharedLogger) {
|
|||
chThdCreateStatic(hipTreadStack, sizeof(hipTreadStack), NORMALPRIO, (tfunc_t) hipThread, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif /* EFI_HIP_9011 */
|
||||
|
|
|
@ -113,8 +113,8 @@ float baseFuel;+Fuel squirt duration while cranking\nA number of curves adjust t
|
|||
int16_t rpm;+Cranking mode threshold. Special cranking logic controls fuel and spark while RPM is below this threshold\nset cranking_rpm X;"RPM", 1, 0, 0, 3000, 0
|
||||
end_struct
|
||||
|
||||
#define debug_mode_e_enum "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "mode14", "mode15"
|
||||
custom debug_mode_e 4 bits, U32, @OFFSET@, [0:3], @@debug_mode_e_enum@@
|
||||
#define debug_mode_e_enum "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "sr5", "Knock", "mode16", "mode17", "mode18", "mode19"
|
||||
custom debug_mode_e 4 bits, U32, @OFFSET@, [0:4], @@debug_mode_e_enum@@
|
||||
|
||||
#define vvt_mode_e_enum "First half", "Second half", "2GZ", "Miata NB2", "mode4", "mode5", "mode6", "mode7"
|
||||
custom vvt_mode_e 4 bits, U32, @OFFSET@, [0:2], @@vvt_mode_e_enum@@
|
||||
|
|
|
@ -44,7 +44,7 @@ enable2ndByteCanID = false
|
|||
|
||||
; see PAGE_0_SIZE in C source code
|
||||
; CONFIG_DEFINITION_START
|
||||
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Apr 08 15:54:48 EDT 2017
|
||||
; this section was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Apr 09 21:59:09 EDT 2017
|
||||
|
||||
pageSize = 16376
|
||||
page = 1
|
||||
|
@ -556,7 +556,7 @@ page = 1
|
|||
tpsDecelEnleanmentThreshold = scalar, F32, 2232, "roc", 1, 0, 0, 200, 3
|
||||
tpsDecelEnleanmentMultiplier = scalar, F32, 2236, "coeff", 1, 0, 0, 200, 3
|
||||
slowAdcAlpha = scalar, F32, 2240, "coeff", 1, 0, 0, 200, 3
|
||||
debugMode = bits, U32, 2244, [0:3], "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "mode14", "mode15"
|
||||
debugMode = bits, U32, 2244, [0:4], "Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "sr5", "Knock", "mode16", "mode17", "mode18", "mode19"
|
||||
warmupAfrPid_pFactor = scalar, F32, 2248, "value", 1, 0, -1000, 1000, 5
|
||||
warmupAfrPid_iFactor = scalar, F32, 2252, "value", 1, 0, -1000, 1000, 5
|
||||
warmupAfrPid_dFactor = scalar, F32, 2256, "value", 1, 0, -1000, 1000, 5
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.rusefi.config;
|
||||
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sat Apr 08 08:33:07 EDT 2017
|
||||
// this file was generated automatically by ConfigDefinition.jar based on rusefi_config.txt Sun Apr 09 21:59:09 EDT 2017
|
||||
public class Fields {
|
||||
public static final int LE_COMMAND_LENGTH = 200;
|
||||
public static final int FSIO_ADC_COUNT = 4;
|
||||
|
@ -1527,7 +1527,7 @@ public class Fields {
|
|||
public static final Field TPSDECELENLEANMENTTHRESHOLD = Field.create("TPSDECELENLEANMENTTHRESHOLD", 2232, FieldType.FLOAT);
|
||||
public static final Field TPSDECELENLEANMENTMULTIPLIER = Field.create("TPSDECELENLEANMENTMULTIPLIER", 2236, FieldType.FLOAT);
|
||||
public static final Field SLOWADCALPHA = Field.create("SLOWADCALPHA", 2240, FieldType.FLOAT);
|
||||
public static final String[] debug_mode_e = {"Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "mode14", "mode15"};
|
||||
public static final String[] debug_mode_e = {"Alternator_PID", "TPS accel enrich", "Warmup PID", "IDLE", "EL accl enrich", "Trigger Counters", "FSIO_ADC", "AUX_PID_1", "VVT PID", "Cranking", "Timing", "Closed-loop fuel corr", "VSS", "SD card", "sr5", "Knock", "mode16", "mode17", "mode18", "mode19"};
|
||||
public static final Field DEBUGMODE = Field.create("DEBUGMODE", 2244, FieldType.INT, debug_mode_e);
|
||||
public static final Field WARMUPAFRPID_PFACTOR = Field.create("WARMUPAFRPID_PFACTOR", 2248, FieldType.FLOAT);
|
||||
public static final Field WARMUPAFRPID_IFACTOR = Field.create("WARMUPAFRPID_IFACTOR", 2252, FieldType.FLOAT);
|
||||
|
|
Loading…
Reference in New Issue