Friendlier pin names (#1233)

* enable TS error readout

* friendlier text for common errors

* improve comment

* friendlier ADC errors

* ign/inj names

* more pin names
This commit is contained in:
Matthew Kennedy 2020-03-29 16:07:07 -07:00 committed by GitHub
parent 8fd9842310
commit d541e04a7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 34 additions and 36 deletions

View File

@ -579,7 +579,7 @@ static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPi
static void initStatusLeds(void) {
enginePins.communicationLedPin.initPin("led: comm status", engineConfiguration->communicationLedPin);
// we initialize this here so that we can blink it on start-up
enginePins.checkEnginePin.initPin("MalfunctionIndicator", CONFIG(malfunctionIndicatorPin), &CONFIG(malfunctionIndicatorPinMode));
enginePins.checkEnginePin.initPin("Check engine light", CONFIG(malfunctionIndicatorPin), &CONFIG(malfunctionIndicatorPinMode));
enginePins.warningLedPin.initPin("led: warning status", engineConfiguration->warningLedPin);
enginePins.runningLedPin.initPin("led: running status", engineConfiguration->runningLedPin);

View File

@ -162,8 +162,7 @@ void initAlternatorCtrl(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
return;
if (CONFIG(onOffAlternatorLogic)) {
enginePins.alternatorPin.initPin("on/off alternator", CONFIG(alternatorControlPin));
enginePins.alternatorPin.initPin("Alternator control", CONFIG(alternatorControlPin));
} else {
startSimplePwmExt(&alternatorControl,
"Alternator control",

View File

@ -45,7 +45,7 @@ void initTachometer(void) {
return;
}
enginePins.tachOut.initPin("analog tach output", CONFIG(tachOutputPin), &CONFIG(tachOutputPinMode));
enginePins.tachOut.initPin("Tachometer", CONFIG(tachOutputPin), &CONFIG(tachOutputPinMode));
#if EFI_SHAFT_POSITION_INPUT
addTriggerEventListener(tachSignalCallback, "tach", engine);

View File

@ -34,15 +34,15 @@ static Logging* logger;
pin_output_mode_e DEFAULT_OUTPUT = OM_DEFAULT;
static const char *sparkNames[] = { "coil1", "coil2", "coil3", "coil4", "coil5", "coil6", "coil7", "coil8",
"coil9", "coil10", "coil11", "coil12"};
static const char *sparkNames[] = { "Coil 1", "Coil 2", "Coil 3", "Coil 4", "Coil 5", "Coil 6", "Coil 7", "Coil 8",
"Coil 9", "Coil 10", "Coil 11", "Coil 12"};
// these short names are part of engine sniffer protocol
static const char *sparkShortNames[] = { PROTOCOL_COIL1_SHORT_NAME, "c2", "c3", "c4", "c5", "c6", "c7", "c8",
"c9", "cA", "cB", "cD"};
static const char *injectorNames[] = { "injector1", "injector2", "injector3", "injector4", "injector5", "injector6",
"injector7", "injector8", "injector9", "injector10", "injector11", "injector12"};
static const char *injectorNames[] = { "Injector 1", "Injector 2", "Injector 3", "Injector 4", "Injector 5", "Injector 6",
"Injector 7", "Injector 8", "Injector 9", "Injector 10", "Injector 11", "Injector 12"};
static const char *injectorShortNames[] = { PROTOCOL_INJ1_SHORT_NAME, "i2", "i3", "i4", "i5", "i6", "i7", "i8",
"j9", "iA", "iB", "iC"};
@ -60,7 +60,7 @@ EnginePins::EnginePins() {
}
static_assert(efi::size(injectorNames) >= INJECTION_PIN_COUNT, "Too many injection pins");
for (int i = 0; i < INJECTION_PIN_COUNT;i++) {
for (int i = 0; i < INJECTION_PIN_COUNT;i++) {
enginePins.injectors[i].injectorIndex = i;
enginePins.injectors[i].name = injectorNames[i];
enginePins.injectors[i].shortName = injectorShortNames[i];
@ -202,7 +202,7 @@ void EnginePins::startIgnitionPins(void) {
}
}
if (isPinOrModeChanged(dizzySparkOutputPin, dizzySparkOutputPinMode)) {
enginePins.dizzyOutput.initPin("dizzy tach", engineConfiguration->dizzySparkOutputPin,
enginePins.dizzyOutput.initPin("Distributor", engineConfiguration->dizzySparkOutputPin,
&engineConfiguration->dizzySparkOutputPinMode);
}
@ -376,18 +376,18 @@ void initOutputPins(DECLARE_ENGINE_PARAMETER_SIGNATURE) {
// memset(&outputs, 0, sizeof(outputs));
#if HAL_USE_SPI
enginePins.sdCsPin.initPin("spi CS5", CONFIG(sdCardCsPin));
enginePins.sdCsPin.initPin("SD CS", CONFIG(sdCardCsPin));
#endif /* HAL_USE_SPI */
// todo: should we move this code closer to the fuel pump logic?
enginePins.fuelPumpRelay.initPin("fuel pump relay", CONFIG(fuelPumpPin), &CONFIG(fuelPumpPinMode));
enginePins.fuelPumpRelay.initPin("Fuel pump", CONFIG(fuelPumpPin), &CONFIG(fuelPumpPinMode));
enginePins.mainRelay.initPin("main relay", CONFIG(mainRelayPin), &CONFIG(mainRelayPinMode));
enginePins.starterRelayDisable.initPin("starter disable", CONFIG(starterRelayDisablePin), &CONFIG(starterRelayDisableMode));
enginePins.starterControl.initPin("starter control", CONFIG(starterControlPin));
enginePins.mainRelay.initPin("Main relay", CONFIG(mainRelayPin), &CONFIG(mainRelayPinMode));
enginePins.starterRelayDisable.initPin("Starter disable", CONFIG(starterRelayDisablePin), &CONFIG(starterRelayDisableMode));
enginePins.starterControl.initPin("Starter control", CONFIG(starterControlPin));
enginePins.fanRelay.initPin("fan relay", CONFIG(fanPin), &CONFIG(fanPinMode));
enginePins.o2heater.initPin("o2 heater", CONFIG(o2heaterPin));
enginePins.fanRelay.initPin("Fan", CONFIG(fanPin), &CONFIG(fanPinMode));
enginePins.o2heater.initPin("O2 heater", CONFIG(o2heaterPin));
enginePins.acRelay.initPin("A/C relay", CONFIG(acRelayPin), &CONFIG(acRelayPinMode));
// digit 1

View File

@ -498,32 +498,31 @@ static void configureInputs(void) {
*/
addChannel("MAP", engineConfiguration->map.sensor.hwChannel, ADC_FAST);
if (hasMafSensor()) {
addChannel("MAF", engineConfiguration->mafAdcChannel, ADC_FAST);
}
addChannel("hip", engineConfiguration->hipOutputChannel, ADC_FAST);
addChannel("MAF", engineConfiguration->mafAdcChannel, ADC_FAST);
addChannel("baro", engineConfiguration->baroSensor.hwChannel, ADC_SLOW);
addChannel("HIP9011", engineConfiguration->hipOutputChannel, ADC_FAST);
addChannel("TPS1_1", engineConfiguration->tps1_1AdcChannel, ADC_SLOW);
addChannel("TPS1_2", engineConfiguration->tps1_2AdcChannel, ADC_SLOW);
addChannel("TPS2_1", engineConfiguration->tps2_1AdcChannel, ADC_SLOW);
addChannel("TPS2_2", engineConfiguration->tps2_2AdcChannel, ADC_SLOW);
addChannel("Baro Press", engineConfiguration->baroSensor.hwChannel, ADC_SLOW);
addChannel("fuel", engineConfiguration->fuelLevelSensor, ADC_SLOW);
addChannel("pPS", engineConfiguration->throttlePedalPositionAdcChannel, ADC_SLOW);
addChannel("TPS 1 Primary", engineConfiguration->tps1_1AdcChannel, ADC_SLOW);
addChannel("TPS 1 Secondary", engineConfiguration->tps1_2AdcChannel, ADC_SLOW);
addChannel("TPS 2 Primary", engineConfiguration->tps2_1AdcChannel, ADC_SLOW);
addChannel("TPS 2 Secondary", engineConfiguration->tps2_2AdcChannel, ADC_SLOW);
addChannel("Fuel Level", engineConfiguration->fuelLevelSensor, ADC_SLOW);
addChannel("Acc Pedal", engineConfiguration->throttlePedalPositionAdcChannel, ADC_SLOW);
addChannel("VBatt", engineConfiguration->vbattAdcChannel, ADC_SLOW);
// not currently used addChannel("Vref", engineConfiguration->vRefAdcChannel, ADC_SLOW);
addChannel("CLT", engineConfiguration->clt.adcChannel, ADC_SLOW);
addChannel("IAT", engineConfiguration->iat.adcChannel, ADC_SLOW);
addChannel("AUXT#1", engineConfiguration->auxTempSensor1.adcChannel, ADC_SLOW);
addChannel("AUXT#2", engineConfiguration->auxTempSensor2.adcChannel, ADC_SLOW);
addChannel("AUX Temp 1", engineConfiguration->auxTempSensor1.adcChannel, ADC_SLOW);
addChannel("AUX Temp 2", engineConfiguration->auxTempSensor2.adcChannel, ADC_SLOW);
if (engineConfiguration->auxFastSensor1_adcChannel != INCOMPATIBLE_CONFIG_CHANGE) {
// allow EFI_ADC_0 next time we have an incompatible configuration change
addChannel("AUXF#1", engineConfiguration->auxFastSensor1_adcChannel, ADC_FAST);
}
addChannel("AFR", engineConfiguration->afr.hwChannel, ADC_SLOW);
addChannel("OilP", engineConfiguration->oilPressure.hwChannel, ADC_SLOW);
addChannel("Oil Pressure", engineConfiguration->oilPressure.hwChannel, ADC_SLOW);
addChannel("AC", engineConfiguration->acSwitchAdc, ADC_SLOW);
if (engineConfiguration->high_fuel_pressure_sensor_1 != INCOMPATIBLE_CONFIG_CHANGE) {
addChannel("HFP1", engineConfiguration->high_fuel_pressure_sensor_1, ADC_SLOW);
@ -533,8 +532,8 @@ static void configureInputs(void) {
}
if (CONFIG(isCJ125Enabled)) {
addChannel("cj125ur", engineConfiguration->cj125ur, ADC_SLOW);
addChannel("cj125ua", engineConfiguration->cj125ua, ADC_SLOW);
addChannel("CJ125 UR", engineConfiguration->cj125ur, ADC_SLOW);
addChannel("CJ125 UA", engineConfiguration->cj125ua, ADC_SLOW);
}
for (int i = 0; i < FSIO_ANALOG_INPUT_COUNT ; i++) {

View File

@ -174,13 +174,13 @@ void StepDirectionStepper::initialize(brain_pin_e stepPin, brain_pin_e direction
setReactionTime(reactionTime);
this->directionPinMode = directionPinMode;
this->directionPin.initPin("stepper dir", directionPin, &this->directionPinMode);
this->directionPin.initPin("Stepper DIR", directionPin, &this->directionPinMode);
this->stepPinMode = OM_DEFAULT; // todo: do we need configurable stepPinMode?
this->stepPin.initPin("stepper step", stepPin, &this->stepPinMode);
this->stepPin.initPin("Stepper step", stepPin, &this->stepPinMode);
this->enablePinMode = enablePinMode;
this->enablePin.initPin("stepper enable", enablePin, &this->enablePinMode);
this->enablePin.initPin("Stepper EN", enablePin, &this->enablePinMode);
// All pins must be 0 for correct hardware startup (e.g. stepper auto-disabling circuit etc.).
this->enablePin.setValue(true); // disable stepper