UART pins validation and dynamic alternative function recognition #3536

This commit is contained in:
Andrey 2021-11-11 21:29:18 -05:00
parent 2765d386b9
commit 78fdd5b9a9
2 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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();