/* 常用STM32调试打印命令源程序*/
/* putchar */
#ifdef __GNUC__
/* With GCC/RAISONANCE, small printf (option LD Linker->Libraries->Small printf
set to 'Yes') calls __io_putchar() */
#define PUTCHAR_PROTOTYPE int __io_putchar(int ch)
#else
#define PUTCHAR_PROTOTYPE int fputc(int ch, FILE *f)
#endif /* __GNUC__ */
/*1. STM32串口调试 STM32UartImpl.c*/
--------------------------------
#include <./Interface/UartIntf.h>
#include <STM32Impl.h>
#include <string.h>
#include <Debug.h>
static UART_HandleTypeDef* puartdebug = NULL;
void Stm32SendString(const char* str)
{
if(puartdebug == NULL)return;
HAL_UART_Transmit(puartdebug,(uint8_t*)str,strlen(str),1000);
}
VATAPI_RESULT UartOpenDebugPort(void* puart,