clean up pretty useless console commands
This commit is contained in:
parent
d511ed9779
commit
c71ba44d61
|
@ -42,7 +42,6 @@ void setDodgeNeon1995EngineConfiguration() {
|
||||||
|
|
||||||
setWholeTimingTable_d(12);
|
setWholeTimingTable_d(12);
|
||||||
|
|
||||||
// set cranking_injection_mode 0
|
|
||||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||||
// set injection_mode 1
|
// set injection_mode 1
|
||||||
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
engineConfiguration->injectionMode = IM_SEQUENTIAL;
|
||||||
|
@ -89,7 +88,6 @@ void setDodgeNeon1995EngineConfiguration() {
|
||||||
|
|
||||||
engineConfiguration->mapErrorDetectionTooHigh = 120;
|
engineConfiguration->mapErrorDetectionTooHigh = 120;
|
||||||
|
|
||||||
// set injection_pin_mode 0
|
|
||||||
engineConfiguration->injectionPinMode = OM_DEFAULT;
|
engineConfiguration->injectionPinMode = OM_DEFAULT;
|
||||||
|
|
||||||
// Frankenstein: high side #1: PE8
|
// Frankenstein: high side #1: PE8
|
||||||
|
@ -99,7 +97,6 @@ void setDodgeNeon1995EngineConfiguration() {
|
||||||
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
engineConfiguration->ignitionPins[1] = Gpio::Unassigned;
|
||||||
engineConfiguration->ignitionPins[2] = Gpio::E10; // // Frankenstein: high side #2
|
engineConfiguration->ignitionPins[2] = Gpio::E10; // // Frankenstein: high side #2
|
||||||
|
|
||||||
// set ignition_pin_mode 0
|
|
||||||
engineConfiguration->ignitionPinMode = OM_DEFAULT;
|
engineConfiguration->ignitionPinMode = OM_DEFAULT;
|
||||||
|
|
||||||
engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700};
|
engineConfiguration->clt.config = {0, 30, 100, 32500, 7550, 700, 2700};
|
||||||
|
|
|
@ -114,7 +114,6 @@ void common079721_2351() {
|
||||||
|
|
||||||
engineConfiguration->fuelPumpPin = Gpio::Unassigned; // fuel pump is not controlled by ECU on this engine
|
engineConfiguration->fuelPumpPin = Gpio::Unassigned; // fuel pump is not controlled by ECU on this engine
|
||||||
|
|
||||||
// set cranking_injection_mode 0
|
|
||||||
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
engineConfiguration->crankingInjectionMode = IM_SIMULTANEOUS;
|
||||||
// set injection_mode 2
|
// set injection_mode 2
|
||||||
engineConfiguration->injectionMode = IM_BATCH;
|
engineConfiguration->injectionMode = IM_BATCH;
|
||||||
|
|
|
@ -81,29 +81,11 @@ void AlternatorController::onFastCallback() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void showAltInfo(void) {
|
|
||||||
efiPrintf("alt=%s @%s t=%dms", boolToString(engineConfiguration->isAlternatorControlEnabled),
|
|
||||||
hwPortname(engineConfiguration->alternatorControlPin),
|
|
||||||
engineConfiguration->alternatorControl.periodMs);
|
|
||||||
efiPrintf("p=%.2f/i=%.2f/d=%.2f offset=%.2f", engineConfiguration->alternatorControl.pFactor,
|
|
||||||
0, 0, engineConfiguration->alternatorControl.offset); // todo: i & d
|
|
||||||
efiPrintf("vbatt=%.2f/duty=%.2f/target=%.2f", Sensor::getOrZero(SensorType::BatteryVoltage), currentAltDuty,
|
|
||||||
engineConfiguration->targetVBatt);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setAltPFactor(float p) {
|
|
||||||
engineConfiguration->alternatorControl.pFactor = p;
|
|
||||||
efiPrintf("setAltPid: %.2f", p);
|
|
||||||
pidReset();
|
|
||||||
showAltInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousConfiguration) {
|
void onConfigurationChangeAlternatorCallback(engine_configuration_s *previousConfiguration) {
|
||||||
shouldResetPid = !alternatorPid.isSame(&previousConfiguration->alternatorControl);
|
shouldResetPid = !alternatorPid.isSame(&previousConfiguration->alternatorControl);
|
||||||
}
|
}
|
||||||
|
|
||||||
void initAlternatorCtrl() {
|
void initAlternatorCtrl() {
|
||||||
addConsoleAction("altinfo", showAltInfo);
|
|
||||||
if (!isBrainPinValid(engineConfiguration->alternatorControlPin))
|
if (!isBrainPinValid(engineConfiguration->alternatorControlPin))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,6 @@
|
||||||
|
|
||||||
void initAlternatorCtrl();
|
void initAlternatorCtrl();
|
||||||
|
|
||||||
void setAltPFactor(float p);
|
|
||||||
void setAltIFactor(float p);
|
|
||||||
void setAltDFactor(float p);
|
|
||||||
void showAltInfo(void);
|
|
||||||
|
|
||||||
class AlternatorController : public EngineModule {
|
class AlternatorController : public EngineModule {
|
||||||
public:
|
public:
|
||||||
void onFastCallback() override;
|
void onFastCallback() override;
|
||||||
|
|
|
@ -30,11 +30,6 @@
|
||||||
* set debug_mode 17
|
* set debug_mode 17
|
||||||
* for PID outputs
|
* for PID outputs
|
||||||
*
|
*
|
||||||
* set etb_p X
|
|
||||||
* set etb_i X
|
|
||||||
* set etb_d X
|
|
||||||
* set etb_o X
|
|
||||||
*
|
|
||||||
* set_etb_duty X
|
* set_etb_duty X
|
||||||
*
|
*
|
||||||
* http://rusefi.com/forum/viewtopic.php?f=5&t=592
|
* http://rusefi.com/forum/viewtopic.php?f=5&t=592
|
||||||
|
@ -783,31 +778,6 @@ static DcThread dcThread CCM_OPTIONAL;
|
||||||
|
|
||||||
#endif // EFI_UNIT_TEST
|
#endif // EFI_UNIT_TEST
|
||||||
|
|
||||||
static void showEtbInfo() {
|
|
||||||
#if EFI_PROD_CODE
|
|
||||||
efiPrintf("etbAutoTune=%d", engine->etbAutoTune);
|
|
||||||
|
|
||||||
efiPrintf("TPS=%.2f", Sensor::getOrZero(SensorType::Tps1));
|
|
||||||
|
|
||||||
efiPrintf("ETB1 duty=%.2f freq=%d",
|
|
||||||
engine->outputChannels.etb1DutyCycle,
|
|
||||||
engineConfiguration->etbFreq);
|
|
||||||
|
|
||||||
efiPrintf("ETB freq=%d",
|
|
||||||
engineConfiguration->etbFreq);
|
|
||||||
|
|
||||||
for (int i = 0; i < ETB_COUNT; i++) {
|
|
||||||
efiPrintf("ETB%d", i);
|
|
||||||
efiPrintf(" dir1=%s", hwPortname(engineConfiguration->etbIo[i].directionPin1));
|
|
||||||
efiPrintf(" dir2=%s", hwPortname(engineConfiguration->etbIo[i].directionPin2));
|
|
||||||
efiPrintf(" control=%s", hwPortname(engineConfiguration->etbIo[i].controlPin));
|
|
||||||
efiPrintf(" disable=%s", hwPortname(engineConfiguration->etbIo[i].disablePin));
|
|
||||||
showDcMotorInfo(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* EFI_PROD_CODE */
|
|
||||||
}
|
|
||||||
|
|
||||||
void etbPidReset() {
|
void etbPidReset() {
|
||||||
for (int i = 0 ; i < ETB_COUNT; i++) {
|
for (int i = 0 ; i < ETB_COUNT; i++) {
|
||||||
if (auto controller = engine->etbControllers[i]) {
|
if (auto controller = engine->etbControllers[i]) {
|
||||||
|
@ -858,42 +828,6 @@ static void etbReset() {
|
||||||
}
|
}
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
/**
|
|
||||||
* set etb_p X
|
|
||||||
*/
|
|
||||||
void setEtbPFactor(float value) {
|
|
||||||
engineConfiguration->etb.pFactor = value;
|
|
||||||
etbPidReset();
|
|
||||||
showEtbInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set etb_i X
|
|
||||||
*/
|
|
||||||
void setEtbIFactor(float value) {
|
|
||||||
engineConfiguration->etb.iFactor = value;
|
|
||||||
etbPidReset();
|
|
||||||
showEtbInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set etb_d X
|
|
||||||
*/
|
|
||||||
void setEtbDFactor(float value) {
|
|
||||||
engineConfiguration->etb.dFactor = value;
|
|
||||||
etbPidReset();
|
|
||||||
showEtbInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* set etb_o X
|
|
||||||
*/
|
|
||||||
void setEtbOffset(int value) {
|
|
||||||
engineConfiguration->etb.offset = value;
|
|
||||||
etbPidReset();
|
|
||||||
showEtbInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void etbAutocal(size_t throttleIndex) {
|
void etbAutocal(size_t throttleIndex) {
|
||||||
if (throttleIndex >= ETB_COUNT) {
|
if (throttleIndex >= ETB_COUNT) {
|
||||||
return;
|
return;
|
||||||
|
@ -1076,7 +1010,6 @@ void initElectronicThrottle() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
addConsoleAction("etbinfo", showEtbInfo);
|
|
||||||
addConsoleAction("etbreset", etbReset);
|
addConsoleAction("etbreset", etbReset);
|
||||||
addConsoleActionI("etb_freq", setEtbFrequency);
|
addConsoleActionI("etb_freq", setEtbFrequency);
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,6 @@ void setBoschVAGETB();
|
||||||
void setDefaultEtbBiasCurve();
|
void setDefaultEtbBiasCurve();
|
||||||
void setDefaultEtbParameters();
|
void setDefaultEtbParameters();
|
||||||
void setBoschVNH2SP30Curve();
|
void setBoschVNH2SP30Curve();
|
||||||
void setEtbPFactor(float value);
|
|
||||||
void setEtbIFactor(float value);
|
|
||||||
void setEtbDFactor(float value);
|
|
||||||
void setEtbOffset(int value);
|
|
||||||
void setThrottleDutyCycle(percent_t level);
|
void setThrottleDutyCycle(percent_t level);
|
||||||
void onConfigurationChangeElectronicThrottleCallback(engine_configuration_s *previousConfiguration);
|
void onConfigurationChangeElectronicThrottleCallback(engine_configuration_s *previousConfiguration);
|
||||||
void unregisterEtbPins();
|
void unregisterEtbPins();
|
||||||
|
|
|
@ -97,9 +97,6 @@ void setManualIdleValvePosition(int positionPercent);
|
||||||
void startIdleThread();
|
void startIdleThread();
|
||||||
void setDefaultIdleParameters();
|
void setDefaultIdleParameters();
|
||||||
void startIdleBench(void);
|
void startIdleBench(void);
|
||||||
void setIdlePFactor(float value);
|
|
||||||
void setIdleIFactor(float value);
|
|
||||||
void setIdleDFactor(float value);
|
|
||||||
void setIdleMode(idle_mode_e value);
|
void setIdleMode(idle_mode_e value);
|
||||||
void setTargetIdleRpm(int value);
|
void setTargetIdleRpm(int value);
|
||||||
void startPedalPins();
|
void startPedalPins();
|
||||||
|
|
|
@ -146,24 +146,6 @@ void setTargetIdleRpm(int value) {
|
||||||
showIdleInfo();
|
showIdleInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
void setIdlePFactor(float value) {
|
|
||||||
engineConfiguration->idleRpmPid.pFactor = value;
|
|
||||||
applyPidSettings();
|
|
||||||
showIdleInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setIdleIFactor(float value) {
|
|
||||||
engineConfiguration->idleRpmPid.iFactor = value;
|
|
||||||
applyPidSettings();
|
|
||||||
showIdleInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
void setIdleDFactor(float value) {
|
|
||||||
engineConfiguration->idleRpmPid.dFactor = value;
|
|
||||||
applyPidSettings();
|
|
||||||
showIdleInfo();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Idle test would activate the solenoid for three seconds
|
* Idle test would activate the solenoid for three seconds
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -199,26 +199,16 @@ TpsAccelEnrichment::TpsAccelEnrichment() {
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
|
|
||||||
static void accelInfo() {
|
|
||||||
// efiPrintf("TPS accel length=%d", tpsInstance.cb.getSize());
|
|
||||||
efiPrintf("TPS accel th=%.2f/mult=%.2f", engineConfiguration->tpsAccelEnrichmentThreshold, -1);
|
|
||||||
|
|
||||||
efiPrintf("beta=%.2f/tau=%.2f", engineConfiguration->wwaeBeta, engineConfiguration->wwaeTau);
|
|
||||||
}
|
|
||||||
|
|
||||||
void setTpsAccelThr(float value) {
|
void setTpsAccelThr(float value) {
|
||||||
engineConfiguration->tpsAccelEnrichmentThreshold = value;
|
engineConfiguration->tpsAccelEnrichmentThreshold = value;
|
||||||
accelInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTpsDecelThr(float value) {
|
void setTpsDecelThr(float value) {
|
||||||
engineConfiguration->tpsDecelEnleanmentThreshold = value;
|
engineConfiguration->tpsDecelEnleanmentThreshold = value;
|
||||||
accelInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTpsDecelMult(float value) {
|
void setTpsDecelMult(float value) {
|
||||||
engineConfiguration->tpsDecelEnleanmentMultiplier = value;
|
engineConfiguration->tpsDecelEnleanmentMultiplier = value;
|
||||||
accelInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTpsAccelLen(int length) {
|
void setTpsAccelLen(int length) {
|
||||||
|
@ -227,7 +217,6 @@ void setTpsAccelLen(int length) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
engine->tpsAccelEnrichment.setLength(length);
|
engine->tpsAccelEnrichment.setLength(length);
|
||||||
accelInfo();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateAccelParameters() {
|
void updateAccelParameters() {
|
||||||
|
@ -243,8 +232,6 @@ void initAccelEnrichment() {
|
||||||
|
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
|
|
||||||
addConsoleAction("accelinfo", accelInfo);
|
|
||||||
|
|
||||||
updateAccelParameters();
|
updateAccelParameters();
|
||||||
#endif /* ! EFI_UNIT_TEST */
|
#endif /* ! EFI_UNIT_TEST */
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,17 +5,13 @@
|
||||||
|
|
||||||
void grabTPSIsClosed() {
|
void grabTPSIsClosed() {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
printTPSInfo();
|
|
||||||
engineConfiguration->tpsMin = convertVoltageTo10bitADC(Sensor::getRaw(SensorType::Tps1));
|
engineConfiguration->tpsMin = convertVoltageTo10bitADC(Sensor::getRaw(SensorType::Tps1));
|
||||||
printTPSInfo();
|
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
void grabTPSIsWideOpen() {
|
void grabTPSIsWideOpen() {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
printTPSInfo();
|
|
||||||
engineConfiguration->tpsMax = convertVoltageTo10bitADC(Sensor::getRaw(SensorType::Tps1));
|
engineConfiguration->tpsMax = convertVoltageTo10bitADC(Sensor::getRaw(SensorType::Tps1));
|
||||||
printTPSInfo();
|
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,8 +13,6 @@
|
||||||
#include "eficonsole.h"
|
#include "eficonsole.h"
|
||||||
#include "trigger_decoder.h"
|
#include "trigger_decoder.h"
|
||||||
#include "console_io.h"
|
#include "console_io.h"
|
||||||
#include "idle_thread.h"
|
|
||||||
#include "alternator_controller.h"
|
|
||||||
#include "trigger_emulator_algo.h"
|
#include "trigger_emulator_algo.h"
|
||||||
#include "value_lookup.h"
|
#include "value_lookup.h"
|
||||||
#if EFI_RTC
|
#if EFI_RTC
|
||||||
|
@ -41,118 +39,8 @@ extern int waveChartUsedSize;
|
||||||
extern WaveChart waveChart;
|
extern WaveChart waveChart;
|
||||||
#endif // EFI_ENGINE_SNIFFER
|
#endif // EFI_ENGINE_SNIFFER
|
||||||
|
|
||||||
void printSpiState(const engine_configuration_s *engineConfiguration) {
|
|
||||||
efiPrintf("spi 1=%s/2=%s/3=%s/4=%s",
|
|
||||||
boolToString(engineConfiguration->is_enabled_spi_1),
|
|
||||||
boolToString(engineConfiguration->is_enabled_spi_2),
|
|
||||||
boolToString(engineConfiguration->is_enabled_spi_3),
|
|
||||||
boolToString(engineConfiguration->is_enabled_spi_4));
|
|
||||||
}
|
|
||||||
|
|
||||||
static void printOutputs(const engine_configuration_s *engineConfiguration) {
|
|
||||||
efiPrintf("injectionPins: mode %s", getPin_output_mode_e(engineConfiguration->injectionPinMode));
|
|
||||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
|
||||||
brain_pin_e brainPin = engineConfiguration->injectionPins[i];
|
|
||||||
efiPrintf("injection #%d @ %s", (1 + i), hwPortname(brainPin));
|
|
||||||
}
|
|
||||||
|
|
||||||
efiPrintf("ignitionPins: mode %s", getPin_output_mode_e(engineConfiguration->ignitionPinMode));
|
|
||||||
for (size_t i = 0; i < engineConfiguration->specs.cylindersCount; i++) {
|
|
||||||
brain_pin_e brainPin = engineConfiguration->ignitionPins[i];
|
|
||||||
efiPrintf("ignition #%d @ %s", (1 + i), hwPortname(brainPin));
|
|
||||||
}
|
|
||||||
|
|
||||||
efiPrintf("idlePin: mode %s @ %s freq=%d", getPin_output_mode_e(engineConfiguration->idle.solenoidPinMode),
|
|
||||||
hwPortname(engineConfiguration->idle.solenoidPin), engineConfiguration->idle.solenoidFrequency);
|
|
||||||
efiPrintf("malfunctionIndicator: %s mode=%s", hwPortname(engineConfiguration->malfunctionIndicatorPin),
|
|
||||||
getPin_output_mode_e(engineConfiguration->malfunctionIndicatorPinMode));
|
|
||||||
|
|
||||||
efiPrintf("fuelPumpPin: mode %s @ %s", getPin_output_mode_e(engineConfiguration->fuelPumpPinMode),
|
|
||||||
hwPortname(engineConfiguration->fuelPumpPin));
|
|
||||||
|
|
||||||
efiPrintf("fanPin: mode %s @ %s", getPin_output_mode_e(engineConfiguration->fanPinMode),
|
|
||||||
hwPortname(engineConfiguration->fanPin));
|
|
||||||
|
|
||||||
efiPrintf("mainRelay: mode %s @ %s", getPin_output_mode_e(engineConfiguration->mainRelayPinMode),
|
|
||||||
hwPortname(engineConfiguration->mainRelayPin));
|
|
||||||
|
|
||||||
efiPrintf("starterRelay: mode %s @ %s", getPin_output_mode_e(engineConfiguration->starterRelayDisablePinMode),
|
|
||||||
hwPortname(engineConfiguration->starterRelayDisablePin));
|
|
||||||
|
|
||||||
efiPrintf("alternator field: mode %s @ %s",
|
|
||||||
getPin_output_mode_e(engineConfiguration->alternatorControlPinMode),
|
|
||||||
hwPortname(engineConfiguration->alternatorControlPin));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Prints current engine configuration to human-readable console.
|
|
||||||
*/
|
|
||||||
void printConfiguration(const engine_configuration_s *engineConfiguration) {
|
|
||||||
|
|
||||||
efiPrintf("Template %s/%d trigger %s/%s/%d", getEngine_type_e(engineConfiguration->engineType),
|
|
||||||
engineConfiguration->engineType, getTrigger_type_e(engineConfiguration->trigger.type),
|
|
||||||
getEngine_load_mode_e(engineConfiguration->fuelAlgorithm), engineConfiguration->fuelAlgorithm);
|
|
||||||
|
|
||||||
|
|
||||||
efiPrintf("configurationVersion=%d", engine->getGlobalConfigurationVersion());
|
|
||||||
|
|
||||||
efiPrintf("rpmHardLimit: %d/operationMode=%d", engineConfiguration->rpmHardLimit,
|
|
||||||
getEngineRotationState()->getOperationMode());
|
|
||||||
|
|
||||||
efiPrintf("globalTriggerAngleOffset=%.2f", engineConfiguration->globalTriggerAngleOffset);
|
|
||||||
|
|
||||||
efiPrintf("=== cranking ===");
|
|
||||||
efiPrintf("crankingRpm: %d", engineConfiguration->cranking.rpm);
|
|
||||||
efiPrintf("cranking injection %s", getInjection_mode_e(engineConfiguration->crankingInjectionMode));
|
|
||||||
|
|
||||||
efiPrintf("cranking timing %.2f", engineConfiguration->crankingTimingAngle);
|
|
||||||
|
|
||||||
efiPrintf("=== ignition ===");
|
|
||||||
|
|
||||||
efiPrintf("ignitionMode: %s/enabled=%s", getIgnition_mode_e(engineConfiguration->ignitionMode),
|
|
||||||
boolToString(engineConfiguration->isIgnitionEnabled));
|
|
||||||
efiPrintf("timingMode: %s", getTiming_mode_e(engineConfiguration->timingMode));
|
|
||||||
if (engineConfiguration->timingMode == TM_FIXED) {
|
|
||||||
efiPrintf("fixedModeTiming: %d", (int) engineConfiguration->fixedModeTiming);
|
|
||||||
}
|
|
||||||
|
|
||||||
efiPrintf("=== injection ===");
|
|
||||||
efiPrintf("injection %s enabled=%s", getInjection_mode_e(engineConfiguration->injectionMode),
|
|
||||||
boolToString(engineConfiguration->isInjectionEnabled));
|
|
||||||
|
|
||||||
printOutputs(engineConfiguration);
|
|
||||||
|
|
||||||
efiPrintf("map_avg=%s/wa=%s",
|
|
||||||
boolToString(engineConfiguration->isMapAveragingEnabled),
|
|
||||||
boolToString(engineConfiguration->isWaveAnalyzerEnabled));
|
|
||||||
|
|
||||||
efiPrintf("isManualSpinningMode=%s/isCylinderCleanupEnabled=%s",
|
|
||||||
boolToString(engineConfiguration->isManualSpinningMode),
|
|
||||||
boolToString(engineConfiguration->isCylinderCleanupEnabled));
|
|
||||||
|
|
||||||
efiPrintf("clutchUp@%s: %s", hwPortname(engineConfiguration->clutchUpPin),
|
|
||||||
boolToString(engine->engineState.clutchUpState));
|
|
||||||
efiPrintf("clutchDown@%s: %s", hwPortname(engineConfiguration->clutchDownPin),
|
|
||||||
boolToString(engine->engineState.clutchDownState));
|
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
|
||||||
printSpiState(engineConfiguration);
|
|
||||||
#endif // EFI_PROD_CODE
|
|
||||||
}
|
|
||||||
|
|
||||||
static void doPrintConfiguration() {
|
|
||||||
printConfiguration(engineConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setFixedModeTiming(int value) {
|
|
||||||
engineConfiguration->fixedModeTiming = value;
|
|
||||||
doPrintConfiguration();
|
|
||||||
incrementGlobalConfigurationVersion();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setTimingMode(int value) {
|
static void setTimingMode(int value) {
|
||||||
engineConfiguration->timingMode = (timing_mode_e) value;
|
engineConfiguration->timingMode = (timing_mode_e) value;
|
||||||
doPrintConfiguration();
|
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -161,71 +49,12 @@ static void setIdleSolenoidFrequency(int value) {
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setInjectionPinMode(int value) {
|
|
||||||
engineConfiguration->injectionPinMode = (pin_output_mode_e) value;
|
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setIgnitionPinMode(int value) {
|
|
||||||
engineConfiguration->ignitionPinMode = (pin_output_mode_e) value;
|
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setIdlePinMode(int value) {
|
|
||||||
engineConfiguration->idle.solenoidPinMode = (pin_output_mode_e) value;
|
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setFuelPumpPinMode(int value) {
|
|
||||||
engineConfiguration->fuelPumpPinMode = (pin_output_mode_e) value;
|
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setMalfunctionIndicatorPinMode(int value) {
|
|
||||||
engineConfiguration->malfunctionIndicatorPinMode = (pin_output_mode_e) value;
|
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setSensorChartMode(int value) {
|
static void setSensorChartMode(int value) {
|
||||||
engineConfiguration->sensorChartMode = (sensor_chart_e) value;
|
engineConfiguration->sensorChartMode = (sensor_chart_e) value;
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void printTpsSenser(const char *msg, SensorType sensor, int16_t min, int16_t max, adc_channel_e channel) {
|
|
||||||
auto tps = Sensor::get(sensor);
|
|
||||||
auto raw = Sensor::getRaw(sensor);
|
|
||||||
|
|
||||||
if (!tps.Valid) {
|
|
||||||
efiPrintf("TPS not valid");
|
|
||||||
}
|
|
||||||
|
|
||||||
char pinNameBuffer[16];
|
|
||||||
|
|
||||||
efiPrintf("tps min (closed) %d/max (full) %d v=%.2f @%s", min, max,
|
|
||||||
raw, getPinNameByAdcChannel(msg, channel, pinNameBuffer));
|
|
||||||
|
|
||||||
|
|
||||||
efiPrintf("current 10bit=%d value=%.2f", convertVoltageTo10bitADC(raw), tps.value_or(0));
|
|
||||||
}
|
|
||||||
|
|
||||||
void printTPSInfo(void) {
|
|
||||||
efiPrintf("pedal up %f / down %f",
|
|
||||||
engineConfiguration->throttlePedalUpVoltage,
|
|
||||||
engineConfiguration->throttlePedalWOTVoltage);
|
|
||||||
|
|
||||||
auto pps = Sensor::get(SensorType::AcceleratorPedal);
|
|
||||||
|
|
||||||
if (!pps.Valid) {
|
|
||||||
efiPrintf("PPS not valid");
|
|
||||||
}
|
|
||||||
|
|
||||||
printTpsSenser("TPS", SensorType::Tps1, engineConfiguration->tpsMin, engineConfiguration->tpsMax, engineConfiguration->tps1_1AdcChannel);
|
|
||||||
printTpsSenser("TPS2", SensorType::Tps2, engineConfiguration->tps2Min, engineConfiguration->tps2Max, engineConfiguration->tps2_1AdcChannel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setCrankingRpm(int value) {
|
static void setCrankingRpm(int value) {
|
||||||
engineConfiguration->cranking.rpm = value;
|
engineConfiguration->cranking.rpm = value;
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -233,17 +62,14 @@ static void setCrankingRpm(int value) {
|
||||||
*/
|
*/
|
||||||
static void setAlgorithmInt(int value) {
|
static void setAlgorithmInt(int value) {
|
||||||
setAlgorithm((engine_load_mode_e) value);
|
setAlgorithm((engine_load_mode_e) value);
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setFiringOrder(int value) {
|
static void setFiringOrder(int value) {
|
||||||
engineConfiguration->specs.firingOrder = (firing_order_e) value;
|
engineConfiguration->specs.firingOrder = (firing_order_e) value;
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setRpmHardLimit(int value) {
|
static void setRpmHardLimit(int value) {
|
||||||
engineConfiguration->rpmHardLimit = value;
|
engineConfiguration->rpmHardLimit = value;
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setCrankingIACExtra(float percent) {
|
static void setCrankingIACExtra(float percent) {
|
||||||
|
@ -263,32 +89,22 @@ static void setGlobalTriggerAngleOffset(float value) {
|
||||||
}
|
}
|
||||||
engineConfiguration->globalTriggerAngleOffset = value;
|
engineConfiguration->globalTriggerAngleOffset = value;
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setCrankingTimingAngle(float value) {
|
static void setCrankingTimingAngle(float value) {
|
||||||
engineConfiguration->crankingTimingAngle = value;
|
engineConfiguration->crankingTimingAngle = value;
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setCrankingInjectionMode(int value) {
|
|
||||||
engineConfiguration->crankingInjectionMode = (injection_mode_e) value;
|
|
||||||
incrementGlobalConfigurationVersion();
|
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setInjectionMode(int value) {
|
static void setInjectionMode(int value) {
|
||||||
engineConfiguration->injectionMode = (injection_mode_e) value;
|
engineConfiguration->injectionMode = (injection_mode_e) value;
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setIgnitionMode(int value) {
|
static void setIgnitionMode(int value) {
|
||||||
engineConfiguration->ignitionMode = (ignition_mode_e) value;
|
engineConfiguration->ignitionMode = (ignition_mode_e) value;
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
prepareOutputSignals();
|
prepareOutputSignals();
|
||||||
doPrintConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setOneCoilIgnition() {
|
static void setOneCoilIgnition() {
|
||||||
|
@ -306,7 +122,6 @@ static void setIndividualCoilsIgnition() {
|
||||||
static void setTriggerType(int value) {
|
static void setTriggerType(int value) {
|
||||||
engineConfiguration->trigger.type = (trigger_type_e) value;
|
engineConfiguration->trigger.type = (trigger_type_e) value;
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
doPrintConfiguration();
|
|
||||||
efiPrintf("Do you need to also invoke set operation_mode X?");
|
efiPrintf("Do you need to also invoke set operation_mode X?");
|
||||||
engine->resetEngineSnifferIfInTestMode();
|
engine->resetEngineSnifferIfInTestMode();
|
||||||
}
|
}
|
||||||
|
@ -315,17 +130,6 @@ static void setDebugMode(int value) {
|
||||||
engineConfiguration->debugMode = (debug_mode_e) value;
|
engineConfiguration->debugMode = (debug_mode_e) value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void setInjectorLag(float voltage, float value) {
|
|
||||||
setCurveValue(INJECTOR_LAG_CURVE, voltage, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setGlobalFuelCorrection(float value) {
|
|
||||||
if (value < 0.01 || value > 50)
|
|
||||||
return;
|
|
||||||
efiPrintf("setting fuel mult=%.2f", value);
|
|
||||||
engineConfiguration->globalFuelCorrection = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setFanSetting(float onTempC, float offTempC) {
|
static void setFanSetting(float onTempC, float offTempC) {
|
||||||
if (onTempC <= offTempC) {
|
if (onTempC <= offTempC) {
|
||||||
efiPrintf("ON temp [%.2f] should be above OFF temp [%.2f]", onTempC, offTempC);
|
efiPrintf("ON temp [%.2f] should be above OFF temp [%.2f]", onTempC, offTempC);
|
||||||
|
@ -615,24 +419,6 @@ static void showPinFunction(const char *pinName) {
|
||||||
|
|
||||||
#endif // EFI_PROD_CODE
|
#endif // EFI_PROD_CODE
|
||||||
|
|
||||||
static void setSpiMode(int index, bool mode) {
|
|
||||||
switch (index) {
|
|
||||||
case 1:
|
|
||||||
engineConfiguration->is_enabled_spi_1 = mode;
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
engineConfiguration->is_enabled_spi_2 = mode;
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
engineConfiguration->is_enabled_spi_3 = mode;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
efiPrintf("invalid spi index %d", index);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
printSpiState(engineConfiguration);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void enableOrDisable(const char *param, bool isEnabled) {
|
static void enableOrDisable(const char *param, bool isEnabled) {
|
||||||
if (strEqualCaseInsensitive(param, "useTLE8888_cranking_hack")) {
|
if (strEqualCaseInsensitive(param, "useTLE8888_cranking_hack")) {
|
||||||
engineConfiguration->useTLE8888_cranking_hack = isEnabled;
|
engineConfiguration->useTLE8888_cranking_hack = isEnabled;
|
||||||
|
@ -743,14 +529,6 @@ static void disable(const char *param) {
|
||||||
enableOrDisable(param, false);
|
enableOrDisable(param, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void enableSpi(int index) {
|
|
||||||
setSpiMode(index, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void disableSpi(int index) {
|
|
||||||
setSpiMode(index, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* See 'LimpManager::isEngineStop' for code which actually stops engine
|
* See 'LimpManager::isEngineStop' for code which actually stops engine
|
||||||
*/
|
*/
|
||||||
|
@ -759,7 +537,6 @@ void scheduleStopEngine(void) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getValue(const char *paramStr) {
|
static void getValue(const char *paramStr) {
|
||||||
|
|
||||||
{
|
{
|
||||||
float value = getConfigValueByName(paramStr);
|
float value = getConfigValueByName(paramStr);
|
||||||
if (value != EFI_ERROR_CODE) {
|
if (value != EFI_ERROR_CODE) {
|
||||||
|
@ -768,25 +545,7 @@ static void getValue(const char *paramStr) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strEqualCaseInsensitive(paramStr, "tps_min")) {
|
if (strEqualCaseInsensitive(paramStr, CMD_DATE)) {
|
||||||
efiPrintf("tps_min=%d", engineConfiguration->tpsMin);
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "tps_max")) {
|
|
||||||
efiPrintf("tps_max=%d", engineConfiguration->tpsMax);
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "global_trigger_offset_angle")) {
|
|
||||||
efiPrintf("global_trigger_offset=%.2f", engineConfiguration->globalTriggerAngleOffset);
|
|
||||||
#if EFI_SHAFT_POSITION_INPUT
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "trigger_hw_input")) {
|
|
||||||
efiPrintf("trigger_hw_input=%s", boolToString(getTriggerCentral()->hwTriggerInputEnabled));
|
|
||||||
#endif // EFI_SHAFT_POSITION_INPUT
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "is_enabled_spi_1")) {
|
|
||||||
efiPrintf("is_enabled_spi_1=%s", boolToString(engineConfiguration->is_enabled_spi_1));
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "is_enabled_spi_2")) {
|
|
||||||
efiPrintf("is_enabled_spi_2=%s", boolToString(engineConfiguration->is_enabled_spi_2));
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "is_enabled_spi_3")) {
|
|
||||||
efiPrintf("is_enabled_spi_3=%s", boolToString(engineConfiguration->is_enabled_spi_3));
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "invertCamVVTSignal")) {
|
|
||||||
efiPrintf("invertCamVVTSignal=%s", boolToString(engineConfiguration->invertCamVVTSignal));
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, CMD_DATE)) {
|
|
||||||
printDateTime();
|
printDateTime();
|
||||||
} else {
|
} else {
|
||||||
efiPrintf("Invalid Parameter: %s", paramStr);
|
efiPrintf("Invalid Parameter: %s", paramStr);
|
||||||
|
@ -814,7 +573,6 @@ struct command_f_s {
|
||||||
const command_f_s commandsF[] = {
|
const command_f_s commandsF[] = {
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
{"global_trigger_offset_angle", setGlobalTriggerAngleOffset},
|
{"global_trigger_offset_angle", setGlobalTriggerAngleOffset},
|
||||||
{"global_fuel_correction", setGlobalFuelCorrection},
|
|
||||||
{"cranking_fuel", setCrankingFuel},
|
{"cranking_fuel", setCrankingFuel},
|
||||||
{"cranking_iac", setCrankingIACExtra},
|
{"cranking_iac", setCrankingIACExtra},
|
||||||
{"cranking_timing_angle", setCrankingTimingAngle},
|
{"cranking_timing_angle", setCrankingTimingAngle},
|
||||||
|
@ -825,63 +583,29 @@ const command_f_s commandsF[] = {
|
||||||
#endif // EFI_ENGINE_CONTROL
|
#endif // EFI_ENGINE_CONTROL
|
||||||
{"script_curve_1_value", setScriptCurve1Value},
|
{"script_curve_1_value", setScriptCurve1Value},
|
||||||
{"script_curve_2_value", setScriptCurve2Value},
|
{"script_curve_2_value", setScriptCurve2Value},
|
||||||
#if EFI_PROD_CODE
|
|
||||||
#if EFI_IDLE_CONTROL
|
|
||||||
{"idle_p", setIdlePFactor},
|
|
||||||
{"idle_i", setIdleIFactor},
|
|
||||||
{"idle_d", setIdleDFactor},
|
|
||||||
#endif // EFI_IDLE_CONTROL
|
|
||||||
#endif // EFI_PROD_CODE
|
|
||||||
|
|
||||||
#if EFI_ELECTRONIC_THROTTLE_BODY
|
#if EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
{"etb_p", setEtbPFactor},
|
|
||||||
{"etb_i", setEtbIFactor},
|
|
||||||
{"etb_d", setEtbDFactor},
|
|
||||||
{"etb", setThrottleDutyCycle},
|
{"etb", setThrottleDutyCycle},
|
||||||
#endif // EFI_ELECTRONIC_THROTTLE_BODY
|
#endif // EFI_ELECTRONIC_THROTTLE_BODY
|
||||||
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void setTpsErrorDetectionTooLow(int v) {
|
|
||||||
engineConfiguration->tpsErrorDetectionTooLow = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void setTpsErrorDetectionTooHigh(int v) {
|
|
||||||
engineConfiguration->tpsErrorDetectionTooHigh = v;
|
|
||||||
}
|
|
||||||
|
|
||||||
const command_i_s commandsI[] = {{"ignition_mode", setIgnitionMode},
|
const command_i_s commandsI[] = {{"ignition_mode", setIgnitionMode},
|
||||||
#if EFI_ENGINE_CONTROL
|
#if EFI_ENGINE_CONTROL
|
||||||
{"cranking_rpm", setCrankingRpm},
|
{"cranking_rpm", setCrankingRpm},
|
||||||
{"cranking_injection_mode", setCrankingInjectionMode},
|
|
||||||
{"injection_mode", setInjectionMode},
|
{"injection_mode", setInjectionMode},
|
||||||
{"sensor_chart_mode", setSensorChartMode},
|
{"sensor_chart_mode", setSensorChartMode},
|
||||||
{"tpsErrorDetectionTooLow", setTpsErrorDetectionTooLow},
|
|
||||||
{"tpsErrorDetectionTooHigh", setTpsErrorDetectionTooHigh},
|
|
||||||
{"fixed_mode_timing", setFixedModeTiming},
|
|
||||||
{"timing_mode", setTimingMode},
|
{"timing_mode", setTimingMode},
|
||||||
{CMD_ENGINE_TYPE, setEngineType},
|
{CMD_ENGINE_TYPE, setEngineType},
|
||||||
{"rpm_hard_limit", setRpmHardLimit},
|
{"rpm_hard_limit", setRpmHardLimit},
|
||||||
{"firing_order", setFiringOrder},
|
{"firing_order", setFiringOrder},
|
||||||
{"algorithm", setAlgorithmInt},
|
{"algorithm", setAlgorithmInt},
|
||||||
{"injection_pin_mode", setInjectionPinMode},
|
|
||||||
{"ignition_pin_mode", setIgnitionPinMode},
|
|
||||||
{"idle_pin_mode", setIdlePinMode},
|
|
||||||
{"fuel_pump_pin_mode", setFuelPumpPinMode},
|
|
||||||
{"malfunction_indicator_pin_mode", setMalfunctionIndicatorPinMode},
|
|
||||||
{"debug_mode", setDebugMode},
|
{"debug_mode", setDebugMode},
|
||||||
{"trigger_type", setTriggerType},
|
{"trigger_type", setTriggerType},
|
||||||
{"idle_solenoid_freq", setIdleSolenoidFrequency},
|
{"idle_solenoid_freq", setIdleSolenoidFrequency},
|
||||||
{"tps_accel_len", setTpsAccelLen},
|
{"tps_accel_len", setTpsAccelLen},
|
||||||
#endif // EFI_ENGINE_CONTROL
|
#endif // EFI_ENGINE_CONTROL
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
{"bor", setBor},
|
|
||||||
#if EFI_CAN_SUPPORT
|
#if EFI_CAN_SUPPORT
|
||||||
{"can_mode", setCanType},
|
{"can_mode", setCanType},
|
||||||
{"can_vss", setCanVss},
|
{"can_vss", setCanVss},
|
||||||
|
@ -892,15 +616,6 @@ const command_i_s commandsI[] = {{"ignition_mode", setIgnitionMode},
|
||||||
#endif // EFI_IDLE_CONTROL
|
#endif // EFI_IDLE_CONTROL
|
||||||
#endif // EFI_PROD_CODE
|
#endif // EFI_PROD_CODE
|
||||||
|
|
||||||
#if EFI_ELECTRONIC_THROTTLE_BODY
|
|
||||||
{"etb_o", setEtbOffset},
|
|
||||||
#endif // EFI_ELECTRONIC_THROTTLE_BODY
|
|
||||||
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
// {"", },
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void setValue(const char *paramStr, const char *valueStr) {
|
static void setValue(const char *paramStr, const char *valueStr) {
|
||||||
|
@ -930,11 +645,8 @@ static void setValue(const char *paramStr, const char *valueStr) {
|
||||||
if (valueI > 10) {
|
if (valueI > 10) {
|
||||||
engineConfiguration->alternatorControl.periodMs = valueI;
|
engineConfiguration->alternatorControl.periodMs = valueI;
|
||||||
}
|
}
|
||||||
showAltInfo();
|
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "alt_offset")) {
|
} else if (strEqualCaseInsensitive(paramStr, "alt_offset")) {
|
||||||
engineConfiguration->alternatorControl.offset = valueI;
|
engineConfiguration->alternatorControl.offset = valueI;
|
||||||
} else if (strEqualCaseInsensitive(paramStr, "alt_p")) {
|
|
||||||
setAltPFactor(valueF);
|
|
||||||
} else
|
} else
|
||||||
#endif // EFI_ALTERNATOR_CONTROL
|
#endif // EFI_ALTERNATOR_CONTROL
|
||||||
if (strEqualCaseInsensitive(paramStr, "warning_period")) {
|
if (strEqualCaseInsensitive(paramStr, "warning_period")) {
|
||||||
|
@ -988,10 +700,6 @@ void initSettings(void) {
|
||||||
printf("initSettings\n");
|
printf("initSettings\n");
|
||||||
#endif // EFI_SIMULATOR
|
#endif // EFI_SIMULATOR
|
||||||
|
|
||||||
// todo: start saving values into flash right away?
|
|
||||||
|
|
||||||
addConsoleAction("showconfig", doPrintConfiguration);
|
|
||||||
addConsoleAction("tpsinfo", printTPSInfo);
|
|
||||||
addConsoleAction("calibrate_tps_1_closed", grabTPSIsClosed);
|
addConsoleAction("calibrate_tps_1_closed", grabTPSIsClosed);
|
||||||
addConsoleAction("calibrate_tps_1_wot", grabTPSIsWideOpen);
|
addConsoleAction("calibrate_tps_1_wot", grabTPSIsWideOpen);
|
||||||
|
|
||||||
|
@ -1006,15 +714,9 @@ void initSettings(void) {
|
||||||
|
|
||||||
addConsoleAction("stopengine", (Void) scheduleStopEngine);
|
addConsoleAction("stopengine", (Void) scheduleStopEngine);
|
||||||
|
|
||||||
// todo: refactor this - looks like all boolean flags should be controlled with less code duplication
|
|
||||||
addConsoleActionI("enable_spi", enableSpi);
|
|
||||||
addConsoleActionI("disable_spi", disableSpi);
|
|
||||||
|
|
||||||
addConsoleActionS(CMD_ENABLE, enable);
|
addConsoleActionS(CMD_ENABLE, enable);
|
||||||
addConsoleActionS(CMD_DISABLE, disable);
|
addConsoleActionS(CMD_DISABLE, disable);
|
||||||
|
|
||||||
addConsoleActionFF("set_injector_lag", setInjectorLag);
|
|
||||||
|
|
||||||
addConsoleActionFF("set_fan", setFanSetting);
|
addConsoleActionFF("set_fan", setFanSetting);
|
||||||
|
|
||||||
addConsoleActionSS("set", setValue);
|
addConsoleActionSS("set", setValue);
|
||||||
|
@ -1110,6 +812,5 @@ void setEngineType(int value) {
|
||||||
}
|
}
|
||||||
incrementGlobalConfigurationVersion();
|
incrementGlobalConfigurationVersion();
|
||||||
#if ! EFI_UNIT_TEST
|
#if ! EFI_UNIT_TEST
|
||||||
doPrintConfiguration();
|
|
||||||
#endif // ! EFI_UNIT_TEST
|
#endif // ! EFI_UNIT_TEST
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,9 @@
|
||||||
#include "engine_configuration_generated_structures.h"
|
#include "engine_configuration_generated_structures.h"
|
||||||
|
|
||||||
void initSettings(void);
|
void initSettings(void);
|
||||||
void printSpiState(const engine_configuration_s *engineConfiguration);
|
|
||||||
void printConfiguration(const engine_configuration_s *engineConfiguration);
|
void printConfiguration(const engine_configuration_s *engineConfiguration);
|
||||||
void scheduleStopEngine(void);
|
void scheduleStopEngine(void);
|
||||||
|
|
||||||
void printTPSInfo(void);
|
|
||||||
void setEngineType(int value);
|
void setEngineType(int value);
|
||||||
void readPin(const char *pinName);
|
void readPin(const char *pinName);
|
||||||
|
|
||||||
|
|
|
@ -342,13 +342,6 @@ void applyNewHardwareSettings() {
|
||||||
adcConfigListener(engine);
|
adcConfigListener(engine);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if EFI_PROD_CODE
|
|
||||||
void setBor(int borValue) {
|
|
||||||
efiPrintf("setting BOR to %d", borValue);
|
|
||||||
BOR_Set((BOR_Level_t)borValue);
|
|
||||||
}
|
|
||||||
#endif /* EFI_PROD_CODE */
|
|
||||||
|
|
||||||
// This function initializes hardware that can do so before configuration is loaded
|
// This function initializes hardware that can do so before configuration is loaded
|
||||||
void initHardwareNoConfig() {
|
void initHardwareNoConfig() {
|
||||||
efiAssertVoid(CUSTOM_IH_STACK, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "init h");
|
efiAssertVoid(CUSTOM_IH_STACK, getCurrentRemainingStack() > EXPECTED_REMAINING_STACK, "init h");
|
||||||
|
|
|
@ -58,8 +58,6 @@ void initHardware();
|
||||||
|
|
||||||
#endif /* EFI_PROD_CODE */
|
#endif /* EFI_PROD_CODE */
|
||||||
|
|
||||||
void setBor(int borValue);
|
|
||||||
|
|
||||||
class ButtonDebounce;
|
class ButtonDebounce;
|
||||||
|
|
||||||
#endif /* __cplusplus */
|
#endif /* __cplusplus */
|
||||||
|
|
|
@ -31,8 +31,6 @@ static SPIConfig spiConfig[EGT_CHANNEL_COUNT];
|
||||||
|
|
||||||
static void showEgtInfo() {
|
static void showEgtInfo() {
|
||||||
#if EFI_PROD_CODE
|
#if EFI_PROD_CODE
|
||||||
printSpiState(engineConfiguration);
|
|
||||||
|
|
||||||
efiPrintf("EGT spi: %d", engineConfiguration->max31855spiDevice);
|
efiPrintf("EGT spi: %d", engineConfiguration->max31855spiDevice);
|
||||||
|
|
||||||
for (int i = 0; i < EGT_CHANNEL_COUNT; i++) {
|
for (int i = 0; i < EGT_CHANNEL_COUNT; i++) {
|
||||||
|
|
|
@ -437,7 +437,7 @@ uint16_t engineSnifferRpmThreshold;Engine sniffer would be disabled above this r
|
||||||
|
|
||||||
struct injector_s
|
struct injector_s
|
||||||
float flow;This is your injector flow at the fuel pressure used in the vehicle. cc/min, cubic centimetre per minute\nBy the way, g/s = 0.125997881 * (lb/hr)\ng/s = 0.125997881 * (cc/min)/10.5\ng/s = 0.0119997981 * cc/min;"cm3/min", 1, 0, 0, 99999, 2
|
float flow;This is your injector flow at the fuel pressure used in the vehicle. cc/min, cubic centimetre per minute\nBy the way, g/s = 0.125997881 * (lb/hr)\ng/s = 0.125997881 * (cc/min)/10.5\ng/s = 0.0119997981 * cc/min;"cm3/min", 1, 0, 0, 99999, 2
|
||||||
float[VBAT_INJECTOR_CURVE_SIZE] battLagCorrBins;set_flat_injector_lag LAG\nset_injector_lag VOLTAGE LAG;"volts", 1, 0, 0, 20, 2
|
float[VBAT_INJECTOR_CURVE_SIZE] battLagCorrBins;;"volts", 1, 0, 0, 20, 2
|
||||||
float[VBAT_INJECTOR_CURVE_SIZE] battLagCorr;ms delay between injector open and close dead times;"ms", 1, 0, 0, 50, 2
|
float[VBAT_INJECTOR_CURVE_SIZE] battLagCorr;ms delay between injector open and close dead times;"ms", 1, 0, 0, 50, 2
|
||||||
end_struct
|
end_struct
|
||||||
|
|
||||||
|
@ -588,7 +588,7 @@ custom spi_device_e 1 bits, U08, @OFFSET@, [0:2], "Off", "SPI1", "SPI2", "SPI3",
|
||||||
uint8_t boostControlSafeDutyCycle;Duty cycle to use in case of a sensor failure. This duty cycle should produce the minimum possible amount of boost. This duty is also used in case any of the minimum RPM/TPS/MAP conditions are not met.;"%", 1, 0, 0, 100, 0
|
uint8_t boostControlSafeDutyCycle;Duty cycle to use in case of a sensor failure. This duty cycle should produce the minimum possible amount of boost. This duty is also used in case any of the minimum RPM/TPS/MAP conditions are not met.;"%", 1, 0, 0, 100, 0
|
||||||
adc_channel_e mafAdcChannel
|
adc_channel_e mafAdcChannel
|
||||||
|
|
||||||
float globalFuelCorrection;set global_fuel_correction X;"coef", 1, 0, 0, 1000, 2
|
float globalFuelCorrection;;"coef", 1, 0, 0, 1000, 2
|
||||||
|
|
||||||
float adcVcc;;"volts", 1, 0, 0, 6, 3
|
float adcVcc;;"volts", 1, 0, 0, 6, 3
|
||||||
float mapCamDetectionAnglePosition;;"Deg", 1, 0, 0, 360, 0
|
float mapCamDetectionAnglePosition;;"Deg", 1, 0, 0, 360, 0
|
||||||
|
|
|
@ -34,14 +34,10 @@ public class RecentCommands {
|
||||||
private static final String KEY = "recent_commands";
|
private static final String KEY = "recent_commands";
|
||||||
private static final String DELIMETER = "|";
|
private static final String DELIMETER = "|";
|
||||||
private static final String STOPENGINE = "stopengine";
|
private static final String STOPENGINE = "stopengine";
|
||||||
private static final String SHOWCONFIG = "showconfig";
|
|
||||||
private static final String HELP = "help";
|
private static final String HELP = "help";
|
||||||
private static final String SENSORINFO = "sensorinfo";
|
private static final String SENSORINFO = "sensorinfo";
|
||||||
private static final String IDLEINFO = "idleinfo";
|
private static final String IDLEINFO = "idleinfo";
|
||||||
private static final String ALTINFO = "altinfo";
|
|
||||||
private static final String TPSINFO = "tpsinfo";
|
|
||||||
private static final String MAPINFO = "mapinfo";
|
private static final String MAPINFO = "mapinfo";
|
||||||
private static final String ACCELINFO = "accelinfo";
|
|
||||||
private static final String CANINFO = "caninfo";
|
private static final String CANINFO = "caninfo";
|
||||||
private static final String TSINFO = "tsinfo";
|
private static final String TSINFO = "tsinfo";
|
||||||
private static final String SPEEDINFO = "speedinfo";
|
private static final String SPEEDINFO = "speedinfo";
|
||||||
|
@ -56,15 +52,11 @@ public class RecentCommands {
|
||||||
static {
|
static {
|
||||||
COMMAND_ICONS.put(STOPENGINE, AutoupdateUtil.loadIcon("stop.jpg"));
|
COMMAND_ICONS.put(STOPENGINE, AutoupdateUtil.loadIcon("stop.jpg"));
|
||||||
ImageIcon infoIcon = AutoupdateUtil.loadIcon("info.png");
|
ImageIcon infoIcon = AutoupdateUtil.loadIcon("info.png");
|
||||||
COMMAND_ICONS.put(SHOWCONFIG, infoIcon);
|
|
||||||
COMMAND_ICONS.put(HELP, AutoupdateUtil.loadIcon("help.jpg"));
|
COMMAND_ICONS.put(HELP, AutoupdateUtil.loadIcon("help.jpg"));
|
||||||
COMMAND_ICONS.put(SENSORINFO, infoIcon);
|
COMMAND_ICONS.put(SENSORINFO, infoIcon);
|
||||||
COMMAND_ICONS.put(CMD_TRIGGERINFO, AutoupdateUtil.loadIcon("trigger.jpg"));
|
COMMAND_ICONS.put(CMD_TRIGGERINFO, AutoupdateUtil.loadIcon("trigger.jpg"));
|
||||||
COMMAND_ICONS.put(IDLEINFO, infoIcon);
|
COMMAND_ICONS.put(IDLEINFO, infoIcon);
|
||||||
COMMAND_ICONS.put(ALTINFO, AutoupdateUtil.loadIcon("alternator.jpg"));
|
|
||||||
COMMAND_ICONS.put(ACCELINFO, infoIcon);
|
|
||||||
COMMAND_ICONS.put(TSINFO, infoIcon);
|
COMMAND_ICONS.put(TSINFO, infoIcon);
|
||||||
COMMAND_ICONS.put(TPSINFO, infoIcon);
|
|
||||||
COMMAND_ICONS.put(MAPINFO, infoIcon);
|
COMMAND_ICONS.put(MAPINFO, infoIcon);
|
||||||
COMMAND_ICONS.put(CANINFO, infoIcon);
|
COMMAND_ICONS.put(CANINFO, infoIcon);
|
||||||
COMMAND_ICONS.put(FUELINFO, infoIcon);
|
COMMAND_ICONS.put(FUELINFO, infoIcon);
|
||||||
|
@ -115,7 +107,6 @@ public class RecentCommands {
|
||||||
|
|
||||||
private void addDefaults() {
|
private void addDefaults() {
|
||||||
add(HELP);
|
add(HELP);
|
||||||
add(SHOWCONFIG);
|
|
||||||
add(STOPENGINE);
|
add(STOPENGINE);
|
||||||
add(SENSORINFO);
|
add(SENSORINFO);
|
||||||
add(CMD_TRIGGERINFO);
|
add(CMD_TRIGGERINFO);
|
||||||
|
@ -139,10 +130,7 @@ public class RecentCommands {
|
||||||
add("sparkbench 5 400 2");
|
add("sparkbench 5 400 2");
|
||||||
add("fuelbench 5 400 2");
|
add("fuelbench 5 400 2");
|
||||||
add(IDLEINFO);
|
add(IDLEINFO);
|
||||||
add(ALTINFO);
|
|
||||||
add(TPSINFO);
|
|
||||||
add(MAPINFO);
|
add(MAPINFO);
|
||||||
add(ACCELINFO);
|
|
||||||
add(FUELINFO);
|
add(FUELINFO);
|
||||||
add(HIPINFO);
|
add(HIPINFO);
|
||||||
add(SDINFO);
|
add(SDINFO);
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 14 KiB |
Loading…
Reference in New Issue