improve pin error messages (#1252)
* improve error msg * emulator pin names too Co-authored-by: Matthew Kennedy <makenne@microsoft.com>
This commit is contained in:
parent
57d6d05335
commit
0ca63356c0
|
@ -37,8 +37,6 @@ void onConfigurationChangeRpmEmulatorCallback(engine_configuration_s *previousCo
|
|||
}
|
||||
|
||||
void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX) {
|
||||
|
||||
|
||||
#if EFI_EMULATE_POSITION_SENSORS
|
||||
print("Emulating %s\r\n", getConfigurationName(engineConfiguration->engineType));
|
||||
|
||||
|
@ -48,13 +46,13 @@ void initTriggerEmulator(Logging *sharedLogger DECLARE_ENGINE_PARAMETER_SUFFIX)
|
|||
|
||||
#if EFI_PROD_CODE
|
||||
// todo: refactor, make this a loop
|
||||
triggerSignal.outputPins[0]->initPin("trg emulator ch1", CONFIG(triggerSimulatorPins)[0],
|
||||
triggerSignal.outputPins[0]->initPin("Trigger emulator 1", CONFIG(triggerSimulatorPins)[0],
|
||||
&CONFIG(triggerSimulatorPinModes)[0]);
|
||||
|
||||
triggerSignal.outputPins[1]->initPin("trg emulator ch2", CONFIG(triggerSimulatorPins)[1],
|
||||
triggerSignal.outputPins[1]->initPin("Trigger emulator 2", CONFIG(triggerSimulatorPins)[1],
|
||||
&CONFIG(triggerSimulatorPinModes)[1]);
|
||||
|
||||
triggerSignal.outputPins[2]->initPin("trg emulator ch3", CONFIG(triggerSimulatorPins)[2],
|
||||
triggerSignal.outputPins[2]->initPin("Trigger emulator 3", CONFIG(triggerSimulatorPins)[2],
|
||||
&CONFIG(triggerSimulatorPinModes)[2]);
|
||||
#endif /* EFI_PROD_CODE */
|
||||
|
||||
|
|
|
@ -231,7 +231,7 @@ bool brain_pin_markUsed(brain_pin_e brainPin, const char *msg) {
|
|||
* connected, so the warning is never displayed on the console and that's quite a problem!
|
||||
*/
|
||||
// warning(OBD_PCM_Processor_Fault, "brain pin %d req by %s used by %s", brainPin, msg, getBrainUsedPin(index));
|
||||
firmwareError(CUSTOM_ERR_PIN_ALREADY_USED_1, "Pin \"%s\" required by %s but is used by %s", hwPortname(brainPin), msg, getBrainUsedPin(index));
|
||||
firmwareError(CUSTOM_ERR_PIN_ALREADY_USED_1, "Pin \"%s\" required by \"%s\" but is used by \"%s\"", hwPortname(brainPin), msg, getBrainUsedPin(index));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -139,14 +139,14 @@ void stopTriggerInputPins(void) {
|
|||
void startTriggerInputPins(void) {
|
||||
for (int i = 0; i < TRIGGER_SUPPORTED_CHANNELS; i++) {
|
||||
if (isConfigurationChanged(triggerInputPins[i])) {
|
||||
const char * msg = (i == 0 ? "trigger#1" : (i == 1 ? "trigger#2" : "trigger#3"));
|
||||
const char * msg = (i == 0 ? "Trigger #1" : (i == 1 ? "Trigger #2" : "Trigger #3"));
|
||||
turnOnTriggerInputPin(msg, i, true);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < CAM_INPUTS_COUNT; i++) {
|
||||
if (isConfigurationChanged(camInputs[i])) {
|
||||
turnOnTriggerInputPin("cam", i, false);
|
||||
turnOnTriggerInputPin("Cam", i, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ int icuTriggerTurnOnInputPin(const char *msg, int index, bool isTriggerShaft) {
|
|||
return -1;
|
||||
}
|
||||
|
||||
digital_input_s* input = startDigitalCapture("trigger", brainPin);
|
||||
digital_input_s* input = startDigitalCapture(msg, brainPin);
|
||||
if (input == NULL) {
|
||||
/* error already reported */
|
||||
return -1;
|
||||
|
@ -108,7 +108,6 @@ int icuTriggerTurnOnInputPin(const char *msg, int index, bool isTriggerShaft) {
|
|||
}
|
||||
|
||||
void icuTriggerTurnOffInputPin(brain_pin_e brainPin) {
|
||||
|
||||
stopDigitalCapture("trigger", brainPin);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue