ugly copy-paste
This commit is contained in:
parent
ae1bd9c55d
commit
69a232e12d
|
@ -80,10 +80,17 @@ static void runCommands() {
|
||||||
// if the baud rate is changed, reinit the UART
|
// if the baud rate is changed, reinit the UART
|
||||||
if (baudIdx != prevBaudIdx || restoreAndExit) {
|
if (baudIdx != prevBaudIdx || restoreAndExit) {
|
||||||
#if EFI_USB_SERIAL
|
#if EFI_USB_SERIAL
|
||||||
extern SerialConfig serialConfig;
|
|
||||||
// if we have USB we assume BT operates on primary TTL
|
// if we have USB we assume BT operates on primary TTL
|
||||||
// todo: we need to clean a lot in this area :(
|
// todo: we need to clean a lot in this area :(
|
||||||
|
#ifdef EFI_CONSOLE_SERIAL_DEVICE
|
||||||
|
extern SerialConfig serialConfig;
|
||||||
sdStop(EFI_CONSOLE_SERIAL_DEVICE);
|
sdStop(EFI_CONSOLE_SERIAL_DEVICE);
|
||||||
|
#endif /* EFI_CONSOLE_SERIAL_DEVICE */
|
||||||
|
#ifdef EFI_CONSOLE_UART_DEVICE
|
||||||
|
extern UARTConfig uartConfig;
|
||||||
|
uartStop(EFI_CONSOLE_UART_DEVICE);
|
||||||
|
#endif /* EFI_CONSOLE_UART_DEVICE */
|
||||||
|
|
||||||
#else
|
#else
|
||||||
// deinit UART
|
// deinit UART
|
||||||
if (!stopTsPort(tsChannel)) {
|
if (!stopTsPort(tsChannel)) {
|
||||||
|
@ -96,8 +103,14 @@ static void runCommands() {
|
||||||
CONFIG(tunerStudioSerialSpeed) = restoreAndExit ? savedSerialSpeed : baudRates[baudIdx];
|
CONFIG(tunerStudioSerialSpeed) = restoreAndExit ? savedSerialSpeed : baudRates[baudIdx];
|
||||||
|
|
||||||
#if EFI_USB_SERIAL
|
#if EFI_USB_SERIAL
|
||||||
|
#ifdef EFI_CONSOLE_SERIAL_DEVICE
|
||||||
serialConfig.speed = CONFIG(tunerStudioSerialSpeed);
|
serialConfig.speed = CONFIG(tunerStudioSerialSpeed);
|
||||||
sdStart(EFI_CONSOLE_SERIAL_DEVICE, &serialConfig);
|
sdStart(EFI_CONSOLE_SERIAL_DEVICE, &serialConfig);
|
||||||
|
#endif /* EFI_CONSOLE_SERIAL_DEVICE */
|
||||||
|
#ifdef EFI_CONSOLE_UART_DEVICE
|
||||||
|
uartConfig.speed = CONFIG(tunerStudioSerialSpeed);
|
||||||
|
uartStart(EFI_CONSOLE_UART_DEVICE, &uartConfig);
|
||||||
|
#endif /* EFI_CONSOLE_UART_DEVICE */
|
||||||
#else
|
#else
|
||||||
// init UART
|
// init UART
|
||||||
startTsPort(tsChannel);
|
startTsPort(tsChannel);
|
||||||
|
|
|
@ -136,7 +136,7 @@ SerialConfig serialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
|
||||||
|
|
||||||
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR )
|
#if (defined(EFI_CONSOLE_UART_DEVICE) && ! EFI_SIMULATOR )
|
||||||
/* Note: This structure is modified from the default ChibiOS layout! */
|
/* Note: This structure is modified from the default ChibiOS layout! */
|
||||||
static UARTConfig uartConfig = {
|
UARTConfig uartConfig = {
|
||||||
.txend1_cb = NULL, .txend2_cb = NULL, .rxend_cb = NULL, .rxchar_cb = NULL, .rxerr_cb = NULL,
|
.txend1_cb = NULL, .txend2_cb = NULL, .rxend_cb = NULL, .rxchar_cb = NULL, .rxerr_cb = NULL,
|
||||||
.speed = 0, .cr1 = 0, .cr2 = 0/*USART_CR2_STOP1_BITS*/ | USART_CR2_LINEN, .cr3 = 0,
|
.speed = 0, .cr1 = 0, .cr2 = 0/*USART_CR2_STOP1_BITS*/ | USART_CR2_LINEN, .cr3 = 0,
|
||||||
.timeout_cb = NULL, .rxhalf_cb = NULL
|
.timeout_cb = NULL, .rxhalf_cb = NULL
|
||||||
|
|
Loading…
Reference in New Issue