helping F7 uart

This commit is contained in:
Andrey 2023-06-20 19:43:09 -05:00
parent d0b0e91d72
commit 05db8477e8
2 changed files with 6 additions and 4 deletions

View File

@ -18,10 +18,7 @@ DDEFS += -DDISABLE_PIN_STATE_VALIDATION=TRUE
include $(BOARDS_DIR)/hellen/hellen-common144.mk
# serial ports only on F4
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)
endif
DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)
ifeq ($(PROJECT_CPU),ARCH_STM32F7)
DDEFS += -DSHORT_BOARD_NAME=alphax-4chan-f7

View File

@ -46,11 +46,16 @@ void UartTsChannel::start(uint32_t baud) {
.rxchar_cb = NULL,
.rxerr_cb = NULL,
.timeout_cb = NULL,
#if defined(STM32F7XX)
.timeout = 0,
#endif
.speed = baud,
.cr1 = 0,
.cr2 = USART_CR2_STOP1_BITS | USART_CR2_LINEN,
.cr3 = 0,
#if defined(STM32F4XX)
.rxhalf_cb = NULL
#endif
};
uartStart(m_driver, &m_config);