From e9eb764358b8fbbe0c9c84101df9fbafd6ad532f Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Thu, 16 May 2019 20:12:00 +0200 Subject: [PATCH] Fix MCK in usart, our MCK is 16*12/2/2 --- client/ui.c | 4 +++- common/usart.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client/ui.c b/client/ui.c index 91aaed35a..f233da60a 100644 --- a/client/ui.c +++ b/client/ui.c @@ -135,7 +135,9 @@ void PrintAndLogEx(logLevel_t level, const char *fmt, ...) { } else { snprintf(buffer2, sizeof(buffer2), "%s%s", prefix, buffer); if (level == INPLACE) { - fprintf(stream, "\r%s", buffer2); + char buffer3[MAX_PRINT_BUFFER + 20] = {0}; + memcpy_filter_ansi(buffer3, buffer2, sizeof(buffer2), !session.supports_colors); + fprintf(stream, "\r%s", buffer3); fflush(stream); } else { fPrintAndLog(stream, "%s", buffer2); diff --git a/common/usart.c b/common/usart.c index d7819d598..ecae58d0b 100644 --- a/common/usart.c +++ b/common/usart.c @@ -225,7 +225,7 @@ void usart_init(uint32_t baudrate, uint8_t parity) { // note that for very large baudrates, error is not neglectible: // b921600 => 8.6% // b1382400 => 8.6% - pUS1->US_BRGR = 48054841 / (usart_baudrate << 3); + pUS1->US_BRGR = 48000000 / (usart_baudrate << 3); // Write the Timeguard Register pUS1->US_TTGR = 0;