refactoring: using brain_pin like the rest of the code
This commit is contained in:
parent
96ceae7d17
commit
b9733c5901
|
@ -296,10 +296,8 @@
|
|||
#undef EFI_CONSOLE_SERIAL_DEVICE
|
||||
#define EFI_CONSOLE_UART_DEVICE (&UARTD1)
|
||||
|
||||
#define EFI_CONSOLE_TX_PORT GPIOA
|
||||
#define EFI_CONSOLE_TX_PIN 10
|
||||
#define EFI_CONSOLE_RX_PORT GPIOA
|
||||
#define EFI_CONSOLE_RX_PIN 11
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN GPIOA_10
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOA_11
|
||||
#define EFI_CONSOLE_AF 3
|
||||
|
||||
#define TS_SERIAL_AF 2
|
||||
|
|
|
@ -68,14 +68,12 @@
|
|||
#endif
|
||||
|
||||
|
||||
#undef EFI_CONSOLE_TX_PORT
|
||||
#define EFI_CONSOLE_TX_PORT GPIOA
|
||||
#undef EFI_CONSOLE_TX_PIN
|
||||
#define EFI_CONSOLE_TX_PIN 0
|
||||
#undef EFI_CONSOLE_RX_PORT
|
||||
#define EFI_CONSOLE_RX_PORT GPIOA
|
||||
#undef EFI_CONSOLE_RX_PIN
|
||||
#define EFI_CONSOLE_RX_PIN 1
|
||||
#undef EFI_CONSOLE_TX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN GPIOA_0
|
||||
|
||||
#undef EFI_CONSOLE_RX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOA_1
|
||||
|
||||
#undef EFI_CONSOLE_AF
|
||||
#define EFI_CONSOLE_AF 8
|
||||
|
||||
|
|
|
@ -372,10 +372,8 @@
|
|||
// todo: start using consoleSerial{Tx,Rx}Pin
|
||||
#define EFI_CONSOLE_AF 7
|
||||
#define TS_SERIAL_AF 7
|
||||
#define EFI_CONSOLE_TX_PORT GPIOC
|
||||
#define EFI_CONSOLE_TX_PIN 10
|
||||
#define EFI_CONSOLE_RX_PORT GPIOC
|
||||
#define EFI_CONSOLE_RX_PIN 11
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN GPIOC_10
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOC_11
|
||||
|
||||
// todo: document the limitations of DMA mode for the UART.
|
||||
#undef TS_UART_DMA_MODE
|
||||
|
|
|
@ -57,14 +57,12 @@
|
|||
#define SERIAL_SPEED 115200
|
||||
|
||||
#ifdef EFI_CONSOLE_SERIAL_DEVICE
|
||||
#undef EFI_CONSOLE_TX_PORT
|
||||
#define EFI_CONSOLE_TX_PORT GPIOA
|
||||
#undef EFI_CONSOLE_TX_PIN
|
||||
#define EFI_CONSOLE_TX_PIN 9
|
||||
#undef EFI_CONSOLE_RX_PORT
|
||||
#define EFI_CONSOLE_RX_PORT GPIOA
|
||||
#undef EFI_CONSOLE_RX_PIN
|
||||
#define EFI_CONSOLE_RX_PIN 10
|
||||
#undef EFI_CONSOLE_TX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN GPIOA_9
|
||||
|
||||
#undef EFI_CONSOLE_RX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOA_10
|
||||
|
||||
#undef EFI_CONSOLE_AF
|
||||
#define EFI_CONSOLE_AF 7
|
||||
#endif
|
||||
|
|
|
@ -349,18 +349,12 @@
|
|||
#endif
|
||||
|
||||
// todo: start using consoleSerialTxPin? Not sure
|
||||
#ifndef EFI_CONSOLE_TX_PORT
|
||||
#define EFI_CONSOLE_TX_PORT GPIOC
|
||||
#endif
|
||||
#ifndef EFI_CONSOLE_TX_PIN
|
||||
#define EFI_CONSOLE_TX_PIN 10
|
||||
#ifndef EFI_CONSOLE_TX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN GPIOC_10
|
||||
#endif
|
||||
// todo: start using consoleSerialRxPin? Not sure
|
||||
#ifndef EFI_CONSOLE_RX_PORT
|
||||
#define EFI_CONSOLE_RX_PORT GPIOC
|
||||
#endif
|
||||
#ifndef EFI_CONSOLE_RX_PIN
|
||||
#define EFI_CONSOLE_RX_PIN 11
|
||||
#ifndef EFI_CONSOLE_RX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOC_11
|
||||
#endif
|
||||
// todo: this should be detected automatically based on pin selection
|
||||
#define EFI_CONSOLE_AF 7
|
||||
|
|
|
@ -95,15 +95,12 @@
|
|||
#endif
|
||||
|
||||
// todo: start using consoleSerialTxPin? Not sure
|
||||
#undef EFI_CONSOLE_TX_PORT
|
||||
#define EFI_CONSOLE_TX_PORT GPIOD
|
||||
#undef EFI_CONSOLE_TX_PIN
|
||||
#define EFI_CONSOLE_TX_PIN 8
|
||||
#undef EFI_CONSOLE_TX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_TX_BRAIN_PIN GPIOD_8
|
||||
|
||||
// todo: start using consoleSerialRxPin? Not sure
|
||||
#undef EFI_CONSOLE_RX_PORT
|
||||
#define EFI_CONSOLE_RX_PORT GPIOD
|
||||
#undef EFI_CONSOLE_RX_PIN
|
||||
#define EFI_CONSOLE_RX_PIN 9
|
||||
#undef EFI_CONSOLE_RX_BRAIN_PIN
|
||||
#define EFI_CONSOLE_RX_BRAIN_PIN GPIOD_9
|
||||
|
||||
// todo: temporary ignore errors, this is a test config
|
||||
#define EFI_PRINT_ERRORS_AS_WARNINGS TRUE
|
||||
|
|
|
@ -269,8 +269,8 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p)
|
|||
sdStart(EFI_CONSOLE_SERIAL_DEVICE, &serialConfig);
|
||||
|
||||
// cannot use pin repository here because pin repository prints to console
|
||||
palSetPadMode(EFI_CONSOLE_RX_PORT, EFI_CONSOLE_RX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
palSetPadMode(EFI_CONSOLE_TX_PORT, EFI_CONSOLE_TX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
palSetPadMode(getHwPort("console", EFI_CONSOLE_RX_BRAIN_PIN), getHwPin("console", EFI_CONSOLE_RX_BRAIN_PIN), PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
palSetPadMode(getHwPort("console", EFI_CONSOLE_TX_BRAIN_PIN), getHwPin("console", EFI_CONSOLE_TX_BRAIN_PIN), PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
|
||||
isSerialConsoleStarted = true;
|
||||
|
||||
|
@ -280,8 +280,8 @@ void startConsole(Logging *sharedLogger, CommandHandler console_line_callback_p)
|
|||
uartStart(EFI_CONSOLE_UART_DEVICE, &uartConfig);
|
||||
|
||||
// cannot use pin repository here because pin repository prints to console
|
||||
palSetPadMode(EFI_CONSOLE_RX_PORT, EFI_CONSOLE_RX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
palSetPadMode(EFI_CONSOLE_TX_PORT, EFI_CONSOLE_TX_PIN, PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
palSetPadMode(getHwPort("console", EFI_CONSOLE_RX_BRAIN_PIN), getHwPin("console", EFI_CONSOLE_RX_BRAIN_PIN), PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
palSetPadMode(getHwPort("console", EFI_CONSOLE_TX_BRAIN_PIN), getHwPin("console", EFI_CONSOLE_TX_BRAIN_PIN), PAL_MODE_ALTERNATE(EFI_CONSOLE_AF));
|
||||
|
||||
isSerialConsoleStarted = true;
|
||||
#endif /* EFI_CONSOLE_SERIAL_DEVICE || EFI_CONSOLE_UART_DEVICE */
|
||||
|
|
Loading…
Reference in New Issue