Add DBG_FSIO_ADC (#505)

This commit is contained in:
andreika-git 2017-12-03 14:42:44 +02:00 committed by rusefi
parent 306a450568
commit 53b3ebbc90
3 changed files with 39 additions and 24 deletions

View File

@ -725,10 +725,6 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
#endif /* EFI_ANALOG_SENSORS */ #endif /* EFI_ANALOG_SENSORS */
tsOutputChannels->engineLoad = engineLoad; tsOutputChannels->engineLoad = engineLoad;
if (engineConfiguration->debugMode == DBG_TRIGGER_INPUT) {
tsOutputChannels->debugFloatField4 = engine->rpmCalculator.getRpmAcceleration();
}
tsOutputChannels->triggerErrorsCounter = engine->triggerCentral.triggerState.totalTriggerErrorCounter; tsOutputChannels->triggerErrorsCounter = engine->triggerCentral.triggerState.totalTriggerErrorCounter;
tsOutputChannels->baroCorrection = engine->engineState.baroCorrection; tsOutputChannels->baroCorrection = engine->engineState.baroCorrection;
tsOutputChannels->pedalPosition = hasPedalPositionSensor(PASS_ENGINE_PARAMETER_SIGNATURE) ? getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE) : 0; tsOutputChannels->pedalPosition = hasPedalPositionSensor(PASS_ENGINE_PARAMETER_SIGNATURE) ? getPedalPosition(PASS_ENGINE_PARAMETER_SIGNATURE) : 0;
@ -755,19 +751,22 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->isWarnNow = isWarningNow(now, true); tsOutputChannels->isWarnNow = isWarningNow(now, true);
tsOutputChannels->isCltBroken = engine->isCltBroken; tsOutputChannels->isCltBroken = engine->isCltBroken;
if (engineConfiguration->debugMode == DBG_TPS_ACCEL) { switch (engineConfiguration->debugMode) {
case DBG_TPS_ACCEL:
tsOutputChannels->debugIntField1 = engine->tpsAccelEnrichment.cb.getSize(); tsOutputChannels->debugIntField1 = engine->tpsAccelEnrichment.cb.getSize();
} else if (engineConfiguration->debugMode == DBG_SR5_PROTOCOL) { break;
int _10_6 = 100000; case DBG_SR5_PROTOCOL: {
const int _10_6 = 100000;
tsOutputChannels->debugIntField1 = tsState.textCommandCounter * _10_6 + tsState.totalCounter; tsOutputChannels->debugIntField1 = tsState.textCommandCounter * _10_6 + tsState.totalCounter;
tsOutputChannels->debugIntField2 = tsState.outputChannelsCommandCounter * _10_6 + tsState.writeValueCommandCounter; tsOutputChannels->debugIntField2 = tsState.outputChannelsCommandCounter * _10_6 + tsState.writeValueCommandCounter;
tsOutputChannels->debugIntField3 = tsState.readPageCommandsCounter * _10_6 + tsState.burnCommandCounter; tsOutputChannels->debugIntField3 = tsState.readPageCommandsCounter * _10_6 + tsState.burnCommandCounter;
} else if (engineConfiguration->debugMode == DBG__AUX_VALVES) { break;
}
case DBG_AUX_VALVES:
tsOutputChannels->debugFloatField1 = engine->engineState.auxValveStart; tsOutputChannels->debugFloatField1 = engine->engineState.auxValveStart;
tsOutputChannels->debugFloatField2 = engine->engineState.auxValveEnd; tsOutputChannels->debugFloatField2 = engine->engineState.auxValveEnd;
} break;
case DBG_TRIGGER_INPUT:
if (engineConfiguration->debugMode == DBG_TRIGGER_INPUT) {
tsOutputChannels->debugIntField1 = engine->triggerCentral.getHwEventCounter((int)SHAFT_PRIMARY_FALLING); tsOutputChannels->debugIntField1 = engine->triggerCentral.getHwEventCounter((int)SHAFT_PRIMARY_FALLING);
tsOutputChannels->debugIntField2 = engine->triggerCentral.getHwEventCounter((int)SHAFT_SECONDARY_FALLING); tsOutputChannels->debugIntField2 = engine->triggerCentral.getHwEventCounter((int)SHAFT_SECONDARY_FALLING);
tsOutputChannels->debugIntField3 = engine->triggerCentral.getHwEventCounter((int)SHAFT_3RD_FALLING); tsOutputChannels->debugIntField3 = engine->triggerCentral.getHwEventCounter((int)SHAFT_3RD_FALLING);
@ -775,28 +774,42 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_
tsOutputChannels->debugFloatField1 = engine->triggerCentral.getHwEventCounter((int)SHAFT_PRIMARY_RISING); tsOutputChannels->debugFloatField1 = engine->triggerCentral.getHwEventCounter((int)SHAFT_PRIMARY_RISING);
tsOutputChannels->debugFloatField2 = engine->triggerCentral.getHwEventCounter((int)SHAFT_SECONDARY_RISING); tsOutputChannels->debugFloatField2 = engine->triggerCentral.getHwEventCounter((int)SHAFT_SECONDARY_RISING);
tsOutputChannels->debugFloatField3 = engine->triggerCentral.getHwEventCounter((int)SHAFT_3RD_RISING); tsOutputChannels->debugFloatField3 = engine->triggerCentral.getHwEventCounter((int)SHAFT_3RD_RISING);
tsOutputChannels->debugFloatField4 = engine->rpmCalculator.getRpmAcceleration();
} else if (engineConfiguration->debugMode == DBG_FSIO_ADC) { break;
case DBG_FSIO_ADC:
// todo: implement a proper loop // todo: implement a proper loop
if (engineConfiguration->fsioAdc[0] != EFI_ADC_NONE) { if (engineConfiguration->fsioAdc[0] != EFI_ADC_NONE) {
strcpy(buf, "adcX"); strcpy(buf, "adcX");
tsOutputChannels->debugFloatField1 = getVoltage("fsio", engineConfiguration->fsioAdc[0]); tsOutputChannels->debugFloatField1 = getVoltage("fsio", engineConfiguration->fsioAdc[0]);
} }
} else if (engineConfiguration->debugMode == DBG_VEHICLE_SPEED_SENSOR) { break;
case DBG_VEHICLE_SPEED_SENSOR:
tsOutputChannels->debugIntField1 = engine->engineState.vssEventCounter; tsOutputChannels->debugIntField1 = engine->engineState.vssEventCounter;
} else if (engineConfiguration->debugMode == DBG_SD_CARD) { break;
case DBG_SD_CARD:
tsOutputChannels->debugIntField1 = engine->engineState.totalLoggedBytes; tsOutputChannels->debugIntField1 = engine->engineState.totalLoggedBytes;
} else if (engineConfiguration->debugMode == DBG_CRANKING_DETAILS) { break;
case DBG_CRANKING_DETAILS:
tsOutputChannels->debugIntField1 = engine->rpmCalculator.getRevolutionCounterSinceStart(); tsOutputChannels->debugIntField1 = engine->rpmCalculator.getRevolutionCounterSinceStart();
} break;
#if EFI_HIP_9011 || defined(__DOXYGEN__) #if EFI_HIP_9011 || defined(__DOXYGEN__)
if (engineConfiguration->debugMode == DBG_KNOCK) { case DBG_KNOCK:
tsOutputChannels->debugIntField1 = correctResponsesCount; tsOutputChannels->debugIntField1 = correctResponsesCount;
tsOutputChannels->debugIntField2 = invalidResponsesCount; tsOutputChannels->debugIntField2 = invalidResponsesCount;
} break;
#endif /* EFI_HIP_9011 */ #endif /* EFI_HIP_9011 */
case DBG_ADC:
tsOutputChannels->debugFloatField1 = (engineConfiguration->vbattAdcChannel != EFI_ADC_NONE) ? getVoltageDivided("vbatt", engineConfiguration->vbattAdcChannel) : 0.0f;
tsOutputChannels->debugFloatField2 = (engineConfiguration->tpsAdcChannel != EFI_ADC_NONE) ? getVoltageDivided("tps", engineConfiguration->tpsAdcChannel) : 0.0f;
tsOutputChannels->debugFloatField3 = (engineConfiguration->mafAdcChannel != EFI_ADC_NONE) ? getVoltageDivided("maf", engineConfiguration->mafAdcChannel) : 0.0f;
tsOutputChannels->debugFloatField4 = (engineConfiguration->map.sensor.hwChannel != EFI_ADC_NONE) ? getVoltageDivided("map", engineConfiguration->map.sensor.hwChannel) : 0.0f;
tsOutputChannels->debugFloatField5 = (engineConfiguration->clt.adcChannel != EFI_ADC_NONE) ? getVoltageDivided("clt", engineConfiguration->clt.adcChannel) : 0.0f;
tsOutputChannels->debugFloatField6 = (engineConfiguration->iat.adcChannel != EFI_ADC_NONE) ? getVoltageDivided("iat", engineConfiguration->iat.adcChannel) : 0.0f;
tsOutputChannels->debugFloatField7 = (engineConfiguration->afr.hwChannel != EFI_ADC_NONE) ? getVoltageDivided("ego", engineConfiguration->afr.hwChannel) : 0.0f;
break;
default:
;
}
tsOutputChannels->wallFuelAmount = ENGINE(wallFuel).getWallFuel(0); tsOutputChannels->wallFuelAmount = ENGINE(wallFuel).getWallFuel(0);
tsOutputChannels->wallFuelCorrection = ENGINE(wallFuelCorrection); tsOutputChannels->wallFuelCorrection = ENGINE(wallFuelCorrection);

