detect MCU flash size to config diff usart

This commit is contained in:
2025-08-21 00:39:30 +08:00
parent b6485c5c39
commit b78c1e416a
8 changed files with 138 additions and 13 deletions

View File

@@ -16,6 +16,7 @@
#include <unistd.h>
#include <sys/wait.h>
#include "gd32e23x_usart.h"
#include "board_config.h"
#undef errno
extern int errno;
@@ -164,7 +165,7 @@ int _execve(char *name, char **argv, char **env)
// USART0 printf重定向实现
int __io_putchar(int ch) {
// 等待发送缓冲区空
while (usart_flag_get(USART0, USART_FLAG_TBE) == RESET) {}
usart_data_transmit(USART0, (uint8_t)ch);
while (usart_flag_get(RS485_PHY, USART_FLAG_TBE) == RESET) {}
usart_data_transmit(RS485_PHY, (uint8_t)ch);
return ch;
}