UART pins validation and dynamic alternative function recognition #3536
This commit is contained in:
parent
2765d386b9
commit
78fdd5b9a9
|
@ -379,9 +379,11 @@
|
|||
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOC_11
|
||||
#endif
|
||||
// todo: this should be detected automatically based on pin selection
|
||||
// https://github.com/rusefi/rusefi/issues/3536
|
||||
#define EFI_CONSOLE_AF 7
|
||||
|
||||
// todo: this should be detected automatically based on pin selection
|
||||
// https://github.com/rusefi/rusefi/issues/3536
|
||||
#define TS_SERIAL_AF 7
|
||||
|
||||
#ifndef LED_CRITICAL_ERROR_BRAIN_PIN
|
||||
|
|
|
@ -72,11 +72,15 @@ void initAuxSerial(void) {
|
|||
return;
|
||||
|
||||
// Validate pins
|
||||
if (isSerialTXEnabled && !isValidSerialTxPin(CONFIG(auxSerialTxPin)))
|
||||
if (isSerialTXEnabled && !isValidSerialTxPin(CONFIG(auxSerialTxPin))) {
|
||||
firmwareError(OBD_PCM_Processor_Fault, "unexpected aux TX pin");
|
||||
return;
|
||||
}
|
||||
|
||||
if (isSerialRXEnabled && !isValidSerialRxPin(CONFIG(auxSerialRxPin)))
|
||||
if (isSerialRXEnabled && !isValidSerialRxPin(CONFIG(auxSerialRxPin))) {
|
||||
firmwareError(OBD_PCM_Processor_Fault, "unexpected aux RX pin");
|
||||
return;
|
||||
}
|
||||
|
||||
startAuxSerialPins();
|
||||
|
||||
|
|
Loading…
Reference in New Issue