View File

@ -723,9 +723,11 @@ typedef enum {
DBG_ELECTRONIC_THROTTLE = 17, DBG_ELECTRONIC_THROTTLE = 17,
DBG_EXECUTOR = 18, DBG_EXECUTOR = 18,
DBG_BENCH_TEST = 19, DBG_BENCH_TEST = 19,
DBG__AUX_VALVES = 20, DBG_AUX_VALVES = 20,
DBG__21 = 21, DBG_ADC = 21,
DBG__22 = 22, DBG__22 = 22,
DBG__23 = 23,
Force_4b_debug_mode_e = ENUM_32_BITS, Force_4b_debug_mode_e = ENUM_32_BITS,
} debug_mode_e; } debug_mode_e;

View File

@ -142,7 +142,7 @@ 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 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 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", "sr5", "Knock", "Trigger Sync", "Electronic Throttle", "Executor", "mode19", "mode20", "mode21", "mode22", "mode23", "mode24", "mode25" #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", "Trigger Sync", "Electronic Throttle", "Executor", "Bench Test", "Aux Valves", "ADC", "mode22", "mode23", "mode24", "mode25"
custom debug_mode_e 4 bits, U32, @OFFSET@, [0:4], @@debug_mode_e_enum@@ 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" #define vvt_mode_e_enum "First half", "Second half", "2GZ", "Miata NB2", "mode4", "mode5", "mode6", "mode7"