This commit is contained in:
2025-08-11 20:59:22 +08:00
parent 4a488429bf
commit 1c3c688cc2
4 changed files with 8 additions and 39 deletions

View File

@@ -70,32 +70,3 @@ void rs485_init(void) {
#endif // RS485_MAX13487
}
// static uart_printf_port_t g_printf_port = UART_PRINTF_USART0;
// void uart_set_printf_port(uart_printf_port_t port) {
// g_printf_port = port;
// }
// // printf 重定向,支持多串口
// int __io_putchar(int ch) {
// switch (g_printf_port) {
// case UART_PRINTF_USART0:
// while (usart_flag_get(USART0, USART_FLAG_TBE) == RESET) {}
// usart_data_transmit(USART0, (uint8_t)ch);
// break;
// case UART_PRINTF_USART1:
// while (usart_flag_get(USART1, USART_FLAG_TBE) == RESET) {}
// usart_data_transmit(USART1, (uint8_t)ch);
// break;
// case UART_PRINTF_BOTH:
// while (usart_flag_get(USART0, USART_FLAG_TBE) == RESET) {}
// usart_data_transmit(USART0, (uint8_t)ch);
// while (usart_flag_get(USART1, USART_FLAG_TBE) == RESET) {}
// usart_data_transmit(USART1, (uint8_t)ch);
// break;
// default:
// break;
// }
// return ch;
// }