printf for usart1

master
gnssuser 3 weeks ago
parent 9fcaab1916
commit 320688d525

@ -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 */

Loading…
Cancel
Save