feat: usart retarget

This commit is contained in:
2025-03-20 02:35:29 +08:00
parent f515d5fa96
commit 05dc5e3f53
5 changed files with 180 additions and 33 deletions

22
Core/Inc/retarget.h Normal file
View File

@ -0,0 +1,22 @@
#ifndef _RETARGET_H__
#define _RETARGET_H__
#include "stm32f1xx_hal.h"
#include <sys/stat.h>
#include <stdio.h>
void RetargetInit(UART_HandleTypeDef *huart);
int _isatty(int fd);
int _write(int fd, char *ptr, int len);
int _close(int fd);
int _lseek(int fd, int ptr, int dir);
int _read(int fd, char *ptr, int len);
int _fstat(int fd, struct stat *st);
#endif //#ifndef _RETARGET_H__