From 320688d525899878881d34c588e66f3f37748612 Mon Sep 17 00:00:00 2001 From: gnssuser Date: Wed, 12 Nov 2025 13:57:02 +0100 Subject: [PATCH] printf for usart1 --- Core/Src/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Src/main.c b/Core/Src/main.c index 62d12fb..fc537e2 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -70,8 +70,8 @@ static void MX_USART1_UART_Init(void); /***************************************************************************//** * @brief Character send interface for printf function *//****************************************************************************/ -void uart_putc(void *p, char c) { - Usart6_PutByte(c); +void printf_putc(void *p, char c) { + Usart1_PutByte(c); } /* USER CODE END 0 */ @@ -113,8 +113,8 @@ int main(void) { Usart2_Init(); Usart6_Init(); Usart1_Init(); - init_printf(NULL, &uart_putc);// connect printf to UART - printf("Hello world. This is a Nucleo UART and printf sample with IRQ and ring buffer.\n"); + init_printf(NULL, &printf_putc); + printf("Nucleo UART with IRQ and ring buffer\n"); /* USER CODE END 2 */ /* Infinite loop */