PORT_EXTRA_SERIAL_CR2

This commit is contained in:
Matthew Kennedy
2025-01-24 15:02:54 -08:00
parent 6594dc1179
commit 127e46116e
2 changed files with 11 additions and 3 deletions

View File

@@ -61,11 +61,15 @@ int SerialTsChannel::bt_disconnect(void)
return bt_wait_ok();
}
#ifndef PORT_EXTRA_SERIAL_CR2
#define PORT_EXTRA_SERIAL_CR2 0
#endif
int SerialTsChannel::start(uint32_t newBaud) {
SerialConfig cfg = {
.speed = newBaud,
.cr1 = 0,
.cr2 = USART_CR2_STOP1_BITS | USART_CR2_LINEN,
.cr2 = USART_CR2_STOP1_BITS | PORT_EXTRA_SERIAL_CR2,
.cr3 = 0
};
@@ -82,7 +86,7 @@ int SerialTsChannel::reStart() {
SerialConfig cfg = {
.speed = baud,
.cr1 = 0,
.cr2 = USART_CR2_STOP1_BITS | USART_CR2_LINEN,
.cr2 = USART_CR2_STOP1_BITS | PORT_EXTRA_SERIAL_CR2,
.cr3 = 0
};

View File

@@ -13,12 +13,16 @@
#include "tunerstudio_io.h"
#include "wideband_board_config.h"
#ifndef PORT_EXTRA_SERIAL_CR2
#define PORT_EXTRA_SERIAL_CR2 0
#endif
#ifdef DEBUG_SERIAL_PORT
SerialConfig cfg = {
.speed = DEBUG_SERIAL_BAUDRATE,
.cr1 = 0,
.cr2 = USART_CR2_STOP1_BITS,
.cr2 = USART_CR2_STOP1_BITS | PORT_EXTRA_SERIAL_CR2,
.cr3 = 0
};