debug uart

This commit is contained in:
wmano
2025-09-02 22:09:40 +08:00
parent d633c6b55f
commit f6985d97c5
9 changed files with 105 additions and 45 deletions
+2 -2
View File
@@ -188,14 +188,14 @@ int main (void)
int fputc(int ch, FILE *f)
{
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xffff);
HAL_UART_Transmit(&huart2, (uint8_t *)&ch, 1, 0xffff);
return ch;
}
int fgetc(FILE * f)
{
uint8_t ch = 0;
HAL_UART_Receive(&huart1,&ch, 1, 0xffff);
HAL_UART_Receive(&huart2,&ch, 1, 0xffff);
return ch;
}