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 include $(BOARDS_DIR)/hellen/hellen-common144.mk
# serial ports only on F4 DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)
ifeq ($(PROJECT_CPU),ARCH_STM32F4)
DDEFS += $(PRIMARY_COMMUNICATION_PORT_USART2)
endif
ifeq ($(PROJECT_CPU),ARCH_STM32F7) ifeq ($(PROJECT_CPU),ARCH_STM32F7)
DDEFS += -DSHORT_BOARD_NAME=alphax-4chan-f7 DDEFS += -DSHORT_BOARD_NAME=alphax-4chan-f7

View File

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