diff --git a/src/platforms/common/stm32/traceswoasync.c b/src/platforms/common/stm32/traceswoasync.c index d4c019c24ae..7d234321e30 100644 --- a/src/platforms/common/stm32/traceswoasync.c +++ b/src/platforms/common/stm32/traceswoasync.c @@ -91,6 +91,11 @@ void trace_buf_drain(usbd_device *dev, uint8_t ep) atomic_flag_clear_explicit(&reentry_flag, memory_order_relaxed); } +uint32_t traceswo_get_baudrate(void) +{ + return usart_get_baudrate(SWO_UART); +} + void traceswo_setspeed(uint32_t baudrate) { dma_disable_channel(SWO_DMA_BUS, SWO_DMA_CHAN); diff --git a/src/platforms/common/stm32/traceswoasync_f723.c b/src/platforms/common/stm32/traceswoasync_f723.c index 1a0ecc476b7..7806ed57d71 100644 --- a/src/platforms/common/stm32/traceswoasync_f723.c +++ b/src/platforms/common/stm32/traceswoasync_f723.c @@ -75,6 +75,11 @@ void trace_buf_drain(usbd_device *dev, uint8_t ep) atomic_flag_clear_explicit(&reentry_flag, memory_order_relaxed); } +uint32_t traceswo_get_baudrate(void) +{ + return usart_get_baudrate(SWO_UART); +} + void traceswo_setspeed(uint32_t baudrate) { dma_disable_stream(SWO_DMA_BUS, SWO_DMA_STREAM); diff --git a/src/platforms/common/tm4c/traceswo.c b/src/platforms/common/tm4c/traceswo.c index 5128a34dd3d..c7a2c8d300d 100644 --- a/src/platforms/common/tm4c/traceswo.c +++ b/src/platforms/common/tm4c/traceswo.c @@ -87,6 +87,11 @@ void traceswo_baud(unsigned int baud) uart_set_databits(TRACEUART, 8); } +uint32_t traceswo_get_baudrate(void) +{ + return uart_get_baudrate(TRACEUART); +} + #define FIFO_SIZE 256U /* RX Fifo buffer */ diff --git a/src/platforms/common/traceswo.h b/src/platforms/common/traceswo.h index f1f62f53104..3ebae849772 100644 --- a/src/platforms/common/traceswo.h +++ b/src/platforms/common/traceswo.h @@ -28,6 +28,7 @@ #define SWO_DEFAULT_BAUD 2250000U void traceswo_init(uint32_t baudrate, uint32_t swo_chan_bitmask); void traceswo_deinit(void); +uint32_t traceswo_get_baudrate(void); #else void traceswo_init(uint32_t swo_chan_bitmask); #endif